[STATEMENT]
lemma GS_rec_fun_elem: "GS_rec_fun v s = (\<Squnion>a \<in> A s. GS_rec_elem v s a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_rec_fun v s = \<Squnion> (GS_rec_elem v s ` A s)
[PROOF STEP]
unfolding GS_rec_elem_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_rec_fun v s = (\<Squnion>a\<in>A s. r (s, a) + l * ((\<Sum>s'<s. pmf (K (s, a)) s' * GS_rec_fun v s') + (\<Sum>s'\<in>Collect ((\<le>) s). pmf (K (s, a)) s' * v s')))
[PROOF STEP]
using GS_rec_fun.simps
[PROOF STATE]
proof (prove)
using this:
GS_rec_fun ?v ?s = (\<Squnion>a\<in>A ?s. r (?s, a) + l * ((\<Sum>s'<?s. pmf (K (?s, a)) s' * GS_rec_fun ?v s') + (\<Sum>s'\<in>Collect ((\<le>) ?s). pmf (K (?s, a)) s' * ?v s')))

goal (1 subgoal):
 1. GS_rec_fun v s = (\<Squnion>a\<in>A s. r (s, a) + l * ((\<Sum>s'<s. pmf (K (s, a)) s' * GS_rec_fun v s') + (\<Sum>s'\<in>Collect ((\<le>) s). pmf (K (s, a)) s' * v s')))
[PROOF STEP]
by blast


[STATEMENT]
lemma mset_quicksort: "mset (quicksort xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (quicksort xs) = mset xs
[PROOF STEP]
apply (induction xs rule: quicksort.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mset (quicksort []) = mset []
 2. \<And>x xs. \<lbrakk>mset (quicksort (filter (\<lambda>y. y < x) xs)) = mset (filter (\<lambda>y. y < x) xs); mset (quicksort (filter ((\<le>) x) xs)) = mset (filter ((\<le>) x) xs)\<rbrakk> \<Longrightarrow> mset (quicksort (x # xs)) = mset (x # xs)
[PROOF STEP]
apply (auto simp: not_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_card_of_iff_card2:
assumes FIN: "finite A" and FIN': "finite B"
shows "( |A| \<le>o |B| ) = (card A \<le> card B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (|A| \<le>o |B|) = (card A \<le> card B)
[PROOF STEP]
using assms card_of_ordLeq[of A B] inj_on_iff_card_le[of A B]
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
(\<exists>f. inj_on f A \<and> f ` A \<subseteq> B) = (|A| \<le>o |B|)
\<lbrakk>finite A; finite B\<rbrakk> \<Longrightarrow> (\<exists>f. inj_on f A \<and> f ` A \<subseteq> B) = (card A \<le> card B)

goal (1 subgoal):
 1. (|A| \<le>o |B|) = (card A \<le> card B)
[PROOF STEP]
by blast


[STATEMENT]
lemma qk_uk_norm:
  "(1/(norm (column k ((Gram_Schmidt_matrix A))))) *\<^sub>R (column k ((Gram_Schmidt_matrix A)))
  = column k (fst(QR_decomposition A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) = column k (fst (QR_decomposition A))
[PROOF STEP]
unfolding QR_decomposition_def Let_def fst_conv divide_by_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) = column k (\<chi>a b. Projections.normalize (column b (Gram_Schmidt_matrix A)) $ a)
[PROOF STEP]
unfolding column_def normalize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / norm (\<chi>i. Gram_Schmidt_matrix A $ i $ k)) *\<^sub>R (\<chi>i. Gram_Schmidt_matrix A $ i $ k) = (\<chi>i. (\<chi>a b. ((1 / norm (\<chi>i. Gram_Schmidt_matrix A $ i $ b)) *\<^sub>R (\<chi>i. Gram_Schmidt_matrix A $ i $ b)) $ a) $ i $ k)
[PROOF STEP]
by vector


[STATEMENT]
lemma fst_echelon_form_of_det[code_unfold]:
  "(fst (echelon_form_of_det A bezout))
  = fst (echelon_form_of_det_iarrays (matrix_to_iarray A) bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_det A bezout) = fst (echelon_form_of_det_iarrays (matrix_to_iarray A) bezout)
[PROOF STEP]
unfolding echelon_form_of_det_def echelon_form_of_det_iarrays_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_upt_k_det bezout (1::'a, A) (ncols A - 1)) = fst (echelon_form_of_upt_k_det_iarrays (1::'a, matrix_to_iarray A) (ncols_iarray (matrix_to_iarray A) - 1) bezout)
[PROOF STEP]
unfolding matrix_to_iarray_ncols[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_upt_k_det bezout (1::'a, A) (ncols A - 1)) = fst (echelon_form_of_upt_k_det_iarrays (1::'a, matrix_to_iarray A) (ncols A - 1) bezout)
[PROOF STEP]
by (rule matrix_to_iarray_fst_echelon_form_of_upt_k_det, simp add: ncols_def)


[STATEMENT]
lemma orthogonal_iff_angle:
  shows "orthogonal (A - B) (C - B) \<longleftrightarrow> angle A B C = pi / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (A - B) (C - B) = (angle A B C = pi / 2)
[PROOF STEP]
unfolding angle_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (A - B) (C - B) = (vangle (A - B) (C - B) = pi / 2)
[PROOF STEP]
by (auto simp only: orthogonal_iff_vangle)


[STATEMENT]
lemma all_Suc_le_conv: "(\<forall>i\<le>Suc n. P i) \<longleftrightarrow> P 0 \<and> (\<forall>i\<le>n. P (Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<le>Suc n. P i) = (P 0 \<and> (\<forall>i\<le>n. P (Suc i)))
[PROOF STEP]
by (metis less_Suc_eq_0_disj nat_less_le order_refl)


[STATEMENT]
lemma allocationInverseRangeDomainProperty:
  assumes "a \<in> allAllocations N G"
  shows  "a^-1 \<in> injections (Range a) N &
          (Range a) partitions G &
          Domain a \<subseteq> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a\<inverse> \<in> injections (Range a) N \<and> Range a partitions G \<and> Domain a \<subseteq> N
[PROOF STEP]
unfolding injections_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a\<inverse> \<in> {R. Domain R = Range a \<and> Range R \<subseteq> N \<and> runiq R \<and> runiq (R\<inverse>)} \<and> Range a partitions G \<and> Domain a \<subseteq> N
[PROOF STEP]
using assms all_partitions_def injections_def
[PROOF STATE]
proof (prove)
using this:
a \<in> allAllocations N G
all_partitions ?A = {P. P partitions ?A}
injections ?X ?Y = {R. Domain R = ?X \<and> Range R \<subseteq> ?Y \<and> runiq R \<and> runiq (R\<inverse>)}

goal (1 subgoal):
 1. a\<inverse> \<in> {R. Domain R = Range a \<and> Range R \<subseteq> N \<and> runiq R \<and> runiq (R\<inverse>)} \<and> Range a partitions G \<and> Domain a \<subseteq> N
[PROOF STEP]
by fastforce


[STATEMENT]
lemma det_Gauss_Jordan[code_unfold]:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
shows "det (Gauss_Jordan A) = prod (\<lambda>i. (Gauss_Jordan A)$i$i) (UNIV:: 'n set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (Gauss_Jordan A) = (\<Prod>i\<in>UNIV. Gauss_Jordan A $ i $ i)
[PROOF STEP]
using det_upperdiagonal rref_imp_upper_triagular[OF rref_Gauss_Jordan[of A]]
[PROOF STATE]
proof (prove)
using this:
(\<And>i j. j < i \<Longrightarrow> ?A $ i $ j = (0::?'a)) \<Longrightarrow> det ?A = (\<Prod>i\<in>UNIV. ?A $ i $ i)
upper_triangular (Gauss_Jordan A)

goal (1 subgoal):
 1. det (Gauss_Jordan A) = (\<Prod>i\<in>UNIV. Gauss_Jordan A $ i $ i)
[PROOF STEP]
unfolding upper_triangular_def
[PROOF STATE]
proof (prove)
using this:
(\<And>i j. j < i \<Longrightarrow> ?A $ i $ j = (0::?'a)) \<Longrightarrow> det ?A = (\<Prod>i\<in>UNIV. ?A $ i $ i)
\<forall>i j. j < i \<longrightarrow> Gauss_Jordan A $ i $ j = (0::'a)

goal (1 subgoal):
 1. det (Gauss_Jordan A) = (\<Prod>i\<in>UNIV. Gauss_Jordan A $ i $ i)
[PROOF STEP]
by blast


[STATEMENT]
lemma frontier_of_eq_empty:
     "S \<subseteq> topspace X \<Longrightarrow> (X frontier_of S = {} \<longleftrightarrow> closedin X S \<and> openin X S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> topspace X \<Longrightarrow> (X frontier_of S = {}) = (closedin X S \<and> openin X S)
[PROOF STEP]
by (simp add: clopenin_eq_frontier_of)


[STATEMENT]
lemma bigo_real_nat_transfer:
  "(f :: real \<Rightarrow> real) \<in> O(g) \<Longrightarrow> (\<lambda>x::nat. f (real x)) \<in> O(\<lambda>x. g (real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> O(g) \<Longrightarrow> (\<lambda>x. f (real x)) \<in> O(\<lambda>x. g (real x))
[PROOF STEP]
by (rule landau_o.big.compose[OF _ filterlim_real_sequentially])


[STATEMENT]
lemma homeomorphic_hyperplanes_eq:
  fixes a :: "'M::euclidean_space" and c :: "'N::euclidean_space"
  assumes "a \<noteq> 0" "c \<noteq> 0"
  shows "({x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} \<longleftrightarrow> DIM('M) = DIM('N))" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} = (DIM('M) = DIM('N))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} = (DIM('M) = DIM('N))
[PROOF STEP]
have "(DIM('M) - Suc 0 = DIM('N) - Suc 0) \<longleftrightarrow> (DIM('M) = DIM('N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (DIM('M) - Suc 0 = DIM('N) - Suc 0) = (DIM('M) = DIM('N))
[PROOF STEP]
by auto (metis DIM_positive Suc_pred)
[PROOF STATE]
proof (state)
this:
(DIM('M) - Suc 0 = DIM('N) - Suc 0) = (DIM('M) = DIM('N))

goal (1 subgoal):
 1. {x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} = (DIM('M) = DIM('N))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(DIM('M) - Suc 0 = DIM('N) - Suc 0) = (DIM('M) = DIM('N))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(DIM('M) - Suc 0 = DIM('N) - Suc 0) = (DIM('M) = DIM('N))

goal (1 subgoal):
 1. {x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} = (DIM('M) = DIM('N))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(DIM('M) - Suc 0 = DIM('N) - Suc 0) = (DIM('M) = DIM('N))
a \<noteq> (0::'M)
c \<noteq> (0::'N)

goal (1 subgoal):
 1. {x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} = (DIM('M) = DIM('N))
[PROOF STEP]
by (simp add: homeomorphic_affine_sets_eq affine_hyperplane)
[PROOF STATE]
proof (state)
this:
{x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} = (DIM('M) = DIM('N))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nextMax_Un_eq[simp]:
"finite x \<Longrightarrow> finite y \<Longrightarrow> nextMax (x \<union> y) = max (nextMax x) (nextMax y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite x; finite y\<rbrakk> \<Longrightarrow> nextMax (x \<union> y) = max (nextMax x) (nextMax y)
[PROOF STEP]
unfolding nextMax_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite x; finite y\<rbrakk> \<Longrightarrow> (if x \<union> y = {} then 0 else Suc (Max (x \<union> y))) = max (if x = {} then 0 else Suc (Max x)) (if y = {} then 0 else Suc (Max y))
[PROOF STEP]
using Max_Un
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}; finite ?B; ?B \<noteq> {}\<rbrakk> \<Longrightarrow> Max (?A \<union> ?B) = max (Max ?A) (Max ?B)

goal (1 subgoal):
 1. \<lbrakk>finite x; finite y\<rbrakk> \<Longrightarrow> (if x \<union> y = {} then 0 else Suc (Max (x \<union> y))) = max (if x = {} then 0 else Suc (Max x)) (if y = {} then 0 else Suc (Max y))
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_newton_interpolation_poly:
  shows "degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
proof (cases "length xs_ys")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length xs_ys = 0 \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
 2. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
length xs_ys = 0

goal (2 subgoals):
 1. length xs_ys = 0 \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
 2. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
hence id: "xs_ys = []"
[PROOF STATE]
proof (prove)
using this:
length xs_ys = 0

goal (1 subgoal):
 1. xs_ys = []
[PROOF STEP]
by (cases xs_ys, auto)
[PROOF STATE]
proof (state)
this:
xs_ys = []

goal (2 subgoals):
 1. length xs_ys = 0 \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
 2. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
unfolding
    id newton_interpolation_poly_def Let_def list.simps newton_poly_impl_def
    Newton_Interpolation.newton_coefficients_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (horner_composition (rev (map hd (newton_coefficients_main [] (rev []) (rev [])))) []) \<le> length [] - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1

goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
case (Suc nn)
[PROOF STATE]
proof (state)
this:
length xs_ys = Suc nn

goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
let ?xs = "map fst xs_ys"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
let ?fs = "map snd xs_ys"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
let ?n = "Suc nn"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
have id: "newton_interpolation_poly xs_ys = newton_poly ?xs ?fs nn"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. newton_interpolation_poly xs_ys = newton_poly (map fst xs_ys) (map snd xs_ys) nn
[PROOF STEP]
unfolding newton_interpolation_poly_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. newton_poly_impl (map fst xs_ys) (map snd xs_ys) = newton_poly (map fst xs_ys) (map snd xs_ys) nn
[PROOF STEP]
by (rule newton_poly_impl[OF _ _ Suc], auto)
[PROOF STATE]
proof (state)
this:
newton_interpolation_poly xs_ys = newton_poly (map fst xs_ys) (map snd xs_ys) nn

goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (newton_poly (map fst xs_ys) (map snd xs_ys) nn) \<le> length xs_ys - 1
[PROOF STEP]
using newton_poly_degree[of ?xs ?fs nn] Suc
[PROOF STATE]
proof (prove)
using this:
degree (newton_poly (map fst xs_ys) (map snd xs_ys) nn) \<le> nn
length xs_ys = Suc nn

goal (1 subgoal):
 1. degree (newton_poly (map fst xs_ys) (map snd xs_ys) nn) \<le> length xs_ys - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cos_double_less_one: "0 < x \<Longrightarrow> x < 2 \<Longrightarrow> cos (2 * x) < 1"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x < 2\<rbrakk> \<Longrightarrow> cos (2 * x) < 1
[PROOF STEP]
using sin_gt_zero_02 [where x = x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < x; x < 2\<rbrakk> \<Longrightarrow> 0 < sin x

goal (1 subgoal):
 1. \<lbrakk>0 < x; x < 2\<rbrakk> \<Longrightarrow> cos (2 * x) < 1
[PROOF STEP]
by (auto simp: cos_squared_eq cos_double)


[STATEMENT]
lemma inc_mat_col_list_map:  "j < length Bs \<Longrightarrow>
    col (inc_mat_of Vs Bs) j = map_vec (\<lambda> x . if (x \<in> (Bs ! j)) then 1 else 0) (vec_of_list Vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < length Bs \<Longrightarrow> col (inc_mat_of Vs Bs) j = map_vec (\<lambda>x. if x \<in> Bs ! j then 1::'b else (0::'b)) (vec_of_list Vs)
[PROOF STEP]
by (intro eq_vecI)
    (simp_all add: inc_mat_dim_row inc_mat_dim_col inc_mat_col_list_map_elem index_vec_of_list)


[STATEMENT]
lemma reciprocal_id_iff:
  shows "reciprocal z = z \<longleftrightarrow> z = of_complex 1 \<or> z = of_complex (-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
proof (cases "z = 0\<^sub>h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z = 0\<^sub>h \<Longrightarrow> (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
 2. z \<noteq> 0\<^sub>h \<Longrightarrow> (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z = 0\<^sub>h

goal (2 subgoals):
 1. z = 0\<^sub>h \<Longrightarrow> (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
 2. z \<noteq> 0\<^sub>h \<Longrightarrow> (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
z = 0\<^sub>h

goal (1 subgoal):
 1. (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
by (metis inf_not_of_complex of_complex_zero_iff reciprocal_inf_iff zero_neq_neg_one zero_neq_one)
[PROOF STATE]
proof (state)
this:
(reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))

goal (1 subgoal):
 1. z \<noteq> 0\<^sub>h \<Longrightarrow> (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<noteq> 0\<^sub>h \<Longrightarrow> (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. z \<noteq> 0\<^sub>h \<Longrightarrow> (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
using inf_or_of_complex[of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0\<^sub>h
z = \<infinity>\<^sub>h \<or> (\<exists>x. z = of_complex x)

goal (1 subgoal):
 1. (reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))
[PROOF STEP]
by (smt complex_sqrt_1 of_complex_zero_iff reciprocal_inf_iff reciprocal_of_complex to_complex_of_complex)
[PROOF STATE]
proof (state)
this:
(reciprocal z = z) = (z = of_complex 1 \<or> z = of_complex (- 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_to_set_is_finite: "finite (nat_to_set u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (nat_to_set u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (nat_to_set u)
[PROOF STEP]
have S1: "finite {i. i<u}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i < u}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {i. i < u}
[PROOF STEP]
let ?B = "{i. i<u}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {i. i < u}
[PROOF STEP]
let ?f = "(\<lambda> (x::nat). x)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {i. i < u}
[PROOF STEP]
have "?B = ?f ` ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < u} = (\<lambda>x. x) ` {i. i < u}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < u} = (\<lambda>x. x) ` {i. i < u}

goal (1 subgoal):
 1. finite {i. i < u}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{i. i < u} = (\<lambda>x. x) ` {i. i < u}
[PROOF STEP]
show "finite ?B"
[PROOF STATE]
proof (prove)
using this:
{i. i < u} = (\<lambda>x. x) ` {i. i < u}

goal (1 subgoal):
 1. finite {i. i < u}
[PROOF STEP]
by (rule nat_seg_image_imp_finite)
[PROOF STATE]
proof (state)
this:
finite {i. i < u}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {i. i < u}

goal (1 subgoal):
 1. finite (nat_to_set u)
[PROOF STEP]
have S2: "nat_to_set u \<subseteq> {i. i<u}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set u \<subseteq> {i. i < u}
[PROOF STEP]
by (rule nat_to_set_upper_bound2)
[PROOF STATE]
proof (state)
this:
nat_to_set u \<subseteq> {i. i < u}

goal (1 subgoal):
 1. finite (nat_to_set u)
[PROOF STEP]
from S2 S1
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u \<subseteq> {i. i < u}
finite {i. i < u}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nat_to_set u \<subseteq> {i. i < u}
finite {i. i < u}

goal (1 subgoal):
 1. finite (nat_to_set u)
[PROOF STEP]
by (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite (nat_to_set u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infnorm_eq_0:
  fixes x :: "'a::euclidean_space"
  shows "infnorm x = 0 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (infnorm x = 0) = (x = (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (infnorm x = 0) = (x = (0::'a))
[PROOF STEP]
have "infnorm x \<le> 0 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (infnorm x \<le> 0) = (x = (0::'a))
[PROOF STEP]
unfolding infnorm_Max
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<le> 0) = (x = (0::'a))
[PROOF STEP]
by (simp add: euclidean_all_zero_iff)
[PROOF STATE]
proof (state)
this:
(infnorm x \<le> 0) = (x = (0::'a))

goal (1 subgoal):
 1. (infnorm x = 0) = (x = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(infnorm x \<le> 0) = (x = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(infnorm x \<le> 0) = (x = (0::'a))

goal (1 subgoal):
 1. (infnorm x = 0) = (x = (0::'a))
[PROOF STEP]
using infnorm_pos_le[of x]
[PROOF STATE]
proof (prove)
using this:
(infnorm x \<le> 0) = (x = (0::'a))
0 \<le> infnorm x

goal (1 subgoal):
 1. (infnorm x = 0) = (x = (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(infnorm x = 0) = (x = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cosh_0 [simp]: "cosh 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cosh (0::'a) = (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cosh (0::'a) = (1::'a)
[PROOF STEP]
have "cosh 0 = (1/2) *\<^sub>R (1 + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cosh (0::'b) = (1 / 2) *\<^sub>R ((1::'b) + (1::'b))
[PROOF STEP]
by (simp add: cosh_def)
[PROOF STATE]
proof (state)
this:
cosh (0::?'b1) = (1 / 2) *\<^sub>R ((1::?'b1) + (1::?'b1))

goal (1 subgoal):
 1. cosh (0::'a) = (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cosh (0::?'b1) = (1 / 2) *\<^sub>R ((1::?'b1) + (1::?'b1))

goal (1 subgoal):
 1. cosh (0::'a) = (1::'a)
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>R ((1::'b) + (1::'b)) = (1::'b)
[PROOF STEP]
by (rule scaleR_half_double)
[PROOF STATE]
proof (state)
this:
(1 / 2) *\<^sub>R ((1::?'b2) + (1::?'b2)) = (1::?'b2)

goal (1 subgoal):
 1. cosh (0::'a) = (1::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cosh (0::?'b3) = (1::?'b3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cosh (0::?'b3) = (1::?'b3)

goal (1 subgoal):
 1. cosh (0::'a) = (1::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cosh (0::'a) = (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_hull_convex_sum: assumes A: "A \<subseteq> carrier_vec n"
  and x: "x \<in> convex_hull A"
  and y: "y \<in> convex_hull A"
  and a: "0 \<le> a" "a \<le> 1"
shows "a \<cdot>\<^sub>v x + (1 - a) \<cdot>\<^sub>v y \<in> convex_hull A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
from convex_hull_convex_hull_listD[OF A x]
[PROOF STATE]
proof (chain)
picking this:
\<exists>as. set as \<subseteq> A \<and> x \<in> convex_hull_list as
[PROOF STEP]
obtain xs where xs: "set xs \<subseteq> A"
    and x: "x \<in> convex_hull_list xs"
[PROOF STATE]
proof (prove)
using this:
\<exists>as. set as \<subseteq> A \<and> x \<in> convex_hull_list as

goal (1 subgoal):
 1. (\<And>xs. \<lbrakk>set xs \<subseteq> A; x \<in> convex_hull_list xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> A
x \<in> convex_hull_list xs

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
from convex_hull_convex_hull_listD[OF A y]
[PROOF STATE]
proof (chain)
picking this:
\<exists>as. set as \<subseteq> A \<and> y \<in> convex_hull_list as
[PROOF STEP]
obtain ys where ys: "set ys \<subseteq> A"
    and y: "y \<in> convex_hull_list ys"
[PROOF STATE]
proof (prove)
using this:
\<exists>as. set as \<subseteq> A \<and> y \<in> convex_hull_list as

goal (1 subgoal):
 1. (\<And>ys. \<lbrakk>set ys \<subseteq> A; y \<in> convex_hull_list ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set ys \<subseteq> A
y \<in> convex_hull_list ys

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
have fin: "finite (set (xs @ ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set (xs @ ys))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (set (xs @ ys))

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
have sub: "set (xs @ ys) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (xs @ ys) \<subseteq> A
[PROOF STEP]
using xs ys
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> A
set ys \<subseteq> A

goal (1 subgoal):
 1. set (xs @ ys) \<subseteq> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (xs @ ys) \<subseteq> A

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
from convex_hull_list_mono[of "xs @ ys" xs] x sub A
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set (xs @ ys) \<subseteq> carrier_vec n; set xs \<subseteq> set (xs @ ys)\<rbrakk> \<Longrightarrow> convex_hull_list xs \<subseteq> convex_hull_list (xs @ ys)
x \<in> convex_hull_list xs
set (xs @ ys) \<subseteq> A
A \<subseteq> carrier_vec n
[PROOF STEP]
have x: "x \<in> convex_hull_list (xs @ ys)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set (xs @ ys) \<subseteq> carrier_vec n; set xs \<subseteq> set (xs @ ys)\<rbrakk> \<Longrightarrow> convex_hull_list xs \<subseteq> convex_hull_list (xs @ ys)
x \<in> convex_hull_list xs
set (xs @ ys) \<subseteq> A
A \<subseteq> carrier_vec n

goal (1 subgoal):
 1. x \<in> convex_hull_list (xs @ ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> convex_hull_list (xs @ ys)

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
from convex_hull_list_mono[of "xs @ ys" ys] y sub A
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set (xs @ ys) \<subseteq> carrier_vec n; set ys \<subseteq> set (xs @ ys)\<rbrakk> \<Longrightarrow> convex_hull_list ys \<subseteq> convex_hull_list (xs @ ys)
y \<in> convex_hull_list ys
set (xs @ ys) \<subseteq> A
A \<subseteq> carrier_vec n
[PROOF STEP]
have y: "y \<in> convex_hull_list (xs @ ys)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set (xs @ ys) \<subseteq> carrier_vec n; set ys \<subseteq> set (xs @ ys)\<rbrakk> \<Longrightarrow> convex_hull_list ys \<subseteq> convex_hull_list (xs @ ys)
y \<in> convex_hull_list ys
set (xs @ ys) \<subseteq> A
A \<subseteq> carrier_vec n

goal (1 subgoal):
 1. y \<in> convex_hull_list (xs @ ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> convex_hull_list (xs @ ys)

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
from convex_hull_list_combination[OF _ x y a]
[PROOF STATE]
proof (chain)
picking this:
set (xs @ ys) \<subseteq> carrier_vec n \<Longrightarrow> a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)
[PROOF STEP]
have "a \<cdot>\<^sub>v x + (1 - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)"
[PROOF STATE]
proof (prove)
using this:
set (xs @ ys) \<subseteq> carrier_vec n \<Longrightarrow> a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)
[PROOF STEP]
using sub A
[PROOF STATE]
proof (prove)
using this:
set (xs @ ys) \<subseteq> carrier_vec n \<Longrightarrow> a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)
set (xs @ ys) \<subseteq> A
A \<subseteq> carrier_vec n

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
from finite_convex_hull_iff_convex_hull_list[of _ "xs @ ys"] this sub A
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?Vs \<subseteq> carrier_vec n; ?Vs = set (xs @ ys)\<rbrakk> \<Longrightarrow> convex_hull ?Vs = convex_hull_list (xs @ ys)
a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)
set (xs @ ys) \<subseteq> A
A \<subseteq> carrier_vec n
[PROOF STEP]
have "a \<cdot>\<^sub>v x + (1 - a) \<cdot>\<^sub>v y \<in> convex_hull (set (xs @ ys))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?Vs \<subseteq> carrier_vec n; ?Vs = set (xs @ ys)\<rbrakk> \<Longrightarrow> convex_hull ?Vs = convex_hull_list (xs @ ys)
a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull_list (xs @ ys)
set (xs @ ys) \<subseteq> A
A \<subseteq> carrier_vec n

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull (set (xs @ ys))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull (set (xs @ ys))

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
with convex_hull_mono[OF sub]
[PROOF STATE]
proof (chain)
picking this:
convex_hull (set (xs @ ys)) \<subseteq> convex_hull A
a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull (set (xs @ ys))
[PROOF STEP]
show "a \<cdot>\<^sub>v x + (1 - a) \<cdot>\<^sub>v y \<in> convex_hull A"
[PROOF STATE]
proof (prove)
using this:
convex_hull (set (xs @ ys)) \<subseteq> convex_hull A
a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull (set (xs @ ys))

goal (1 subgoal):
 1. a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v x + ((1::'a) - a) \<cdot>\<^sub>v y \<in> convex_hull A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_compose_gen:
  assumes lf: "Vector_Spaces.linear (*s) (*s) (f::'a::{field}^'n \<Rightarrow> 'a^'m)"
    and lg: "Vector_Spaces.linear (*s) (*s) (g::'a^'m \<Rightarrow> 'a^_)"
  shows "matrix (g o f) = matrix g ** matrix f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix (g \<circ> f) = matrix g ** matrix f
[PROOF STEP]
using lf lg Vector_Spaces.linear_compose[OF lf lg] matrix_works[OF Vector_Spaces.linear_compose[OF lf lg]]
[PROOF STATE]
proof (prove)
using this:
Vector_Spaces.linear (*s) (*s) f
Vector_Spaces.linear (*s) (*s) g
Vector_Spaces.linear (*s) (*s) (g \<circ> f)
matrix (g \<circ> f) *v ?x = (g \<circ> f) ?x

goal (1 subgoal):
 1. matrix (g \<circ> f) = matrix g ** matrix f
[PROOF STEP]
by (simp add: matrix_eq matrix_works matrix_vector_mul_assoc[symmetric] o_def)


[STATEMENT]
lemma measure_spmf_of_set:
  "measure (measure_spmf (spmf_of_set S)) A = card (S \<inter> A) / card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (spmf_of_set S)) A = real (card (S \<inter> A)) / real (card S)
[PROOF STEP]
by(auto simp add: measure_spmf_spmf_of_set measure_pmf_of_set)


[STATEMENT]
lemma vrestr_same_measure_f:
  assumes "f \<in> measure_preserving M M"
          "A \<in> sets M"
  shows "measure M (f--`A) = measure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
have "measure M (f--`A) = enn2real (emeasure M (f--`A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = enn2real (emeasure M (f --` A))
[PROOF STEP]
by (simp add: Sigma_Algebra.measure_def)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (f --` A) = enn2real (emeasure M (f --` A))

goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (f --` A) = enn2real (emeasure M (f --` A))

goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
have "... = enn2real (emeasure M A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (emeasure M (f --` A)) = enn2real (emeasure M A)
[PROOF STEP]
using vrestr_same_emeasure_f[OF assms]
[PROOF STATE]
proof (prove)
using this:
emeasure M (f --` A) = emeasure M A

goal (1 subgoal):
 1. enn2real (emeasure M (f --` A)) = enn2real (emeasure M A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enn2real (emeasure M (f --` A)) = enn2real (emeasure M A)

goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
enn2real (emeasure M (f --` A)) = enn2real (emeasure M A)

goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
have "... = measure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (emeasure M A) = Sigma_Algebra.measure M A
[PROOF STEP]
by (simp add: Sigma_Algebra.measure_def)
[PROOF STATE]
proof (state)
this:
enn2real (emeasure M A) = Sigma_Algebra.measure M A

goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
show "measure M (f--` A) = measure M A"
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A

goal (1 subgoal):
 1. Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (f --` A) = Sigma_Algebra.measure M A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smult_add_right: "smult a (p + q) = smult a p + smult a q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult a (p + q) = smult a p + smult a q
[PROOF STEP]
by (rule poly_eqI) (simp add: algebra_simps)


[STATEMENT]
lemma sinh_real:
  fixes x :: real
  shows "of_real((exp x - inverse (exp x)) / 2) = -\<i> * sin(\<i> * of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real ((exp x - inverse (exp x)) / 2) = - \<i> * sin (\<i> * complex_of_real x)
[PROOF STEP]
by (simp add: exp_of_real sin_i_times)


[STATEMENT]
lemma mod_integer_le:
  \<open>x mod (a + 1) \<le> b\<close> if \<open>a \<le> b\<close> \<open>0 < a\<close> for a b x :: integer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod (a + 1) \<le> b
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<le> b
0 < a

goal (1 subgoal):
 1. x mod (a + 1) \<le> b
[PROOF STEP]
including integer.lifting
[PROOF STATE]
proof (prove)
using this:
a \<le> b
0 < a

goal (1 subgoal):
 1. x mod (a + 1) \<le> b
[PROOF STEP]
proof transfer
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>a \<le> b; 0 < a\<rbrakk> \<Longrightarrow> x mod (a + 1) \<le> b
[PROOF STEP]
fix a b x :: int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>a \<le> b; 0 < a\<rbrakk> \<Longrightarrow> x mod (a + 1) \<le> b
[PROOF STEP]
assume \<open>0 < a\<close> \<open>a \<le> b\<close>
[PROOF STATE]
proof (state)
this:
0 < a
a \<le> b

goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>a \<le> b; 0 < a\<rbrakk> \<Longrightarrow> x mod (a + 1) \<le> b
[PROOF STEP]
have \<open>x mod (a + 1) < a + 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod (a + 1) < a + 1
[PROOF STEP]
by (rule pos_mod_bound) (use \<open>0 < a\<close> in simp)
[PROOF STATE]
proof (state)
this:
x mod (a + 1) < a + 1

goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>a \<le> b; 0 < a\<rbrakk> \<Longrightarrow> x mod (a + 1) \<le> b
[PROOF STEP]
with \<open>a \<le> b\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<le> b
x mod (a + 1) < a + 1
[PROOF STEP]
show \<open>x mod (a + 1) \<le> b\<close>
[PROOF STATE]
proof (prove)
using this:
a \<le> b
x mod (a + 1) < a + 1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_factor_imp_mod_0: "
  \<lbrakk>(x::nat) mod (m * k) = y * k mod (m * k)\<rbrakk> \<Longrightarrow> x mod k = 0"
  (is "\<lbrakk> ?P1 \<rbrakk> \<Longrightarrow> ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
assume as1: ?P1
[PROOF STATE]
proof (state)
this:
x mod (m * k) = y * k mod (m * k)

goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
have "y * k mod (m * k) = y mod m * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * k mod (m * k) = y mod m * k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y * k mod (m * k) = y mod m * k

goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
hence "x mod (m * k) = y mod m * k"
[PROOF STATE]
proof (prove)
using this:
y * k mod (m * k) = y mod m * k

goal (1 subgoal):
 1. x mod (m * k) = y mod m * k
[PROOF STEP]
using as1
[PROOF STATE]
proof (prove)
using this:
y * k mod (m * k) = y mod m * k
x mod (m * k) = y * k mod (m * k)

goal (1 subgoal):
 1. x mod (m * k) = y mod m * k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x mod (m * k) = y mod m * k

goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
hence "y mod m * k = k * (x div k mod m) + x mod k" (is "?l1 = ?r1")
[PROOF STATE]
proof (prove)
using this:
x mod (m * k) = y mod m * k

goal (1 subgoal):
 1. y mod m * k = k * (x div k mod m) + x mod k
[PROOF STEP]
by (simp only: ac_simps mod_mult2_eq)
[PROOF STATE]
proof (state)
this:
y mod m * k = k * (x div k mod m) + x mod k

goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
hence "(y mod m * k) mod k = ?r1 mod k"
[PROOF STATE]
proof (prove)
using this:
y mod m * k = k * (x div k mod m) + x mod k

goal (1 subgoal):
 1. y mod m * k mod k = (k * (x div k mod m) + x mod k) mod k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y mod m * k mod k = (k * (x div k mod m) + x mod k) mod k

goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
hence "0 = ?r1 mod k"
[PROOF STATE]
proof (prove)
using this:
y mod m * k mod k = (k * (x div k mod m) + x mod k) mod k

goal (1 subgoal):
 1. 0 = (k * (x div k mod m) + x mod k) mod k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 = (k * (x div k mod m) + x mod k) mod k

goal (1 subgoal):
 1. x mod (m * k) = y * k mod (m * k) \<Longrightarrow> x mod k = 0
[PROOF STEP]
thus "x mod k = 0"
[PROOF STATE]
proof (prove)
using this:
0 = (k * (x div k mod m) + x mod k) mod k

goal (1 subgoal):
 1. x mod k = 0
[PROOF STEP]
by (simp add: mod_add_eq)
[PROOF STATE]
proof (state)
this:
x mod k = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_fds_inverse:
  fixes s :: "'a :: {nat_power, real_normed_field, banach, second_countable_topology}"
  assumes "fds_abs_converges f s" "fds_abs_converges (inverse f) s" "fds_nth f 1 \<noteq> 0"
  shows   "eval_fds (inverse f) s = inverse (eval_fds f s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
have "eval_fds (inverse f * f) s = eval_fds (inverse f) s * eval_fds f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds (inverse f * f) s = eval_fds (inverse f) s * eval_fds f s
[PROOF STEP]
by (intro eval_fds_mult assms)
[PROOF STATE]
proof (state)
this:
eval_fds (inverse f * f) s = eval_fds (inverse f) s * eval_fds f s

goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval_fds (inverse f * f) s = eval_fds (inverse f) s * eval_fds f s

goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
have "inverse f * f = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse f * f = 1
[PROOF STEP]
by (intro fds_left_inverse assms)
[PROOF STATE]
proof (state)
this:
inverse f * f = 1

goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse f * f = 1

goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
have "eval_fds 1 s = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds 1 s = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_fds 1 s = (1::'a)

goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1::'a) = eval_fds (inverse f) s * eval_fds f s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1::'a) = eval_fds (inverse f) s * eval_fds f s

goal (1 subgoal):
 1. eval_fds (inverse f) s = inverse (eval_fds f s)
[PROOF STEP]
by (auto simp: divide_simps)
[PROOF STATE]
proof (state)
this:
eval_fds (inverse f) s = inverse (eval_fds f s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_lower_bound_power_indet:
  assumes "eventually (\<lambda>x. l x \<le> f x) at_top"
  assumes "eventually (\<lambda>x. l' x \<le> l x ^ n) at_top" "eventually (\<lambda>x. l' x \<le> 0) at_top"
  shows   "eventually (\<lambda>x. l' x \<le> (f x ^ n :: real)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. l' x \<le> f x ^ n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. l x \<le> f x
\<forall>\<^sub>F x in at_top. l' x \<le> l x ^ n
\<forall>\<^sub>F x in at_top. l' x \<le> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. l' x \<le> f x ^ n
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>l x \<le> f x; l' x \<le> l x ^ n; l' x \<le> 0\<rbrakk> \<Longrightarrow> l' x \<le> f x ^ n
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
l x \<le> f x
l' x \<le> l x ^ n
l' x \<le> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>l x \<le> f x; l' x \<le> l x ^ n; l' x \<le> 0\<rbrakk> \<Longrightarrow> l' x \<le> f x ^ n
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
l x \<le> f x
l' x \<le> l x ^ n
l' x \<le> 0

goal (1 subgoal):
 1. l' x \<le> f x ^ n
[PROOF STEP]
using power_mono_odd[of n "l x" "f x"] zero_le_even_power[of n "f x"]
[PROOF STATE]
proof (prove)
using this:
l x \<le> f x
l' x \<le> l x ^ n
l' x \<le> 0
\<lbrakk>odd n; l x \<le> f x\<rbrakk> \<Longrightarrow> l x ^ n \<le> f x ^ n
even n \<Longrightarrow> 0 \<le> f x ^ n

goal (1 subgoal):
 1. l' x \<le> f x ^ n
[PROOF STEP]
by (cases "even n") auto
[PROOF STATE]
proof (state)
this:
l' x \<le> f x ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_union_map [reversal_rule]:
  assumes "inj f" shows "List.union (map f xs) (map f ys) = map f (List.union xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.union (map f xs) (map f ys) = map f (List.union xs ys)
[PROOF STEP]
proof (induction xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. List.union (map f []) (map f ys) = map f (List.union [] ys)
 2. \<And>a xs ys. (\<And>ys. List.union (map f xs) (map f ys) = map f (List.union xs ys)) \<Longrightarrow> List.union (map f (a # xs)) (map f ys) = map f (List.union (a # xs) ys)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
List.union (map f xs) (map f ?ys) = map f (List.union xs ?ys)

goal (2 subgoals):
 1. \<And>ys. List.union (map f []) (map f ys) = map f (List.union [] ys)
 2. \<And>a xs ys. (\<And>ys. List.union (map f xs) (map f ys) = map f (List.union xs ys)) \<Longrightarrow> List.union (map f (a # xs)) (map f ys) = map f (List.union (a # xs) ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.union (map f (a # xs)) (map f ys) = map f (List.union (a # xs) ys)
[PROOF STEP]
using Cons.IH
[PROOF STATE]
proof (prove)
using this:
List.union (map f xs) (map f ?ys) = map f (List.union xs ?ys)

goal (1 subgoal):
 1. List.union (map f (a # xs)) (map f ys) = map f (List.union (a # xs) ys)
[PROOF STEP]
unfolding List.union_def Cons_map[symmetric] fold.simps(2) o_apply
[PROOF STATE]
proof (prove)
using this:
fold List.insert (map f xs) (map f ?ys) = map f (fold List.insert xs ?ys)

goal (1 subgoal):
 1. fold List.insert (map f xs) (List.insert (f a) (map f ys)) = map f (fold List.insert xs (List.insert a ys))
[PROOF STEP]
unfolding list_insert_map[OF \<open>inj f\<close>]
[PROOF STATE]
proof (prove)
using this:
fold List.insert (map f xs) (map f ?ys) = map f (fold List.insert xs ?ys)

goal (1 subgoal):
 1. fold List.insert (map f xs) (map f (List.insert a ys)) = map f (fold List.insert xs (List.insert a ys))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
List.union (map f (a # xs)) (map f ys) = map f (List.union (a # xs) ys)

goal (1 subgoal):
 1. \<And>ys. List.union (map f []) (map f ys) = map f (List.union [] ys)
[PROOF STEP]
qed (simp add: List.union_def)

  \<comment> \<open>\<^const>\<open>length\<close>\<close>


[STATEMENT]
lemma cart_prod_distinct_mset:
  assumes assm1: "distinct_mset A"
  assumes assm2: "distinct_mset B"
  shows "distinct_mset (A \<times># B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset (A \<times># B)
[PROOF STEP]
unfolding distinct_mset_count_less_1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. count (A \<times># B) a \<le> 1
[PROOF STEP]
proof (rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. count (A \<times># B) a \<le> 1
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. count (A \<times># B) a \<le> 1
[PROOF STEP]
have count_mult: "count (A \<times># B) x = count A (fst x) * count B (snd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (A \<times># B) x = count A (fst x) * count B (snd x)
[PROOF STEP]
using count_Sigma_mset
[PROOF STATE]
proof (prove)
using this:
count (Sigma_mset ?A ?B) (?a, ?b) = count ?A ?a * count (?B ?a) ?b

goal (1 subgoal):
 1. count (A \<times># B) x = count A (fst x) * count B (snd x)
[PROOF STEP]
by (metis prod.exhaust_sel)
[PROOF STATE]
proof (state)
this:
count (A \<times># B) x = count A (fst x) * count B (snd x)

goal (1 subgoal):
 1. \<And>a. count (A \<times># B) a \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count (A \<times># B) x = count A (fst x) * count B (snd x)
[PROOF STEP]
have "count A (fst x) * count B (snd x) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
count (A \<times># B) x = count A (fst x) * count B (snd x)

goal (1 subgoal):
 1. count A (fst x) * count B (snd x) \<le> 1
[PROOF STEP]
using assm1 assm2
[PROOF STATE]
proof (prove)
using this:
count (A \<times># B) x = count A (fst x) * count B (snd x)
distinct_mset A
distinct_mset B

goal (1 subgoal):
 1. count A (fst x) * count B (snd x) \<le> 1
[PROOF STEP]
unfolding distinct_mset_count_less_1
[PROOF STATE]
proof (prove)
using this:
count (A \<times># B) x = count A (fst x) * count B (snd x)
\<forall>a. count A a \<le> 1
\<forall>a. count B a \<le> 1

goal (1 subgoal):
 1. count A (fst x) * count B (snd x) \<le> 1
[PROOF STEP]
using mult_le_one
[PROOF STATE]
proof (prove)
using this:
count (A \<times># B) x = count A (fst x) * count B (snd x)
\<forall>a. count A a \<le> 1
\<forall>a. count B a \<le> 1
\<lbrakk>?a \<le> (1::?'a); (0::?'a) \<le> ?b; ?b \<le> (1::?'a)\<rbrakk> \<Longrightarrow> ?a * ?b \<le> (1::?'a)

goal (1 subgoal):
 1. count A (fst x) * count B (snd x) \<le> 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
count A (fst x) * count B (snd x) \<le> 1

goal (1 subgoal):
 1. \<And>a. count (A \<times># B) a \<le> 1
[PROOF STEP]
thus "count (A \<times># B) x \<le> 1"
[PROOF STATE]
proof (prove)
using this:
count A (fst x) * count B (snd x) \<le> 1

goal (1 subgoal):
 1. count (A \<times># B) x \<le> 1
[PROOF STEP]
using count_mult
[PROOF STATE]
proof (prove)
using this:
count A (fst x) * count B (snd x) \<le> 1
count (A \<times># B) x = count A (fst x) * count B (snd x)

goal (1 subgoal):
 1. count (A \<times># B) x \<le> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count (A \<times># B) x \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtrancl_path_last: "\<lbrakk> rtrancl_path R x xs y; xs \<noteq> [] \<rbrakk> \<Longrightarrow> last xs = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rtrancl_path R x xs y; xs \<noteq> []\<rbrakk> \<Longrightarrow> last xs = y
[PROOF STEP]
by(induction rule: rtrancl_path.induct)(auto elim: rtrancl_path.cases)


[STATEMENT]
lemma coprime_power_right_iff [simp]:
  "coprime a (b ^ n) \<longleftrightarrow> coprime a b \<or> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a (b ^ n) = (coprime a b \<or> n = 0)
[PROOF STEP]
using coprime_power_left_iff [of b n a]
[PROOF STATE]
proof (prove)
using this:
coprime (b ^ n) a = (coprime b a \<or> n = 0)

goal (1 subgoal):
 1. coprime a (b ^ n) = (coprime a b \<or> n = 0)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma enum_0_eq_Inf_finite:
  fixes N :: "nat set"
  assumes "finite N" "N \<noteq> {}"
  shows "enum N 0 = Inf N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enum N 0 = \<Sqinter> N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. enum N 0 = \<Sqinter> N
[PROOF STEP]
have "enum N 0 \<in> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enum N 0 \<in> N
[PROOF STEP]
by (metis Nat.neq0_conv assms empty_is_image enum_works_finite image_eqI lessThan_empty_iff lessThan_iff)
[PROOF STATE]
proof (state)
this:
enum N 0 \<in> N

goal (1 subgoal):
 1. enum N 0 = \<Sqinter> N
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
enum N 0 \<in> N

goal (1 subgoal):
 1. enum N 0 = \<Sqinter> N
[PROOF STEP]
have "enum N 0 \<le> x" if "x \<in> N" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enum N 0 \<le> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. enum N 0 \<le> x
[PROOF STEP]
obtain i where "i < card N" "x = enum N i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < card N; x = enum N i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>x \<in> N\<close> \<open>finite N\<close> enum_obtain_index_finite)
[PROOF STATE]
proof (state)
this:
i < card N
x = enum N i

goal (1 subgoal):
 1. enum N 0 \<le> x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite N
N \<noteq> {}
i < card N
x = enum N i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite N
N \<noteq> {}
i < card N
x = enum N i

goal (1 subgoal):
 1. enum N 0 \<le> x
[PROOF STEP]
by (metis Nat.neq0_conv finite_enumerate_mono less_or_eq_imp_le)
[PROOF STATE]
proof (state)
this:
enum N 0 \<le> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> N \<Longrightarrow> enum N 0 \<le> ?x

goal (1 subgoal):
 1. enum N 0 = \<Sqinter> N
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
enum N 0 \<in> N
?x \<in> N \<Longrightarrow> enum N 0 \<le> ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
enum N 0 \<in> N
?x \<in> N \<Longrightarrow> enum N 0 \<le> ?x

goal (1 subgoal):
 1. enum N 0 = \<Sqinter> N
[PROOF STEP]
by (metis cInf_eq_minimum)
[PROOF STATE]
proof (state)
this:
enum N 0 = \<Sqinter> N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_of_poly_monom: "fps_of_poly (monom (c :: 'a :: comm_ring_1) n) = fps_const c * fps_X ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (monom c n) = fps_const c * fps_X ^ n
[PROOF STEP]
by (intro fps_ext) simp_all


[STATEMENT]
lemma graeffe_poly_impl_mahler: "mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
let ?c = "complex_of_int"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
let ?cc = "map_poly ?c"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
let ?f = "?cc f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
note eq = complex_roots(1)[of ?f]
[PROOF STATE]
proof (state)
this:
Polynomial.smult (lead_coeff (of_int_poly f)) (\<Prod>a\<leftarrow>complex_roots_complex (of_int_poly f). [:- a, 1:]) = of_int_poly f

goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
interpret inj_idom_hom complex_of_int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_idom_hom complex_of_int
[PROOF STEP]
by (standard, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m
[PROOF STEP]
unfolding mahler_measure_def mahler_graeffe[OF eq[symmetric], symmetric]
     graeffe_poly_impl[OF eq[symmetric], symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_poly (of_int_poly (graeffe_poly_impl f m)) = mahler_measure_poly (graeffe_poly_impl (of_int_poly f) m)
[PROOF STEP]
by (simp add: of_int_hom.graeffe_poly_impl_hom)
[PROOF STATE]
proof (state)
this:
mahler_measure (graeffe_poly_impl f m) = mahler_measure f ^ 2 ^ m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_induct:
  fixes j :: int
  assumes a: "P 0"
  and     b: "\<And>i::int. P i \<Longrightarrow> P (i + 1)"
  and     c: "\<And>i::int. P i \<Longrightarrow> P (i - 1)"
  shows      "P j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P j
[PROOF STEP]
using a b c
[PROOF STATE]
proof (prove)
using this:
P 0
P ?i \<Longrightarrow> P (?i + 1)
P ?i \<Longrightarrow> P (?i - 1)

goal (1 subgoal):
 1. P j
[PROOF STEP]
unfolding minus_int_def
[PROOF STATE]
proof (prove)
using this:
P 0
P ?i \<Longrightarrow> P (?i + 1)
P ?i \<Longrightarrow> P (?i + - 1)

goal (1 subgoal):
 1. P j
[PROOF STEP]
by (descending) (auto intro: int_induct2)


[STATEMENT]
lemma leq_neg_imp_abs_geq: "\<lbrakk> (a::'a::ordered_ab_group_add_abs) \<le> 0; b \<le> a \<rbrakk> \<Longrightarrow> \<bar>a\<bar> \<le> \<bar>b\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> (0::'a); b \<le> a\<rbrakk> \<Longrightarrow> \<bar>a\<bar> \<le> \<bar>b\<bar>
[PROOF STEP]
by simp


[STATEMENT]
lemma log_powr: "x \<noteq> 0 \<Longrightarrow> log b (x powr y) = y * log b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> log b (x powr y) = y * log b x
[PROOF STEP]
by (simp add: log_def ln_powr)


[STATEMENT]
lemma nextMax_set[simp]:
  assumes "sorted xs"
  shows "nextMax (set xs) = (if xs = Nil then 0 else Suc (last xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nextMax (set xs) = (if xs = [] then 0 else Suc (last xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted xs

goal (1 subgoal):
 1. nextMax (set xs) = (if xs = [] then 0 else Suc (last xs))
[PROOF STEP]
proof(induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sorted [] \<Longrightarrow> nextMax (set []) = (if [] = [] then 0 else Suc (last []))
 2. \<And>a xs. \<lbrakk>sorted xs \<Longrightarrow> nextMax (set xs) = (if xs = [] then 0 else Suc (last xs)); sorted (a # xs)\<rbrakk> \<Longrightarrow> nextMax (set (a # xs)) = (if a # xs = [] then 0 else Suc (last (a # xs)))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
sorted []

goal (2 subgoals):
 1. sorted [] \<Longrightarrow> nextMax (set []) = (if [] = [] then 0 else Suc (last []))
 2. \<And>a xs. \<lbrakk>sorted xs \<Longrightarrow> nextMax (set xs) = (if xs = [] then 0 else Suc (last xs)); sorted (a # xs)\<rbrakk> \<Longrightarrow> nextMax (set (a # xs)) = (if a # xs = [] then 0 else Suc (last (a # xs)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nextMax (set []) = (if [] = [] then 0 else Suc (last []))
[PROOF STEP]
unfolding nextMax_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if set [] = {} then 0 else Suc (Max (set []))) = (if [] = [] then 0 else Suc (last []))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nextMax (set []) = (if [] = [] then 0 else Suc (last []))

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>sorted xs \<Longrightarrow> nextMax (set xs) = (if xs = [] then 0 else Suc (last xs)); sorted (a # xs)\<rbrakk> \<Longrightarrow> nextMax (set (a # xs)) = (if a # xs = [] then 0 else Suc (last (a # xs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>sorted xs \<Longrightarrow> nextMax (set xs) = (if xs = [] then 0 else Suc (last xs)); sorted (a # xs)\<rbrakk> \<Longrightarrow> nextMax (set (a # xs)) = (if a # xs = [] then 0 else Suc (last (a # xs)))
[PROOF STEP]
case (Cons a list)
[PROOF STATE]
proof (state)
this:
sorted list \<Longrightarrow> nextMax (set list) = (if list = [] then 0 else Suc (last list))
sorted (a # list)

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>sorted xs \<Longrightarrow> nextMax (set xs) = (if xs = [] then 0 else Suc (last xs)); sorted (a # xs)\<rbrakk> \<Longrightarrow> nextMax (set (a # xs)) = (if a # xs = [] then 0 else Suc (last (a # xs)))
[PROOF STEP]
hence "list \<noteq> [] \<Longrightarrow> fold max list a = last list"
[PROOF STATE]
proof (prove)
using this:
sorted list \<Longrightarrow> nextMax (set list) = (if list = [] then 0 else Suc (last list))
sorted (a # list)

goal (1 subgoal):
 1. list \<noteq> [] \<Longrightarrow> fold max list a = last list
[PROOF STEP]
using list_sorted_max
[PROOF STATE]
proof (prove)
using this:
sorted list \<Longrightarrow> nextMax (set list) = (if list = [] then 0 else Suc (last list))
sorted (a # list)
\<lbrakk>sorted ?list; ?list = ?x # ?xs\<rbrakk> \<Longrightarrow> fold max ?xs ?x = last ?list

goal (1 subgoal):
 1. list \<noteq> [] \<Longrightarrow> fold max list a = last list
[PROOF STEP]
by (metis last.simps)
[PROOF STATE]
proof (state)
this:
list \<noteq> [] \<Longrightarrow> fold max list a = last list

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>sorted xs \<Longrightarrow> nextMax (set xs) = (if xs = [] then 0 else Suc (last xs)); sorted (a # xs)\<rbrakk> \<Longrightarrow> nextMax (set (a # xs)) = (if a # xs = [] then 0 else Suc (last (a # xs)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
list \<noteq> [] \<Longrightarrow> fold max list a = last list

goal (1 subgoal):
 1. nextMax (set (a # list)) = (if a # list = [] then 0 else Suc (last (a # list)))
[PROOF STEP]
unfolding nextMax_def Max.set_eq_fold
[PROOF STATE]
proof (prove)
using this:
list \<noteq> [] \<Longrightarrow> fold max list a = last list

goal (1 subgoal):
 1. (if set (a # list) = {} then 0 else Suc (fold max list a)) = (if a # list = [] then 0 else Suc (last (a # list)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nextMax (set (a # list)) = (if a # list = [] then 0 else Suc (last (a # list)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quantum_payoff_le_3:
  fixes x y:: real
  shows "2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3
[PROOF STEP]
have "(sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 1
[PROOF STEP]
by (simp add: sin_squared_le_one cos_squared_le_one mult_le_one)
[PROOF STATE]
proof (state)
this:
(sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 1

goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 1
[PROOF STEP]
have "2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 2"
[PROOF STATE]
proof (prove)
using this:
(sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 1

goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 2

goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 2

goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3
[PROOF STEP]
have "(cos y)\<^sup>2 \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos y)\<^sup>2 \<le> 1
[PROOF STEP]
using cos_squared_le_one[of "y"]
[PROOF STATE]
proof (prove)
using this:
(cos y)\<^sup>2 \<le> 1

goal (1 subgoal):
 1. (cos y)\<^sup>2 \<le> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(cos y)\<^sup>2 \<le> 1

goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 2
(cos y)\<^sup>2 \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 \<le> 2
(cos y)\<^sup>2 \<le> 1

goal (1 subgoal):
 1. 2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * (sin x)\<^sup>2 * (cos y)\<^sup>2 + (cos y)\<^sup>2 \<le> 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma onorm_compose:
  assumes f: "bounded_linear f"
  assumes g: "bounded_linear g"
  shows "onorm (f \<circ> g) \<le> onorm f * onorm g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (f \<circ> g) \<le> onorm f * onorm g
[PROOF STEP]
proof (rule onorm_bound)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> onorm f * onorm g
 2. \<And>x. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
show "0 \<le> onorm f * onorm g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> onorm f * onorm g
[PROOF STEP]
by (intro mult_nonneg_nonneg onorm_pos_le f g)
[PROOF STATE]
proof (state)
this:
0 \<le> onorm f * onorm g

goal (1 subgoal):
 1. \<And>x. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
have "norm (f (g x)) \<le> onorm f * norm (g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f (g x)) \<le> onorm f * norm (g x)
[PROOF STEP]
by (rule onorm [OF f])
[PROOF STATE]
proof (state)
this:
norm (f (g x)) \<le> onorm f * norm (g x)

goal (1 subgoal):
 1. \<And>x. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f (g x)) \<le> onorm f * norm (g x)

goal (1 subgoal):
 1. \<And>x. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
have "onorm f * norm (g x) \<le> onorm f * (onorm g * norm x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm f * norm (g x) \<le> onorm f * (onorm g * norm x)
[PROOF STEP]
by (rule mult_left_mono [OF onorm [OF g] onorm_pos_le [OF f]])
[PROOF STATE]
proof (state)
this:
onorm f * norm (g x) \<le> onorm f * (onorm g * norm x)

goal (1 subgoal):
 1. \<And>x. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (f (g x)) \<le> onorm f * (onorm g * norm x)
[PROOF STEP]
show "norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x"
[PROOF STATE]
proof (prove)
using this:
norm (f (g x)) \<le> onorm f * (onorm g * norm x)

goal (1 subgoal):
 1. norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x
[PROOF STEP]
by (simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
norm ((f \<circ> g) x) \<le> onorm f * onorm g * norm x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_k_uniform_mat_block_size:
  assumes "((u\<^sub>v (dim_row M)) \<^sub>v* M) = k \<cdot>\<^sub>v (u\<^sub>v (dim_col M))"
  assumes "j < dim_col M"
  shows "mat_block_size M j = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_block_size M j = k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_block_size M j = k
[PROOF STEP]
have "mat_block_size M j = sum_vec (col M j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (mat_block_size M j) = sum_vec (col M j)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
j < dim_col M

goal (1 subgoal):
 1. int (mat_block_size M j) = sum_vec (col M j)
[PROOF STEP]
by (simp add: elems01 mat_block_size_sum_alt)
[PROOF STATE]
proof (state)
this:
int (mat_block_size M j) = sum_vec (col M j)

goal (1 subgoal):
 1. mat_block_size M j = k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (mat_block_size M j) = sum_vec (col M j)

goal (1 subgoal):
 1. mat_block_size M j = k
[PROOF STEP]
have "... = ((u\<^sub>v (dim_row M)) \<^sub>v* M) $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_vec (col M j) = (u\<^sub>v (dim_row M) \<^sub>v* M) $ j
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
j < dim_col M

goal (1 subgoal):
 1. sum_vec (col M j) = (u\<^sub>v (dim_row M) \<^sub>v* M) $ j
[PROOF STEP]
by (simp add: sum_vec_def scalar_prod_def)
[PROOF STATE]
proof (state)
this:
sum_vec (col M j) = (u\<^sub>v (dim_row M) \<^sub>v* M) $ j

goal (1 subgoal):
 1. mat_block_size M j = k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
int (mat_block_size M j) = (u\<^sub>v (dim_row M) \<^sub>v* M) $ j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (mat_block_size M j) = (u\<^sub>v (dim_row M) \<^sub>v* M) $ j

goal (1 subgoal):
 1. mat_block_size M j = k
[PROOF STEP]
using  assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
int (mat_block_size M j) = (u\<^sub>v (dim_row M) \<^sub>v* M) $ j
u\<^sub>v (dim_row M) \<^sub>v* M = int k \<cdot>\<^sub>v u\<^sub>v (dim_col M)
j < dim_col M

goal (1 subgoal):
 1. mat_block_size M j = k
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
mat_block_size M j = k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_on_exp:
  fixes l :: real
  assumes "l \<ge> 0"
  shows   "convex_on UNIV (\<lambda>x. exp(l*x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_on UNIV (\<lambda>x. exp (l * x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> l

goal (1 subgoal):
 1. convex_on UNIV (\<lambda>x. exp (l * x))
[PROOF STEP]
by (intro convex_on_realI[where f' = "\<lambda>x. l * exp (l * x)"])
     (auto intro!: derivative_eq_intros mult_left_mono)


[STATEMENT]
lemma norm_cauchy_schwarz_abs_eq:
  "\<bar>x \<bullet> y\<bar> = norm x * norm y \<longleftrightarrow>
    norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x"
  (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
have th: "\<And>(x::real) a. a \<ge> 0 \<Longrightarrow> \<bar>x\<bar> = a \<longleftrightarrow> x = a \<or> x = - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a. 0 \<le> a \<Longrightarrow> (\<bar>x\<bar> = a) = (x = a \<or> x = - a)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 \<le> ?a \<Longrightarrow> (\<bar>?x\<bar> = ?a) = (?x = ?a \<or> ?x = - ?a)

goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
have "?rhs \<longleftrightarrow> norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm (- x) *\<^sub>R y = norm y *\<^sub>R (- x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm (- x) *\<^sub>R y = norm y *\<^sub>R - x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm (- x) *\<^sub>R y = norm y *\<^sub>R - x)

goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm (- x) *\<^sub>R y = norm y *\<^sub>R - x)

goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (x \<bullet> y = norm x * norm y \<or> (- x) \<bullet> y = norm x * norm y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm (- x) *\<^sub>R y = norm y *\<^sub>R - x) = (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y)
[PROOF STEP]
unfolding norm_cauchy_schwarz_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm (- x) * norm y) = (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y)
[PROOF STEP]
unfolding norm_minus_cancel norm_scaleR
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y) = (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm (- x) *\<^sub>R y = norm y *\<^sub>R - x) = (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y)

goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm (- x) *\<^sub>R y = norm y *\<^sub>R - x) = (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y)

goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)
[PROOF STEP]
unfolding th[OF mult_nonneg_nonneg, OF norm_ge_zero[of x] norm_ge_zero[of y]] inner_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y) = (x \<bullet> y = norm x * norm y \<or> x \<bullet> y = - (norm x * norm y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x \<bullet> y = norm x * norm y \<or> - x \<bullet> y = norm x * norm y) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)

goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)

goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<bar>x \<bullet> y\<bar> = norm x * norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x \<or> norm x *\<^sub>R y = - norm y *\<^sub>R x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UN_atLeast_UNIV: "(\<Union>n. atLeast (k - int n)) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. {k - int n..}) = UNIV
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<exists>xa. k - int xa \<le> x
[PROOF STEP]
apply (rule_tac x = "nat (k - x)" in exI, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Ln_times_ii:
  assumes "z \<noteq> 0"
    shows  "Ln(\<i> * z) = (if 0 \<le> Re(z) | Im(z) < 0
                          then Ln(z) + \<i> * of_real pi/2
                          else Ln(z) - \<i> * of_real(3 * pi/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ln (\<i> * z) = (if 0 \<le> Re z \<or> Im z < 0 then Ln z + \<i> * complex_of_real pi / 2 else Ln z - \<i> * complex_of_real (3 * pi / 2))
[PROOF STEP]
using Im_Ln_le_pi [of z] mpi_less_Im_Ln [of z] assms
        Im_Ln_eq_pi [of z] Im_Ln_pos_lt [of z] Re_Ln_pos_le [of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0 \<Longrightarrow> Im (Ln z) \<le> pi
z \<noteq> 0 \<Longrightarrow> - pi < Im (Ln z)
z \<noteq> 0
z \<noteq> 0 \<Longrightarrow> (Im (Ln z) = pi) = (Re z < 0 \<and> Im z = 0)
z \<noteq> 0 \<Longrightarrow> (0 < Im (Ln z) \<and> Im (Ln z) < pi) = (0 < Im z)
z \<noteq> 0 \<Longrightarrow> (\<bar>Im (Ln z)\<bar> \<le> pi / 2) = (0 \<le> Re z)

goal (1 subgoal):
 1. Ln (\<i> * z) = (if 0 \<le> Re z \<or> Im z < 0 then Ln z + \<i> * complex_of_real pi / 2 else Ln z - \<i> * complex_of_real (3 * pi / 2))
[PROOF STEP]
by (simp add: Ln_times) auto


[STATEMENT]
lemma is_interval_connected:
  fixes S :: "'a::euclidean_space set"
  shows "is_interval S \<Longrightarrow> connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interval S \<Longrightarrow> connected S
[PROOF STEP]
using is_interval_convex convex_connected
[PROOF STATE]
proof (prove)
using this:
is_interval ?S \<Longrightarrow> convex ?S
convex ?S \<Longrightarrow> connected ?S

goal (1 subgoal):
 1. is_interval S \<Longrightarrow> connected S
[PROOF STEP]
by auto


[STATEMENT]
lemma diag_block_mat_mat_conj:
  assumes "length Al = length Bl"
  and "\<forall>i < length Al. dim_col (Al!i) = dim_row (Bl!i)"
  and "\<forall>i < length Al. dim_row (Bl!i) = dim_col (Bl!i)"
  shows "mat_conj (diag_block_mat Al) (diag_block_mat Bl) =
    diag_block_mat (map2 mat_conj Al Bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
have "mat_conj (diag_block_mat Al) (diag_block_mat Bl) =
    diag_block_mat Al * diag_block_mat Bl *
    diag_block_mat (map Complex_Matrix.adjoint Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al)
[PROOF STEP]
using diag_block_mat_adjoint[of Al]
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (diag_block_mat Al) = diag_block_mat (map Complex_Matrix.adjoint Al)

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al)
[PROOF STEP]
unfolding mat_conj_def
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (diag_block_mat Al) = diag_block_mat (map Complex_Matrix.adjoint Al)

goal (1 subgoal):
 1. diag_block_mat Al * diag_block_mat Bl * Complex_Matrix.adjoint (diag_block_mat Al) = diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al)

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al)

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
have "... = diag_block_mat (map2 (*) Al Bl) *
    diag_block_mat (map Complex_Matrix.adjoint Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al) = diag_block_mat (map2 (*) Al Bl) * diag_block_mat (map Complex_Matrix.adjoint Al)
[PROOF STEP]
using diag_block_mat_mult[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
diag_block_mat Al * diag_block_mat Bl = diag_block_mat (map2 (*) Al Bl)

goal (1 subgoal):
 1. diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al) = diag_block_mat (map2 (*) Al Bl) * diag_block_mat (map Complex_Matrix.adjoint Al)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al) = diag_block_mat (map2 (*) Al Bl) * diag_block_mat (map Complex_Matrix.adjoint Al)

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
diag_block_mat Al * diag_block_mat Bl * diag_block_mat (map Complex_Matrix.adjoint Al) = diag_block_mat (map2 (*) Al Bl) * diag_block_mat (map Complex_Matrix.adjoint Al)

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
have "... = diag_block_mat (map2 (*) (map2 (*) Al Bl)
    (map Complex_Matrix.adjoint Al))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (map2 (*) Al Bl) * diag_block_mat (map Complex_Matrix.adjoint Al) = diag_block_mat (map2 (*) (map2 (*) Al Bl) (map Complex_Matrix.adjoint Al))
[PROOF STEP]
proof (rule diag_block_mat_mult)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (map2 (*) Al Bl) = length (map Complex_Matrix.adjoint Al)
 2. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_row (map Complex_Matrix.adjoint Al ! i)
[PROOF STEP]
show "length (map2 (*) Al Bl) = length (map Complex_Matrix.adjoint Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map2 (*) Al Bl) = length (map Complex_Matrix.adjoint Al)
[PROOF STEP]
by (simp add: assms(1))
[PROOF STATE]
proof (state)
this:
length (map2 (*) Al Bl) = length (map Complex_Matrix.adjoint Al)

goal (1 subgoal):
 1. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_row (map Complex_Matrix.adjoint Al ! i)
[PROOF STEP]
show "\<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) =
      dim_row (map Complex_Matrix.adjoint Al ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_row (map Complex_Matrix.adjoint Al ! i)
[PROOF STEP]
by (simp add: assms(2) assms(3))
[PROOF STATE]
proof (state)
this:
\<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_row (map Complex_Matrix.adjoint Al ! i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
diag_block_mat (map2 (*) Al Bl) * diag_block_mat (map Complex_Matrix.adjoint Al) = diag_block_mat (map2 (*) (map2 (*) Al Bl) (map Complex_Matrix.adjoint Al))

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
diag_block_mat (map2 (*) Al Bl) * diag_block_mat (map Complex_Matrix.adjoint Al) = diag_block_mat (map2 (*) (map2 (*) Al Bl) (map Complex_Matrix.adjoint Al))

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
have "... = diag_block_mat (map2 mat_conj Al Bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (map2 (*) (map2 (*) Al Bl) (map Complex_Matrix.adjoint Al)) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
using map2_mat_conj_exp[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
map2 (*) (map2 (*) Al Bl) (map Complex_Matrix.adjoint Al) = map2 mat_conj Al Bl

goal (1 subgoal):
 1. diag_block_mat (map2 (*) (map2 (*) Al Bl) (map Complex_Matrix.adjoint Al)) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat (map2 (*) (map2 (*) Al Bl) (map Complex_Matrix.adjoint Al)) = diag_block_mat (map2 mat_conj Al Bl)

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)

goal (1 subgoal):
 1. mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mat_conj (diag_block_mat Al) (diag_block_mat Bl) = diag_block_mat (map2 mat_conj Al Bl)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_B_mono: assumes "\<And> i. v $ i \<ge> w $ i"
  shows "(B *v v) $ i \<ge> (B *v w) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B *v w) $h i \<le> (B *v v) $h i
[PROOF STEP]
unfolding matrix_vector_mult_def vec_lambda_beta
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. B $h i $h j * w $h j) \<le> (\<Sum>j\<in>UNIV. B $h i $h j * v $h j)
[PROOF STEP]
by (rule sum_mono, rule mult_left_mono[OF assms], unfold B_norm, auto)


[STATEMENT]
lemma ord_eq_Suc_0_iff: "ord n (x::nat) = Suc 0 \<longleftrightarrow> [x = 1] (mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ord n x = Suc 0) = [x = 1] (mod n)
[PROOF STEP]
using ord_divides[of x 1 n]
[PROOF STATE]
proof (prove)
using this:
[x ^ 1 = 1] (mod n) = is_unit (ord n x)

goal (1 subgoal):
 1. (ord n x = Suc 0) = [x = 1] (mod n)
[PROOF STEP]
by (auto simp: ord_divides')


[STATEMENT]
lemma log2_of_power_less: "\<lbrakk> m < 2 ^ n; m > 0 \<rbrakk> \<Longrightarrow> log 2 m < n" for m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m < 2 ^ n; 0 < m\<rbrakk> \<Longrightarrow> log 2 (real m) < real n
[PROOF STEP]
using log_of_power_less[of _ 2]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>real ?m < 2 ^ ?n; 1 < 2; 0 < ?m\<rbrakk> \<Longrightarrow> log 2 (real ?m) < real ?n

goal (1 subgoal):
 1. \<lbrakk>m < 2 ^ n; 0 < m\<rbrakk> \<Longrightarrow> log 2 (real m) < real n
[PROOF STEP]
by simp


[STATEMENT]
lemma ivl_integral_has_vector_derivative_subset:
  fixes f :: "real \<Rightarrow> 'a::banach"
  assumes "continuous_on (closed_segment a b) f"
    and "x \<in> closed_segment a b"
    and "c \<in> closed_segment a b"
  shows "((\<lambda>u. ivl_integral c u f) has_vector_derivative f x) (at x within closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vector_derivative f x) (at x within closed_segment a b)
[PROOF STEP]
using ivl_integral_has_vderiv_on_subset_segment[OF assms(1)] assms(2-)
[PROOF STATE]
proof (prove)
using this:
?c \<in> closed_segment a b \<Longrightarrow> ((\<lambda>u. ivl_integral ?c u f) has_vderiv_on f) (closed_segment a b)
x \<in> closed_segment a b
c \<in> closed_segment a b

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vector_derivative f x) (at x within closed_segment a b)
[PROOF STEP]
by (auto simp: has_vderiv_on_def)


[STATEMENT]
lemma cos_periodic_nat [simp]:
  fixes n :: nat
  shows "cos (x + n * (2 * pi)) = cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + real n * (2 * pi)) = cos x
[PROOF STEP]
by (metis add.left_neutral cos_2npi cos_add cos_periodic mult.assoc mult_2 mult_2_right of_nat_numeral sin_periodic sin_periodic_nat)


[STATEMENT]
lemma  cross_cross_det: "(w \<times> x) \<times> (y \<times> z) = det(vector[w,x,z]) *\<^sub>R y - det(vector[w,x,y]) *\<^sub>R z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w \<times> x) \<times> y \<times> z = det (vector [w, x, z]) *\<^sub>R y - det (vector [w, x, y]) *\<^sub>R z
[PROOF STEP]
using exhaust_3
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2 \<or> ?x = 3

goal (1 subgoal):
 1. (w \<times> x) \<times> y \<times> z = det (vector [w, x, z]) *\<^sub>R y - det (vector [w, x, y]) *\<^sub>R z
[PROOF STEP]
by (force simp add: cross3_simps)


[STATEMENT]
lemma homotopy_eqv_rel_frontier_punctured_convex:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S" "bounded S" "a \<in> rel_interior S" "convex T" "rel_frontier S \<subseteq> T" "T \<subseteq> affine hull S"
  shows "(rel_frontier S) homotopy_eqv (T - {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier S homotopy_eqv T - {a}
[PROOF STEP]
apply (rule rel_frontier_deformation_retract_of_punctured_convex [of S T])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. convex S
 2. convex T
 3. bounded S
 4. ?a \<in> rel_interior S
 5. rel_frontier S \<subseteq> T
 6. T \<subseteq> affine hull S
 7. \<And>r. \<lbrakk>homotopic_with_canon (\<lambda>x. True) (T - {?a}) (T - {?a}) id r; retraction (T - {?a}) (rel_frontier S) r\<rbrakk> \<Longrightarrow> rel_frontier S homotopy_eqv T - {a}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
convex S
bounded S
a \<in> rel_interior S
convex T
rel_frontier S \<subseteq> T
T \<subseteq> affine hull S

goal (7 subgoals):
 1. convex S
 2. convex T
 3. bounded S
 4. ?a \<in> rel_interior S
 5. rel_frontier S \<subseteq> T
 6. T \<subseteq> affine hull S
 7. \<And>r. \<lbrakk>homotopic_with_canon (\<lambda>x. True) (T - {?a}) (T - {?a}) id r; retraction (T - {?a}) (rel_frontier S) r\<rbrakk> \<Longrightarrow> rel_frontier S homotopy_eqv T - {a}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>homotopic_with_canon (\<lambda>x. True) (T - {a}) (T - {a}) id r; retraction (T - {a}) (rel_frontier S) r; convex S; bounded S; a \<in> rel_interior S; convex T; rel_frontier S \<subseteq> T; T \<subseteq> affine hull S\<rbrakk> \<Longrightarrow> rel_frontier S homotopy_eqv T - {a}
[PROOF STEP]
using deformation_retract_imp_homotopy_eqv homotopy_equivalent_space_sym
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>homotopic_with_canon (\<lambda>x. True) ?S ?S id ?r; retraction ?S ?T ?r\<rbrakk> \<Longrightarrow> ?S homotopy_eqv ?T
(?X homotopy_equivalent_space ?Y) = (?Y homotopy_equivalent_space ?X)

goal (1 subgoal):
 1. \<And>r. \<lbrakk>homotopic_with_canon (\<lambda>x. True) (T - {a}) (T - {a}) id r; retraction (T - {a}) (rel_frontier S) r; convex S; bounded S; a \<in> rel_interior S; convex T; rel_frontier S \<subseteq> T; T \<subseteq> affine hull S\<rbrakk> \<Longrightarrow> rel_frontier S homotopy_eqv T - {a}
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_set2:
  assumes "card A = n" and "finite A"
  shows "finite {xs. set xs = A \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. set xs = A \<and> distinct xs}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {xs. set xs = A \<and> distinct xs}
[PROOF STEP]
have "{xs. set xs = A \<and> distinct xs} \<subseteq> {xs. set xs = A \<and> length xs = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. set xs = A \<and> distinct xs} \<subseteq> {xs. set xs = A \<and> length xs = n}
[PROOF STEP]
using assms(1) distinct_card
[PROOF STATE]
proof (prove)
using this:
card A = n
distinct ?xs \<Longrightarrow> card (set ?xs) = length ?xs

goal (1 subgoal):
 1. {xs. set xs = A \<and> distinct xs} \<subseteq> {xs. set xs = A \<and> length xs = n}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{xs. set xs = A \<and> distinct xs} \<subseteq> {xs. set xs = A \<and> length xs = n}

goal (1 subgoal):
 1. finite {xs. set xs = A \<and> distinct xs}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{xs. set xs = A \<and> distinct xs} \<subseteq> {xs. set xs = A \<and> length xs = n}

goal (1 subgoal):
 1. finite {xs. set xs = A \<and> distinct xs}
[PROOF STEP]
by (metis (no_types, lifting) finite_lists_length_eqE[OF \<open>finite A\<close>, of n] finite_subset)
[PROOF STATE]
proof (state)
this:
finite {xs. set xs = A \<and> distinct xs}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma b_least_less_impl_eq: "b_least f x < x \<Longrightarrow> (b_least f x) = (Least (%y. (f x y) \<noteq> 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
assume A1: "b_least f x < x" (is "?b < _")
[PROOF STATE]
proof (state)
this:
b_least f x < x

goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
let ?B = "(Least (%y. (f x y) \<noteq> 0))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
b_least f x < x
[PROOF STEP]
have S1: "f x ?b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
b_least f x < x

goal (1 subgoal):
 1. f x (b_least f x) \<noteq> 0
[PROOF STEP]
by (rule b_least_less_impl_nz)
[PROOF STATE]
proof (state)
this:
f x (b_least f x) \<noteq> 0

goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
f x (b_least f x) \<noteq> 0
[PROOF STEP]
have S2: "?B  \<le> ?b"
[PROOF STATE]
proof (prove)
using this:
f x (b_least f x) \<noteq> 0

goal (1 subgoal):
 1. (LEAST y. f x y \<noteq> 0) \<le> b_least f x
[PROOF STEP]
by (rule Least_le)
[PROOF STATE]
proof (state)
this:
(LEAST y. f x y \<noteq> 0) \<le> b_least f x

goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
f x (b_least f x) \<noteq> 0
[PROOF STEP]
have S3: "f x ?B \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f x (b_least f x) \<noteq> 0

goal (1 subgoal):
 1. f x (LEAST y. f x y \<noteq> 0) \<noteq> 0
[PROOF STEP]
by (rule LeastI)
[PROOF STATE]
proof (state)
this:
f x (LEAST y. f x y \<noteq> 0) \<noteq> 0

goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
from S3
[PROOF STATE]
proof (chain)
picking this:
f x (LEAST y. f x y \<noteq> 0) \<noteq> 0
[PROOF STEP]
have S4: "?b \<le> ?B"
[PROOF STATE]
proof (prove)
using this:
f x (LEAST y. f x y \<noteq> 0) \<noteq> 0

goal (1 subgoal):
 1. b_least f x \<le> (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
by (rule nz_impl_b_least_le)
[PROOF STATE]
proof (state)
this:
b_least f x \<le> (LEAST y. f x y \<noteq> 0)

goal (1 subgoal):
 1. b_least f x < x \<Longrightarrow> b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
from S2 S4
[PROOF STATE]
proof (chain)
picking this:
(LEAST y. f x y \<noteq> 0) \<le> b_least f x
b_least f x \<le> (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(LEAST y. f x y \<noteq> 0) \<le> b_least f x
b_least f x \<le> (LEAST y. f x y \<noteq> 0)

goal (1 subgoal):
 1. b_least f x = (LEAST y. f x y \<noteq> 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b_least f x = (LEAST y. f x y \<noteq> 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infchain_outruns_all:
  assumes "finite (UNIV :: 'a set)"
    and "\<forall>i :: nat. ((\<tau> :: 'a set \<Rightarrow> 'a set)^^ i) ({}:: 'a set) \<subset> (\<tau> ^^ (i + 1)) {}"
  shows "\<forall>j :: nat. \<exists>i :: nat. j < card ((\<tau> ^^ i) {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j. \<exists>i. j < card ((\<tau> ^^ i) {})
[PROOF STEP]
proof (rule allI, induct_tac j)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j. \<exists>i. 0 < card ((\<tau> ^^ i) {})
 2. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
show "\<exists>i. 0 < card ((\<tau> ^^ i) {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. 0 < card ((\<tau> ^^ i) {})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite UNIV
\<forall>i. (\<tau> ^^ i) {} \<subset> (\<tau> ^^ (i + 1)) {}

goal (1 subgoal):
 1. \<exists>i. 0 < card ((\<tau> ^^ i) {})
[PROOF STEP]
by (metis bot.not_eq_extremum card_gt_0_iff finite_subset subset_UNIV)
[PROOF STATE]
proof (state)
this:
\<exists>i. 0 < card ((\<tau> ^^ i) {})

goal (1 subgoal):
 1. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
show "\<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {})
             \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
fix j n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
assume a: "\<exists>i. n < card ((\<tau> ^^ i) {})"
[PROOF STATE]
proof (state)
this:
\<exists>i. n < card ((\<tau> ^^ i) {})

goal (1 subgoal):
 1. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
obtain i where "n < card ((\<tau> ^^ i) {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
\<exists>i. n < card ((\<tau> ^^ i) {})

goal (1 subgoal):
 1. (\<And>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n < card ((\<tau> ^^ i) {})

goal (1 subgoal):
 1. \<And>j n. \<exists>i. n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
thus "\<exists> i. Suc n < card ((\<tau> ^^ i) {})"
[PROOF STATE]
proof (prove)
using this:
n < card ((\<tau> ^^ i) {})

goal (1 subgoal):
 1. \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n < card ((\<tau> ^^ i) {})
finite UNIV
\<forall>i. (\<tau> ^^ i) {} \<subset> (\<tau> ^^ (i + 1)) {}

goal (1 subgoal):
 1. \<exists>i. Suc n < card ((\<tau> ^^ i) {})
[PROOF STEP]
by (meson finite_subset le_less_trans le_simps(3) psubset_card_mono subset_UNIV)
[PROOF STATE]
proof (state)
this:
\<exists>i. Suc n < card ((\<tau> ^^ i) {})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>i. ?n < card ((\<tau> ^^ i) {}) \<Longrightarrow> \<exists>i. Suc ?n < card ((\<tau> ^^ i) {})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sinh_real_less_iff [simp]: "sinh x < sinh y \<longleftrightarrow> x < (y::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sinh x < sinh y) = (x < y)
[PROOF STEP]
using sinh_real_strict_mono
[PROOF STATE]
proof (prove)
using this:
strict_mono sinh

goal (1 subgoal):
 1. (sinh x < sinh y) = (x < y)
[PROOF STEP]
by (simp add: strict_mono_less)


[STATEMENT]
lemma zero_less_Fract_iff: "0 < b \<Longrightarrow> 0 < Fract a b \<longleftrightarrow> 0 < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (0 < Fract a b) = (0 < a)
[PROOF STEP]
by (simp add: Zero_rat_def zero_less_mult_iff)


[STATEMENT]
lemma unitary_is_length_preserving_bis [simp]:
  fixes U::"complex mat" and v::"complex mat"
  assumes "unitary U" and "dim_row v = dim_col U" and "dim_col v = 1"
  shows "\<parallel>col (U * v) 0\<parallel> = \<parallel>col v 0\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel> = \<parallel>col v 0\<parallel>
[PROOF STEP]
using assms unitary_is_sq_length_preserving_bis
[PROOF STATE]
proof (prove)
using this:
unitary U
dim_row v = dim_col U
dim_col v = 1
\<lbrakk>unitary ?U; dim_row ?v = dim_col ?U; dim_col ?v = 1\<rbrakk> \<Longrightarrow> \<parallel>col (?U * ?v) 0\<parallel>\<^sup>2 = \<parallel>col ?v 0\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel> = \<parallel>col v 0\<parallel>
[PROOF STEP]
by (metis cpx_vec_length_inner_prod inner_prod_csqrt of_real_hom.injectivity)