[STATEMENT]
lemma log_prod: assumes "0 < a" "a \<noteq> 1" "\<And> x. x \<in> X \<Longrightarrow> 0 < f x"
  shows "log a (prod f X) = sum (log a o f) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log a (prod f X) = sum (log a \<circ> f) X
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<Longrightarrow> 0 < f ?x

goal (1 subgoal):
 1. log a (prod f X) = sum (log a \<circ> f) X
[PROOF STEP]
proof (induct X rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>x. x \<in> A \<Longrightarrow> 0 < f x\<rbrakk> \<Longrightarrow> log a (prod f A) = sum (log a \<circ> f) A
 2. (\<And>x. x \<in> {} \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f {}) = sum (log a \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F; \<And>xa. xa \<in> insert x F \<Longrightarrow> 0 < f xa\<rbrakk> \<Longrightarrow> log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
(\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F
?x \<in> insert x F \<Longrightarrow> 0 < f ?x

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>x. x \<in> A \<Longrightarrow> 0 < f x\<rbrakk> \<Longrightarrow> log a (prod f A) = sum (log a \<circ> f) A
 2. (\<And>x. x \<in> {} \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f {}) = sum (log a \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F; \<And>xa. xa \<in> insert x F \<Longrightarrow> 0 < f xa\<rbrakk> \<Longrightarrow> log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)
[PROOF STEP]
have "log a (prod f (insert x F)) = log a (f x * prod f F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log a (prod f (insert x F)) = log a (f x * prod f F)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F
?x \<in> insert x F \<Longrightarrow> 0 < f ?x

goal (1 subgoal):
 1. log a (prod f (insert x F)) = log a (f x * prod f F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
log a (prod f (insert x F)) = log a (f x * prod f F)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>x. x \<in> A \<Longrightarrow> 0 < f x\<rbrakk> \<Longrightarrow> log a (prod f A) = sum (log a \<circ> f) A
 2. (\<And>x. x \<in> {} \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f {}) = sum (log a \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F; \<And>xa. xa \<in> insert x F \<Longrightarrow> 0 < f xa\<rbrakk> \<Longrightarrow> log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
log a (prod f (insert x F)) = log a (f x * prod f F)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>x. x \<in> A \<Longrightarrow> 0 < f x\<rbrakk> \<Longrightarrow> log a (prod f A) = sum (log a \<circ> f) A
 2. (\<And>x. x \<in> {} \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f {}) = sum (log a \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F; \<And>xa. xa \<in> insert x F \<Longrightarrow> 0 < f xa\<rbrakk> \<Longrightarrow> log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)
[PROOF STEP]
have "\<dots> = log a (f x) + log a (prod f F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log a (f x * prod f F) = log a (f x) + log a (prod f F)
[PROOF STEP]
by (rule log_mult[OF assms(1-2) insert(4) prod_pos], insert insert, auto)
[PROOF STATE]
proof (state)
this:
log a (f x * prod f F) = log a (f x) + log a (prod f F)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>x. x \<in> A \<Longrightarrow> 0 < f x\<rbrakk> \<Longrightarrow> log a (prod f A) = sum (log a \<circ> f) A
 2. (\<And>x. x \<in> {} \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f {}) = sum (log a \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F; \<And>xa. xa \<in> insert x F \<Longrightarrow> 0 < f xa\<rbrakk> \<Longrightarrow> log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
log a (prod f (insert x F)) = log a (f x) + log a (prod f F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
log a (prod f (insert x F)) = log a (f x) + log a (prod f F)

goal (1 subgoal):
 1. log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
log a (prod f (insert x F)) = log a (f x) + log a (prod f F)
finite F
x \<notin> F
(\<And>x. x \<in> F \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f F) = sum (log a \<circ> f) F
?x \<in> insert x F \<Longrightarrow> 0 < f ?x

goal (1 subgoal):
 1. log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
log a (prod f (insert x F)) = sum (log a \<circ> f) (insert x F)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>x. x \<in> A \<Longrightarrow> 0 < f x\<rbrakk> \<Longrightarrow> log a (prod f A) = sum (log a \<circ> f) A
 2. (\<And>x. x \<in> {} \<Longrightarrow> 0 < f x) \<Longrightarrow> log a (prod f {}) = sum (log a \<circ> f) {}
[PROOF STEP]
qed auto


[STATEMENT]
lemma wf_list_graph_impl_axioms_locale_props:
    "wf_list_graph_impl V E \<longleftrightarrow> fst` set E \<subseteq> set V \<and> snd` set E \<subseteq> set V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_list_graph_impl V E = (fst ` set E \<subseteq> set V \<and> snd ` set E \<subseteq> set V)
[PROOF STEP]
by (induction E) auto


[STATEMENT]
lemma disj_matrices_add_le_zero: "disj_matrices A B \<Longrightarrow>
  (A + B <= 0) = (A <= 0 & (B::('a::lattice_ab_group_add) matrix) <= 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disj_matrices A B \<Longrightarrow> (A + B \<le> 0) = (A \<le> 0 \<and> B \<le> 0)
[PROOF STEP]
by (rule disj_matrices_add[of A B 0 0, simplified])


[STATEMENT]
lemma countable_Collect_finite_subset:
  "countable T \<Longrightarrow> countable {A. finite A \<and> A \<subseteq> T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable T \<Longrightarrow> countable {A. finite A \<and> A \<subseteq> T}
[PROOF STEP]
unfolding Collect_finite_subset_eq_lists
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable T \<Longrightarrow> countable (set ` lists T)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_col_to_block_size: "j < dim_col M \<Longrightarrow> card (map_col_to_block (col M j)) = mat_block_size M j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < dim_col M \<Longrightarrow> card (map_col_to_block (col M j)) = mat_block_size M j
[PROOF STEP]
unfolding mat_block_size_def map_col_to_block_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < dim_col M \<Longrightarrow> card {i. i < dim_vec (col M j) \<and> col M j $ i = (1::'b)} = count_vec (col M j) (1::'b)
[PROOF STEP]
using count_vec_alt[of "col M j" "1"] Collect_cong
[PROOF STATE]
proof (prove)
using this:
count_vec (col M j) (1::'b) = card {i. col M j $ i = (1::'b) \<and> i < dim_vec (col M j)}
(\<And>x. ?P x = ?Q x) \<Longrightarrow> {x. ?P x} = {x. ?Q x}

goal (1 subgoal):
 1. j < dim_col M \<Longrightarrow> card {i. i < dim_vec (col M j) \<and> col M j $ i = (1::'b)} = count_vec (col M j) (1::'b)
[PROOF STEP]
by (metis (no_types, lifting))


[STATEMENT]
lemma cos_of_real_pi [simp]: "cos (of_real pi) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (of_real pi) = - (1::'a)
[PROOF STEP]
using cos_add [where x = "pi/2" and y = "pi/2"]
[PROOF STATE]
proof (prove)
using this:
cos (pi / 2 + pi / 2) = cos (pi / 2) * cos (pi / 2) - sin (pi / 2) * sin (pi / 2)

goal (1 subgoal):
 1. cos (of_real pi) = - (1::'a)
[PROOF STEP]
by (simp add: cos_of_real)


[STATEMENT]
lemma div_poly_eq_0:
  fixes p q::"('a::idom_divide) poly"
  assumes "q dvd p" "poly (p div q) x = 0" "q \<noteq> 0"
  shows "poly p x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p x = (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
q dvd p
poly (p div q) x = (0::'a)
q \<noteq> 0

goal (1 subgoal):
 1. poly p x = (0::'a)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in ergodic_pmpt) birkhoff_positive_average:
      fixes f::"'a \<Rightarrow> real"
  assumes [measurable]: "integrable M f" and "AE x in M. (\<lambda>n. birkhoff_sum f n x) \<longlonglongrightarrow> \<infinity>"
  shows "(\<integral> x. f x \<partial>M) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < expectation f
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
assume "\<not>((\<integral> x. f x \<partial>M) > 0)"
[PROOF STATE]
proof (state)
this:
\<not> 0 < expectation f

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < expectation f
[PROOF STEP]
have *: "(\<integral> x. f x \<partial>M) \<le> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < expectation f

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

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
have "AE x in M. (\<lambda>n. birkhoff_sum f n x) \<longlonglongrightarrow> \<infinity> \<and> infinite {n. birkhoff_sum f n x \<in> {n * (\<integral>x. f x \<partial>M) - 1 .. n* (\<integral>x. f x \<partial>M)}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity> \<and> infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}
[PROOF STEP]
using assms(2) birkhoff_sum_small_asymp_neg[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity>
0 < ?e \<Longrightarrow> AE x in M. infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - ?e..real n * expectation f}}

goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity> \<and> infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity> \<and> infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity> \<and> infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}
[PROOF STEP]
obtain x where x: "(\<lambda>n. birkhoff_sum f n x) \<longlonglongrightarrow> \<infinity>" "infinite {n. birkhoff_sum f n x \<in> {n * (\<integral>x. f x \<partial>M) - 1 .. n* (\<integral>x. f x \<partial>M)}}"
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity> \<and> infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>(\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity>; infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using AE_False eventually_elim2
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity> \<and> infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}
(AE x in M. False) = False
\<lbrakk>eventually ?P ?F; eventually ?Q ?F; \<And>i. \<lbrakk>?P i; ?Q i\<rbrakk> \<Longrightarrow> ?R i\<rbrakk> \<Longrightarrow> eventually ?R ?F

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>(\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity>; infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity>
infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity>
infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
assume "birkhoff_sum f n x \<in> {n * (\<integral>x. f x \<partial>M) - 1 .. n * (\<integral>x. f x \<partial>M)}"
[PROOF STATE]
proof (state)
this:
birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}
[PROOF STEP]
have "birkhoff_sum f n x \<le> n * (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}

goal (1 subgoal):
 1. birkhoff_sum f n x \<le> real n * expectation f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
birkhoff_sum f n x \<le> real n * expectation f

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
birkhoff_sum f n x \<le> real n * expectation f

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
have "... \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n * expectation f \<le> 0
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
expectation f \<le> 0

goal (1 subgoal):
 1. real n * expectation f \<le> 0
[PROOF STEP]
by (simp add: mult_nonneg_nonpos)
[PROOF STATE]
proof (state)
this:
real n * expectation f \<le> 0

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
birkhoff_sum f n x \<le> 0
[PROOF STEP]
have "birkhoff_sum f n x \<le> 0"
[PROOF STATE]
proof (prove)
using this:
birkhoff_sum f n x \<le> 0

goal (1 subgoal):
 1. birkhoff_sum f n x \<le> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
birkhoff_sum f n x \<le> 0

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
birkhoff_sum f ?n14 x \<in> {real ?n14 * expectation f - 1..real ?n14 * expectation f} \<Longrightarrow> birkhoff_sum f ?n14 x \<le> 0

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
birkhoff_sum f ?n14 x \<in> {real ?n14 * expectation f - 1..real ?n14 * expectation f} \<Longrightarrow> birkhoff_sum f ?n14 x \<le> 0
[PROOF STEP]
have "{n. birkhoff_sum f n x \<in> {n * (\<integral>x. f x \<partial>M) - 1 .. n* (\<integral>x. f x \<partial>M)}} \<subseteq> {n. birkhoff_sum f n x \<le> 0}"
[PROOF STATE]
proof (prove)
using this:
birkhoff_sum f ?n14 x \<in> {real ?n14 * expectation f - 1..real ?n14 * expectation f} \<Longrightarrow> birkhoff_sum f ?n14 x \<le> 0

goal (1 subgoal):
 1. {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}} \<subseteq> {n. birkhoff_sum f n x \<le> 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}} \<subseteq> {n. birkhoff_sum f n x \<le> 0}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}} \<subseteq> {n. birkhoff_sum f n x \<le> 0}
[PROOF STEP]
have inf: "infinite {n. birkhoff_sum f n x \<le> 0}"
[PROOF STATE]
proof (prove)
using this:
{n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}} \<subseteq> {n. birkhoff_sum f n x \<le> 0}

goal (1 subgoal):
 1. infinite {n. birkhoff_sum f n x \<le> 0}
[PROOF STEP]
using x(2) finite_subset
[PROOF STATE]
proof (prove)
using this:
{n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}} \<subseteq> {n. birkhoff_sum f n x \<le> 0}
infinite {n. birkhoff_sum f n x \<in> {real n * expectation f - 1..real n * expectation f}}
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. infinite {n. birkhoff_sum f n x \<le> 0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
infinite {n. birkhoff_sum f n x \<le> 0}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
have "0 < (\<infinity>::ereal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < \<infinity>

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < \<infinity>
[PROOF STEP]
have "eventually (\<lambda>n. birkhoff_sum f n x > (0::ereal)) sequentially"
[PROOF STATE]
proof (prove)
using this:
0 < \<infinity>

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < ereal (birkhoff_sum f n x)
[PROOF STEP]
using x(1) order_tendsto_iff
[PROOF STATE]
proof (prove)
using this:
0 < \<infinity>
(\<lambda>xa. ereal (birkhoff_sum f xa x)) \<longlonglongrightarrow> \<infinity>
(?f \<longlongrightarrow> ?x) ?F = ((\<forall>l<?x. \<forall>\<^sub>F x in ?F. l < ?f x) \<and> (\<forall>u>?x. \<forall>\<^sub>F x in ?F. ?f x < u))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < ereal (birkhoff_sum f n x)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < ereal (birkhoff_sum f n x)

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < ereal (birkhoff_sum f n x)
[PROOF STEP]
obtain N where "\<And>n. n \<ge> N \<Longrightarrow> birkhoff_sum f n x > (0::ereal)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < ereal (birkhoff_sum f n x)

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> 0 < ereal (birkhoff_sum f n x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson eventually_at_top_linorder)
[PROOF STATE]
proof (state)
this:
N \<le> ?n12 \<Longrightarrow> 0 < ereal (birkhoff_sum f ?n12 x)

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> ?n12 \<Longrightarrow> 0 < ereal (birkhoff_sum f ?n12 x)
[PROOF STEP]
have "\<And>n. n \<ge> N \<Longrightarrow> birkhoff_sum f n x > 0"
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n12 \<Longrightarrow> 0 < ereal (birkhoff_sum f ?n12 x)

goal (1 subgoal):
 1. \<And>n. N \<le> n \<Longrightarrow> 0 < birkhoff_sum f n x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> ?n12 \<Longrightarrow> 0 < birkhoff_sum f ?n12 x

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> ?n12 \<Longrightarrow> 0 < birkhoff_sum f ?n12 x
[PROOF STEP]
have "{n. birkhoff_sum f n x \<le> 0} \<subseteq> {..<N}"
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n12 \<Longrightarrow> 0 < birkhoff_sum f ?n12 x

goal (1 subgoal):
 1. {n. birkhoff_sum f n x \<le> 0} \<subseteq> {..<N}
[PROOF STEP]
by (metis (mono_tags, lifting) lessThan_iff linorder_not_less mem_Collect_eq subsetI)
[PROOF STATE]
proof (state)
this:
{n. birkhoff_sum f n x \<le> 0} \<subseteq> {..<N}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{n. birkhoff_sum f n x \<le> 0} \<subseteq> {..<N}
[PROOF STEP]
have "finite {n. birkhoff_sum f n x \<le> 0}"
[PROOF STATE]
proof (prove)
using this:
{n. birkhoff_sum f n x \<le> 0} \<subseteq> {..<N}

goal (1 subgoal):
 1. finite {n. birkhoff_sum f n x \<le> 0}
[PROOF STEP]
using finite_nat_iff_bounded
[PROOF STATE]
proof (prove)
using this:
{n. birkhoff_sum f n x \<le> 0} \<subseteq> {..<N}
finite ?S = (\<exists>k. ?S \<subseteq> {..<k})

goal (1 subgoal):
 1. finite {n. birkhoff_sum f n x \<le> 0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {n. birkhoff_sum f n x \<le> 0}

goal (1 subgoal):
 1. \<not> 0 < expectation f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {n. birkhoff_sum f n x \<le> 0}
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
finite {n. birkhoff_sum f n x \<le> 0}

goal (1 subgoal):
 1. False
[PROOF STEP]
using inf
[PROOF STATE]
proof (prove)
using this:
finite {n. birkhoff_sum f n x \<le> 0}
infinite {n. birkhoff_sum f n x \<le> 0}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) surj_const_mult: "a \<in> carrier G \<Longrightarrow> (\<lambda>x. a \<otimes> x) ` carrier G = carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier G \<Longrightarrow> (\<otimes>) a ` carrier G = carrier G
[PROOF STEP]
apply (auto simp add: image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<in> carrier G; x \<in> carrier G\<rbrakk> \<Longrightarrow> \<exists>xa\<in>carrier G. x = a \<otimes> xa
[PROOF STEP]
by (metis inv_closed inv_solve_left m_closed)


[STATEMENT]
lemma distinct_on_no_compare: "(\<And>x y . f x y \<Longrightarrow> f y x)\<Longrightarrow>
  distinct_on f xs \<Longrightarrow> x\<in>set xs \<Longrightarrow> y\<in>set xs \<Longrightarrow> x\<noteq>y \<Longrightarrow> \<not> f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. f x y \<Longrightarrow> f y x; distinct_on f xs; x \<in> set xs; y \<in> set xs; x \<noteq> y\<rbrakk> \<Longrightarrow> \<not> f x y
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma finite_face_cycle_set[simp, intro]: "finite (face_cycle_set a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (face_cycle_set a)
[PROOF STEP]
using face_cycle_set_self
[PROOF STATE]
proof (prove)
using this:
?a \<in> face_cycle_set ?a

goal (1 subgoal):
 1. finite (face_cycle_set a)
[PROOF STEP]
unfolding face_cycle_set_def
[PROOF STATE]
proof (prove)
using this:
?a \<in> orbit face_cycle_succ ?a

goal (1 subgoal):
 1. finite (orbit face_cycle_succ a)
[PROOF STEP]
by (simp add: finite_orbit)


[STATEMENT]
lemma sums_zero[simp, intro]: "(\<lambda>n. 0) sums 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 0::'a) sums (0::'a)
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>n<n. (0::'a)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma convex_rel_interior_closure_aux:
  fixes x y z :: "'n::euclidean_space"
  assumes "0 < a" "0 < b" "(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y"
  obtains e where "0 < e" "e < 1" "z = y - e *\<^sub>R (y - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define e where "e = a / (a + b)"
[PROOF STATE]
proof (state)
this:
e = a / (a + b)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "z = (1 / (a + b)) *\<^sub>R ((a + b) *\<^sub>R z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = (1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b
(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y

goal (1 subgoal):
 1. z = (1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z
[PROOF STEP]
by (simp add: eq_vector_fraction_iff)
[PROOF STATE]
proof (state)
this:
z = (1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z = (1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<dots> = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)
[PROOF STEP]
using assms scaleR_cancel_left[of "1/(a+b)" "(a + b) *\<^sub>R z" "a *\<^sub>R x + b *\<^sub>R y"]
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b
(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y
((1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)) = ((a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y \<or> 1 / (a + b) = 0)

goal (1 subgoal):
 1. (1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / (a + b)) *\<^sub>R (a + b) *\<^sub>R z = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<dots> = y - e *\<^sub>R (y-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y) = y - e *\<^sub>R (y - x)
[PROOF STEP]
using e_def assms
[PROOF STATE]
proof (prove)
using this:
e = a / (a + b)
0 < a
0 < b
(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y

goal (1 subgoal):
 1. (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y) = y - e *\<^sub>R (y - x)
[PROOF STEP]
by (simp add: divide_simps vector_fraction_eq_iff) (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y) = y - e *\<^sub>R (y - x)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
z = y - e *\<^sub>R (y - x)
[PROOF STEP]
have "z = y - e *\<^sub>R (y-x)"
[PROOF STATE]
proof (prove)
using this:
z = y - e *\<^sub>R (y - x)

goal (1 subgoal):
 1. z = y - e *\<^sub>R (y - x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z = y - e *\<^sub>R (y - x)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z = y - e *\<^sub>R (y - x)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "e > 0" "e < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e &&& e < 1
[PROOF STEP]
using e_def assms
[PROOF STATE]
proof (prove)
using this:
e = a / (a + b)
0 < a
0 < b
(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y

goal (1 subgoal):
 1. 0 < e &&& e < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e
e < 1

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z = y - e *\<^sub>R (y - x)
0 < e
e < 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = y - e *\<^sub>R (y - x)
0 < e
e < 1

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that[of e]
[PROOF STATE]
proof (prove)
using this:
z = y - e *\<^sub>R (y - x)
0 < e
e < 1
\<lbrakk>0 < e; e < 1; z = y - e *\<^sub>R (y - x)\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_eq_append_conv: "map f xs = ys\<^sub>1@ys\<^sub>2
  \<longleftrightarrow> (\<exists>xs\<^sub>1 xs\<^sub>2. xs = xs\<^sub>1@xs\<^sub>2 \<and> map f xs\<^sub>1 = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f xs = ys\<^sub>1 @ ys\<^sub>2) = (\<exists>xs\<^sub>1 xs\<^sub>2. xs = xs\<^sub>1 @ xs\<^sub>2 \<and> map f xs\<^sub>1 = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map f xs = ys\<^sub>1 @ ys\<^sub>2 \<Longrightarrow> \<exists>xs\<^sub>1 xs\<^sub>2. xs = xs\<^sub>1 @ xs\<^sub>2 \<and> map f xs\<^sub>1 = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2
 2. \<exists>xs\<^sub>1 xs\<^sub>2. xs = xs\<^sub>1 @ xs\<^sub>2 \<and> map f xs\<^sub>1 = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2 \<Longrightarrow> map f xs = ys\<^sub>1 @ ys\<^sub>2
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f xs = ys\<^sub>1 @ ys\<^sub>2 \<Longrightarrow> \<exists>xs\<^sub>1 xs\<^sub>2. xs = xs\<^sub>1 @ xs\<^sub>2 \<and> map f xs\<^sub>1 = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2
[PROOF STEP]
apply (rule exI[where x="take (length ys\<^sub>1) xs"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f xs = ys\<^sub>1 @ ys\<^sub>2 \<Longrightarrow> \<exists>xs\<^sub>2. xs = take (length ys\<^sub>1) xs @ xs\<^sub>2 \<and> map f (take (length ys\<^sub>1) xs) = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2
[PROOF STEP]
apply (rule exI[where x="drop (length ys\<^sub>1) xs"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f xs = ys\<^sub>1 @ ys\<^sub>2 \<Longrightarrow> xs = take (length ys\<^sub>1) xs @ drop (length ys\<^sub>1) xs \<and> map f (take (length ys\<^sub>1) xs) = ys\<^sub>1 \<and> map f (drop (length ys\<^sub>1) xs) = ys\<^sub>2
[PROOF STEP]
apply (drule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ys\<^sub>1 @ ys\<^sub>2 = map f xs \<Longrightarrow> xs = take (length ys\<^sub>1) xs @ drop (length ys\<^sub>1) xs \<and> map f (take (length ys\<^sub>1) xs) = ys\<^sub>1 \<and> map f (drop (length ys\<^sub>1) xs) = ys\<^sub>2
[PROOF STEP]
by (auto simp: append_eq_conv_conj take_map drop_map)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xs\<^sub>1 xs\<^sub>2. xs = xs\<^sub>1 @ xs\<^sub>2 \<and> map f xs\<^sub>1 = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2 \<Longrightarrow> map f xs = ys\<^sub>1 @ ys\<^sub>2
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xs\<^sub>1 xs\<^sub>2. xs = xs\<^sub>1 @ xs\<^sub>2 \<and> map f xs\<^sub>1 = ys\<^sub>1 \<and> map f xs\<^sub>2 = ys\<^sub>2 \<Longrightarrow> map f xs = ys\<^sub>1 @ ys\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iterate_is_empty_by_size_correct :
assumes it: "set_iterator it S0"
shows "iterate_is_empty_by_size it = (S0 = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iterate_is_empty_by_size it = (S0 = {})
[PROOF STEP]
using iterate_size_abort_correct[OF it, of 1]
[PROOF STATE]
proof (prove)
using this:
iterate_size_abort it 1 = min 1 (card S0) \<and> finite S0

goal (1 subgoal):
 1. iterate_is_empty_by_size it = (S0 = {})
[PROOF STEP]
unfolding iterate_is_empty_by_size_def
[PROOF STATE]
proof (prove)
using this:
iterate_size_abort it 1 = min 1 (card S0) \<and> finite S0

goal (1 subgoal):
 1. (iterate_size_abort it 1 = 0) = (S0 = {})
[PROOF STEP]
by (cases "card S0") auto


[STATEMENT]
lemma dist_triangle3: "dist x y \<le> dist a x + dist a y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x y \<le> dist a x + dist a y
[PROOF STEP]
using dist_triangle2 [of x y a]
[PROOF STATE]
proof (prove)
using this:
dist x y \<le> dist x a + dist y a

goal (1 subgoal):
 1. dist x y \<le> dist a x + dist a y
[PROOF STEP]
by (simp add: dist_commute)


[STATEMENT]
lemma wf_trm_subterm_arity: "wf\<^sub>t\<^sub>r\<^sub>m t \<Longrightarrow> Fun f T \<sqsubseteq> t \<Longrightarrow> length T = arity f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf\<^sub>t\<^sub>r\<^sub>m t; Fun f T \<sqsubseteq> t\<rbrakk> \<Longrightarrow> length T = arity f
[PROOF STEP]
unfolding wf\<^sub>t\<^sub>r\<^sub>m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>f T. Fun f T \<sqsubseteq> t \<longrightarrow> length T = arity f; Fun f T \<sqsubseteq> t\<rbrakk> \<Longrightarrow> length T = arity f
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_deriv_0[simp]: "fps_deriv 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv 0 = 0
[PROOF STEP]
by (simp add: fps_deriv_def fps_eq_iff)


[STATEMENT]
lemma pairwise_coprime_dvd:
  assumes "finite A" "pairwise coprime A" "(n::nat) = prod id A" "\<forall>a\<in>A. a dvd j"
  shows "n dvd j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n dvd j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
pairwise coprime A
n = prod id A
\<forall>a\<in>A. a dvd j

goal (1 subgoal):
 1. n dvd j
[PROOF STEP]
proof (induction A arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>pairwise coprime {}; n = prod id {}; \<forall>a\<in>{}. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
 2. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. \<lbrakk>pairwise coprime F; n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j; pairwise coprime (insert x F); n = prod id (insert x F); \<forall>a\<in>insert x F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
[PROOF STEP]
case i: (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>pairwise coprime F; ?n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> ?n dvd j
pairwise coprime (insert x F)
n = prod id (insert x F)
\<forall>a\<in>insert x F. a dvd j

goal (2 subgoals):
 1. \<And>n. \<lbrakk>pairwise coprime {}; n = prod id {}; \<forall>a\<in>{}. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
 2. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. \<lbrakk>pairwise coprime F; n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j; pairwise coprime (insert x F); n = prod id (insert x F); \<forall>a\<in>insert x F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
[PROOF STEP]
have "prod id F dvd j" "x dvd j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod id F dvd j &&& x dvd j
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>pairwise coprime F; ?n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> ?n dvd j
pairwise coprime (insert x F)
n = prod id (insert x F)
\<forall>a\<in>insert x F. a dvd j

goal (1 subgoal):
 1. prod id F dvd j &&& x dvd j
[PROOF STEP]
unfolding pairwise_def
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>x\<in>F. \<forall>y\<in>F. x \<noteq> y \<longrightarrow> coprime x y; ?n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> ?n dvd j
\<forall>xa\<in>insert x F. \<forall>y\<in>insert x F. xa \<noteq> y \<longrightarrow> coprime xa y
n = prod id (insert x F)
\<forall>a\<in>insert x F. a dvd j

goal (1 subgoal):
 1. prod id F dvd j &&& x dvd j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod id F dvd j
x dvd j

goal (2 subgoals):
 1. \<And>n. \<lbrakk>pairwise coprime {}; n = prod id {}; \<forall>a\<in>{}. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
 2. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. \<lbrakk>pairwise coprime F; n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j; pairwise coprime (insert x F); n = prod id (insert x F); \<forall>a\<in>insert x F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prod id F dvd j
x dvd j

goal (2 subgoals):
 1. \<And>n. \<lbrakk>pairwise coprime {}; n = prod id {}; \<forall>a\<in>{}. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
 2. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. \<lbrakk>pairwise coprime F; n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j; pairwise coprime (insert x F); n = prod id (insert x F); \<forall>a\<in>insert x F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
[PROOF STEP]
have "coprime (prod id F) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (prod id F) x
[PROOF STEP]
by (metis i(2, 4) id_apply pairwise_insert prod_coprime_left)
[PROOF STATE]
proof (state)
this:
coprime (prod id F) x

goal (2 subgoals):
 1. \<And>n. \<lbrakk>pairwise coprime {}; n = prod id {}; \<forall>a\<in>{}. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
 2. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. \<lbrakk>pairwise coprime F; n = prod id F; \<forall>a\<in>F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j; pairwise coprime (insert x F); n = prod id (insert x F); \<forall>a\<in>insert x F. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prod id F dvd j
x dvd j
coprime (prod id F) x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
prod id F dvd j
x dvd j
coprime (prod id F) x

goal (1 subgoal):
 1. n dvd j
[PROOF STEP]
using i(1, 2, 5)
[PROOF STATE]
proof (prove)
using this:
prod id F dvd j
x dvd j
coprime (prod id F) x
finite F
x \<notin> F
n = prod id (insert x F)

goal (1 subgoal):
 1. n dvd j
[PROOF STEP]
by (simp add: coprime_commute divides_mult)
[PROOF STATE]
proof (state)
this:
n dvd j

goal (1 subgoal):
 1. \<And>n. \<lbrakk>pairwise coprime {}; n = prod id {}; \<forall>a\<in>{}. a dvd j\<rbrakk> \<Longrightarrow> n dvd j
[PROOF STEP]
qed simp


[STATEMENT]
lemma (in finite_measure) integral_bounded_eq_bound_then_AE:
  assumes "AE x in M. f x \<le> (c::real)"
    "integrable M f" "(\<integral>x. f x \<partial>M) = c * measure M (space M)"
  shows "AE x in M. f x = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. f x = c
[PROOF STEP]
apply (rule integral_ineq_eq_0_then_AE)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. AE x in M. f x \<le> c
 2. integrable M f
 3. integrable M (\<lambda>x. c)
 4. integral\<^sup>L M f = LINT x|M. c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x \<le> c
integrable M f
integral\<^sup>L M f = c * Sigma_Algebra.measure M (space M)

goal (4 subgoals):
 1. AE x in M. f x \<le> c
 2. integrable M f
 3. integrable M (\<lambda>x. c)
 4. integral\<^sup>L M f = LINT x|M. c
[PROOF STEP]
by auto


[STATEMENT]
lemma halfspace_eq_empty_le:
   "{x. a \<bullet> x \<le> b} = {} \<longleftrightarrow> a = 0 \<and> b < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x. a \<bullet> x \<le> b} = {}) = (a = (0::'a) \<and> b < 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ({x. a \<bullet> x \<le> b} = {}) = (a = (0::'a) \<and> b < 0)
[PROOF STEP]
have "a = 0 \<and> b < 0" if "{x. a \<bullet> x \<le> b} \<subseteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = (0::'a) \<and> b < 0
[PROOF STEP]
using subsetD [OF that, where c = "((b-1) / (a \<bullet> a)) *\<^sub>R a"]
[PROOF STATE]
proof (prove)
using this:
((b - 1) / (a \<bullet> a)) *\<^sub>R a \<in> {x. a \<bullet> x \<le> b} \<Longrightarrow> ((b - 1) / (a \<bullet> a)) *\<^sub>R a \<in> {}

goal (1 subgoal):
 1. a = (0::'a) \<and> b < 0
[PROOF STEP]
by (force simp add: field_split_simps split: if_split_asm)
[PROOF STATE]
proof (state)
this:
{x. a \<bullet> x \<le> b} \<subseteq> {} \<Longrightarrow> a = (0::'a) \<and> b < 0

goal (1 subgoal):
 1. ({x. a \<bullet> x \<le> b} = {}) = (a = (0::'a) \<and> b < 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x. a \<bullet> x \<le> b} \<subseteq> {} \<Longrightarrow> a = (0::'a) \<and> b < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. a \<bullet> x \<le> b} \<subseteq> {} \<Longrightarrow> a = (0::'a) \<and> b < 0

goal (1 subgoal):
 1. ({x. a \<bullet> x \<le> b} = {}) = (a = (0::'a) \<and> b < 0)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
({x. a \<bullet> x \<le> b} = {}) = (a = (0::'a) \<and> b < 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma listsum_cong:
 "\<lbrakk> xs = ys; \<And>y. y \<in> set ys \<Longrightarrow> f y = g y \<rbrakk>
  \<Longrightarrow> ListSum xs f = ListSum ys g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs = ys; \<And>y. y \<in> set ys \<Longrightarrow> f y = g y\<rbrakk> \<Longrightarrow> ListSum xs f = ListSum ys g
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs = ys; \<And>y. y \<in> set ys \<Longrightarrow> f y = g y\<rbrakk> \<Longrightarrow> ListSum ys f = ListSum ys g
[PROOF STEP]
apply(erule thin_rl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> set ys \<Longrightarrow> f y = g y) \<Longrightarrow> ListSum ys f = ListSum ys g
[PROOF STEP]
by (induct ys) simp_all


[STATEMENT]
lemma vcinjection_vrange_vsubset:
  assumes "i \<in>\<^sub>\<circ> I"
  shows "\<R>\<^sub>\<circ> (vcinjection A i) \<subseteq>\<^sub>\<circ> (\<Coprod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (vcinjection A i) \<subseteq>\<^sub>\<circ> VSigma I A
[PROOF STEP]
unfolding vcinjection_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (VLambda (A i) (vpair i)) \<subseteq>\<^sub>\<circ> VSigma I A
[PROOF STEP]
proof(intro vrange_VLambda_vsubset)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A i \<Longrightarrow> \<langle>i, x\<rangle> \<in>\<^sub>\<circ> VSigma I A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A i \<Longrightarrow> \<langle>i, x\<rangle> \<in>\<^sub>\<circ> VSigma I A
[PROOF STEP]
assume prems: "x \<in>\<^sub>\<circ> A i"
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> A i

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A i \<Longrightarrow> \<langle>i, x\<rangle> \<in>\<^sub>\<circ> VSigma I A
[PROOF STEP]
show "\<langle>i, x\<rangle> \<in>\<^sub>\<circ> (\<Coprod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>i, x\<rangle> \<in>\<^sub>\<circ> VSigma I A
[PROOF STEP]
by (intro vdunionI[where A=A, OF _ assms prems]) simp
[PROOF STATE]
proof (state)
this:
\<langle>i, x\<rangle> \<in>\<^sub>\<circ> VSigma I A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SMP_subterms_eq:
  "SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) = SMP M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) = SMP M
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<subseteq> SMP M
 2. SMP M \<subseteq> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M)
[PROOF STEP]
show "SMP M \<subseteq> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SMP M \<subseteq> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M)
[PROOF STEP]
using SMP_mono[of M "subterms\<^sub>s\<^sub>e\<^sub>t M"]
[PROOF STATE]
proof (prove)
using this:
M \<subseteq> subterms\<^sub>s\<^sub>e\<^sub>t M \<Longrightarrow> SMP M \<subseteq> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M)

goal (1 subgoal):
 1. SMP M \<subseteq> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
SMP M \<subseteq> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M)

goal (1 subgoal):
 1. SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<subseteq> SMP M
[PROOF STEP]
show "SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<subseteq> SMP M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<subseteq> SMP M
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<Longrightarrow> x \<in> SMP M
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<Longrightarrow> x \<in> SMP M
[PROOF STEP]
show "t \<in> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<Longrightarrow> t \<in> SMP M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<Longrightarrow> t \<in> SMP M
[PROOF STEP]
by (induction t rule: SMP.induct) blast+
[PROOF STATE]
proof (state)
this:
t \<in> SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<Longrightarrow> t \<in> SMP M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
SMP (subterms\<^sub>s\<^sub>e\<^sub>t M) \<subseteq> SMP M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma im_subgroup :
  assumes "Subgroup H"
  shows   "Group.Subgroup ImG (T ` H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group (T ` H) \<and> T ` H \<subseteq> ImG
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Group (T ` H)
 2. T ` H \<subseteq> ImG
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
[PROOF STEP]
have "Group ((T \<down> H) ` H)"
[PROOF STATE]
proof (prove)
using this:
Subgroup H

goal (1 subgoal):
 1. Group ((T \<down> H) ` H)
[PROOF STEP]
using GroupHom_restrict0_subgroup GroupHom.Group_Im
[PROOF STATE]
proof (prove)
using this:
Subgroup H
Subgroup ?H \<Longrightarrow> GroupHom ?H (T \<down> ?H)
GroupHom ?G ?T \<Longrightarrow> Group (?T ` ?G)

goal (1 subgoal):
 1. Group ((T \<down> H) ` H)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Group ((T \<down> H) ` H)

goal (2 subgoals):
 1. Group (T ` H)
 2. T ` H \<subseteq> ImG
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Group ((T \<down> H) ` H)

goal (2 subgoals):
 1. Group (T ` H)
 2. T ` H \<subseteq> ImG
[PROOF STEP]
have "(T \<down> H) ` H = T ` H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T \<down> H) ` H = T ` H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(T \<down> H) ` H = T ` H

goal (2 subgoals):
 1. Group (T ` H)
 2. T ` H \<subseteq> ImG
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Group ((T \<down> H) ` H)
(T \<down> H) ` H = T ` H
[PROOF STEP]
show "Group (T ` H)"
[PROOF STATE]
proof (prove)
using this:
Group ((T \<down> H) ` H)
(T \<down> H) ` H = T ` H

goal (1 subgoal):
 1. Group (T ` H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Group (T ` H)

goal (1 subgoal):
 1. T ` H \<subseteq> ImG
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
[PROOF STEP]
show "T ` H \<subseteq> ImG"
[PROOF STATE]
proof (prove)
using this:
Subgroup H

goal (1 subgoal):
 1. T ` H \<subseteq> ImG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
T ` H \<subseteq> ImG

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_baldR[simp]: "size (rbt_baldR t1 a b t2) = Suc (size t1 + size t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (rbt_baldR t1 a b t2) = Suc (size t1 + size t2)
[PROOF STEP]
by (induction t1 a b t2 rule: rbt_baldR.induct) auto


[STATEMENT]
lemma transcendental_cosh:
  assumes "algebraic z" "z \<noteq> 0"
  shows   "\<not>algebraic (cosh z :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> algebraic (cosh z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> algebraic (cosh z)
[PROOF STEP]
have "\<not>algebraic (\<Sum>(a,b)\<leftarrow>[(1/2, z), (1/2, -z)]. a * exp b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> algebraic (\<Sum>(a, b)\<leftarrow>[(1 / 2, z), (1 / 2, - z)]. a * exp b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
algebraic z
z \<noteq> 0

goal (1 subgoal):
 1. \<not> algebraic (\<Sum>(a, b)\<leftarrow>[(1 / 2, z), (1 / 2, - z)]. a * exp b)
[PROOF STEP]
by (intro sum_of_exp_transcendentalI) auto
[PROOF STATE]
proof (state)
this:
\<not> algebraic (\<Sum>(a, b)\<leftarrow>[(1 / 2, z), (1 / 2, - z)]. a * exp b)

goal (1 subgoal):
 1. \<not> algebraic (cosh z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<not> algebraic (\<Sum>(a, b)\<leftarrow>[(1 / 2, z), (1 / 2, - z)]. a * exp b)

goal (1 subgoal):
 1. \<not> algebraic (cosh z)
[PROOF STEP]
have "(\<Sum>(a,b)\<leftarrow>[(1/2, z), (1/2, -z)]. a * exp b) = cosh z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(a, b)\<leftarrow>[(1 / 2, z), (1 / 2, - z)]. a * exp b) = cosh z
[PROOF STEP]
by (simp add: cosh_def field_simps scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(\<Sum>(a, b)\<leftarrow>[(1 / 2, z), (1 / 2, - z)]. a * exp b) = cosh z

goal (1 subgoal):
 1. \<not> algebraic (cosh z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<not> algebraic (cosh z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> algebraic (cosh z)

goal (1 subgoal):
 1. \<not> algebraic (cosh z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<not> algebraic (cosh z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma agree_DRESTRICT_2:
  assumes "(fmdom' s1 \<subseteq> vs1)" "(fmdom' s2 \<subseteq> vs2)" "(agree s1 s2)"
  shows "(agree (fmrestrict_set vs2 s1) (fmrestrict_set vs1 s2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. agree (fmrestrict_set vs2 s1) (fmrestrict_set vs1 s2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fmdom' s1 \<subseteq> vs1
fmdom' s2 \<subseteq> vs2
agree s1 s2

goal (1 subgoal):
 1. agree (fmrestrict_set vs2 s1) (fmrestrict_set vs1 s2)
[PROOF STEP]
unfolding agree_def fmdom'_restrict_set_precise
[PROOF STATE]
proof (prove)
using this:
fmdom' s1 \<subseteq> vs1
fmdom' s2 \<subseteq> vs2
\<forall>v. v \<in> fmdom' s1 \<and> v \<in> fmdom' s2 \<longrightarrow> fmlookup s1 v = fmlookup s2 v

goal (1 subgoal):
 1. \<forall>v. v \<in> fmdom' s1 \<inter> vs2 \<and> v \<in> fmdom' s2 \<inter> vs1 \<longrightarrow> fmlookup (fmrestrict_set vs2 s1) v = fmlookup (fmrestrict_set vs1 s2) v
[PROOF STEP]
by auto

\<comment> \<open>NOTE added lemma.\<close>


[STATEMENT]
lemma emeasure_point_measure_finite:
  "finite A \<Longrightarrow> X \<subseteq> A \<Longrightarrow> emeasure (point_measure A f) X = (\<Sum>a\<in>X. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; X \<subseteq> A\<rbrakk> \<Longrightarrow> emeasure (point_measure A f) X = sum f X
[PROOF STEP]
by (subst emeasure_point_measure) (auto dest: finite_subset intro!: sum.mono_neutral_left simp: less_le)


[STATEMENT]
lemma length_partition_holes_nth [simp]:
  assumes "sum_list (map num_holes cs) = length ts"
    and "i < length cs"
  shows "length (partition_holes ts cs ! i) = num_holes (cs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (partition_holes ts cs ! i) = num_holes (cs ! i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sum_list (map num_holes cs) = length ts
i < length cs

goal (1 subgoal):
 1. length (partition_holes ts cs ! i) = num_holes (cs ! i)
[PROOF STEP]
by (simp add: length_partition_by_nth)


[STATEMENT]
lemma fls_integral_neg [simp]: "fls_integral (-f) = - fls_integral f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (- f) = - fls_integral f
[PROOF STEP]
using fls_integral_sub[of 0 f]
[PROOF STATE]
proof (prove)
using this:
fls_integral (0 - f) = fls_integral 0 - fls_integral f

goal (1 subgoal):
 1. fls_integral (- f) = - fls_integral f
[PROOF STEP]
by simp


[STATEMENT]
lemma max_exists: "finite (X::nat set) ==> X \<noteq> {} --> (\<exists>x. x \<in> X & (\<forall>y. y \<in> X --> y \<le> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> X \<and> (\<forall>y. y \<in> X \<longrightarrow> y \<le> x))
[PROOF STEP]
apply(erule_tac finite_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {} \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> {} \<and> (\<forall>y. y \<in> {} \<longrightarrow> y \<le> x))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x))\<rbrakk> \<Longrightarrow> insert x F \<noteq> {} \<longrightarrow> (\<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa))
[PROOF STEP]
apply(force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x))\<rbrakk> \<Longrightarrow> insert x F \<noteq> {} \<longrightarrow> (\<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa))
[PROOF STEP]
apply(rule)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x)); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa)
[PROOF STEP]
apply(case_tac "F = {}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x)); insert x F \<noteq> {}; F = {}\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x)); insert x F \<noteq> {}; F \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa)
[PROOF STEP]
apply(force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<longrightarrow> (\<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x)); insert x F \<noteq> {}; F \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa)
[PROOF STEP]
apply(erule impE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}\<rbrakk> \<Longrightarrow> F \<noteq> {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}; \<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa)
[PROOF STEP]
apply(force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}; \<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa)
[PROOF STEP]
apply(elim exE conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F xa. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}; xa \<in> F; \<forall>y. y \<in> F \<longrightarrow> y \<le> xa\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> xa)
[PROOF STEP]
apply(rule_tac x="max x xa" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F xa. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}; xa \<in> F; \<forall>y. y \<in> F \<longrightarrow> y \<le> xa\<rbrakk> \<Longrightarrow> max x xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> y \<le> max x xa)
[PROOF STEP]
apply(rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x F xa. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}; xa \<in> F; \<forall>y. y \<in> F \<longrightarrow> y \<le> xa\<rbrakk> \<Longrightarrow> max x xa \<in> insert x F
 2. \<And>x F xa. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}; xa \<in> F; \<forall>y. y \<in> F \<longrightarrow> y \<le> xa\<rbrakk> \<Longrightarrow> \<forall>y. y \<in> insert x F \<longrightarrow> y \<le> max x xa
[PROOF STEP]
apply(simp add: max_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F xa. \<lbrakk>finite F; x \<notin> F; insert x F \<noteq> {}; F \<noteq> {}; xa \<in> F; \<forall>y. y \<in> F \<longrightarrow> y \<le> xa\<rbrakk> \<Longrightarrow> \<forall>y. y \<in> insert x F \<longrightarrow> y \<le> max x xa
[PROOF STEP]
apply(simp add: max_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F xa. \<lbrakk>finite F; x \<notin> F; F \<noteq> {}; xa \<in> F; \<forall>y. y \<in> F \<longrightarrow> y \<le> xa\<rbrakk> \<Longrightarrow> \<not> x \<le> xa \<longrightarrow> (\<forall>y. y \<in> F \<longrightarrow> y \<le> x)
[PROOF STEP]
apply(force)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
  \<comment> \<open>poor max lemmas in lib\<close>


[STATEMENT]
lemma eq_onp_Id_on_eq[pred_set_conv]: "eq_onp (\<lambda> a. a \<in> A) = (\<lambda> x y. (x, y) \<in> Id_on A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_onp (\<lambda>a. a \<in> A) = (\<lambda>x y. (x, y) \<in> Id_on A)
[PROOF STEP]
unfolding eq_onp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. x \<in> A \<and> x = y) = (\<lambda>x y. (x, y) \<in> Id_on A)
[PROOF STEP]
by auto


[STATEMENT]
lemma proots_count_of_root: assumes "P \<noteq> 0" "x\<in>S" "poly P x = 0"
  shows "proots_count P S > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count P S
[PROOF STEP]
using proots_count_of_root_set[of P "{x}" S] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>P \<noteq> 0; {x} \<subseteq> S; \<And>xa. xa \<in> {x} \<Longrightarrow> poly P xa = (0::'a)\<rbrakk> \<Longrightarrow> card {x} \<le> proots_count P S
P \<noteq> 0
x \<in> S
poly P x = (0::'a)

goal (1 subgoal):
 1. 0 < proots_count P S
[PROOF STEP]
by force


[STATEMENT]
lemma desargues_config_not_col_4:
  assumes "desargues_config A B C A' B' C' M N P R"
  shows "\<not> col A A' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> col A A' C'
[PROOF STEP]
using assms desargues_config_not_col_3 desargues_config_rot_CCW
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<Longrightarrow> \<not> col ?C ?C' ?B'
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<Longrightarrow> desargues_config ?B ?C ?A ?B' ?C' ?A' ?N ?P ?M ?R

goal (1 subgoal):
 1. \<not> col A A' C'
[PROOF STEP]
by blast


[STATEMENT]
lemma eventually_deriv_compose':
  assumes "f twice_field_differentiable_at x"
      and "g twice_field_differentiable_at (f x)"
    shows "\<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
using assms eventually_deriv_compose twice_field_differentiable_at_def
[PROOF STATE]
proof (prove)
using this:
f twice_field_differentiable_at x
g twice_field_differentiable_at f x
\<lbrakk>\<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S; ?g twice_field_differentiable_at ?f ?x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in nhds ?x. deriv (\<lambda>x. ?g (?f x)) x = deriv ?g (?f x) * deriv ?f x
?f twice_field_differentiable_at ?x \<equiv> \<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S \<and> deriv ?f field_differentiable at ?x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
by blast


[STATEMENT]
lemma has_integral_componentwise:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  shows "(\<And>b. b \<in> Basis \<Longrightarrow> ((\<lambda>x. f x \<bullet> b) has_integral (y \<bullet> b)) A) \<Longrightarrow> (f has_integral y) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. b \<in> Basis \<Longrightarrow> ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A) \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
by (subst has_integral_componentwise_iff) blast


[STATEMENT]
lemma not_collinear_vangle: "\<not>collinear {0,u,v} \<Longrightarrow> vangle u v \<in> {0<..<pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> collinear {0::'a, u, v} \<Longrightarrow> vangle u v \<in> {0<..<pi}
[PROOF STEP]
using vangle_bounds[of u v] vangle_collinear[of u v]
[PROOF STATE]
proof (prove)
using this:
0 \<le> vangle u v
vangle u v \<le> pi
vangle u v \<in> {0, pi} \<Longrightarrow> collinear {0::'a, u, v}

goal (1 subgoal):
 1. \<not> collinear {0::'a, u, v} \<Longrightarrow> vangle u v \<in> {0<..<pi}
[PROOF STEP]
by (cases "vangle u v = 0 \<or> vangle u v = pi") auto


[STATEMENT]
lemma ennreal_eq_zero_iff[simp]: "0 \<le> x \<Longrightarrow> ennreal x = 0 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (ennreal x = 0) = (x = 0)
[PROOF STEP]
by transfer (auto simp: max_absorb2)


[STATEMENT]
lemma hmset_pos_neg_dual:
  "hmset_pos a + hmset_pos b + (hmset_neg a - hmset_pos b) + (hmset_neg b - hmset_pos a) =
   hmset_neg a + hmset_neg b + (hmset_pos a - hmset_neg b) + (hmset_pos b - hmset_neg a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hmset_pos a + hmset_pos b + (hmset_neg a - hmset_pos b) + (hmset_neg b - hmset_pos a) = hmset_neg a + hmset_neg b + (hmset_pos a - hmset_neg b) + (hmset_pos b - hmset_neg a)
[PROOF STEP]
by (simp add: HMSet_plus[symmetric] HMSet_diff[symmetric]) (rule mset_pos_neg_dual)


[STATEMENT]
lemma Sup_eq_0_iff [simp]: "\<Squnion>A = 0 \<longleftrightarrow> A \<subseteq> {0} \<or> \<not> small A" for A :: "V set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion> A = 0) = (A \<subseteq> {0} \<or> \<not> small A)
[PROOF STEP]
using Sup_upper
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> ?A; small ?A\<rbrakk> \<Longrightarrow> ?x \<le> \<Squnion> ?A

goal (1 subgoal):
 1. (\<Squnion> A = 0) = (A \<subseteq> {0} \<or> \<not> small A)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma nat_mod_int :
  assumes "n mod m = k"
  shows "int n mod int m = int k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int n mod int m = int k
[PROOF STEP]
by (metis assms of_nat_mod)


[STATEMENT]
lemma all_edges_between_disjnt1: "disjnt X Y \<Longrightarrow> disjnt (all_edges_between X Z) (all_edges_between Y Z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjnt X Y \<Longrightarrow> disjnt (all_edges_between X Z) (all_edges_between Y Z)
[PROOF STEP]
by (auto simp: all_edges_between_def disjnt_iff)


[STATEMENT]
lemma complex_roots_int:
  "smult (lead_coeff p) (\<Prod>a\<leftarrow>complex_roots_int p. [:- a, 1:]) = map_poly of_int p"
  "length (complex_roots_int p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (complex_of_int (lead_coeff p)) (\<Prod>a\<leftarrow>complex_roots_int p. [:- a, 1:]) = of_int_poly p &&& length (complex_roots_int p) = degree p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Polynomial.smult (complex_of_int (lead_coeff p)) (\<Prod>a\<leftarrow>complex_roots_int p. [:- a, 1:]) = of_int_poly p
 2. length (complex_roots_int p) = degree p
[PROOF STEP]
show "smult (lead_coeff p) (\<Prod>a\<leftarrow>complex_roots_int p. [:- a, 1:]) = map_poly of_int p"
  "length (complex_roots_int p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (complex_of_int (lead_coeff p)) (\<Prod>a\<leftarrow>complex_roots_int p. [:- a, 1:]) = of_int_poly p &&& length (complex_roots_int p) = degree p
[PROOF STEP]
using complex_roots[of "map_poly of_int p"]
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (lead_coeff (of_int_poly p)) (\<Prod>a\<leftarrow>complex_roots_complex (of_int_poly p). [:- a, 1:]) = of_int_poly p
length (complex_roots_complex (of_int_poly p)) = degree (of_int_poly p)

goal (1 subgoal):
 1. Polynomial.smult (complex_of_int (lead_coeff p)) (\<Prod>a\<leftarrow>complex_roots_int p. [:- a, 1:]) = of_int_poly p &&& length (complex_roots_int p) = degree p
[PROOF STEP]
unfolding complex_roots_int_def
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (lead_coeff (of_int_poly p)) (\<Prod>a\<leftarrow>complex_roots_complex (of_int_poly p). [:- a, 1:]) = of_int_poly p
length (complex_roots_complex (of_int_poly p)) = degree (of_int_poly p)

goal (1 subgoal):
 1. Polynomial.smult (complex_of_int (lead_coeff p)) (\<Prod>a\<leftarrow>complex_roots_complex (of_int_poly p). [:- a, 1:]) = of_int_poly p &&& length (complex_roots_complex (of_int_poly p)) = degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Polynomial.smult (complex_of_int (lead_coeff p)) (\<Prod>a\<leftarrow>complex_roots_int p. [:- a, 1:]) = of_int_poly p
length (complex_roots_int p) = degree p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_union_of_distinct :
  assumes "\<forall> S1 \<in> SS . \<forall> S2 \<in> SS . S1 = S2 \<or> f S1 \<inter> f S2 = {}"
  and     "finite SS"
  and     "\<forall> S \<in> SS . f S \<noteq> {}"
shows "card (image f SS) = card SS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
finite SS
[PROOF STEP]
have "\<forall> S1 \<in> SS . \<forall> S2 \<in> SS . S1 = S2 \<or> f S1 \<inter> f S2 = {}
                      \<Longrightarrow> \<forall> S \<in> SS . f S \<noteq> {} \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
using this:
finite SS

goal (1 subgoal):
 1. \<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS
[PROOF STEP]
proof (induction SS)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>{}. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` {}) = card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>{}. f S \<noteq> {}

goal (2 subgoals):
 1. \<lbrakk>\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>{}. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` {}) = card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>{}. f S \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>S1\<in>{}. \<forall>S2\<in>{}. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>{}. f S \<noteq> {}

goal (1 subgoal):
 1. card (f ` {}) = card {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f ` {}) = card {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}
[PROOF STEP]
have "\<not> (\<exists> y \<in> F . f y = f x)"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. \<not> (\<exists>y\<in>F. f y = f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>y\<in>F. f y = f x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>y\<in>F. f y = f x)
[PROOF STEP]
have "f x \<notin> image f F"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>y\<in>F. f y = f x)

goal (1 subgoal):
 1. f x \<notin> f ` F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x \<notin> f ` F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f x \<notin> f ` F
[PROOF STEP]
have "card (image f (insert x F)) = Suc (card (image f F))"
[PROOF STATE]
proof (prove)
using this:
f x \<notin> f ` F

goal (1 subgoal):
 1. card (f ` insert x F) = Suc (card (f ` F))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
f x \<notin> f ` F
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. card (f ` insert x F) = Suc (card (f ` F))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f ` insert x F) = Suc (card (f ` F))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (f ` insert x F) = Suc (card (f ` F))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
have "card (f ` F) = card F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f ` F) = card F
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. card (f ` F) = card F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f ` F) = card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (f ` F) = card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
have "card (insert x F) = Suc (card F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert x F) = Suc (card F)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F
\<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}
\<forall>S\<in>insert x F. f S \<noteq> {}

goal (1 subgoal):
 1. card (insert x F) = Suc (card F)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (insert x F) = Suc (card F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>S1\<in>F. \<forall>S2\<in>F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` F) = card F; \<forall>S1\<in>insert x F. \<forall>S2\<in>insert x F. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>insert x F. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` insert x F) = card (insert x F)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (f ` insert x F) = Suc (card (f ` F))
card (f ` F) = card F
card (insert x F) = Suc (card F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (f ` insert x F) = Suc (card (f ` F))
card (f ` F) = card F
card (insert x F) = Suc (card F)

goal (1 subgoal):
 1. card (f ` insert x F) = card (insert x F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (f ` insert x F) = card (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS

goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS

goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}; \<forall>S\<in>SS. f S \<noteq> {}\<rbrakk> \<Longrightarrow> card (f ` SS) = card SS
\<forall>S1\<in>SS. \<forall>S2\<in>SS. S1 = S2 \<or> f S1 \<inter> f S2 = {}
finite SS
\<forall>S\<in>SS. f S \<noteq> {}

goal (1 subgoal):
 1. card (f ` SS) = card SS
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (f ` SS) = card SS

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dist_of_real [simp]: "dist (of_real x :: 'a) (of_real y) = dist x y"
  for a :: "'a::real_normed_div_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (of_real x) (of_real y) = dist x y
[PROOF STEP]
by (metis dist_norm norm_of_real of_real_diff real_norm_def)


[STATEMENT]
lemma [code]:
  \<open>Word.the_int (word_rotr n w) = concat_bit (LENGTH('a) - n mod LENGTH('a))
    (drop_bit (n mod LENGTH('a)) (Word.the_int w))
    (Word.the_int (take_bit (n mod LENGTH('a)) w))\<close>
  for w :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Word.the_int (word_rotr n w) = concat_bit (LENGTH('a) - n mod LENGTH('a)) (drop_bit (n mod LENGTH('a)) (Word.the_int w)) (Word.the_int (take_bit (n mod LENGTH('a)) w))
[PROOF STEP]
using uint_word_rotr_eq [of n w]
[PROOF STATE]
proof (prove)
using this:
uint (word_rotr n w) = concat_bit (LENGTH('a) - n mod LENGTH('a)) (drop_bit (n mod LENGTH('a)) (uint w)) (uint (take_bit (n mod LENGTH('a)) w))

goal (1 subgoal):
 1. Word.the_int (word_rotr n w) = concat_bit (LENGTH('a) - n mod LENGTH('a)) (drop_bit (n mod LENGTH('a)) (Word.the_int w)) (Word.the_int (take_bit (n mod LENGTH('a)) w))
[PROOF STEP]
by simp


[STATEMENT]
lemma fixed_point_char:
  assumes "m \<in> M"
  shows "(m \<in> fixed_points) = (\<forall>g\<in>carrier G. \<phi> g m = m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<in> fixed_points) = (\<forall>g\<in>carrier G. \<phi> g m = m)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<in> M

goal (1 subgoal):
 1. (m \<in> fixed_points) = (\<forall>g\<in>carrier G. \<phi> g m = m)
[PROOF STEP]
unfolding fixed_points_def stabilizer_def
[PROOF STATE]
proof (prove)
using this:
m \<in> M

goal (1 subgoal):
 1. (m \<in> {m \<in> M. carrier G \<subseteq> {g \<in> carrier G. \<phi> g m = m}}) = (\<forall>g\<in>carrier G. \<phi> g m = m)
[PROOF STEP]
by force


[STATEMENT]
lemma distincts_Cons': "distincts (xs # xss)
   \<longleftrightarrow> xs \<noteq> [] \<and> distinct xs \<and> distincts xss \<and> (\<forall>ys \<in> set xss. set xs \<inter> set ys = {})" (is "?L \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distincts (xs # xss) = (xs \<noteq> [] \<and> distinct xs \<and> distincts xss \<and> (\<forall>ys\<in>set xss. set xs \<inter> set ys = {}))
[PROOF STEP]
unfolding distincts_Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<noteq> [] \<and> distinct xs \<and> distincts xss \<and> set xs \<inter> \<Union> (set ` set xss) = {}) = (xs \<noteq> [] \<and> distinct xs \<and> distincts xss \<and> (\<forall>ys\<in>set xss. set xs \<inter> set ys = {}))
[PROOF STEP]
by blast


[STATEMENT]
lemma InfCard_cadd_eq: "\<lbrakk>InfCard \<kappa>; InfCard \<mu>\<rbrakk> \<Longrightarrow> \<kappa> \<oplus> \<mu> = \<kappa> \<squnion> \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>InfCard \<kappa>; InfCard \<mu>\<rbrakk> \<Longrightarrow> \<kappa> \<oplus> \<mu> = \<kappa> \<squnion> \<mu>
[PROOF STEP]
by (metis Card_iff_initial InfCard_def InfCard_le_cadd_eq Ord_linear_le cadd_commute sup.absorb2 sup.orderE)


[STATEMENT]
lemma wf_subterm_pair_rel:
    shows "wf subterm_pair_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {((t1, t2), u1, u2). subterm t1 u1 \<and> subterm t2 u2}
[PROOF STEP]
using subterm_implies_smaller
            wf_if_img_lt [of subterm_pair_rel "\<lambda>(t1, t2). max (size t1) (size t2)"]
[PROOF STATE]
proof (prove)
using this:
subterm ?t ?u \<Longrightarrow> local.size ?t < local.size ?u
(\<And>x y. (x, y) \<in> {((t1, t2), u1, u2). subterm t1 u1 \<and> subterm t2 u2} \<Longrightarrow> (case x of (t1, t2) \<Rightarrow> max (local.size t1) (local.size t2)) < (case y of (t1, t2) \<Rightarrow> max (local.size t1) (local.size t2))) \<Longrightarrow> wf {((t1, t2), u1, u2). subterm t1 u1 \<and> subterm t2 u2}

goal (1 subgoal):
 1. wf {((t1, t2), u1, u2). subterm t1 u1 \<and> subterm t2 u2}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma stieltjes_gamma_summable:
  "summable (\<lambda>k. ln (k+1) ^ n / (k+1) - (ln (k+2) ^ (n+1) - ln (k+1) ^ (n + 1)) / (n + 1))"
    (is "summable ?f")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>k. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / (real n + 1))
[PROOF STEP]
proof (rule summable_comparison_test_bigo)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. norm (?g n))
 2. (\<lambda>k. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / (real n + 1)) \<in> O(?g)
[PROOF STEP]
(* TODO: good real_asymp example *)
  (* TODO: investigate how to make this more automatic *)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. norm (?g n))
 2. (\<lambda>k. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / (real n + 1)) \<in> O(?g)
[PROOF STEP]
have "eventually (\<lambda>x::real. ln x ^ n - ln x ^ (n+1) * (inverse (ln x) * (1 + real n)) *
           inverse (real n + 1) = 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln x ^ n - ln x ^ (n + 1) * (inverse (ln x) * (1 + real n)) * inverse (real n + 1) = 0
[PROOF STEP]
using eventually_gt_at_top[of 1]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (1::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln x ^ n - ln x ^ (n + 1) * (inverse (ln x) * (1 + real n)) * inverse (real n + 1) = 0
[PROOF STEP]
by eventually_elim (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. ln x ^ n - ln x ^ (n + 1) * (inverse (ln x) * (1 + real n)) * inverse (real n + 1) = 0

goal (2 subgoals):
 1. summable (\<lambda>n. norm (?g n))
 2. (\<lambda>k. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / (real n + 1)) \<in> O(?g)
[PROOF STEP]
thus "?f \<in> O(\<lambda>k. k powr (-3/2))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. ln x ^ n - ln x ^ (n + 1) * (inverse (ln x) * (1 + real n)) * inverse (real n + 1) = 0

goal (1 subgoal):
 1. (\<lambda>k. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / (real n + 1)) \<in> O(\<lambda>x. real x powr (- 3 / 2))
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / (real n + 1)) \<in> O(\<lambda>x. real x powr (- 3 / 2))

goal (1 subgoal):
 1. summable (\<lambda>n. norm (real n powr (- 3 / 2)))
[PROOF STEP]
qed (simp_all add: summable_real_powr_iff)


[STATEMENT]
lemma permutation_validS: "mset fs = mset gs --> (validS fs = validS gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset fs = mset gs \<longrightarrow> validS fs = validS gs
[PROOF STEP]
apply(simp add: validS_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset fs = mset gs \<longrightarrow> (\<forall>M. \<forall>phi\<in>modelAssigns M. evalS M phi fs) = (\<forall>M. \<forall>phi\<in>modelAssigns M. evalS M phi gs)
[PROOF STEP]
apply(simp add: evalS_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset fs = mset gs \<longrightarrow> (\<forall>M. \<forall>phi\<in>modelAssigns M. \<exists>f\<in>set fs. evalF M phi f) = (\<forall>M. \<forall>phi\<in>modelAssigns M. \<exists>f\<in>set gs. evalF M phi f)
[PROOF STEP]
using mset_eq_setD
[PROOF STATE]
proof (prove)
using this:
mset ?xs = mset ?ys \<Longrightarrow> set ?xs = set ?ys

goal (1 subgoal):
 1. mset fs = mset gs \<longrightarrow> (\<forall>M. \<forall>phi\<in>modelAssigns M. \<exists>f\<in>set fs. evalF M phi f) = (\<forall>M. \<forall>phi\<in>modelAssigns M. \<exists>f\<in>set gs. evalF M phi f)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma comp_char:
    shows "COMP g f = (if seq g f then
                         MkArr (Dom f) (Cod g) (Comp (Cod g) (Dom g) (Dom f) (Map g) (Map f))
                       else
                         null)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. COMP g f = (if seq g f then MkArr (Dom f) (Cod g) (Comp (Cod g) (Dom g) (Dom f) (Map g) (Map f)) else null)
[PROOF STEP]
using COMP_def seq_char arr_char null_char
[PROOF STATE]
proof (prove)
using this:
COMP ?g ?f \<equiv> if (?f \<noteq> Null \<and> Dom ?f \<in> Obj \<and> Cod ?f \<in> Obj \<and> Map ?f \<in> Hom (Dom ?f) (Cod ?f)) \<and> (?g \<noteq> Null \<and> Dom ?g \<in> Obj \<and> Cod ?g \<in> Obj \<and> Map ?g \<in> Hom (Dom ?g) (Cod ?g)) \<and> Dom ?g = Cod ?f then MkArr (Dom ?f) (Cod ?g) (Comp (Cod ?g) (Dom ?g) (Dom ?f) (Map ?g) (Map ?f)) else Null
seq ?g ?f = (arr ?f \<and> arr ?g \<and> Dom ?g = Cod ?f)
arr ?f = (?f \<noteq> Null \<and> Dom ?f \<in> Obj \<and> Cod ?f \<in> Obj \<and> Map ?f \<in> Hom (Dom ?f) (Cod ?f))
null = Null

goal (1 subgoal):
 1. COMP g f = (if seq g f then MkArr (Dom f) (Cod g) (Comp (Cod g) (Dom g) (Dom f) (Map g) (Map f)) else null)
[PROOF STEP]
by auto


[STATEMENT]
lemma scene_demorgan2: "-(X \<sqinter>\<^sub>S Y) = -X \<squnion>\<^sub>S -Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (X \<sqinter>\<^sub>S Y) = - X \<squnion>\<^sub>S - Y
[PROOF STEP]
by (simp add: inf_scene_def, transfer, auto)


[STATEMENT]
lemma (in aGroup) agsum_add2p:"\<lbrakk>a \<in> carrier A; 0 \<le> n\<rbrakk> \<Longrightarrow>
                                    \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> ((-n)\<triangleright>a\<^bsub>A\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> n\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (case_tac "n = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> n; n = 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
 2. \<lbrakk>a \<in> carrier A; 0 \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (simp add:sprod_n_a_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; n = 0\<rbrakk> \<Longrightarrow> \<zero> = \<zero> \<plusminus> \<zero>
 2. \<lbrakk>a \<in> carrier A; 0 \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (cut_tac ag_inc_zero)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; n = 0; \<zero> \<in> carrier A\<rbrakk> \<Longrightarrow> \<zero> = \<zero> \<plusminus> \<zero>
 2. \<lbrakk>a \<in> carrier A; 0 \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (simp add:ag_r_zero[THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (frule non_zero_int[of "n"], thin_tac "n \<noteq> 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 < n\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (subgoal_tac "-n < 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; 0 < n; - n < 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
 2. \<lbrakk>a \<in> carrier A; 0 < n\<rbrakk> \<Longrightarrow> - n < 0
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; 0 < n\<rbrakk> \<Longrightarrow> - n < 0
 2. \<lbrakk>a \<in> carrier A; 0 < n; - n < 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 < n; - n < 0\<rbrakk> \<Longrightarrow> \<zero> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (- n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (simp add:sprod_n_a_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 < n\<rbrakk> \<Longrightarrow> \<zero> = aSum A (nat n) a \<plusminus> aSum A (nat n) (-\<^sub>a a)
[PROOF STEP]
apply (simp add:agsum_add2Tr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mono_LeadsTo_o:
     "mono (h::'a::order => 'b::order)
      ==> (\<Inter>j. {s. j \<le> g s} LeadsTo {s. j \<le> f s}) \<subseteq>
          (\<Inter>k. {s. k \<le> h (g s)} LeadsTo {s. k \<le> h (f s)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono h \<Longrightarrow> (\<Inter>j. {s. j \<le> g s} \<longmapsto>w {s. j \<le> f s}) \<subseteq> (\<Inter>k. {s. k \<le> h (g s)} \<longmapsto>w {s. k \<le> h (f s)})
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x k. \<lbrakk>mono h; \<forall>xa. x \<in> {s. xa \<le> g s} \<longmapsto>w {s. xa \<le> f s}\<rbrakk> \<Longrightarrow> x \<in> {s. k \<le> h (g s)} \<longmapsto>w {s. k \<le> h (f s)}
[PROOF STEP]
apply (rule single_LeadsTo_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x k s. \<lbrakk>mono h; \<forall>xa. x \<in> {s. xa \<le> g s} \<longmapsto>w {s. xa \<le> f s}; s \<in> {s. k \<le> h (g s)}\<rbrakk> \<Longrightarrow> x \<in> {s} \<longmapsto>w {s. k \<le> h (f s)}
[PROOF STEP]
apply (drule_tac x = "g s" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x k s. \<lbrakk>mono h; s \<in> {s. k \<le> h (g s)}; x \<in> {sa. g s \<le> g sa} \<longmapsto>w {sa. g s \<le> f sa}\<rbrakk> \<Longrightarrow> x \<in> {s} \<longmapsto>w {s. k \<le> h (f s)}
[PROOF STEP]
apply (erule LeadsTo_weaken)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x k s. \<lbrakk>mono h; s \<in> {s. k \<le> h (g s)}\<rbrakk> \<Longrightarrow> {s} \<subseteq> {sa. g s \<le> g sa}
 2. \<And>x k s. \<lbrakk>mono h; s \<in> {s. k \<le> h (g s)}\<rbrakk> \<Longrightarrow> {sa. g s \<le> f sa} \<subseteq> {s. k \<le> h (f s)}
[PROOF STEP]
apply (blast intro: monoD order_trans)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_relD2: "(s,s')\<in>\<langle>R\<rangle>set_rel \<Longrightarrow> x'\<in>s' \<Longrightarrow> \<exists>x\<in>s. (x,x')\<in>R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(s, s') \<in> \<langle>R\<rangle>set_rel; x' \<in> s'\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. (x, x') \<in> R
[PROOF STEP]
unfolding set_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(s, s') \<in> {(A, B). (\<forall>x\<in>A. \<exists>y\<in>B. (x, y) \<in> R) \<and> (\<forall>y\<in>B. \<exists>x\<in>A. (x, y) \<in> R)}; x' \<in> s'\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. (x, x') \<in> R
[PROOF STEP]
by blast


[STATEMENT]
lemma snd_Sup: "snd (Sup A) = (SUP x\<in>A. snd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Sup A) = Sup (snd ` A)
[PROOF STEP]
by (simp add: Sup_prod_def)


[STATEMENT]
lemma inverse_hyperdual_parts:
  fixes a b c d :: "'a :: {inverse,ring_1}"
  shows "inverse (a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12) =
         (1 / a) *\<^sub>H ba + (- b / a ^ 2) *\<^sub>H e1 + (- c / a ^ 2) *\<^sub>H e2 + (2 * (b * c / a ^ 3) - d / a ^ 2) *\<^sub>H e12"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12) = ((1::'a) / a) *\<^sub>H ba + (- b / a\<^sup>2) *\<^sub>H e1 + (- c / a\<^sup>2) *\<^sub>H e2 + ((2::'a) * (b * c / a ^ 3) - d / a\<^sup>2) *\<^sub>H e12
[PROOF STEP]
by (simp add: hyperdual_bases)


[STATEMENT]
lemma poly_add_degree: "degree (poly_add p1 p2) \<le> max (degree p1) (degree p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_add p1 p2) \<le> max (degree p1) (degree p2)
[PROOF STEP]
using poly_add_length_le
[PROOF STATE]
proof (prove)
using this:
length (poly_add ?p1.0 ?p2.0) \<le> max (length ?p1.0) (length ?p2.0)

goal (1 subgoal):
 1. degree (poly_add p1 p2) \<le> max (degree p1) (degree p2)
[PROOF STEP]
by (meson diff_le_mono le_max_iff_disj)


[STATEMENT]
lemma Rep_formula_diff:
  "Rep_formula (x - y) = Rep_formula x - Rep_formula y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_formula (x - y) = Rep_formula x - Rep_formula y
[PROOF STEP]
unfolding minus_formula_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_formula (Abs_formula (Rep_formula x - Rep_formula y)) = Rep_formula x - Rep_formula y
[PROOF STEP]
by (intro Abs_formula_inverse fba_Diff Rep_formula)


[STATEMENT]
lemma fls_prpart_one [simp]: "fls_prpart 1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_prpart 1 = 0
[PROOF STEP]
by (simp add: fls_prpart_eq0_iff)


[STATEMENT]
lemma comparator_linordered_group [code abstract]:
  "compare comparator_linordered_group = (\<lambda>a b.
    let c = a - b in if c < 0 then Less
    else if c = 0 then Equiv else Greater)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compare comparator_linordered_group = (\<lambda>a b. let c = a - b in if c < (0::'a) then Less else if c = (0::'a) then Equiv else Greater)
[PROOF STEP]
proof (rule ext)+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. compare comparator_linordered_group a b = (let c = a - b in if c < (0::'a) then Less else if c = (0::'a) then Equiv else Greater)
[PROOF STEP]
fix a b :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. compare comparator_linordered_group a b = (let c = a - b in if c < (0::'a) then Less else if c = (0::'a) then Equiv else Greater)
[PROOF STEP]
show "compare comparator_linordered_group a b =
    (let c = a - b in if c < 0 then Less
       else if c = 0 then Equiv else Greater)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compare comparator_linordered_group a b = (let c = a - b in if c < (0::'a) then Less else if c = (0::'a) then Equiv else Greater)
[PROOF STEP]
by (simp add: Let_def not_less) (transfer; auto)
[PROOF STATE]
proof (state)
this:
compare comparator_linordered_group a b = (let c = a - b in if c < (0::'a) then Less else if c = (0::'a) then Equiv else Greater)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permute_set_eq:
 shows "p \<bullet> X = {x. - p \<bullet> x \<in> X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<bullet> X = {x. - p \<bullet> x \<in> X}
[PROOF STEP]
unfolding permute_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p \<bullet> x |x. x \<in> X} = {x. - p \<bullet> x \<in> X}
[PROOF STEP]
by (auto) (metis permute_minus_cancel(1))


[STATEMENT]
lemma multp_code_eq_multp: "irreflp r \<Longrightarrow> transp r \<Longrightarrow> multp_code r = multp r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>irreflp r; transp r\<rbrakk> \<Longrightarrow> multp_code r = multp r
[PROOF STEP]
using multp_code_iff_mult[of "{(x, y). r x y}" r for r,
    folded irreflp_irrefl_eq transp_trans multp_def, simplified]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>irreflp ?ra4; transp ?ra4\<rbrakk> \<Longrightarrow> multp_code ?ra4 ?N ?M = multp ?ra4 ?N ?M

goal (1 subgoal):
 1. \<lbrakk>irreflp r; transp r\<rbrakk> \<Longrightarrow> multp_code r = multp r
[PROOF STEP]
by blast