[STATEMENT]
lemma lcm_least_iff [simp]: "lcm a b dvd c \<longleftrightarrow> a dvd c \<and> b dvd c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lcm a b dvd c) = (a dvd c \<and> b dvd c)
[PROOF STEP]
by (blast intro!: lcm_least intro: dvd_trans)


[STATEMENT]
lemma second_countable_metric_dense_subset:
  "\<exists>A::'a::{metric_space, second_countable_topology} set. countable A \<and> closure A = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV
[PROOF STEP]
using ex_countable_basis
[PROOF STATE]
proof (prove)
using this:
\<exists>B. countable B \<and> topological_basis B

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV
[PROOF STEP]
by (auto simp add: second_countable_iff_dense_countable_subset[symmetric])


[STATEMENT]
lemma bounded_linear_mult_right: "bounded_linear (\<lambda>y::'a::real_normed_algebra. x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear ((*) x)
[PROOF STEP]
using bounded_bilinear_mult
[PROOF STATE]
proof (prove)
using this:
bounded_bilinear (*)

goal (1 subgoal):
 1. bounded_linear ((*) x)
[PROOF STEP]
by (rule bounded_bilinear.bounded_linear_right)


[STATEMENT]
lemma fiter_inductl:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "mono f \<Longrightarrow> mono g \<Longrightarrow> h \<le> f \<sqinter> (g \<circ> h) \<Longrightarrow> h \<le> fiter f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g; h \<le> f \<sqinter> (g \<circ> h)\<rbrakk> \<Longrightarrow> h \<le> fiter f g
[PROOF STEP]
by (simp add: fiter_def fiter_fun_def gfp_upperbound)


[STATEMENT]
lemma n_mult_add:
  assumes "p \<in> carrier P"
  assumes "q \<in> carrier P"
  shows "n_mult (p \<oplus>\<^bsub>P\<^esub> q) = n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_mult (p \<oplus>\<^bsub>P\<^esub> q) = n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q
[PROOF STEP]
proof(rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. n_mult (p \<oplus>\<^bsub>P\<^esub> q) x = (n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. n_mult (p \<oplus>\<^bsub>P\<^esub> q) x = (n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q) x
[PROOF STEP]
show "n_mult (p \<oplus>\<^bsub>P\<^esub> q) x = (n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_mult (p \<oplus>\<^bsub>P\<^esub> q) x = (n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q) x
[PROOF STEP]
using assms R.add.nat_pow_distrib[of "p x" "q x" x]  cfs_add[of p q x]
        cfs_add[of "n_mult p" "n_mult q" x] n_mult_closed
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier P
q \<in> carrier P
\<lbrakk>p x \<in> carrier R; q x \<in> carrier R\<rbrakk> \<Longrightarrow> [x] \<cdot> (p x \<oplus> q x) = [x] \<cdot> p x \<oplus> [x] \<cdot> q x
\<lbrakk>p \<in> carrier P; q \<in> carrier P\<rbrakk> \<Longrightarrow> (p \<oplus>\<^bsub>P\<^esub> q) x = p x \<oplus> q x
\<lbrakk>n_mult p \<in> carrier P; n_mult q \<in> carrier P\<rbrakk> \<Longrightarrow> (n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q) x = n_mult p x \<oplus> n_mult q x
?f \<in> carrier P \<Longrightarrow> n_mult ?f \<in> carrier P

goal (1 subgoal):
 1. n_mult (p \<oplus>\<^bsub>P\<^esub> q) x = (n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q) x
[PROOF STEP]
unfolding n_mult_def
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier P
q \<in> carrier P
\<lbrakk>p x \<in> carrier R; q x \<in> carrier R\<rbrakk> \<Longrightarrow> [x] \<cdot> (p x \<oplus> q x) = [x] \<cdot> p x \<oplus> [x] \<cdot> q x
\<lbrakk>p \<in> carrier P; q \<in> carrier P\<rbrakk> \<Longrightarrow> (p \<oplus>\<^bsub>P\<^esub> q) x = p x \<oplus> q x
\<lbrakk>(\<lambda>n. [n] \<cdot> p n) \<in> carrier P; (\<lambda>n. [n] \<cdot> q n) \<in> carrier P\<rbrakk> \<Longrightarrow> ((\<lambda>n. [n] \<cdot> p n) \<oplus>\<^bsub>P\<^esub> (\<lambda>n. [n] \<cdot> q n)) x = [x] \<cdot> p x \<oplus> [x] \<cdot> q x
?f \<in> carrier P \<Longrightarrow> (\<lambda>n. [n] \<cdot> ?f n) \<in> carrier P

goal (1 subgoal):
 1. [x] \<cdot> (p \<oplus>\<^bsub>P\<^esub> q) x = ((\<lambda>n. [n] \<cdot> p n) \<oplus>\<^bsub>P\<^esub> (\<lambda>n. [n] \<cdot> q n)) x
[PROOF STEP]
by (simp add: cfs_closed)
[PROOF STATE]
proof (state)
this:
n_mult (p \<oplus>\<^bsub>P\<^esub> q) x = (n_mult p \<oplus>\<^bsub>P\<^esub> n_mult q) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma choose_even_sum:
  assumes "n > 0"
  shows "2 * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else 0) = (2 ^ n :: 'a::comm_ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "2 ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (-1) ^ i * of_nat (n choose i) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
using choose_row_sum[of n]
[PROOF STATE]
proof (prove)
using this:
sum ((choose) n) {..n} = 2 ^ n

goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: choose_alternating_sum assms atLeast0AtMost of_nat_sum[symmetric])
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) + (-1) ^ i * of_nat (n choose i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = 2 * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
by (subst sum_distrib_left, intro sum.cong) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_insert_insert:
  fixes a::real
  shows "Sup (insert a (insert b s)) = Sup (insert (max a b) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (insert a (insert b s)) = Sup (insert (max a b) s)
[PROOF STEP]
by (simp add: Sup_real_def)


[STATEMENT]
lemma incomparable_minimal_antichain[simp]: "incomparable (minimal_antichain A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incomparable (minimal_antichain A)
[PROOF STEP]
unfolding incomparable_def minimal_antichain_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{x \<in> A. \<not> (\<exists>y\<in>A. y < x)}. \<forall>y\<in>{x \<in> A. \<not> (\<exists>y\<in>A. y < x)}. x \<noteq> y \<longrightarrow> \<not> x < y \<and> \<not> y < x
[PROOF STEP]
by auto


[STATEMENT]
lemma ereal_of_enat_SUP:
  "A \<noteq> {} \<Longrightarrow> ereal_of_enat (SUP a\<in>A. f a) = (SUP a \<in> A. ereal_of_enat (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> ereal_of_enat (Sup (f ` A)) = (SUP a\<in>A. ereal_of_enat (f a))
[PROOF STEP]
by (simp add: ereal_of_enat_Sup image_comp)


[STATEMENT]
lemma non_dummy_eq_o_funPair: "non_dummy = (% (g,a,r). (| giv = g, ask = a, rel = r |)) o
                              (funPair giv (funPair ask rel))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. non_dummy = (\<lambda>(g, a, r). \<lparr>giv = g, ask = a, rel = r\<rparr>) \<circ> funPair giv (funPair ask rel)
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. non_dummy x = ((\<lambda>(g, a, r). \<lparr>giv = g, ask = a, rel = r\<rparr>) \<circ> funPair giv (funPair ask rel)) x
[PROOF STEP]
apply (auto simp add: o_def non_dummy_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma powr_complexpow [simp]:
  fixes x::complex shows "x \<noteq> 0 \<Longrightarrow> x powr (of_nat n) = x^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> x powr of_nat n = x ^ n
[PROOF STEP]
by (induct n) (auto simp: ac_simps powr_add)


[STATEMENT]
lemma wf_tuple_map_Some: "length xs = n \<Longrightarrow> {0..<n} \<subseteq> A \<Longrightarrow> wf_tuple n A (map Some xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = n; {0..<n} \<subseteq> A\<rbrakk> \<Longrightarrow> wf_tuple n A (map Some xs)
[PROOF STEP]
unfolding wf_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = n; {0..<n} \<subseteq> A\<rbrakk> \<Longrightarrow> length (map Some xs) = n \<and> (\<forall>i<n. (map Some xs ! i = None) = (i \<notin> A))
[PROOF STEP]
by auto


[STATEMENT]
lemma set_mult_is_times: "set_mult A B = A * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mult A B = A * B
[PROOF STEP]
unfolding set_mult_def set_times_def func_times
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<lambda>x. f x * g x |f g. f \<in> A \<and> g \<in> B} = {c. \<exists>a\<in>A. \<exists>b\<in>B. c = (\<lambda>x. a x * b x)}
[PROOF STEP]
by blast


[STATEMENT]
lemma Max_by_UNION_distrib:
  "\<lbrakk>finite A; A = (\<Union>x\<in>S. f x); S \<noteq> {}; {} \<notin> f ` S; inj_on cmp_f A\<rbrakk> \<Longrightarrow>
    Max_by cmp_f A = Max_by cmp_f (Max_by cmp_f ` (f ` S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A = \<Union> (f ` S); S \<noteq> {}; {} \<notin> f ` S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f A = Max_by cmp_f (Max_by cmp_f ` f ` S)
[PROOF STEP]
by(force intro!: Max_by_Union_distrib)


[STATEMENT]
lemma minus_mult_vec_commute: "(- p) ** q = p ** (- q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p ** q = p ** - q
[PROOF STEP]
by (simp add: mult_vec_minus_mult_left mult_vec_minus_mult_right)


[STATEMENT]
theorem isRevNth_equals:
assumes a: "reach s" and r: "isRevNth s confID uID papID m" "isRevNth s confID uID papID n"
shows "m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = n
[PROOF STEP]
using isRevNth_equals1[OF a] r
[PROOF STATE]
proof (prove)
using this:
isRevNth_equals s
isRevNth s confID uID papID m
isRevNth s confID uID papID n

goal (1 subgoal):
 1. m = n
[PROOF STEP]
unfolding isRevNth_equals_def
[PROOF STATE]
proof (prove)
using this:
\<forall>confID uID papID m n. isRevNth s confID uID papID m \<and> isRevNth s confID uID papID n \<longrightarrow> m = n
isRevNth s confID uID papID m
isRevNth s confID uID papID n

goal (1 subgoal):
 1. m = n
[PROOF STEP]
by blast


[STATEMENT]
lemma variation_mult_neg_2:
  assumes "c<0"
  shows "variation x (c*y) = variation x y + (if x=0 then 0 else - sign y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. variation x (c * y) = variation x y + (if x = 0 then 0 else - sign y)
[PROOF STEP]
unfolding variation_comm[of x "c*y", unfolded variation_mult_neg_1[OF \<open>c<0\<close>, of y x] ]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (variation y x + (if x = 0 then 0 else sign y)) = variation x y + (if x = 0 then 0 else - sign y)
[PROOF STEP]
by (auto,subst variation_comm,simp)


[STATEMENT]
lemma tendsto_zero_divide_iff [simp]:
  fixes c::"'a::{topological_semigroup_mult,field}" assumes "c \<noteq> 0" shows "(\<lambda>n. a n / c)\<longlonglongrightarrow> 0 \<longleftrightarrow> a \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a n / c) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using tendsto_zero_mult_right_iff [of "1/c" a] assms
[PROOF STATE]
proof (prove)
using this:
(1::'a) / c \<noteq> (0::'a) \<Longrightarrow> (\<lambda>n. a n * ((1::'a) / c)) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
c \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. a n / c) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma lift_01_vec_count:
  assumes "set\<^sub>v v \<subseteq> {0, 1}"
  assumes "x \<in> {0, 1}"
  shows "count_vec v x = count_vec (lift_01_vec v) (of_zero_neq_one x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec v x = count_vec (lift_01_vec v) (of_zero_neq_one x)
[PROOF STEP]
using of_injective_lim.lim_inj_hom_count_vec
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set\<^sub>v ?v \<subseteq> {0::?'a, 1::?'a}; ?x \<in> {0::?'a, 1::?'a}\<rbrakk> \<Longrightarrow> count_vec ?v ?x = count_vec (map_vec of_zero_neq_one ?v) (of_zero_neq_one ?x)

goal (1 subgoal):
 1. count_vec v x = count_vec (lift_01_vec v) (of_zero_neq_one x)
[PROOF STEP]
by (metis assms(1) assms(2) lift_01_vec_def)


[STATEMENT]
lemma zmult_pos_neg:"\<lbrakk>(0::int) < i; j < 0\<rbrakk> \<Longrightarrow> i * j < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; j < 0\<rbrakk> \<Longrightarrow> i * j < 0
[PROOF STEP]
apply (frule zmult_zless_mono_neg[of "0" "i" "j"], assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in domain) var_pow_closed:
  assumes "subring K R" shows "X [^]\<^bsub>K[X]\<^esub> (n :: nat) \<in> carrier (K[X])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X [^]\<^bsub>K [X]\<^esub> n \<in> carrier (K [X])
[PROOF STEP]
using monoid.nat_pow_closed[OF univ_poly_is_monoid[OF assms] var_closed(1)[OF assms]]
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>K [X]\<^esub> ?n \<in> carrier (K [X])

goal (1 subgoal):
 1. X [^]\<^bsub>K [X]\<^esub> n \<in> carrier (K [X])
[PROOF STEP]
.


[STATEMENT]
lemma diag_mat_transpose[simp]: "dim_row A = dim_col A \<Longrightarrow>
  diag_mat (transpose_mat A) = diag_mat A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = dim_col A \<Longrightarrow> diag_mat (transpose_mat A) = diag_mat A
[PROOF STEP]
unfolding diag_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = dim_col A \<Longrightarrow> map (\<lambda>i. transpose_mat A $$ (i, i)) [0..<dim_row (transpose_mat A)] = map (\<lambda>i. A $$ (i, i)) [0..<dim_row A]
[PROOF STEP]
by auto


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


[STATEMENT]
lemma choose_even_sum:
  assumes "n > 0"
  shows "2 * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else 0) = (2 ^ n :: 'a::comm_ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "2 ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (-1) ^ i * of_nat (n choose i) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
using choose_row_sum[of n]
[PROOF STATE]
proof (prove)
using this:
sum ((choose) n) {..n} = 2 ^ n

goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: choose_alternating_sum assms atLeast0AtMost of_nat_sum[symmetric])
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) + (-1) ^ i * of_nat (n choose i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = 2 * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
by (subst sum_distrib_left, intro sum.cong) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma separating_hyperplane_sets:
  fixes S T :: "'a::euclidean_space set"
  assumes "convex S"
    and "convex T"
    and "S \<noteq> {}"
    and "T \<noteq> {}"
    and "S \<inter> T = {}"
  shows "\<exists>a b. a \<noteq> 0 \<and> (\<forall>x\<in>S. inner a x \<le> b) \<and> (\<forall>x\<in>T. inner a x \<ge> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)
[PROOF STEP]
from separating_hyperplane_set_0[OF convex_differences[OF assms(2,1)]]
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<notin> (\<Union>x\<in>T. \<Union>y\<in>S. {x - y}) \<Longrightarrow> \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>\<Union>x\<in>T. \<Union>y\<in>S. {x - y}. 0 \<le> a \<bullet> x)
[PROOF STEP]
obtain a where "a \<noteq> 0" "\<forall>x\<in>{x - y |x y. x \<in> T \<and> y \<in> S}. 0 \<le> inner a x"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<notin> (\<Union>x\<in>T. \<Union>y\<in>S. {x - y}) \<Longrightarrow> \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>\<Union>x\<in>T. \<Union>y\<in>S. {x - y}. 0 \<le> a \<bullet> x)

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); \<forall>x\<in>{x - y |x y. x \<in> T \<and> y \<in> S}. 0 \<le> a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(3-5)
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<notin> (\<Union>x\<in>T. \<Union>y\<in>S. {x - y}) \<Longrightarrow> \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>\<Union>x\<in>T. \<Union>y\<in>S. {x - y}. 0 \<le> a \<bullet> x)
S \<noteq> {}
T \<noteq> {}
S \<inter> T = {}

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); \<forall>x\<in>{x - y |x y. x \<in> T \<and> y \<in> S}. 0 \<le> a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)
\<forall>x\<in>{x - y |x y. x \<in> T \<and> y \<in> S}. 0 \<le> a \<bullet> x

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
\<forall>x\<in>{x - y |x y. x \<in> T \<and> y \<in> S}. 0 \<le> a \<bullet> x
[PROOF STEP]
have *: "\<And>x y. x \<in> T \<Longrightarrow> y \<in> S \<Longrightarrow> inner a y \<le> inner a x"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)
\<forall>x\<in>{x - y |x y. x \<in> T \<and> y \<in> S}. 0 \<le> a \<bullet> x

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> T; y \<in> S\<rbrakk> \<Longrightarrow> a \<bullet> y \<le> a \<bullet> x
[PROOF STEP]
by (force simp: inner_diff)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> T; ?y \<in> S\<rbrakk> \<Longrightarrow> a \<bullet> ?y \<le> a \<bullet> ?x

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> T; ?y \<in> S\<rbrakk> \<Longrightarrow> a \<bullet> ?y \<le> a \<bullet> ?x
[PROOF STEP]
have bdd: "bdd_above (((\<bullet>) a)`S)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> T; ?y \<in> S\<rbrakk> \<Longrightarrow> a \<bullet> ?y \<le> a \<bullet> ?x

goal (1 subgoal):
 1. bdd_above ((\<bullet>) a ` S)
[PROOF STEP]
using \<open>T \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> T; ?y \<in> S\<rbrakk> \<Longrightarrow> a \<bullet> ?y \<le> a \<bullet> ?x
T \<noteq> {}

goal (1 subgoal):
 1. bdd_above ((\<bullet>) a ` S)
[PROOF STEP]
by (auto intro: bdd_aboveI2[OF *])
[PROOF STATE]
proof (state)
this:
bdd_above ((\<bullet>) a ` S)

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)
[PROOF STEP]
using \<open>a\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)
[PROOF STEP]
by (intro exI[of _ a] exI[of _ "SUP x\<in>S. a \<bullet> x"])
       (auto intro!: cSUP_upper bdd cSUP_least \<open>a \<noteq> 0\<close> \<open>S \<noteq> {}\<close> *)
[PROOF STATE]
proof (state)
this:
\<exists>a b. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. a \<bullet> x \<le> b) \<and> (\<forall>x\<in>T. b \<le> a \<bullet> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bitAND_digit_mult:"(nth_bit (a && b) k) = (nth_bit a k) * (nth_bit b k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k
[PROOF STEP]
proof(induction k arbitrary: a b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a && b) \<exclamdown> 0 = a \<exclamdown> 0 * b \<exclamdown> 0
 2. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a b. (a && b) \<exclamdown> 0 = a \<exclamdown> 0 * b \<exclamdown> 0
 2. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a && b) \<exclamdown> 0 = a \<exclamdown> 0 * b \<exclamdown> 0
[PROOF STEP]
using nth_bit_def
[PROOF STATE]
proof (prove)
using this:
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2

goal (1 subgoal):
 1. (a && b) \<exclamdown> 0 = a \<exclamdown> 0 * b \<exclamdown> 0
[PROOF STEP]
by auto (metis (no_types, opaque_lifting) Groups.add_ac(2) bitAND_rec mod_mod_trivial
              mod_mult_self2 mult_numeral_1_right mult_zero_right not_mod_2_eq_1_eq_0 numeral_One)
[PROOF STATE]
proof (state)
this:
(a && b) \<exclamdown> 0 = a \<exclamdown> 0 * b \<exclamdown> 0

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
(?a && ?b) \<exclamdown> k = ?a \<exclamdown> k * ?b \<exclamdown> k

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
have "nth_bit (a && b) (Suc k)
        = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^(Suc k) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^ Suc k mod 2
[PROOF STEP]
using bitAND_rec
[PROOF STATE]
proof (prove)
using this:
?m && ?n = 2 * (?m div 2 && ?n div 2) + ?m mod 2 * (?n mod 2)

goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^ Suc k mod 2
[PROOF STEP]
by (metis nth_bit_def)
[PROOF STATE]
proof (state)
this:
(a && b) \<exclamdown> Suc k = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^ Suc k mod 2

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a && b) \<exclamdown> Suc k = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^ Suc k mod 2

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
have "(a mod 2) * (b mod 2) < (2 ^ Suc(k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod 2 * (b mod 2) < 2 ^ Suc k
[PROOF STEP]
by (metis One_nat_def lessI mult_numeral_1_right mult_zero_right not_mod_2_eq_1_eq_0
              numeral_2_eq_2 numeral_One power_gt1 zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
a mod 2 * (b mod 2) < 2 ^ Suc k

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a && b) \<exclamdown> Suc k = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^ Suc k mod 2
a mod 2 * (b mod 2) < 2 ^ Suc k
[PROOF STEP]
have "nth_bit (a && b) (Suc k) = (2 * (a div 2 && b div 2)) div 2 ^(Suc k) mod 2"
[PROOF STATE]
proof (prove)
using this:
(a && b) \<exclamdown> Suc k = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^ Suc k mod 2
a mod 2 * (b mod 2) < 2 ^ Suc k

goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = 2 * (a div 2 && b div 2) div 2 ^ Suc k mod 2
[PROOF STEP]
using aux1_bitAND_digit_mult
[PROOF STATE]
proof (prove)
using this:
(a && b) \<exclamdown> Suc k = (2 * (a div 2 && b div 2) + a mod 2 * (b mod 2)) div 2 ^ Suc k mod 2
a mod 2 * (b mod 2) < 2 ^ Suc k
0 < ?k \<and> ?a mod 2 = 0 \<and> ?b \<le> 1 \<Longrightarrow> (?a + ?b) div 2 ^ ?k = ?a div 2 ^ ?k

goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = 2 * (a div 2 && b div 2) div 2 ^ Suc k mod 2
[PROOF STEP]
by (metis le_numeral_extra(1) le_numeral_extra(4) mod_mult_self1_is_0 mult_numeral_1_right
              mult_zero_right not_mod_2_eq_1_eq_0 numeral_One zero_less_Suc)
[PROOF STATE]
proof (state)
this:
(a && b) \<exclamdown> Suc k = 2 * (a div 2 && b div 2) div 2 ^ Suc k mod 2

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a && b) \<exclamdown> Suc k = 2 * (a div 2 && b div 2) div 2 ^ Suc k mod 2
[PROOF STEP]
have "nth_bit (a && b) (Suc k) = (nth_bit (a div 2 && b div 2) k)"
[PROOF STATE]
proof (prove)
using this:
(a && b) \<exclamdown> Suc k = 2 * (a div 2 && b div 2) div 2 ^ Suc k mod 2

goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = (a div 2 && b div 2) \<exclamdown> k
[PROOF STEP]
by (auto simp add: nth_bit_def)
[PROOF STATE]
proof (state)
this:
(a && b) \<exclamdown> Suc k = (a div 2 && b div 2) \<exclamdown> k

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a && b) \<exclamdown> Suc k = (a div 2 && b div 2) \<exclamdown> k
[PROOF STEP]
have "nth_bit (a && b) (Suc k) = (nth_bit (a div 2) k) * (nth_bit (b div 2) k)"
[PROOF STATE]
proof (prove)
using this:
(a && b) \<exclamdown> Suc k = (a div 2 && b div 2) \<exclamdown> k

goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = (a div 2) \<exclamdown> k * (b div 2) \<exclamdown> k
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(a && b) \<exclamdown> Suc k = (a div 2 && b div 2) \<exclamdown> k
(?a && ?b) \<exclamdown> k = ?a \<exclamdown> k * ?b \<exclamdown> k

goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = (a div 2) \<exclamdown> k * (b div 2) \<exclamdown> k
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(a && b) \<exclamdown> Suc k = (a div 2) \<exclamdown> k * (b div 2) \<exclamdown> k

goal (1 subgoal):
 1. \<And>k a b. (\<And>a b. (a && b) \<exclamdown> k = a \<exclamdown> k * b \<exclamdown> k) \<Longrightarrow> (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a && b) \<exclamdown> Suc k = (a div 2) \<exclamdown> k * (b div 2) \<exclamdown> k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(a && b) \<exclamdown> Suc k = (a div 2) \<exclamdown> k * (b div 2) \<exclamdown> k

goal (1 subgoal):
 1. (a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k
[PROOF STEP]
by (metis div_mult2_eq nth_bit_def power_Suc)
[PROOF STATE]
proof (state)
this:
(a && b) \<exclamdown> Suc k = a \<exclamdown> Suc k * b \<exclamdown> Suc k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSLIMSEQ_mult: "X \<longlonglongrightarrow>\<^sub>N\<^sub>S a \<Longrightarrow> Y \<longlonglongrightarrow>\<^sub>N\<^sub>S b \<Longrightarrow> (\<lambda>n. X n * Y n) \<longlonglongrightarrow>\<^sub>N\<^sub>S a * b"
  for a b :: "'a::real_normed_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<longlonglongrightarrow>\<^sub>N\<^sub>S a; Y \<longlonglongrightarrow>\<^sub>N\<^sub>S b\<rbrakk> \<Longrightarrow> (\<lambda>n. X n * Y n) \<longlonglongrightarrow>\<^sub>N\<^sub>S a * b
[PROOF STEP]
by (auto intro!: approx_mult_HFinite simp add: NSLIMSEQ_def)


[STATEMENT]
lemma (in group) normal_subgroup_set_mult_closed:
  assumes "M \<lhd> G" and "N \<lhd> G"
  shows "M <#> N \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M <#> N \<lhd> G
[PROOF STEP]
proof (rule normalI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subgroup (M <#> N) G
 2. \<forall>x\<in>carrier G. M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
M \<lhd> G
N \<lhd> G
[PROOF STEP]
show "subgroup (M <#> N) G"
[PROOF STATE]
proof (prove)
using this:
M \<lhd> G
N \<lhd> G

goal (1 subgoal):
 1. subgroup (M <#> N) G
[PROOF STEP]
using second_isomorphism_grp.normal_set_mult_subgroup normal_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
M \<lhd> G
N \<lhd> G
second_isomorphism_grp ?H ?G ?S \<Longrightarrow> subgroup (?H <#>\<^bsub>?G\<^esub> ?S) ?G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. subgroup (M <#> N) G
[PROOF STEP]
unfolding second_isomorphism_grp_def second_isomorphism_grp_axioms_def
[PROOF STATE]
proof (prove)
using this:
M \<lhd> G
N \<lhd> G
?H \<lhd> ?G \<and> subgroup ?S ?G \<Longrightarrow> subgroup (?H <#>\<^bsub>?G\<^esub> ?S) ?G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. subgroup (M <#> N) G
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
subgroup (M <#> N) G

goal (1 subgoal):
 1. \<forall>x\<in>carrier G. M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>carrier G. M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
show "\<forall>x\<in>carrier G. M <#> N #> x = x <# (M <#> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>carrier G. M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
assume x:"x \<in> carrier G"
[PROOF STATE]
proof (state)
this:
x \<in> carrier G

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
have "M <#> N #> x = M <#> (N #> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M <#> N #> x = M <#> (N #> x)
[PROOF STEP]
by (metis assms(1,2) normal_inv_iff setmult_rcos_assoc subgroup.subset x)
[PROOF STATE]
proof (state)
this:
M <#> N #> x = M <#> (N #> x)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M <#> N #> x = M <#> (N #> x)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
have "\<dots> = M <#> (x <# N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M <#> (N #> x) = M <#> (x <# N)
[PROOF STEP]
by (metis assms(2) normal.coset_eq x)
[PROOF STATE]
proof (state)
this:
M <#> (N #> x) = M <#> (x <# N)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M <#> (N #> x) = M <#> (x <# N)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
have "\<dots> = (M #> x) <#> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M <#> (x <# N) = M #> x <#> N
[PROOF STEP]
by (metis assms(1,2) normal_imp_subgroup rcos_assoc_lcos subgroup.subset x)
[PROOF STATE]
proof (state)
this:
M <#> (x <# N) = M #> x <#> N

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M <#> (x <# N) = M #> x <#> N

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
have "\<dots> = (x <# M) <#> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M #> x <#> N = x <# M <#> N
[PROOF STEP]
by (metis assms(1) normal.coset_eq x)
[PROOF STATE]
proof (state)
this:
M #> x <#> N = x <# M <#> N

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M #> x <#> N = x <# M <#> N

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
have "\<dots> = x <# (M <#> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x <# M <#> N = x <# (M <#> N)
[PROOF STEP]
by (metis assms(1,2) normal_imp_subgroup setmult_lcos_assoc subgroup.subset x)
[PROOF STATE]
proof (state)
this:
x <# M <#> N = x <# (M <#> N)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
show "M <#> N #> x = x <# (M <#> N)"
[PROOF STATE]
proof (prove)
using this:
M <#> N #> x = x <# (M <#> N)

goal (1 subgoal):
 1. M <#> N #> x = x <# (M <#> N)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
M <#> N #> x = x <# (M <#> N)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>carrier G. M <#> N #> x = x <# (M <#> N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_mod_greater_imp_div_less: "
  \<lbrakk> a \<le> (b::nat); a mod m > b mod m \<rbrakk> \<Longrightarrow> a div m < b div m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b mod m < a mod m\<rbrakk> \<Longrightarrow> a div m < b div m
[PROOF STEP]
apply (rule ccontr, simp add: linorder_not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b mod m < a mod m; b div m \<le> a div m\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule mult_le_mono1[of "b div m" _ m])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b mod m < a mod m; b div m * m \<le> a div m * m\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule add_less_le_mono[of "b mod m" "a mod m" "b div m * m" "a div m * m"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; b div m * m \<le> a div m * m\<rbrakk> \<Longrightarrow> b div m * m \<le> a div m * m
 2. \<lbrakk>a \<le> b; b div m * m \<le> a div m * m; b mod m + b div m * m < a mod m + a div m * m\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma b_join_c_eq_e: " d_aux a b c <= e_aux a b c \<Longrightarrow> b_aux a b c \<squnion> c_aux a b c = e_aux a b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_aux a b c \<le> e_aux a b c \<Longrightarrow> b_aux a b c \<squnion> c_aux a b c = e_aux a b c
[PROOF STEP]
apply (subst b_a)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_aux a b c \<le> e_aux a b c \<Longrightarrow> a_aux b c a \<squnion> c_aux a b c = e_aux a b c
[PROOF STEP]
apply (subgoal_tac "c_aux a b c = b_aux b c a")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>d_aux a b c \<le> e_aux a b c; c_aux a b c = b_aux b c a\<rbrakk> \<Longrightarrow> a_aux b c a \<squnion> c_aux a b c = e_aux a b c
 2. d_aux a b c \<le> e_aux a b c \<Longrightarrow> c_aux a b c = b_aux b c a
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>d_aux a b c \<le> e_aux a b c; c_aux a b c = b_aux b c a\<rbrakk> \<Longrightarrow> a_aux b c a \<squnion> b_aux b c a = e_aux a b c
 2. d_aux a b c \<le> e_aux a b c \<Longrightarrow> c_aux a b c = b_aux b c a
[PROOF STEP]
apply (subst a_join_b_eq_e)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>d_aux a b c \<le> e_aux a b c; c_aux a b c = b_aux b c a\<rbrakk> \<Longrightarrow> d_aux b c a \<le> e_aux b c a
 2. \<lbrakk>d_aux a b c \<le> e_aux a b c; c_aux a b c = b_aux b c a\<rbrakk> \<Longrightarrow> e_aux b c a = e_aux a b c
 3. d_aux a b c \<le> e_aux a b c \<Longrightarrow> c_aux a b c = b_aux b c a
[PROOF STEP]
by (simp_all add: c_aux_def b_aux_def d_b_c_a e_b_c_a)


[STATEMENT]
lemma scaleR_left_normalize:
  fixes a ::real and b c::"'a::real_vector"
  shows "a *\<^sub>R b = c \<longleftrightarrow> (if a = 0 then c = 0 else b = c /\<^sub>R a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>R b = c) = (if a = 0 then c = (0::'a) else b = c /\<^sub>R a)
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma munionM_assoc: "munionM (munionM x y) z = munionM x (munionM y z)" for x y z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. munionM (munionM x y) z = munionM x (munionM y z)
[PROOF STEP]
by(simp add: munionM_def bind_assoc return_bind add.assoc)


[STATEMENT]
lemma Arg_unique: "\<lbrakk>of_real r * exp(\<i> * a) = z; 0 < r; -pi < a; a \<le> pi\<rbrakk> \<Longrightarrow> Arg z = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>complex_of_real r * exp (\<i> * complex_of_real a) = z; 0 < r; - pi < a; a \<le> pi\<rbrakk> \<Longrightarrow> Arg z = a
[PROOF STEP]
by (rule Arg_unique_lemma [unfolded is_Arg_def, OF _ Arg_eq])
     (use mpi_less_Arg Arg_le_pi in \<open>auto simp: norm_mult\<close>)


[STATEMENT]
lemma polyhedral_cone_carrier: assumes "A \<in> carrier_mat nr n"
  shows "polyhedral_cone A \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polyhedral_cone A \<subseteq> carrier_vec n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr n

goal (1 subgoal):
 1. polyhedral_cone A \<subseteq> carrier_vec n
[PROOF STEP]
unfolding polyhedral_cone_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr n

goal (1 subgoal):
 1. {x \<in> carrier_vec n. A *\<^sub>v x \<le> 0\<^sub>v (dim_row A)} \<subseteq> carrier_vec n
[PROOF STEP]
by auto


[STATEMENT]
lemma some_ccontr:
      assumes "(\<And> x. \<not> P x) \<Longrightarrow> False"
      shows "P (SOME x. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (SOME x. P x)
[PROOF STEP]
using assms someI_ex ccontr
[PROOF STATE]
proof (prove)
using this:
(\<And>x. \<not> P x) \<Longrightarrow> False
\<exists>x. ?P x \<Longrightarrow> ?P (SOME x. ?P x)
(\<not> ?P \<Longrightarrow> False) \<Longrightarrow> ?P

goal (1 subgoal):
 1. P (SOME x. P x)
[PROOF STEP]
by metis


[STATEMENT]
lemma ln_le_zero_iff [simp]: "0 < x \<Longrightarrow> ln x \<le> 0 \<longleftrightarrow> x \<le> 1"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (ln x \<le> 0) = (x \<le> 1)
[PROOF STEP]
by (metis less_numeral_extra(1) ln_le_cancel_iff ln_one)


[STATEMENT]
lemma frac_add_common_denom:
  assumes "a \<in> carrier Z\<^sub>p"
  assumes "b \<in> carrier Z\<^sub>p"
  assumes "c \<in> nonzero Z\<^sub>p"
  shows "(frac a c) \<oplus> (frac b c) = frac (a \<oplus>\<^bsub>Z\<^sub>p\<^esub> b) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fraction Z\<^sub>p a c \<oplus> fraction Z\<^sub>p b c = fraction Z\<^sub>p (a \<oplus>\<^bsub>Z\<^sub>p\<^esub> b) c
[PROOF STEP]
by (simp add: Q\<^sub>p_def assms(1) assms(2) assms(3) frac_add_common_denom)


[STATEMENT]
lemma stake_cycle: "u \<noteq> [] \<Longrightarrow>
   stake n (cycle u) = concat (replicate (n div length u) u) @ take (n mod length u) u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<noteq> [] \<Longrightarrow> stake n (cycle u) = concat (replicate (n div length u) u) @ take (n mod length u) u
[PROOF STEP]
by (subst div_mult_mod_eq[of n "length u", symmetric], unfold stake_add[symmetric]) auto


[STATEMENT]
lemma main_step_R:
  fixes qs:: "real poly list"
  shows "set (find_consistent_signs_R qs) =  consistent_sign_vectors_R qs UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (find_consistent_signs_R qs) = consistent_sign_vectors_R qs UNIV
[PROOF STEP]
using main_step_aux1_R main_step_aux2_R
[PROOF STATE]
proof (prove)
using this:
check_all_const_deg ?qs = True \<Longrightarrow> set (find_consistent_signs_R ?qs) = consistent_sign_vectors_R ?qs UNIV
check_all_const_deg ?qs = False \<Longrightarrow> set (find_consistent_signs_R ?qs) = consistent_sign_vectors_R ?qs UNIV

goal (1 subgoal):
 1. set (find_consistent_signs_R qs) = consistent_sign_vectors_R qs UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma Proj_sum_spaces:
  assumes \<open>finite X\<close>
  assumes \<open>\<And>x y. x\<in>X \<Longrightarrow> y\<in>X \<Longrightarrow> x\<noteq>y \<Longrightarrow> orthogonal_spaces (J x) (J y)\<close>
  shows \<open>Proj (\<Sum>x\<in>X. J x) = (\<Sum>x\<in>X. Proj (J x))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (sum J X) = (\<Sum>x\<in>X. Proj (J x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite X
\<lbrakk>?x \<in> X; ?y \<in> X; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J ?x) (J ?y)

goal (1 subgoal):
 1. Proj (sum J X) = (\<Sum>x\<in>X. Proj (J x))
[PROOF STEP]
proof induction
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>x y. \<lbrakk>x \<in> {}; y \<in> {}; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J {}) = (\<Sum>x\<in>{}. Proj (J x))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> {}; ?y \<in> {}; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J ?x) (J ?y)

goal (2 subgoals):
 1. (\<And>x y. \<lbrakk>x \<in> {}; y \<in> {}; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J {}) = (\<Sum>x\<in>{}. Proj (J x))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (sum J {}) = (\<Sum>x\<in>{}. Proj (J x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Proj (sum J {}) = (\<Sum>x\<in>{}. Proj (J x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
(\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x))
\<lbrakk>?x \<in> insert x F; ?y \<in> insert x F; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J ?x) (J ?y)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
have \<open>Proj (sum J (insert x F)) = Proj (J x \<squnion> sum J F)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (sum J (insert x F)) = Proj (J x \<squnion> sum J F)
[PROOF STEP]
by (simp add: insert)
[PROOF STATE]
proof (state)
this:
Proj (sum J (insert x F)) = Proj (J x \<squnion> sum J F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Proj (sum J (insert x F)) = Proj (J x \<squnion> sum J F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
have \<open>\<dots> = Proj (J x) + Proj (sum J F)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (J x \<squnion> sum J F) = Proj (J x) + Proj (sum J F)
[PROOF STEP]
apply (rule Proj_sup)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_spaces (J x) (sum J F)
[PROOF STEP]
apply (rule orthogonal_sum)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite F
 2. \<And>xa. xa \<in> F \<Longrightarrow> orthogonal_spaces (J x) (J xa)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x))
\<lbrakk>?x \<in> insert x F; ?y \<in> insert x F; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J ?x) (J ?y)

goal (2 subgoals):
 1. finite F
 2. \<And>xa. xa \<in> F \<Longrightarrow> orthogonal_spaces (J x) (J xa)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Proj (J x \<squnion> sum J F) = Proj (J x) + Proj (sum J F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Proj (J x \<squnion> sum J F) = Proj (J x) + Proj (sum J F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
have \<open>\<dots> = (\<Sum>x\<in>insert x F. Proj (J x))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (J x) + Proj (sum J F) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
by (simp add: insert.IH insert.hyps(1) insert.hyps(2) insert.prems)
[PROOF STATE]
proof (state)
this:
Proj (J x) + Proj (sum J F) = (\<Sum>x\<in>insert x F. Proj (J x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x y. \<lbrakk>x \<in> F; y \<in> F; x \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J x) (J y)) \<Longrightarrow> Proj (sum J F) = (\<Sum>x\<in>F. Proj (J x)); \<And>xa y. \<lbrakk>xa \<in> insert x F; y \<in> insert x F; xa \<noteq> y\<rbrakk> \<Longrightarrow> orthogonal_spaces (J xa) (J y)\<rbrakk> \<Longrightarrow> Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))

goal (1 subgoal):
 1. Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
Proj (sum J (insert x F)) = (\<Sum>x\<in>insert x F. Proj (J x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finsum_eq:
  assumes "f \<in> S \<rightarrow> carrier R"
  assumes "g \<in> S \<rightarrow> carrier R"
  assumes "(\<lambda> x \<in> S. f x) = (\<lambda> x \<in> S. g x)"
  shows " finsum R f S = finsum R g S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f S = finsum R g S
[PROOF STEP]
by (metis assms(1) assms(3) finsum_cong' restrict_apply')


[STATEMENT]
lemma real_transfer_operator_add [intro]:
  assumes [measurable]: "integrable M f" "integrable M g"
  shows "AE x in M. real_transfer_operator (\<lambda>x. f x + g x) x = real_transfer_operator f x + real_transfer_operator g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. real_transfer_operator (\<lambda>x. f x + g x) x = real_transfer_operator f x + real_transfer_operator g x
[PROOF STEP]
proof (rule real_transfer_operator_charact)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
 3. integrable M (\<lambda>x. real_transfer_operator f x + real_transfer_operator g x)
[PROOF STEP]
have "integrable M (real_transfer_operator f)" "integrable M (real_transfer_operator g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (real_transfer_operator f) &&& integrable M (real_transfer_operator g)
[PROOF STEP]
using real_transfer_operator_int(1) assms
[PROOF STATE]
proof (prove)
using this:
integrable M ?f \<Longrightarrow> integrable M (real_transfer_operator ?f)
integrable M f
integrable M g

goal (1 subgoal):
 1. integrable M (real_transfer_operator f) &&& integrable M (real_transfer_operator g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M (real_transfer_operator f)
integrable M (real_transfer_operator g)

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
 3. integrable M (\<lambda>x. real_transfer_operator f x + real_transfer_operator g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable M (real_transfer_operator f)
integrable M (real_transfer_operator g)
[PROOF STEP]
show "integrable M (\<lambda>x. real_transfer_operator f x + real_transfer_operator g x)"
[PROOF STATE]
proof (prove)
using this:
integrable M (real_transfer_operator f)
integrable M (real_transfer_operator g)

goal (1 subgoal):
 1. integrable M (\<lambda>x. real_transfer_operator f x + real_transfer_operator g x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. real_transfer_operator f x + real_transfer_operator g x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
assume [measurable]: "A \<in> sets M"
[PROOF STATE]
proof (state)
this:
A \<in> sets M

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
have intAf: "integrable M (\<lambda>x. indicator A (T x) * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real A (T x) * f x)
[PROOF STEP]
apply (rule Bochner_Integration.integrable_bound[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. indicat_real A (T x) * f x) \<in> borel_measurable M
 2. AE x in M. norm (indicat_real A (T x) * f x) \<le> norm (f x)
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. of_bool (T x \<in> A) * f x) \<in> borel_measurable M
 2. AE x in M. norm (of_bool (T x \<in> A) * f x) \<le> norm (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. indicat_real A (T x) * f x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
have intAg: "integrable M (\<lambda>x. indicator A (T x) * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real A (T x) * g x)
[PROOF STEP]
apply (rule Bochner_Integration.integrable_bound[OF assms(2)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. indicat_real A (T x) * g x) \<in> borel_measurable M
 2. AE x in M. norm (indicat_real A (T x) * g x) \<le> norm (g x)
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. of_bool (T x \<in> A) * g x) \<in> borel_measurable M
 2. AE x in M. norm (of_bool (T x \<in> A) * g x) \<le> norm (g x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. indicat_real A (T x) * g x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
have "(\<integral>x. indicator A x * (real_transfer_operator f x + real_transfer_operator g x)\<partial>M)
      = (\<integral>x. indicator A x * real_transfer_operator f x + indicator A x* real_transfer_operator g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A x * real_transfer_operator f x + indicat_real A x * real_transfer_operator g x
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A x * real_transfer_operator f x + indicat_real A x * real_transfer_operator g x

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A x * real_transfer_operator f x + indicat_real A x * real_transfer_operator g x

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
have "... = (\<integral>x. indicator A x * real_transfer_operator f x \<partial>M) + (\<integral>x. indicator A x * real_transfer_operator g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. indicat_real A x * real_transfer_operator f x + indicat_real A x * real_transfer_operator g x = (LINT x|M. indicat_real A x * real_transfer_operator f x) + (LINT x|M. indicat_real A x * real_transfer_operator g x)
[PROOF STEP]
apply (rule Bochner_Integration.integral_add)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. integrable M (\<lambda>x. indicat_real A x * real_transfer_operator f x)
 2. integrable M (\<lambda>x. indicat_real A x * real_transfer_operator g x)
[PROOF STEP]
using integrable_real_mult_indicator[OF \<open>A \<in> sets M\<close> real_transfer_operator_int(1)[OF assms(1)]]
          integrable_real_mult_indicator[OF \<open>A \<in> sets M\<close> real_transfer_operator_int(1)[OF assms(2)]]
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. real_transfer_operator f x * indicat_real A x)
integrable M (\<lambda>x. real_transfer_operator g x * indicat_real A x)

goal (2 subgoals):
 1. integrable M (\<lambda>x. indicat_real A x * real_transfer_operator f x)
 2. integrable M (\<lambda>x. indicat_real A x * real_transfer_operator g x)
[PROOF STEP]
by (auto simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
LINT x|M. indicat_real A x * real_transfer_operator f x + indicat_real A x * real_transfer_operator g x = (LINT x|M. indicat_real A x * real_transfer_operator f x) + (LINT x|M. indicat_real A x * real_transfer_operator g x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. indicat_real A x * real_transfer_operator f x + indicat_real A x * real_transfer_operator g x = (LINT x|M. indicat_real A x * real_transfer_operator f x) + (LINT x|M. indicat_real A x * real_transfer_operator g x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
have "... = (\<integral>x. indicator A (T x) * f x \<partial>M) + (\<integral>x. indicator A (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. indicat_real A x * real_transfer_operator f x) + (LINT x|M. indicat_real A x * real_transfer_operator g x) = (LINT x|M. indicat_real A (T x) * f x) + (LINT x|M. indicat_real A (T x) * g x)
[PROOF STEP]
using real_transfer_operator_intg(2) assms \<open>A \<in> sets M\<close> intAf intAg
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>integrable M (\<lambda>x. ?f (T x) * ?g x); ?f \<in> borel_measurable M; ?g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> LINT x|M. ?f x * real_transfer_operator ?g x = LINT x|M. ?f (T x) * ?g x
integrable M f
integrable M g
A \<in> sets M
integrable M (\<lambda>x. indicat_real A (T x) * f x)
integrable M (\<lambda>x. indicat_real A (T x) * g x)

goal (1 subgoal):
 1. (LINT x|M. indicat_real A x * real_transfer_operator f x) + (LINT x|M. indicat_real A x * real_transfer_operator g x) = (LINT x|M. indicat_real A (T x) * f x) + (LINT x|M. indicat_real A (T x) * g x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(LINT x|M. indicat_real A x * real_transfer_operator f x) + (LINT x|M. indicat_real A x * real_transfer_operator g x) = (LINT x|M. indicat_real A (T x) * f x) + (LINT x|M. indicat_real A (T x) * g x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. indicat_real A x * real_transfer_operator f x) + (LINT x|M. indicat_real A x * real_transfer_operator g x) = (LINT x|M. indicat_real A (T x) * f x) + (LINT x|M. indicat_real A (T x) * g x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
have "... = (\<integral>x. indicator A (T x) * f x + indicator A (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. indicat_real A (T x) * f x) + (LINT x|M. indicat_real A (T x) * g x) = LINT x|M. indicat_real A (T x) * f x + indicat_real A (T x) * g x
[PROOF STEP]
by (rule Bochner_Integration.integral_add[symmetric]) (auto simp add: assms \<open>A \<in> sets M\<close> intAf intAg)
[PROOF STATE]
proof (state)
this:
(LINT x|M. indicat_real A (T x) * f x) + (LINT x|M. indicat_real A (T x) * g x) = LINT x|M. indicat_real A (T x) * f x + indicat_real A (T x) * g x

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. indicat_real A (T x) * f x) + (LINT x|M. indicat_real A (T x) * g x) = LINT x|M. indicat_real A (T x) * f x + indicat_real A (T x) * g x

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
have "... = \<integral>x. indicator A (T x) * (f x + g x)\<partial>M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. indicat_real A (T x) * f x + indicat_real A (T x) * g x = LINT x|M. indicat_real A (T x) * (f x + g x)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
LINT x|M. indicat_real A (T x) * f x + indicat_real A (T x) * g x = LINT x|M. indicat_real A (T x) * (f x + g x)

goal (2 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
 2. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
[PROOF STEP]
show "(\<integral>x. indicator A x * (real_transfer_operator f x + real_transfer_operator g x)\<partial>M) = \<integral>x. indicator A (T x) * (f x + g x)\<partial>M"
[PROOF STATE]
proof (prove)
using this:
LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)

goal (1 subgoal):
 1. LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|M. indicat_real A x * (real_transfer_operator f x + real_transfer_operator g x) = LINT x|M. indicat_real A (T x) * (f x + g x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
qed (auto simp add: assms)


[STATEMENT]
lemma Amin_ge1Tr:"(\<forall>j\<le>(Suc n). (f j) \<in> Z\<^sub>\<infinity> \<and> z \<le> (f j)) \<longrightarrow>
                                            z \<le> (Amin (Suc n) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>j\<le>Suc n. f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc n) f
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<forall>j\<le>Suc 0. f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc 0) f
 2. \<And>n. (\<forall>j\<le>Suc n. f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc n) f \<Longrightarrow> (\<forall>j\<le>Suc (Suc n). f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc (Suc n)) f
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>j\<le>Suc 0. f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j \<Longrightarrow> z \<le> Amin (Suc 0) f
 2. \<And>n. (\<forall>j\<le>Suc n. f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc n) f \<Longrightarrow> (\<forall>j\<le>Suc (Suc n). f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc (Suc n)) f
[PROOF STEP]
apply (frule_tac x = 0 in spec,
        frule_tac x = "Suc 0" in spec,
        thin_tac "\<forall>j\<le>Suc 0. f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j", simp, (erule conjE)+,
        simp add:amin_ge1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (\<forall>j\<le>Suc n. f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc n) f \<Longrightarrow> (\<forall>j\<le>Suc (Suc n). f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j) \<longrightarrow> z \<le> Amin (Suc (Suc n)) f
[PROOF STEP]
apply (rule impI,
       simp,
       frule_tac a = "Suc (Suc n)" in forall_spec,
       thin_tac "\<forall>j\<le>Suc (Suc n). f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j", simp,
       thin_tac "\<forall>j\<le>Suc (Suc n). f j \<in> Z\<^sub>\<infinity> \<and> z \<le> f j", erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>z \<le> amin (Amin n f) (f (Suc n)); f (Suc (Suc n)) \<in> Z\<^sub>\<infinity>; z \<le> f (Suc (Suc n))\<rbrakk> \<Longrightarrow> z \<le> amin (amin (Amin n f) (f (Suc n))) (f (Suc (Suc n)))
[PROOF STEP]
apply (rule amin_ge1, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma matrix_to_iarray_plus[code_unfold]: "matrix_to_iarray (A + B) = (matrix_to_iarray A) + (matrix_to_iarray B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (A + B) = matrix_to_iarray A + matrix_to_iarray B
[PROOF STEP]
unfolding matrix_to_iarray_def o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray (map (\<lambda>x. vec_to_iarray ((A + B) $ mod_type_class.from_nat x)) [0..<CARD('c)]) = IArray (map (\<lambda>x. vec_to_iarray (A $ mod_type_class.from_nat x)) [0..<CARD('c)]) + IArray (map (\<lambda>x. vec_to_iarray (B $ mod_type_class.from_nat x)) [0..<CARD('c)])
[PROOF STEP]
by (simp add: plus_iarray_def Let_def vec_to_iarray_plus)


[STATEMENT]
lemma part_circlepath_rotate_right:
  "part_circlepath c r (a + x) (b + x) = (\<lambda>z. c + cis x * (z - c)) \<circ> part_circlepath c r a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. part_circlepath c r (a + x) (b + x) = (\<lambda>z. c + cis x * (z - c)) \<circ> part_circlepath c r a b
[PROOF STEP]
by (simp add: part_circlepath_def exp_eq_polar fun_eq_iff
                linepath_translate_left linepath_translate_right cis_mult add_ac)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. (\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) = (\<lambda>x. indicat_real \<Omega> x * f x)
[PROOF STEP]
by (auto simp: indicator_def fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) = (\<lambda>x. indicat_real \<Omega> x * f x)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pmat_extension_trace:
  assumes "m \<in> carrier_mat d1 d1"
  shows "trace (pmat_extension m) = d2 * trace m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (pmat_extension m) = int d2 * trace m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<in> carrier_mat d1 d1

goal (1 subgoal):
 1. trace (pmat_extension m) = int d2 * trace m
[PROOF STEP]
by (simp add: pmat_extension_def ptensor_mat_trace)


[STATEMENT]
lemma rel_interior_affine:
  fixes S :: "'n::euclidean_space set"
  shows  "affine S \<Longrightarrow> rel_interior S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine S \<Longrightarrow> rel_interior S = S
[PROOF STEP]
using affine_rel_open rel_open_def
[PROOF STATE]
proof (prove)
using this:
affine ?S \<Longrightarrow> rel_open ?S
rel_open ?S = (rel_interior ?S = ?S)

goal (1 subgoal):
 1. affine S \<Longrightarrow> rel_interior S = S
[PROOF STEP]
by auto


[STATEMENT]
lemma sq_mtx_times_eq: "A * B = to_mtx (\<chi> i j. sum (\<lambda>k. A$$i$k * B$$k$j) UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = to_mtx (\<chi>i j. \<Sum>k\<in>UNIV. A $$ i $ k * B $$ k $ j)
[PROOF STEP]
by transfer (simp add: matrix_matrix_mult_def)


[STATEMENT]
lemma bounded_antilinearI:
  assumes \<open>\<And>b1 b2. f (b1 + b2) = f b1 + f b2\<close>
  assumes \<open>\<And>r b. f (r *\<^sub>C b) = cnj r *\<^sub>C f b\<close>
  assumes \<open>\<forall>x. norm (f x) \<le> norm x * K\<close>
  shows "bounded_antilinear f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_antilinear f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f (?b1.0 + ?b2.0) = f ?b1.0 + f ?b2.0
f (?r *\<^sub>C ?b) = cnj ?r *\<^sub>C f ?b
\<forall>x. norm (f x) \<le> norm x * K

goal (1 subgoal):
 1. bounded_antilinear f
[PROOF STEP]
by (auto intro!: exI bounded_antilinear.intro antilinearI simp: bounded_antilinear_axioms_def)