[STATEMENT]
lemma contour_integrable_linepath_same_Im_iff:
  fixes a b :: complex and f :: "complex \<Rightarrow> complex"
  assumes "Im a = Im b" "Re a < Re b"
  shows   "(f contour_integrable_on linepath a b) \<longleftrightarrow>
             (\<lambda>x. f (of_real x + Im a * \<i>)) integrable_on {Re a..Re b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f contour_integrable_on linepath a b) = ((\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>)) integrable_on {Re a..Re b})
[PROOF STEP]
using has_contour_integral_linepath_same_Im_iff[OF assms, of f]
[PROOF STATE]
proof (prove)
using this:
(f has_contour_integral ?I) (linepath a b) = ((\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>)) has_integral ?I) {Re a..Re b}

goal (1 subgoal):
 1. (f contour_integrable_on linepath a b) = ((\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>)) integrable_on {Re a..Re b})
[PROOF STEP]
by (auto simp: contour_integrable_on_def integrable_on_def)


[STATEMENT]
lemma lm04:
  assumes "runiq f" "y1 \<in> Range f"
  shows "(f^-1 `` {y1} \<inter> f^-1 `` {y2} \<noteq> {}) = (f^-1``{y1}=f^-1``{y2})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f\<inverse> `` {y1} \<inter> f\<inverse> `` {y2} \<noteq> {}) = (f\<inverse> `` {y1} = f\<inverse> `` {y2})
[PROOF STEP]
using assms rightUniqueFunctionAfterInverse
[PROOF STATE]
proof (prove)
using this:
runiq f
y1 \<in> Range f
runiq ?f \<Longrightarrow> ?f `` ?f\<inverse> `` ?Y \<subseteq> ?Y

goal (1 subgoal):
 1. (f\<inverse> `` {y1} \<inter> f\<inverse> `` {y2} \<noteq> {}) = (f\<inverse> `` {y1} = f\<inverse> `` {y2})
[PROOF STEP]
by fast


[STATEMENT]
lemma card_ceros_count_UNIV:
  shows "card (ceros_of_boolean_input a) + count_true ((a::bool vec)) = dim_vec a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (ceros_of_boolean_input a) + count_true a = dim_vec a
[PROOF STEP]
using card_complementary [of a]
[PROOF STATE]
proof (prove)
using this:
card (ceros_of_boolean_input a) + card {x. x < dim_vec a \<and> a $ x = True} = dim_vec a

goal (1 subgoal):
 1. card (ceros_of_boolean_input a) + count_true a = dim_vec a
[PROOF STEP]
using card_boolean_function
[PROOF STATE]
proof (prove)
using this:
card (ceros_of_boolean_input a) + card {x. x < dim_vec a \<and> a $ x = True} = dim_vec a
?v \<in> carrier_vec ?n \<Longrightarrow> card {x. x < ?n \<and> ?v $ x = True} = (\<Sum>i = 0..<?n. if ?v $ i then 1 else 0)

goal (1 subgoal):
 1. card (ceros_of_boolean_input a) + count_true a = dim_vec a
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
card {x. x < dim_vec a \<and> a $ x = False} + card {x. x < dim_vec a \<and> a $ x = True} = dim_vec a
?v \<in> carrier_vec ?n \<Longrightarrow> card {x. x < ?n \<and> ?v $ x = True} = (\<Sum>i = 0..<?n. if ?v $ i then 1 else 0)

goal (1 subgoal):
 1. card {x. x < dim_vec a \<and> a $ x = False} + count_true a = dim_vec a
[PROOF STEP]
unfolding count_true_def
[PROOF STATE]
proof (prove)
using this:
card {x. x < dim_vec a \<and> a $ x = False} + card {x. x < dim_vec a \<and> a $ x = True} = dim_vec a
?v \<in> carrier_vec ?n \<Longrightarrow> card {x. x < ?n \<and> ?v $ x = True} = (\<Sum>i = 0..<?n. if ?v $ i then 1 else 0)

goal (1 subgoal):
 1. card {x. x < dim_vec a \<and> a $ x = False} + (\<Sum>i = 0..<dim_vec a. if a $ i then 1 else 0) = dim_vec a
[PROOF STEP]
by simp


[STATEMENT]
lemma scalar_prod_add_distrib: assumes v: "v\<^sub>1 \<in> carrier_vec n" "v\<^sub>2 \<in> carrier_vec n" "v\<^sub>3 \<in> carrier_vec n"
  shows "v\<^sub>1 \<bullet> (v\<^sub>2 + v\<^sub>3) = v\<^sub>1 \<bullet> v\<^sub>2 + v\<^sub>1 \<bullet> v\<^sub>3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v\<^sub>1 \<bullet> (v\<^sub>2 + v\<^sub>3) = v\<^sub>1 \<bullet> v\<^sub>2 + v\<^sub>1 \<bullet> v\<^sub>3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v\<^sub>1 \<bullet> (v\<^sub>2 + v\<^sub>3) = v\<^sub>1 \<bullet> v\<^sub>2 + v\<^sub>1 \<bullet> v\<^sub>3
[PROOF STEP]
have "(\<Sum>i\<in>{0..<dim_vec v\<^sub>3}. v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i\<in>{0..<dim_vec v\<^sub>3}. v\<^sub>1 $ i * v\<^sub>2 $ i + v\<^sub>1 $ i * v\<^sub>3 $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * v\<^sub>2 $ i + v\<^sub>1 $ i * v\<^sub>3 $ i)
[PROOF STEP]
by (rule sum.cong, insert v, auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * v\<^sub>2 $ i + v\<^sub>1 $ i * v\<^sub>3 $ i)

goal (1 subgoal):
 1. v\<^sub>1 \<bullet> (v\<^sub>2 + v\<^sub>3) = v\<^sub>1 \<bullet> v\<^sub>2 + v\<^sub>1 \<bullet> v\<^sub>3
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * v\<^sub>2 $ i + v\<^sub>1 $ i * v\<^sub>3 $ i)

goal (1 subgoal):
 1. v\<^sub>1 \<bullet> (v\<^sub>2 + v\<^sub>3) = v\<^sub>1 \<bullet> v\<^sub>2 + v\<^sub>1 \<bullet> v\<^sub>3
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * v\<^sub>2 $ i + v\<^sub>1 $ i * v\<^sub>3 $ i)

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (v\<^sub>2 + v\<^sub>3). v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i = 0..<dim_vec v\<^sub>2. v\<^sub>1 $ i * v\<^sub>2 $ i) + (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * v\<^sub>3 $ i)
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * v\<^sub>2 $ i + v\<^sub>1 $ i * v\<^sub>3 $ i)
v\<^sub>1 \<in> carrier_vec n
v\<^sub>2 \<in> carrier_vec n
v\<^sub>3 \<in> carrier_vec n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (v\<^sub>2 + v\<^sub>3). v\<^sub>1 $ i * (v\<^sub>2 + v\<^sub>3) $ i) = (\<Sum>i = 0..<dim_vec v\<^sub>2. v\<^sub>1 $ i * v\<^sub>2 $ i) + (\<Sum>i = 0..<dim_vec v\<^sub>3. v\<^sub>1 $ i * v\<^sub>3 $ i)
[PROOF STEP]
by (auto intro: sum.distrib)
[PROOF STATE]
proof (state)
this:
v\<^sub>1 \<bullet> (v\<^sub>2 + v\<^sub>3) = v\<^sub>1 \<bullet> v\<^sub>2 + v\<^sub>1 \<bullet> v\<^sub>3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma two_power_sum: "sum (\<lambda> x. (2::nat) ^ x) {i. i< Suc m} = (2 ^ Suc m) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc m} = 2 ^ Suc m - 1
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum ((^) 2) {i. i < Suc 0} = 2 ^ Suc 0 - 1
 2. \<And>m. sum ((^) 2) {i. i < Suc m} = 2 ^ Suc m - 1 \<Longrightarrow> sum ((^) 2) {i. i < Suc (Suc m)} = 2 ^ Suc (Suc m) - 1
[PROOF STEP]
show "sum (\<lambda> x. (2::nat) ^ x) {i. i< Suc 0} = (2 ^ Suc 0) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc 0} = 2 ^ Suc 0 - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {i. i < Suc 0} = 2 ^ Suc 0 - 1

goal (1 subgoal):
 1. \<And>m. sum ((^) 2) {i. i < Suc m} = 2 ^ Suc m - 1 \<Longrightarrow> sum ((^) 2) {i. i < Suc (Suc m)} = 2 ^ Suc (Suc m) - 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. sum ((^) 2) {i. i < Suc m} = 2 ^ Suc m - 1 \<Longrightarrow> sum ((^) 2) {i. i < Suc (Suc m)} = 2 ^ Suc (Suc m) - 1
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. sum ((^) 2) {i. i < Suc m} = 2 ^ Suc m - 1 \<Longrightarrow> sum ((^) 2) {i. i < Suc (Suc m)} = 2 ^ Suc (Suc m) - 1
[PROOF STEP]
assume A: "sum (\<lambda> x. (2::nat) ^ x) {i. i< Suc n} = (2 ^ Suc n) - 1"
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {i. i < Suc n} = 2 ^ Suc n - 1

goal (1 subgoal):
 1. \<And>m. sum ((^) 2) {i. i < Suc m} = 2 ^ Suc m - 1 \<Longrightarrow> sum ((^) 2) {i. i < Suc (Suc m)} = 2 ^ Suc (Suc m) - 1
[PROOF STEP]
show "sum (\<lambda> x. (2::nat) ^ x) {i. i< Suc (Suc n)} = (2 ^ Suc (Suc n)) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
let ?f = "\<lambda> x. (2::nat) ^ x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have S1: "{i. i< Suc (Suc n)} = {i. i \<le> Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < Suc (Suc n)} = {i. i \<le> Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < Suc (Suc n)} = {i. i \<le> Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have S2: "{i. i \<le> Suc n} = {i. i < Suc n} \<union> { Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<le> Suc n} = {i. i < Suc n} \<union> {Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i \<le> Suc n} = {i. i < Suc n} \<union> {Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
{i. i < Suc (Suc n)} = {i. i \<le> Suc n}
{i. i \<le> Suc n} = {i. i < Suc n} \<union> {Suc n}
[PROOF STEP]
have S3: "{i. i< Suc (Suc n)} = {i. i < Suc n} \<union> { Suc n}"
[PROOF STATE]
proof (prove)
using this:
{i. i < Suc (Suc n)} = {i. i \<le> Suc n}
{i. i \<le> Suc n} = {i. i < Suc n} \<union> {Suc n}

goal (1 subgoal):
 1. {i. i < Suc (Suc n)} = {i. i < Suc n} \<union> {Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < Suc (Suc n)} = {i. i < Suc n} \<union> {Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have S4: "{i. i < Suc n} = (\<lambda> x. x) ` {i. i < Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < Suc n} = (\<lambda>x. x) ` {i. i < Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < Suc n} = (\<lambda>x. x) ` {i. i < Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{i. i < Suc n} = (\<lambda>x. x) ` {i. i < Suc n}
[PROOF STEP]
have S5: "finite {i. i < Suc n}"
[PROOF STATE]
proof (prove)
using this:
{i. i < Suc n} = (\<lambda>x. x) ` {i. i < Suc n}

goal (1 subgoal):
 1. finite {i. i < Suc n}
[PROOF STEP]
by (rule nat_seg_image_imp_finite)
[PROOF STATE]
proof (state)
this:
finite {i. i < Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have S6: "Suc n \<notin> {i. i < Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n \<notin> {i. i < Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc n \<notin> {i. i < Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
from S5 S6 sum.insert
[PROOF STATE]
proof (chain)
picking this:
finite {i. i < Suc n}
Suc n \<notin> {i. i < Suc n}
\<lbrakk>finite ?A; ?x \<notin> ?A\<rbrakk> \<Longrightarrow> sum ?g (insert ?x ?A) = ?g ?x + sum ?g ?A
[PROOF STEP]
have S7: "sum ?f ({i. i< Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ?f {i. i< Suc n}"
[PROOF STATE]
proof (prove)
using this:
finite {i. i < Suc n}
Suc n \<notin> {i. i < Suc n}
\<lbrakk>finite ?A; ?x \<notin> ?A\<rbrakk> \<Longrightarrow> sum ?g (insert ?x ?A) = ?g ?x + sum ?g ?A

goal (1 subgoal):
 1. sum ((^) 2) ({i. i < Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ((^) 2) {i. i < Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) ({i. i < Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ((^) 2) {i. i < Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
from S3
[PROOF STATE]
proof (chain)
picking this:
{i. i < Suc (Suc n)} = {i. i < Suc n} \<union> {Suc n}
[PROOF STEP]
have "sum ?f {i. i< Suc (Suc n)} = sum ?f ({i. i< Suc n} \<union> {Suc n})"
[PROOF STATE]
proof (prove)
using this:
{i. i < Suc (Suc n)} = {i. i < Suc n} \<union> {Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = sum ((^) 2) ({i. i < Suc n} \<union> {Suc n})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {i. i < Suc (Suc n)} = sum ((^) 2) ({i. i < Suc n} \<union> {Suc n})

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {i. i < Suc (Suc n)} = sum ((^) 2) ({i. i < Suc n} \<union> {Suc n})

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
from S7
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) ({i. i < Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ((^) 2) {i. i < Suc n}
[PROOF STEP]
have "\<dots> = 2 ^ Suc n + sum ?f {i. i< Suc n}"
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) ({i. i < Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ((^) 2) {i. i < Suc n}

goal (1 subgoal):
 1. sum ((^) 2) ({i. i < Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ((^) 2) {i. i < Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) ({i. i < Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ((^) 2) {i. i < Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((^) 2) ({i. i < Suc n} \<union> {Suc n}) = 2 ^ Suc n + sum ((^) 2) {i. i < Suc n}

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) {i. i < Suc n} = 2 ^ Suc n - 1
[PROOF STEP]
have "\<dots> = 2 ^ Suc n + (((2::nat) ^ Suc n)-(1::nat))"
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) {i. i < Suc n} = 2 ^ Suc n - 1

goal (1 subgoal):
 1. 2 ^ Suc n + sum ((^) 2) {i. i < Suc n} = 2 ^ Suc n + (2 ^ Suc n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ Suc n + sum ((^) 2) {i. i < Suc n} = 2 ^ Suc n + (2 ^ Suc n - 1)

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ Suc n + sum ((^) 2) {i. i < Suc n} = 2 ^ Suc n + (2 ^ Suc n - 1)

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have "\<dots> = (2 ^ Suc (Suc n)) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ Suc n + (2 ^ Suc n - 1) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ Suc n + (2 ^ Suc n - 1) = 2 ^ Suc (Suc n) - 1

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1

goal (1 subgoal):
 1. sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {i. i < Suc (Suc n)} = 2 ^ Suc (Suc n) - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_floor_add: "\<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> \<le> \<lfloor>x + y\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> \<le> \<lfloor>x + y\<rfloor>
[PROOF STEP]
by (simp only: le_floor_iff of_int_add add_mono of_int_floor_le)


[STATEMENT]
lemma p_H: "0 < p_H" "p_H < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p_H &&& p_H < 1
[PROOF STEP]
using J_not_empty C_smaller C_non_empty
[PROOF STATE]
proof (prove)
using this:
J \<noteq> {}
C \<subset> J
C \<noteq> {}

goal (1 subgoal):
 1. 0 < p_H &&& p_H < 1
[PROOF STEP]
by (simp_all add: p_H_def card_Diff_subset card_mono field_simps zero_less_divide_iff card_gt_0_iff)


[STATEMENT]
lemma matrix_vector_mul_injective_on_rowspace:
  fixes A :: "real^'n^'m"
  shows "\<lbrakk>A *v x = A *v y; x \<in> span(rows A); y \<in> span(rows A)\<rbrakk> \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A *v x = A *v y; x \<in> span (rows A); y \<in> span (rows A)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using nullspace_inter_rowspace [of A "x-y"]
[PROOF STATE]
proof (prove)
using this:
(A *v (x - y) = 0 \<and> x - y \<in> span (rows A)) = (x - y = 0)

goal (1 subgoal):
 1. \<lbrakk>A *v x = A *v y; x \<in> span (rows A); y \<in> span (rows A)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis diff_eq_diff_eq diff_self matrix_vector_mult_diff_distrib span_diff)


[STATEMENT]
lemma Im_exp: "Im (exp z) = exp (Re z) * sin (Im z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (exp z) = exp (Re z) * sin (Im z)
[PROOF STEP]
unfolding exp_eq_polar
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (complex_of_real (exp (Re z)) * cis (Im z)) = exp (Re z) * sin (Im z)
[PROOF STEP]
by simp


[STATEMENT]
lemma mset_size_ne0_set_card: "size A > 0 \<Longrightarrow> card (set_mset A) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < size A \<Longrightarrow> 0 < card (set_mset A)
[PROOF STEP]
using mset_nempty_set_nempty
[PROOF STATE]
proof (prove)
using this:
(?A \<noteq> {#}) = (set_mset ?A \<noteq> {})

goal (1 subgoal):
 1. 0 < size A \<Longrightarrow> 0 < card (set_mset A)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma isCont_sgn[continuous_intros]:
  fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector"
  assumes "isCont f a"
    and "f a \<noteq> 0"
  shows "isCont (\<lambda>x. sgn (f x)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. sgn (f x)) a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isCont f a
f a \<noteq> (0::'b)

goal (1 subgoal):
 1. isCont (\<lambda>x. sgn (f x)) a
[PROOF STEP]
unfolding continuous_at
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>a\<rightarrow> f a
f a \<noteq> (0::'b)

goal (1 subgoal):
 1. (\<lambda>x. sgn (f x)) \<midarrow>a\<rightarrow> sgn (f a)
[PROOF STEP]
by (rule tendsto_sgn)


[STATEMENT]
lemma det_perm_rows:
  fixes A :: "'a::comm_ring_1^^'n"
  assumes p: "p permutes UNIV"
  shows "det (perm_rows A p) = of_int (sign p) * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (perm_rows A p) = of_int (sign p) * Square_Matrix.det A
[PROOF STEP]
using det_perm_cols[OF p, of "transpose A"]
[PROOF STATE]
proof (prove)
using this:
Square_Matrix.det (perm_cols (Square_Matrix.transpose A) p) = of_int (sign p) * Square_Matrix.det (Square_Matrix.transpose A)

goal (1 subgoal):
 1. Square_Matrix.det (perm_rows A p) = of_int (sign p) * Square_Matrix.det A
[PROOF STEP]
by (simp add: det_transpose perm_cols_transpose)


[STATEMENT]
lemma frechet_derivative_inverse: "frechet_derivative (\<lambda>x. inverse (f x)) (at x) =
    (\<lambda>h. - 1 / (f x)\<^sup>2 * frechet_derivative f (at x) h)"
  if "f differentiable at x" "f x \<noteq> 0" for f::"_\<Rightarrow>_::real_normed_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. inverse (f x)) (at x) = (\<lambda>h. - (1::'d) / (f x)\<^sup>2 * frechet_derivative f (at x) h)
[PROOF STEP]
apply (rule frechet_derivative_at')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) has_derivative (\<lambda>h. - (1::'d) / (f x)\<^sup>2 * frechet_derivative f (at x) h)) (at x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
f differentiable at x
f x \<noteq> (0::'d)

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) has_derivative (\<lambda>h. - (1::'d) / (f x)\<^sup>2 * frechet_derivative f (at x) h)) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros frechet_derivative_worksI
      simp: divide_simps algebra_simps power2_eq_square)


[STATEMENT]
lemma exp1: "exp 3 (A) + exp 3 (B) < 3 * ((exp 3 A) * (exp 3 B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 3 A + exp 3 B < 3 * (exp 3 A * exp 3 B)
[PROOF STEP]
using exp3Min[of A] exp3Min[of B]
[PROOF STATE]
proof (prove)
using this:
0 < exp 3 A
0 < exp 3 B

goal (1 subgoal):
 1. exp 3 A + exp 3 B < 3 * (exp 3 A * exp 3 B)
[PROOF STEP]
apply(case_tac "exp 3 A")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < exp 3 A; 0 < exp 3 B; exp 3 A = 0\<rbrakk> \<Longrightarrow> exp 3 A + exp 3 B < 3 * (exp 3 A * exp 3 B)
 2. \<And>nat. \<lbrakk>0 < exp 3 A; 0 < exp 3 B; exp 3 A = Suc nat\<rbrakk> \<Longrightarrow> exp 3 A + exp 3 B < 3 * (exp 3 A * exp 3 B)
[PROOF STEP]
apply(simp add: exp3Min)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>0 < exp 3 A; 0 < exp 3 B; exp 3 A = Suc nat\<rbrakk> \<Longrightarrow> exp 3 A + exp 3 B < 3 * (exp 3 A * exp 3 B)
[PROOF STEP]
apply(case_tac "exp 3 B")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>nat. \<lbrakk>0 < exp 3 A; 0 < exp 3 B; exp 3 A = Suc nat; exp 3 B = 0\<rbrakk> \<Longrightarrow> exp 3 A + exp 3 B < 3 * (exp 3 A * exp 3 B)
 2. \<And>nat nata. \<lbrakk>0 < exp 3 A; 0 < exp 3 B; exp 3 A = Suc nat; exp 3 B = Suc nata\<rbrakk> \<Longrightarrow> exp 3 A + exp 3 B < 3 * (exp 3 A * exp 3 B)
[PROOF STEP]
apply (simp add: exp3Min, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma log_divide: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> 0 < y \<Longrightarrow> log a (x/y) = log a x - log a y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a \<noteq> 1; 0 < x; 0 < y\<rbrakk> \<Longrightarrow> log a (x / y) = log a x - log a y
[PROOF STEP]
by (simp add: log_mult divide_inverse log_inverse)


[STATEMENT]
lemma groups_of_size_zero: "groups_of_size 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. groups_of_size 0 = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. groups_of_size 0 = 0
[PROOF STEP]
have empty: "{G \<in> \<G> . card G = 0} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {G \<in> \<G>. card G = 0} = {}
[PROOF STEP]
using min_group_size
[PROOF STATE]
proof (prove)
using this:
?G \<in> \<G> \<Longrightarrow> 1 \<le> card ?G

goal (1 subgoal):
 1. {G \<in> \<G>. card G = 0} = {}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{G \<in> \<G>. card G = 0} = {}

goal (1 subgoal):
 1. groups_of_size 0 = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{G \<in> \<G>. card G = 0} = {}

goal (1 subgoal):
 1. groups_of_size 0 = 0
[PROOF STEP]
unfolding groups_of_size_def
[PROOF STATE]
proof (prove)
using this:
{G \<in> \<G>. card G = 0} = {}

goal (1 subgoal):
 1. card {G \<in> \<G>. card G = 0} = 0
[PROOF STEP]
by (simp add: empty)
[PROOF STATE]
proof (state)
this:
groups_of_size 0 = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjointify_card:
  assumes "finite As"
  shows"card  (disjointify As) \<le> card As"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (disjointify As) \<le> card As
[PROOF STEP]
by (simp add: card_of_rec_disjointify disjointify_def)


[STATEMENT]
lemma content_cbox_plus:
  fixes x :: "'a::euclidean_space"
  shows "content(cbox x (x + h *\<^sub>R One)) = (if h \<ge> 0 then h ^ DIM('a) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (cbox x (x + h *\<^sub>R One)) = (if 0 \<le> h then h ^ DIM('a) else 0)
[PROOF STEP]
by (simp add: algebra_simps content_cbox_if box_eq_empty)


[STATEMENT]
lemma card_remove_fset_less2:
  shows "x |\<in>| xs \<Longrightarrow> y |\<in>| xs \<Longrightarrow> card_fset (remove_fset y (remove_fset x xs)) < card_fset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x |\<in>| xs; y |\<in>| xs\<rbrakk> \<Longrightarrow> card_fset (remove_fset y (remove_fset x xs)) < card_fset xs
[PROOF STEP]
unfolding card_fset remove_fset in_fset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> fset xs; y \<in> fset xs\<rbrakk> \<Longrightarrow> card (fset xs - {x} - {y}) < card (fset xs)
[PROOF STEP]
by (rule card_Diff2_less[OF finite_fset])


[STATEMENT]
lemma subresultant_product: fixes F :: "'a :: idom poly"
  assumes "F = B * G"
  and FG: "degree F \<ge> degree G"
shows "subresultant J F G = (if J < degree G then 0 else
   if J < degree F then smult (lead_coeff G ^ (degree F - J - 1)) G else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
proof (cases "J < degree G")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
case J: True
[PROOF STATE]
proof (state)
this:
J < degree G

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
F = B * G
degree G \<le> degree F
[PROOF STEP]
have eq: "F + (-B) * G = 0"
[PROOF STATE]
proof (prove)
using this:
F = B * G
degree G \<le> degree F

goal (1 subgoal):
 1. F + - B * G = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
F + - B * G = 0

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
from J
[PROOF STATE]
proof (chain)
picking this:
J < degree G
[PROOF STEP]
have lt: "degree 0 < degree G \<or> b" for b
[PROOF STATE]
proof (prove)
using this:
J < degree G

goal (1 subgoal):
 1. degree 0 < degree G \<or> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree 0 < degree G \<or> ?b1

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
from BT_lemma_1_13[OF eq FG lt lt]
[PROOF STATE]
proof (chain)
picking this:
subresultant (degree 0) F G = Polynomial.smult ((- (1::'a)) ^ ((degree F - degree 0) * (degree G - degree 0)) * lead_coeff G ^ (degree F - degree 0) * lead_coeff 0 ^ (degree G - degree 0 - 1)) 0
[PROOF STEP]
have "subresultant 0 F G = 0"
[PROOF STATE]
proof (prove)
using this:
subresultant (degree 0) F G = Polynomial.smult ((- (1::'a)) ^ ((degree F - degree 0) * (degree G - degree 0)) * lead_coeff G ^ (degree F - degree 0) * lead_coeff 0 ^ (degree G - degree 0 - 1)) 0

goal (1 subgoal):
 1. subresultant 0 F G = 0
[PROOF STEP]
using J
[PROOF STATE]
proof (prove)
using this:
subresultant (degree 0) F G = Polynomial.smult ((- (1::'a)) ^ ((degree F - degree 0) * (degree G - degree 0)) * lead_coeff G ^ (degree F - degree 0) * lead_coeff 0 ^ (degree G - degree 0 - 1)) 0
J < degree G

goal (1 subgoal):
 1. subresultant 0 F G = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subresultant 0 F G = 0

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
with BT_lemma_1_14[OF eq FG lt, of J]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>degree 0 < J; J < degree G - 1\<rbrakk> \<Longrightarrow> subresultant J F G = 0
subresultant 0 F G = 0
[PROOF STEP]
have 00: "J = 0 \<or> J < degree G - 1 \<Longrightarrow> subresultant J F G = 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>degree 0 < J; J < degree G - 1\<rbrakk> \<Longrightarrow> subresultant J F G = 0
subresultant 0 F G = 0

goal (1 subgoal):
 1. J = 0 \<or> J < degree G - 1 \<Longrightarrow> subresultant J F G = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
J = 0 \<or> J < degree G - 1 \<Longrightarrow> subresultant J F G = 0

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
from BT_lemma_1_15[OF eq FG lt lt] J
[PROOF STATE]
proof (chain)
picking this:
subresultant (degree G - 1) F G = Polynomial.smult ((- (1::'a)) ^ (degree F - degree G + 1) * lead_coeff G ^ (degree F - degree G + 1)) 0
J < degree G
[PROOF STEP]
have 01: "subresultant (degree G - 1) F G = 0"
[PROOF STATE]
proof (prove)
using this:
subresultant (degree G - 1) F G = Polynomial.smult ((- (1::'a)) ^ (degree F - degree G + 1) * lead_coeff G ^ (degree F - degree G + 1)) 0
J < degree G

goal (1 subgoal):
 1. subresultant (degree G - 1) F G = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subresultant (degree G - 1) F G = 0

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
from J
[PROOF STATE]
proof (chain)
picking this:
J < degree G
[PROOF STEP]
have "(J = 0 \<or> J < degree G - 1) \<or> J = degree G - 1"
[PROOF STATE]
proof (prove)
using this:
J < degree G

goal (1 subgoal):
 1. (J = 0 \<or> J < degree G - 1) \<or> J = degree G - 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(J = 0 \<or> J < degree G - 1) \<or> J = degree G - 1

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
with 00 01
[PROOF STATE]
proof (chain)
picking this:
J = 0 \<or> J < degree G - 1 \<Longrightarrow> subresultant J F G = 0
subresultant (degree G - 1) F G = 0
(J = 0 \<or> J < degree G - 1) \<or> J = degree G - 1
[PROOF STEP]
have "subresultant J F G = 0"
[PROOF STATE]
proof (prove)
using this:
J = 0 \<or> J < degree G - 1 \<Longrightarrow> subresultant J F G = 0
subresultant (degree G - 1) F G = 0
(J = 0 \<or> J < degree G - 1) \<or> J = degree G - 1

goal (1 subgoal):
 1. subresultant J F G = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subresultant J F G = 0

goal (2 subgoals):
 1. J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
subresultant J F G = 0

goal (1 subgoal):
 1. subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
using J
[PROOF STATE]
proof (prove)
using this:
subresultant J F G = 0
J < degree G

goal (1 subgoal):
 1. subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
case J: False
[PROOF STATE]
proof (state)
this:
\<not> J < degree G

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
hence dg: "degree G - J = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> J < degree G

goal (1 subgoal):
 1. degree G - J = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree G - J = 0

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
let ?n = "degree F - J"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have *: "(j :: nat) < 0 \<longleftrightarrow> False" "j - 0 = j" for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (j < 0) = False &&& j - 0 = j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(?j < 0) = False
?j - 0 = ?j

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
let ?M = "mat ?n ?n
          (\<lambda>(i, j).
              if i = ?n - 1 then monom 1 (?n - 1 - j) * G
              else [:coeff_int G (int (degree G) - int i + int j):])"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "subresultant J F G = det ?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subresultant J F G = det (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]))
[PROOF STEP]
unfolding subresultant_def subresultant_mat_def Let_def dg *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat (degree F - J + 0) (degree F - J + 0) (\<lambda>(i, j). if False then if i = degree F - J + 0 - 1 then monom (1::'a) (0 - 1 - j) * F else [:coeff_int F (int (degree F) - int i + int j):] else if i = degree F - J + 0 - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])) = det (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subresultant J F G = det (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]))

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
subresultant J F G = det (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]))

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "det ?M = prod_list (diag_mat ?M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])) = prod_list (diag_mat (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])))
[PROOF STEP]
by (rule det_lower_triangular[of ?n], auto intro: coeff_int_eq_0)
[PROOF STATE]
proof (state)
this:
det (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])) = prod_list (diag_mat (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])))

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])) = prod_list (diag_mat (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])))

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "\<dots> = (\<Prod>i = 0..< ?n. ?M $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (diag_mat (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]))) = (\<Prod>i = 0..<degree F - J. mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i))
[PROOF STEP]
unfolding prod_list_diag_prod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<dim_row (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):])). mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i)) = (\<Prod>i = 0..<degree F - J. mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod_list (diag_mat (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]))) = (\<Prod>i = 0..<degree F - J. mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i))

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod_list (diag_mat (mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]))) = (\<Prod>i = 0..<degree F - J. mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i))

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "\<dots> = (\<Prod>i = 0..< ?n. if i = ?n - 1 then G else [: lead_coeff G :])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<degree F - J. mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i)) = (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:])
[PROOF STEP]
by (rule prod.cong[OF refl], auto simp: coeff_int_def)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J. mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i)) = (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:])

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J. mat (degree F - J) (degree F - J) (\<lambda>(i, j). if i = degree F - J - 1 then monom (1::'a) (degree F - J - 1 - j) * G else [:coeff_int G (int (degree G) - int i + int j):]) $$ (i, i)) = (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:])

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "\<dots> = (if J < degree F then smult (lead_coeff G ^ (?n - 1)) G else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
proof (cases "J < degree F")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
J < degree F

goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
hence id: "{ 0 ..< ?n} = { 0 ..< ?n - 1} \<union> {?n - 1}"
[PROOF STATE]
proof (prove)
using this:
J < degree F

goal (1 subgoal):
 1. {0..<degree F - J} = {0..<degree F - J - 1} \<union> {degree F - J - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<degree F - J} = {0..<degree F - J - 1} \<union> {degree F - J - 1}

goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "(\<Prod>i = 0..< ?n. if i = ?n - 1 then G else [: lead_coeff G :])
      = (\<Prod>i = 0 ..< ?n - 1. if i = ?n - 1 then G else [: lead_coeff G :]) * G" (is "_ = ?P * G")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (\<Prod>i = 0..<degree F - J - 1. if i = degree F - J - 1 then G else [:lead_coeff G:]) * G
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>{0..<degree F - J - 1} \<union> {degree F - J - 1}. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (\<Prod>i = 0..<degree F - J - 1. if i = degree F - J - 1 then G else [:lead_coeff G:]) * G
[PROOF STEP]
by (subst prod.union_disjoint, auto)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (\<Prod>i = 0..<degree F - J - 1. if i = degree F - J - 1 then G else [:lead_coeff G:]) * G

goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (\<Prod>i = 0..<degree F - J - 1. if i = degree F - J - 1 then G else [:lead_coeff G:]) * G

goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "?P = (\<Prod>i = 0 ..< ?n - 1. [: lead_coeff G :])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<degree F - J - 1. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (\<Prod>i = 0..<degree F - J - 1. [:lead_coeff G:])
[PROOF STEP]
by (rule prod.cong, auto)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J - 1. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (\<Prod>i = 0..<degree F - J - 1. [:lead_coeff G:])

goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J - 1. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (\<Prod>i = 0..<degree F - J - 1. [:lead_coeff G:])

goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "\<dots> = [: lead_coeff G ^ (?n - 1) :]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<degree F - J - 1. [:lead_coeff G:]) = [:lead_coeff G ^ (degree F - J - 1):]
[PROOF STEP]
by (simp add: poly_const_pow)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J - 1. [:lead_coeff G:]) = [:lead_coeff G ^ (degree F - J - 1):]

goal (2 subgoals):
 1. J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
 2. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = [:lead_coeff G ^ (degree F - J - 1):] * G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = [:lead_coeff G ^ (degree F - J - 1):] * G

goal (1 subgoal):
 1. (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)

goal (1 subgoal):
 1. \<not> J < degree F \<Longrightarrow> (\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<degree F - J. if i = degree F - J - 1 then G else [:lead_coeff G:]) = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
subresultant J F G = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
have "subresultant J F G =
      (if J < degree F then smult (lead_coeff G ^ (degree F - J - 1)) G else 1)"
[PROOF STATE]
proof (prove)
using this:
subresultant J F G = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)

goal (1 subgoal):
 1. subresultant J F G = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
subresultant J F G = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)

goal (1 subgoal):
 1. \<not> J < degree G \<Longrightarrow> subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
subresultant J F G = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)

goal (1 subgoal):
 1. subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
using J
[PROOF STATE]
proof (prove)
using this:
subresultant J F G = (if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
\<not> J < degree G

goal (1 subgoal):
 1. subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subresultant J F G = (if J < degree G then 0 else if J < degree F then Polynomial.smult (lead_coeff G ^ (degree F - J - 1)) G else 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinality_of_utility_function :
  fixes f :: "real \<Rightarrow> real"
  assumes monot: "monotone (>) (>) f"
  shows "(f \<circ> u) x > (f \<circ> u) y \<longleftrightarrow> u x > u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((f \<circ> u) y < (f \<circ> u) x) = (u y < u x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((f \<circ> u) y < (f \<circ> u) x) = (u y < u x)
[PROOF STEP]
let ?func = "(\<lambda>x. f(u x))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((f \<circ> u) y < (f \<circ> u) x) = (u y < u x)
[PROOF STEP]
have "\<forall>m n . u m \<ge> u n \<longleftrightarrow> ?func m \<ge> ?func n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m n. (u n \<le> u m) = (f (u n) \<le> f (u m))
[PROOF STEP]
by (metis le_less monot monotone_def not_less)
[PROOF STATE]
proof (state)
this:
\<forall>m n. (u n \<le> u m) = (f (u n) \<le> f (u m))

goal (1 subgoal):
 1. ((f \<circ> u) y < (f \<circ> u) x) = (u y < u x)
[PROOF STEP]
hence "u x > u y \<longleftrightarrow> ?func x > ?func y"
[PROOF STATE]
proof (prove)
using this:
\<forall>m n. (u n \<le> u m) = (f (u n) \<le> f (u m))

goal (1 subgoal):
 1. (u y < u x) = (f (u y) < f (u x))
[PROOF STEP]
using not_le
[PROOF STATE]
proof (prove)
using this:
\<forall>m n. (u n \<le> u m) = (f (u n) \<le> f (u m))
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. (u y < u x) = (f (u y) < f (u x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(u y < u x) = (f (u y) < f (u x))

goal (1 subgoal):
 1. ((f \<circ> u) y < (f \<circ> u) x) = (u y < u x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(u y < u x) = (f (u y) < f (u x))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma consistent_imp_nonneg_constant:
  assumes "consistent x t T B p incr"
  assumes "t < T"
  shows "B \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
consistent x t T B p incr
t < T
[PROOF STEP]
have "T - t > 0"
[PROOF STATE]
proof (prove)
using this:
consistent x t T B p incr
t < T

goal (1 subgoal):
 1. 0 < T - t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < T - t

goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
have "0 \<le> dist (x T) (discrete_evolution incr T t (x t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> dist (x T) (discrete_evolution incr T t (x t))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> dist (x T) (discrete_evolution incr T t (x t))

goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> dist (x T) (discrete_evolution incr T t (x t))

goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
consistent x t T B p incr
t < T
[PROOF STEP]
have "... \<le> B * (T - t) ^ (p + 1)"
[PROOF STATE]
proof (prove)
using this:
consistent x t T B p incr
t < T

goal (1 subgoal):
 1. dist (x T) (discrete_evolution incr T t (x t)) \<le> B * (T - t) ^ (p + 1)
[PROOF STEP]
unfolding consistent_def
[PROOF STATE]
proof (prove)
using this:
\<forall>h\<ge>0. t + h \<le> T \<longrightarrow> dist (x (t + h)) (discrete_evolution incr (t + h) t (x t)) \<le> B * h ^ (p + 1)
t < T

goal (1 subgoal):
 1. dist (x T) (discrete_evolution incr T t (x t)) \<le> B * (T - t) ^ (p + 1)
[PROOF STEP]
by (auto dest: spec[where x="T - t"])
[PROOF STATE]
proof (state)
this:
dist (x T) (discrete_evolution incr T t (x t)) \<le> B * (T - t) ^ (p + 1)

goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> B * (T - t) ^ (p + 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> B * (T - t) ^ (p + 1)

goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
using zero_less_power[OF \<open>T - t > 0\<close>, of "p+1"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> B * (T - t) ^ (p + 1)
0 < (T - t) ^ (p + 1)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma between_nth_primes_imp_nonprime:
  assumes "n > nth_prime k" "n < nth_prime (Suc k)"
  shows   "\<not>prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> prime n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
nth_prime k < n
n < nth_prime (Suc k)

goal (1 subgoal):
 1. \<not> prime n
[PROOF STEP]
by (metis Suc_leI not_le nth_prime_Suc smallest_prime_beyond_smallest)


[STATEMENT]
lemma t_heap_of_A_log_bound:
  "t_heap_of_A xs \<le> length xs * (nlog2 (length xs + 1) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t_heap_of_A xs \<le> length xs * (nat \<lceil>log 2 (real (length xs + 1))\<rceil> + 1)
[PROOF STEP]
using t_heap_of_A_bound[of xs]
    acomplete_if_braun[OF braun_heap_of_A, of xs]
[PROOF STATE]
proof (prove)
using this:
t_heap_of_A xs \<le> length xs * (height (heap_of_A xs) + 1)
acomplete (heap_of_A xs)

goal (1 subgoal):
 1. t_heap_of_A xs \<le> length xs * (nat \<lceil>log 2 (real (length xs + 1))\<rceil> + 1)
[PROOF STEP]
by (simp add: height_acomplete size1_size size_heap_of_A)


[STATEMENT]
lemma sin_i_times:
  fixes z :: complex
  shows "sin(\<i> * z) = \<i> * ((exp z - inverse (exp z)) / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (\<i> * z) = \<i> * ((exp z - inverse (exp z)) / 2)
[PROOF STEP]
using sinh_complex
[PROOF STATE]
proof (prove)
using this:
(exp ?z - inverse (exp ?z)) / 2 = - \<i> * sin (\<i> * ?z)

goal (1 subgoal):
 1. sin (\<i> * z) = \<i> * ((exp z - inverse (exp z)) / 2)
[PROOF STEP]
by auto


[STATEMENT]
lemma trace_minus_linear:
  fixes A B :: "'a::comm_ring mat"
  assumes A: "A \<in> carrier_mat n n" and B: "B \<in> carrier_mat n n"
  shows "trace (A - B) = trace A - trace B" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
have "?lhs = (\<Sum>i=0..<n. A$$(i, i) - B$$(i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i) - B $$ (i, i))
[PROOF STEP]
unfolding trace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row (A - B). (A - B) $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i) - B $$ (i, i))
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row (A - B). (A - B) $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i) - B $$ (i, i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i) - B $$ (i, i))

goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i) - B $$ (i, i))

goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
have "\<dots> = (\<Sum>i=0..<n. A$$(i, i)) - (\<Sum>i=0..<n. B$$(i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. A $$ (i, i) - B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
by (auto simp add: sum_subtractf)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. A $$ (i, i) - B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
have l: "?lhs = (\<Sum>i=0..<n. A$$(i, i)) - (\<Sum>i=0..<n. B$$(i, i))"
[PROOF STATE]
proof (prove)
using this:
trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
have r: "?rhs = (\<Sum>i=0..<n. A$$(i, i)) - (\<Sum>i=0..<n. B$$(i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace A - trace B = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
unfolding trace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row A. A $$ (i, i)) - (\<Sum>i = 0..<dim_row B. B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row A. A $$ (i, i)) - (\<Sum>i = 0..<dim_row B. B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace A - trace B = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
from l r
[PROOF STATE]
proof (chain)
picking this:
trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
trace A - trace B = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trace (A - B) = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))
trace A - trace B = (\<Sum>i = 0..<n. A $$ (i, i)) - (\<Sum>i = 0..<n. B $$ (i, i))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arcsin_plus_arccos:
  assumes "-1 \<le> x" "x \<le> 1"
    shows "arcsin x + arccos x = pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcsin x + arccos x = pi / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. arcsin x + arccos x = pi / 2
[PROOF STEP]
have "arcsin x = pi/2 - arccos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcsin x = pi / 2 - arccos x
[PROOF STEP]
apply (rule sin_inj_pi)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. - (pi / 2) \<le> arcsin x
 2. arcsin x \<le> pi / 2
 3. - (pi / 2) \<le> pi / 2 - arccos x
 4. pi / 2 - arccos x \<le> pi / 2
 5. sin (arcsin x) = sin (pi / 2 - arccos x)
[PROOF STEP]
using assms arcsin [OF assms] arccos [OF assms]
[PROOF STATE]
proof (prove)
using this:
- 1 \<le> x
x \<le> 1
- (pi / 2) \<le> arcsin x \<and> arcsin x \<le> pi / 2 \<and> sin (arcsin x) = x
0 \<le> arccos x \<and> arccos x \<le> pi \<and> cos (arccos x) = x

goal (5 subgoals):
 1. - (pi / 2) \<le> arcsin x
 2. arcsin x \<le> pi / 2
 3. - (pi / 2) \<le> pi / 2 - arccos x
 4. pi / 2 - arccos x \<le> pi / 2
 5. sin (arcsin x) = sin (pi / 2 - arccos x)
[PROOF STEP]
by (auto simp: algebra_simps sin_diff)
[PROOF STATE]
proof (state)
this:
arcsin x = pi / 2 - arccos x

goal (1 subgoal):
 1. arcsin x + arccos x = pi / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
arcsin x = pi / 2 - arccos x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
arcsin x = pi / 2 - arccos x

goal (1 subgoal):
 1. arcsin x + arccos x = pi / 2
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
arcsin x + arccos x = pi / 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Module) mHom_ker_eq:"\<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M;
      b\<in> carrier M; f a = f b\<rbrakk> \<Longrightarrow> a \<plusminus> (-\<^sub>a b) \<in> ker\<^bsub>M,N\<^esub> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; f a = f b\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b \<in> ker\<^bsub>M,N\<^esub> f
[PROOF STEP]
apply (simp add:ker_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; f a = f b\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b \<in> carrier M \<and> f (a \<plusminus> -\<^sub>a b) = \<zero>\<^bsub>N\<^esub>
[PROOF STEP]
apply (frule ag_mOp_closed[of b])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; f a = f b; -\<^sub>a b \<in> carrier M\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b \<in> carrier M \<and> f (a \<plusminus> -\<^sub>a b) = \<zero>\<^bsub>N\<^esub>
[PROOF STEP]
apply (simp add:ag_pOp_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; f a = f b; -\<^sub>a b \<in> carrier M\<rbrakk> \<Longrightarrow> f (a \<plusminus> -\<^sub>a b) = \<zero>\<^bsub>N\<^esub>
[PROOF STEP]
apply (simp add:mHom_add mHom_inv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; f a = f b; -\<^sub>a b \<in> carrier M\<rbrakk> \<Longrightarrow> f b \<plusminus>\<^bsub>N\<^esub> -\<^sub>a\<^bsub>N\<^esub> f b = \<zero>\<^bsub>N\<^esub>
[PROOF STEP]
apply (frule mHom_mem [of N f b], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; f a = f b; -\<^sub>a b \<in> carrier M; f b \<in> carrier N\<rbrakk> \<Longrightarrow> f b \<plusminus>\<^bsub>N\<^esub> -\<^sub>a\<^bsub>N\<^esub> f b = \<zero>\<^bsub>N\<^esub>
[PROOF STEP]
apply (frule_tac R = R and M = N in Module.module_is_ag,
        simp add:aGroup.ag_r_inv1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cong_iff_lin_poly: "([(a::'b::{field_gcd} poly) = b] (mod m)) = (\<exists>k. b = a + m * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a = b] (mod m) = (\<exists>k. b = a + m * k)
[PROOF STEP]
using cong_diff_iff_cong_0 [of b a m]
[PROOF STATE]
proof (prove)
using this:
[b - a = 0] (mod m) = [b = a] (mod m)

goal (1 subgoal):
 1. [a = b] (mod m) = (\<exists>k. b = a + m * k)
[PROOF STEP]
by (auto simp add: cong_0_iff dvd_def algebra_simps dest: cong_sym)


[STATEMENT]
theorem Units_bijective:
  "Units = {\<alpha> \<in> S \<rightarrow>\<^sub>E S. bij_betw \<alpha> S S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Units = {\<alpha> \<in> S \<rightarrow>\<^sub>E S. bij_betw \<alpha> S S}
[PROOF STEP]
unfolding Units_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {u \<in> S \<rightarrow>\<^sub>E S. invertible u} = {\<alpha> \<in> S \<rightarrow>\<^sub>E S. bij_betw \<alpha> S S}
[PROOF STEP]
by (auto simp add: invertible_is_bijective)


[STATEMENT]
lemma onorm_id: "onorm (\<lambda>x. x::'a::{real_normed_vector, perfect_space}) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (\<lambda>x. x) = 1
[PROOF STEP]
proof (rule antisym[OF onorm_id_le])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> onorm (\<lambda>x. x)
[PROOF STEP]
have "{0::'a} \<noteq> UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0::'a} \<noteq> UNIV
[PROOF STEP]
by (metis not_open_singleton open_UNIV)
[PROOF STATE]
proof (state)
this:
{0::'a} \<noteq> UNIV

goal (1 subgoal):
 1. 1 \<le> onorm (\<lambda>x. x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{0::'a} \<noteq> UNIV
[PROOF STEP]
obtain x :: 'a where "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
{0::'a} \<noteq> UNIV

goal (1 subgoal):
 1. (\<And>x. x \<noteq> (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. 1 \<le> onorm (\<lambda>x. x)
[PROOF STEP]
hence "1 \<le> norm x / norm x"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

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

goal (1 subgoal):
 1. 1 \<le> onorm (\<lambda>x. x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 \<le> norm x / norm x

goal (1 subgoal):
 1. 1 \<le> onorm (\<lambda>x. x)
[PROOF STEP]
have "\<dots> \<le> onorm (\<lambda>x::'a. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x / norm x \<le> onorm (\<lambda>x. x)
[PROOF STEP]
by (rule le_onorm) (rule bounded_linear_ident)
[PROOF STATE]
proof (state)
this:
norm x / norm x \<le> onorm (\<lambda>x. x)

goal (1 subgoal):
 1. 1 \<le> onorm (\<lambda>x. x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 \<le> onorm (\<lambda>x. x)
[PROOF STEP]
show "1 \<le> onorm (\<lambda>x::'a. x)"
[PROOF STATE]
proof (prove)
using this:
1 \<le> onorm (\<lambda>x. x)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_not_univ_orthogonal:
  fixes S :: "'a::euclidean_space set"
  assumes sU: "span S \<noteq> UNIV"
  shows "\<exists>a::'a. a \<noteq> 0 \<and> (\<forall>x \<in> span S. a \<bullet> x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
from sU
[PROOF STATE]
proof (chain)
picking this:
span S \<noteq> UNIV
[PROOF STEP]
obtain a where a: "a \<notin> span S"
[PROOF STATE]
proof (prove)
using this:
span S \<noteq> UNIV

goal (1 subgoal):
 1. (\<And>a. a \<notin> span S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<notin> span S

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
from orthogonal_basis_exists
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. independent B \<and> B \<subseteq> span ?V \<and> ?V \<subseteq> span B \<and> card B = dim ?V \<and> pairwise orthogonal B
[PROOF STEP]
obtain B where
    B: "independent B" "B \<subseteq> span S" "S \<subseteq> span B"
    "card B = dim S" "pairwise orthogonal B"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. independent B \<and> B \<subseteq> span ?V \<and> ?V \<subseteq> span B \<and> card B = dim ?V \<and> pairwise orthogonal B

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>independent B; B \<subseteq> span S; S \<subseteq> span B; card B = dim S; pairwise orthogonal B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
independent B
B \<subseteq> span S
S \<subseteq> span B
card B = dim S
pairwise orthogonal B

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
from B
[PROOF STATE]
proof (chain)
picking this:
independent B
B \<subseteq> span S
S \<subseteq> span B
card B = dim S
pairwise orthogonal B
[PROOF STEP]
have fB: "finite B" "card B = dim S"
[PROOF STATE]
proof (prove)
using this:
independent B
B \<subseteq> span S
S \<subseteq> span B
card B = dim S
pairwise orthogonal B

goal (1 subgoal):
 1. finite B &&& card B = dim S
[PROOF STEP]
using independent_bound
[PROOF STATE]
proof (prove)
using this:
independent B
B \<subseteq> span S
S \<subseteq> span B
card B = dim S
pairwise orthogonal B
independent ?S \<Longrightarrow> finite ?S \<and> card ?S \<le> DIM(?'a)

goal (1 subgoal):
 1. finite B &&& card B = dim S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite B
card B = dim S

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
from span_mono[OF B(2)] span_mono[OF B(3)]
[PROOF STATE]
proof (chain)
picking this:
span B \<subseteq> span (span S)
span S \<subseteq> span (span B)
[PROOF STEP]
have sSB: "span S = span B"
[PROOF STATE]
proof (prove)
using this:
span B \<subseteq> span (span S)
span S \<subseteq> span (span B)

goal (1 subgoal):
 1. span S = span B
[PROOF STEP]
by (simp add: span_span)
[PROOF STATE]
proof (state)
this:
span S = span B

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
let ?a = "a - sum (\<lambda>b. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) B"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
have "sum (\<lambda>b. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) B \<in> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<in> span S
[PROOF STEP]
unfolding sSB
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<in> span B
[PROOF STEP]
apply (rule span_sum)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a \<bullet> x / (x \<bullet> x)) *\<^sub>R x \<in> span B
[PROOF STEP]
apply (rule span_scale)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> x \<in> span B
[PROOF STEP]
apply (rule span_base)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> x \<in> B
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<in> span S

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
a \<notin> span S
(\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<in> span S
[PROOF STEP]
have a0:"?a  \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
a \<notin> span S
(\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<in> span S

goal (1 subgoal):
 1. a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
have "?a \<bullet> x = 0" if "x\<in>span B" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
proof (rule span_induct [OF that])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subspace {b. (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> b = 0}
 2. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
show "subspace {x. ?a \<bullet> x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace {x. (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0}
[PROOF STEP]
by (auto simp add: subspace_def inner_add)
[PROOF STATE]
proof (state)
this:
subspace {x. (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0}

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
assume x: "x \<in> B"
[PROOF STATE]
proof (state)
this:
x \<in> B

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> B
[PROOF STEP]
have B': "B = insert x (B - {x})"
[PROOF STATE]
proof (prove)
using this:
x \<in> B

goal (1 subgoal):
 1. B = insert x (B - {x})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B = insert x (B - {x})

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
have fth: "finite (B - {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (B - {x})
[PROOF STEP]
using fB
[PROOF STATE]
proof (prove)
using this:
finite B
card B = dim S

goal (1 subgoal):
 1. finite (B - {x})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (B - {x})

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
have "?a \<bullet> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
apply (subst B')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - (\<Sum>b\<in>insert x (B - {x}). (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
using fB fth
[PROOF STATE]
proof (prove)
using this:
finite B
card B = dim S
finite (B - {x})

goal (1 subgoal):
 1. (a - (\<Sum>b\<in>insert x (B - {x}). (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
unfolding sum_clauses(2)[OF fth]
[PROOF STATE]
proof (prove)
using this:
finite B
card B = dim S
finite (B - {x})

goal (1 subgoal):
 1. (a - (if x \<in> B - {x} then \<Sum>b\<in>B - {x}. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b else (a \<bullet> x / (x \<bullet> x)) *\<^sub>R x + (\<Sum>b\<in>B - {x}. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b))) \<bullet> x = 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite B; card B = dim S\<rbrakk> \<Longrightarrow> (a - ((a \<bullet> x / (x \<bullet> x)) *\<^sub>R x + (\<Sum>b\<in>B - {x}. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b))) \<bullet> x = 0
[PROOF STEP]
unfolding inner_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite B; card B = dim S\<rbrakk> \<Longrightarrow> a \<bullet> x - (a \<bullet> x / (x \<bullet> x) * (x \<bullet> x) + (\<Sum>b\<in>B - {x}. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<bullet> x) = 0
[PROOF STEP]
apply (clarsimp simp add: inner_add inner_sum_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite B; card B = dim S; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<Sum>b\<in>B - {x}. a \<bullet> b * (b \<bullet> x) / (b \<bullet> b)) = 0
[PROOF STEP]
apply (rule sum.neutral, rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>finite B; card B = dim S; x \<noteq> (0::'a); x \<in> B - {x}\<rbrakk> \<Longrightarrow> a \<bullet> x * (x \<bullet> x) / (x \<bullet> x) = 0
[PROOF STEP]
apply (simp only: inner_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>finite B; card B = dim S; x \<noteq> (0::'a); x \<in> B - {x}\<rbrakk> \<Longrightarrow> x \<bullet> a * (x \<bullet> x) / (x \<bullet> x) = 0
[PROOF STEP]
apply (auto simp add: x field_simps
          intro: B(5)[unfolded pairwise_def orthogonal_def, rule_format])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?xa2 \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?xa2 = 0

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?xa2 \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?xa2 = 0
[PROOF STEP]
show "?a \<bullet> x = 0" if "x \<in> B" for x
[PROOF STATE]
proof (prove)
using this:
?xa2 \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?xa2 = 0

goal (1 subgoal):
 1. (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?xa2 \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?xa2 = 0
x \<in> B

goal (1 subgoal):
 1. (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> x = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?x = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> span B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?x = 0

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
with a0
[PROOF STATE]
proof (chain)
picking this:
a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<noteq> (0::'a)
?x \<in> span B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<noteq> (0::'a)
?x \<in> span B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?x = 0

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)
[PROOF STEP]
unfolding sSB
[PROOF STATE]
proof (prove)
using this:
a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b) \<noteq> (0::'a)
?x \<in> span B \<Longrightarrow> (a - (\<Sum>b\<in>B. (a \<bullet> b / (b \<bullet> b)) *\<^sub>R b)) \<bullet> ?x = 0

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span B. a \<bullet> x = 0)
[PROOF STEP]
by (auto intro: exI[where x="?a"])
[PROOF STATE]
proof (state)
this:
\<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>span S. a \<bullet> x = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cInf_asclose:
  fixes S :: "'a::{linordered_idom,conditionally_complete_linorder} set"
  assumes S: "S \<noteq> {}"
    and b: "\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e"
  shows "\<bar>Inf S - l\<bar> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Inf S - l\<bar> \<le> e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>Inf S - l\<bar> \<le> e
[PROOF STEP]
have *: "\<bar>x - l\<bar> \<le> e \<longleftrightarrow> l - e \<le> x \<and> x \<le> l + e" for x l e :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>x - l\<bar> \<le> e) = (l - e \<le> x \<and> x \<le> l + e)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
(\<bar>?x - ?l\<bar> \<le> ?e) = (?l - ?e \<le> ?x \<and> ?x \<le> ?l + ?e)

goal (1 subgoal):
 1. \<bar>Inf S - l\<bar> \<le> e
[PROOF STEP]
have "bdd_below S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_below S
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e

goal (1 subgoal):
 1. bdd_below S
[PROOF STEP]
by (auto intro!: bdd_belowI[of _ "l - e"])
[PROOF STATE]
proof (state)
this:
bdd_below S

goal (1 subgoal):
 1. \<bar>Inf S - l\<bar> \<le> e
[PROOF STEP]
with S b
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e
bdd_below S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e
bdd_below S

goal (1 subgoal):
 1. \<bar>Inf S - l\<bar> \<le> e
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
\<forall>x\<in>S. l - e \<le> x \<and> x \<le> l + e
bdd_below S

goal (1 subgoal):
 1. l - e \<le> Inf S \<and> Inf S \<le> l + e
[PROOF STEP]
by (auto intro!: cInf_lower2 cInf_greatest)
[PROOF STATE]
proof (state)
this:
\<bar>Inf S - l\<bar> \<le> e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Func_singleton:
fixes x :: 'b and A :: "'a set"
shows "|Func A {x}| =o |{x}|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Func A {x}| =o |{x}|
[PROOF STEP]
proof (rule ordIso_symmetric)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |{x}| =o |Func A {x}|
[PROOF STEP]
define f where [abs_def]: "f y a = (if y = x \<and> a \<in> A then x else undefined)" for y a
[PROOF STATE]
proof (state)
this:
f \<equiv> \<lambda>y a. if y = x \<and> a \<in> A then x else undefined

goal (1 subgoal):
 1. |{x}| =o |Func A {x}|
[PROOF STEP]
have "Func A {x} \<subseteq> f ` {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Func A {x} \<subseteq> f ` {x}
[PROOF STEP]
unfolding f_def Func_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. (\<forall>a\<in>A. f a \<in> {x}) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)} \<subseteq> (\<lambda>y a. if y = x \<and> a \<in> A then x else undefined) ` {x}
[PROOF STEP]
by (force simp: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
Func A {x} \<subseteq> f ` {x}

goal (1 subgoal):
 1. |{x}| =o |Func A {x}|
[PROOF STEP]
hence "bij_betw f {x} (Func A {x})"
[PROOF STATE]
proof (prove)
using this:
Func A {x} \<subseteq> f ` {x}

goal (1 subgoal):
 1. bij_betw f {x} (Func A {x})
[PROOF STEP]
unfolding bij_betw_def inj_on_def f_def Func_def
[PROOF STATE]
proof (prove)
using this:
{f. (\<forall>a\<in>A. f a \<in> {x}) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)} \<subseteq> (\<lambda>y a. if y = x \<and> a \<in> A then x else undefined) ` {x}

goal (1 subgoal):
 1. (\<forall>xa\<in>{x}. \<forall>y\<in>{x}. (\<lambda>a. if xa = x \<and> a \<in> A then x else undefined) = (\<lambda>a. if y = x \<and> a \<in> A then x else undefined) \<longrightarrow> xa = y) \<and> (\<lambda>y a. if y = x \<and> a \<in> A then x else undefined) ` {x} = {f. (\<forall>a\<in>A. f a \<in> {x}) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)}
[PROOF STEP]
by (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
bij_betw f {x} (Func A {x})

goal (1 subgoal):
 1. |{x}| =o |Func A {x}|
[PROOF STEP]
thus "|{x}| =o |Func A {x}|"
[PROOF STATE]
proof (prove)
using this:
bij_betw f {x} (Func A {x})

goal (1 subgoal):
 1. |{x}| =o |Func A {x}|
[PROOF STEP]
using card_of_ordIso
[PROOF STATE]
proof (prove)
using this:
bij_betw f {x} (Func A {x})
(\<exists>f. bij_betw f ?A ?B) = (|?A| =o |?B|)

goal (1 subgoal):
 1. |{x}| =o |Func A {x}|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|{x}| =o |Func A {x}|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem (in group) group_inverse_times: "inverse (x * y) = inverse y * inverse x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (x * y) = inverse y * inverse x
[PROOF STEP]
proof (rule group_inverse_equality)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
show "(inverse y * inverse x) * (x * y) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
have "(inverse y * inverse x) * (x * y) =
        (inverse y * (inverse x * x)) * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = inverse y * (inverse x * x) * y
[PROOF STEP]
by (simp only: group_assoc)
[PROOF STATE]
proof (state)
this:
inverse y * inverse x * (x * y) = inverse y * (inverse x * x) * y

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse y * inverse x * (x * y) = inverse y * (inverse x * x) * y

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
have "\<dots> = (inverse y * 1) * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse y * (inverse x * x) * y = inverse y * (1::'a) * y
[PROOF STEP]
by (simp only: group_left_inverse)
[PROOF STATE]
proof (state)
this:
inverse y * (inverse x * x) * y = inverse y * (1::'a) * y

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse y * (inverse x * x) * y = inverse y * (1::'a) * y

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
have "\<dots> = inverse y * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse y * (1::'a) * y = inverse y * y
[PROOF STEP]
by (simp only: group_right_one)
[PROOF STATE]
proof (state)
this:
inverse y * (1::'a) * y = inverse y * y

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse y * (1::'a) * y = inverse y * y

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse y * y = (1::'a)
[PROOF STEP]
by (simp only: group_left_inverse)
[PROOF STATE]
proof (state)
this:
inverse y * y = (1::'a)

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inverse y * inverse x * (x * y) = (1::'a)

goal (1 subgoal):
 1. inverse y * inverse x * (x * y) = (1::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inverse y * inverse x * (x * y) = (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inverse y * inverse x * (x * y) = (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma union_term_w[simp]:  "(\<Union>w. {s. t s = w}) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>w. {s. t s = w}) = UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma pr_index_enumerator_mono2: "m1 < m2 \<Longrightarrow> pr_index_enumerator n m1 < pr_index_enumerator n m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m1 < m2 \<Longrightarrow> pr_index_enumerator n m1 < pr_index_enumerator n m2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m1 < m2 \<Longrightarrow> pr_index_enumerator n m1 < pr_index_enumerator n m2
[PROOF STEP]
assume A: "m1 < m2"
[PROOF STATE]
proof (state)
this:
m1 < m2

goal (1 subgoal):
 1. m1 < m2 \<Longrightarrow> pr_index_enumerator n m1 < pr_index_enumerator n m2
[PROOF STEP]
define f where "f x = pr_index_enumerator n x" for x
[PROOF STATE]
proof (state)
this:
f ?x = pr_index_enumerator n ?x

goal (1 subgoal):
 1. m1 < m2 \<Longrightarrow> pr_index_enumerator n m1 < pr_index_enumerator n m2
[PROOF STEP]
have f_inc: "\<forall> x. f x < f (x+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f x < f (x + 1)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f x < f (x + 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f x < f (x + 1)
[PROOF STEP]
show "f x < f (x+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x < f (x + 1)
[PROOF STEP]
by (unfold f_def, rule pr_index_enumerator_increase2)
[PROOF STATE]
proof (state)
this:
f x < f (x + 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x. f x < f (x + 1)

goal (1 subgoal):
 1. m1 < m2 \<Longrightarrow> pr_index_enumerator n m1 < pr_index_enumerator n m2
[PROOF STEP]
from f_inc
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. f x < f (x + 1)
[PROOF STEP]
have "\<forall> x y. (x < y \<longrightarrow> f x < f y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. f x < f (x + 1)

goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> f x < f y
[PROOF STEP]
by (rule f_inc_mono)
[PROOF STATE]
proof (state)
this:
\<forall>x y. x < y \<longrightarrow> f x < f y

goal (1 subgoal):
 1. m1 < m2 \<Longrightarrow> pr_index_enumerator n m1 < pr_index_enumerator n m2
[PROOF STEP]
with A f_def
[PROOF STATE]
proof (chain)
picking this:
m1 < m2
f ?x = pr_index_enumerator n ?x
\<forall>x y. x < y \<longrightarrow> f x < f y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m1 < m2
f ?x = pr_index_enumerator n ?x
\<forall>x y. x < y \<longrightarrow> f x < f y

goal (1 subgoal):
 1. pr_index_enumerator n m1 < pr_index_enumerator n m2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pr_index_enumerator n m1 < pr_index_enumerator n m2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_subset_negligible:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: banach"
  assumes "S \<subseteq> T" "negligible (T - S)"
  shows   "integral S f = integral T f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
have "integral T f = integral T (\<lambda>x. if x \<in> S then f x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral T f = integral T (\<lambda>x. if x \<in> S then f x else (0::'b))
[PROOF STEP]
by (rule integral_spike[of "T - S"]) (use assms in auto)
[PROOF STATE]
proof (state)
this:
integral T f = integral T (\<lambda>x. if x \<in> S then f x else (0::'b))

goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral T f = integral T (\<lambda>x. if x \<in> S then f x else (0::'b))

goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
have "\<dots> = integral (S \<inter> T) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral T (\<lambda>x. if x \<in> S then f x else (0::'b)) = integral (S \<inter> T) f
[PROOF STEP]
by (subst integral_restrict_Int) auto
[PROOF STATE]
proof (state)
this:
integral T (\<lambda>x. if x \<in> S then f x else (0::'b)) = integral (S \<inter> T) f

goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral T (\<lambda>x. if x \<in> S then f x else (0::'b)) = integral (S \<inter> T) f

goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
have "S \<inter> T = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> T = S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> T
negligible (T - S)

goal (1 subgoal):
 1. S \<inter> T = S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<inter> T = S

goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral T f = integral S f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral T f = integral S f

goal (1 subgoal):
 1. integral S f = integral T f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
integral S f = integral T f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma q63_upto_def: "q63 = (\<lambda>k. k\<^sup>2 mod 63) ` {..<63}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q63 = (\<lambda>k. k\<^sup>2 mod 63) ` {..<63}
[PROOF STEP]
by (simp add: q63_def lessThan_nat_numeral lessThan_Suc insert_commute)


[STATEMENT]
lemma row_all1_matrix:
assumes "i < nr"
shows "row (all1_matrix nr nc) i = all1_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (all1_matrix nr nc) i = all1_vec nc
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ia. ia < dim_vec (all1_vec nc) \<Longrightarrow> row (all1_matrix nr nc) i $ ia = all1_vec nc $ ia
 2. dim_vec (row (all1_matrix nr nc) i) = dim_vec (all1_vec nc)
[PROOF STEP]
apply (simp add: all1_matrix_def all1_vec_def assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (row (all1_matrix nr nc) i) = dim_vec (all1_vec nc)
[PROOF STEP]
by (simp add: all1_matrix_def all1_vec_def)


[STATEMENT]
lemma unitary_is_length_preserving [simp]:
  fixes U:: "complex mat" and v:: "complex vec"
  assumes "unitary U" and "dim_vec v = dim_col U"
  shows "\<parallel>U * |v\<rangle>\<parallel> = \<parallel>v\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel> = \<parallel>v\<parallel>
[PROOF STEP]
using assms unitary_is_sq_length_preserving
[PROOF STATE]
proof (prove)
using this:
unitary U
dim_vec v = dim_col U
\<lbrakk>unitary ?U; dim_vec ?v = dim_col ?U\<rbrakk> \<Longrightarrow> \<parallel>col_fst (?U * |?v\<rangle>)\<parallel>\<^sup>2 = \<parallel>?v\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel> = \<parallel>v\<parallel>
[PROOF STEP]
by (metis cpx_vec_length_inner_prod inner_prod_csqrt of_real_hom.injectivity)


[STATEMENT]
lemma norm_ge_square: "norm x \<ge> a \<longleftrightarrow> a \<le> 0 \<or> inner x x \<ge> a\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> norm x) = (a \<le> 0 \<or> a\<^sup>2 \<le> inner x x)
[PROOF STEP]
apply (simp add: dot_square_norm abs_le_square_iff[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> norm x) = (a \<le> 0 \<or> \<bar>a\<bar> \<le> norm x)
[PROOF STEP]
using norm_ge_zero[of x]
[PROOF STATE]
proof (prove)
using this:
0 \<le> norm x

goal (1 subgoal):
 1. (a \<le> norm x) = (a \<le> 0 \<or> \<bar>a\<bar> \<le> norm x)
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma uedge_eq_iff: "uedge (a,b) = uedge (c,d) \<longleftrightarrow> a=c \<and> b=d \<or> a=d \<and> b=c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (uedge (a, b) = uedge (c, d)) = (a = c \<and> b = d \<or> a = d \<and> b = c)
[PROOF STEP]
by (auto simp: uedge_def doubleton_eq_iff)


[STATEMENT]
lemma Sigma_mset_plus_distrib2[simp]:
  "Sigma_mset A (\<lambda>i. B i + C i) = Sigma_mset A B + Sigma_mset A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SIGMAMSET i\<in>#A. B i + C i) = Sigma_mset A B + Sigma_mset A C
[PROOF STEP]
unfolding Sigma_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>#A. image_mset (Pair a) (B a + C a)) = (\<Sum>a\<in>#A. image_mset (Pair a) (B a)) + (\<Sum>a\<in>#A. image_mset (Pair a) (C a))
[PROOF STEP]
by (induction A) (auto simp: multiset_eq_iff)


[STATEMENT]
lemma lm143:
  assumes "card (Pow A) = 1"
  shows "A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card (Pow A) = 1

goal (1 subgoal):
 1. A = {}
[PROOF STEP]
by (metis Pow_bottom Pow_top cardinalityOneTheElemIdentity singletonD)