[STATEMENT]
lemma continuous_within_ball:
  "continuous (at x within s) f \<longleftrightarrow>
    (\<forall>e > 0. \<exists>d > 0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at x within s) f = (\<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
continuous (at x within s) f

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
continuous (at x within s) f

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
fix e :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
obtain d where d: "d>0" "\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>?lhs\<close>[unfolded continuous_within Lim_within]
[PROOF STATE]
proof (prove)
using this:
0 < e
\<forall>e>0. \<exists>d>0. \<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < d
\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 < d
\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
assume "y \<in> f ` (ball x d \<inter> s)"
[PROOF STATE]
proof (state)
this:
y \<in> f ` (ball x d \<inter> s)

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> f ` (ball x d \<inter> s)
[PROOF STEP]
have "y \<in> ball (f x) e"
[PROOF STATE]
proof (prove)
using this:
y \<in> f ` (ball x d \<inter> s)

goal (1 subgoal):
 1. y \<in> ball (f x) e
[PROOF STEP]
using d(2)
[PROOF STATE]
proof (prove)
using this:
y \<in> f ` (ball x d \<inter> s)
\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e

goal (1 subgoal):
 1. y \<in> ball (f x) e
[PROOF STEP]
using \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> f ` (ball x d \<inter> s)
\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e
0 < e

goal (1 subgoal):
 1. y \<in> ball (f x) e
[PROOF STEP]
by (auto simp: dist_commute)
[PROOF STATE]
proof (state)
this:
y \<in> ball (f x) e

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?y2 \<in> f ` (ball x d \<inter> s) \<Longrightarrow> ?y2 \<in> ball (f x) e

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y2 \<in> f ` (ball x d \<inter> s) \<Longrightarrow> ?y2 \<in> ball (f x) e
[PROOF STEP]
have "\<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e"
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> f ` (ball x d \<inter> s) \<Longrightarrow> ?y2 \<in> ball (f x) e

goal (1 subgoal):
 1. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
[PROOF STEP]
using \<open>d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> f ` (ball x d \<inter> s) \<Longrightarrow> ?y2 \<in> ball (f x) e
0 < d

goal (1 subgoal):
 1. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
[PROOF STEP]
unfolding subset_eq ball_def
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> f ` ({y. dist x y < d} \<inter> s) \<Longrightarrow> ?y2 \<in> {y. dist (f x) y < e}
0 < d

goal (1 subgoal):
 1. \<exists>d>0. \<forall>xa\<in>f ` ({y. dist x y < d} \<inter> s). xa \<in> {y. dist (f x) y < e}
[PROOF STEP]
by (auto simp: dist_commute)
[PROOF STATE]
proof (state)
this:
\<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?e2 \<Longrightarrow> \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) ?e2

goal (2 subgoals):
 1. continuous (at x within s) f \<Longrightarrow> \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
 2. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?e2 \<Longrightarrow> \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) ?e2
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
0 < ?e2 \<Longrightarrow> \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) ?e2

goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e

goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e

goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e

goal (1 subgoal):
 1. continuous (at x within s) f
[PROOF STEP]
unfolding continuous_within Lim_within ball_def subset_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>d>0. \<forall>xa\<in>f ` ({y. dist x y < d} \<inter> s). xa \<in> {y. dist (f x) y < e}

goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. \<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e
[PROOF STEP]
apply (auto simp: dist_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<forall>e>0. \<exists>d>0. \<forall>xa\<in>{y. dist y x < d} \<inter> s. dist (f xa) (f x) < e; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>xa\<in>s. xa \<noteq> x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e
[PROOF STEP]
apply (erule_tac x=e in allE, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
continuous (at x within s) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_on_cmul:
  fixes c :: real
  assumes "f measurable_on S"
  shows "(\<lambda>x. c * f x) measurable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * f x) measurable_on S
[PROOF STEP]
using measurable_on_scaleR_const [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ?c *\<^sub>R f x) measurable_on S

goal (1 subgoal):
 1. (\<lambda>x. c * f x) measurable_on S
[PROOF STEP]
by simp


[STATEMENT]
lemma integrable_on_cmult_left_iff [simp]:
  assumes "c \<noteq> 0"
  shows "(\<lambda>x. of_real c * f x) integrable_on s \<longleftrightarrow> f integrable_on s"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. of_real c * f x) integrable_on s) = (f integrable_on s)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. of_real c * f x) integrable_on s \<Longrightarrow> f integrable_on s
 2. f integrable_on s \<Longrightarrow> (\<lambda>x. of_real c * f x) integrable_on s
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
(\<lambda>x. of_real c * f x) integrable_on s

goal (2 subgoals):
 1. (\<lambda>x. of_real c * f x) integrable_on s \<Longrightarrow> f integrable_on s
 2. f integrable_on s \<Longrightarrow> (\<lambda>x. of_real c * f x) integrable_on s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. of_real c * f x) integrable_on s
[PROOF STEP]
have "(\<lambda>x. of_real (1 / c) * (of_real c * f x)) integrable_on s"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. of_real c * f x) integrable_on s

goal (1 subgoal):
 1. (\<lambda>x. of_real (1 / c) * (of_real c * f x)) integrable_on s
[PROOF STEP]
using integrable_cmul[of "\<lambda>x. of_real c * f x" s "1 / of_real c"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. of_real c * f x) integrable_on s
(\<lambda>x. of_real c * f x) integrable_on s \<Longrightarrow> (\<lambda>x. (1 / of_real c) *\<^sub>R (of_real c * f x)) integrable_on s

goal (1 subgoal):
 1. (\<lambda>x. of_real (1 / c) * (of_real c * f x)) integrable_on s
[PROOF STEP]
by (simp add: scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. of_real (1 / c) * (of_real c * f x)) integrable_on s

goal (2 subgoals):
 1. (\<lambda>x. of_real c * f x) integrable_on s \<Longrightarrow> f integrable_on s
 2. f integrable_on s \<Longrightarrow> (\<lambda>x. of_real c * f x) integrable_on s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. of_real (1 / c) * (of_real c * f x)) integrable_on s
[PROOF STEP]
have "(\<lambda>x. (of_real (1 / c) * of_real c * f x)) integrable_on s"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. of_real (1 / c) * (of_real c * f x)) integrable_on s

goal (1 subgoal):
 1. (\<lambda>x. of_real (1 / c) * of_real c * f x) integrable_on s
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. of_real (1 / c) * of_real c * f x) integrable_on s

goal (2 subgoals):
 1. (\<lambda>x. of_real c * f x) integrable_on s \<Longrightarrow> f integrable_on s
 2. f integrable_on s \<Longrightarrow> (\<lambda>x. of_real c * f x) integrable_on s
[PROOF STEP]
with \<open>c \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
(\<lambda>x. of_real (1 / c) * of_real c * f x) integrable_on s
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
(\<lambda>x. of_real (1 / c) * of_real c * f x) integrable_on s

goal (1 subgoal):
 1. f integrable_on s
[PROOF STEP]
by (metis (no_types, lifting) integrable_eq mult.left_neutral nonzero_divide_eq_eq of_real_1 of_real_mult)
[PROOF STATE]
proof (state)
this:
f integrable_on s

goal (1 subgoal):
 1. f integrable_on s \<Longrightarrow> (\<lambda>x. of_real c * f x) integrable_on s
[PROOF STEP]
qed (blast intro: integrable_on_cmult_left)


[STATEMENT]
lemma pt_eqvt_fun1a:
  fixes f     :: "'a\<Rightarrow>'b"
  assumes pta: "pt TYPE('a) TYPE('x)"
  and     ptb: "pt TYPE('b) TYPE('x)"
  and     at:  "at TYPE('x)"
  and     a:   "((supp f)::'x set)={}"
  shows "\<forall>(pi::'x prm). pi\<bullet>f = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>pi. pi \<bullet> f = f
[PROOF STEP]
proof (intro strip)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>pi. pi \<bullet> f = f
[PROOF STEP]
fix pi
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>pi. pi \<bullet> f = f
[PROOF STEP]
have "\<forall>a b. a\<notin>((supp f)::'x set) \<and> b\<notin>((supp f)::'x set) \<longrightarrow> (([(a,b)]\<bullet>f) = f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b. a \<notin> supp f \<and> b \<notin> supp f \<longrightarrow> [(a, b)] \<bullet> f = f
[PROOF STEP]
by (intro strip, fold fresh_def,
      simp add: pt_fresh_fresh[OF pt_fun_inst[OF pta, OF ptb, OF at],OF at])
[PROOF STATE]
proof (state)
this:
\<forall>a b. a \<notin> supp f \<and> b \<notin> supp f \<longrightarrow> [(a, b)] \<bullet> f = f

goal (1 subgoal):
 1. \<And>pi. pi \<bullet> f = f
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
supp f = {}
\<forall>a b. a \<notin> supp f \<and> b \<notin> supp f \<longrightarrow> [(a, b)] \<bullet> f = f
[PROOF STEP]
have "\<forall>(a::'x) (b::'x). ([(a,b)]\<bullet>f) = f"
[PROOF STATE]
proof (prove)
using this:
supp f = {}
\<forall>a b. a \<notin> supp f \<and> b \<notin> supp f \<longrightarrow> [(a, b)] \<bullet> f = f

goal (1 subgoal):
 1. \<forall>a b. [(a, b)] \<bullet> f = f
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>a b. [(a, b)] \<bullet> f = f

goal (1 subgoal):
 1. \<And>pi. pi \<bullet> f = f
[PROOF STEP]
hence "\<forall>(pi::'x prm). pi\<bullet>f = f"
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. [(a, b)] \<bullet> f = f

goal (1 subgoal):
 1. \<forall>pi. pi \<bullet> f = f
[PROOF STEP]
by (simp add: pt_swap_eq[OF pt_fun_inst[OF pta, OF ptb, OF at]])
[PROOF STATE]
proof (state)
this:
\<forall>pi. pi \<bullet> f = f

goal (1 subgoal):
 1. \<And>pi. pi \<bullet> f = f
[PROOF STEP]
thus "(pi::'x prm)\<bullet>f = f"
[PROOF STATE]
proof (prove)
using this:
\<forall>pi. pi \<bullet> f = f

goal (1 subgoal):
 1. pi \<bullet> f = f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pi \<bullet> f = f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_equiv_class:
  assumes "finite A"
  assumes "equiv A R"
  shows "card A = sum card (A // R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = sum card (A // R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card A = sum card (A // R)
[PROOF STEP]
have "(\<lambda>x. True) respects R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. True) respects R
[PROOF STEP]
by (simp add: congruentI)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. True) respects R

goal (1 subgoal):
 1. card A = sum card (A // R)
[PROOF STEP]
from \<open>finite A\<close> \<open>equiv A R\<close> this
[PROOF STATE]
proof (chain)
picking this:
finite A
equiv A R
(\<lambda>x. True) respects R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
equiv A R
(\<lambda>x. True) respects R

goal (1 subgoal):
 1. card A = sum card (A // R)
[PROOF STEP]
using card_equiv_class_restricted[where P="\<lambda>x. True"]
[PROOF STATE]
proof (prove)
using this:
finite A
equiv A R
(\<lambda>x. True) respects R
\<lbrakk>finite {x \<in> ?A. True}; equiv ?A ?R; (\<lambda>x. True) respects ?R\<rbrakk> \<Longrightarrow> card {x \<in> ?A. True} = sum card ({x \<in> ?A. True} // ?R)

goal (1 subgoal):
 1. card A = sum card (A // R)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card A = sum card (A // R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma even_bit_succ_iff:
  \<open>bit (1 + a) n \<longleftrightarrow> bit a n \<or> n = 0\<close> if \<open>even a\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit ((1::'a) + a) n = (bit a n \<or> n = 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
even a

goal (1 subgoal):
 1. bit ((1::'a) + a) n = (bit a n \<or> n = 0)
[PROOF STEP]
by (cases \<open>n = 0\<close>) (simp_all add: bit_iff_odd)


[STATEMENT]
lemma nth_sequence_of:
  assumes "i < card A"
  shows "(sequence_of A enum f) ! i = f (enum i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sequence_of A enum f ! i = f (enum i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < card A

goal (1 subgoal):
 1. sequence_of A enum f ! i = f (enum i)
[PROOF STEP]
unfolding sequence_of_def
[PROOF STATE]
proof (prove)
using this:
i < card A

goal (1 subgoal):
 1. map (\<lambda>n. f (enum n)) [0..<card A] ! i = f (enum i)
[PROOF STEP]
by auto


[STATEMENT]
lemma vars_clause_mono: "S \<subseteq># C \<Longrightarrow> vars_clause S \<subseteq> vars_clause C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq># C \<Longrightarrow> vars_clause S \<subseteq> vars_clause C
[PROOF STEP]
unfolding vars_clause_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq># C \<Longrightarrow> \<Union> (set_mset (image_mset vars_lit S)) \<subseteq> \<Union> (set_mset (image_mset vars_lit C))
[PROOF STEP]
by auto


[STATEMENT]
lemma deg_pm_homogenize:
  assumes "t \<in> keys (homogenize x p)"
  shows "deg_pm t = poly_deg p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
t \<in> keys (homogenize x p)
[PROOF STEP]
obtain q t' where q: "q \<in> hom_components p" and "t' \<in> keys q"
    and t: "t = Poly_Mapping.single x (poly_deg p - poly_deg q) + t'"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys (homogenize x p)

goal (1 subgoal):
 1. (\<And>q t'. \<lbrakk>q \<in> hom_components p; t' \<in> keys q; t = monomial (poly_deg p - poly_deg q) x + t'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule keys_homogenizeE_alt)
[PROOF STATE]
proof (state)
this:
q \<in> hom_components p
t' \<in> keys q
t = monomial (poly_deg p - poly_deg q) x + t'

goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
from q
[PROOF STATE]
proof (chain)
picking this:
q \<in> hom_components p
[PROOF STEP]
have "homogeneous q"
[PROOF STATE]
proof (prove)
using this:
q \<in> hom_components p

goal (1 subgoal):
 1. homogeneous q
[PROOF STEP]
by (rule hom_components_homogeneous)
[PROOF STATE]
proof (state)
this:
homogeneous q

goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
hence "deg_pm t' = poly_deg q"
[PROOF STATE]
proof (prove)
using this:
homogeneous q

goal (1 subgoal):
 1. deg_pm t' = poly_deg q
[PROOF STEP]
using \<open>t' \<in> keys q\<close>
[PROOF STATE]
proof (prove)
using this:
homogeneous q
t' \<in> keys q

goal (1 subgoal):
 1. deg_pm t' = poly_deg q
[PROOF STEP]
by (rule homogeneousD_poly_deg)
[PROOF STATE]
proof (state)
this:
deg_pm t' = poly_deg q

goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
deg_pm t' = poly_deg q

goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
from q
[PROOF STATE]
proof (chain)
picking this:
q \<in> hom_components p
[PROOF STEP]
have "poly_deg q \<le> poly_deg p"
[PROOF STATE]
proof (prove)
using this:
q \<in> hom_components p

goal (1 subgoal):
 1. poly_deg q \<le> poly_deg p
[PROOF STEP]
by (rule poly_deg_hom_components_le)
[PROOF STATE]
proof (state)
this:
poly_deg q \<le> poly_deg p

goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
deg_pm t' = poly_deg q
poly_deg q \<le> poly_deg p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deg_pm t' = poly_deg q
poly_deg q \<le> poly_deg p

goal (1 subgoal):
 1. deg_pm t = poly_deg p
[PROOF STEP]
by (simp add: t deg_pm_plus deg_pm_single)
[PROOF STATE]
proof (state)
this:
deg_pm t = poly_deg p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma greatest_less_zero_row:
  fixes A::"'a::{bezout_ring}^'cols::{mod_type}^'rows::{finite, wellorder}"
  assumes r: "echelon_form_upt_k A k"
  and zero_i: "is_zero_row_upt_k i k A"
  and not_all_zero: "\<not> (\<forall>a. is_zero_row_upt_k a k A)"
  shows "(GREATEST m. \<not> is_zero_row_upt_k m k A) < i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (GREATEST m. \<not> is_zero_row_upt_k m k A) < i
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (GREATEST m. \<not> is_zero_row_upt_k m k A) < i \<Longrightarrow> False
[PROOF STEP]
assume not_less_i: "\<not> (GREATEST m. \<not> is_zero_row_upt_k m k A) < i"
[PROOF STATE]
proof (state)
this:
\<not> (GREATEST m. \<not> is_zero_row_upt_k m k A) < i

goal (1 subgoal):
 1. \<not> (GREATEST m. \<not> is_zero_row_upt_k m k A) < i \<Longrightarrow> False
[PROOF STEP]
have i_less_greatest: "i < (GREATEST m. \<not> is_zero_row_upt_k m k A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < (GREATEST m. \<not> is_zero_row_upt_k m k A)
[PROOF STEP]
by (metis not_less_i neq_iff GreatestI not_all_zero zero_i)
[PROOF STATE]
proof (state)
this:
i < (GREATEST m. \<not> is_zero_row_upt_k m k A)

goal (1 subgoal):
 1. \<not> (GREATEST m. \<not> is_zero_row_upt_k m k A) < i \<Longrightarrow> False
[PROOF STEP]
have "is_zero_row_upt_k (GREATEST m. \<not> is_zero_row_upt_k m k A) k A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero_row_upt_k (GREATEST m. \<not> is_zero_row_upt_k m k A) k A
[PROOF STEP]
using r zero_i i_less_greatest
[PROOF STATE]
proof (prove)
using this:
echelon_form_upt_k A k
is_zero_row_upt_k i k A
i < (GREATEST m. \<not> is_zero_row_upt_k m k A)

goal (1 subgoal):
 1. is_zero_row_upt_k (GREATEST m. \<not> is_zero_row_upt_k m k A) k A
[PROOF STEP]
unfolding echelon_form_upt_k_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>i. is_zero_row_upt_k i k A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row_upt_k j k A)) \<and> (\<forall>i j. i < j \<and> \<not> is_zero_row_upt_k i k A \<and> \<not> is_zero_row_upt_k j k A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ j $ n \<noteq> (0::'a)))
is_zero_row_upt_k i k A
i < (GREATEST m. \<not> is_zero_row_upt_k m k A)

goal (1 subgoal):
 1. is_zero_row_upt_k (GREATEST m. \<not> is_zero_row_upt_k m k A) k A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_zero_row_upt_k (GREATEST m. \<not> is_zero_row_upt_k m k A) k A

goal (1 subgoal):
 1. \<not> (GREATEST m. \<not> is_zero_row_upt_k m k A) < i \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
is_zero_row_upt_k (GREATEST m. \<not> is_zero_row_upt_k m k A) k A

goal (1 subgoal):
 1. False
[PROOF STEP]
using GreatestI_ex not_all_zero
[PROOF STATE]
proof (prove)
using this:
is_zero_row_upt_k (GREATEST m. \<not> is_zero_row_upt_k m k A) k A
\<exists>x. ?P x \<Longrightarrow> ?P (Greatest ?P)
\<not> (\<forall>a. is_zero_row_upt_k a k A)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma croots2: assumes "degree p = 2"
  shows "{x. poly p x = 0} = set (croots2 p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
from degree2_coeffs[OF assms]
[PROOF STATE]
proof (chain)
picking this:
\<exists>a b c. p = [:c, b, a:] \<and> a \<noteq> 0
[PROOF STEP]
obtain a b c
  where p: "p = [:c, b, a:]" and a: "a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>a b c. p = [:c, b, a:] \<and> a \<noteq> 0

goal (1 subgoal):
 1. (\<And>c b a. \<lbrakk>p = [:c, b, a:]; a \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = [:c, b, a:]
a \<noteq> 0

goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
note main = roots2[OF p a]
[PROOF STATE]
proof (state)
this:
{x. poly p x = 0} = {- (b / (2 * a)) + e |e. e\<^sup>2 = (b / (2 * a))\<^sup>2 - c / a}

goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
have 2: "2 = Suc (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 = Suc (Suc 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 = Suc (Suc 0)

goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
have coeff: "coeff p 2 = a" "coeff p 1 = b" "coeff p 0 = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p 2 = a &&& coeff p 1 = b &&& coeff p 0 = c
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff [:c, b, a:] 2 = a &&& coeff [:c, b, a:] 1 = b &&& coeff [:c, b, a:] 0 = c
[PROOF STEP]
by (auto simp: 2)
[PROOF STATE]
proof (state)
this:
coeff p 2 = a
coeff p 1 = b
coeff p 0 = c

goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
let ?b2a = "b / (2 * a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
define b2a where "b2a = ?b2a"
[PROOF STATE]
proof (state)
this:
b2a = b / (2 * a)

goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
let ?bac = "b2a^2 - c/a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
define bac where "bac = ?bac"
[PROOF STATE]
proof (state)
this:
bac = b2a\<^sup>2 - c / a

goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
have roots: "set (croots2 p) = {- b2a + csqrt bac, - b2a - csqrt bac}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (croots2 p) = {- b2a + csqrt bac, - b2a - csqrt bac}
[PROOF STEP]
unfolding croots2_def Let_def coeff b2a_def[symmetric] bac_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (remdups [- b2a + csqrt bac, - b2a - csqrt bac]) = {- b2a + csqrt bac, - b2a - csqrt bac}
[PROOF STEP]
by (auto split: if_splits)
[PROOF STATE]
proof (state)
this:
set (croots2 p) = {- b2a + csqrt bac, - b2a - csqrt bac}

goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. poly p x = 0} = set (croots2 p)
[PROOF STEP]
unfolding roots main b2a_def[symmetric] bac_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {- b2a + e |e. e\<^sup>2 = bac} = {- b2a + csqrt bac, - b2a - csqrt bac}
[PROOF STEP]
using power2_eq_iff
[PROOF STATE]
proof (prove)
using this:
(?x\<^sup>2 = ?y\<^sup>2) = (?x = ?y \<or> ?x = - ?y)

goal (1 subgoal):
 1. {- b2a + e |e. e\<^sup>2 = bac} = {- b2a + csqrt bac, - b2a - csqrt bac}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{x. poly p x = 0} = set (croots2 p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_clinear_const_scaleR:
  fixes c :: real
  assumes \<open>bounded_clinear f\<close>
  shows \<open>bounded_clinear (\<lambda> x. c *\<^sub>R f x )\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. c *\<^sub>R f x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. c *\<^sub>R f x)
[PROOF STEP]
have  \<open>bounded_clinear (\<lambda> x. (complex_of_real c) *\<^sub>C f x )\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. complex_of_real c *\<^sub>C f x)
[PROOF STEP]
by (simp add: assms bounded_clinear_const_scaleC)
[PROOF STATE]
proof (state)
this:
bounded_clinear (\<lambda>x. complex_of_real c *\<^sub>C f x)

goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. c *\<^sub>R f x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bounded_clinear (\<lambda>x. complex_of_real c *\<^sub>C f x)

goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. c *\<^sub>R f x)
[PROOF STEP]
by (simp add: scaleR_scaleC)
[PROOF STATE]
proof (state)
this:
bounded_clinear (\<lambda>x. c *\<^sub>R f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_inj: "\<lbrakk> f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B \<rbrakk>
              \<Longrightarrow> inj_on (compose A g f) A "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B\<rbrakk> \<Longrightarrow> inj_on (compose A g f) A
[PROOF STEP]
apply (simp add:inj_on_def [of "compose A g f"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. \<forall>y\<in>A. compose A g f x = compose A g f y \<longrightarrow> x = y
[PROOF STEP]
apply (rule ballI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> compose A g f x = compose A g f y \<longrightarrow> x = y
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B; x \<in> A; y \<in> A; compose A g f x = compose A g f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (rule inj_onTr0 [of "f" "A" "B"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B; x \<in> A; y \<in> A; compose A g f x = compose A g f y\<rbrakk> \<Longrightarrow> f x = f y
[PROOF STEP]
apply (frule funcset_mem [of "f" "A" "B" _], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B; x \<in> A; y \<in> A; compose A g f x = compose A g f y; f x \<in> B\<rbrakk> \<Longrightarrow> f x = f y
[PROOF STEP]
apply (rotate_tac -3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>y \<in> A; compose A g f x = compose A g f y; f x \<in> B; f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B; x \<in> A\<rbrakk> \<Longrightarrow> f x = f y
[PROOF STEP]
apply (frule funcset_mem [of "f" "A" "B" _], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>y \<in> A; compose A g f x = compose A g f y; f x \<in> B; f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B; x \<in> A; f y \<in> B\<rbrakk> \<Longrightarrow> f x = f y
[PROOF STEP]
apply (rule inj_onTr0 [of "g" "B" "C" _], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>y \<in> A; compose A g f x = compose A g f y; f x \<in> B; f \<in> A \<rightarrow> B; inj_on f A; g \<in> B \<rightarrow> C; inj_on g B; x \<in> A; f y \<in> B\<rbrakk> \<Longrightarrow> g (f x) = g (f y)
[PROOF STEP]
apply (simp add:compose_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rtrancl_is_path:
  assumes "(u,v)\<in>E\<^sup>*"
  obtains l where "path E u l v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l. path E u l v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> E\<^sup>*

goal (1 subgoal):
 1. (\<And>l. path E u l v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by induct (auto intro: path0 path_append)


[STATEMENT]
lemma rtrancl_to_subtuple:
  "(subtuple r)\<^sup>*\<^sup>* xm ym \<Longrightarrow>
   subtuple r\<^sup>*\<^sup>* xm ym"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subtuple r)\<^sup>*\<^sup>* xm ym \<Longrightarrow> subtuple r\<^sup>*\<^sup>* xm ym
[PROOF STEP]
apply (induct rule: rtranclp_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. subtuple r\<^sup>*\<^sup>* xm xm
 2. \<And>y z. \<lbrakk>(subtuple r)\<^sup>*\<^sup>* xm y; subtuple r y z; subtuple r\<^sup>*\<^sup>* xm y\<rbrakk> \<Longrightarrow> subtuple r\<^sup>*\<^sup>* xm z
[PROOF STEP]
apply (simp add: fmap.rel_refl_strong fmrel_to_subtuple)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(subtuple r)\<^sup>*\<^sup>* xm y; subtuple r y z; subtuple r\<^sup>*\<^sup>* xm y\<rbrakk> \<Longrightarrow> subtuple r\<^sup>*\<^sup>* xm z
[PROOF STEP]
by (rule fmrel_on_fset_trans; auto)


[STATEMENT]
lemma stream_update_snth: "(stream_update xs n a) !! n = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stream_update xs n a !! n = a
[PROOF STEP]
proof (induction n arbitrary: xs a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs a. stream_update xs 0 a !! 0 = a
 2. \<And>n xs a. (\<And>xs a. stream_update xs n a !! n = a) \<Longrightarrow> stream_update xs (Suc n) a !! Suc n = a
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs a. stream_update xs 0 a !! 0 = a
 2. \<And>n xs a. (\<And>xs a. stream_update xs n a !! n = a) \<Longrightarrow> stream_update xs (Suc n) a !! Suc n = a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stream_update xs 0 a !! 0 = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
stream_update xs 0 a !! 0 = a

goal (1 subgoal):
 1. \<And>n xs a. (\<And>xs a. stream_update xs n a !! n = a) \<Longrightarrow> stream_update xs (Suc n) a !! Suc n = a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n xs a. (\<And>xs a. stream_update xs n a !! n = a) \<Longrightarrow> stream_update xs (Suc n) a !! Suc n = a
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
stream_update ?xs n ?a !! n = ?a

goal (1 subgoal):
 1. \<And>n xs a. (\<And>xs a. stream_update xs n a !! n = a) \<Longrightarrow> stream_update xs (Suc n) a !! Suc n = a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
stream_update ?xs n ?a !! n = ?a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
stream_update ?xs n ?a !! n = ?a

goal (1 subgoal):
 1. stream_update xs (Suc n) a !! Suc n = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
stream_update xs (Suc n) a !! Suc n = a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_poly_degree_leq[simp]:
  shows "degree (map_poly f p) \<le> degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly f p) \<le> degree p
[PROOF STEP]
unfolding map_poly_def degree_eq_length_coeffs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (coeffs (Poly (map f (coeffs p)))) - 1 \<le> length (coeffs p) - 1
[PROOF STEP]
by (metis coeffs_Poly diff_le_mono length_map length_strip_while_le)


[STATEMENT]
lemma dlex_pm_antisym: "dlex_pm s t \<Longrightarrow> dlex_pm t s \<Longrightarrow> s = t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dlex_pm s t; dlex_pm t s\<rbrakk> \<Longrightarrow> s = t
[PROOF STEP]
unfolding dlex_pm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dord_pm lex_pm s t; dord_pm lex_pm t s\<rbrakk> \<Longrightarrow> s = t
[PROOF STEP]
using lex_pm_antisym
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>lex_pm ?s ?t; lex_pm ?t ?s\<rbrakk> \<Longrightarrow> ?s = ?t

goal (1 subgoal):
 1. \<lbrakk>dord_pm lex_pm s t; dord_pm lex_pm t s\<rbrakk> \<Longrightarrow> s = t
[PROOF STEP]
by (rule dord_pm_antisym)


[STATEMENT]
lemma tendsto_rabs [tendsto_intros]: "(f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar>) \<longlongrightarrow> \<bar>l\<bar>) F"
  for l :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar>) \<longlongrightarrow> \<bar>l\<bar>) F
[PROOF STEP]
by (fold real_norm_def) (rule tendsto_norm)


[STATEMENT]
lemma add_diff_eq_vec: fixes y :: "'a :: group_add vec"
  shows "y \<in> carrier_vec n \<Longrightarrow> x \<in> carrier_vec n \<Longrightarrow> z \<in> carrier_vec n \<Longrightarrow> y + (x - z) = y + x - z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> carrier_vec n; x \<in> carrier_vec n; z \<in> carrier_vec n\<rbrakk> \<Longrightarrow> y + (x - z) = y + x - z
[PROOF STEP]
by (intro eq_vecI, auto simp: add_diff_eq)


[STATEMENT]
lemma r01_r01_to_r01_image':
  assumes "0 < r2" "r2 < 1"
    shows "r01_r01_to_r01 (r1,r2) \<in> {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
obtain i where "r01_binary_expansion' r2 i = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. r01_binary_expansion' r2 i = 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using r01_binary_expression_ex1[of r2] assms(1,2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < r2; r2 < 1\<rbrakk> \<Longrightarrow> \<exists>i. r01_binary_expansion' r2 i = 1
0 < r2
r2 < 1

goal (1 subgoal):
 1. (\<And>i. r01_binary_expansion' r2 i = 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r01_binary_expansion' r2 i = 1

goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
hence hi:"r01_r01_to_r01' (r1,r2) (2*i + 1) = 1"
[PROOF STATE]
proof (prove)
using this:
r01_binary_expansion' r2 i = 1

goal (1 subgoal):
 1. r01_r01_to_r01' (r1, r2) (2 * i + 1) = 1
[PROOF STEP]
by(simp add: r01_r01_to_r01'_def)
[PROOF STATE]
proof (state)
this:
r01_r01_to_r01' (r1, r2) (2 * i + 1) = 1

goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
obtain j where "r01_binary_expansion' r2 j = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j. r01_binary_expansion' r2 j = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using r01_binary_expression_ex0[of r2] assms(1,2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < r2; r2 < 1\<rbrakk> \<Longrightarrow> \<exists>i. r01_binary_expansion' r2 i = 0
0 < r2
r2 < 1

goal (1 subgoal):
 1. (\<And>j. r01_binary_expansion' r2 j = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r01_binary_expansion' r2 j = 0

goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
hence hj:"r01_r01_to_r01' (r1,r2) (2*j + 1) = 0"
[PROOF STATE]
proof (prove)
using this:
r01_binary_expansion' r2 j = 0

goal (1 subgoal):
 1. r01_r01_to_r01' (r1, r2) (2 * j + 1) = 0
[PROOF STEP]
by(simp add: r01_r01_to_r01'_def)
[PROOF STATE]
proof (state)
this:
r01_r01_to_r01' (r1, r2) (2 * j + 1) = 0

goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
using ai_exists1_gt0[of "r01_r01_to_r01' (r1,r2)"] ai_exists0_less_than1[of "r01_r01_to_r01' (r1,r2)"] r01_r01_to_r01'in01[of "(r1,r2)"] r01_r01_to_r01_def'[of r1 r2] hi hj
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>n. r01_r01_to_r01' (r1, r2) n \<in> {0, 1}; \<exists>i. r01_r01_to_r01' (r1, r2) i = 1\<rbrakk> \<Longrightarrow> 0 < (\<Sum>n. real (r01_r01_to_r01' (r1, r2) n) * (1 / 2) ^ Suc n)
\<lbrakk>\<And>n. r01_r01_to_r01' (r1, r2) n \<in> {0, 1}; \<exists>i. r01_r01_to_r01' (r1, r2) i = 0\<rbrakk> \<Longrightarrow> (\<Sum>n. real (r01_r01_to_r01' (r1, r2) n) * (1 / 2) ^ Suc n) < 1
r01_r01_to_r01' (r1, r2) ?n \<in> {0, 1}
r01_r01_to_r01 (r1, r2) = (\<Sum>n. real (r01_r01_to_r01' (r1, r2) n) * (1 / 2) ^ (n + 1))
r01_r01_to_r01' (r1, r2) (2 * i + 1) = 1
r01_r01_to_r01' (r1, r2) (2 * j + 1) = 0

goal (1 subgoal):
 1. r01_r01_to_r01 (r1, r2) \<in> {0<..<1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r01_r01_to_r01 (r1, r2) \<in> {0<..<1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma factor_mset_sim:
  assumes "a \<in> carrier G" "b \<in> carrier G"
  shows "a \<sim> b \<longleftrightarrow> factor_mset G a = factor_mset G b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sim> b = (factor_mset G a = factor_mset G b)
[PROOF STEP]
using factor_mset_divides assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier G; ?b \<in> carrier G\<rbrakk> \<Longrightarrow> ?a divides ?b = (factor_mset G ?a \<subseteq># factor_mset G ?b)
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. a \<sim> b = (factor_mset G a = factor_mset G b)
[PROOF STEP]
by (simp add:associated_def) auto


[STATEMENT]
lemma set_nths': "set (nths' i j xs) = {x. \<exists>k. i \<le> k \<and> k < j \<and> k < List.length xs \<and> x = xs ! k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (nths' i j xs) = {x. \<exists>k\<ge>i. k < j \<and> k < length xs \<and> x = xs ! k}
[PROOF STEP]
apply (simp add: nths'_nths)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (nths xs {ja. i \<le> ja \<and> ja < j}) = {x. \<exists>k\<ge>i. k < j \<and> k < length xs \<and> x = xs ! k}
[PROOF STEP]
apply (simp add: set_nths)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs ! ia |ia. ia < length xs \<and> i \<le> ia \<and> ia < j} = {x. \<exists>k\<ge>i. k < j \<and> k < length xs \<and> x = xs ! k}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iso_vertex_empty_neighborhood: "is_isolated_vertex v \<Longrightarrow> neighborhood v = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> neighborhood v = {}
[PROOF STEP]
using is_isolated_vertex_def neighborhood_def
[PROOF STATE]
proof (prove)
using this:
is_isolated_vertex ?v \<equiv> ?v \<in> V \<and> (\<forall>u\<in>V. \<not> vert_adj u ?v)
neighborhood ?x \<equiv> {v \<in> V. vert_adj ?x v}

goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> neighborhood v = {}
[PROOF STEP]
by (metis (mono_tags, lifting) Collect_empty_eq is_isolated_vertex_edge vert_adj_inc_edge_iff)


[STATEMENT]
lemma supp_sum_subset_union_supp :
  fixes     f g :: "'a \<Rightarrow> 'b::monoid_add"
  shows     "supp (f + g) \<subseteq> supp f \<union> supp g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (f + g) \<subseteq> supp f \<union> supp g
[PROOF STEP]
unfolding supp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. (f + g) x \<noteq> (0::'b)} \<subseteq> {x. f x \<noteq> (0::'b)} \<union> {x. g x \<noteq> (0::'b)}
[PROOF STEP]
by        auto


[STATEMENT]
lemma padic_a_inv_simp':
  assumes "prime p"
  assumes "f \<in> padic_set p"
  assumes "n >0"
  shows "padic_a_inv p f n = (if n=0 then 0 else (- (f n)) mod (p^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_a_inv p f n = (if n = 0 then 0 else - f n mod p ^ n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padic_a_inv p f n = (if n = 0 then 0 else - f n mod p ^ n)
[PROOF STEP]
have "residues (p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residues (p ^ n)
[PROOF STEP]
by (simp add: assms(1) assms(3) prime_gt_1_int residues.intro)
[PROOF STATE]
proof (state)
this:
residues (p ^ n)

goal (1 subgoal):
 1. padic_a_inv p f n = (if n = 0 then 0 else - f n mod p ^ n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
residues (p ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
residues (p ^ n)

goal (1 subgoal):
 1. padic_a_inv p f n = (if n = 0 then 0 else - f n mod p ^ n)
[PROOF STEP]
using residue_ring_def padic_a_inv_def residues.res_neg_eq
[PROOF STATE]
proof (prove)
using this:
residues (p ^ n)
residue_ring ?m = \<lparr>carrier = {0..?m - 1}, monoid.mult = \<lambda>x y. x * y mod ?m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod ?m\<rparr>
padic_a_inv ?p ?f \<equiv> \<lambda>n. \<ominus>\<^bsub>residue_ring (?p ^ n)\<^esub> ?f n
residues ?m \<Longrightarrow> \<ominus>\<^bsub>residue_ring ?m\<^esub> ?x = - ?x mod ?m

goal (1 subgoal):
 1. padic_a_inv p f n = (if n = 0 then 0 else - f n mod p ^ n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
padic_a_inv p f n = (if n = 0 then 0 else - f n mod p ^ n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutes_add_one:
  assumes "p permutes S" "x \<notin> S" "y \<in> S"
  shows "p(x := y, inv p y := x) permutes (insert x S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p(x := y, inv p y := x) permutes insert x S
[PROOF STEP]
proof (rule bij_imp_permutes')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bij (p(x := y, inv p y := x))
 2. \<forall>xa. xa \<notin> insert x S \<longrightarrow> (p(x := y, inv p y := x)) xa = xa
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p permutes S
x \<notin> S
y \<in> S
[PROOF STEP]
show "bij (p(x := y, inv p y := x))"
[PROOF STATE]
proof (prove)
using this:
p permutes S
x \<notin> S
y \<in> S

goal (1 subgoal):
 1. bij (p(x := y, inv p y := x))
[PROOF STEP]
by (meson bij_extends permutes_def permutes_imp_bij')
[PROOF STATE]
proof (state)
this:
bij (p(x := y, inv p y := x))

goal (1 subgoal):
 1. \<forall>xa. xa \<notin> insert x S \<longrightarrow> (p(x := y, inv p y := x)) xa = xa
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p permutes S
x \<notin> S
y \<in> S
[PROOF STEP]
show "\<forall>z. z \<notin> insert x S \<longrightarrow> (p(x := y, inv p y := x)) z = z"
[PROOF STATE]
proof (prove)
using this:
p permutes S
x \<notin> S
y \<in> S

goal (1 subgoal):
 1. \<forall>z. z \<notin> insert x S \<longrightarrow> (p(x := y, inv p y := x)) z = z
[PROOF STEP]
by (metis fun_upd_apply insertCI permutes_def permutes_inverses(1))
[PROOF STATE]
proof (state)
this:
\<forall>z. z \<notin> insert x S \<longrightarrow> (p(x := y, inv p y := x)) z = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LowLink_lessI:
    assumes "y \<in> lowlink_set s v"
    and "\<delta> s y < \<delta> s v"
    shows "LowLink s v < \<delta> s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
let ?L = "\<delta> s ` lowlink_set s v"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
y \<in> lowlink_set s v
\<delta> s y < \<delta> s v
[PROOF STEP]
have "\<delta> s y \<in> ?L"
[PROOF STATE]
proof (prove)
using this:
y \<in> lowlink_set s v
\<delta> s y < \<delta> s v

goal (1 subgoal):
 1. \<delta> s y \<in> \<delta> s ` lowlink_set s v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<delta> s y \<in> \<delta> s ` lowlink_set s v

goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<delta> s y \<in> \<delta> s ` lowlink_set s v

goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
hence "?L \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<delta> s y \<in> \<delta> s ` lowlink_set s v

goal (1 subgoal):
 1. \<delta> s ` lowlink_set s v \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<delta> s ` lowlink_set s v \<noteq> {}

goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<delta> s ` lowlink_set s v \<noteq> {}

goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
from lowlink_set_finite
[PROOF STATE]
proof (chain)
picking this:
finite (lowlink_set s ?v)
[PROOF STEP]
have "finite ?L"
[PROOF STATE]
proof (prove)
using this:
finite (lowlink_set s ?v)

goal (1 subgoal):
 1. finite (\<delta> s ` lowlink_set s v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (\<delta> s ` lowlink_set s v)

goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<delta> s y \<in> \<delta> s ` lowlink_set s v
\<delta> s ` lowlink_set s v \<noteq> {}
finite (\<delta> s ` lowlink_set s v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<delta> s y \<in> \<delta> s ` lowlink_set s v
\<delta> s ` lowlink_set s v \<noteq> {}
finite (\<delta> s ` lowlink_set s v)

goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) < \<delta> s v
[PROOF STEP]
by (metis Min_less_iff assms(2))
[PROOF STATE]
proof (state)
this:
Min (\<delta> s ` lowlink_set s v) < \<delta> s v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma frac_add_le_preservation:
  fixes a d :: real and b :: nat
  assumes "a < b" "d < 1 - frac a"
  shows "a + d < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a < real b
d < 1 - frac a
[PROOF STEP]
have "a + d < a + 1 - frac a"
[PROOF STATE]
proof (prove)
using this:
a < real b
d < 1 - frac a

goal (1 subgoal):
 1. a + d < a + 1 - frac a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a + d < a + 1 - frac a

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a + d < a + 1 - frac a

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
have "\<dots> = (a - frac a) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + 1 - frac a = a - frac a + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a + 1 - frac a = a - frac a + 1

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a + 1 - frac a = a - frac a + 1

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
have "\<dots> = floor a + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - frac a + 1 = real_of_int (\<lfloor>a\<rfloor> + 1)
[PROOF STEP]
unfolding frac_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - (a - real_of_int \<lfloor>a\<rfloor>) + 1 = real_of_int (\<lfloor>a\<rfloor> + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a - frac a + 1 = real_of_int (\<lfloor>a\<rfloor> + 1)

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a - frac a + 1 = real_of_int (\<lfloor>a\<rfloor> + 1)

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
have "\<dots> \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (\<lfloor>a\<rfloor> + 1) \<le> real b
[PROOF STEP]
using \<open>a < b\<close>
[PROOF STATE]
proof (prove)
using this:
a < real b

goal (1 subgoal):
 1. real_of_int (\<lfloor>a\<rfloor> + 1) \<le> real b
[PROOF STEP]
by (metis floor_less_iff int_less_real_le of_int_1 of_int_add of_int_of_nat_eq)
[PROOF STATE]
proof (state)
this:
real_of_int (\<lfloor>a\<rfloor> + 1) \<le> real b

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a + d < real b
[PROOF STEP]
show "a + d < b"
[PROOF STATE]
proof (prove)
using this:
a + d < real b

goal (1 subgoal):
 1. a + d < real b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a + d < real b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma alternating_list_append:
  "even m \<Longrightarrow>
    alternating_list m s t @ alternating_list n s t = alternating_list (m+n) s t"
  "odd m \<Longrightarrow>
    alternating_list m s t @ alternating_list n t s = alternating_list (m+n) s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (even m \<Longrightarrow> alternating_list m s t @ alternating_list n s t = alternating_list (m + n) s t) &&& (odd m \<Longrightarrow> alternating_list m s t @ alternating_list n t s = alternating_list (m + n) s t)
[PROOF STEP]
using alternating_list_split[THEN sym, of m]
[PROOF STATE]
proof (prove)
using this:
alternating_list m ?s1 ?t1 @ (if even m then alternating_list ?n1 ?s1 ?t1 else alternating_list ?n1 ?t1 ?s1) = alternating_list (m + ?n1) ?s1 ?t1

goal (1 subgoal):
 1. (even m \<Longrightarrow> alternating_list m s t @ alternating_list n s t = alternating_list (m + n) s t) &&& (odd m \<Longrightarrow> alternating_list m s t @ alternating_list n t s = alternating_list (m + n) s t)
[PROOF STEP]
by auto


[STATEMENT]
lemma set_borel_measurable_sets:
  fixes f :: "_ \<Rightarrow> _::real_normed_vector"
  assumes "set_borel_measurable M X f" "B \<in> sets borel" "X \<in> sets M"
  shows "f -` B \<inter> X \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` B \<inter> X \<in> sets M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f -` B \<inter> X \<in> sets M
[PROOF STEP]
have "f \<in> borel_measurable (restrict_space M X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable (restrict_space M X)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set_borel_measurable M X f
B \<in> sets borel
X \<in> sets M

goal (1 subgoal):
 1. f \<in> borel_measurable (restrict_space M X)
[PROOF STEP]
unfolding set_borel_measurable_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. indicat_real X x *\<^sub>R f x) \<in> borel_measurable M
B \<in> sets borel
X \<in> sets M

goal (1 subgoal):
 1. f \<in> borel_measurable (restrict_space M X)
[PROOF STEP]
by (subst borel_measurable_restrict_space_iff) auto
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (restrict_space M X)

goal (1 subgoal):
 1. f -` B \<inter> X \<in> sets M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> borel_measurable (restrict_space M X)
[PROOF STEP]
have "f -` B \<inter> space (restrict_space M X) \<in> sets (restrict_space M X)"
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (restrict_space M X)

goal (1 subgoal):
 1. f -` B \<inter> space (restrict_space M X) \<in> sets (restrict_space M X)
[PROOF STEP]
by (rule measurable_sets) fact
[PROOF STATE]
proof (state)
this:
f -` B \<inter> space (restrict_space M X) \<in> sets (restrict_space M X)

goal (1 subgoal):
 1. f -` B \<inter> X \<in> sets M
[PROOF STEP]
with \<open>X \<in> sets M\<close>
[PROOF STATE]
proof (chain)
picking this:
X \<in> sets M
f -` B \<inter> space (restrict_space M X) \<in> sets (restrict_space M X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<in> sets M
f -` B \<inter> space (restrict_space M X) \<in> sets (restrict_space M X)

goal (1 subgoal):
 1. f -` B \<inter> X \<in> sets M
[PROOF STEP]
by (subst (asm) sets_restrict_space_iff) (auto simp: space_restrict_space)
[PROOF STATE]
proof (state)
this:
f -` B \<inter> X \<in> sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjoint_Un:
  assumes "disjoint_family_on A (insert x F)"
  and "x\<notin> F"
shows "(A x) \<inter> (\<Union> a\<in> F. A a) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
have "(A x) \<inter> (\<Union> a\<in> F. A a) = (\<Union>i\<in>F. (A x) \<inter> A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = (\<Union>i\<in>F. A x \<inter> A i)
[PROOF STEP]
using Int_UN_distrib
[PROOF STATE]
proof (prove)
using this:
?B \<inter> \<Union> (?A ` ?I) = (\<Union>i\<in>?I. ?B \<inter> ?A i)

goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = (\<Union>i\<in>F. A x \<inter> A i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A x \<inter> \<Union> (A ` F) = (\<Union>i\<in>F. A x \<inter> A i)

goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A x \<inter> \<Union> (A ` F) = (\<Union>i\<in>F. A x \<inter> A i)

goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
have "... = (\<Union>i\<in>F. {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i\<in>F. A x \<inter> A i) = (\<Union>i\<in>F. {})
[PROOF STEP]
using assms disjoint_family_onD
[PROOF STATE]
proof (prove)
using this:
disjoint_family_on A (insert x F)
x \<notin> F
\<lbrakk>disjoint_family_on ?A ?I; ?i \<in> ?I; ?j \<in> ?I; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> ?A ?i \<inter> ?A ?j = {}

goal (1 subgoal):
 1. (\<Union>i\<in>F. A x \<inter> A i) = (\<Union>i\<in>F. {})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<Union>i\<in>F. A x \<inter> A i) = (\<Union>i\<in>F. {})

goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>i\<in>F. A x \<inter> A i) = (\<Union>i\<in>F. {})

goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
have "... = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i\<in>F. {}) = {}
[PROOF STEP]
using SUP_bot_conv(2)
[PROOF STATE]
proof (prove)
using this:
(\<bottom> = \<Squnion> (?B ` ?A)) = (\<forall>x\<in>?A. ?B x = \<bottom>)

goal (1 subgoal):
 1. (\<Union>i\<in>F. {}) = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Union>i\<in>F. {}) = {}

goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A x \<inter> \<Union> (A ` F) = {}

goal (1 subgoal):
 1. A x \<inter> \<Union> (A ` F) = {}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A x \<inter> \<Union> (A ` F) = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutation_inverse_compose:
  assumes p: "permutation p"
    and q: "permutation q"
  shows "inv (p \<circ> q) = inv q \<circ> inv p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
note ps = permutation_inverse_works[OF p]
[PROOF STATE]
proof (state)
this:
inv p \<circ> p = id
p \<circ> inv p = id

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
note qs = permutation_inverse_works[OF q]
[PROOF STATE]
proof (state)
this:
inv q \<circ> q = id
q \<circ> inv q = id

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
have "p \<circ> q \<circ> (inv q \<circ> inv p) = p \<circ> (q \<circ> inv q) \<circ> inv p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<circ> q \<circ> (inv q \<circ> inv p) = p \<circ> (q \<circ> inv q) \<circ> inv p
[PROOF STEP]
by (simp add: o_assoc)
[PROOF STATE]
proof (state)
this:
p \<circ> q \<circ> (inv q \<circ> inv p) = p \<circ> (q \<circ> inv q) \<circ> inv p

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p \<circ> q \<circ> (inv q \<circ> inv p) = p \<circ> (q \<circ> inv q) \<circ> inv p

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
have "\<dots> = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<circ> (q \<circ> inv q) \<circ> inv p = id
[PROOF STEP]
by (simp add: ps qs)
[PROOF STATE]
proof (state)
this:
p \<circ> (q \<circ> inv q) \<circ> inv p = id

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p \<circ> q \<circ> (inv q \<circ> inv p) = id
[PROOF STEP]
have *: "p \<circ> q \<circ> (inv q \<circ> inv p) = id"
[PROOF STATE]
proof (prove)
using this:
p \<circ> q \<circ> (inv q \<circ> inv p) = id

goal (1 subgoal):
 1. p \<circ> q \<circ> (inv q \<circ> inv p) = id
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p \<circ> q \<circ> (inv q \<circ> inv p) = id

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
have "inv q \<circ> inv p \<circ> (p \<circ> q) = inv q \<circ> (inv p \<circ> p) \<circ> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv q \<circ> inv p \<circ> (p \<circ> q) = inv q \<circ> (inv p \<circ> p) \<circ> q
[PROOF STEP]
by (simp add: o_assoc)
[PROOF STATE]
proof (state)
this:
inv q \<circ> inv p \<circ> (p \<circ> q) = inv q \<circ> (inv p \<circ> p) \<circ> q

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv q \<circ> inv p \<circ> (p \<circ> q) = inv q \<circ> (inv p \<circ> p) \<circ> q

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
have "\<dots> = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv q \<circ> (inv p \<circ> p) \<circ> q = id
[PROOF STEP]
by (simp add: ps qs)
[PROOF STATE]
proof (state)
this:
inv q \<circ> (inv p \<circ> p) \<circ> q = id

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inv q \<circ> inv p \<circ> (p \<circ> q) = id
[PROOF STEP]
have **: "inv q \<circ> inv p \<circ> (p \<circ> q) = id"
[PROOF STATE]
proof (prove)
using this:
inv q \<circ> inv p \<circ> (p \<circ> q) = id

goal (1 subgoal):
 1. inv q \<circ> inv p \<circ> (p \<circ> q) = id
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inv q \<circ> inv p \<circ> (p \<circ> q) = id

goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (p \<circ> q) = inv q \<circ> inv p
[PROOF STEP]
by (rule inv_unique_comp[OF * **])
[PROOF STATE]
proof (state)
this:
inv (p \<circ> q) = inv q \<circ> inv p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_one_over_log_squared_bound:
  assumes x: "x \<ge> 4"
  shows   "integral {2..x} (\<lambda>t. 1 / ln t ^ 2) \<le> sqrt x / ln 2 ^ 2 + 4 * x / ln x ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
4 \<le> x
[PROOF STEP]
have "x * 1 \<le> x ^ 2"
[PROOF STATE]
proof (prove)
using this:
4 \<le> x

goal (1 subgoal):
 1. x * 1 \<le> x\<^sup>2
[PROOF STEP]
unfolding power2_eq_square
[PROOF STATE]
proof (prove)
using this:
4 \<le> x

goal (1 subgoal):
 1. x * 1 \<le> x * x
[PROOF STEP]
by (intro mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
x * 1 \<le> x\<^sup>2

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
4 \<le> x
x * 1 \<le> x\<^sup>2
[PROOF STEP]
have x': "2 \<le> sqrt x" "sqrt x \<le> x"
[PROOF STATE]
proof (prove)
using this:
4 \<le> x
x * 1 \<le> x\<^sup>2

goal (1 subgoal):
 1. 2 \<le> sqrt x &&& sqrt x \<le> x
[PROOF STEP]
by (auto simp: real_sqrt_le_iff' intro!: real_le_rsqrt)
[PROOF STATE]
proof (state)
this:
2 \<le> sqrt x
sqrt x \<le> x

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
have "integral {2..x} (\<lambda>t. 1 / ln t ^ 2) =
          integral {2..sqrt x} (\<lambda>t. 1 / ln t ^ 2) + integral {sqrt x..x} (\<lambda>t. 1 / ln t ^ 2)"
    (is "_ = ?I1 + ?I2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) = integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2)
[PROOF STEP]
using x x'
[PROOF STATE]
proof (prove)
using this:
4 \<le> x
2 \<le> sqrt x
sqrt x \<le> x

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) = integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2)
[PROOF STEP]
by (intro Henstock_Kurzweil_Integration.integral_combine [symmetric] integrable_continuous_real)
       (auto intro!: continuous_intros)
[PROOF STATE]
proof (state)
this:
integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) = integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2)

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) = integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2)

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
have "?I1 \<le> integral {2..sqrt x} (\<lambda>_. 1 / ln 2 ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
4 \<le> x

goal (1 subgoal):
 1. integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2)
[PROOF STEP]
by (intro integral_le integrable_continuous_real divide_left_mono
              power_mono continuous_intros) auto
[PROOF STATE]
proof (state)
this:
integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2)

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {2..sqrt x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2)

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
have "\<dots> \<le> sqrt x / ln 2 ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2
[PROOF STEP]
using x'
[PROOF STATE]
proof (prove)
using this:
2 \<le> sqrt x
sqrt x \<le> x

goal (1 subgoal):
 1. integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {2..sqrt x} (\<lambda>_. 1 / (ln 2)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
have "?I2 \<le> integral {sqrt x..x} (\<lambda>t. 1 / ln (sqrt x) ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {sqrt x..x} (\<lambda>t. 1 / (ln (sqrt x))\<^sup>2)
[PROOF STEP]
using x'
[PROOF STATE]
proof (prove)
using this:
2 \<le> sqrt x
sqrt x \<le> x

goal (1 subgoal):
 1. integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {sqrt x..x} (\<lambda>t. 1 / (ln (sqrt x))\<^sup>2)
[PROOF STEP]
by (intro integral_le integrable_continuous_real divide_left_mono
              power_mono continuous_intros) auto
[PROOF STATE]
proof (state)
this:
integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {sqrt x..x} (\<lambda>t. 1 / (ln (sqrt x))\<^sup>2)

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> integral {sqrt x..x} (\<lambda>t. 1 / (ln (sqrt x))\<^sup>2)

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
have "\<dots> \<le> 4 * x / ln x ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {sqrt x..x} (\<lambda>t. 1 / (ln (sqrt x))\<^sup>2) \<le> 4 * x / (ln x)\<^sup>2
[PROOF STEP]
using x'
[PROOF STATE]
proof (prove)
using this:
2 \<le> sqrt x
sqrt x \<le> x

goal (1 subgoal):
 1. integral {sqrt x..x} (\<lambda>t. 1 / (ln (sqrt x))\<^sup>2) \<le> 4 * x / (ln x)\<^sup>2
[PROOF STEP]
by (simp add: ln_sqrt field_simps)
[PROOF STATE]
proof (state)
this:
integral {sqrt x..x} (\<lambda>t. 1 / (ln (sqrt x))\<^sup>2) \<le> 4 * x / (ln x)\<^sup>2

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>xa y. xa \<le> y \<Longrightarrow> xa + integral {sqrt x..x} (\<lambda>uu_. 1 / (ln uu_)\<^sup>2) \<le> y + integral {sqrt x..x} (\<lambda>uu_. 1 / (ln uu_)\<^sup>2); \<And>xa y. xa \<le> y \<Longrightarrow> xa + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> y + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2); \<And>xa y. xa \<le> y \<Longrightarrow> sqrt x / (ln 2)\<^sup>2 + xa \<le> sqrt x / (ln 2)\<^sup>2 + y; \<And>xa y. xa \<le> y \<Longrightarrow> sqrt x / (ln 2)\<^sup>2 + xa \<le> sqrt x / (ln 2)\<^sup>2 + y\<rbrakk> \<Longrightarrow> integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>xa y. xa \<le> y \<Longrightarrow> xa + integral {sqrt x..x} (\<lambda>uu_. 1 / (ln uu_)\<^sup>2) \<le> y + integral {sqrt x..x} (\<lambda>uu_. 1 / (ln uu_)\<^sup>2); \<And>xa y. xa \<le> y \<Longrightarrow> xa + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> y + integral {sqrt x..x} (\<lambda>t. 1 / (ln t)\<^sup>2); \<And>xa y. xa \<le> y \<Longrightarrow> sqrt x / (ln 2)\<^sup>2 + xa \<le> sqrt x / (ln 2)\<^sup>2 + y; \<And>xa y. xa \<le> y \<Longrightarrow> sqrt x / (ln 2)\<^sup>2 + xa \<le> sqrt x / (ln 2)\<^sup>2 + y\<rbrakk> \<Longrightarrow> integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2

goal (1 subgoal):
 1. integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral {2..x} (\<lambda>t. 1 / (ln t)\<^sup>2) \<le> sqrt x / (ln 2)\<^sup>2 + 4 * x / (ln x)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ack_2 [simp]: "ack (Suc (Suc 0)) j = 2 * j + 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ack (Suc (Suc 0)) j = 2 * j + 3
[PROOF STEP]
by (induct j) simp_all


[STATEMENT]
lemma (in Ring) module_over_zeroring:"\<lbrakk>zeroring R; R module M\<rbrakk> \<Longrightarrow>
                    carrier M = {\<zero>\<^bsub>M\<^esub>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>zeroring R; R module M\<rbrakk> \<Longrightarrow> carrier M = {\<zero>\<^bsub>M\<^esub>}
[PROOF STEP]
apply (simp add:zeroring_def, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}\<rbrakk> \<Longrightarrow> carrier M = {\<zero>\<^bsub>M\<^esub>}
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}\<rbrakk> \<Longrightarrow> carrier M \<subseteq> {\<zero>\<^bsub>M\<^esub>}
 2. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>M\<^esub>} \<subseteq> carrier M
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}; x \<in> carrier M\<rbrakk> \<Longrightarrow> x \<in> {\<zero>\<^bsub>M\<^esub>}
 2. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>M\<^esub>} \<subseteq> carrier M
[PROOF STEP]
apply (frule_tac m = x in Module.sprod_one [of M R], assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}; x \<in> carrier M; 1\<^sub>r \<cdot>\<^sub>s\<^bsub>M\<^esub> x = x\<rbrakk> \<Longrightarrow> x \<in> {\<zero>\<^bsub>M\<^esub>}
 2. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>M\<^esub>} \<subseteq> carrier M
[PROOF STEP]
apply (cut_tac ring_one, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}; x \<in> carrier M; \<zero> \<cdot>\<^sub>s\<^bsub>M\<^esub> x = x; 1\<^sub>r = \<zero>\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>M\<^esub>
 2. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>M\<^esub>} \<subseteq> carrier M
[PROOF STEP]
apply (simp add:Module.sc_0_m[of M R])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>M\<^esub>} \<subseteq> carrier M
[PROOF STEP]
apply (frule Module.module_is_ag [of M R])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; Ring R; carrier R = {\<zero>}; aGroup M\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>M\<^esub>} \<subseteq> carrier M
[PROOF STEP]
apply (simp add:aGroup.ag_inc_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Y_ide_arr [simp]:
    assumes a: "C.ide a" and "\<guillemotleft>g : b' \<rightarrow> b\<guillemotright>"
    shows "\<guillemotleft>Y a g : Hom.map (b, a) \<rightarrow>\<^sub>S Hom.map (b', a)\<guillemotright>"
    and "Y a g =
         S.mkArr (Hom.set (b, a)) (Hom.set (b', a)) (\<phi> (b', a) o Cop.comp g o \<psi> (b, a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>Y a g : Hom.map (b, a) \<rightarrow>\<^sub>S Hom.map (b', a)\<guillemotright> &&& Y a g = S.mkArr (Hom.set (b, a)) (Hom.set (b', a)) (\<phi> (b', a) \<circ> (\<cdot>\<^sup>o\<^sup>p) g \<circ> \<psi> (b, a))
[PROOF STEP]
using assms Hom.map_simp_1
[PROOF STATE]
proof (prove)
using this:
C.ide a
\<guillemotleft>g : b' \<rightarrow> b\<guillemotright>
\<lbrakk>C.arr ?g; C.ide ?a\<rbrakk> \<Longrightarrow> Hom.map (?g, ?a) = S.mkArr (Hom.set (C.cod ?g, ?a)) (Hom.set (C.dom ?g, ?a)) (\<phi> (C.dom ?g, ?a) \<circ> (\<cdot>\<^sup>o\<^sup>p) ?g \<circ> \<psi> (C.cod ?g, ?a))

goal (1 subgoal):
 1. \<guillemotleft>Y a g : Hom.map (b, a) \<rightarrow>\<^sub>S Hom.map (b', a)\<guillemotright> &&& Y a g = S.mkArr (Hom.set (b, a)) (Hom.set (b', a)) (\<phi> (b', a) \<circ> (\<cdot>\<^sup>o\<^sup>p) g \<circ> \<psi> (b, a))
[PROOF STEP]
by (fastforce, auto)