[STATEMENT]
lemma second_countable_iff_dense_countable_subset:
  "(\<exists>B::'a::metric_space set set. countable B \<and> topological_basis B)
    \<longleftrightarrow> (\<exists>A::'a set. countable A \<and> closure A = UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>B. countable B \<and> topological_basis B) = (\<exists>A. countable A \<and> closure A = UNIV)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>B. countable B \<and> topological_basis B \<Longrightarrow> \<exists>A. countable A \<and> closure A = UNIV
 2. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
assume "\<exists>B::'a set set. countable B \<and> topological_basis B"
[PROOF STATE]
proof (state)
this:
\<exists>B. countable B \<and> topological_basis B

goal (2 subgoals):
 1. \<exists>B. countable B \<and> topological_basis B \<Longrightarrow> \<exists>A. countable A \<and> closure A = UNIV
 2. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
obtain B::"'a set set" where "countable B" "topological_basis B"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. countable B \<and> topological_basis B

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>countable B; topological_basis B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable B
topological_basis B

goal (2 subgoals):
 1. \<exists>B. countable B \<and> topological_basis B \<Longrightarrow> \<exists>A. countable A \<and> closure A = UNIV
 2. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
define A where "A = (\<lambda>U. SOME x. x \<in> U)`B"
[PROOF STATE]
proof (state)
this:
A = (\<lambda>U. SOME x. x \<in> U) ` B

goal (2 subgoals):
 1. \<exists>B. countable B \<and> topological_basis B \<Longrightarrow> \<exists>A. countable A \<and> closure A = UNIV
 2. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
have "countable A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable A
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable ((\<lambda>U. SOME x. x \<in> U) ` B)
[PROOF STEP]
using \<open>countable B\<close>
[PROOF STATE]
proof (prove)
using this:
countable B

goal (1 subgoal):
 1. countable ((\<lambda>U. SOME x. x \<in> U) ` B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable A

goal (2 subgoals):
 1. \<exists>B. countable B \<and> topological_basis B \<Longrightarrow> \<exists>A. countable A \<and> closure A = UNIV
 2. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable A

goal (2 subgoals):
 1. \<exists>B. countable B \<and> topological_basis B \<Longrightarrow> \<exists>A. countable A \<and> closure A = UNIV
 2. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
have "closure A = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure A = UNIV
[PROOF STEP]
proof (auto simp add: closure_approachable)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
fix x::'a and e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
obtain U where "U \<in> B" "x \<in> U" "U \<subseteq> ball x e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>U. \<lbrakk>U \<in> B; x \<in> U; U \<subseteq> ball x e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule topological_basisE[OF \<open>topological_basis B\<close>, of "ball x e" x], auto simp add: \<open>e > 0\<close>)
[PROOF STATE]
proof (state)
this:
U \<in> B
x \<in> U
U \<subseteq> ball x e

goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
define y where "y = (\<lambda>U. SOME x. x \<in> U) U"
[PROOF STATE]
proof (state)
this:
y = (SOME x. x \<in> U)

goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
have "y \<in> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> U
[PROOF STEP]
unfolding y_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<in> U) \<in> U
[PROOF STEP]
using \<open>x \<in> U\<close> some_in_eq
[PROOF STATE]
proof (prove)
using this:
x \<in> U
((SOME x. x \<in> ?A) \<in> ?A) = (?A \<noteq> {})

goal (1 subgoal):
 1. (SOME x. x \<in> U) \<in> U
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
y \<in> U

goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> U
[PROOF STEP]
have "dist y x < e"
[PROOF STATE]
proof (prove)
using this:
y \<in> U

goal (1 subgoal):
 1. dist y x < e
[PROOF STEP]
using \<open>U \<subseteq> ball x e\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> U
U \<subseteq> ball x e

goal (1 subgoal):
 1. dist y x < e
[PROOF STEP]
by (metis dist_commute mem_ball subset_iff)
[PROOF STATE]
proof (state)
this:
dist y x < e

goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dist y x < e

goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
have "y \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> A
[PROOF STEP]
unfolding A_def y_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<in> U) \<in> (\<lambda>U. SOME x. x \<in> U) ` B
[PROOF STEP]
using \<open>U \<in> B\<close>
[PROOF STATE]
proof (prove)
using this:
U \<in> B

goal (1 subgoal):
 1. (SOME x. x \<in> U) \<in> (\<lambda>U. SOME x. x \<in> U) ` B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> A

goal (1 subgoal):
 1. \<And>x e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dist y x < e
y \<in> A
[PROOF STEP]
show "\<exists>y\<in>A. dist y x < e"
[PROOF STATE]
proof (prove)
using this:
dist y x < e
y \<in> A

goal (1 subgoal):
 1. \<exists>y\<in>A. dist y x < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>A. dist y x < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closure A = UNIV

goal (2 subgoals):
 1. \<exists>B. countable B \<and> topological_basis B \<Longrightarrow> \<exists>A. countable A \<and> closure A = UNIV
 2. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
countable A
closure A = UNIV
[PROOF STEP]
show "\<exists>A::'a set. countable A \<and> closure A = UNIV"
[PROOF STATE]
proof (prove)
using this:
countable A
closure A = UNIV

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>A. countable A \<and> closure A = UNIV

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
assume "\<exists>A::'a set. countable A \<and> closure A = UNIV"
[PROOF STATE]
proof (state)
this:
\<exists>A. countable A \<and> closure A = UNIV

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A. countable A \<and> closure A = UNIV
[PROOF STEP]
obtain A::"'a set" where "countable A" "closure A = UNIV"
[PROOF STATE]
proof (prove)
using this:
\<exists>A. countable A \<and> closure A = UNIV

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>countable A; closure A = UNIV\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable A
closure A = UNIV

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
define B where "B = (\<lambda>(x, (n::nat)). ball x (1/n))`(A \<times> UNIV)"
[PROOF STATE]
proof (state)
this:
B = (\<lambda>(xa, x). ball xa (1 / real x)) ` (A \<times> UNIV)

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
have "countable B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable B
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable ((\<lambda>(xa, x). ball xa (1 / real x)) ` (A \<times> UNIV))
[PROOF STEP]
using \<open>countable A\<close>
[PROOF STATE]
proof (prove)
using this:
countable A

goal (1 subgoal):
 1. countable ((\<lambda>(xa, x). ball xa (1 / real x)) ` (A \<times> UNIV))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable B

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable B

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
have "topological_basis B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topological_basis B
[PROOF STEP]
proof (rule topological_basisI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
fix x::'a and U
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
assume "x \<in> U" "open U"
[PROOF STATE]
proof (state)
this:
x \<in> U
open U

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> U
open U
[PROOF STEP]
obtain e where "e > 0" "ball x e \<subseteq> U"
[PROOF STATE]
proof (prove)
using this:
x \<in> U
open U

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using openE
[PROOF STATE]
proof (prove)
using this:
x \<in> U
open U
\<lbrakk>open ?S; ?x \<in> ?S; \<And>e. \<lbrakk>0 < e; ball ?x e \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<subseteq> U

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
obtain n::nat where "n > 2/e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. 2 / e < real n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using reals_Archimedean2
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x < of_nat n

goal (1 subgoal):
 1. (\<And>n. 2 / e < real n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 / e < real n

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 / e < real n
[PROOF STEP]
have "n > 0"
[PROOF STATE]
proof (prove)
using this:
2 / e < real n

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
using \<open>e > 0\<close> not_less
[PROOF STATE]
proof (prove)
using this:
2 / e < real n
0 < e
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < n

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "1/n > 0"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 0 < 1 / real n
[PROOF STEP]
using zero_less_divide_iff
[PROOF STATE]
proof (prove)
using this:
0 < n
((0::?'a) < ?a / ?b) = ((0::?'a) < ?a \<and> (0::?'a) < ?b \<or> ?a < (0::?'a) \<and> ?b < (0::?'a))

goal (1 subgoal):
 1. 0 < 1 / real n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < 1 / real n

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 1 / real n
[PROOF STEP]
obtain y where y: "y \<in> A" "dist x y < 1/n"
[PROOF STATE]
proof (prove)
using this:
0 < 1 / real n

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> A; dist x y < 1 / real n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>closure A = UNIV\<close> UNIV_I closure_approachable dist_commute)
[PROOF STATE]
proof (state)
this:
y \<in> A
dist x y < 1 / real n

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> A
dist x y < 1 / real n
[PROOF STEP]
have "ball y (1/n) \<in> B"
[PROOF STATE]
proof (prove)
using this:
y \<in> A
dist x y < 1 / real n

goal (1 subgoal):
 1. ball y (1 / real n) \<in> B
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
using this:
y \<in> A
dist x y < 1 / real n

goal (1 subgoal):
 1. ball y (1 / real n) \<in> (\<lambda>(xa, x). ball xa (1 / real x)) ` (A \<times> UNIV)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball y (1 / real n) \<in> B

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ball y (1 / real n) \<in> B

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
have "x \<in> ball y (1/n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> ball y (1 / real n)
[PROOF STEP]
using y(2)
[PROOF STATE]
proof (prove)
using this:
dist x y < 1 / real n

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

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> ball y (1 / real n)

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
have "ball y (1/n) \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball y (1 / real n) \<subseteq> U
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
assume z: "dist y z < 1/n"
[PROOF STATE]
proof (state)
this:
dist y z < 1 / real n

goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
have "dist z x \<le> dist z y + dist y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist z x \<le> dist z y + dist y x
[PROOF STEP]
using dist_triangle
[PROOF STATE]
proof (prove)
using this:
dist ?x ?z \<le> dist ?x ?y + dist ?y ?z

goal (1 subgoal):
 1. dist z x \<le> dist z y + dist y x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist z x \<le> dist z y + dist y x

goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist z x \<le> dist z y + dist y x

goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
have "... < 1/n + 1/n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist z y + dist y x < 1 / real n + 1 / real n
[PROOF STEP]
using z y(2)
[PROOF STATE]
proof (prove)
using this:
dist y z < 1 / real n
dist x y < 1 / real n

goal (1 subgoal):
 1. dist z y + dist y x < 1 / real n + 1 / real n
[PROOF STEP]
by (auto simp add: dist_commute)
[PROOF STATE]
proof (state)
this:
dist z y + dist y x < 1 / real n + 1 / real n

goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist z y + dist y x < 1 / real n + 1 / real n

goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
have "... < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real n + 1 / real n < e
[PROOF STEP]
using \<open>n > 2/e\<close> \<open>e > 0\<close> \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
2 / e < real n
0 < e
0 < n

goal (1 subgoal):
 1. 1 / real n + 1 / real n < e
[PROOF STEP]
by (auto simp add: divide_simps mult.commute)
[PROOF STATE]
proof (state)
this:
1 / real n + 1 / real n < e

goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist z x < e
[PROOF STEP]
have "z \<in> ball x e"
[PROOF STATE]
proof (prove)
using this:
dist z x < e

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

goal (1 subgoal):
 1. \<And>x. dist y x < 1 / real n \<Longrightarrow> x \<in> U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> ball x e
[PROOF STEP]
show "z \<in> U"
[PROOF STATE]
proof (prove)
using this:
z \<in> ball x e

goal (1 subgoal):
 1. z \<in> U
[PROOF STEP]
using \<open>ball x e \<subseteq> U\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> ball x e
ball x e \<subseteq> U

goal (1 subgoal):
 1. z \<in> U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> U

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ball y (1 / real n) \<subseteq> U

goal (2 subgoals):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
 2. \<And>O' x. \<lbrakk>open O'; x \<in> O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ball y (1 / real n) \<in> B
x \<in> ball y (1 / real n)
ball y (1 / real n) \<subseteq> U
[PROOF STEP]
show "\<exists>V\<in>B. x \<in> V \<and> V \<subseteq> U"
[PROOF STATE]
proof (prove)
using this:
ball y (1 / real n) \<in> B
x \<in> ball y (1 / real n)
ball y (1 / real n) \<subseteq> U

goal (1 subgoal):
 1. \<exists>V\<in>B. x \<in> V \<and> V \<subseteq> U
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>V\<in>B. x \<in> V \<and> V \<subseteq> U

goal (1 subgoal):
 1. \<And>B'. B' \<in> B \<Longrightarrow> open B'
[PROOF STEP]
qed (auto simp add: B_def)
[PROOF STATE]
proof (state)
this:
topological_basis B

goal (1 subgoal):
 1. \<exists>A. countable A \<and> closure A = UNIV \<Longrightarrow> \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
countable B
topological_basis B
[PROOF STEP]
show "\<exists>B::'a set set. countable B \<and> topological_basis B"
[PROOF STATE]
proof (prove)
using this:
countable B
topological_basis B

goal (1 subgoal):
 1. \<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>B. countable B \<and> topological_basis B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_of_squares: "6 * (\<Sum>i=0..n. i * i) = n * Suc n * Suc (2 * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 6 * (\<Sum>i = 0..n. i * i) = n * Suc n * Suc (2 * n)
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma board_subset: "n\<^sub>1 \<le> n\<^sub>2 \<Longrightarrow> m\<^sub>1 \<le> m\<^sub>2 \<Longrightarrow> board n\<^sub>1 m\<^sub>1 \<subseteq> board n\<^sub>2 m\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n\<^sub>1 \<le> n\<^sub>2; m\<^sub>1 \<le> m\<^sub>2\<rbrakk> \<Longrightarrow> board n\<^sub>1 m\<^sub>1 \<subseteq> board n\<^sub>2 m\<^sub>2
[PROOF STEP]
unfolding board_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n\<^sub>1 \<le> n\<^sub>2; m\<^sub>1 \<le> m\<^sub>2\<rbrakk> \<Longrightarrow> {(i, j) |i j. 1 \<le> i \<and> i \<le> int n\<^sub>1 \<and> 1 \<le> j \<and> j \<le> int m\<^sub>1} \<subseteq> {(i, j) |i j. 1 \<le> i \<and> i \<le> int n\<^sub>2 \<and> 1 \<le> j \<and> j \<le> int m\<^sub>2}
[PROOF STEP]
by auto


[STATEMENT]
lemma "(-x \<le> (0::real)) = (0 \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<le> 0) = (0 \<le> x)
[PROOF STEP]
by arith


[STATEMENT]
lemma float_le_zero:
  "(float (a,b) <= 0) = (a <= 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (float (a, b) \<le> 0) = (a \<le> 0)
[PROOF STEP]
by (simp add: float_def mult_le_0_iff)


[STATEMENT]
lemma cartesian_product_complement_right:
  assumes "B \<subseteq> carrier (R\<^bsup>m\<^esup>)"
  assumes "A \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  shows "cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - (cartesian_product A B) =
          cartesian_product A ((carrier (R\<^bsup>m\<^esup>)) - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B = cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B \<subseteq> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B)
 2. cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<subseteq> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
show "cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B \<subseteq> cartesian_product A ((carrier (R\<^bsup>m\<^esup>)) - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B \<subseteq> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B)
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. \<exists>as\<in>A. \<exists>bs\<in>carrier (R\<^bsup>m\<^esup>). xs = as @ bs} - {xs. \<exists>as\<in>A. \<exists>bs\<in>B. xs = as @ bs} \<subseteq> {xs. \<exists>as\<in>A. \<exists>bs\<in>carrier (R\<^bsup>m\<^esup>) - B. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B \<subseteq> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B)

goal (1 subgoal):
 1. cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<subseteq> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
show "cartesian_product A ((carrier (R\<^bsup>m\<^esup>)) - B) \<subseteq> cartesian_product A ((carrier (R\<^bsup>m\<^esup>))) - cartesian_product A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<subseteq> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<Longrightarrow> x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<Longrightarrow> x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
assume A: "x \<in> cartesian_product A ((carrier (R\<^bsup>m\<^esup>)) - B)"
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B)

goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<Longrightarrow> x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
have 0: "x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>))
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B)

goal (1 subgoal):
 1. x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>))
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {xs. \<exists>as\<in>A. \<exists>bs\<in>carrier (R\<^bsup>m\<^esup>) - B. xs = as @ bs}

goal (1 subgoal):
 1. x \<in> {xs. \<exists>as\<in>A. \<exists>bs\<in>carrier (R\<^bsup>m\<^esup>). xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>))

goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<Longrightarrow> x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
show "x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B
[PROOF STEP]
apply(rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B \<Longrightarrow> False
[PROOF STEP]
using assms 0 A cartesian_product_memE[of x A "((carrier (R\<^bsup>m\<^esup>)) - B)" R n]
                      cartesian_product_memE[of x A B R n]
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> carrier (R\<^bsup>m\<^esup>)
A \<subseteq> carrier (R\<^bsup>n\<^esup>)
x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>))
x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B)
\<lbrakk>x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B); A \<subseteq> carrier (R\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> take n x \<in> A
\<lbrakk>x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B); A \<subseteq> carrier (R\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> drop n x \<in> carrier (R\<^bsup>m\<^esup>) - B
\<lbrakk>x \<in> cartesian_product A B; A \<subseteq> carrier (R\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> take n x \<in> A
\<lbrakk>x \<in> cartesian_product A B; A \<subseteq> carrier (R\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> drop n x \<in> B

goal (1 subgoal):
 1. x \<notin> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B \<Longrightarrow> False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cartesian_product A (carrier (R\<^bsup>m\<^esup>) - B) \<subseteq> cartesian_product A (carrier (R\<^bsup>m\<^esup>)) - cartesian_product A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lower_circle_rescale:
  assumes "l < r"
  shows "lower_circle l r = (\<lambda> x . (x*(r - l) + l)) ` lower_circle_01"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_circle l r = (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lower_circle l r \<subseteq> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01
 2. (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01 \<subseteq> lower_circle l r
[PROOF STEP]
show "lower_circle l r \<subseteq> (\<lambda>x. x * (of_real r - of_real l) + of_real l) `
        lower_circle_01"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_circle l r \<subseteq> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> lower_circle l r \<Longrightarrow> x \<in> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01
[PROOF STEP]
apply (rule image_eqI[of _ _ "(_ - of_real l)/(of_real r - of_real l)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> lower_circle l r \<Longrightarrow> x = (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) * (complex_of_real r - complex_of_real l) + complex_of_real l
 2. \<And>x. x \<in> lower_circle l r \<Longrightarrow> (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) \<in> lower_circle_01
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < r

goal (2 subgoals):
 1. \<And>x. x \<in> lower_circle l r \<Longrightarrow> x = (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) * (complex_of_real r - complex_of_real l) + complex_of_real l
 2. \<And>x. x \<in> lower_circle l r \<Longrightarrow> (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) \<in> lower_circle_01
[PROOF STEP]
apply (auto simp: divide_simps)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> lower_circle l r \<Longrightarrow> (x - complex_of_real l) / (complex_of_real r - complex_of_real l) \<in> lower_circle_01
[PROOF STEP]
by (auto simp: lower_circle_01_def lower_circle_def)
[PROOF STATE]
proof (state)
this:
lower_circle l r \<subseteq> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01

goal (1 subgoal):
 1. (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01 \<subseteq> lower_circle l r
[PROOF STEP]
show "(\<lambda>x. x * (of_real r - of_real l) + of_real l) ` lower_circle_01 \<subseteq>
        lower_circle l r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01 \<subseteq> lower_circle l r
[PROOF STEP]
apply (rule subsetI, subst(asm) image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<exists>xa\<in>lower_circle_01. x = xa * (complex_of_real r - complex_of_real l) + complex_of_real l \<Longrightarrow> x \<in> lower_circle l r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < r

goal (1 subgoal):
 1. \<And>x. \<exists>xa\<in>lower_circle_01. x = xa * (complex_of_real r - complex_of_real l) + complex_of_real l \<Longrightarrow> x \<in> lower_circle l r
[PROOF STEP]
by (auto simp: lower_circle_01_def lower_circle_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` lower_circle_01 \<subseteq> lower_circle l r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unary_rec_into_pr: "\<lbrakk> g \<in> PrimRec1; h \<in> PrimRec1 \<rbrakk> \<Longrightarrow> UnaryRecOp g h \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; h \<in> PrimRec1\<rbrakk> \<Longrightarrow> UnaryRecOp g h \<in> PrimRec1
[PROOF STEP]
by (simp add: UnaryRecOp_def pr_conv_1_to_3_lm pr_conv_2_to_1_lm pr_rec)


[STATEMENT]
lemma all_openin_homeomorphic_image:
  assumes "homeomorphic_map X Y f"
  shows "(\<forall>V. openin Y V \<longrightarrow> P V) \<longleftrightarrow> (\<forall>U. openin X U \<longrightarrow> P(f ` U))"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>V. openin Y V \<longrightarrow> P V) = (\<forall>U. openin X U \<longrightarrow> P (f ` U))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>V. openin Y V \<longrightarrow> P V \<Longrightarrow> \<forall>U. openin X U \<longrightarrow> P (f ` U)
 2. \<forall>U. openin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. openin Y V \<longrightarrow> P V
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
\<forall>V. openin Y V \<longrightarrow> P V

goal (2 subgoals):
 1. \<forall>V. openin Y V \<longrightarrow> P V \<Longrightarrow> \<forall>U. openin X U \<longrightarrow> P (f ` U)
 2. \<forall>U. openin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. openin Y V \<longrightarrow> P V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>V. openin Y V \<longrightarrow> P V
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
\<forall>V. openin Y V \<longrightarrow> P V

goal (1 subgoal):
 1. \<forall>U. openin X U \<longrightarrow> P (f ` U)
[PROOF STEP]
by (meson assms homeomorphic_map_openness_eq)
[PROOF STATE]
proof (state)
this:
\<forall>U. openin X U \<longrightarrow> P (f ` U)

goal (1 subgoal):
 1. \<forall>U. openin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. openin Y V \<longrightarrow> P V
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>U. openin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. openin Y V \<longrightarrow> P V
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>U. openin X U \<longrightarrow> P (f ` U)

goal (1 subgoal):
 1. \<forall>U. openin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. openin Y V \<longrightarrow> P V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>U. openin X U \<longrightarrow> P (f ` U)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<forall>U. openin X U \<longrightarrow> P (f ` U)

goal (1 subgoal):
 1. \<forall>V. openin Y V \<longrightarrow> P V
[PROOF STEP]
by (metis (no_types, lifting) assms homeomorphic_imp_surjective_map homeomorphic_map_openness openin_subset subset_image_iff)
[PROOF STATE]
proof (state)
this:
\<forall>V. openin Y V \<longrightarrow> P V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sincos_principal_value: "\<exists>y. (- pi < y \<and> y \<le> pi) \<and> (sin y = sin x \<and> cos y = cos x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x
[PROOF STEP]
define y where "y \<equiv> pi - (2 * pi) * frac ((pi - x) / (2 * pi))"
[PROOF STATE]
proof (state)
this:
y \<equiv> pi - 2 * pi * frac ((pi - x) / (2 * pi))

goal (1 subgoal):
 1. \<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x
[PROOF STEP]
have "-pi < y"" y \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - pi < y &&& y \<le> pi
[PROOF STEP]
by (auto simp: field_simps frac_lt_1 y_def)
[PROOF STATE]
proof (state)
this:
- pi < y
y \<le> pi

goal (1 subgoal):
 1. \<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- pi < y
y \<le> pi

goal (1 subgoal):
 1. \<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x
[PROOF STEP]
have "sin y = sin x" "cos y = cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin y = sin x &&& cos y = cos x
[PROOF STEP]
unfolding y_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (pi - 2 * pi * frac ((pi - x) / (2 * pi))) = sin x &&& cos (pi - 2 * pi * frac ((pi - x) / (2 * pi))) = cos x
[PROOF STEP]
apply (simp_all add: frac_def divide_simps sin_add cos_add)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sin x * cos (real_of_int \<lfloor>(pi - x) / (2 * pi)\<rfloor> * (2 * pi)) + cos x * sin (real_of_int \<lfloor>(pi - x) / (2 * pi)\<rfloor> * (2 * pi)) = sin x
 2. cos x * cos (real_of_int \<lfloor>(pi - x) / (2 * pi)\<rfloor> * (2 * pi)) - sin x * sin (real_of_int \<lfloor>(pi - x) / (2 * pi)\<rfloor> * (2 * pi)) = cos x
[PROOF STEP]
by (metis sin_int_2pin cos_int_2pin diff_zero add.right_neutral mult.commute mult.left_neutral mult_zero_left)+
[PROOF STATE]
proof (state)
this:
sin y = sin x
cos y = cos x

goal (1 subgoal):
 1. \<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- pi < y
y \<le> pi
sin y = sin x
cos y = cos x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- pi < y
y \<le> pi
sin y = sin x
cos y = cos x

goal (1 subgoal):
 1. \<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>y. (- pi < y \<and> y \<le> pi) \<and> sin y = sin x \<and> cos y = cos x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all2_trans: "\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c \<Longrightarrow>
    \<forall>xs2 xs3. list_all2 P1 xs1 xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 xs1 xs3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c \<Longrightarrow> \<forall>xs2 xs3. list_all2 P1 xs1 xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 xs1 xs3
[PROOF STEP]
apply (induct_tac xs1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c \<Longrightarrow> \<forall>xs2 xs3. list_all2 P1 [] xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 [] xs3
 2. \<And>a list. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3\<rbrakk> \<Longrightarrow> \<forall>xs2 xs3. list_all2 P1 (a # list) xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 (a # list) xs3
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3\<rbrakk> \<Longrightarrow> \<forall>xs2 xs3. list_all2 P1 (a # list) xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 (a # list) xs3
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list xs2. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3\<rbrakk> \<Longrightarrow> \<forall>xs3. list_all2 P1 (a # list) xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 (a # list) xs3
[PROOF STEP]
apply (induct_tac xs2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a list xs2. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3\<rbrakk> \<Longrightarrow> \<forall>xs3. list_all2 P1 (a # list) [] \<longrightarrow> list_all2 P2 [] xs3 \<longrightarrow> list_all2 P3 (a # list) xs3
 2. \<And>a list xs2 aa lista. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3; \<forall>xs3. list_all2 P1 (a # list) lista \<longrightarrow> list_all2 P2 lista xs3 \<longrightarrow> list_all2 P3 (a # list) xs3\<rbrakk> \<Longrightarrow> \<forall>xs3. list_all2 P1 (a # list) (aa # lista) \<longrightarrow> list_all2 P2 (aa # lista) xs3 \<longrightarrow> list_all2 P3 (a # list) xs3
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list xs2 aa lista. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3; \<forall>xs3. list_all2 P1 (a # list) lista \<longrightarrow> list_all2 P2 lista xs3 \<longrightarrow> list_all2 P3 (a # list) xs3\<rbrakk> \<Longrightarrow> \<forall>xs3. list_all2 P1 (a # list) (aa # lista) \<longrightarrow> list_all2 P2 (aa # lista) xs3 \<longrightarrow> list_all2 P3 (a # list) xs3
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list xs2 aa lista xs3. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3; \<forall>xs3. list_all2 P1 (a # list) lista \<longrightarrow> list_all2 P2 lista xs3 \<longrightarrow> list_all2 P3 (a # list) xs3\<rbrakk> \<Longrightarrow> list_all2 P1 (a # list) (aa # lista) \<longrightarrow> list_all2 P2 (aa # lista) xs3 \<longrightarrow> list_all2 P3 (a # list) xs3
[PROOF STEP]
apply (induct_tac xs3)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a list xs2 aa lista xs3. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3; \<forall>xs3. list_all2 P1 (a # list) lista \<longrightarrow> list_all2 P2 lista xs3 \<longrightarrow> list_all2 P3 (a # list) xs3\<rbrakk> \<Longrightarrow> list_all2 P1 (a # list) (aa # lista) \<longrightarrow> list_all2 P2 (aa # lista) [] \<longrightarrow> list_all2 P3 (a # list) []
 2. \<And>a list xs2 aa lista xs3 ab listb. \<lbrakk>\<forall>a b c. P1 a b \<longrightarrow> P2 b c \<longrightarrow> P3 a c; \<forall>xs2 xs3. list_all2 P1 list xs2 \<longrightarrow> list_all2 P2 xs2 xs3 \<longrightarrow> list_all2 P3 list xs3; \<forall>xs3. list_all2 P1 (a # list) lista \<longrightarrow> list_all2 P2 lista xs3 \<longrightarrow> list_all2 P3 (a # list) xs3; list_all2 P1 (a # list) (aa # lista) \<longrightarrow> list_all2 P2 (aa # lista) listb \<longrightarrow> list_all2 P3 (a # list) listb\<rbrakk> \<Longrightarrow> list_all2 P1 (a # list) (aa # lista) \<longrightarrow> list_all2 P2 (aa # lista) (ab # listb) \<longrightarrow> list_all2 P3 (a # list) (ab # listb)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma octo_mult_cnj_conv_norm: "x * cnj x = octo_of_real (norm x) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * Octonions.cnj x = (octo_of_real (norm x))\<^sup>2
[PROOF STEP]
by (simp add: octo_eq_iff octo_mult_components norm_octo_def power2_eq_square
           flip: octo_of_real_power)


[STATEMENT]
lemma rotation_minus_pi_2_x_axis [simp]:
  shows "moebius_circline (moebius_rotation (-pi/2)) x_axis = y_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (moebius_rotation (- pi / 2)) x_axis = y_axis
[PROOF STEP]
unfolding moebius_rotation_def moebius_similarity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (mk_moebius (cis (- pi / 2)) 0 0 1) x_axis = y_axis
[PROOF STEP]
by (transfer, transfer, simp add: mat_adj_def mat_cnj_def)


[STATEMENT]
lemma infsetsum_of_real:
  shows "infsetsum (\<lambda>x. of_real (f x)
           :: 'a :: {real_normed_algebra_1,banach,second_countable_topology,real_inner}) A =
             of_real (infsetsum f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>ax\<in>A. of_real (f x)) = of_real (infsetsum f A)
[PROOF STEP]
unfolding infsetsum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|count_space A. of_real (f x) = of_real (integral\<^sup>L (count_space A) f)
[PROOF STEP]
by (rule integral_bounded_linear'[OF bounded_linear_of_real bounded_linear_inner_left[of 1]]) auto


[STATEMENT]
lemma single_pp_plus: "single_pp x a + single_pp x b = single_pp x (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_pp x a + single_pp x b = single_pp x (a + b)
[PROOF STEP]
by (rule pp_eqI, simp add: lookup_single_pp lookup_plus_pp when_def)


[STATEMENT]
theorem tak_correct: "tak x y z = (if x \<le> y then y else if y \<le> z then z else x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tak x y z = (if x \<le> y then y else if y \<le> z then z else x)
[PROOF STEP]
by (induction x y z rule: tak.induct) auto


[STATEMENT]
lemma e_approx_32: "\<bar>exp(1) - 5837465777 / 2147483648\<bar> \<le> (inverse(2 ^ 32)::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp 1 - 5837465777 / 2147483648\<bar> \<le> inverse (2 ^ 32)
[PROOF STEP]
using Taylor_exp [of 1 14] exp_le
[PROOF STATE]
proof (prove)
using this:
cmod (exp 1 - (\<Sum>k\<le>14. 1 ^ k / fact k)) \<le> exp \<bar>Re 1\<bar> * cmod 1 ^ Suc 14 / fact 14
exp 1 \<le> 3

goal (1 subgoal):
 1. \<bar>exp 1 - 5837465777 / 2147483648\<bar> \<le> inverse (2 ^ 32)
[PROOF STEP]
apply (simp add: sum_distrib_right in_Reals_norm Re_exp atMost_nat_numeral fact_numeral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>exp 1 - 47395032961 / 17435658240\<bar> * 87178291200 \<le> exp 1; exp 1 \<le> 3\<rbrakk> \<Longrightarrow> \<bar>exp 1 - 5837465777 / 2147483648\<bar> * 4294967296 \<le> 1
[PROOF STEP]
apply (simp only: pos_le_divide_eq [symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma  matrix_left_invertible:
  "linear f \<Longrightarrow> ((\<exists>B. B ** matrix f = mat 1) \<longleftrightarrow> (\<exists>g. linear g \<and> g \<circ> f = id))" for f::"real^'m \<Rightarrow> real^'n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f \<Longrightarrow> (\<exists>B. B ** matrix f = mat 1) = (\<exists>g. linear g \<and> g \<circ> f = id)
[PROOF STEP]
using matrix_left_invertible_gen[of f]
[PROOF STATE]
proof (prove)
using this:
Vector_Spaces.linear (*s) (*s) f \<Longrightarrow> (\<exists>B. B ** matrix f = mat 1) = (\<exists>g. Vector_Spaces.linear (*s) (*s) g \<and> g \<circ> f = id)

goal (1 subgoal):
 1. linear f \<Longrightarrow> (\<exists>B. B ** matrix f = mat 1) = (\<exists>g. linear g \<and> g \<circ> f = id)
[PROOF STEP]
by (auto simp: linear_matrix_vector_mul_eq)


[STATEMENT]
theorem pred_bound_size_univ: "invar_vebt t n \<Longrightarrow> u =  2^n \<Longrightarrow>   T\<^sub>p\<^sub>r\<^sub>e\<^sub>d t x \<le> 58 + 29 * lb (lb u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; u = 2 ^ n\<rbrakk> \<Longrightarrow> real (T\<^sub>p\<^sub>r\<^sub>e\<^sub>d t x) \<le> 58 + 29 * log 2 (log 2 u)
[PROOF STEP]
using pred_bound_height[of t n x] height_double_log_univ_size[of u n t]
[PROOF STATE]
proof (prove)
using this:
invar_vebt t n \<Longrightarrow> T\<^sub>p\<^sub>r\<^sub>e\<^sub>d t x \<le> (1 + height t) * 29
\<lbrakk>u = 2 ^ n; invar_vebt t n\<rbrakk> \<Longrightarrow> real (height t) \<le> 1 + log 2 (log 2 u)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; u = 2 ^ n\<rbrakk> \<Longrightarrow> real (T\<^sub>p\<^sub>r\<^sub>e\<^sub>d t x) \<le> 58 + 29 * log 2 (log 2 u)
[PROOF STEP]
by simp


[STATEMENT]
lemma "((\<lambda>t::real. t^2 / (exp t - 1)) \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t\<^sup>2 / (exp t - 1)) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma elements_mat_append_cols: "A \<in> carrier_mat n nc \<Longrightarrow> B \<in> carrier_mat n nc1
  \<Longrightarrow> elements_mat (A @\<^sub>c B) = elements_mat A \<union> elements_mat B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n nc; B \<in> carrier_mat n nc1\<rbrakk> \<Longrightarrow> elements_mat (A @\<^sub>c B) = elements_mat A \<union> elements_mat B
[PROOF STEP]
unfolding append_cols_def elements_mat_transpose_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n nc; B \<in> carrier_mat n nc1\<rbrakk> \<Longrightarrow> elements_mat (A\<^sup>T @\<^sub>r B\<^sup>T) = elements_mat A \<union> elements_mat B
[PROOF STEP]
by (subst elements_mat_append_rows, auto)


[STATEMENT]
lemma permute_list_zip:
  assumes "f permutes A" "A = {..<length xs}"
  assumes [simp]: "length xs = length ys"
  shows "permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
from permutes_in_image[OF assms(1)] assms(2)
[PROOF STATE]
proof (chain)
picking this:
(f ?x \<in> A) = (?x \<in> A)
A = {..<length xs}
[PROOF STEP]
have *: "f i < length ys \<longleftrightarrow> i < length ys" for i
[PROOF STATE]
proof (prove)
using this:
(f ?x \<in> A) = (?x \<in> A)
A = {..<length xs}

goal (1 subgoal):
 1. (f i < length ys) = (i < length ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f ?i < length ys) = (?i < length ys)

goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
have "permute_list f (zip xs ys) = map (\<lambda>i. zip xs ys ! f i) [0..<length ys]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list f (zip xs ys) = map (\<lambda>i. zip xs ys ! f i) [0..<length ys]
[PROOF STEP]
by (simp_all add: permute_list_def zip_map_map)
[PROOF STATE]
proof (state)
this:
permute_list f (zip xs ys) = map (\<lambda>i. zip xs ys ! f i) [0..<length ys]

goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
permute_list f (zip xs ys) = map (\<lambda>i. zip xs ys ! f i) [0..<length ys]

goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
have "\<dots> = map (\<lambda>(x, y). (xs ! f x, ys ! f y)) (zip [0..<length ys] [0..<length ys])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. zip xs ys ! f i) [0..<length ys] = map2 (\<lambda>x y. (xs ! f x, ys ! f y)) [0..<length ys] [0..<length ys]
[PROOF STEP]
by (intro nth_equalityI) (simp_all add: *)
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. zip xs ys ! f i) [0..<length ys] = map2 (\<lambda>x y. (xs ! f x, ys ! f y)) [0..<length ys] [0..<length ys]

goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. zip xs ys ! f i) [0..<length ys] = map2 (\<lambda>x y. (xs ! f x, ys ! f y)) [0..<length ys] [0..<length ys]

goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
have "\<dots> = zip (permute_list f xs) (permute_list f ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<lambda>x y. (xs ! f x, ys ! f y)) [0..<length ys] [0..<length ys] = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
by (simp_all add: permute_list_def zip_map_map)
[PROOF STATE]
proof (state)
this:
map2 (\<lambda>x y. (xs ! f x, ys ! f y)) [0..<length ys] [0..<length ys] = zip (permute_list f xs) (permute_list f ys)

goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)

goal (1 subgoal):
 1. permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
permute_list f (zip xs ys) = zip (permute_list f xs) (permute_list f ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_antilinear_equal_ket:
  fixes f g :: \<open>'a ell2 \<Rightarrow> _\<close>
  assumes \<open>bounded_antilinear f\<close>
  assumes \<open>bounded_antilinear g\<close>
  assumes \<open>\<And>i. f (ket i) = g (ket i)\<close>
  shows \<open>f = g\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f x = g x
[PROOF STEP]
apply (rule bounded_antilinear_eq_on[of f g \<open>range ket\<close>])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. bounded_antilinear f
 2. \<And>x. bounded_antilinear g
 3. \<And>x xa. xa \<in> range ket \<Longrightarrow> f xa = g xa
 4. \<And>x. x \<in> closure (cspan (range ket))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bounded_antilinear f
bounded_antilinear g
f (ket ?i) = g (ket ?i)

goal (4 subgoals):
 1. \<And>x. bounded_antilinear f
 2. \<And>x. bounded_antilinear g
 3. \<And>x xa. xa \<in> range ket \<Longrightarrow> f xa = g xa
 4. \<And>x. x \<in> closure (cspan (range ket))
[PROOF STEP]
by auto


[STATEMENT]
lemma lim_exp_minus_1: "((\<lambda>z::'a. (exp(z) - 1) / z) \<longlongrightarrow> 1) (at 0)"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. (exp z - (1::'a)) / z) \<midarrow>0::'a\<rightarrow> (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>z. (exp z - (1::'a)) / z) \<midarrow>0::'a\<rightarrow> (1::'a)
[PROOF STEP]
have "((\<lambda>z::'a. exp(z) - 1) has_field_derivative 1) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. exp z - (1::'a)) has_field_derivative (1::'a)) (at (0::'a))
[PROOF STEP]
by (intro derivative_eq_intros | simp)+
[PROOF STATE]
proof (state)
this:
((\<lambda>z. exp z - (1::'a)) has_field_derivative (1::'a)) (at (0::'a))

goal (1 subgoal):
 1. (\<lambda>z. (exp z - (1::'a)) / z) \<midarrow>0::'a\<rightarrow> (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. exp z - (1::'a)) has_field_derivative (1::'a)) (at (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. exp z - (1::'a)) has_field_derivative (1::'a)) (at (0::'a))

goal (1 subgoal):
 1. (\<lambda>z. (exp z - (1::'a)) / z) \<midarrow>0::'a\<rightarrow> (1::'a)
[PROOF STEP]
by (simp add: Deriv.has_field_derivative_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>z. (exp z - (1::'a)) / z) \<midarrow>0::'a\<rightarrow> (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_mset_mono:
  assumes "distinct ys" "mset xs \<subseteq># mset ys"
  shows   "distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs
[PROOF STEP]
unfolding distinct_count_atmost_1'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. count (mset xs) a \<le> 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. count (mset xs) a \<le> 1
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. count (mset xs) a \<le> 1
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
mset xs \<subseteq># mset ys
[PROOF STEP]
have "count (mset xs) x \<le> count (mset ys) x"
[PROOF STATE]
proof (prove)
using this:
mset xs \<subseteq># mset ys

goal (1 subgoal):
 1. count (mset xs) x \<le> count (mset ys) x
[PROOF STEP]
by (rule mset_subset_eq_count)
[PROOF STATE]
proof (state)
this:
count (mset xs) x \<le> count (mset ys) x

goal (1 subgoal):
 1. \<And>a. count (mset xs) a \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count (mset xs) x \<le> count (mset ys) x

goal (1 subgoal):
 1. \<And>a. count (mset xs) a \<le> 1
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
distinct ys
[PROOF STEP]
have "\<dots> \<le> 1"
[PROOF STATE]
proof (prove)
using this:
distinct ys

goal (1 subgoal):
 1. count (mset ys) x \<le> 1
[PROOF STEP]
unfolding distinct_count_atmost_1'
[PROOF STATE]
proof (prove)
using this:
\<forall>a. count (mset ys) a \<le> 1

goal (1 subgoal):
 1. count (mset ys) x \<le> 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
count (mset ys) x \<le> 1

goal (1 subgoal):
 1. \<And>a. count (mset xs) a \<le> 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
count (mset xs) x \<le> 1
[PROOF STEP]
show "count (mset xs) x \<le> 1"
[PROOF STATE]
proof (prove)
using this:
count (mset xs) x \<le> 1

goal (1 subgoal):
 1. count (mset xs) x \<le> 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
count (mset xs) x \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma increasing_LIMSEQ:
  fixes f :: "nat \<Rightarrow> real"
  assumes inc: "\<And>n. f n \<le> f (Suc n)"
    and bdd: "\<And>n. f n \<le> l"
    and en: "\<And>e. 0 < e \<Longrightarrow> \<exists>n. l \<le> f n + e"
  shows "f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> l
[PROOF STEP]
proof (rule increasing_tendsto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. f n \<le> l
 2. \<And>x. x < l \<Longrightarrow> \<forall>\<^sub>F n in sequentially. x < f n
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. f n \<le> l
 2. \<And>x. x < l \<Longrightarrow> \<forall>\<^sub>F n in sequentially. x < f n
[PROOF STEP]
assume "x < l"
[PROOF STATE]
proof (state)
this:
x < l

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. f n \<le> l
 2. \<And>x. x < l \<Longrightarrow> \<forall>\<^sub>F n in sequentially. x < f n
[PROOF STEP]
with dense[of 0 "l - x"]
[PROOF STATE]
proof (chain)
picking this:
0 < l - x \<Longrightarrow> \<exists>z>0. z < l - x
x < l
[PROOF STEP]
obtain e where "0 < e" "e < l - x"
[PROOF STATE]
proof (prove)
using this:
0 < l - x \<Longrightarrow> \<exists>z>0. z < l - x
x < l

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; e < l - x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e
e < l - x

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. f n \<le> l
 2. \<And>x. x < l \<Longrightarrow> \<forall>\<^sub>F n in sequentially. x < f n
[PROOF STEP]
from en[OF \<open>0 < e\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. l \<le> f n + e
[PROOF STEP]
obtain n where "l - e \<le> f n"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. l \<le> f n + e

goal (1 subgoal):
 1. (\<And>n. l - e \<le> f n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
l - e \<le> f n

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. f n \<le> l
 2. \<And>x. x < l \<Longrightarrow> \<forall>\<^sub>F n in sequentially. x < f n
[PROOF STEP]
with \<open>e < l - x\<close> \<open>0 < e\<close>
[PROOF STATE]
proof (chain)
picking this:
e < l - x
0 < e
l - e \<le> f n
[PROOF STEP]
have "x < f n"
[PROOF STATE]
proof (prove)
using this:
e < l - x
0 < e
l - e \<le> f n

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

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. f n \<le> l
 2. \<And>x. x < l \<Longrightarrow> \<forall>\<^sub>F n in sequentially. x < f n
[PROOF STEP]
with incseq_SucI[of f, OF inc]
[PROOF STATE]
proof (chain)
picking this:
incseq f
x < f n
[PROOF STEP]
show "eventually (\<lambda>n. x < f n) sequentially"
[PROOF STATE]
proof (prove)
using this:
incseq f
x < f n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. x < f n
[PROOF STEP]
by (auto simp: eventually_sequentially incseq_def intro: less_le_trans)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. x < f n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. f n \<le> l
[PROOF STEP]
qed (use bdd in auto)


[STATEMENT]
lemma image_image_fixed_card_subset:
  assumes "inj_on f A"
  shows   "(\<lambda>X. f ` X) ` {X. X \<subseteq> A \<and> card X = k} = {X. X \<subseteq> f ` A \<and> card X = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) f ` {X. X \<subseteq> A \<and> card X = k} = {X. X \<subseteq> f ` A \<and> card X = k}
[PROOF STEP]
using bij_betw_imp_surj_on[OF bij_betw_image_fixed_card_subset[OF assms, of k]]
[PROOF STATE]
proof (prove)
using this:
(`) f ` {X. X \<subseteq> A \<and> card X = k} = {X. X \<subseteq> f ` A \<and> card X = k}

goal (1 subgoal):
 1. (`) f ` {X. X \<subseteq> A \<and> card X = k} = {X. X \<subseteq> f ` A \<and> card X = k}
[PROOF STEP]
.


[STATEMENT]
lemma
  assumes "vi v (Suc n) \<le> vi v n"
  shows "vi v (Suc n + m) \<le> vi v (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
have "vi v (Suc n + m) = vi (vi v (Suc n)) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v = (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ Suc n) v)
[PROOF STEP]
by (simp add: Groups.add_ac(2) funpow_add funpow_swap1)
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ (Suc n + m)) v = (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ Suc n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ (Suc n + m)) v = (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ Suc n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
have "... \<le> vi (vi v n) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ Suc n) v) \<le> (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v)
[PROOF STEP]
using \<L>\<^sub>b_iter_mono[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<L>\<^sub>b ^^ ?n) ((\<L>\<^sub>b ^^ Suc n) v) \<le> (\<L>\<^sub>b ^^ ?n) ((\<L>\<^sub>b ^^ n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ Suc n) v) \<le> (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ Suc n) v) \<le> (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ Suc n) v) \<le> (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
have "... = vi v (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v) = (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
by (simp add: add.commute funpow_add)
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v) = (\<L>\<^sub>b ^^ (n + m)) v

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ (Suc n + m)) v \<le> (\<L>\<^sub>b ^^ (n + m)) v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem succ_correct: "invar_vebt t n \<Longrightarrow> vebt_succ t x = Some sx \<longleftrightarrow>is_succ_in_set (set_vebt t) x sx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n \<Longrightarrow> (vebt_succ t x = Some sx) = is_succ_in_set (set_vebt t) x sx
[PROOF STEP]
by (simp add: succ_corr set_vebt_set_vebt'_valid)


[STATEMENT]
lemma clauseFalseIffAllLiteralsAreFalse:
  fixes clause :: Clause and valuation :: Valuation
  shows "clauseFalse clause valuation = (\<forall> literal. literal el clause \<longrightarrow> literalFalse literal valuation)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clauseFalse clause valuation = (\<forall>literal. literal el clause \<longrightarrow> literalFalse literal valuation)
[PROOF STEP]
by (induct clause) auto


[STATEMENT]
lemma CauchyI: "(\<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm (X m - X n) < e) \<Longrightarrow> Cauchy X"
  for X :: "nat \<Rightarrow> 'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm (X m - X n) < e) \<Longrightarrow> Cauchy X
[PROOF STEP]
by (simp add: Cauchy_iff)


[STATEMENT]
lemma arccos_less_arccos: "- 1 \<le> x \<Longrightarrow> x < y \<Longrightarrow> y \<le> 1 \<Longrightarrow> arccos y < arccos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> x; x < y; y \<le> 1\<rbrakk> \<Longrightarrow> arccos y < arccos x
[PROOF STEP]
using arccos_less_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<bar>?x\<bar> \<le> 1; \<bar>?y\<bar> \<le> 1\<rbrakk> \<Longrightarrow> (arccos ?x < arccos ?y) = (?y < ?x)

goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> x; x < y; y \<le> 1\<rbrakk> \<Longrightarrow> arccos y < arccos x
[PROOF STEP]
by auto


[STATEMENT]
lemma height_node: "invar_vebt  (Node (Some (mi, ma)) deg treeList summary) n
                    \<Longrightarrow> height  (Node (Some (mi, ma)) deg treeList summary) >= 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (Node (Some (mi, ma)) deg treeList summary) n \<Longrightarrow> 1 \<le> height (Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
using height.simps(2)
[PROOF STATE]
proof (prove)
using this:
height (Node ?uu ?deg ?treeList ?summary) = 1 + Max (height ` insert ?summary (set ?treeList))

goal (1 subgoal):
 1. invar_vebt (Node (Some (mi, ma)) deg treeList summary) n \<Longrightarrow> 1 \<le> height (Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
by presburger


[STATEMENT]
lemma measure_pmf_bernoulli_half: "measure_pmf (bernoulli_pmf (1 / 2)) = uniform_count_measure UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf (bernoulli_pmf (1 / 2)) = uniform_count_measure UNIV
[PROOF STEP]
by (rule measure_eqI)
     (simp_all add: nn_integral_pmf[symmetric] emeasure_uniform_count_measure ennreal_divide_numeral[symmetric]
                    nn_integral_count_space_finite sets_uniform_count_measure divide_ennreal_def mult_ac
                    ennreal_of_nat_eq_real_of_nat)


[STATEMENT]
lemma nat_power_power_left: "m > 0 \<Longrightarrow> nat_power (m ^ k) n = nat_power m n ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> nat_power (m ^ k) n = nat_power m n ^ k
[PROOF STEP]
by (induction k) (simp_all add: nat_power_mult_distrib)


[STATEMENT]
lemma  rfn_tool12_1:"\<lbrakk>0 < (s::nat); (l::nat) mod s < s - 1 \<rbrakk> \<Longrightarrow>
                     Suc (l mod s) = (Suc l) mod s "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < s; l mod s < s - 1\<rbrakk> \<Longrightarrow> Suc (l mod s) = Suc l mod s
[PROOF STEP]
apply (insert div_mult_mod_eq [of "l" "s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < s; l mod s < s - 1; l div s * s + l mod s = l\<rbrakk> \<Longrightarrow> Suc (l mod s) = Suc l mod s
[PROOF STEP]
apply (insert add_Suc_right [THEN sym, of "l div s * s" "l mod s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < s; l mod s < s - 1; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s)\<rbrakk> \<Longrightarrow> Suc (l mod s) = Suc l mod s
[PROOF STEP]
apply (insert mod_mult_self1  [of "Suc (l mod s)" "l div s" "s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < s; l mod s < s - 1; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); (Suc (l mod s) + l div s * s) mod s = Suc (l mod s) mod s\<rbrakk> \<Longrightarrow> Suc (l mod s) = Suc l mod s
[PROOF STEP]
apply (frule Suc_mono [of "l mod s" "s - 1"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < s; l mod s < s - 1; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); (Suc (l mod s) + l div s * s) mod s = Suc (l mod s) mod s; Suc (l mod s) < Suc (s - 1)\<rbrakk> \<Longrightarrow> Suc (l mod s) = Suc l mod s
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_matrix_vec_mult_le_transpose:
  "\<parallel>x\<parallel> = 1 \<Longrightarrow> (\<parallel>A *v x\<parallel>) \<le> sqrt (\<parallel>transpose A ** A\<parallel>\<^sub>o\<^sub>p) * (\<parallel>x\<parallel>)" for A :: "real^'n^'n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
assume "\<parallel>x\<parallel> = 1"
[PROOF STATE]
proof (state)
this:
\<parallel>x\<parallel> = 1

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
have "(\<parallel>A *v x\<parallel>)\<^sup>2 = (A *v x) \<bullet> (A *v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A *v x\<parallel>\<^sup>2 = (A *v x) \<bullet> (A *v x)
[PROOF STEP]
using dot_square_norm[of "(A *v x)"]
[PROOF STATE]
proof (prove)
using this:
(A *v x) \<bullet> (A *v x) = \<parallel>A *v x\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>A *v x\<parallel>\<^sup>2 = (A *v x) \<bullet> (A *v x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>A *v x\<parallel>\<^sup>2 = (A *v x) \<bullet> (A *v x)

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>A *v x\<parallel>\<^sup>2 = (A *v x) \<bullet> (A *v x)

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
have "... = x \<bullet> (transpose A *v (A *v x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *v x) \<bullet> (A *v x) = x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x))
[PROOF STEP]
using vec_mult_inner
[PROOF STATE]
proof (prove)
using this:
(?A *v ?v) \<bullet> ?w = ?v \<bullet> (Finite_Cartesian_Product.transpose ?A *v ?w)

goal (1 subgoal):
 1. (A *v x) \<bullet> (A *v x) = x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(A *v x) \<bullet> (A *v x) = x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x))

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A *v x) \<bullet> (A *v x) = x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x))

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
have "... \<le> (\<parallel>x\<parallel>) * (\<parallel>transpose A *v (A *v x)\<parallel>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x)) \<le> \<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A *v (A *v x)\<parallel>
[PROOF STEP]
using norm_cauchy_schwarz
[PROOF STATE]
proof (prove)
using this:
?x \<bullet> ?y \<le> \<parallel>?x\<parallel> * \<parallel>?y\<parallel>

goal (1 subgoal):
 1. x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x)) \<le> \<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A *v (A *v x)\<parallel>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x)) \<le> \<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A *v (A *v x)\<parallel>

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<bullet> (Finite_Cartesian_Product.transpose A *v (A *v x)) \<le> \<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A *v (A *v x)\<parallel>

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
have "... \<le> (\<parallel>transpose A ** A\<parallel>\<^sub>o\<^sub>p) * (\<parallel>x\<parallel>)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A *v (A *v x)\<parallel> \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2
[PROOF STEP]
apply(subst matrix_vector_mul_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A ** A *v x\<parallel> \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2
[PROOF STEP]
using norm_matrix_le_mult_op_norm[of "transpose A ** A" x]
[PROOF STATE]
proof (prove)
using this:
\<parallel>Finite_Cartesian_Product.transpose A ** A *v x\<parallel> \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>

goal (1 subgoal):
 1. \<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A ** A *v x\<parallel> \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2
[PROOF STEP]
by (simp add: \<open>\<parallel>x\<parallel> = 1\<close>)
[PROOF STATE]
proof (state)
this:
\<parallel>x\<parallel> * \<parallel>Finite_Cartesian_Product.transpose A *v (A *v x)\<parallel> \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<parallel>A *v x\<parallel>\<^sup>2 \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2
[PROOF STEP]
have "((\<parallel>A *v x\<parallel>))^2 \<le> (\<parallel>transpose A ** A\<parallel>\<^sub>o\<^sub>p) * (\<parallel>x\<parallel>)^2"
[PROOF STATE]
proof (prove)
using this:
\<parallel>A *v x\<parallel>\<^sup>2 \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>A *v x\<parallel>\<^sup>2 \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<parallel>A *v x\<parallel>\<^sup>2 \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
thus "(\<parallel>A *v x\<parallel>) \<le> sqrt ((\<parallel>transpose A ** A\<parallel>\<^sub>o\<^sub>p)) * (\<parallel>x\<parallel>)"
[PROOF STATE]
proof (prove)
using this:
\<parallel>A *v x\<parallel>\<^sup>2 \<le> (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>
[PROOF STEP]
by (simp add: \<open>\<parallel>x\<parallel> = 1\<close> real_le_rsqrt)
[PROOF STATE]
proof (state)
this:
\<parallel>A *v x\<parallel> \<le> sqrt (\<parallel>Finite_Cartesian_Product.transpose A ** A\<parallel>\<^sub>o\<^sub>p) * \<parallel>x\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_mult_assoc: "poly_mult p1 (poly_mult p2 p3) =p poly_mult (poly_mult p1 p2) p3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mult p1 (poly_mult p2 p3) =p poly_mult (poly_mult p1 p2) p3
[PROOF STEP]
unfolding eq_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<alpha>. eval_poly \<alpha> (poly_mult p1 (poly_mult p2 p3)) = eval_poly \<alpha> (poly_mult (poly_mult p1 p2) p3)
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma continuous_image_subset_interior:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "continuous_on S f" "inj_on f S" "DIM('b) \<le> DIM('a)"
  shows "f ` (interior S) \<subseteq> interior(f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` interior S \<subseteq> interior (f ` S)
[PROOF STEP]
proof (rule interior_maximal)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` interior S \<subseteq> f ` S
 2. open (f ` interior S)
[PROOF STEP]
show "f ` interior S \<subseteq> f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` interior S \<subseteq> f ` S
[PROOF STEP]
by (simp add: image_mono interior_subset)
[PROOF STATE]
proof (state)
this:
f ` interior S \<subseteq> f ` S

goal (1 subgoal):
 1. open (f ` interior S)
[PROOF STEP]
show "open (f ` interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` interior S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
inj_on f S
DIM('b) \<le> DIM('a)

goal (1 subgoal):
 1. open (f ` interior S)
[PROOF STEP]
by (auto simp: subset_inj_on interior_subset continuous_on_subset invariance_of_domain_gen)
[PROOF STATE]
proof (state)
this:
open (f ` interior S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma induced_map_stabilizes_recurrent_infty:
  assumes "x \<in> recurrent_subset_infty A"
  shows "((induced_map A)^^n) x \<in> recurrent_subset_infty A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
have "x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A
[PROOF STEP]
using assms(1) recurrent_subset_incl(2)
[PROOF STATE]
proof (prove)
using this:
x \<in> recurrent_subset_infty A
recurrent_subset_infty ?A \<subseteq> ?A

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

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
define R where "R = (\<Sum>i < n. return_time_function A ((induced_map A ^^i) x))"
[PROOF STATE]
proof (state)
this:
R = (\<Sum>i<n. return_time_function A ((induced_map A ^^ i) x))

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
have *: "((induced_map A)^^n) x = (T^^R) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (induced_map A ^^ n) x = (T ^^ R) x
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (induced_map A ^^ n) x = (T ^^ (\<Sum>i<n. return_time_function A ((induced_map A ^^ i) x))) x
[PROOF STEP]
by (rule induced_map_iterates)
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ n) x = (T ^^ R) x

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ n) x = (T ^^ R) x

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
have "((induced_map A)^^n) x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> A
[PROOF STEP]
by (rule induced_map_iterates_stabilize_A, simp add: \<open>x \<in> A\<close>)
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ n) x \<in> A

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(induced_map A ^^ n) x = (T ^^ R) x
(induced_map A ^^ n) x \<in> A
[PROOF STEP]
have "(T^^R) x \<in> A"
[PROOF STATE]
proof (prove)
using this:
(induced_map A ^^ n) x = (T ^^ R) x
(induced_map A ^^ n) x \<in> A

goal (1 subgoal):
 1. (T ^^ R) x \<in> A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(T ^^ R) x \<in> A

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(T ^^ R) x \<in> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(T ^^ R) x \<in> A

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
using recurrent_subset_infty_returns[OF assms] *
[PROOF STATE]
proof (prove)
using this:
(T ^^ R) x \<in> A
(T ^^ ?n) x \<in> A \<Longrightarrow> (T ^^ ?n) x \<in> recurrent_subset_infty A
(induced_map A ^^ n) x = (T ^^ R) x

goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> recurrent_subset_infty A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ n) x \<in> recurrent_subset_infty A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_double: "exp(2 * z) = exp z ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp ((2::'a) * z) = (exp z)\<^sup>2
[PROOF STEP]
by (simp add: exp_add_commuting mult_2 power2_eq_square)


[STATEMENT]
lemma numer_cf3_pos: "-4.64 \<le> x \<Longrightarrow> numer_cf3 x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (464 / 10\<^sup>2) \<le> x \<Longrightarrow> 0 < numer_cf3 x
[PROOF STEP]
unfolding numer_cf3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (464 / 10\<^sup>2) \<le> x \<Longrightarrow> 0 < x ^ 3 + 12 * x\<^sup>2 + 60 * x + 120
[PROOF STEP]
by sturm


[STATEMENT]
lemma linear_gcd:
  fixes a b c d :: nat
  assumes "a > 0" "b > 0" "c > 0" "d > 0"
  assumes "coprime a c" "coprime b d"
  shows "gcd (a*b) (c*d) = (gcd a d) * (gcd b c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b
0 < c
0 < d
coprime a c
coprime b d

goal (1 subgoal):
 1. gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
define q1 :: nat where "q1 = a div gcd a d"
[PROOF STATE]
proof (state)
this:
q1 = a div gcd a d

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
define q2 :: nat where "q2 = c div gcd b c"
[PROOF STATE]
proof (state)
this:
q2 = c div gcd b c

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
define q3 :: nat where "q3 = b div gcd b c"
[PROOF STATE]
proof (state)
this:
q3 = b div gcd b c

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
define q4 :: nat where "q4 = d div gcd a d"
[PROOF STATE]
proof (state)
this:
q4 = d div gcd a d

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
have "coprime q1 q2" "coprime q3 q4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime q1 q2 &&& coprime q3 q4
[PROOF STEP]
unfolding q1_def q2_def q3_def q4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (a div gcd a d) (c div gcd b c) &&& coprime (b div gcd b c) (d div gcd a d)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. coprime (a div gcd a d) (c div gcd b c)
 2. coprime (b div gcd b c) (d div gcd a d)
[PROOF STEP]
have "coprime (a div gcd a d) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (a div gcd a d) c
[PROOF STEP]
using \<open>coprime a c\<close> coprime_mult_left_iff[of "a div gcd a d" "gcd a d" c]
            dvd_mult_div_cancel[OF gcd_dvd1, of a b]
[PROOF STATE]
proof (prove)
using this:
coprime a c
coprime (a div gcd a d * gcd a d) c = (coprime (a div gcd a d) c \<and> coprime (gcd a d) c)
gcd a b * (a div gcd a b) = a

goal (1 subgoal):
 1. coprime (a div gcd a d) c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime (a div gcd a d) c

goal (2 subgoals):
 1. coprime (a div gcd a d) (c div gcd b c)
 2. coprime (b div gcd b c) (d div gcd a d)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime (a div gcd a d) c
[PROOF STEP]
show "coprime (a div gcd a d) (c div gcd b c)"
[PROOF STATE]
proof (prove)
using this:
coprime (a div gcd a d) c

goal (1 subgoal):
 1. coprime (a div gcd a d) (c div gcd b c)
[PROOF STEP]
using coprime_mult_right_iff[of "a div gcd a d" "gcd b c" "c div gcd b c"]
          dvd_div_mult_self[OF gcd_dvd2[of b c]]
[PROOF STATE]
proof (prove)
using this:
coprime (a div gcd a d) c
coprime (a div gcd a d) (gcd b c * (c div gcd b c)) = (coprime (a div gcd a d) (gcd b c) \<and> coprime (a div gcd a d) (c div gcd b c))
c div gcd b c * gcd b c = c

goal (1 subgoal):
 1. coprime (a div gcd a d) (c div gcd b c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (a div gcd a d) (c div gcd b c)

goal (1 subgoal):
 1. coprime (b div gcd b c) (d div gcd a d)
[PROOF STEP]
have "coprime (b div gcd b c) d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (b div gcd b c) d
[PROOF STEP]
using \<open>coprime b d\<close> coprime_mult_left_iff[of "b div gcd b c" "gcd b c" d]
            dvd_mult_div_cancel[OF gcd_dvd1, of a b]
[PROOF STATE]
proof (prove)
using this:
coprime b d
coprime (b div gcd b c * gcd b c) d = (coprime (b div gcd b c) d \<and> coprime (gcd b c) d)
gcd a b * (a div gcd a b) = a

goal (1 subgoal):
 1. coprime (b div gcd b c) d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime (b div gcd b c) d

goal (1 subgoal):
 1. coprime (b div gcd b c) (d div gcd a d)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime (b div gcd b c) d
[PROOF STEP]
show "coprime (b div gcd b c) (d div gcd a d)"
[PROOF STATE]
proof (prove)
using this:
coprime (b div gcd b c) d

goal (1 subgoal):
 1. coprime (b div gcd b c) (d div gcd a d)
[PROOF STEP]
using coprime_mult_right_iff[of "b div gcd b c" "gcd a d" "d div gcd a d"]
          dvd_div_mult_self[OF gcd_dvd2[of b c]]
[PROOF STATE]
proof (prove)
using this:
coprime (b div gcd b c) d
coprime (b div gcd b c) (gcd a d * (d div gcd a d)) = (coprime (b div gcd b c) (gcd a d) \<and> coprime (b div gcd b c) (d div gcd a d))
c div gcd b c * gcd b c = c

goal (1 subgoal):
 1. coprime (b div gcd b c) (d div gcd a d)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (b div gcd b c) (d div gcd a d)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime q1 q2
coprime q3 q4

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coprime q1 q2
coprime q3 q4

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
have "coprime q1 q4" "coprime q3 q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime q1 q4 &&& coprime q3 q2
[PROOF STEP]
unfolding q1_def q2_def q3_def q4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (a div gcd a d) (d div gcd a d) &&& coprime (b div gcd b c) (c div gcd b c)
[PROOF STEP]
using assms div_gcd_coprime
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b
0 < c
0 < d
coprime a c
coprime b d
?a \<noteq> (0::?'a) \<or> ?b \<noteq> (0::?'a) \<Longrightarrow> coprime (?a div gcd ?a ?b) (?b div gcd ?a ?b)

goal (1 subgoal):
 1. coprime (a div gcd a d) (d div gcd a d) &&& coprime (b div gcd b c) (c div gcd b c)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
coprime q1 q4
coprime q3 q2

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
coprime q1 q2
coprime q3 q4
coprime q1 q4
coprime q3 q2
[PROOF STEP]
have 1: "coprime (q1*q3) (q2*q4)"
[PROOF STATE]
proof (prove)
using this:
coprime q1 q2
coprime q3 q4
coprime q1 q4
coprime q3 q2

goal (1 subgoal):
 1. coprime (q1 * q3) (q2 * q4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime (q1 * q3) (q2 * q4)

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
have "gcd (a*b) (c*d) = (gcd a d) * (gcd b c) * gcd (q1*q3) (q2*q4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (a * b) (c * d) = gcd a d * gcd b c * gcd (q1 * q3) (q2 * q4)
[PROOF STEP]
unfolding q1_def q2_def q3_def q4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (a * b) (c * d) = gcd a d * gcd b c * gcd (a div gcd a d * (b div gcd b c)) (c div gcd b c * (d div gcd a d))
[PROOF STEP]
by (subst gcd_mult_distrib_nat[of "gcd a d * gcd b c"],
       simp add: field_simps,
       simp add: mult.left_commute semiring_normalization_rules(18))
[PROOF STATE]
proof (state)
this:
gcd (a * b) (c * d) = gcd a d * gcd b c * gcd (q1 * q3) (q2 * q4)

goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c; 0 < d; coprime a c; coprime b d\<rbrakk> \<Longrightarrow> gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
from this 1
[PROOF STATE]
proof (chain)
picking this:
gcd (a * b) (c * d) = gcd a d * gcd b c * gcd (q1 * q3) (q2 * q4)
coprime (q1 * q3) (q2 * q4)
[PROOF STEP]
show "gcd (a*b) (c*d) = (gcd a d) * (gcd b c)"
[PROOF STATE]
proof (prove)
using this:
gcd (a * b) (c * d) = gcd a d * gcd b c * gcd (q1 * q3) (q2 * q4)
coprime (q1 * q3) (q2 * q4)

goal (1 subgoal):
 1. gcd (a * b) (c * d) = gcd a d * gcd b c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd (a * b) (c * d) = gcd a d * gcd b c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_ennreal_0 [tendsto_intros]:
  assumes "(u \<longlongrightarrow> 0) F"
  shows "((\<lambda>n. ennreal(u n)) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. ennreal (u n)) \<longlongrightarrow> 0) F
[PROOF STEP]
unfolding ennreal_0[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. ennreal (u n)) \<longlongrightarrow> ennreal 0) F
[PROOF STEP]
by (intro tendsto_intros assms)


[STATEMENT]
lemma seq_offset_neg:
  "(f \<longlongrightarrow> l) sequentially \<Longrightarrow> ((\<lambda>i. f(i - k)) \<longlongrightarrow> l) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> l \<Longrightarrow> (\<lambda>i. f (i - k)) \<longlonglongrightarrow> l
[PROOF STEP]
apply (erule filterlim_compose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x sequentially. x - k :> sequentially
[PROOF STEP]
apply (simp add: filterlim_def le_sequentially eventually_filtermap eventually_sequentially, arith)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma keys_rbt_app: "RBT_Impl.keys (rbt_app l r) = RBT_Impl.keys l @ RBT_Impl.keys r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (rbt_app l r) = keys l @ keys r
[PROOF STEP]
by (induction l r rule: rbt_app.induct)
     (auto simp: keys_rbt_baldL keys_rbt_baldR split: RBT_Impl.rbt.splits RBT_Impl.color.splits)


[STATEMENT]
lemma rel_interior_translation:
  fixes a :: "'n::euclidean_space"
  shows "rel_interior ((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` rel_interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior ((+) a ` S) = (+) a ` rel_interior S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior ((+) a ` S) = (+) a ` rel_interior S
[PROOF STEP]
have "(\<lambda>x. (-a) + x) ` rel_interior ((\<lambda>x. a + x) ` S) \<subseteq> rel_interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior S
[PROOF STEP]
using rel_interior_translation_aux[of "-a" "(\<lambda>x. a + x) ` S"]
      translation_assoc[of "-a" "a"]
[PROOF STATE]
proof (prove)
using this:
(+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior ((+) (- a) ` (+) a ` S)
(+) (- a) ` (+) a ` ?S = (+) (a + - a) ` ?S

goal (1 subgoal):
 1. (+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior S

goal (1 subgoal):
 1. rel_interior ((+) a ` S) = (+) a ` rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior S
[PROOF STEP]
have "((\<lambda>x. a + x) ` rel_interior S) \<supseteq> rel_interior ((\<lambda>x. a + x) ` S)"
[PROOF STATE]
proof (prove)
using this:
(+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior S

goal (1 subgoal):
 1. rel_interior ((+) a ` S) \<subseteq> (+) a ` rel_interior S
[PROOF STEP]
using translation_inverse_subset[of a "rel_interior ((+) a ` S)" "rel_interior S"]
[PROOF STATE]
proof (prove)
using this:
(+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior S
(+) (- a) ` rel_interior ((+) a ` S) \<subseteq> rel_interior S \<Longrightarrow> rel_interior ((+) a ` S) \<subseteq> (+) a ` rel_interior S

goal (1 subgoal):
 1. rel_interior ((+) a ` S) \<subseteq> (+) a ` rel_interior S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior ((+) a ` S) \<subseteq> (+) a ` rel_interior S

goal (1 subgoal):
 1. rel_interior ((+) a ` S) = (+) a ` rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_interior ((+) a ` S) \<subseteq> (+) a ` rel_interior S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel_interior ((+) a ` S) \<subseteq> (+) a ` rel_interior S

goal (1 subgoal):
 1. rel_interior ((+) a ` S) = (+) a ` rel_interior S
[PROOF STEP]
using rel_interior_translation_aux[of a S]
[PROOF STATE]
proof (prove)
using this:
rel_interior ((+) a ` S) \<subseteq> (+) a ` rel_interior S
(+) a ` rel_interior S \<subseteq> rel_interior ((+) a ` S)

goal (1 subgoal):
 1. rel_interior ((+) a ` S) = (+) a ` rel_interior S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior ((+) a ` S) = (+) a ` rel_interior S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rroots3: assumes deg: "degree p = 3"
  shows "set (rroots3 p) = { x. poly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (rroots3 p) = {x. poly p x = 0}
[PROOF STEP]
unfolding rroots3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (roots3_generic solve_depressed_cubic_real p) = {x. poly p x = 0}
[PROOF STEP]
by (rule roots3_generic[OF deg solve_depressed_cubic_real])


[STATEMENT]
lemma [smt_arith_multiplication]:
  fixes A B :: real and p n :: int
  assumes "A < B" "0 < n" "p > 0"
  shows "(A / n) * p < (B / n) * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A / real_of_int n * real_of_int p < B / real_of_int n * real_of_int p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A < B
0 < n
0 < p

goal (1 subgoal):
 1. A / real_of_int n * real_of_int p < B / real_of_int n * real_of_int p
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma DERIV_compose_FDERIV:
  fixes f::"real\<Rightarrow>real"
  assumes "DERIV f (g x) :> f'"
  assumes "(g has_derivative g') (at x within s)"
  shows "((\<lambda>x. f (g x)) has_derivative (\<lambda>x. g' x * f')) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_derivative (\<lambda>x. g' x * f')) (at x within s)
[PROOF STEP]
using assms has_derivative_compose[of g g' x s f "(*) f'"]
[PROOF STATE]
proof (prove)
using this:
(f has_real_derivative f') (at (g x))
(g has_derivative g') (at x within s)
\<lbrakk>(g has_derivative g') (at x within s); (f has_derivative (*) f') (at (g x))\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_derivative (\<lambda>x. f' * g' x)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_derivative (\<lambda>x. g' x * f')) (at x within s)
[PROOF STEP]
by (auto simp: has_field_derivative_def ac_simps)


[STATEMENT]
lemma mat_of_rows_list_carrier[simp]:
  "mat_of_rows_list n vs \<in> carrier_mat (length vs) n"
  "dim_row (mat_of_rows_list n vs) = length vs"
  "dim_col (mat_of_rows_list n vs) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows_list n vs \<in> carrier_mat (length vs) n &&& dim_row (mat_of_rows_list n vs) = length vs &&& dim_col (mat_of_rows_list n vs) = n
[PROOF STEP]
unfolding mat_of_rows_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (length vs) n (\<lambda>(i, y). vs ! i ! y) \<in> carrier_mat (length vs) n &&& dim_row (mat (length vs) n (\<lambda>(i, y). vs ! i ! y)) = length vs &&& dim_col (mat (length vs) n (\<lambda>(i, y). vs ! i ! y)) = n
[PROOF STEP]
by auto