[STATEMENT]
lemma Domainp_mod_ring_rel [transfer_domain_rule]:
  "Domainp (mod_ring_rel) = (\<lambda> v. v \<in> {0 ..< p})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
fix v :: int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
assume *: "0 \<le> v" "v < p"
[PROOF STATE]
proof (state)
this:
0 \<le> v
v < p

goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
have "Domainp mod_ring_rel v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp mod_ring_rel v
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_ring_rel v ?b
[PROOF STEP]
show "mod_ring_rel v (of_int_mod_ring v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_ring_rel v (of_int_mod_ring v)
[PROOF STEP]
unfolding mod_ring_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = to_int_mod_ring (of_int_mod_ring v)
[PROOF STEP]
using * p
[PROOF STATE]
proof (prove)
using this:
0 \<le> v
v < p
p = int CARD('a)

goal (1 subgoal):
 1. v = to_int_mod_ring (of_int_mod_ring v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mod_ring_rel v (of_int_mod_ring v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Domainp mod_ring_rel v

goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?v2; ?v2 < p\<rbrakk> \<Longrightarrow> Domainp mod_ring_rel ?v2

goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?v2; ?v2 < p\<rbrakk> \<Longrightarrow> Domainp mod_ring_rel ?v2

goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})
[PROOF STEP]
by (intro ext iffI, insert range_to_int_mod_ring[where 'a = 'a] *, auto simp: mod_ring_rel_def p)
[PROOF STATE]
proof (state)
this:
Domainp mod_ring_rel = (\<lambda>v. v \<in> {0..<p})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_le:
  assumes "\<And>i. f i \<le> ((g i) :: real)"
  shows "sum f {.. (n::nat)} \<le> sum g {.. n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..n} \<le> sum g {..n}
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum f {..0} \<le> sum g {..0}
 2. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. sum f {..0} \<le> sum g {..0}
 2. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..0} \<le> sum g {..0}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f ?i \<le> g ?i

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

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
sum f {..n} \<le> sum g {..n}

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
have "sum f {..Suc n} = sum f {.. n} + f (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..Suc n} = sum f {..n} + f (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {..Suc n} = sum f {..n} + f (Suc n)

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {..Suc n} = sum f {..n} + f (Suc n)

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
have "... \<le> sum g {.. n} + f (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..n} + f (Suc n) \<le> sum g {..n} + f (Suc n)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
sum f {..n} \<le> sum g {..n}

goal (1 subgoal):
 1. sum f {..n} + f (Suc n) \<le> sum g {..n} + f (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {..n} + f (Suc n) \<le> sum g {..n} + f (Suc n)

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {..n} + f (Suc n) \<le> sum g {..n} + f (Suc n)

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
have "... \<le> sum g {.. n} + g (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g {..n} + f (Suc n) \<le> sum g {..n} + g (Suc n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f ?i \<le> g ?i

goal (1 subgoal):
 1. sum g {..n} + f (Suc n) \<le> sum g {..n} + g (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum g {..n} + f (Suc n) \<le> sum g {..n} + g (Suc n)

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum g {..n} + f (Suc n) \<le> sum g {..n} + g (Suc n)

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
have "... = sum g {.. Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g {..n} + g (Suc n) = sum g {..Suc n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum g {..n} + g (Suc n) = sum g {..Suc n}

goal (1 subgoal):
 1. \<And>n. sum f {..n} \<le> sum g {..n} \<Longrightarrow> sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum f {..Suc n} \<le> sum g {..Suc n}

goal (1 subgoal):
 1. sum f {..Suc n} \<le> sum g {..Suc n}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f {..Suc n} \<le> sum g {..Suc n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_zero_erealI:
  assumes "\<And>e. e > 0 \<Longrightarrow> eventually (\<lambda>x. \<bar>f x\<bar> < ereal e) F"
  shows   "(f \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> 0) F
[PROOF STEP]
proof (subst filterlim_cong[OF refl refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in F. f x = ?g x
 2. (?g \<longlongrightarrow> 0) F
[PROOF STEP]
from assms[OF zero_less_one]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. \<bar>f x\<bar> < ereal 1
[PROOF STEP]
show "eventually (\<lambda>x. f x = ereal (real_of_ereal (f x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. \<bar>f x\<bar> < ereal 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x = ereal (real_of_ereal (f x))
[PROOF STEP]
by eventually_elim (auto simp: ereal_real)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x = ereal (real_of_ereal (f x))

goal (1 subgoal):
 1. ((\<lambda>x. ereal (real_of_ereal (f x))) \<longlongrightarrow> 0) F
[PROOF STEP]
hence "eventually (\<lambda>x. abs (real_of_ereal (f x)) < e) F" if "e > 0" for e
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x = ereal (real_of_ereal (f x))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<bar>real_of_ereal (f x)\<bar> < e
[PROOF STEP]
using assms[OF that]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x = ereal (real_of_ereal (f x))
\<forall>\<^sub>F x in F. \<bar>f x\<bar> < ereal e

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<bar>real_of_ereal (f x)\<bar> < e
[PROOF STEP]
by eventually_elim (simp add: real_less_ereal_iff that)
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F x in F. \<bar>real_of_ereal (f x)\<bar> < ?e

goal (1 subgoal):
 1. ((\<lambda>x. ereal (real_of_ereal (f x))) \<longlongrightarrow> 0) F
[PROOF STEP]
hence "((\<lambda>x. real_of_ereal (f x)) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F x in F. \<bar>real_of_ereal (f x)\<bar> < ?e

goal (1 subgoal):
 1. ((\<lambda>x. real_of_ereal (f x)) \<longlongrightarrow> 0) F
[PROOF STEP]
unfolding tendsto_iff
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F x in F. \<bar>real_of_ereal (f x)\<bar> < ?e

goal (1 subgoal):
 1. \<forall>e>0. \<forall>\<^sub>F x in F. dist (real_of_ereal (f x)) 0 < e
[PROOF STEP]
by (auto simp: tendsto_iff dist_real_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. real_of_ereal (f x)) \<longlongrightarrow> 0) F

goal (1 subgoal):
 1. ((\<lambda>x. ereal (real_of_ereal (f x))) \<longlongrightarrow> 0) F
[PROOF STEP]
thus "((\<lambda>x. ereal (real_of_ereal (f x))) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. real_of_ereal (f x)) \<longlongrightarrow> 0) F

goal (1 subgoal):
 1. ((\<lambda>x. ereal (real_of_ereal (f x))) \<longlongrightarrow> 0) F
[PROOF STEP]
by (simp add: zero_ereal_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ereal (real_of_ereal (f x))) \<longlongrightarrow> 0) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arccos_cos_eq_abs:
  assumes "\<bar>\<theta>\<bar> \<le> pi"
  shows "arccos (cos \<theta>) = \<bar>\<theta>\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arccos (cos \<theta>) = \<bar>\<theta>\<bar>
[PROOF STEP]
unfolding arccos_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE x. 0 \<le> x \<and> x \<le> pi \<and> cos x = cos \<theta>) = \<bar>\<theta>\<bar>
[PROOF STEP]
proof (intro the_equality conjI; clarify?)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. 0 \<le> \<bar>\<theta>\<bar>
 2. \<bar>\<theta>\<bar> \<le> pi
 3. cos \<bar>\<theta>\<bar> = cos \<theta>
 4. \<And>x. \<lbrakk>0 \<le> x; x \<le> pi; cos x = cos \<theta>\<rbrakk> \<Longrightarrow> x = \<bar>\<theta>\<bar>
[PROOF STEP]
show "cos \<bar>\<theta>\<bar> = cos \<theta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos \<bar>\<theta>\<bar> = cos \<theta>
[PROOF STEP]
by (simp add: abs_real_def)
[PROOF STATE]
proof (state)
this:
cos \<bar>\<theta>\<bar> = cos \<theta>

goal (3 subgoals):
 1. 0 \<le> \<bar>\<theta>\<bar>
 2. \<bar>\<theta>\<bar> \<le> pi
 3. \<And>x. \<lbrakk>0 \<le> x; x \<le> pi; cos x = cos \<theta>\<rbrakk> \<Longrightarrow> x = \<bar>\<theta>\<bar>
[PROOF STEP]
show "x = \<bar>\<theta>\<bar>" if "cos x = cos \<theta>" "0 \<le> x" "x \<le> pi" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = \<bar>\<theta>\<bar>
[PROOF STEP]
by (simp add: \<open>cos \<bar>\<theta>\<bar> = cos \<theta>\<close> assms cos_inj_pi that)
[PROOF STATE]
proof (state)
this:
\<lbrakk>cos ?x = cos \<theta>; 0 \<le> ?x; ?x \<le> pi\<rbrakk> \<Longrightarrow> ?x = \<bar>\<theta>\<bar>

goal (2 subgoals):
 1. 0 \<le> \<bar>\<theta>\<bar>
 2. \<bar>\<theta>\<bar> \<le> pi
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma exp_approx'':
  assumes "n > 0" "0 \<le> x" "x \<le> 1"
  shows   "\<bar>exp (x::real) - (\<Sum>k\<le>n. x^k / fact k)\<bar> \<le> 1 / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
0 \<le> x
x \<le> 1
[PROOF STEP]
have "\<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> x ^ n / fact n"
[PROOF STATE]
proof (prove)
using this:
0 < n
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. \<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> x ^ n / fact n
[PROOF STEP]
by (rule exp_approx')
[PROOF STATE]
proof (state)
this:
\<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> x ^ n / fact n

goal (1 subgoal):
 1. \<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> x ^ n / fact n

goal (1 subgoal):
 1. \<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
0 \<le> x
x \<le> 1
[PROOF STEP]
have "\<dots> \<le> 1 / fact n"
[PROOF STATE]
proof (prove)
using this:
0 < n
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. x ^ n / fact n \<le> 1 / fact n
[PROOF STEP]
by (simp add: field_split_simps power_le_one)
[PROOF STATE]
proof (state)
this:
x ^ n / fact n \<le> 1 / fact n

goal (1 subgoal):
 1. \<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n

goal (1 subgoal):
 1. \<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>exp x - (\<Sum>k\<le>n. x ^ k / fact k)\<bar> \<le> 1 / fact n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma radical_sqrt_quadratic_equation:
  assumes a: "a \<in> radical_sqrt"
      and b: "b \<in> radical_sqrt"
      and c: "c \<in> radical_sqrt"
      and eq0: "a*x^2+b*x+c =0"
      and NotNull: "\<not> (a = 0 & b = 0 & c = 0)"
  shows "x \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> radical_sqrt
[PROOF STEP]
proof (cases "a=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> x \<in> radical_sqrt
 2. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> x \<in> radical_sqrt
 2. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
have "\<not> (b = 0 & c = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (b = 0 \<and> c = 0)
[PROOF STEP]
by (metis True NotNull)
[PROOF STATE]
proof (state)
this:
\<not> (b = 0 \<and> c = 0)

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> x \<in> radical_sqrt
 2. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (b = 0 \<and> c = 0)

goal (1 subgoal):
 1. x \<in> radical_sqrt
[PROOF STEP]
using b c radical_sqrt_linear_equation [of "b" "c" "x"]
[PROOF STATE]
proof (prove)
using this:
\<not> (b = 0 \<and> c = 0)
b \<in> radical_sqrt
c \<in> radical_sqrt
\<lbrakk>b \<in> radical_sqrt; c \<in> radical_sqrt; \<not> (b = 0 \<and> c = 0); b * x + c = 0\<rbrakk> \<Longrightarrow> x \<in> radical_sqrt

goal (1 subgoal):
 1. x \<in> radical_sqrt
[PROOF STEP]
by (metis True add_0 eq0 mult_zero_left)
[PROOF STATE]
proof (state)
this:
x \<in> radical_sqrt

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
hence "(2*a*x+b)^2 = 4*a*(- c)+b^2"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (2 * a * x + b)\<^sup>2 = 4 * a * - c + b\<^sup>2
[PROOF STEP]
using eq0
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
a * x\<^sup>2 + b * x + c = 0

goal (1 subgoal):
 1. (2 * a * x + b)\<^sup>2 = 4 * a * - c + b\<^sup>2
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
(2 * a * x + b)\<^sup>2 = 4 * a * - c + b\<^sup>2

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
hence "(b^2 - 4*a*c)\<ge>0 & (sqrt ((b^2 - 4*a*c)) = (2*a*x+b) | sqrt ((b^2 - 4*a*c)) = -(2*a*x+b))"
[PROOF STATE]
proof (prove)
using this:
(2 * a * x + b)\<^sup>2 = 4 * a * - c + b\<^sup>2

goal (1 subgoal):
 1. 0 \<le> b\<^sup>2 - 4 * a * c \<and> (sqrt (b\<^sup>2 - 4 * a * c) = 2 * a * x + b \<or> sqrt (b\<^sup>2 - 4 * a * c) = - (2 * a * x + b))
[PROOF STEP]
using sqrt_roots [of "2*a*x+b" "b^2 - 4*a*c"]
[PROOF STATE]
proof (prove)
using this:
(2 * a * x + b)\<^sup>2 = 4 * a * - c + b\<^sup>2
(2 * a * x + b)\<^sup>2 = b\<^sup>2 - 4 * a * c \<Longrightarrow> 0 \<le> b\<^sup>2 - 4 * a * c \<and> (sqrt (b\<^sup>2 - 4 * a * c) = 2 * a * x + b \<or> sqrt (b\<^sup>2 - 4 * a * c) = - (2 * a * x + b))

goal (1 subgoal):
 1. 0 \<le> b\<^sup>2 - 4 * a * c \<and> (sqrt (b\<^sup>2 - 4 * a * c) = 2 * a * x + b \<or> sqrt (b\<^sup>2 - 4 * a * c) = - (2 * a * x + b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> b\<^sup>2 - 4 * a * c \<and> (sqrt (b\<^sup>2 - 4 * a * c) = 2 * a * x + b \<or> sqrt (b\<^sup>2 - 4 * a * c) = - (2 * a * x + b))

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
hence l12: "b^2 - 4*a*c \<ge> 0 & ((-b + sqrt (b^2 - 4*a*c)) / (2*a) = x |
                                 (-b - sqrt (b^2 - 4*a*c)) / (2*a) = x)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> b\<^sup>2 - 4 * a * c \<and> (sqrt (b\<^sup>2 - 4 * a * c) = 2 * a * x + b \<or> sqrt (b\<^sup>2 - 4 * a * c) = - (2 * a * x + b))

goal (1 subgoal):
 1. 0 \<le> b\<^sup>2 - 4 * a * c \<and> ((- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x \<or> (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
0 \<le> b\<^sup>2 - 4 * a * c \<and> (sqrt (b\<^sup>2 - 4 * a * c) = 2 * a * x + b \<or> sqrt (b\<^sup>2 - 4 * a * c) = - (2 * a * x + b))
a \<noteq> 0

goal (1 subgoal):
 1. 0 \<le> b\<^sup>2 - 4 * a * c \<and> ((- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x \<or> (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> b\<^sup>2 - 4 * a * c \<and> ((- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x \<or> (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x)

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
have "4*a*c \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * a * c \<in> radical_sqrt
[PROOF STEP]
using a c radical_sqrt.simps
[PROOF STATE]
proof (prove)
using this:
a \<in> radical_sqrt
c \<in> radical_sqrt
(?a \<in> radical_sqrt) = ((\<exists>x. ?a = x \<and> x \<in> \<rat>) \<or> (\<exists>x. ?a = - x \<and> x \<in> radical_sqrt) \<or> (\<exists>x. ?a = 1 / x \<and> x \<in> radical_sqrt \<and> x \<noteq> 0) \<or> (\<exists>x y. ?a = x + y \<and> x \<in> radical_sqrt \<and> y \<in> radical_sqrt) \<or> (\<exists>x y. ?a = x * y \<and> x \<in> radical_sqrt \<and> y \<in> radical_sqrt) \<or> (\<exists>x. ?a = sqrt x \<and> x \<in> radical_sqrt \<and> 0 \<le> x))

goal (1 subgoal):
 1. 4 * a * c \<in> radical_sqrt
[PROOF STEP]
by (metis Rats_number_of radical_sqrt.intros(1) radical_sqrt.intros(5))
[PROOF STATE]
proof (state)
this:
4 * a * c \<in> radical_sqrt

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
hence "b^2 - 4*a*c \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
using this:
4 * a * c \<in> radical_sqrt

goal (1 subgoal):
 1. b\<^sup>2 - 4 * a * c \<in> radical_sqrt
[PROOF STEP]
using a b c
[PROOF STATE]
proof (prove)
using this:
4 * a * c \<in> radical_sqrt
a \<in> radical_sqrt
b \<in> radical_sqrt
c \<in> radical_sqrt

goal (1 subgoal):
 1. b\<^sup>2 - 4 * a * c \<in> radical_sqrt
[PROOF STEP]
by (metis power2_eq_square radical_sqrt.intros(5) radical_sqrt_rule_subtraction)
[PROOF STATE]
proof (state)
this:
b\<^sup>2 - 4 * a * c \<in> radical_sqrt

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
hence l22: "sqrt (b^2 - 4*a*c) \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
using this:
b\<^sup>2 - 4 * a * c \<in> radical_sqrt

goal (1 subgoal):
 1. sqrt (b\<^sup>2 - 4 * a * c) \<in> radical_sqrt
[PROOF STEP]
using l12
[PROOF STATE]
proof (prove)
using this:
b\<^sup>2 - 4 * a * c \<in> radical_sqrt
0 \<le> b\<^sup>2 - 4 * a * c \<and> ((- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x \<or> (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) = x)

goal (1 subgoal):
 1. sqrt (b\<^sup>2 - 4 * a * c) \<in> radical_sqrt
[PROOF STEP]
by (metis radical_sqrt.intros(6))
[PROOF STATE]
proof (state)
this:
sqrt (b\<^sup>2 - 4 * a * c) \<in> radical_sqrt

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
hence l23: "(-b + sqrt (b^2 - 4*a*c)) / (2*a) \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
using this:
sqrt (b\<^sup>2 - 4 * a * c) \<in> radical_sqrt

goal (1 subgoal):
 1. (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<in> radical_sqrt
[PROOF STEP]
using b a False
[PROOF STATE]
proof (prove)
using this:
sqrt (b\<^sup>2 - 4 * a * c) \<in> radical_sqrt
b \<in> radical_sqrt
a \<in> radical_sqrt
a \<noteq> 0

goal (1 subgoal):
 1. (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<in> radical_sqrt
[PROOF STEP]
apply (simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sqrt (b\<^sup>2 - a * (c * 4)) \<in> radical_sqrt; b \<in> radical_sqrt; a \<in> radical_sqrt; a \<noteq> 0\<rbrakk> \<Longrightarrow> (sqrt (b\<^sup>2 - a * (c * 4)) - b) / (a * 2) \<in> radical_sqrt
[PROOF STEP]
apply (metis radical_sqrt_rule_division radical_sqrt_rule_subtraction double_zero_sym mult_2_right mult_2_right radical_sqrt.intros(4))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<in> radical_sqrt

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
have "(-b - sqrt (b^2 - 4*a*c)) / (2*a) \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<in> radical_sqrt
[PROOF STEP]
using a b False l22
[PROOF STATE]
proof (prove)
using this:
a \<in> radical_sqrt
b \<in> radical_sqrt
a \<noteq> 0
sqrt (b\<^sup>2 - 4 * a * c) \<in> radical_sqrt

goal (1 subgoal):
 1. (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<in> radical_sqrt
[PROOF STEP]
by (metis div_by_0 mult_2 radical_sqrt.intros(2) radical_sqrt.intros(4) radical_sqrt_rule_division radical_sqrt_rule_subtraction)
[PROOF STATE]
proof (state)
this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<in> radical_sqrt

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<in> radical_sqrt

goal (1 subgoal):
 1. x \<in> radical_sqrt
[PROOF STEP]
by (metis l12 l23)
[PROOF STATE]
proof (state)
this:
x \<in> radical_sqrt

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma overdamped_door:
  assumes "b\<^sup>2 + a * 4 > 0" and "a < 0" and "b \<le> 0"
  shows "PRE (\<lambda>s. s$1 = 0)
  HP (LOOP open_door; (x\<acute>=((*\<^sub>V) (A a b)) & G) INV (\<lambda>s. 0 \<le> s$1))
  POST (\<lambda>s. 0 \<le> s $ 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PRE(\<lambda>s. s $ 1 = 0) HP (LOOP (\<lambda>s. {s. 0 < s $ 1 \<and> s $ 2 = 0}) ; x\<acute>=\<lambda>t. (*\<^sub>V) (A a b) & G on \<lambda>s. {t. 0 \<le> t} UNIV @ 0 INV (\<lambda>s. 0 \<le> s $ 1) ) POST \<lambda>s. 0 \<le> s $ 1
[PROOF STEP]
apply(rule fbox_loopI, simp_all add: le_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 \<le> x $ 1 \<longrightarrow> (|(\<lambda>s. {s. 0 < s $ 1 \<and> s $ 2 = 0})] |x\<acute>=\<lambda>t. (*\<^sub>V) (A a b) & G on \<lambda>s. Collect ((\<le>) 0) UNIV @ 0] (\<lambda>s. 0 \<le> s $ 1)) x
[PROOF STEP]
apply(subst local_flow.fbox_g_ode_subset[OF local_flow_mtx_hOsc[OF assms(1)]])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. a \<noteq> 0
 2. \<And>x s. s \<in> UNIV \<Longrightarrow> 0 \<in> Collect ((\<le>) 0) \<and> is_interval (Collect ((\<le>) 0)) \<and> Collect ((\<le>) 0) \<subseteq> UNIV
 3. \<forall>x. 0 \<le> x $ 1 \<longrightarrow> (|(\<lambda>s. {s. 0 < s $ 1 \<and> s $ 2 = 0})] (\<lambda>s. s \<in> UNIV \<longrightarrow> (\<forall>t\<in>Collect ((\<le>) 0). (\<forall>\<tau>\<in>down (Collect ((\<le>) 0)) t. G (((1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)), exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))], [a * exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - a * exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)), (b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))]]) *\<^sub>V s)) \<longrightarrow> 0 \<le> ((1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)), exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))], [a * exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - a * exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)), (b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))]]) *\<^sub>V s $ 1))) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < b\<^sup>2 + a * 4
a < 0
b \<le> 0

goal (3 subgoals):
 1. \<And>x. a \<noteq> 0
 2. \<And>x s. s \<in> UNIV \<Longrightarrow> 0 \<in> Collect ((\<le>) 0) \<and> is_interval (Collect ((\<le>) 0)) \<and> Collect ((\<le>) 0) \<subseteq> UNIV
 3. \<forall>x. 0 \<le> x $ 1 \<longrightarrow> (|(\<lambda>s. {s. 0 < s $ 1 \<and> s $ 2 = 0})] (\<lambda>s. s \<in> UNIV \<longrightarrow> (\<forall>t\<in>Collect ((\<le>) 0). (\<forall>\<tau>\<in>down (Collect ((\<le>) 0)) t. G (((1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)), exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))], [a * exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - a * exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)), (b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (\<tau> * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))]]) *\<^sub>V s)) \<longrightarrow> 0 \<le> ((1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)), exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))], [a * exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - a * exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2)), (b + sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b + sqrt (b\<^sup>2 + 4 * a)) / 2)) - (b - sqrt (b\<^sup>2 + 4 * a)) / 2 * exp (t * ((b - sqrt (b\<^sup>2 + 4 * a)) / 2))]]) *\<^sub>V s $ 1))) x
[PROOF STEP]
apply(simp_all add: le_fun_def fbox_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < b\<^sup>2 + a * 4; a < 0; b \<le> 0\<rbrakk> \<Longrightarrow> (\<exists>x. 0 \<le> x $ 1) \<longrightarrow> (\<forall>s'. 0 < s' $ 1 \<and> s' $ 2 = 0 \<longrightarrow> (\<forall>t\<ge>0. (\<forall>\<tau>. 0 \<le> \<tau> \<and> \<tau> \<le> t \<longrightarrow> G (((1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2, exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2)], [a * exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - a * exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2), (b + sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2]]) *\<^sub>V s')) \<longrightarrow> 0 \<le> ((1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2, exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2)], [a * exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - a * exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2), (b + sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2]]) *\<^sub>V s' $ 1))
[PROOF STEP]
unfolding sq_mtx_scaleR_eq UNIV_2 sq_mtx_vec_mult_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < b\<^sup>2 + a * 4; a < 0; b \<le> 0\<rbrakk> \<Longrightarrow> (\<exists>x. 0 \<le> x $ 1) \<longrightarrow> (\<forall>s'. 0 < s' $ 1 \<and> s' $ 2 = 0 \<longrightarrow> (\<forall>t\<ge>0. (\<forall>\<tau>. 0 \<le> \<tau> \<and> \<tau> \<le> t \<longrightarrow> G (\<chi>i. \<Sum>j\<in>insert 1 (skip 2). to_mtx (\<chi>i j. (1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2, exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2)], [a * exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - a * exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2), (b + sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (\<tau> * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2]] $$ i $ j) $$ i $ j * s' $ j)) \<longrightarrow> 0 \<le> (\<chi>i. \<Sum>j\<in>insert 1 (skip 2). to_mtx (\<chi>i j. (1 / sqrt (b\<^sup>2 + a * 4)) *\<^sub>R mtx [[(b + sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2, exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2)], [a * exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) - a * exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2), (b + sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b + sqrt (b\<^sup>2 + 4 * a)) / 2) / 2 - (b - sqrt (b\<^sup>2 + 4 * a)) * exp (t * (b - sqrt (b\<^sup>2 + 4 * a)) / 2) / 2]] $$ i $ j) $$ i $ j * s' $ j) $ 1))
[PROOF STEP]
by (clarsimp simp: overdamped_door_arith)


[STATEMENT]
lemma continuous_artanh [continuous_intros]:
  "continuous F f \<Longrightarrow> f (Lim F (\<lambda>x. x)) \<in> {-1<..<1} \<Longrightarrow> continuous F (\<lambda>x. artanh (f x :: real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; f (Lim F (\<lambda>x. x)) \<in> {- 1<..<1}\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. artanh (f x))
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F; f (Lim F (\<lambda>x. x)) \<in> {- 1<..<1}\<rbrakk> \<Longrightarrow> ((\<lambda>x. artanh (f x)) \<longlongrightarrow> artanh (f (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
by (rule tendsto_artanh) auto


[STATEMENT]
lemma inf_ifte_distrib:
  "ifte x a b \<sqinter> ifte x c d = ifte x (a \<sqinter> c) (b \<sqinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ifte x a b \<sqinter> ifte x c d = ifte x (a \<sqinter> c) (b \<sqinter> d)
[PROOF STEP]
unfolding ifte_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> a \<squnion> - x \<sqinter> b) \<sqinter> (x \<sqinter> c \<squnion> - x \<sqinter> d) = x \<sqinter> (a \<sqinter> c) \<squnion> - x \<sqinter> (b \<sqinter> d)
[PROOF STEP]
apply (simp add: inf_sup_distrib1 inf_sup_distrib2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> a \<sqinter> (x \<sqinter> c) \<squnion> - x \<sqinter> b \<sqinter> (- x \<sqinter> d) = x \<sqinter> (a \<sqinter> c) \<squnion> - x \<sqinter> (b \<sqinter> d)
[PROOF STEP]
apply (simp add: inf_sup_aci inf_compl_bot)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma basis_expansion_cart_basis'_unique: "sum (\<lambda>i. f (cart_basis' $ i) *s cart_basis' $ i) UNIV = x \<longleftrightarrow> (\<forall>i. f (cart_basis' $ i) = x$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>i\<in>UNIV. f (cart_basis' $ i) *s cart_basis' $ i) = x) = (\<forall>i. f (cart_basis' $ i) = x $ i)
[PROOF STEP]
using basis_expansion_unique
[PROOF STATE]
proof (prove)
using this:
((\<Sum>i\<in>UNIV. ?f i *s axis i (1::?'a)) = ?x) = (\<forall>i. ?f i = ?x $ i)

goal (1 subgoal):
 1. ((\<Sum>i\<in>UNIV. f (cart_basis' $ i) *s cart_basis' $ i) = x) = (\<forall>i. f (cart_basis' $ i) = x $ i)
[PROOF STEP]
unfolding cart_basis'_def
[PROOF STATE]
proof (prove)
using this:
((\<Sum>i\<in>UNIV. ?f i *s axis i (1::?'a)) = ?x) = (\<forall>i. ?f i = ?x $ i)

goal (1 subgoal):
 1. ((\<Sum>i\<in>UNIV. f ((\<chi>i. axis i (1::'c)) $ i) *s (\<chi>i. axis i (1::'a)) $ i) = x) = (\<forall>i. f ((\<chi>i. axis i (1::'c)) $ i) = x $ i)
[PROOF STEP]
by (simp add: vec_eq_iff if_distrib cong del: if_weak_cong)


[STATEMENT]
lemma [code]: "liouville_lambda n =
  (if n = 0 then 0 else if even (length (prime_factorization_nat n)) then 1 else -1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liouville_lambda n = (if n = 0 then 0::'a else if even (length (prime_factorization_nat n)) then 1::'a else - (1::'a))
[PROOF STEP]
by (auto simp: liouville_lambda_def multiset_prime_factorization_nat_correct)


[STATEMENT]
lemma iMODb_union: "
  \<lbrakk> r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c' \<rbrakk> \<Longrightarrow>
  [r, mod m, c] \<union> [r', mod m, c'] = [r, mod m, r' div m - r div m + c']"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<union> [ r', mod m, c' ] = [ r, mod m, r' div m - r div m + c' ]
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x \<in> [ r, mod m, c ] \<union> [ r', mod m, c' ]) = (x \<in> [ r, mod m, r' div m - r div m + c' ])
[PROOF STEP]
apply (simp add: iMODb_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x mod m = r' mod m \<and> r \<le> x \<and> x \<le> r + m * c \<or> x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + m * c') = (x mod m = r' mod m \<and> r \<le> x \<and> x \<le> r + m * (r' div m - r div m + c'))
[PROOF STEP]
apply (drule sym[of "r mod m"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r' \<le> r + m * c; r + m * c \<le> r' + m * c'; r' mod m = r mod m\<rbrakk> \<Longrightarrow> (x mod m = r mod m \<and> r \<le> x \<and> x \<le> r + m * c \<or> x mod m = r mod m \<and> r' \<le> x \<and> x \<le> r' + m * c') = (x mod m = r mod m \<and> r \<le> x \<and> x \<le> r + m * (r' div m - r div m + c'))
[PROOF STEP]
apply (fastforce simp: add_mult_distrib2 diff_mult_distrib2 minus_mod_eq_mult_div [symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mersenne_prime_iff: "mersenne_prime p \<longleftrightarrow> p > 2 \<and> prime (2 ^ p - 1 :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mersenne_prime p = (2 < p \<and> prime (2 ^ p - 1))
[PROOF STEP]
by (simp add: mersenne_prime_def)


[STATEMENT]
lemma radical_UNIV [simp]: "\<surd>UNIV = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<surd>UNIV = UNIV
[PROOF STEP]
by (simp add: radical_def)


[STATEMENT]
lemma mset_neg_plus[simp]:
  "mset_neg (A + B) = (mset_neg A - mset_pos B) + (mset_neg B - mset_pos A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_neg (A + B) = mset_neg A - mset_pos B + (mset_neg B - mset_pos A)
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma euclidean_dist_l2:
  fixes x y :: "'a :: euclidean_space"
  shows "dist x y = L2_set (\<lambda>i. dist (x \<bullet> i) (y \<bullet> i)) Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x y = L2_set (\<lambda>i. dist (x \<bullet> i) (y \<bullet> i)) Basis
[PROOF STEP]
unfolding dist_norm norm_eq_sqrt_inner L2_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt ((x - y) \<bullet> (x - y)) = sqrt (\<Sum>i\<in>Basis. (sqrt ((x \<bullet> i - y \<bullet> i) \<bullet> (x \<bullet> i - y \<bullet> i)))\<^sup>2)
[PROOF STEP]
by (subst euclidean_inner) (simp add: power2_eq_square inner_diff_left)


[STATEMENT]
lemma comp_group_morphisms:
  assumes "group_homomorphism \<eta> A multA oneA B multB oneB" and
"group_homomorphism \<theta> B multB oneB C multC oneC"
shows "group_homomorphism (\<theta> \<circ> \<eta> \<down> A) A multA oneA C multC oneC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_homomorphism (\<theta> \<circ> \<eta> \<down> A) A multA oneA C multC oneC
[PROOF STEP]
using assms group_homomorphism_def comp_monoid_morphisms
[PROOF STATE]
proof (prove)
using this:
group_homomorphism \<eta> A multA oneA B multB oneB
group_homomorphism \<theta> B multB oneB C multC oneC
group_homomorphism ?\<eta> ?G ?composition ?unit ?G' ?composition' ?unit' \<equiv> monoid_homomorphism ?\<eta> ?G ?composition ?unit ?G' ?composition' ?unit' \<and> Group_Theory.group ?G ?composition ?unit \<and> Group_Theory.group ?G' ?composition' ?unit'
\<lbrakk>monoid_homomorphism ?\<eta> ?A ?multA ?oneA ?B ?multB ?oneB; monoid_homomorphism ?\<theta> ?B ?multB ?oneB ?C ?multC ?oneC\<rbrakk> \<Longrightarrow> monoid_homomorphism (?\<theta> \<circ> ?\<eta> \<down> ?A) ?A ?multA ?oneA ?C ?multC ?oneC

goal (1 subgoal):
 1. group_homomorphism (\<theta> \<circ> \<eta> \<down> A) A multA oneA C multC oneC
[PROOF STEP]
by metis


[STATEMENT]
lemma reduced_row_echelon_form_def':
"reduced_row_echelon_form A =
  (
    (\<forall>i. is_zero_row i A \<longrightarrow> \<not> (\<exists>j. j>i \<and> \<not> is_zero_row j A)) \<and>
    (\<forall>i. \<not> (is_zero_row i A) \<longrightarrow> A $ i $ (LEAST k. A $ i $ k \<noteq> 0) = 1) \<and>
    (\<forall>i. i<i+1 \<and> \<not> (is_zero_row i A) \<and> \<not> (is_zero_row (i+1) A) \<longrightarrow> ((LEAST k. A $ i $ k \<noteq> 0) < (LEAST k. A $ (i+1) $ k \<noteq> 0))) \<and>
    (\<forall>i. \<not> (is_zero_row i A) \<longrightarrow> (\<forall>j. i \<noteq> j \<longrightarrow> A $ j $ (LEAST k. A $ i $ k \<noteq> 0) = 0))
  )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduced_row_echelon_form A = ((\<forall>i. is_zero_row i A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row j A)) \<and> (\<forall>i. \<not> is_zero_row i A \<longrightarrow> A $ i $ (LEAST k. A $ i $ k \<noteq> (0::'a)) = (1::'a)) \<and> (\<forall>i. i < i + (1::'c) \<and> \<not> is_zero_row i A \<and> \<not> is_zero_row (i + (1::'c)) A \<longrightarrow> (LEAST k. A $ i $ k \<noteq> (0::'a)) < (LEAST k. A $ (i + (1::'c)) $ k \<noteq> (0::'a))) \<and> (\<forall>i. \<not> is_zero_row i A \<longrightarrow> (\<forall>j. i \<noteq> j \<longrightarrow> A $ j $ (LEAST k. A $ i $ k \<noteq> (0::'a)) = (0::'a))))
[PROOF STEP]
unfolding reduced_row_echelon_form_def reduced_row_echelon_form_upt_k_def is_zero_row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>i. is_zero_row_upt_k i (ncols A) A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row_upt_k j (ncols A) A)) \<and> (\<forall>i. \<not> is_zero_row_upt_k i (ncols A) A \<longrightarrow> A $ i $ (LEAST k. A $ i $ k \<noteq> (0::'a)) = (1::'a)) \<and> (\<forall>i. i < i + (1::'c) \<and> \<not> is_zero_row_upt_k i (ncols A) A \<and> \<not> is_zero_row_upt_k (i + (1::'c)) (ncols A) A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))) \<and> (\<forall>i. \<not> is_zero_row_upt_k i (ncols A) A \<longrightarrow> (\<forall>j. i \<noteq> j \<longrightarrow> A $ j $ (LEAST n. A $ i $ n \<noteq> (0::'a)) = (0::'a)))) = ((\<forall>i. is_zero_row_upt_k i (ncols A) A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row_upt_k j (ncols A) A)) \<and> (\<forall>i. \<not> is_zero_row_upt_k i (ncols A) A \<longrightarrow> A $ i $ (LEAST k. A $ i $ k \<noteq> (0::'a)) = (1::'a)) \<and> (\<forall>i. i < i + (1::'c) \<and> \<not> is_zero_row_upt_k i (ncols A) A \<and> \<not> is_zero_row_upt_k (i + (1::'c)) (ncols A) A \<longrightarrow> (LEAST k. A $ i $ k \<noteq> (0::'a)) < (LEAST k. A $ (i + (1::'c)) $ k \<noteq> (0::'a))) \<and> (\<forall>i. \<not> is_zero_row_upt_k i (ncols A) A \<longrightarrow> (\<forall>j. i \<noteq> j \<longrightarrow> A $ j $ (LEAST k. A $ i $ k \<noteq> (0::'a)) = (0::'a))))
[PROOF STEP]
..


[STATEMENT]
lemma icard_Suc_Diff1: "x \<in> A \<Longrightarrow> eSuc (icard (A - {x})) = icard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> eSuc (icard (A - {x})) = icard A
[PROOF STEP]
apply (case_tac "finite A")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> A; finite A\<rbrakk> \<Longrightarrow> eSuc (icard (A - {x})) = icard A
 2. \<lbrakk>x \<in> A; infinite A\<rbrakk> \<Longrightarrow> eSuc (icard (A - {x})) = icard A
[PROOF STEP]
apply (simp add: icard_finite eSuc_enat in_imp_not_empty not_empty_card_gr0_conv[THEN iffD1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; infinite A\<rbrakk> \<Longrightarrow> eSuc (icard (A - {x})) = icard A
[PROOF STEP]
apply (simp add: Diff_infinite_finite[OF singleton_finite])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hcomplex_mult_hcnj: "\<And>z. z * hcnj z = hcomplex_of_hypreal ((hRe z)\<^sup>2 + (hIm z)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. z * hcnj z = hcomplex_of_hypreal ((hRe z)\<^sup>2 + (hIm z)\<^sup>2)
[PROOF STEP]
by transfer (rule complex_mult_cnj)


[STATEMENT]
lemma is_nth_power_upto_unit_conv_multiplicity:
  fixes x :: "'a :: factorial_semiring"
  assumes "n > 0"
  shows   "is_nth_power_upto_unit n x \<longleftrightarrow> (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = (0::'a) \<Longrightarrow> is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)
 2. x \<noteq> (0::'a) \<Longrightarrow> is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> (0::'a)

goal (2 subgoals):
 1. x = (0::'a) \<Longrightarrow> is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)
 2. x \<noteq> (0::'a) \<Longrightarrow> is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
fix p :: 'a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
assume p: "prime p"
[PROOF STATE]
proof (state)
this:
prime p

goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
assume "is_nth_power_upto_unit n x"
[PROOF STATE]
proof (state)
this:
is_nth_power_upto_unit n x

goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_nth_power_upto_unit n x
[PROOF STEP]
obtain u y where uy: "is_unit u" "u * x = y ^ n"
[PROOF STATE]
proof (prove)
using this:
is_nth_power_upto_unit n x

goal (1 subgoal):
 1. (\<And>u y. \<lbrakk>is_unit u; u * x = y ^ n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: is_nth_power_upto_unit_def elim!: is_nth_powerE)
[PROOF STATE]
proof (state)
this:
is_unit u
u * x = y ^ n

goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
from p uy assms False
[PROOF STATE]
proof (chain)
picking this:
prime p
is_unit u
u * x = y ^ n
0 < n
x \<noteq> (0::'a)
[PROOF STEP]
have [simp]: "y \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
prime p
is_unit u
u * x = y ^ n
0 < n
x \<noteq> (0::'a)

goal (1 subgoal):
 1. y \<noteq> (0::'a)
[PROOF STEP]
by (auto simp: power_0_left)
[PROOF STATE]
proof (state)
this:
y \<noteq> (0::'a)

goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
have "multiplicity p (u * x) = multiplicity p (y ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (u * x) = multiplicity p (y ^ n)
[PROOF STEP]
by (subst uy(2) [symmetric]) simp
[PROOF STATE]
proof (state)
this:
multiplicity p (u * x) = multiplicity p (y ^ n)

goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p (u * x) = multiplicity p (y ^ n)

goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
have "multiplicity p (u * x) = multiplicity p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (u * x) = multiplicity p x
[PROOF STEP]
by (simp add: multiplicity_times_unit_right uy(1))
[PROOF STATE]
proof (state)
this:
multiplicity p (u * x) = multiplicity p x

goal (2 subgoals):
 1. \<And>p. \<lbrakk>is_nth_power_upto_unit n x; prime p\<rbrakk> \<Longrightarrow> n dvd multiplicity p x
 2. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
multiplicity p x = multiplicity p (y ^ n)
[PROOF STEP]
show "n dvd multiplicity p x"
[PROOF STATE]
proof (prove)
using this:
multiplicity p x = multiplicity p (y ^ n)

goal (1 subgoal):
 1. n dvd multiplicity p x
[PROOF STEP]
using False and p and uy and assms
[PROOF STATE]
proof (prove)
using this:
multiplicity p x = multiplicity p (y ^ n)
x \<noteq> (0::'a)
prime p
is_unit u
u * x = y ^ n
0 < n

goal (1 subgoal):
 1. n dvd multiplicity p x
[PROOF STEP]
by (auto simp: prime_elem_multiplicity_power_distrib)
[PROOF STATE]
proof (state)
this:
n dvd multiplicity p x

goal (1 subgoal):
 1. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
assume *: "\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x"
[PROOF STATE]
proof (state)
this:
\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x

goal (1 subgoal):
 1. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
have "multiplicity p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) =
            multiplicity p x" if "prime p" for p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity p x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. multiplicity p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity p x
[PROOF STEP]
from that and *
[PROOF STATE]
proof (chain)
picking this:
prime p
\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x
[PROOF STEP]
have "n dvd multiplicity p x"
[PROOF STATE]
proof (prove)
using this:
prime p
\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x

goal (1 subgoal):
 1. n dvd multiplicity p x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n dvd multiplicity p x

goal (1 subgoal):
 1. multiplicity p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity p x
[PROOF STEP]
have "multiplicity p x = 0" if "p \<notin> prime_factors x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p x = 0
[PROOF STEP]
using that and \<open>prime p\<close>
[PROOF STATE]
proof (prove)
using this:
p \<notin> prime_factors x
prime p

goal (1 subgoal):
 1. multiplicity p x = 0
[PROOF STEP]
by (simp add: prime_factors_multiplicity)
[PROOF STATE]
proof (state)
this:
p \<notin> prime_factors x \<Longrightarrow> multiplicity p x = 0

goal (1 subgoal):
 1. multiplicity p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity p x
[PROOF STEP]
with that and * and assms
[PROOF STATE]
proof (chain)
picking this:
prime p
\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x
0 < n
p \<notin> prime_factors x \<Longrightarrow> multiplicity p x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime p
\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x
0 < n
p \<notin> prime_factors x \<Longrightarrow> multiplicity p x = 0

goal (1 subgoal):
 1. multiplicity p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity p x
[PROOF STEP]
unfolding prod_power_distrib power_mult [symmetric]
[PROOF STATE]
proof (prove)
using this:
prime p
\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x
0 < n
p \<notin> prime_factors x \<Longrightarrow> multiplicity p x = 0

goal (1 subgoal):
 1. multiplicity p (\<Prod>xa\<in>prime_factors x. xa ^ (multiplicity xa x div n * n)) = multiplicity p x
[PROOF STEP]
by (subst multiplicity_prod_prime_powers) (auto simp: in_prime_factors_imp_prime elim: dvdE)
[PROOF STATE]
proof (state)
this:
multiplicity p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity p x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
prime ?p \<Longrightarrow> multiplicity ?p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity ?p x

goal (1 subgoal):
 1. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
with assms False
[PROOF STATE]
proof (chain)
picking this:
0 < n
x \<noteq> (0::'a)
prime ?p \<Longrightarrow> multiplicity ?p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity ?p x
[PROOF STEP]
have "normalize ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = normalize x"
[PROOF STATE]
proof (prove)
using this:
0 < n
x \<noteq> (0::'a)
prime ?p \<Longrightarrow> multiplicity ?p ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = multiplicity ?p x

goal (1 subgoal):
 1. normalize ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = normalize x
[PROOF STEP]
by (intro multiplicity_eq_imp_eq) (auto simp: multiplicity_prod_prime_powers)
[PROOF STATE]
proof (state)
this:
normalize ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = normalize x

goal (1 subgoal):
 1. \<forall>p. prime p \<longrightarrow> n dvd multiplicity p x \<Longrightarrow> is_nth_power_upto_unit n x
[PROOF STEP]
thus "is_nth_power_upto_unit n x"
[PROOF STATE]
proof (prove)
using this:
normalize ((\<Prod>p\<in>prime_factors x. p ^ (multiplicity p x div n)) ^ n) = normalize x

goal (1 subgoal):
 1. is_nth_power_upto_unit n x
[PROOF STEP]
by (auto intro: is_nth_power_upto_unitI)
[PROOF STATE]
proof (state)
this:
is_nth_power_upto_unit n x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)

goal (1 subgoal):
 1. x = (0::'a) \<Longrightarrow> is_nth_power_upto_unit n x = (\<forall>p. prime p \<longrightarrow> n dvd multiplicity p x)
[PROOF STEP]
qed (use assms in \<open>auto simp: is_nth_power_upto_unit_def\<close>)


[STATEMENT]
lemma integral_empty[simp]: "integral {} f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {} f = (0::'a)
[PROOF STEP]
by (rule integral_unique) (rule has_integral_empty)


[STATEMENT]
lemma isometry_preserves_bounded:
  assumes "isometry_on X f"
          "A \<subseteq> X"
  shows "bounded (f`A) \<longleftrightarrow> bounded A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (f ` A) = bounded A
[PROOF STEP]
unfolding bounded_two_points
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>e. \<forall>x\<in>f ` A. \<forall>y\<in>f ` A. dist x y \<le> e) = (\<exists>e. \<forall>x\<in>A. \<forall>y\<in>A. dist x y \<le> e)
[PROOF STEP]
using assms(2) isometry_onD[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> X
\<lbrakk>?x \<in> X; ?y \<in> X\<rbrakk> \<Longrightarrow> dist (f ?x) (f ?y) = dist ?x ?y

goal (1 subgoal):
 1. (\<exists>e. \<forall>x\<in>f ` A. \<forall>y\<in>f ` A. dist x y \<le> e) = (\<exists>e. \<forall>x\<in>A. \<forall>y\<in>A. dist x y \<le> e)
[PROOF STEP]
by auto (metis assms(2) rev_subsetD)+


[STATEMENT]
lemma distinct_game:
  "\<lbrakk> guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g;
     inv_prize g; inv_guess g; inv_clue g \<rbrakk> \<Longrightarrow>
   {1, 2, 3} = {guess g, prize g, clue g}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; inv_prize g; inv_guess g; inv_clue g\<rbrakk> \<Longrightarrow> {1, 2, 3} = {guess g, prize g, clue g}
[PROOF STEP]
unfolding inv_prize_def inv_guess_def inv_clue_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; prize g \<in> {1, 2, 3}; guess g \<in> {1, 2, 3}; clue g \<in> {1, 2, 3}\<rbrakk> \<Longrightarrow> {1, 2, 3} = {guess g, prize g, clue g}
[PROOF STEP]
apply(rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; prize g \<in> {1, 2, 3}; guess g \<in> {1, 2, 3}; clue g \<in> {1, 2, 3}\<rbrakk> \<Longrightarrow> (x \<in> {1, 2, 3}) = (x \<in> {guess g, prize g, clue g})
[PROOF STEP]
apply(rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; prize g \<in> {1, 2, 3}; guess g \<in> {1, 2, 3}; clue g \<in> {1, 2, 3}; x \<in> {1, 2, 3}\<rbrakk> \<Longrightarrow> x \<in> {guess g, prize g, clue g}
 2. \<And>x. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; prize g \<in> {1, 2, 3}; guess g \<in> {1, 2, 3}; clue g \<in> {1, 2, 3}; x \<in> {guess g, prize g, clue g}\<rbrakk> \<Longrightarrow> x \<in> {1, 2, 3}
[PROOF STEP]
apply(clarify)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; prize g \<in> {1, 2, 3}; guess g \<in> {1, 2, 3}; clue g \<in> {1, 2, 3}; x \<in> {1, 2, 3}; x \<noteq> guess g; x \<noteq> prize g; x \<notin> {}\<rbrakk> \<Longrightarrow> x = clue g
 2. \<And>x. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; prize g \<in> {1, 2, 3}; guess g \<in> {1, 2, 3}; clue g \<in> {1, 2, 3}; x \<in> {guess g, prize g, clue g}\<rbrakk> \<Longrightarrow> x \<in> {1, 2, 3}
[PROOF STEP]
apply(metis (full_types) empty_iff insert_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>guess g \<noteq> prize g; clue g \<noteq> prize g; clue g \<noteq> guess g; prize g \<in> {1, 2, 3}; guess g \<in> {1, 2, 3}; clue g \<in> {1, 2, 3}; x \<in> {guess g, prize g, clue g}\<rbrakk> \<Longrightarrow> x \<in> {1, 2, 3}
[PROOF STEP]
apply(metis insert_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma floor_numeral_power [simp]: "\<lfloor>numeral x ^ n\<rfloor> = numeral x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>numeral x ^ n\<rfloor> = numeral x ^ n
[PROOF STEP]
by (metis floor_of_int of_int_numeral of_int_power)


[STATEMENT]
lemma INF_nat_shift: "(\<Sqinter>i\<in>{i. 0 < i}. f i) = (\<Sqinter>i. f (Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> (f ` {i::nat. (0::nat) < i}) = (\<Sqinter>i::nat. f (Suc i))
variables:
f :: nat \<Rightarrow> 'a
type variables:
'a :: Inf
[PROOF STEP]
by (metis greaterThan_0 greaterThan_def range_composition)


[STATEMENT]
lemma pmf_pair: "pmf (pair_pmf M N) (a, b) = pmf M a * pmf N b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (pair_pmf M N) (a, b) = pmf M a * pmf N b
[PROOF STEP]
unfolding pair_pmf_def pmf_bind pmf_return
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation M (\<lambda>x. measure_pmf.expectation N (\<lambda>xa. indicat_real {(a, b)} (x, xa))) = pmf M a * pmf N b
[PROOF STEP]
apply (subst integral_measure_pmf_real[where A="{b}"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. finite {b}
 2. \<And>x aa. \<lbrakk>aa \<in> set_pmf N; indicat_real {(a, b)} (x, aa) \<noteq> 0\<rbrakk> \<Longrightarrow> aa \<in> {b}
 3. measure_pmf.expectation M (\<lambda>x. \<Sum>aa\<in>{b}. indicat_real {(a, b)} (x, aa) * pmf N aa) = pmf M a * pmf N b
[PROOF STEP]
apply (auto simp: indicator_eq_0_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation M (\<lambda>x. \<Sum>a | a = b \<and> x = a. pmf N a) = pmf M a * pmf N b
[PROOF STEP]
apply (subst integral_measure_pmf_real[where A="{a}"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {a}
 2. \<And>aa. \<lbrakk>aa \<in> set_pmf M; sum (pmf N) {ab. ab = b \<and> aa = a} \<noteq> 0\<rbrakk> \<Longrightarrow> aa \<in> {a}
 3. (\<Sum>aa\<in>{a}. sum (pmf N) {ab. ab = b \<and> aa = a} * pmf M aa) = pmf M a * pmf N b
[PROOF STEP]
apply (auto simp: indicator_eq_0_iff sum_nonneg_eq_0_iff pmf_nonneg)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tan_npi [simp]: "tan (real n * pi) = 0"
  for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (real n * pi) = 0
[PROOF STEP]
by (simp add: tan_def)


[STATEMENT]
lemma filterlim_inverse_at_bot:
  "(f \<longlongrightarrow> (0 :: real)) F \<Longrightarrow> eventually (\<lambda>x. f x < 0) F \<Longrightarrow> LIM x F. inverse (f x) :> at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> 0) F; \<forall>\<^sub>F x in F. f x < 0\<rbrakk> \<Longrightarrow> LIM x F. inverse (f x) :> at_bot
[PROOF STEP]
unfolding filterlim_uminus_at_bot inverse_minus_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> 0) F; \<forall>\<^sub>F x in F. f x < 0\<rbrakk> \<Longrightarrow> LIM x F. inverse (- f x) :> at_top
[PROOF STEP]
by (rule filterlim_inverse_at_top) (simp_all add: tendsto_minus_cancel_left[symmetric])


[STATEMENT]
lemma filtermap_at_left_shift: "filtermap (\<lambda>x. x - d) (at_left a) = at_left (a - d::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap (\<lambda>x. x - d) (at_left a) = at_left (a - d)
[PROOF STEP]
by (simp add: filter_eq_iff eventually_filtermap eventually_at_filter filtermap_nhds_shift[symmetric])


[STATEMENT]
theorem undiag_diag_fatom[simp]: "nat_of_fatom (fatom_of_nat n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_fatom (fatom_of_nat n) = n
[PROOF STEP]
unfolding fatom_of_nat_def nat_of_fatom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_hatom (hatom_of_fatom (fatom_of_hatom (hatom_of_nat n))) = n
[PROOF STEP]
by auto


[STATEMENT]
lemma interior_std_simplex_nonempty:
  obtains a :: "'a::euclidean_space" where
    "a \<in> interior(convex hull (insert 0 Basis))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?D = "Basis :: 'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?a = "sum (\<lambda>b::'a. inverse (2 * real DIM('a)) *\<^sub>R b) Basis"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
fix i :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
assume i: "i \<in> Basis"
[PROOF STATE]
proof (state)
this:
i \<in> Basis

goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "?a \<bullet> i = inverse (2 * real DIM('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<bullet> i = inverse (2 * real DIM('a))
[PROOF STEP]
by (rule trans[of _ "sum (\<lambda>j. if i = j then inverse (2 * real DIM('a)) else 0) ?D"])
         (simp_all add: sum.If_cases i)
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<bullet> i = inverse (2 * real DIM('a))

goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 \<in> Basis \<Longrightarrow> (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<bullet> ?i2 = inverse (2 * real DIM('a))

goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
note ** = this
[PROOF STATE]
proof (state)
this:
?i2 \<in> Basis \<Longrightarrow> (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<bullet> ?i2 = inverse (2 * real DIM('a))

goal (1 subgoal):
 1. (\<And>a. a \<in> interior (convex hull insert (0::'a) Basis) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ?a \<in> interior (convex hull insert (0::'a) Basis)
[PROOF STEP]
show "?a \<in> interior(convex hull (insert 0 Basis))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<in> interior (convex hull insert (0::'a) Basis)
[PROOF STEP]
unfolding interior_std_simplex mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>Basis. 0 < sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis \<bullet> i) \<and> sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> Basis \<Longrightarrow> 0 < sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis \<bullet> i
 2. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
fix i :: 'a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> Basis \<Longrightarrow> 0 < sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis \<bullet> i
 2. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
assume i: "i \<in> Basis"
[PROOF STATE]
proof (state)
this:
i \<in> Basis

goal (2 subgoals):
 1. \<And>i. i \<in> Basis \<Longrightarrow> 0 < sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis \<bullet> i
 2. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
show "0 < ?a \<bullet> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<bullet> i
[PROOF STEP]
unfolding **[OF i]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < inverse (2 * real DIM('a))
[PROOF STEP]
by (auto simp add: Suc_le_eq)
[PROOF STATE]
proof (state)
this:
0 < (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<bullet> i

goal (1 subgoal):
 1. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
have "sum ((\<bullet>) ?a) ?D = sum (\<lambda>i. inverse (2 * real DIM('a))) ?D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((\<bullet>) (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a)))) Basis = (\<Sum>i\<in>Basis. inverse (2 * real DIM('a)))
[PROOF STEP]
by (auto intro: sum.cong)
[PROOF STATE]
proof (state)
this:
sum ((\<bullet>) (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a)))) Basis = (\<Sum>i\<in>Basis. inverse (2 * real DIM('a)))

goal (1 subgoal):
 1. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((\<bullet>) (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a)))) Basis = (\<Sum>i\<in>Basis. inverse (2 * real DIM('a)))

goal (1 subgoal):
 1. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
have "\<dots> < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. inverse (2 * real DIM('a))) < 1
[PROOF STEP]
unfolding sum_constant divide_inverse[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real DIM('a) / (2 * real DIM('a)) < 1
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. inverse (2 * real DIM('a))) < 1

goal (1 subgoal):
 1. sum ((\<bullet>) (sum ((*\<^sub>R) (inverse (2 * real DIM('a)))) Basis)) Basis < 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum ((\<bullet>) (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a)))) Basis < 1
[PROOF STEP]
show "sum ((\<bullet>) ?a) ?D < 1"
[PROOF STATE]
proof (prove)
using this:
sum ((\<bullet>) (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a)))) Basis < 1

goal (1 subgoal):
 1. sum ((\<bullet>) (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a)))) Basis < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ((\<bullet>) (\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a)))) Basis < 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. b /\<^sub>R (2 * real DIM('a))) \<in> interior (convex hull insert (0::'a) Basis)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vimage_vsingleton: "r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
have "{b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}

goal (1 subgoal):
 1. r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
have [simp]: "small {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
using this:
{b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}

goal (1 subgoal):
 1. small {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
by (rule smaller_than_small[OF vrange_small[of r]])
[PROOF STATE]
proof (state)
this:
small {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}

goal (1 subgoal):
 1. r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
using app_vimage_set_def
[PROOF STATE]
proof (prove)
using this:
?r `\<^sub>\<circ> ?A = set {b. \<exists>a\<in>elts ?A. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> ?r}

goal (1 subgoal):
 1. r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r `\<^sub>\<circ> set {a} = set {b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lhopital_right_at_top:
  "LIM x at_right x. (g::real \<Rightarrow> real) x :> at_top \<Longrightarrow>
    eventually (\<lambda>x. g' x \<noteq> 0) (at_right x) \<Longrightarrow>
    eventually (\<lambda>x. DERIV f x :> f' x) (at_right x) \<Longrightarrow>
    eventually (\<lambda>x. DERIV g x :> g' x) (at_right x) \<Longrightarrow>
    ((\<lambda> x. (f' x / g' x)) \<longlongrightarrow> y) (at_right x) \<Longrightarrow>
    ((\<lambda> x. f x / g x) \<longlongrightarrow> y) (at_right x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>filterlim g at_top (at_right x); \<forall>\<^sub>F x in at_right x. g' x \<noteq> 0; \<forall>\<^sub>F x in at_right x. (f has_real_derivative f' x) (at x); \<forall>\<^sub>F x in at_right x. (g has_real_derivative g' x) (at x); ((\<lambda>x. f' x / g' x) \<longlongrightarrow> y) (at_right x)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x / g x) \<longlongrightarrow> y) (at_right x)
[PROOF STEP]
unfolding eventually_at_right_to_0[of _ x] filterlim_at_right_to_0[of _ _ x] DERIV_shift
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LIM xa at_right 0. g (xa + x) :> at_top; \<forall>\<^sub>F xa in at_right 0. g' (xa + x) \<noteq> 0; \<forall>\<^sub>F xa in at_right 0. ((\<lambda>xa. f (xa + x)) has_real_derivative f' (xa + x)) (at xa); \<forall>\<^sub>F xa in at_right 0. ((\<lambda>xa. g (xa + x)) has_real_derivative g' (xa + x)) (at xa); ((\<lambda>xa. f' (xa + x) / g' (xa + x)) \<longlongrightarrow> y) (at_right 0)\<rbrakk> \<Longrightarrow> ((\<lambda>xa. f (xa + x) / g (xa + x)) \<longlongrightarrow> y) (at_right 0)
[PROOF STEP]
by (rule lhopital_right_0_at_top)


[STATEMENT]
lemma inverse_1_fds [simp]: "inverse (1 :: 'a :: field fds) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse 1 = 1
[PROOF STEP]
by (rule fds_left_inverse_unique [symmetric]) simp


[STATEMENT]
lemma rel_interior_scaleR:
  fixes S :: "'n::euclidean_space set"
  assumes "c \<noteq> 0"
  shows "((*\<^sub>R) c) ` (rel_interior S) = rel_interior (((*\<^sub>R) c) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) c ` rel_interior S = rel_interior ((*\<^sub>R) c ` S)
[PROOF STEP]
using rel_interior_injective_linear_image[of "((*\<^sub>R) c)" S]
    linear_conv_bounded_linear[of "(*\<^sub>R) c"] linear_scaleR injective_scaleR[of c] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bounded_linear ((*\<^sub>R) c); inj ((*\<^sub>R) c)\<rbrakk> \<Longrightarrow> rel_interior ((*\<^sub>R) c ` S) = (*\<^sub>R) c ` rel_interior S
linear ((*\<^sub>R) c) = bounded_linear ((*\<^sub>R) c)
linear ((*\<^sub>R) ?c)
c \<noteq> 0 \<Longrightarrow> inj ((*\<^sub>R) c)
c \<noteq> 0

goal (1 subgoal):
 1. (*\<^sub>R) c ` rel_interior S = rel_interior ((*\<^sub>R) c ` S)
[PROOF STEP]
by auto


[STATEMENT]
lemma left_commute[tts_ac_simps, tts_algebra_simps, field_simps]:
  "b \<oplus>\<^sub>a (a \<oplus>\<^sub>a c) = a \<oplus>\<^sub>a (b \<oplus>\<^sub>a c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<oplus>\<^sub>a (a \<oplus>\<^sub>a c) = a \<oplus>\<^sub>a (b \<oplus>\<^sub>a c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<oplus>\<^sub>a (a \<oplus>\<^sub>a c) = a \<oplus>\<^sub>a (b \<oplus>\<^sub>a c)
[PROOF STEP]
have "(b \<oplus>\<^sub>a a) \<oplus>\<^sub>a c = (a \<oplus>\<^sub>a b) \<oplus>\<^sub>a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<oplus>\<^sub>a a \<oplus>\<^sub>a c = a \<oplus>\<^sub>a b \<oplus>\<^sub>a c
[PROOF STEP]
by (simp add: commute)
[PROOF STATE]
proof (state)
this:
b \<oplus>\<^sub>a a \<oplus>\<^sub>a c = a \<oplus>\<^sub>a b \<oplus>\<^sub>a c

goal (1 subgoal):
 1. b \<oplus>\<^sub>a (a \<oplus>\<^sub>a c) = a \<oplus>\<^sub>a (b \<oplus>\<^sub>a c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<oplus>\<^sub>a a \<oplus>\<^sub>a c = a \<oplus>\<^sub>a b \<oplus>\<^sub>a c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<oplus>\<^sub>a a \<oplus>\<^sub>a c = a \<oplus>\<^sub>a b \<oplus>\<^sub>a c

goal (1 subgoal):
 1. b \<oplus>\<^sub>a (a \<oplus>\<^sub>a c) = a \<oplus>\<^sub>a (b \<oplus>\<^sub>a c)
[PROOF STEP]
by (simp only: assoc)
[PROOF STATE]
proof (state)
this:
b \<oplus>\<^sub>a (a \<oplus>\<^sub>a c) = a \<oplus>\<^sub>a (b \<oplus>\<^sub>a c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mpoly_coeff_Const: "MPoly_Type.coeff (Const c) m = (if m = 0 then c else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (Const c) m = (if m = 0 then c else (0::'a))
[PROOF STEP]
by (simp add: MPoly_Type.coeff_def Const.rep_eq lookup_Const\<^sub>0)


[STATEMENT]
lemma vector_sub_project_orthogonal:
  "inner b (x - scale (inner x b / (inner b b)) b) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
have f1: "\<And>b a ba. inner b (scale a ba) = cnj (a * inner ba b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b a ba. inner b (scale a ba) = cnj_class.cnj (a * inner ba b)
[PROOF STEP]
by (metis local.inner_commute local.inner_scaleR_left)
[PROOF STATE]
proof (state)
this:
inner ?b (scale ?a ?ba) = cnj_class.cnj (?a * inner ?ba ?b)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
inner ?b (scale ?a ?ba) = cnj_class.cnj (?a * inner ?ba ?b)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
assume "b \<noteq> 0"
[PROOF STATE]
proof (state)
this:
b \<noteq> (0::'b)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
hence "cnj (inner x b) = inner b x \<and> inner b b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'b)

goal (1 subgoal):
 1. cnj_class.cnj (inner x b) = inner b x \<and> inner b b \<noteq> (0::'a)
[PROOF STEP]
by (metis (no_types) local.inner_commute local.inner_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (inner x b) = inner b x \<and> inner b b \<noteq> (0::'a)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
hence "inner b (x - scale (inner x b / inner b b) b) = 0"
[PROOF STATE]
proof (prove)
using this:
cnj_class.cnj (inner x b) = inner b x \<and> inner b b \<noteq> (0::'a)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
using f1 local.inner_diff_right
[PROOF STATE]
proof (prove)
using this:
cnj_class.cnj (inner x b) = inner b x \<and> inner b b \<noteq> (0::'a)
inner ?b (scale ?a ?ba) = cnj_class.cnj (?a * inner ?ba ?b)
inner ?x (?y - ?z) = inner ?x ?y - inner ?x ?z

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
inner b (x - scale (inner x b / inner b b) b) = (0::'a)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
b \<noteq> (0::'b) \<Longrightarrow> inner b (x - scale (inner x b / inner b b) b) = (0::'a)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'b) \<Longrightarrow> inner b (x - scale (inner x b / inner b b) b) = (0::'a)

goal (1 subgoal):
 1. inner b (x - scale (inner x b / inner b b) b) = (0::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
inner b (x - scale (inner x b / inner b b) b) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_bound_max: "norm_bound A (Max {norm (A $$ (i,j)) | i j. i < dim_row A \<and> j < dim_col A})"
  (is "norm_bound A (Max ?norms)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.norm_bound A (Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
have fin: "finite ?norms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
by (simp add: finite_image_set2)
[PROOF STATE]
proof (state)
this:
finite {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
assume "i < dim_row A" and "j < dim_col A"
[PROOF STATE]
proof (state)
this:
i < dim_row A
j < dim_col A

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
hence "norm (A $$ (i,j)) \<in> ?norms"
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A

goal (1 subgoal):
 1. norm (A $$ (i, j)) \<in> {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (A $$ (i, j)) \<in> {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
from Max_ge[OF fin this]
[PROOF STATE]
proof (chain)
picking this:
norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
show "norm (A $$ (i,j)) \<le> Max ?norms"
[PROOF STATE]
proof (prove)
using this:
norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}

goal (1 subgoal):
 1. norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (A $$ (i, j)) \<le> Max {norm (A $$ (i, j)) |i j. i < dim_row A \<and> j < dim_col A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measure_return: assumes X: "X \<in> sets M" shows "measure (return M x) X = indicator X x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (return M x) X = indicat_real X x
[PROOF STEP]
unfolding measure_def emeasure_return[OF X, of x]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (indicator X x) = indicat_real X x
[PROOF STEP]
by (simp split: split_indicator)


[STATEMENT]
lemma inj_prime_power: "inj_on (\<lambda>x. fst x ^ snd x :: nat) ({a. prime a} \<times> {0<..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. fst x ^ snd x) ({a. prime a} \<times> {0<..})
[PROOF STEP]
proof (intro inj_onI, clarify, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>fst (a, b) ^ snd (a, b) = fst (aa, ba) ^ snd (aa, ba); 0 < b; prime a; 0 < ba; prime aa\<rbrakk> \<Longrightarrow> a = aa \<and> b = ba
[PROOF STEP]
case (1 p m q n)
[PROOF STATE]
proof (state)
this:
fst (p, m) ^ snd (p, m) = fst (q, n) ^ snd (q, n)
0 < m
prime p
0 < n
prime q

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>fst (a, b) ^ snd (a, b) = fst (aa, ba) ^ snd (aa, ba); 0 < b; prime a; 0 < ba; prime aa\<rbrakk> \<Longrightarrow> a = aa \<and> b = ba
[PROOF STEP]
with prime_power_eq_imp_eq[of p q m n] and 1
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>prime p; prime q; 0 < m; p ^ m = q ^ n\<rbrakk> \<Longrightarrow> p = q
fst (p, m) ^ snd (p, m) = fst (q, n) ^ snd (q, n)
0 < m
prime p
0 < n
prime q
fst (p, m) ^ snd (p, m) = fst (q, n) ^ snd (q, n)
0 < m
prime p
0 < n
prime q
[PROOF STEP]
have "p = q"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime p; prime q; 0 < m; p ^ m = q ^ n\<rbrakk> \<Longrightarrow> p = q
fst (p, m) ^ snd (p, m) = fst (q, n) ^ snd (q, n)
0 < m
prime p
0 < n
prime q
fst (p, m) ^ snd (p, m) = fst (q, n) ^ snd (q, n)
0 < m
prime p
0 < n
prime q

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

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>fst (a, b) ^ snd (a, b) = fst (aa, ba) ^ snd (aa, ba); 0 < b; prime a; 0 < ba; prime aa\<rbrakk> \<Longrightarrow> a = aa \<and> b = ba
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p = q

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>fst (a, b) ^ snd (a, b) = fst (aa, ba) ^ snd (aa, ba); 0 < b; prime a; 0 < ba; prime aa\<rbrakk> \<Longrightarrow> a = aa \<and> b = ba
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
p = q
[PROOF STEP]
have "m = n"
[PROOF STATE]
proof (prove)
using this:
p = q

goal (1 subgoal):
 1. m = n
[PROOF STEP]
using prime_gt_1_nat 1
[PROOF STATE]
proof (prove)
using this:
p = q
prime ?p \<Longrightarrow> 1 < ?p
fst (p, m) ^ snd (p, m) = fst (q, n) ^ snd (q, n)
0 < m
prime p
0 < n
prime q

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

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>fst (a, b) ^ snd (a, b) = fst (aa, ba) ^ snd (aa, ba); 0 < b; prime a; 0 < ba; prime aa\<rbrakk> \<Longrightarrow> a = aa \<and> b = ba
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p = q
m = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p = q
m = n

goal (1 subgoal):
 1. p = q \<and> m = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = q \<and> m = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lzip_eq_LCons_conv:
  "lzip xs ys = LCons z zs \<longleftrightarrow>
   (\<exists>x xs' y ys'. xs = LCons x xs' \<and> ys = LCons y ys' \<and> z = (x, y) \<and> zs = lzip xs' ys')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lzip xs ys = LCons z zs) = (\<exists>x xs' y ys'. xs = LCons x xs' \<and> ys = LCons y ys' \<and> z = (x, y) \<and> zs = lzip xs' ys')
[PROOF STEP]
by(cases xs ys rule: llist.exhaust[case_product llist.exhaust]) auto


[STATEMENT]
lemma rel_mset_Plus:
  assumes ab: "R a b"
    and MN: "rel_mset R M N"
  shows "rel_mset R (add_mset a M) (add_mset b N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_mset R (add_mset a M) (add_mset b N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_mset R (add_mset a M) (add_mset b N)
[PROOF STEP]
have "\<exists>ya. add_mset a (image_mset fst y) = image_mset fst ya \<and>
    add_mset b (image_mset snd y) = image_mset snd ya \<and>
    set_mset ya \<subseteq> {(x, y). R x y}"
    if "R a b" and "set_mset y \<subseteq> {(x, y). R x y}" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ya. add_mset a (image_mset fst y) = image_mset fst ya \<and> add_mset b (image_mset snd y) = image_mset snd ya \<and> set_mset ya \<subseteq> {(x, y). R x y}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
R a b
set_mset y \<subseteq> {(x, y). R x y}

goal (1 subgoal):
 1. \<exists>ya. add_mset a (image_mset fst y) = image_mset fst ya \<and> add_mset b (image_mset snd y) = image_mset snd ya \<and> set_mset ya \<subseteq> {(x, y). R x y}
[PROOF STEP]
by (intro exI[of _ "add_mset (a,b) y"]) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>R a b; set_mset ?y \<subseteq> {(x, y). R x y}\<rbrakk> \<Longrightarrow> \<exists>ya. add_mset a (image_mset fst ?y) = image_mset fst ya \<and> add_mset b (image_mset snd ?y) = image_mset snd ya \<and> set_mset ya \<subseteq> {(x, y). R x y}

goal (1 subgoal):
 1. rel_mset R (add_mset a M) (add_mset b N)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>R a b; set_mset ?y \<subseteq> {(x, y). R x y}\<rbrakk> \<Longrightarrow> \<exists>ya. add_mset a (image_mset fst ?y) = image_mset fst ya \<and> add_mset b (image_mset snd ?y) = image_mset snd ya \<and> set_mset ya \<subseteq> {(x, y). R x y}

goal (1 subgoal):
 1. rel_mset R (add_mset a M) (add_mset b N)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>R a b; set_mset ?y \<subseteq> {(x, y). R x y}\<rbrakk> \<Longrightarrow> \<exists>ya. add_mset a (image_mset fst ?y) = image_mset fst ya \<and> add_mset b (image_mset snd ?y) = image_mset snd ya \<and> set_mset ya \<subseteq> {(x, y). R x y}
R a b
rel_mset R M N

goal (1 subgoal):
 1. rel_mset R (add_mset a M) (add_mset b N)
[PROOF STEP]
unfolding multiset.rel_compp_Grp Grp_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>R a b; set_mset ?y \<subseteq> {(x, y). R x y}\<rbrakk> \<Longrightarrow> \<exists>ya. add_mset a (image_mset fst ?y) = image_mset fst ya \<and> add_mset b (image_mset snd ?y) = image_mset snd ya \<and> set_mset ya \<subseteq> {(x, y). R x y}
R a b
((\<lambda>a b. b = image_mset fst a \<and> a \<in> {x. set_mset x \<subseteq> {(x, y). R x y}})\<inverse>\<inverse> OO (\<lambda>a b. b = image_mset snd a \<and> a \<in> {x. set_mset x \<subseteq> {(x, y). R x y}})) M N

goal (1 subgoal):
 1. ((\<lambda>a b. b = image_mset fst a \<and> a \<in> {x. set_mset x \<subseteq> {(x, y). R x y}})\<inverse>\<inverse> OO (\<lambda>a b. b = image_mset snd a \<and> a \<in> {x. set_mset x \<subseteq> {(x, y). R x y}})) (add_mset a M) (add_mset b N)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rel_mset R (add_mset a M) (add_mset b N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordertype_image_ordermap:
  assumes "small A" "X \<subseteq> A" "wf r" "trans r" "total_on X r"
  shows "ordertype (ordermap A r ` X) VWF = ordertype X r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (ordermap A r ` X) VWF = ordertype X r
[PROOF STEP]
proof (rule ordertype_inc_eq)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. small X
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X; (x, y) \<in> r\<rbrakk> \<Longrightarrow> (ordermap A r x, ordermap A r y) \<in> VWF
 3. wf r
 4. total_on X r
 5. wf VWF
[PROOF STEP]
show "small X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small X
[PROOF STEP]
by (meson assms smaller_than_small)
[PROOF STATE]
proof (state)
this:
small X

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X; (x, y) \<in> r\<rbrakk> \<Longrightarrow> (ordermap A r x, ordermap A r y) \<in> VWF
 2. wf r
 3. total_on X r
 4. wf VWF
[PROOF STEP]
show "(ordermap A r x, ordermap A r y) \<in> VWF"
    if "x \<in> X" "y \<in> X" "(x, y) \<in> r" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ordermap A r x, ordermap A r y) \<in> VWF
[PROOF STEP]
by (meson that wf_Ord_ordermap VWF_iff_Ord_less assms ordermap_mono_less subsetD)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> X; ?y \<in> X; (?x, ?y) \<in> r\<rbrakk> \<Longrightarrow> (ordermap A r ?x, ordermap A r ?y) \<in> VWF

goal (3 subgoals):
 1. wf r
 2. total_on X r
 3. wf VWF
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma ghom_unit_unit:"\<lbrakk>Group F; Group G; f \<in> gHom F G \<rbrakk> \<Longrightarrow>
                                                   f (\<one>\<^bsub>F\<^esub>) = \<one>\<^bsub>G\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (frule Group.unit_closed[of "F"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; \<one>\<^bsub>F\<^esub> \<in> carrier F\<rbrakk> \<Longrightarrow> f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (frule gHom [of "F" "G" "f" "\<one>\<^bsub>F\<^esub>" "\<one>\<^bsub>F\<^esub>"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; \<one>\<^bsub>F\<^esub> \<in> carrier F; f (\<one>\<^bsub>F\<^esub> \<cdot>\<^bsub>F\<^esub> \<one>\<^bsub>F\<^esub>) = f \<one>\<^bsub>F\<^esub> \<cdot>\<^bsub>G\<^esub> f \<one>\<^bsub>F\<^esub>\<rbrakk> \<Longrightarrow> f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (simp add:Group.l_unit[of "F"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; \<one>\<^bsub>F\<^esub> \<in> carrier F; f \<one>\<^bsub>F\<^esub> = f \<one>\<^bsub>F\<^esub> \<cdot>\<^bsub>G\<^esub> f \<one>\<^bsub>F\<^esub>\<rbrakk> \<Longrightarrow> f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (frule gHom_mem[of "F" "G" "f" "\<one>\<^bsub>F\<^esub>"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; \<one>\<^bsub>F\<^esub> \<in> carrier F; f \<one>\<^bsub>F\<^esub> = f \<one>\<^bsub>F\<^esub> \<cdot>\<^bsub>G\<^esub> f \<one>\<^bsub>F\<^esub>; f \<one>\<^bsub>F\<^esub> \<in> carrier G\<rbrakk> \<Longrightarrow> f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (frule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; \<one>\<^bsub>F\<^esub> \<in> carrier F; f \<one>\<^bsub>F\<^esub> = f \<one>\<^bsub>F\<^esub> \<cdot>\<^bsub>G\<^esub> f \<one>\<^bsub>F\<^esub>; f \<one>\<^bsub>F\<^esub> \<in> carrier G; f \<one>\<^bsub>F\<^esub> \<cdot>\<^bsub>G\<^esub> f \<one>\<^bsub>F\<^esub> = f \<one>\<^bsub>F\<^esub>\<rbrakk> \<Longrightarrow> f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (rule Group.one_unique[of "G" "f \<one>\<^bsub>F\<^esub>" "f \<one>\<^bsub>F\<^esub>"], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma le_err_trans [rule_format]:
  "order r \<Longrightarrow> e1 <=_(le r) e2 \<longrightarrow> e2 <=_(le r) e3 \<longrightarrow> e1 <=_(le r) e3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e2 \<longrightarrow> e2 \<sqsubseteq>\<^bsub>le r\<^esub> e3 \<longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e3
[PROOF STEP]
apply (unfold unfold_lesub_err le_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> (case e2 of Err \<Rightarrow> True | OK y \<Rightarrow> case e1 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y) \<longrightarrow> (case e3 of Err \<Rightarrow> True | OK y \<Rightarrow> case e2 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y) \<longrightarrow> (case e3 of Err \<Rightarrow> True | OK y \<Rightarrow> case e1 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y)
[PROOF STEP]
apply (simp split: err.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> \<forall>x2 x2a. e1 = OK x2a \<longrightarrow> e3 = OK x2 \<longrightarrow> (\<forall>x2b. e2 = OK x2b \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2b \<longrightarrow> x2b \<sqsubseteq>\<^bsub>r\<^esub> x2 \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2)
[PROOF STEP]
apply (blast intro: order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mindeg_min:
  assumes "finite A" and "p \<in> A"
  shows "mindeg A \<le> poly_deg p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mindeg A \<le> poly_deg p
[PROOF STEP]
unfolding mindeg_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (poly_deg ` A) \<le> poly_deg p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
p \<in> A

goal (1 subgoal):
 1. Min (poly_deg ` A) \<le> poly_deg p
[PROOF STEP]
by auto


[STATEMENT]
lemma inner_prod_with_row_bra_vec_col_ket_vec [simp]:
  assumes "dim_vec u = dim_vec v"
  shows "\<langle>u|v\<rangle> = (row \<langle>u| 0) \<bullet> (col |v\<rangle> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>u|v\<rangle> = row \<langle>|u\<rangle>| 0 \<bullet> col |v\<rangle> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dim_vec u = dim_vec v

goal (1 subgoal):
 1. \<langle>u|v\<rangle> = row \<langle>|u\<rangle>| 0 \<bullet> col |v\<rangle> 0
[PROOF STEP]
by (simp add: inner_prod_def scalar_prod_def)


[STATEMENT]
theorem hyp2_axiom6: "\<forall> a b. B\<^sub>K a b a \<longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b. B\<^sub>K a b a \<longrightarrow> a = b
[PROOF STEP]
proof standard+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. B\<^sub>K a b a \<Longrightarrow> a = b
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. B\<^sub>K a b a \<Longrightarrow> a = b
[PROOF STEP]
let ?ca = "cart2_pt (Rep_hyp2 a)"
    and ?cb = "cart2_pt (Rep_hyp2 b)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. B\<^sub>K a b a \<Longrightarrow> a = b
[PROOF STEP]
assume "B\<^sub>K a b a"
[PROOF STATE]
proof (state)
this:
B\<^sub>K a b a

goal (1 subgoal):
 1. \<And>a b. B\<^sub>K a b a \<Longrightarrow> a = b
[PROOF STEP]
hence "B\<^sub>\<real> ?ca ?cb ?ca"
[PROOF STATE]
proof (prove)
using this:
B\<^sub>K a b a

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt (Rep_hyp2 a) cart2_pt (Rep_hyp2 b) cart2_pt (Rep_hyp2 a)
[PROOF STEP]
by (unfold real_hyp2_B_def hyp2_rep_def)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt (Rep_hyp2 a) cart2_pt (Rep_hyp2 b) cart2_pt (Rep_hyp2 a)

goal (1 subgoal):
 1. \<And>a b. B\<^sub>K a b a \<Longrightarrow> a = b
[PROOF STEP]
hence "?ca = ?cb"
[PROOF STATE]
proof (prove)
using this:
B\<^sub>\<real> cart2_pt (Rep_hyp2 a) cart2_pt (Rep_hyp2 b) cart2_pt (Rep_hyp2 a)

goal (1 subgoal):
 1. cart2_pt (Rep_hyp2 a) = cart2_pt (Rep_hyp2 b)
[PROOF STEP]
by (rule real_euclid.A6')
[PROOF STATE]
proof (state)
this:
cart2_pt (Rep_hyp2 a) = cart2_pt (Rep_hyp2 b)

goal (1 subgoal):
 1. \<And>a b. B\<^sub>K a b a \<Longrightarrow> a = b
[PROOF STEP]
hence "Rep_hyp2 a = Rep_hyp2 b"
[PROOF STATE]
proof (prove)
using this:
cart2_pt (Rep_hyp2 a) = cart2_pt (Rep_hyp2 b)

goal (1 subgoal):
 1. Rep_hyp2 a = Rep_hyp2 b
[PROOF STEP]
by (simp add: Rep_hyp2 hyp2_S_cart2_inj)
[PROOF STATE]
proof (state)
this:
Rep_hyp2 a = Rep_hyp2 b

goal (1 subgoal):
 1. \<And>a b. B\<^sub>K a b a \<Longrightarrow> a = b
[PROOF STEP]
thus "a = b"
[PROOF STATE]
proof (prove)
using this:
Rep_hyp2 a = Rep_hyp2 b

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by (unfold Rep_hyp2_inject)
[PROOF STATE]
proof (state)
this:
a = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deg_le_sect_Suc: "deg_le_sect X (Suc d) = deg_le_sect X d \<union> deg_sect X (Suc d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_le_sect X (Suc d) = deg_le_sect X d \<union> deg_sect X (Suc d)
[PROOF STEP]
by (simp add: deg_le_sect_def atMost_Suc Un_commute)


[STATEMENT]
lemma postorder_bt_map: "postorder (bt_map f t) = map f (postorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. postorder (bt_map f t) = map f (postorder t)
[PROOF STEP]
apply (induct t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. postorder (bt_map f Lf) = map f (postorder Lf)
 2. \<And>x1 t1 t2. \<lbrakk>postorder (bt_map f t1) = map f (postorder t1); postorder (bt_map f t2) = map f (postorder t2)\<rbrakk> \<Longrightarrow> postorder (bt_map f (Br x1 t1 t2)) = map f (postorder (Br x1 t1 t2))
[PROOF STEP]
apply (metis Nil_is_map_conv bt_map.simps(1) postorder.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>postorder (bt_map f t1) = map f (postorder t1); postorder (bt_map f t2) = map f (postorder t2)\<rbrakk> \<Longrightarrow> postorder (bt_map f (Br x1 t1 t2)) = map f (postorder (Br x1 t1 t2))
[PROOF STEP]
by simp