[STATEMENT]
theorem AG_AX_commute: "\<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
have "\<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G \<^bold>A\<^bold>X p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
by (rule AG_fp)
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G \<^bold>A\<^bold>X p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G \<^bold>A\<^bold>X p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
have "\<dots> = \<^bold>A\<^bold>X (p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>X p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X (p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p)
[PROOF STEP]
by (simp only: AX_int)
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>X p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X (p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p)

goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>X p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X (p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p)

goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
have "p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>G p"  (is "?lhs = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>G p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
 2. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
have "\<^bold>A\<^bold>X p \<subseteq> p \<rightarrow> \<^bold>A\<^bold>X p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>X p \<subseteq> p \<rightarrow> \<^bold>A\<^bold>X p
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>X p \<subseteq> p \<rightarrow> \<^bold>A\<^bold>X p

goal (2 subgoals):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
 2. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>X p \<subseteq> p \<rightarrow> \<^bold>A\<^bold>X p

goal (2 subgoals):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
 2. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
have "p \<inter> \<^bold>A\<^bold>G (p \<rightarrow> \<^bold>A\<^bold>X p) = \<^bold>A\<^bold>G p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<inter> \<^bold>A\<^bold>G (p \<rightarrow> \<^bold>A\<^bold>X p) = \<^bold>A\<^bold>G p
[PROOF STEP]
by (rule AG_induct)
[PROOF STATE]
proof (state)
this:
p \<inter> \<^bold>A\<^bold>G (p \<rightarrow> \<^bold>A\<^bold>X p) = \<^bold>A\<^bold>G p

goal (2 subgoals):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
 2. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p \<inter> \<^bold>A\<^bold>G (p \<rightarrow> \<^bold>A\<^bold>X p) = \<^bold>A\<^bold>G p

goal (2 subgoals):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
 2. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
note Int_mono AG_mono
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<subseteq> ?C; ?B \<subseteq> ?D\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> ?C \<inter> ?D
?p \<subseteq> ?q \<Longrightarrow> \<^bold>A\<^bold>G ?p \<subseteq> \<^bold>A\<^bold>G ?q

goal (2 subgoals):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
 2. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<subseteq> y \<Longrightarrow> p \<inter> \<^bold>A\<^bold>G x \<subseteq> p \<inter> \<^bold>A\<^bold>G y) \<Longrightarrow> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
\<lbrakk>?A \<subseteq> ?C; ?B \<subseteq> ?D\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> ?C \<inter> ?D
?p \<subseteq> ?q \<Longrightarrow> \<^bold>A\<^bold>G ?p \<subseteq> \<^bold>A\<^bold>G ?q
[PROOF STEP]
show "?lhs \<subseteq> \<^bold>A\<^bold>G p"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<subseteq> y \<Longrightarrow> p \<inter> \<^bold>A\<^bold>G x \<subseteq> p \<inter> \<^bold>A\<^bold>G y) \<Longrightarrow> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
\<lbrakk>?A \<subseteq> ?C; ?B \<subseteq> ?D\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> ?C \<inter> ?D
?p \<subseteq> ?q \<Longrightarrow> \<^bold>A\<^bold>G ?p \<subseteq> \<^bold>A\<^bold>G ?q

goal (1 subgoal):
 1. p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p \<subseteq> \<^bold>A\<^bold>G p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
have "\<^bold>A\<^bold>G p \<subseteq> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p
[PROOF STEP]
by (rule AG_fp_1)
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
have "\<^bold>A\<^bold>G p = \<^bold>A\<^bold>G \<^bold>A\<^bold>G p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G p = \<^bold>A\<^bold>G \<^bold>A\<^bold>G p
[PROOF STEP]
by (simp only: AG_AG)
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p = \<^bold>A\<^bold>G \<^bold>A\<^bold>G p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p = \<^bold>A\<^bold>G \<^bold>A\<^bold>G p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
have "\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>X p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>X p
[PROOF STEP]
by (rule AG_AX)
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>X p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>X p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
note AG_mono
[PROOF STATE]
proof (state)
this:
?p \<subseteq> ?q \<Longrightarrow> \<^bold>A\<^bold>G ?p \<subseteq> \<^bold>A\<^bold>G ?q

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<subseteq> y \<Longrightarrow> \<^bold>A\<^bold>G x \<subseteq> \<^bold>A\<^bold>G y) \<Longrightarrow> \<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
?p \<subseteq> ?q \<Longrightarrow> \<^bold>A\<^bold>G ?p \<subseteq> \<^bold>A\<^bold>G ?q
[PROOF STEP]
have "\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<subseteq> y \<Longrightarrow> \<^bold>A\<^bold>G x \<subseteq> \<^bold>A\<^bold>G y) \<Longrightarrow> \<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
?p \<subseteq> ?q \<Longrightarrow> \<^bold>A\<^bold>G ?p \<subseteq> \<^bold>A\<^bold>G ?q

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<^bold>A\<^bold>G p \<subseteq> p
\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
show "\<^bold>A\<^bold>G p \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
using this:
\<^bold>A\<^bold>G p \<subseteq> p
\<^bold>A\<^bold>G p \<subseteq> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p \<subseteq> p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<inter> \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>G p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p

goal (1 subgoal):
 1. \<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G \<^bold>A\<^bold>X p = \<^bold>A\<^bold>X \<^bold>A\<^bold>G p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complete_imp_closed:
  fixes S :: "'a::metric_space set"
  assumes "complete S"
  shows "closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S
[PROOF STEP]
proof (unfold closed_sequential_limits, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>n. x n \<in> S; x \<longlonglongrightarrow> l\<rbrakk> \<Longrightarrow> l \<in> S
[PROOF STEP]
fix f x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>n. x n \<in> S; x \<longlonglongrightarrow> l\<rbrakk> \<Longrightarrow> l \<in> S
[PROOF STEP]
assume "\<forall>n. f n \<in> S" and "f \<longlonglongrightarrow> x"
[PROOF STATE]
proof (state)
this:
\<forall>n. f n \<in> S
f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>n. x n \<in> S; x \<longlonglongrightarrow> l\<rbrakk> \<Longrightarrow> l \<in> S
[PROOF STEP]
from \<open>f \<longlonglongrightarrow> x\<close>
[PROOF STATE]
proof (chain)
picking this:
f \<longlonglongrightarrow> x
[PROOF STEP]
have "Cauchy f"
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. Cauchy f
[PROOF STEP]
by (rule LIMSEQ_imp_Cauchy)
[PROOF STATE]
proof (state)
this:
Cauchy f

goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>n. x n \<in> S; x \<longlonglongrightarrow> l\<rbrakk> \<Longrightarrow> l \<in> S
[PROOF STEP]
with \<open>complete S\<close> and \<open>\<forall>n. f n \<in> S\<close>
[PROOF STATE]
proof (chain)
picking this:
complete S
\<forall>n. f n \<in> S
Cauchy f
[PROOF STEP]
obtain l where "l \<in> S" and "f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
using this:
complete S
\<forall>n. f n \<in> S
Cauchy f

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l \<in> S; f \<longlonglongrightarrow> l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule completeE)
[PROOF STATE]
proof (state)
this:
l \<in> S
f \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>n. x n \<in> S; x \<longlonglongrightarrow> l\<rbrakk> \<Longrightarrow> l \<in> S
[PROOF STEP]
from \<open>f \<longlonglongrightarrow> x\<close> and \<open>f \<longlonglongrightarrow> l\<close>
[PROOF STATE]
proof (chain)
picking this:
f \<longlonglongrightarrow> x
f \<longlonglongrightarrow> l
[PROOF STEP]
have "x = l"
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> x
f \<longlonglongrightarrow> l

goal (1 subgoal):
 1. x = l
[PROOF STEP]
by (rule LIMSEQ_unique)
[PROOF STATE]
proof (state)
this:
x = l

goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>n. x n \<in> S; x \<longlonglongrightarrow> l\<rbrakk> \<Longrightarrow> l \<in> S
[PROOF STEP]
with \<open>l \<in> S\<close>
[PROOF STATE]
proof (chain)
picking this:
l \<in> S
x = l
[PROOF STEP]
show "x \<in> S"
[PROOF STATE]
proof (prove)
using this:
l \<in> S
x = l

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scaleR1_nonzero_eq:
  "e \<noteq> 0 \<Longrightarrow> ccw 0 (e *\<^sub>R a) b = (if e > 0 then ccw 0 a b else ccw 0 b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>e \<noteq> 0; ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
 2. \<lbrakk>e \<noteq> 0; \<not> ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
[PROOF STEP]
assume "e < 0"
[PROOF STATE]
proof (state)
this:
e < 0

goal (2 subgoals):
 1. \<lbrakk>e \<noteq> 0; ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
 2. \<lbrakk>e \<noteq> 0; \<not> ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
[PROOF STEP]
define e' where "e' = - e"
[PROOF STATE]
proof (state)
this:
e' = - e

goal (2 subgoals):
 1. \<lbrakk>e \<noteq> 0; ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
 2. \<lbrakk>e \<noteq> 0; \<not> ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
[PROOF STEP]
hence "e = -e'" "e' > 0"
[PROOF STATE]
proof (prove)
using this:
e' = - e

goal (1 subgoal):
 1. e = - e' &&& 0 < e'
[PROOF STEP]
using \<open>e < 0\<close>
[PROOF STATE]
proof (prove)
using this:
e' = - e
e < 0

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

goal (2 subgoals):
 1. \<lbrakk>e \<noteq> 0; ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
 2. \<lbrakk>e \<noteq> 0; \<not> ?P\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
e = - e'
0 < e'

goal (1 subgoal):
 1. ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)

goal (1 subgoal):
 1. \<lbrakk>e \<noteq> 0; \<not> e < 0\<rbrakk> \<Longrightarrow> ccw (0::'a) (e *\<^sub>R a) b = (if 0 < e then ccw (0::'a) a b else ccw (0::'a) b a)
[PROOF STEP]
qed simp


[STATEMENT]
lemma distinct_sorted_strict_mono_iff:
  assumes "distinct l" "sorted l"
  assumes "i<length l" "j<length l"
  shows "l!i<l!j \<longleftrightarrow> i<j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l ! i < l ! j) = (i < j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct l
sorted l
i < length l
j < length l

goal (1 subgoal):
 1. (l ! i < l ! j) = (i < j)
[PROOF STEP]
by (metis distinct_sorted_mono leI less_le_not_le
    order.strict_iff_order)


[STATEMENT]
lemma not_gr_zero_hmset[simp]: "\<not> 0 < M \<longleftrightarrow> M = 0" for M :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> 0 < M) = (M = 0)
[PROOF STEP]
using neqE not_less_zero_hmset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<noteq> ?y; ?x < ?y \<Longrightarrow> ?R; ?y < ?x \<Longrightarrow> ?R\<rbrakk> \<Longrightarrow> ?R
\<not> ?M < 0

goal (1 subgoal):
 1. (\<not> 0 < M) = (M = 0)
[PROOF STEP]
by blast


[STATEMENT]
lemma length_sort_sws_le: "length(sort_sws k xs) \<le> length xs ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (sort_sws k xs) \<le> (length xs)\<^sup>2
[PROOF STEP]
proof(induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (sort_sws k []) \<le> (length [])\<^sup>2
 2. \<And>a xs. length (sort_sws k xs) \<le> (length xs)\<^sup>2 \<Longrightarrow> length (sort_sws k (a # xs)) \<le> (length (a # xs))\<^sup>2
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
length (sort_sws k xs) \<le> (length xs)\<^sup>2

goal (2 subgoals):
 1. length (sort_sws k []) \<le> (length [])\<^sup>2
 2. \<And>a xs. length (sort_sws k xs) \<le> (length xs)\<^sup>2 \<Longrightarrow> length (sort_sws k (a # xs)) \<le> (length (a # xs))\<^sup>2
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length (sort_sws k xs) \<le> (length xs)\<^sup>2

goal (1 subgoal):
 1. length (sort_sws k (x # xs)) \<le> (length (x # xs))\<^sup>2
[PROOF STEP]
using length_ins_sws[of k x "sort_key k xs"]
[PROOF STATE]
proof (prove)
using this:
length (sort_sws k xs) \<le> (length xs)\<^sup>2
length (ins_sws k x (sort_key k xs)) \<le> length (sort_key k xs)

goal (1 subgoal):
 1. length (sort_sws k (x # xs)) \<le> (length (x # xs))\<^sup>2
[PROOF STEP]
by (simp add: numeral_eq_Suc)
[PROOF STATE]
proof (state)
this:
length (sort_sws k (x # xs)) \<le> (length (x # xs))\<^sup>2

goal (1 subgoal):
 1. length (sort_sws k []) \<le> (length [])\<^sup>2
[PROOF STEP]
qed simp


[STATEMENT]
lemma absolutely_integrable_measurable:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "S \<in> sets lebesgue"
  shows "f absolutely_integrable_on S \<longleftrightarrow> f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f absolutely_integrable_on S) = (f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)
 2. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f) \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on S

goal (2 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)
 2. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f) \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f absolutely_integrable_on S
[PROOF STEP]
have "f \<in> borel_measurable (lebesgue_on S)"
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by (simp add: absolutely_integrable_on_def integrable_imp_measurable)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (lebesgue_on S)

goal (2 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)
 2. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f) \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (lebesgue_on S)

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)
[PROOF STEP]
using assms set_integrable_norm [of lebesgue S f] L
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (lebesgue_on S)
S \<in> sets lebesgue
f absolutely_integrable_on S \<Longrightarrow> (\<lambda>x. norm (f x)) absolutely_integrable_on S
f absolutely_integrable_on S

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)
[PROOF STEP]
by (simp add: integrable_restrict_space set_integrable_def)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f) \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f) \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f) \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)

goal (1 subgoal):
 1. f absolutely_integrable_on S
[PROOF STEP]
using assms integrable_on_lebesgue_on
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (lebesgue_on S) \<and> integrable (lebesgue_on S) (norm \<circ> f)
S \<in> sets lebesgue
\<lbrakk>integrable (lebesgue_on ?S) ?f; ?S \<in> sets lebesgue\<rbrakk> \<Longrightarrow> ?f integrable_on ?S

goal (1 subgoal):
 1. f absolutely_integrable_on S
[PROOF STEP]
by (metis absolutely_integrable_integrable_bound comp_def eq_iff measurable_bounded_by_integrable_imp_integrable)
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hermitian_real_diag_decomp:
  fixes A::"complex Matrix.mat"
  assumes "A\<in> carrier_mat n n"
  and "0 < n"
  and "hermitian A"
obtains B U where "real_diag_decomp A B U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have es: "char_poly A = (\<Prod> (e :: complex) \<leftarrow> (eigvals A). [:- e, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])
[PROOF STEP]
using assms  eigvals_poly_length
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
0 < n
hermitian A
?M \<in> carrier_mat ?n ?n \<Longrightarrow> char_poly ?M = (\<Prod>a\<leftarrow>eigvals ?M. [:- a, 1:]) \<and> length (eigvals ?M) = dim_row ?M

goal (1 subgoal):
 1. char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain B U Q where us: "unitary_schur_decomposition A (eigvals A) = (B,U,Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B U Q. unitary_schur_decomposition A (eigvals A) = (B, U, Q) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "unitary_schur_decomposition A (eigvals A)")
[PROOF STATE]
proof (state)
this:
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence pr: "similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and>
      diag_mat B = (eigvals A) \<and> unitary U \<and> (\<forall>i < n. B$$(i, i) \<in> Reals)"
[PROOF STATE]
proof (prove)
using this:
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
using hermitian_eigenvalue_real assms  es
[PROOF STATE]
proof (prove)
using this:
unitary_schur_decomposition A (eigvals A) = (B, U, Q)
\<lbrakk>?A \<in> carrier_mat ?n ?n; hermitian ?A; char_poly ?A = (\<Prod>e\<leftarrow>?es. [:- e, 1:]); unitary_schur_decomposition ?A ?es = (?B, ?P, ?Q)\<rbrakk> \<Longrightarrow> similar_mat_wit ?A ?B ?P (Complex_Matrix.adjoint ?P) \<and> diagonal_mat ?B \<and> diag_mat ?B = ?es \<and> Complex_Matrix.unitary ?P \<and> (\<forall>i<?n. ?B $$ (i, i) \<in> \<real>)
A \<in> carrier_mat n n
0 < n
hermitian A
char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "dim_row B = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B = n
[PROOF STEP]
using assms similar_mat_wit_dim_row[of A]
        pr
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
0 < n
hermitian A
similar_mat_wit A ?B ?Q ?R \<Longrightarrow> dim_row ?B = dim_row A
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)

goal (1 subgoal):
 1. dim_row B = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row B = n

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
dim_row B = n
[PROOF STEP]
have "real_diag_decomp A B U"
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
dim_row B = n

goal (1 subgoal):
 1. real_diag_decomp A B U
[PROOF STEP]
using unitary_diagI[of A]
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
dim_row B = n
\<lbrakk>similar_mat_wit A ?B ?U (Complex_Matrix.adjoint ?U); diagonal_mat ?B; Complex_Matrix.unitary ?U\<rbrakk> \<Longrightarrow> unitary_diag A ?B ?U

goal (1 subgoal):
 1. real_diag_decomp A B U
[PROOF STEP]
unfolding real_diag_decomp_def
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<n. B $$ (i, i) \<in> \<real>)
dim_row B = n
\<lbrakk>similar_mat_wit A ?B ?U (Complex_Matrix.adjoint ?U); diagonal_mat ?B; Complex_Matrix.unitary ?U\<rbrakk> \<Longrightarrow> unitary_diag A ?B ?U

goal (1 subgoal):
 1. unitary_diag A B U \<and> (\<forall>i<dim_row B. B $$ (i, i) \<in> \<real>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_diag_decomp A B U

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence "\<exists> B U. real_diag_decomp A B U"
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp A B U

goal (1 subgoal):
 1. \<exists>B U. real_diag_decomp A B U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>B U. real_diag_decomp A B U

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<exists>B U. real_diag_decomp A B U

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>B U. real_diag_decomp A B U

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<exists>B U. real_diag_decomp A B U
real_diag_decomp A ?B ?U \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma analz_insert_Number [simp]:
     "analz (insert (Number N) H) = insert (Number N) (analz H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (insert (Number N) H) = insert (Number N) (analz H)
[PROOF STEP]
apply (rule analz_insert_eq_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert (Number N) H) \<Longrightarrow> x \<in> insert (Number N) (analz H)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_of_squares_nat_bound':
  fixes x y n :: nat
  assumes "x ^ 2 + y ^ 2 = n"
  shows   "y \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> n
[PROOF STEP]
using sum_of_squares_nat_bound[of y x] assms
[PROOF STATE]
proof (prove)
using this:
y\<^sup>2 + x\<^sup>2 = ?n \<Longrightarrow> y \<le> ?n
x\<^sup>2 + y\<^sup>2 = n

goal (1 subgoal):
 1. y \<le> n
[PROOF STEP]
by (simp add: add.commute)


[STATEMENT]
lemma dvd_ideal_generated_singleton':
  assumes b_dvd_a: "b dvd a"
  shows "ideal_generated {a} \<subseteq> ideal_generated {b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {a} \<subseteq> ideal_generated {b}
[PROOF STEP]
apply (simp only: ideal_generated_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k * a |k. k \<in> UNIV} \<subseteq> {k * b |k. k \<in> UNIV}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b dvd a

goal (1 subgoal):
 1. {k * a |k. k \<in> UNIV} \<subseteq> {k * b |k. k \<in> UNIV}
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. a = b * k

goal (1 subgoal):
 1. {k * a |k. k \<in> UNIV} \<subseteq> {k * b |k. k \<in> UNIV}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k ka. a = b * k \<Longrightarrow> \<exists>kb. ka * (b * k) = kb * b
[PROOF STEP]
apply (simp_all only: mult_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k ka. a = k * b \<Longrightarrow> \<exists>kb. ka * (k * b) = kb * b
[PROOF STEP]
unfolding mult_assoc[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k ka. a = k * b \<Longrightarrow> \<exists>kb. ka * k * b = kb * b
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma list_splits_append:
  "list_splits (xs @ ys) = map (\<lambda>(xs', x', ys'). (xs', x', ys' @ ys)) (list_splits xs) @
                           map (\<lambda>(xs', x', ys'). (xs @ xs', x', ys')) (list_splits ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_splits (xs @ ys) = map (\<lambda>(xs', x', ys'). (xs', x', ys' @ ys)) (list_splits xs) @ map (\<lambda>(xs', x', ys'). (xs @ xs', x', ys')) (list_splits ys)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma mod_less_diff_mod: "
  \<lbrakk> n mod m < r; r \<le> m; r \<le> (n::nat) \<rbrakk> \<Longrightarrow>
  (n - r) mod m = m + n mod m - r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n mod m < r; r \<le> m; r \<le> n\<rbrakk> \<Longrightarrow> (n - r) mod m = m + n mod m - r
[PROOF STEP]
apply (case_tac "r = m")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>n mod m < r; r \<le> m; r \<le> n; r = m\<rbrakk> \<Longrightarrow> (n - r) mod m = m + n mod m - r
 2. \<lbrakk>n mod m < r; r \<le> m; r \<le> n; r \<noteq> m\<rbrakk> \<Longrightarrow> (n - r) mod m = m + n mod m - r
[PROOF STEP]
apply (simp add: mod_diff_self2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n mod m < r; r \<le> m; r \<le> n; r \<noteq> m\<rbrakk> \<Longrightarrow> (n - r) mod m = m + n mod m - r
[PROOF STEP]
apply (simp add: mod_diff1_eq[of r n m])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mset_subseteq_add_iff2:
  "i \<le> (j::nat) \<Longrightarrow> (repeat_mset i u + m \<subseteq># repeat_mset j u + n) = (m \<subseteq># repeat_mset (j-i) u + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> (repeat_mset i u + m \<subseteq># repeat_mset j u + n) = (m \<subseteq># repeat_mset (j - i) u + n)
[PROOF STEP]
by (auto simp add: subseteq_mset_def nat_le_add_iff2)


[STATEMENT]
theorem correctness:
  assumes "v \<in> vertices"
  shows "sccs (dfs v (init_env v)) = {S . is_scc S \<and> (\<forall>n\<in>S. reachable v n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sccs (dfs v (init_env v)) = {S. is_scc S \<and> (\<forall>n\<in>S. reachable v n)}
[PROOF STEP]
using assms init_env_pre_dfs[of v]
[PROOF STATE]
proof (prove)
using this:
v \<in> vertices
pre_dfs v (init_env v)

goal (1 subgoal):
 1. sccs (dfs v (init_env v)) = {S. is_scc S \<and> (\<forall>n\<in>S. reachable v n)}
[PROOF STEP]
by (simp add: dfs_dfss_termination partial_correctness)


[STATEMENT]
lemma image_set_plus:
  assumes \<open>linear U\<close>
  shows \<open>U ` (A + B) = U ` A + U ` B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U ` (A + B) = U ` A + U ` B
[PROOF STEP]
unfolding image_def set_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>{c. \<exists>a\<in>A. \<exists>b\<in>B. c = a + b}. y = U x} = {c. \<exists>a\<in>{y. \<exists>x\<in>A. y = U x}. \<exists>b\<in>{y. \<exists>x\<in>B. y = U x}. c = a + b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
linear U

goal (1 subgoal):
 1. {y. \<exists>x\<in>{c. \<exists>a\<in>A. \<exists>b\<in>B. c = a + b}. y = U x} = {c. \<exists>a\<in>{y. \<exists>x\<in>A. y = U x}. \<exists>b\<in>{y. \<exists>x\<in>B. y = U x}. c = a + b}
[PROOF STEP]
by (force simp: linear_add)


[STATEMENT]
lemma finite_prod_map_of_rat_poly_hom:
  shows "poly (real_of_rat_poly (\<Prod>(a,b)\<in>s. f a b)) y = (\<Prod>(a,b)\<in>s. poly (real_of_rat_poly (f a b)) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rpoly (\<Prod>(a, b)\<in>s. f a b) y = (\<Prod>(a, b)\<in>s. rpoly (f a b) y)
[PROOF STEP]
apply (simp add: of_rat_poly_hom.hom_prod poly_prod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>s. rpoly (case x of (x, xa) \<Rightarrow> f x xa) y) = (\<Prod>x\<in>s. case x of (a, b) \<Rightarrow> rpoly (f a b) y)
[PROOF STEP]
by (simp add: case_prod_app prod.case_distrib)


[STATEMENT]
lemma cong_square:
  "prime p \<Longrightarrow> 0 < a \<Longrightarrow> [a * a = 1] (mod p) \<Longrightarrow> [a = 1] (mod p) \<or> [a = - 1] (mod p)"
  for a p :: "'a :: {normalization_semidom, linordered_idom, unique_euclidean_ring}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; (0::'a) < a; [a * a = 1::'a] (mod p)\<rbrakk> \<Longrightarrow> [a = 1::'a] (mod p) \<or> [a = - (1::'a)] (mod p)
[PROOF STEP]
by (auto simp add: cong_iff_dvd_diff square_diff_one_factored dest: prime_dvd_multD)


[STATEMENT]
lemma split_half_conc: "split_half xs = (ls, rs) = (xs = ls@rs \<and> length ls = (length xs + 1) div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (split_half xs = (ls, rs)) = (xs = ls @ rs \<and> length ls = (length xs + 1) div 2)
[PROOF STEP]
by force


[STATEMENT]
lemma pochhammer_fact: "fact n = pochhammer 1 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n = pochhammer (1::'a) n
[PROOF STEP]
by (simp add: pochhammer_prod fact_prod_Suc)


[STATEMENT]
lemma (in ring) add_pow_rdistr_int: \<^marker>\<open>contributor \<open>Paulo Em?lio de Vilhena\<close>\<close>
  assumes "a \<in> carrier R" "b \<in> carrier R"
  shows "a \<otimes> ([(k :: int)] \<cdot> b) = [k] \<cdot> (a \<otimes> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
proof (cases "k \<ge> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> k \<Longrightarrow> a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
 2. \<not> 0 \<le> k \<Longrightarrow> a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> k

goal (2 subgoals):
 1. 0 \<le> k \<Longrightarrow> a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
 2. \<not> 0 \<le> k \<Longrightarrow> a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> k

goal (1 subgoal):
 1. a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
using add_pow_int_ge[of k R] add_pow_rdistr[OF assms]
[PROOF STATE]
proof (prove)
using this:
0 \<le> k
0 \<le> k \<Longrightarrow> [k] \<cdot> ?a = [nat k] \<cdot> ?a
a \<otimes> [?k] \<cdot> b = [?k] \<cdot> (a \<otimes> b)

goal (1 subgoal):
 1. a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)

goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> k

goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> k

goal (1 subgoal):
 1. a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
using add_pow_int_lt[of k R b] add_pow_int_lt[of k R "a \<otimes> b"]
          add_pow_rdistr[OF assms, of "nat (- k)"] assms r_minus
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> k
k < 0 \<Longrightarrow> [k] \<cdot> b = \<ominus> ([nat (- k)] \<cdot> b)
k < 0 \<Longrightarrow> [k] \<cdot> (a \<otimes> b) = \<ominus> ([nat (- k)] \<cdot> (a \<otimes> b))
a \<otimes> [nat (- k)] \<cdot> b = [nat (- k)] \<cdot> (a \<otimes> b)
a \<in> carrier R
b \<in> carrier R
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<otimes> \<ominus> ?y = \<ominus> (?x \<otimes> ?y)

goal (1 subgoal):
 1. a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<otimes> [k] \<cdot> b = [k] \<cdot> (a \<otimes> b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LCL182_1:
 "(\<forall>A. axiom(or(not(or(A,A)),A))) &
  (\<forall>B A. axiom(or(not(A),or(B,A)))) &
  (\<forall>B A. axiom(or(not(or(A,B)),or(B,A)))) &
  (\<forall>B A C. axiom(or(not(or(A,or(B,C))),or(B,or(A,C))))) &
  (\<forall>A C B. axiom(or(not(or(not(A),B)),or(not(or(C,A)),or(C,B))))) &
  (\<forall>X. axiom(X) --> theorem(X)) &
  (\<forall>X Y. axiom(or(not(Y),X)) & theorem(Y) --> theorem(X)) &
  (\<forall>X Y Z. axiom(or(not(X),Y)) & theorem(or(not(Y),Z)) --> theorem(or(not(X),Z))) &
  (~theorem(or(not(or(not(p),q)),or(not(not(q)),not(p))))) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>A. axiom (or (not (or (A, A)), A))) \<and> (\<forall>B A. axiom (or (not A, or (B, A)))) \<and> (\<forall>B A. axiom (or (not (or (A, B)), or (B, A)))) \<and> (\<forall>B A C. axiom (or (not (or (A, or (B, C))), or (B, or (A, C))))) \<and> (\<forall>A C B. axiom (or (not (or (not A, B)), or (not (or (C, A)), or (C, B))))) \<and> (\<forall>X. axiom X \<longrightarrow> theorem X) \<and> (\<forall>X Y. axiom (or (not Y, X)) \<and> theorem Y \<longrightarrow> theorem X) \<and> (\<forall>X Y Z. axiom (or (not X, Y)) \<and> theorem (or (not Y, Z)) \<longrightarrow> theorem (or (not X, Z))) \<and> \<not> theorem (or (not (or (not p, q)), or (not (not q), not p))) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma ordering_inj:
  assumes "ordering f ord X"
      and "\<forall>a b c. (ord a b c \<longrightarrow> a \<noteq> b \<and> a \<noteq> c \<and> b \<noteq> c)"
      and "finite X \<longrightarrow> m < card X"
      and "finite X \<longrightarrow> n < card X"
      and "f m = f n"
  shows "m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = n
[PROOF STEP]
using inf_ordering_inj' finite_ordering_inj assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>infinite ?X; TernaryOrdering.ordering ?f ?ord ?X; \<forall>a b c. ?ord a b c \<longrightarrow> a \<noteq> b \<and> a \<noteq> c \<and> b \<noteq> c; ?f ?m = ?f ?n\<rbrakk> \<Longrightarrow> ?m = ?n
\<lbrakk>finite ?X; TernaryOrdering.ordering ?f ?ord ?X; \<forall>a b c. ?ord a b c \<longrightarrow> a \<noteq> b \<and> a \<noteq> c \<and> b \<noteq> c; ?m < card ?X; ?n < card ?X; ?f ?m = ?f ?n\<rbrakk> \<Longrightarrow> ?m = ?n
TernaryOrdering.ordering f ord X
\<forall>a b c. ord a b c \<longrightarrow> a \<noteq> b \<and> a \<noteq> c \<and> b \<noteq> c
finite X \<longrightarrow> m < card X
finite X \<longrightarrow> n < card X
f m = f n

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


[STATEMENT]
lemma "(x + y = x) = (y = (0::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y = x) = (y = 0)
[PROOF STEP]
by arith


[STATEMENT]
lemma osum_antisym: "\<lbrakk>antisym r; antisym r'\<rbrakk> \<Longrightarrow> antisym (r +o r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>antisym r; antisym r'\<rbrakk> \<Longrightarrow> antisym (r +o r')
[PROOF STEP]
unfolding antisym_def osum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x y. (x, y) \<in> r \<longrightarrow> (y, x) \<in> r \<longrightarrow> x = y; \<forall>x y. (x, y) \<in> r' \<longrightarrow> (y, x) \<in> r' \<longrightarrow> x = y\<rbrakk> \<Longrightarrow> \<forall>x y. (x, y) \<in> map_prod Inl Inl ` r \<union> map_prod Inr Inr ` r' \<union> {(Inl a, Inr a') |a a'. a \<in> Field r \<and> a' \<in> Field r'} \<longrightarrow> (y, x) \<in> map_prod Inl Inl ` r \<union> map_prod Inr Inr ` r' \<union> {(Inl a, Inr a') |a a'. a \<in> Field r \<and> a' \<in> Field r'} \<longrightarrow> x = y
[PROOF STEP]
by auto


[STATEMENT]
lemma cos_n_Re_cis_pow_n: "cos (real n * a) = Re (cis a ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (real n * a) = Re (cis a ^ n)
[PROOF STEP]
by (auto simp add: DeMoivre)


[STATEMENT]
lemma expands_to_add:
  "basis_wf basis \<Longrightarrow> (f expands_to F) basis \<Longrightarrow> (g expands_to G) basis \<Longrightarrow>
     ((\<lambda>x. f x + g x) expands_to F + G) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>basis_wf basis; (f expands_to F) basis; (g expands_to G) basis\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x + g x) expands_to F + G) basis
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_add elim: eventually_elim2)


[STATEMENT]
lemma zero_is_solution_homogeneous_system:
shows "0 \<in> (solution_set A 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<in> solution_set A 0
[PROOF STEP]
unfolding solution_set_def is_solution_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<in> {x. A *v x = 0}
[PROOF STEP]
using matrix_vector_mult_0_right
[PROOF STATE]
proof (prove)
using this:
?A *v 0 = 0

goal (1 subgoal):
 1. 0 \<in> {x. A *v x = 0}
[PROOF STEP]
by fast


[STATEMENT]
lemma wqo_on_trees:
  assumes "wqo_on P A"
  shows "wqo_on (tree_emb A P) (trees A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (tree_emb A P) (trees A)
[PROOF STEP]
using wqo_on_Sigma [OF assms wqo_on_UNIV, THEN kruskal_tree_tree.kruskal]
[PROOF STATE]
proof (prove)
using this:
wqo_on (kruskal_tree_tree.emb A (prod_le P (\<lambda>_ _. True))) (trees A)

goal (1 subgoal):
 1. wqo_on (tree_emb A P) (trees A)
[PROOF STEP]
by (simp add: tree_emb_def)


[STATEMENT]
lemma hcomplex_approx_iff:
  "(x \<approx> y) = (hRe x \<approx> hRe y \<and> hIm x \<approx> hIm y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<approx> y) = (hRe x \<approx> hRe y \<and> hIm x \<approx> hIm y)
[PROOF STEP]
unfolding approx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y \<in> Infinitesimal) = (hRe x - hRe y \<in> Infinitesimal \<and> hIm x - hIm y \<in> Infinitesimal)
[PROOF STEP]
by (simp add: hcomplex_Infinitesimal_iff)


[STATEMENT]
lemma dim_update_mat[simp]:
  "dim_row (A |\<^sub>m ij \<mapsto> a) = dim_row A"
  "dim_col (A |\<^sub>m ij \<mapsto> a) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (A |\<^sub>m ij \<mapsto> a) = dim_row A &&& dim_col (A |\<^sub>m ij \<mapsto> a) = dim_col A
[PROOF STEP]
unfolding update_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (dim_row A) (dim_col A) (\<lambda>ij'. if ij' = ij then a else A $$ ij')) = dim_row A &&& dim_col (mat (dim_row A) (dim_col A) (\<lambda>ij'. if ij' = ij then a else A $$ ij')) = dim_col A
[PROOF STEP]
by simp+


[STATEMENT]
lemma pos_minus_divideC_less_eq [field_simps]:
  "- (b /\<^sub>C c) < a \<longleftrightarrow> - b < c *\<^sub>C a" if "c > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (b /\<^sub>C c) < a) = (- b < c *\<^sub>C a)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. (- (b /\<^sub>C c) < a) = (- b < c *\<^sub>C a)
[PROOF STEP]
by (simp add: less_le_not_le pos_le_minus_divideC_eq pos_minus_divideC_le_eq)


[STATEMENT]
lemma iprev_atLeastAtMost: "\<lbrakk> m < t; t \<le> n \<rbrakk> \<Longrightarrow> iprev t {m..n} = t - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m < t; t \<le> n\<rbrakk> \<Longrightarrow> iprev t {m..n} = t - Suc 0
[PROOF STEP]
by (simp add: atLeastAtMost_def cut_le_Int_conv[symmetric] iprev_atLeast iprev_cut_le_conv)


[STATEMENT]
lemma all_edges_preserved: "\<lbrakk>all_edges_between A B G' = all_edges_between A B G; X \<subseteq> A; Y \<subseteq> B\<rbrakk>
    \<Longrightarrow> all_edges_between X Y G' = all_edges_between X Y G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>all_edges_between A B G' = all_edges_between A B G; X \<subseteq> A; Y \<subseteq> B\<rbrakk> \<Longrightarrow> all_edges_between X Y G' = all_edges_between X Y G
[PROOF STEP]
by (auto simp: all_edges_between_def)


[STATEMENT]
lemma map_lcp_conv: assumes "inj f" shows "(map f xs) \<and>\<^sub>p (map f ys) = map f (xs \<and>\<^sub>p ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys)
[PROOF STEP]
proof (induct xs ys rule: list_induct2', simp, simp, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys. map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys) \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
case (4 x xs y ys)
[PROOF STATE]
proof (state)
this:
map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys)

goal (1 subgoal):
 1. \<And>x xs y ys. map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys) \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys)

goal (1 subgoal):
 1. map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
proof (cases "x = y")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x = y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
 2. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x \<noteq> y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
assume "x = y"
[PROOF STATE]
proof (state)
this:
x = y

goal (2 subgoals):
 1. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x = y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
 2. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x \<noteq> y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x = y

goal (1 subgoal):
 1. map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
using "4.hyps"
[PROOF STATE]
proof (prove)
using this:
x = y
map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys)

goal (1 subgoal):
 1. map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)

goal (1 subgoal):
 1. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x \<noteq> y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x \<noteq> y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
assume "x \<noteq> y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x \<noteq> y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
hence "f x \<noteq> f y"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. f x \<noteq> f y
[PROOF STEP]
using inj_eq[OF \<open>inj f\<close>]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
(f ?x = f ?y) = (?x = ?y)

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

goal (1 subgoal):
 1. \<lbrakk>map f xs \<and>\<^sub>p map f ys = map f (xs \<and>\<^sub>p ys); x \<noteq> y\<rbrakk> \<Longrightarrow> map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
f x \<noteq> f y

goal (1 subgoal):
 1. map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
using \<open>x \<noteq> y\<close>
[PROOF STATE]
proof (prove)
using this:
f x \<noteq> f y
x \<noteq> y

goal (1 subgoal):
 1. map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map f (x # xs) \<and>\<^sub>p map f (y # ys) = map f (x # xs \<and>\<^sub>p y # ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma f_nth_set:
  "\<lbrakk> f (xs ! n) = v; n < length xs \<rbrakk> \<Longrightarrow> v \<in> f ` set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f (xs ! n) = v; n < length xs\<rbrakk> \<Longrightarrow> v \<in> f ` set xs
[PROOF STEP]
unfolding set_conv_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f (xs ! n) = v; n < length xs\<rbrakk> \<Longrightarrow> v \<in> f ` {xs ! i |i. i < length xs}
[PROOF STEP]
by auto


[STATEMENT]
lemma Max_union_Max_out:
  assumes "finite Y" and "\<forall>y \<in> Y. finite (f y)" and "\<forall>y \<in> Y. f y \<noteq> {}" and "Y \<noteq> {}"
  shows "Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union>y\<in>Y. f y)" (is "?M1=_")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
have "\<forall>y \<in> Y. \<forall>x \<in> f y. Max (f y) \<ge> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (f y)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>Y. finite (f y)

goal (1 subgoal):
 1. \<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (f y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (f y)

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (f y)

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
have "\<forall>x \<in> (\<Union>y\<in>Y. {Max (f y)}). ?M1 \<ge> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Union>y\<in>Y. {Max (f y)}. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
finite Y

goal (1 subgoal):
 1. \<forall>x\<in>\<Union>y\<in>Y. {Max (f y)}. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union>y\<in>Y. {Max (f y)}. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union>y\<in>Y. {Max (f y)}. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
have M1_in: "?M1 \<in> (\<Union>y\<in>Y. {Max (f y)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) \<in> (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
using assms(1,4) Max_in[OF finite_fMax_union]
[PROOF STATE]
proof (prove)
using this:
finite Y
Y \<noteq> {}
\<lbrakk>finite ?Y1; (\<Union>y\<in>?Y1. {Max (?f1 y)}) \<noteq> {}\<rbrakk> \<Longrightarrow> Max (\<Union>y\<in>?Y1. {Max (?f1 y)}) \<in> (\<Union>y\<in>?Y1. {Max (?f1 y)})

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) \<in> (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (f y)
\<forall>x\<in>\<Union>y\<in>Y. {Max (f y)}. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
have "\<forall>y \<in> Y. \<forall>x \<in> f y. ?M1 \<ge> x"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (f y)
\<forall>x\<in>\<Union>y\<in>Y. {Max (f y)}. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. \<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
have "\<forall>x \<in> (\<Union>y\<in>Y. f y). ?M1 \<ge> x"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>Y. \<forall>x\<in>f y. x \<le> Max (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (f ` Y). x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (f ` Y). x \<le> Max (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (f ` Y). x \<le> Max (\<Union>y\<in>Y. {Max (f y)})

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
have "?M1 \<in> (\<Union>y\<in>Y. (f y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) \<in> \<Union> (f ` Y)
[PROOF STEP]
using M1_in assms(2-4)
[PROOF STATE]
proof (prove)
using this:
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> (\<Union>y\<in>Y. {Max (f y)})
\<forall>y\<in>Y. finite (f y)
\<forall>y\<in>Y. f y \<noteq> {}
Y \<noteq> {}

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) \<in> \<Union> (f ` Y)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> \<Union> (f ` Y)

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>\<Union> (f ` Y). x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> \<Union> (f ` Y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>\<Union> (f ` Y). x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> \<Union> (f ` Y)

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
using assms(1,2) Max_eqI finite_UN_I
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>\<Union> (f ` Y). x \<le> Max (\<Union>y\<in>Y. {Max (f y)})
Max (\<Union>y\<in>Y. {Max (f y)}) \<in> \<Union> (f ` Y)
finite Y
\<forall>y\<in>Y. finite (f y)
\<lbrakk>finite ?A; \<And>y. y \<in> ?A \<Longrightarrow> y \<le> ?x; ?x \<in> ?A\<rbrakk> \<Longrightarrow> Max ?A = ?x
\<lbrakk>finite ?A; \<And>a. a \<in> ?A \<Longrightarrow> finite (?B a)\<rbrakk> \<Longrightarrow> finite (\<Union> (?B ` ?A))

goal (1 subgoal):
 1. Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lset_ldrop_subset: "lset (ldrop n xs) \<subseteq> lset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset (ldrop n xs) \<subseteq> lset xs
[PROOF STEP]
proof(induct xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ccpo.admissible lSup (\<sqsubseteq>) (\<lambda>a. \<forall>x. lset (ldrop x a) \<subseteq> lset a)
 2. \<And>n. lset (ldrop n LNil) \<subseteq> lset LNil
 3. \<And>x xs n. \<lbrakk>lfinite xs; \<And>n. lset (ldrop n xs) \<subseteq> lset xs\<rbrakk> \<Longrightarrow> lset (ldrop n (LCons x xs)) \<subseteq> lset (LCons x xs)
[PROOF STEP]
case LCons
[PROOF STATE]
proof (state)
this:
lfinite xs_
lset (ldrop ?n xs_) \<subseteq> lset xs_

goal (3 subgoals):
 1. ccpo.admissible lSup (\<sqsubseteq>) (\<lambda>a. \<forall>x. lset (ldrop x a) \<subseteq> lset a)
 2. \<And>n. lset (ldrop n LNil) \<subseteq> lset LNil
 3. \<And>x xs n. \<lbrakk>lfinite xs; \<And>n. lset (ldrop n xs) \<subseteq> lset xs\<rbrakk> \<Longrightarrow> lset (ldrop n (LCons x xs)) \<subseteq> lset (LCons x xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
lfinite xs_
lset (ldrop ?n xs_) \<subseteq> lset xs_

goal (1 subgoal):
 1. lset (ldrop n (LCons x_ xs_)) \<subseteq> lset (LCons x_ xs_)
[PROOF STEP]
by(cases n rule: co.enat.exhaust) auto
[PROOF STATE]
proof (state)
this:
lset (ldrop n (LCons x_ xs_)) \<subseteq> lset (LCons x_ xs_)

goal (2 subgoals):
 1. ccpo.admissible lSup (\<sqsubseteq>) (\<lambda>a. \<forall>x. lset (ldrop x a) \<subseteq> lset a)
 2. \<And>n. lset (ldrop n LNil) \<subseteq> lset LNil
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma calc_intersect_x_axis_positive_lemma:
  assumes "B\<^sup>2 > A\<^sup>2" and "A \<noteq> 0"
  shows "(-B + sgn B * sqrt(B\<^sup>2 - A\<^sup>2)) / A > 0 \<longleftrightarrow> -B/A > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
have "(-B + sgn B * sqrt(B\<^sup>2 - A\<^sup>2)) / A = -B / A + (sgn B * sqrt(B\<^sup>2 - A\<^sup>2)) / A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A = - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A\<^sup>2 < B\<^sup>2
A \<noteq> 0

goal (1 subgoal):
 1. (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A = - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A = - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A = - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
have "-B / A + (sgn B * sqrt(B\<^sup>2 - A\<^sup>2)) / A > 0 \<longleftrightarrow> - B / A > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)
[PROOF STEP]
using add_less_abs_positive_iff[OF calc_x_axis_intersection_positive_abs'[OF assms]]
[PROOF STATE]
proof (prove)
using this:
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)

goal (1 subgoal):
 1. (0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
hence "(B/A)\<^sup>2 > 1"
[PROOF STATE]
proof (prove)
using this:
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)

goal (1 subgoal):
 1. 1 < (B / A)\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)
A\<^sup>2 < B\<^sup>2
A \<noteq> 0

goal (1 subgoal):
 1. 1 < (B / A)\<^sup>2
[PROOF STEP]
by (simp add: power_divide)
[PROOF STATE]
proof (state)
this:
1 < (B / A)\<^sup>2

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
hence "B/A > 1 \<or> B/A < -1"
[PROOF STATE]
proof (prove)
using this:
1 < (B / A)\<^sup>2

goal (1 subgoal):
 1. 1 < B / A \<or> B / A < - 1
[PROOF STEP]
by (smt one_power2 pos2 power2_minus power_0 power_strict_decreasing zero_power2)
[PROOF STATE]
proof (state)
this:
1 < B / A \<or> B / A < - 1

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
hence "-B / A > 0 \<longleftrightarrow> -B / A > 1"
[PROOF STATE]
proof (prove)
using this:
1 < B / A \<or> B / A < - 1

goal (1 subgoal):
 1. (0 < - B / A) = (1 < - B / A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0 < - B / A) = (1 < - B / A)

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A = - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)
(0 < - B / A) = (1 < - B / A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A = - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)
(0 < - B / A) = (1 < - B / A)

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A = - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A
(0 < - B / A + sgn B * sqrt (B\<^sup>2 - A\<^sup>2) / A) = (0 < - B / A)
(0 < - B / A) = (1 < - B / A)
A\<^sup>2 < B\<^sup>2
A \<noteq> 0

goal (1 subgoal):
 1. (0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0 < (- B + sgn B * sqrt (B\<^sup>2 - A\<^sup>2)) / A) = (1 < - B / A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_less_plusL: "y < x * \<omega> \<Longrightarrow> y < x + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x * \<omega> \<Longrightarrow> y < x + y
[PROOF STEP]
apply (case_tac "x = 0", simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y < x * \<omega>; 0 < x\<rbrakk> \<Longrightarrow> y < x + y
[PROOF STEP]
apply (drule ordinal_div_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; y div x < \<omega>\<rbrakk> \<Longrightarrow> y < x + y
[PROOF STEP]
apply (drule less_omegaD, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> y < x + y
[PROOF STEP]
apply (rule_tac y="x * (1 + ordinal_of_nat n)" in order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> y < x * (1 + ordinal_of_nat n)
 2. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> x * (1 + ordinal_of_nat n) \<le> x + y
[PROOF STEP]
apply (simp add: oSuc_plus_ordinal_of_nat)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> y < x * ordinal_of_nat n + x
 2. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> x * (1 + ordinal_of_nat n) \<le> x + y
[PROOF STEP]
apply (erule subst)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. 0 < x \<Longrightarrow> y < x * (y div x) + x
 2. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> x * (1 + ordinal_of_nat n) \<le> x + y
[PROOF STEP]
apply (erule ordinal_less_times_div_plus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> x * (1 + ordinal_of_nat n) \<le> x + y
[PROOF STEP]
apply (simp add: ordinal_times_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < x; y div x = ordinal_of_nat n\<rbrakk> \<Longrightarrow> x * ordinal_of_nat n \<le> y
[PROOF STEP]
apply (erule subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 0 < x \<Longrightarrow> x * (y div x) \<le> y
[PROOF STEP]
apply (rule ordinal_times_div_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_le_abs_sinh:
  fixes x::real
  shows "abs x \<le> abs((exp x - inverse(exp x)) / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
proof (cases "0 \<le> x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
 2. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> x

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
 2. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
using real_le_x_sinh [OF True] True
[PROOF STATE]
proof (prove)
using this:
x \<le> (exp x - inverse (exp x)) / 2
0 \<le> x

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
by (simp add: abs_if)
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> x

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
have "-x \<le> (exp(-x) - inverse(exp(-x))) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x \<le> (exp (- x) - inverse (exp (- x))) / 2
[PROOF STEP]
by (meson False linear neg_le_0_iff_le real_le_x_sinh)
[PROOF STATE]
proof (state)
this:
- x \<le> (exp (- x) - inverse (exp (- x))) / 2

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- x \<le> (exp (- x) - inverse (exp (- x))) / 2

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
have "\<dots> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp (- x) - inverse (exp (- x))) / 2 \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
by (metis (no_types, opaque_lifting) abs_divide abs_le_iff abs_minus_cancel
       add.inverse_inverse exp_minus minus_diff_eq order_refl)
[PROOF STATE]
proof (state)
this:
(exp (- x) - inverse (exp (- x))) / 2 \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- x \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- x \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
- x \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
\<not> 0 \<le> x

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<le> \<bar>(exp x - inverse (exp x)) / 2\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_component_UNIV: "path_component_set UNIV x = (UNIV :: 'a::real_normed_vector set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_set UNIV x = UNIV
[PROOF STEP]
using path_connected_component_set
[PROOF STATE]
proof (prove)
using this:
path_connected ?S = (\<forall>x\<in>?S. path_component_set ?S x = ?S)

goal (1 subgoal):
 1. path_component_set UNIV x = UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma freess_app[simp]: "freess (xs @ ys) = freess xs |\<union>| freess ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freess (xs @ ys) = freess xs |\<union>| freess ys
[PROOF STEP]
unfolding freess_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ffUnion \<circ> fset_of_list \<circ> map frees) (xs @ ys) = (ffUnion \<circ> fset_of_list \<circ> map frees) xs |\<union>| (ffUnion \<circ> fset_of_list \<circ> map frees) ys
[PROOF STEP]
by simp


[STATEMENT]
lemma sq_mtx_vec_mult_diag_axis: "(\<d>\<i>\<a>\<g> i. f i) *\<^sub>V (axis i k) = axis i (f i * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<d>\<i>\<a>\<g> i. f i) *\<^sub>V axis i k = axis i (f i * k)
[PROOF STEP]
unfolding sq_mtx_diag_vec_mult axis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia. f ia * (\<chi>ia. if ia = i then k else 0) $ ia) = (\<chi>ia. if ia = i then f i * k else 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma preserves_inverse_arrows:
    assumes "A.inverse_arrows f g"
    shows "B.inverse_arrows (F f) (F g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B.inverse_arrows (F f) (F g)
[PROOF STEP]
using assms A.inverse_arrows_def B.inverse_arrows_def preserves_section_retraction
[PROOF STATE]
proof (prove)
using this:
A.inverse_arrows f g
A.inverse_arrows ?f ?g \<equiv> A.ide (?g \<cdot>\<^sub>A ?f) \<and> A.ide (?f \<cdot>\<^sub>A ?g)
B.inverse_arrows ?f ?g \<equiv> B.ide (?g \<cdot>\<^sub>B ?f) \<and> B.ide (?f \<cdot>\<^sub>B ?g)
A.ide (?e \<cdot>\<^sub>A ?m) \<Longrightarrow> B.ide (F ?e \<cdot>\<^sub>B F ?m)

goal (1 subgoal):
 1. B.inverse_arrows (F f) (F g)
[PROOF STEP]
by simp


[STATEMENT]
lemma value_eq_true: "(value_eq a b = true) = (\<exists>x y. a = Some x \<and> b = Some y \<and> x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (value_eq a b = true) = (\<exists>x y. a = Some x \<and> b = Some y \<and> x = y)
[PROOF STEP]
by (cases a; cases b, auto)


[STATEMENT]
lemma has_fps_expansion_tan [fps_expansion_intros]:
  fixes c :: "'a :: {banach, real_normed_field, field_char_0}"
  shows "(\<lambda>x. tan (c * x)) has_fps_expansion fps_tan c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. tan (c * x)) has_fps_expansion fps_tan c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. tan (c * x)) has_fps_expansion fps_tan c
[PROOF STEP]
have "(\<lambda>x. sin (c * x) / cos (c * x)) has_fps_expansion fps_sin c / fps_cos c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sin (c * x) / cos (c * x)) has_fps_expansion fps_sin c / fps_cos c
[PROOF STEP]
by (intro fps_expansion_intros) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. sin (c * x) / cos (c * x)) has_fps_expansion fps_sin c / fps_cos c

goal (1 subgoal):
 1. (\<lambda>x. tan (c * x)) has_fps_expansion fps_tan c
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. sin (c * x) / cos (c * x)) has_fps_expansion fps_sin c / fps_cos c

goal (1 subgoal):
 1. (\<lambda>x. tan (c * x)) has_fps_expansion fps_tan c
[PROOF STEP]
by (simp add: tan_def fps_tan_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. tan (c * x)) has_fps_expansion fps_tan c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_measure_meas:
  assumes "pos_meas_set E"
    and "A\<subseteq> E"
    and "A\<in> sets M"
  shows "0 \<le> \<mu> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<mu> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pos_meas_set E
A \<subseteq> E
A \<in> sets M

goal (1 subgoal):
 1. 0 \<le> \<mu> A
[PROOF STEP]
unfolding pos_meas_set_def
[PROOF STATE]
proof (prove)
using this:
E \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> E \<longrightarrow> 0 \<le> \<mu> A)
A \<subseteq> E
A \<in> sets M

goal (1 subgoal):
 1. 0 \<le> \<mu> A
[PROOF STEP]
by simp


[STATEMENT]
lemma mat_of_row_carrier[simp,intro]:
  "y \<in> carrier_vec n \<Longrightarrow> mat_of_row y \<in> carrier_mat 1 n"
  "y \<in> carrier_vec n \<Longrightarrow> mat_of_row y \<in> carrier_mat (Suc 0) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<in> carrier_vec n \<Longrightarrow> mat_of_row y \<in> carrier_mat 1 n) &&& (y \<in> carrier_vec n \<Longrightarrow> mat_of_row y \<in> carrier_mat (Suc 0) n)
[PROOF STEP]
unfolding mat_of_row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<in> carrier_vec n \<Longrightarrow> mat 1 (dim_vec y) (\<lambda>ij. y $ snd ij) \<in> carrier_mat 1 n) &&& (y \<in> carrier_vec n \<Longrightarrow> mat 1 (dim_vec y) (\<lambda>ij. y $ snd ij) \<in> carrier_mat (Suc 0) n)
[PROOF STEP]
by auto


[STATEMENT]
lemma simple_integral_null_set:
  assumes "simple_function M u" "\<And>x. 0 \<le> u x" and "N \<in> null_sets M"
  shows "(\<integral>\<^sup>Sx. u x * indicator N x \<partial>M) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = 0
[PROOF STEP]
have "AE x in M. indicator N x = (0 :: ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. indicator N x = 0
[PROOF STEP]
using \<open>N \<in> null_sets M\<close>
[PROOF STATE]
proof (prove)
using this:
N \<in> null_sets M

goal (1 subgoal):
 1. AE x in M. indicator N x = 0
[PROOF STEP]
by (auto simp: indicator_def intro!: AE_I[of _ _ N])
[PROOF STATE]
proof (state)
this:
AE x in M. indicator N x = 0

goal (1 subgoal):
 1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. indicator N x = 0
[PROOF STEP]
have "(\<integral>\<^sup>Sx. u x * indicator N x \<partial>M) = (\<integral>\<^sup>Sx. 0 \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
AE x in M. indicator N x = 0

goal (1 subgoal):
 1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = \<integral>\<^sup>S x. 0 \<partial>M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
AE x in M. indicator N x = 0
simple_function M u
0 \<le> u ?x
N \<in> null_sets M

goal (1 subgoal):
 1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = \<integral>\<^sup>S x. 0 \<partial>M
[PROOF STEP]
apply (intro simple_integral_cong_AE)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>AE x in M. indicator N x = 0; simple_function M u; \<And>x. 0 \<le> u x; N \<in> null_sets M\<rbrakk> \<Longrightarrow> simple_function M (\<lambda>x. u x * indicator N x)
 2. \<lbrakk>AE x in M. indicator N x = 0; simple_function M u; \<And>x. 0 \<le> u x; N \<in> null_sets M\<rbrakk> \<Longrightarrow> simple_function M (\<lambda>x. 0)
 3. \<lbrakk>AE x in M. indicator N x = 0; simple_function M u; \<And>x. 0 \<le> u x; N \<in> null_sets M\<rbrakk> \<Longrightarrow> AE x in M. u x * indicator N x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. u x * indicator N x \<partial>M = \<integral>\<^sup>S x. 0 \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>S x. u x * indicator N x \<partial>M = \<integral>\<^sup>S x. 0 \<partial>M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>S x. u x * indicator N x \<partial>M = \<integral>\<^sup>S x. 0 \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. u x * indicator N x \<partial>M = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_vec [continuous_intros]:
  fixes x :: "'a::euclidean_space"
  shows "isCont vec x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont vec x
[PROOF STEP]
apply (clarsimp simp add: continuous_def LIM_def dist_vec_def L2_set_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>s>0. \<forall>xa. xa \<noteq> x \<and> dist xa x < s \<longrightarrow> sqrt (real CARD('b) * (dist xa x)\<^sup>2) < r
[PROOF STEP]
apply (rule_tac x="r / sqrt (real CARD('b))" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> 0 < r / sqrt (real CARD('b)) \<and> (\<forall>xa. xa \<noteq> x \<and> dist xa x < r / sqrt (real CARD('b)) \<longrightarrow> sqrt (real CARD('b) * (dist xa x)\<^sup>2) < r)
[PROOF STEP]
by (simp add: mult.commute pos_less_divide_eq real_sqrt_mult)


[STATEMENT]
lemma im_Nset_Suc:"insert (f (Suc n)) (f ` {i. i \<le> n}) = f ` {i. i\<le>(Suc n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (f (Suc n)) (f ` {i. i \<le> n}) = f ` {i. i \<le> Suc n}
[PROOF STEP]
apply (simp add:image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (f (Suc n)) {y. \<exists>x\<le>n. y = f x} = {y. \<exists>x\<le>Suc n. y = f x}
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. insert (f (Suc n)) {y. \<exists>x\<le>n. y = f x} \<subseteq> {y. \<exists>x\<le>Suc n. y = f x}
 2. {y. \<exists>x\<le>Suc n. y = f x} \<subseteq> insert (f (Suc n)) {y. \<exists>x\<le>n. y = f x}
[PROOF STEP]
apply (rule subsetI, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x = f (Suc n) \<or> (\<exists>xa\<le>n. x = f xa) \<Longrightarrow> \<exists>xa\<le>Suc n. x = f xa
 2. {y. \<exists>x\<le>Suc n. y = f x} \<subseteq> insert (f (Suc n)) {y. \<exists>x\<le>n. y = f x}
[PROOF STEP]
apply (erule disjE, blast)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<exists>xa\<le>n. x = f xa \<Longrightarrow> \<exists>xa\<le>Suc n. x = f xa
 2. {y. \<exists>x\<le>Suc n. y = f x} \<subseteq> insert (f (Suc n)) {y. \<exists>x\<le>n. y = f x}
[PROOF STEP]
apply (erule exE, erule conjE, simp,
        frule_tac i = xa and j = n and k = "Suc n" in le_trans,
        simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>xa \<le> n; x = f xa; xa \<le> Suc n\<rbrakk> \<Longrightarrow> \<exists>x\<le>Suc n. f xa = f x
 2. {y. \<exists>x\<le>Suc n. y = f x} \<subseteq> insert (f (Suc n)) {y. \<exists>x\<le>n. y = f x}
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<le>Suc n. y = f x} \<subseteq> insert (f (Suc n)) {y. \<exists>x\<le>n. y = f x}
[PROOF STEP]
apply (rule subsetI, simp, erule exE, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>xa \<le> Suc n; x = f xa\<rbrakk> \<Longrightarrow> x = f (Suc n) \<or> (\<exists>xa\<le>n. x = f xa)
[PROOF STEP]
apply (case_tac "xa = Suc n", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>xa \<le> Suc n; x = f xa; xa \<noteq> Suc n\<rbrakk> \<Longrightarrow> x = f (Suc n) \<or> (\<exists>xa\<le>n. x = f xa)
[PROOF STEP]
apply (metis le_SucE)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in field) generate_field_is_field :
  assumes "H \<subseteq> carrier R"
  shows "field (R \<lparr> carrier := generate_field R H \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field (R\<lparr>carrier := generate_field R H\<rparr>)
[PROOF STEP]
using subfield_iff generate_field_is_subfield assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>field (R\<lparr>carrier := ?K\<rparr>); ?K \<subseteq> carrier R\<rbrakk> \<Longrightarrow> subfield ?K R
subfield ?K R \<Longrightarrow> field (R\<lparr>carrier := ?K\<rparr>)
?H \<subseteq> carrier R \<Longrightarrow> subfield (generate_field R ?H) R
H \<subseteq> carrier R

goal (1 subgoal):
 1. field (R\<lparr>carrier := generate_field R H\<rparr>)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in is_functor) Yoneda_component_components:
  shows "Yoneda_component \<FF> r u d\<lparr>ArrVal\<rparr> =
    (\<lambda>f\<in>\<^sub>\<circ>Hom \<AA> r d. \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr>\<lparr>ArrVal\<rparr>\<lparr>u\<rparr>)"
    and "Yoneda_component \<FF> r u d\<lparr>ArrDom\<rparr> = Hom \<AA> r d"
    and "Yoneda_component \<FF> r u d\<lparr>ArrCod\<rparr> = \<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Yoneda_component \<FF> r u d\<lparr>ArrVal\<rparr> = (\<lambda>f\<in>\<^sub>\<circ>Hom \<AA> r d. \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr>\<lparr>ArrVal\<rparr>\<lparr>u\<rparr>) &&& Yoneda_component \<FF> r u d\<lparr>ArrDom\<rparr> = Hom \<AA> r d &&& Yoneda_component \<FF> r u d\<lparr>ArrCod\<rparr> = \<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>
[PROOF STEP]
unfolding Yoneda_component_def arr_field_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<lambda>f\<in>\<^sub>\<circ>Hom (\<FF>\<lparr>HomDom\<rparr>) r d. \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr>\<lparr>u\<rparr>, Hom (\<FF>\<lparr>HomDom\<rparr>) r d, \<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>]\<^sub>\<circ>\<lparr>[]\<^sub>\<circ>\<rparr> = (\<lambda>f\<in>\<^sub>\<circ>Hom \<AA> r d. \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr>\<lparr>u\<rparr>) &&& [\<lambda>f\<in>\<^sub>\<circ>Hom (\<FF>\<lparr>HomDom\<rparr>) r d. \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr>\<lparr>u\<rparr>, Hom (\<FF>\<lparr>HomDom\<rparr>) r d, \<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>]\<^sub>\<circ>\<lparr>1\<^sub>\<nat>\<rparr> = Hom \<AA> r d &&& [\<lambda>f\<in>\<^sub>\<circ>Hom (\<FF>\<lparr>HomDom\<rparr>) r d. \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr>\<lparr>u\<rparr>, Hom (\<FF>\<lparr>HomDom\<rparr>) r d, \<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>]\<^sub>\<circ>\<lparr>2\<^sub>\<nat>\<rparr> = \<FF>\<lparr>ObjMap\<rparr>\<lparr>d\<rparr>
[PROOF STEP]
by (simp_all add: nat_omega_simps cat_cs_simps)


[STATEMENT]
lemma inorder_node22: "height l > 0 \<Longrightarrow>
  inorder (tree\<^sub>d (node22 l a r')) = inorder l @ a # inorder (tree\<^sub>d r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height l \<Longrightarrow> inorder (tree\<^sub>d (node22 l a r')) = inorder l @ a # inorder (tree\<^sub>d r')
[PROOF STEP]
by(induct l a r' rule: node22.induct) auto


[STATEMENT]
lemma isCont_cosh: "isCont cosh (x :: 'a :: {real_normed_field, banach})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont cosh x
[PROOF STEP]
unfolding cosh_def [abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. (exp x + exp (- x)) /\<^sub>R 2) x
[PROOF STEP]
by (auto intro!: continuous_intros)


[STATEMENT]
lemma powser_ms_aux_MSLCons:
  "powser_ms_aux (MSLCons c cs) f = MSLCons (const_expansion c, 0) (times_ms_aux f (powser_ms_aux cs f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. powser_ms_aux (MSLCons c cs) f = MSLCons (const_expansion c, 0) (times_ms_aux f (powser_ms_aux cs f))
[PROOF STEP]
by (subst powser_ms_aux.code) simp


[STATEMENT]
lemma measurable_pair_swap': "(\<lambda>(x,y). (y, x)) \<in> measurable (M1 \<Otimes>\<^sub>M M2) (M2 \<Otimes>\<^sub>M M1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). (y, x)) \<in> M1 \<Otimes>\<^sub>M M2 \<rightarrow>\<^sub>M M2 \<Otimes>\<^sub>M M1
[PROOF STEP]
by (auto intro!: measurable_Pair simp: measurable_split_conv)


[STATEMENT]
lemma det_row_sum: "det (upd_row M i (\<Sum>s\<in>S. a s)) = (\<Sum>s\<in>S. det (upd_row M i (a s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_row M i (sum a S)) = (\<Sum>s\<in>S. Square_Matrix.det (upd_row M i (a s)))
[PROOF STEP]
by (induction S rule: infinite_finite_induct) (simp_all add: det_row_0 det_row_add)


[STATEMENT]
theorem p21: "\<exists>x. p \<longrightarrow> F(x) \<Longrightarrow> \<exists>x. F(x) \<longrightarrow> p \<Longrightarrow> \<exists>x. p \<longleftrightarrow> F(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@case "p" @with
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@obtain x where "F(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@have "p \<longleftrightarrow> F(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@end
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@case "\<not>p" @with
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@obtain x where "\<not>F(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@have "p \<longleftrightarrow> F(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@end
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. p \<longrightarrow> F x; \<exists>x. F x \<longrightarrow> p\<rbrakk> \<Longrightarrow> \<exists>x. p = F x
[PROOF STEP]
@qed


[STATEMENT]
lemma kernel_of_eq_len:
  assumes "kernel_of x = kernel_of y"
  shows "length x = length y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length x = length y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length x = length y
[PROOF STEP]
have "{..<length x} = {..<length y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<length x} = {..<length y}
[PROOF STEP]
by (metis kernel_of_equiv equiv_on_unique assms)
[PROOF STATE]
proof (state)
this:
{..<length x} = {..<length y}

goal (1 subgoal):
 1. length x = length y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{..<length x} = {..<length y}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_higher_pderiv: "Polynomial.degree ((pderiv ^^ n) p) = Polynomial.degree p - n"
  for p :: "'a::{comm_semiring_1,semiring_no_zero_divisors,semiring_char_0} poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree ((pderiv ^^ n) p) = degree p - n
[PROOF STEP]
by (induction n) (auto simp: degree_pderiv)


[STATEMENT]
lemma real_ge_sup_subset: "t \<noteq> {} \<Longrightarrow> t \<subseteq> s \<Longrightarrow> \<exists>b. s *<= b \<Longrightarrow> Sup s \<ge> Sup (t::real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<noteq> {}; t \<subseteq> s; \<exists>b. s *<= b\<rbrakk> \<Longrightarrow> Sup t \<le> Sup s
[PROOF STEP]
by (rule cSup_subset_mono) (auto simp: bdd_above_setle)


[STATEMENT]
lemma eq_free_eq_subst_type_scheme:
  "(\<forall>n. n\<in>(free_tv sch) \<longrightarrow> S1 n = S2 n) \<Longrightarrow> $ S1 (sch::type_scheme) = $ S2 sch"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. n \<in> free_tv sch \<longrightarrow> S1 n = S2 n \<Longrightarrow> $ S1 sch = $ S2 sch
[PROOF STEP]
apply (rule scheme_substitutions_only_on_free_variables)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. n \<in> free_tv sch \<longrightarrow> S1 n = S2 n \<Longrightarrow> \<forall>x\<in>free_tv sch. S1 x = S2 x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma zero_in_smallomega_iff [simp]: "(\<lambda>_. 0) \<in> \<omega>[F](f) \<longleftrightarrow> eventually (\<lambda>x. f x = 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. 0::'b) \<in> \<omega>[F](f)) = (\<forall>\<^sub>F x in F. f x = (0::'b))
[PROOF STEP]
by (simp add: smallomega_iff_smallo)


[STATEMENT]
lemma fps_power_first_eq':
  assumes "a $ 1 = 1"
  shows   "a^n $ 1 = of_nat n * (a$0)^(n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a $ 1 = (1::'a)
[PROOF STEP]
have "(a ^ Suc m) $ 1 = of_nat (Suc m) * (a$0)^(Suc m - 1)"
[PROOF STATE]
proof (prove)
using this:
a $ 1 = (1::'a)

goal (1 subgoal):
 1. a ^ Suc m $ 1 = of_nat (Suc m) * (a $ 0) ^ (Suc m - 1)
[PROOF STEP]
using fps_mult_nth_1[of a]
[PROOF STATE]
proof (prove)
using this:
a $ 1 = (1::'a)
(a * ?g) $ 1 = a $ 0 * ?g $ 1 + a $ 1 * ?g $ 0

goal (1 subgoal):
 1. a ^ Suc m $ 1 = of_nat (Suc m) * (a $ 0) ^ (Suc m - 1)
[PROOF STEP]
by    (induct m)
          (simp_all add: algebra_simps mult_of_nat_commute fps_power_zeroth)
[PROOF STATE]
proof (state)
this:
a ^ Suc m $ 1 = of_nat (Suc m) * (a $ 0) ^ (Suc m - 1)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
n = Suc m
a ^ Suc m $ 1 = of_nat (Suc m) * (a $ 0) ^ (Suc m - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc m
a ^ Suc m $ 1 = of_nat (Suc m) * (a $ 0) ^ (Suc m - 1)

goal (1 subgoal):
 1. a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> a ^ n $ 1 = of_nat n * (a $ 0) ^ (n - 1)
[PROOF STEP]
qed simp