[STATEMENT]
lemma not_proj2_set_Col_iff_span:
  assumes "card S = 3"
  shows "\<not> proj2_set_Col S \<longleftrightarrow> span (proj2_rep ` S) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
from \<open>card S = 3\<close> and choose_3 [of S]
[PROOF STATE]
proof (chain)
picking this:
card S = 3
card S = 3 \<Longrightarrow> \<exists>x y z. S = {x, y, z}
[PROOF STEP]
obtain p and q and r where "S = {p,q,r}"
[PROOF STATE]
proof (prove)
using this:
card S = 3
card S = 3 \<Longrightarrow> \<exists>x y z. S = {x, y, z}

goal (1 subgoal):
 1. (\<And>p q r. S = {p, q, r} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = {p, q, r}

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
let ?u = "proj2_rep p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
let ?v = "proj2_rep q"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
let ?w = "proj2_rep r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
let ?M = "vector [?u, ?v, ?w] :: real^3^3"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
from \<open>S = {p,q,r}\<close> and not_invertible_iff_proj2_set_Col [of p q r]
[PROOF STATE]
proof (chain)
picking this:
S = {p, q, r}
(\<not> invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = proj2_set_Col {p, q, r}
[PROOF STEP]
have "\<not> proj2_set_Col S \<longleftrightarrow> invertible ?M"
[PROOF STATE]
proof (prove)
using this:
S = {p, q, r}
(\<not> invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<not> proj2_set_Col S) = invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<not> proj2_set_Col S) = invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
from left_invertible_iff_invertible
[PROOF STATE]
proof (chain)
picking this:
(\<exists>N. N ** ?M = mat 1) = invertible ?M
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<exists> N. N ** ?M = mat 1)"
[PROOF STATE]
proof (prove)
using this:
(\<exists>N. N ** ?M = mat 1) = invertible ?M

goal (1 subgoal):
 1. invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = (\<exists>N. N ** vector [proj2_rep p, proj2_rep q, proj2_rep r] = mat 1)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = (\<exists>N. N ** vector [proj2_rep p, proj2_rep q, proj2_rep r] = mat 1)

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
invertible (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = (\<exists>N. N ** vector [proj2_rep p, proj2_rep q, proj2_rep r] = mat 1)

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
from matrix_left_invertible_span_rows
[PROOF STATE]
proof (chain)
picking this:
(\<exists>B. B ** ?A = mat 1) = (span (rows ?A) = UNIV)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> span (rows ?M) = UNIV"
[PROOF STATE]
proof (prove)
using this:
(\<exists>B. B ** ?A = mat 1) = (span (rows ?A) = UNIV)

goal (1 subgoal):
 1. (\<exists>N. N ** vector [proj2_rep p, proj2_rep q, proj2_rep r] = mat 1) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>N. N ** vector [proj2_rep p, proj2_rep q, proj2_rep r] = mat 1) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<not> proj2_set_Col S) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)
[PROOF STEP]
have "\<not> proj2_set_Col S \<longleftrightarrow> span (rows ?M) = UNIV"
[PROOF STATE]
proof (prove)
using this:
(\<not> proj2_set_Col S) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<not> proj2_set_Col S) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
have "rows ?M = {?u, ?v, ?w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = {proj2_rep p, proj2_rep q, proj2_rep r}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
assume "x \<in> rows ?M"
[PROOF STATE]
proof (state)
this:
x \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
obtain i :: 3  where "x = ?M $ i"
[PROOF STATE]
proof (prove)
using this:
x \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal (1 subgoal):
 1. (\<And>i. x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ i \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding rows_def and row_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {vec_lambda (($) (vector [proj2_rep p, proj2_rep q, proj2_rep r] $ i)) |i. i \<in> UNIV}

goal (1 subgoal):
 1. (\<And>i. x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ i \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: vec_lambda_beta vec_lambda_eta)
[PROOF STATE]
proof (state)
this:
x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ i

goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
with exhaust_3
[PROOF STATE]
proof (chain)
picking this:
?x = 1 \<or> ?x = 2 \<or> ?x = 3
x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ i
[PROOF STEP]
have "x = ?u \<or> x = ?v \<or> x = ?w"
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2 \<or> ?x = 3
x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ i

goal (1 subgoal):
 1. x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r
[PROOF STEP]
unfolding vector_def
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2 \<or> ?x = 3
x = vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [proj2_rep p, proj2_rep q, proj2_rep r] (\<lambda>n x. 0) 1) $ i

goal (1 subgoal):
 1. x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r

goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
hence "x \<in> {?u, ?v, ?w}"
[PROOF STATE]
proof (prove)
using this:
x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r

goal (1 subgoal):
 1. x \<in> {proj2_rep p, proj2_rep q, proj2_rep r}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> {proj2_rep p, proj2_rep q, proj2_rep r}

goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<Longrightarrow> ?x2 \<in> {proj2_rep p, proj2_rep q, proj2_rep r}

goal (2 subgoals):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
 2. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
thus "rows ?M \<subseteq> {?u, ?v, ?w}"
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<Longrightarrow> ?x2 \<in> {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) \<subseteq> {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
assume "x \<in> {?u, ?v, ?w}"
[PROOF STATE]
proof (state)
this:
x \<in> {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
hence "x = ?u \<or> x = ?v \<or> x = ?w"
[PROOF STATE]
proof (prove)
using this:
x \<in> {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
hence "x = ?M $ 1 \<or> x = ?M $ 2 \<or> x = ?M $ 3"
[PROOF STATE]
proof (prove)
using this:
x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r

goal (1 subgoal):
 1. x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 1 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 2 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 3
[PROOF STEP]
unfolding vector_def
[PROOF STATE]
proof (prove)
using this:
x = proj2_rep p \<or> x = proj2_rep q \<or> x = proj2_rep r

goal (1 subgoal):
 1. x = vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [proj2_rep p, proj2_rep q, proj2_rep r] (\<lambda>n x. 0) 1) $ 1 \<or> x = vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [proj2_rep p, proj2_rep q, proj2_rep r] (\<lambda>n x. 0) 1) $ 2 \<or> x = vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [proj2_rep p, proj2_rep q, proj2_rep r] (\<lambda>n x. 0) 1) $ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 1 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 2 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 3

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
hence "x \<in> rows ?M"
[PROOF STATE]
proof (prove)
using this:
x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 1 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 2 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 3

goal (1 subgoal):
 1. x \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
unfolding rows_def row_def vec_lambda_eta
[PROOF STATE]
proof (prove)
using this:
x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 1 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 2 \<or> x = vector [proj2_rep p, proj2_rep q, proj2_rep r] $ 3

goal (1 subgoal):
 1. x \<in> {vector [proj2_rep p, proj2_rep q, proj2_rep r] $ i |i. i \<in> UNIV}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {proj2_rep p, proj2_rep q, proj2_rep r} \<Longrightarrow> ?x2 \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
thus "{?u, ?v, ?w} \<subseteq> rows ?M"
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> {proj2_rep p, proj2_rep q, proj2_rep r} \<Longrightarrow> ?x2 \<in> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal (1 subgoal):
 1. {proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
{proj2_rep p, proj2_rep q, proj2_rep r} \<subseteq> rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
with \<open>S = {p,q,r}\<close>
[PROOF STATE]
proof (chain)
picking this:
S = {p, q, r}
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = {proj2_rep p, proj2_rep q, proj2_rep r}
[PROOF STEP]
have "rows ?M = proj2_rep ` S"
[PROOF STATE]
proof (prove)
using this:
S = {p, q, r}
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = proj2_rep ` S
[PROOF STEP]
unfolding image_def
[PROOF STATE]
proof (prove)
using this:
S = {p, q, r}
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = {proj2_rep p, proj2_rep q, proj2_rep r}

goal (1 subgoal):
 1. rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = {y. \<exists>x\<in>S. y = proj2_rep x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = proj2_rep ` S

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
with \<open>\<not> proj2_set_Col S \<longleftrightarrow> span (rows ?M) = UNIV\<close>
[PROOF STATE]
proof (chain)
picking this:
(\<not> proj2_set_Col S) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = proj2_rep ` S
[PROOF STEP]
show "\<not> proj2_set_Col S \<longleftrightarrow> span (proj2_rep ` S) = UNIV"
[PROOF STATE]
proof (prove)
using this:
(\<not> proj2_set_Col S) = (span (rows (vector [proj2_rep p, proj2_rep q, proj2_rep r])) = UNIV)
rows (vector [proj2_rep p, proj2_rep q, proj2_rep r]) = proj2_rep ` S

goal (1 subgoal):
 1. (\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<not> proj2_set_Col S) = (span (proj2_rep ` S) = UNIV)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma resultant_smult_left: assumes "(c :: 'a :: idom) \<noteq> 0"
  shows "resultant (smult c f) g = c ^ degree g * resultant f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant (Polynomial.smult c f) g = c ^ degree g * resultant f g
[PROOF STEP]
unfolding coeff_subresultant_0_0_resultant[symmetric] subresultant_smult_left[OF assms] coeff_smult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ^ (degree g - 0) * coeff (subresultant 0 f g) 0 = c ^ degree g * coeff (subresultant 0 f g) 0
[PROOF STEP]
by simp


[STATEMENT]
lemma connected_component_1_gen:
  fixes S :: "'a :: euclidean_space set"
  assumes "DIM('a) = 1"
  shows "connected_component S a b \<longleftrightarrow> closed_segment a b \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_component S a b = (closed_segment a b \<subseteq> S)
[PROOF STEP]
unfolding connected_component_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>T. connected T \<and> T \<subseteq> S \<and> a \<in> T \<and> b \<in> T) = (closed_segment a b \<subseteq> S)
[PROOF STEP]
by (metis (no_types, lifting) assms subsetD subsetI convex_contains_segment convex_segment(1)
            ends_in_segment connected_convex_1_gen)


[STATEMENT]
lemma genby_eq_sum_lists: "\<langle>S\<rangle> = (\<Union>ss\<in>lists (S \<union> uminus ` S). {sum_list ss})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>S\<rangle> = (\<Union>ss\<in>lists (S \<union> uminus ` S). {sum_list ss})
[PROOF STEP]
using genby_in_sum_list_lists sum_list_lists_in_genby
[PROOF STATE]
proof (prove)
using this:
?w \<in> \<langle>?S\<rangle> \<Longrightarrow> ?w \<in> (\<Union>ss\<in>lists (?S \<union> uminus ` ?S). {sum_list ss})
?ss \<in> lists (?S \<union> uminus ` ?S) \<Longrightarrow> sum_list ?ss \<in> \<langle>?S\<rangle>

goal (1 subgoal):
 1. \<langle>S\<rangle> = (\<Union>ss\<in>lists (S \<union> uminus ` S). {sum_list ss})
[PROOF STEP]
by fast


[STATEMENT]
lemma span_unique:
  "S \<subseteq> T \<Longrightarrow> subspace T \<Longrightarrow> (\<And>T'. S \<subseteq> T' \<Longrightarrow> subspace T' \<Longrightarrow> T \<subseteq> T') \<Longrightarrow> span S = T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; subspace T; \<And>T'. \<lbrakk>S \<subseteq> T'; subspace T'\<rbrakk> \<Longrightarrow> T \<subseteq> T'\<rbrakk> \<Longrightarrow> span S = T
[PROOF STEP]
unfolding span_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; subspace T; \<And>T'. \<lbrakk>S \<subseteq> T'; subspace T'\<rbrakk> \<Longrightarrow> T \<subseteq> T'\<rbrakk> \<Longrightarrow> subspace hull S = T
[PROOF STEP]
by (rule hull_unique)


[STATEMENT]
lemma Ord_odiff_le_iff: "\<lbrakk>\<alpha> \<le> x; Ord x; Ord \<alpha>\<rbrakk> \<Longrightarrow> odiff x \<alpha> \<le> y \<longleftrightarrow> x \<le> \<alpha> + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<alpha> \<le> x; Ord x; Ord \<alpha>\<rbrakk> \<Longrightarrow> (odiff x \<alpha> \<le> y) = (x \<le> \<alpha> + y)
[PROOF STEP]
by (simp add: odiff_le_iff vle_iff_le_Ord)


[STATEMENT]
lemma mult_smult_distrib: assumes A: "A \<in> carrier_mat nr n" and B: "B \<in> carrier_mat n nc"
  shows "A * (k \<cdot>\<^sub>m B) = (k :: 'a :: comm_semiring_0) \<cdot>\<^sub>m (A * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (k \<cdot>\<^sub>m B) = k \<cdot>\<^sub>m (A * B)
[PROOF STEP]
by (rule eq_matI, insert A B, auto)


[STATEMENT]
lemma joinable_simp: "(x, y) \<in> joinable R \<longleftrightarrow> (\<exists>z. (x, z) \<in> R \<and> (y, z) \<in> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> joinable R) = (\<exists>z. (x, z) \<in> R \<and> (y, z) \<in> R)
[PROOF STEP]
unfolding joinable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> {(x, y). \<exists>z. (x, z) \<in> R \<and> (y, z) \<in> R}) = (\<exists>z. (x, z) \<in> R \<and> (y, z) \<in> R)
[PROOF STEP]
by simp


[STATEMENT]
lemma take_last_index :
  assumes "i < length xs"
  shows "last (take (Suc i) xs) = xs ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (take (Suc i) xs) = xs ! i
[PROOF STEP]
by (simp add: assms take_Suc_conv_app_nth)


[STATEMENT]
lemma dim_span[simp]: "dim (span S) = dim S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (span S) = dim S
[PROOF STEP]
by (auto simp add: dim_def span_span)


[STATEMENT]
lemma Qp_ev_zero:
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "Qp_ev \<zero>\<^bsub>Q\<^sub>p[\<X>\<^bsub>n\<^esub>]\<^esub> a = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_at_point Q\<^sub>p a \<zero>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> = \<zero>
[PROOF STEP]
unfolding coord_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_at_point Q\<^sub>p a \<zero>\<^bsub>Pring Q\<^sub>p {..<n}\<^esub> = \<zero>
[PROOF STEP]
by (metis Qp.Pring_zero eval_at_point_const Qp.zero_closed assms)


[STATEMENT]
lemma f''_ge0_imp_convex:
  fixes f :: "real \<Rightarrow> real"
  assumes conv: "convex C"
    and f': "\<And>x. x \<in> C \<Longrightarrow> DERIV f x :> (f' x)"
    and f'': "\<And>x. x \<in> C \<Longrightarrow> DERIV f' x :> (f'' x)"
    and 0: "\<And>x. x \<in> C \<Longrightarrow> f'' x \<ge> 0"
  shows "convex_on C f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_on C f
[PROOF STEP]
using f''_imp_f'[OF conv f' f'' 0] assms pos_convex_function
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> C \<Longrightarrow> x \<in> C; \<And>x. x \<in> C \<Longrightarrow> x \<in> C; \<And>x. x \<in> C \<Longrightarrow> x \<in> C; ?x \<in> C; ?y \<in> C\<rbrakk> \<Longrightarrow> f' ?x * (?y - ?x) \<le> f ?y - f ?x
convex C
?x \<in> C \<Longrightarrow> (f has_real_derivative f' ?x) (at ?x)
?x \<in> C \<Longrightarrow> (f' has_real_derivative f'' ?x) (at ?x)
?x \<in> C \<Longrightarrow> 0 \<le> f'' ?x
\<lbrakk>convex ?C; \<And>x y. \<lbrakk>x \<in> ?C; y \<in> ?C\<rbrakk> \<Longrightarrow> ?f' x * (y - x) \<le> ?f y - ?f x\<rbrakk> \<Longrightarrow> convex_on ?C ?f

goal (1 subgoal):
 1. convex_on C f
[PROOF STEP]
by fastforce


[STATEMENT]
lemma INF_UNION: "(INF z \<in> \<Union>x\<in>A. B x. f z) = (INF x\<in>A. INF z\<in>B x. f z)" for f :: "_ \<Rightarrow> 'b::complete_lattice"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> (f ` \<Union> (B ` A)) = (\<Sqinter>x\<in>A. \<Sqinter> (f ` B x))
[PROOF STEP]
by(auto intro!: antisym INF_greatest intro: INF_lower2)


[STATEMENT]
lemma setdist_sym: "setdist S T = setdist T S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. setdist S T = setdist T S
[PROOF STEP]
by (force simp: setdist_def dist_commute intro!: arg_cong [where f=Inf])


[STATEMENT]
lemma midpoint_preserves_out:
  assumes "A Out B C" and
    "M Midpoint A A'" and
    "M Midpoint B B'" and
    "M Midpoint C C'"
  shows "A' Out B' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' Out B' C'
[PROOF STEP]
by (smt Out_def assms(1) assms(2) assms(3) assms(4) l6_4_2 l7_15 l7_2 not_bet_and_out not_col_distincts)


[STATEMENT]
lemma mult_mat_vec_split:
  assumes A: "A : carrier_mat n n"
      and D: "D : carrier_mat m m"
      and a: "a : carrier_vec n"
      and d: "d : carrier_vec m"
  shows "four_block_mat A (0\<^sub>m n m) (0\<^sub>m m n) D *\<^sub>v (a @\<^sub>v d) = A *\<^sub>v a @\<^sub>v D *\<^sub>v d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (0\<^sub>m n m) (0\<^sub>m m n) D *\<^sub>v (a @\<^sub>v d) = A *\<^sub>v a @\<^sub>v D *\<^sub>v d
[PROOF STEP]
by (subst four_block_mat_mult_vec[OF A _ _ D a d], insert A D a d, auto)


[STATEMENT]
lemma (in cpx_sq_mat) mult_add_distrib_left:
  assumes "A\<in> fc_mats" "B\<in> fc_mats" "C\<in> fc_mats"
  shows "(B + C) * A = B * A + C * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B + C) * A = B * A + C * A
[PROOF STEP]
using assms fc_mats_carrier add_mult_distrib_mat dim_eq
[PROOF STATE]
proof (prove)
using this:
A \<in> fc_mats
B \<in> fc_mats
C \<in> fc_mats
fc_mats = carrier_mat dimR dimC
\<lbrakk>?A \<in> carrier_mat ?nr ?n; ?B \<in> carrier_mat ?nr ?n; ?C \<in> carrier_mat ?n ?nc\<rbrakk> \<Longrightarrow> (?A + ?B) * ?C = ?A * ?C + ?B * ?C
dimR = dimC

goal (1 subgoal):
 1. (B + C) * A = B * A + C * A
[PROOF STEP]
by simp


[STATEMENT]
lemma eval_fds_norm_nonneg:
  assumes "fds_abs_converges (fds_norm f) s"
  shows   "eval_fds (fds_norm f) s \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> eval_fds (fds_norm f) s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges (fds_norm f) s

goal (1 subgoal):
 1. 0 \<le> eval_fds (fds_norm f) s
[PROOF STEP]
unfolding eval_fds_def fds_abs_converges_def
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (fds_nth (fds_norm f) n / nat_power n s))

goal (1 subgoal):
 1. 0 \<le> (\<Sum>n. fds_nth (fds_norm f) n / nat_power n s)
[PROOF STEP]
by (intro suminf_nonneg) auto


[STATEMENT]
lemma lfp_while'':
  fixes f::"'a set \<Rightarrow> 'a set" and M::"'a set"
  defines "N \<equiv> while (\<lambda>A. f A \<noteq> A) f {}"
  assumes f_mono: "mono f"
    and lfp_finite: "finite (lfp f)"
  shows "lfp f = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lfp f = N
[PROOF STEP]
have *: "f X \<subseteq> lfp f" when "X \<subseteq> lfp f" for X
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f X \<subseteq> lfp f
[PROOF STEP]
using lfp_fixpoint[OF f_mono] monoD[OF f_mono that]
[PROOF STATE]
proof (prove)
using this:
f (lfp f) = lfp f
f X \<subseteq> f (lfp f)

goal (1 subgoal):
 1. f X \<subseteq> lfp f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?X \<subseteq> lfp f \<Longrightarrow> f ?X \<subseteq> lfp f

goal (1 subgoal):
 1. lfp f = N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = N
[PROOF STEP]
using lfp_while[OF f_mono * lfp_finite]
[PROOF STATE]
proof (prove)
using this:
(\<And>X. X \<subseteq> lfp f \<Longrightarrow> X \<subseteq> lfp f) \<Longrightarrow> lfp f = while (\<lambda>A. f A \<noteq> A) f {}

goal (1 subgoal):
 1. lfp f = N
[PROOF STEP]
by (simp add: N_def)
[PROOF STATE]
proof (state)
this:
lfp f = N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_set_linear:
  fixes f :: "'a::comm_monoid_add set \<Rightarrow> 'b::comm_monoid_add set"
  assumes "\<And>A B. f(A) + f(B) = f(A + B)" "f {0} = {0}"
  shows "f (sum S I) = sum (f \<circ> S) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (sum S I) = sum (f \<circ> S) I
[PROOF STEP]
using sum_set_cond_linear[of "\<lambda>x. True" f I S] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>A B. \<lbrakk>True; True\<rbrakk> \<Longrightarrow> True; True; \<And>A B. \<lbrakk>True; True\<rbrakk> \<Longrightarrow> f (A + B) = f A + f B; f {0::'a} = {0::'b}; \<And>i. i \<in> I \<Longrightarrow> True\<rbrakk> \<Longrightarrow> f (sum S I) = sum (f \<circ> S) I
f ?A + f ?B = f (?A + ?B)
f {0::'a} = {0::'b}

goal (1 subgoal):
 1. f (sum S I) = sum (f \<circ> S) I
[PROOF STEP]
by auto


[STATEMENT]
lemma lcm_0_iff_int [simp]: "lcm m n = 0 \<longleftrightarrow> m = 0 \<or> n = 0"
  for m n :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lcm m n = 0) = (m = 0 \<or> n = 0)
[PROOF STEP]
by (fact lcm_eq_0_iff)


[STATEMENT]
lemma compact_UN [intro]:
  "finite A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> compact (B x)) \<Longrightarrow> compact (\<Union>x\<in>A. B x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; \<And>x. x \<in> A \<Longrightarrow> compact (B x)\<rbrakk> \<Longrightarrow> compact (\<Union> (B ` A))
[PROOF STEP]
by (rule compact_Union) auto


[STATEMENT]
lemma monom_subst_inv: assumes sub: "\<And> x. poly_inv (\<sigma> x)"
  shows "poly_inv (monom_subst \<sigma> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_inv (monom_subst \<sigma> m)
[PROOF STEP]
unfolding monom_subst_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_inv (monom_list_subst \<sigma> (monom_list m))
[PROOF STEP]
by (rule monom_list_subst_inv[OF sub])


[STATEMENT]
lemma take_rest_power_bin: "m \<le> n \<Longrightarrow> take m (bin_to_bl n w) = bin_to_bl m (((\<lambda>w. w div 2) ^^ (n - m)) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> take m (bin_to_bl n w) = bin_to_bl m (((\<lambda>w. w div 2) ^^ (n - m)) w)
[PROOF STEP]
apply (rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. m \<le> n \<Longrightarrow> length (take m (bin_to_bl n w)) = length (bin_to_bl m (((\<lambda>w. w div 2) ^^ (n - m)) w))
 2. \<And>i. \<lbrakk>m \<le> n; i < length (take m (bin_to_bl n w))\<rbrakk> \<Longrightarrow> take m (bin_to_bl n w) ! i = bin_to_bl m (((\<lambda>w. w div 2) ^^ (n - m)) w) ! i
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>m \<le> n; i < length (take m (bin_to_bl n w))\<rbrakk> \<Longrightarrow> take m (bin_to_bl n w) ! i = bin_to_bl m (((\<lambda>w. w div 2) ^^ (n - m)) w) ! i
[PROOF STEP]
apply (clarsimp simp add: nth_bin_to_bl nth_rest_power_bin)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sorted_distinct [intro]: "\<lbrakk> sorted (xs); distinct(xs) \<rbrakk> \<Longrightarrow> (\<forall> i<length xs - 1. xs!i < xs!(i + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted xs; distinct xs\<rbrakk> \<Longrightarrow> \<forall>i<length xs - 1. xs ! i < xs ! (i + 1)
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>sorted []; distinct []\<rbrakk> \<Longrightarrow> \<forall>i<length [] - 1. [] ! i < [] ! (i + 1)
 2. \<And>a xs. \<lbrakk>\<lbrakk>sorted xs; distinct xs\<rbrakk> \<Longrightarrow> \<forall>i<length xs - 1. xs ! i < xs ! (i + 1); sorted (a # xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> \<forall>i<length (a # xs) - 1. (a # xs) ! i < (a # xs) ! (i + 1)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i; \<forall>x\<in>set xs. a \<le> x; sorted xs; a \<notin> set xs; distinct xs; i < length xs\<rbrakk> \<Longrightarrow> (a # xs) ! i < xs ! i
[PROOF STEP]
apply (metis (no_types, opaque_lifting) Suc_leI Suc_less_eq Suc_pred gr0_conv_Suc not_le not_less_iff_gr_or_eq nth_Cons_Suc nth_mem nth_non_equal_first_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma degree_neville_aitken_interpolation_poly:
  shows "degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
proof (cases "length xs_ys")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length xs_ys = 0 \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
 2. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
length xs_ys = 0

goal (2 subgoals):
 1. length xs_ys = 0 \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
 2. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
hence id: "xs_ys = []"
[PROOF STATE]
proof (prove)
using this:
length xs_ys = 0

goal (1 subgoal):
 1. xs_ys = []
[PROOF STEP]
by (cases xs_ys, auto)
[PROOF STATE]
proof (state)
this:
xs_ys = []

goal (2 subgoals):
 1. length xs_ys = 0 \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
 2. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
unfolding id neville_aitken_interpolation_poly_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (neville_aitken_impl_main (map (\<lambda>(xi, fi). (xi, xi, [:fi:])) [])) \<le> length [] - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1

goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
case (Suc nn)
[PROOF STATE]
proof (state)
this:
length xs_ys = Suc nn

goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
have id: "neville_aitken_interpolation_poly xs_ys =
    neville_aitken (\<lambda> i. fst (xs_ys ! i)) (\<lambda> i. snd (xs_ys ! i)) (length xs_ys - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neville_aitken_interpolation_poly xs_ys = neville_aitken (\<lambda>i. fst (xs_ys ! i)) (\<lambda>i. snd (xs_ys ! i)) (length xs_ys - 1)
[PROOF STEP]
by (rule neville_aitken_interpolation_impl, insert Suc, auto)
[PROOF STATE]
proof (state)
this:
neville_aitken_interpolation_poly xs_ys = neville_aitken (\<lambda>i. fst (xs_ys ! i)) (\<lambda>i. snd (xs_ys ! i)) (length xs_ys - 1)

goal (1 subgoal):
 1. \<And>nat. length xs_ys = Suc nat \<Longrightarrow> degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (neville_aitken (\<lambda>i. fst (xs_ys ! i)) (\<lambda>i. snd (xs_ys ! i)) (length xs_ys - 1)) \<le> length xs_ys - 1
[PROOF STEP]
by (rule degree_neville_aitken)
[PROOF STATE]
proof (state)
this:
degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lists_def2: "lists A = {l. set l \<le> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lists A = {l. set l \<subseteq> A}
[PROOF STEP]
using in_listsI
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set ?xs. x \<in> ?A \<Longrightarrow> ?xs \<in> lists ?A

goal (1 subgoal):
 1. lists A = {l. set l \<subseteq> A}
[PROOF STEP]
by blast


[STATEMENT]
lemma matrix_mul_diag_matl: "diag_mat f ** A = (\<chi> i j. f i * A$i$j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat f ** A = (\<chi>i j. f i * A $ i $ j)
[PROOF STEP]
unfolding diag_mat_def matrix_matrix_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. \<Sum>k\<in>UNIV. (\<chi>i j. if i = j then f i else (0::'a)) $ i $ k * A $ k $ j) = (\<chi>i j. f i * A $ i $ j)
[PROOF STEP]
by simp


[STATEMENT]
lemma tllist_of_llist_eq_lappendt_conv:
  "tllist_of_llist a xs = lappendt ys zs \<longleftrightarrow>
  (\<exists>xs' a'. xs = lappend ys xs' \<and> zs = tllist_of_llist a' xs' \<and> (lfinite ys \<longrightarrow> a = a'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tllist_of_llist a xs = lappendt ys zs) = (\<exists>xs' a'. xs = lappend ys xs' \<and> zs = tllist_of_llist a' xs' \<and> (lfinite ys \<longrightarrow> a = a'))
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma until_conj_distrib:
  "((P \<^bold>\<and> Q) \<U> R) = ((P \<U> R) \<^bold>\<and> (Q \<U> R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>s. P s \<and> Q s) \<U> R) = (\<lambda>s. (P \<U> R) s \<and> (Q \<U> R) s)
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>\<sigma>. \<exists>i. R (\<sigma> |\<^sub>s i) \<and> (\<forall>k<i. P (\<sigma> |\<^sub>s k) \<and> Q (\<sigma> |\<^sub>s k))) = (\<lambda>s. (\<exists>i. R (s |\<^sub>s i) \<and> (\<forall>k<i. P (s |\<^sub>s k))) \<and> (\<exists>i. R (s |\<^sub>s i) \<and> (\<forall>k<i. Q (s |\<^sub>s k))))
[PROOF STEP]
apply (auto simp: fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x i ia. \<lbrakk>R (x |\<^sub>s i); \<forall>k<i. P (x |\<^sub>s k); R (x |\<^sub>s ia); \<forall>k<ia. Q (x |\<^sub>s k)\<rbrakk> \<Longrightarrow> \<exists>i. R (x |\<^sub>s i) \<and> (\<forall>k<i. P (x |\<^sub>s k) \<and> Q (x |\<^sub>s k))
[PROOF STEP]
apply (metis dual_order.strict_trans nat_neq_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma squarefree_part_ge_Suc_0 [simp]: "\<Prod>(squarefree_part n) \<ge> Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 \<le> \<Prod>(squarefree_part n)
[PROOF STEP]
using squarefree_part_pos[of n]
[PROOF STATE]
proof (prove)
using this:
0 < \<Prod>(squarefree_part n)

goal (1 subgoal):
 1. Suc 0 \<le> \<Prod>(squarefree_part n)
[PROOF STEP]
by presburger


[STATEMENT]
lemma weight_sample_uniform_units:
  assumes "(p::nat) > 1"
  shows "weight_spmf (sample_uniform_units p) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight_spmf (sample_uniform_units p) = 1
[PROOF STEP]
using assms lossless_sample_uniform_units
[PROOF STATE]
proof (prove)
using this:
1 < p
1 < ?p \<Longrightarrow> lossless_spmf (sample_uniform_units ?p)

goal (1 subgoal):
 1. weight_spmf (sample_uniform_units p) = 1
[PROOF STEP]
by (simp add: lossless_weight_spmfD)


[STATEMENT]
lemma iT_Minus_singleton: "k \<ominus> {a} = (if a \<le> k then {k - a} else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<ominus> {a} = (if a \<le> k then {k - a} else {})
[PROOF STEP]
by (simp add: iT_Minus_image_conv cut_le_singleton)


[STATEMENT]
lemma vec_last_index:
  assumes v: "v \<in> carrier_vec (n + m)"
    and i: "i < m"
  shows "(vec_last v m) $ i = v $ (n + i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last v m $ i = v $ (n + i)
[PROOF STEP]
unfolding vec_last_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec m (\<lambda>i. v $ (dim_vec v - m + i)) $ i = v $ (n + i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (n + m)
i < m

goal (1 subgoal):
 1. vec m (\<lambda>i. v $ (dim_vec v - m + i)) $ i = v $ (n + i)
[PROOF STEP]
by simp


[STATEMENT]
lemma zip_path_eq_left :
  assumes "length xs1 = length xs2"
  and     "length xs2 = length ys1"
  and     "length ys1 = length ys2"
  and     "zip_path xs1 xs2 = zip_path ys1 ys2"
shows "xs1 = ys1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs1 = ys1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs1 = length xs2
length xs2 = length ys1
length ys1 = length ys2
zip_path xs1 xs2 = zip_path ys1 ys2

goal (1 subgoal):
 1. xs1 = ys1
[PROOF STEP]
by (induction xs1 xs2 ys1 ys2 rule: list_induct4; auto)


[STATEMENT]
lemma pochhammer_Suc_prod: "pochhammer a (Suc n) = prod (\<lambda>i. a + of_nat i) {0..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer a (Suc n) = (\<Prod>i = 0..n. a + of_nat i)
[PROOF STEP]
by (simp add: pochhammer_prod atLeastLessThanSuc_atLeastAtMost)


[STATEMENT]
lemma subset_lemma:
  "\<lbrakk> A \<inter> B = {}; A \<subseteq> B \<rbrakk> \<Longrightarrow> A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<inter> B = {}; A \<subseteq> B\<rbrakk> \<Longrightarrow> A = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma "(\<forall>x. P(x) \<and> Q(x)) = ((\<forall>x. P(x)) \<and> (\<forall>x. Q(x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x \<and> Q x) = ((\<forall>x. P x) \<and> (\<forall>x. Q x))
[PROOF STEP]
by blast


[STATEMENT]
theorem framed_uncross_inv:"(framed_uncross w1 w2) \<Longrightarrow> (kauff_mat w1) = (kauff_mat w2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. framed_uncross w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
unfolding framed_uncross_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncross_positive_flip w1 w2 \<or> uncross_negative_flip w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
using uncross_negative_flip_inv uncross_positive_flip_inv
[PROOF STATE]
proof (prove)
using this:
uncross_negative_flip ?w1.0 ?w2.0 \<Longrightarrow> kauff_mat ?w1.0 = kauff_mat ?w2.0
uncross_positive_flip ?w1.0 ?w2.0 \<Longrightarrow> kauff_mat ?w1.0 = kauff_mat ?w2.0

goal (1 subgoal):
 1. uncross_positive_flip w1 w2 \<or> uncross_negative_flip w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
by auto


[STATEMENT]
lemma Brouwer_degree2_homeomorphic_maps:
  assumes "homeomorphic_maps (nsphere p) (nsphere p) f g"
  obtains "\<bar>Brouwer_degree2 p f\<bar> = 1" "\<bar>Brouwer_degree2 p g\<bar> = 1" "Brouwer_degree2 p g = Brouwer_degree2 p f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>\<bar>Brouwer_degree2 p f\<bar> = 1; \<bar>Brouwer_degree2 p g\<bar> = 1; Brouwer_degree2 p g = Brouwer_degree2 p f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps (nsphere p) (nsphere p) f g

goal (1 subgoal):
 1. (\<lbrakk>\<bar>Brouwer_degree2 p f\<bar> = 1; \<bar>Brouwer_degree2 p g\<bar> = 1; Brouwer_degree2 p g = Brouwer_degree2 p f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: homeomorphic_maps_def homotopic_with_equal continuous_map_compose intro: Brouwer_degree2_homotopy_equivalence)


[STATEMENT]
lemma my_n_2_min1:  "\<mu>^(n div 2) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu> ^ (n div 2) = - 1
[PROOF STEP]
by (metis divide_minus1 mult_zero_right mu_properties(1) nonzero_mult_div_cancel_right omg_n_2_min1 power_one_over zero_neq_one)


[STATEMENT]
lemma bounded_nat_bit_count_2:
  assumes "y < l"
  shows "bit_count (Nb\<^sub>e l y) = floorlog 2 (l-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit_count (Nb\<^sub>e l y) = ereal (real (floorlog 2 (l - 1)))
[PROOF STEP]
using assms bounded_nat_bit_count
[PROOF STATE]
proof (prove)
using this:
y < l
bit_count (Nb\<^sub>e ?l ?y) = ereal_of_enat (if ?y < ?l then enat (floorlog 2 (?l - 1)) else \<infinity>)

goal (1 subgoal):
 1. bit_count (Nb\<^sub>e l y) = ereal (real (floorlog 2 (l - 1)))
[PROOF STEP]
by simp


[STATEMENT]
lemma completely_multiplicative_fds_inverse:
  fixes f :: "nat \<Rightarrow> 'a :: field"
  assumes "completely_multiplicative_function f"
  shows   "inverse (fds f) = fds (\<lambda>n. moebius_mu n * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (fds f) = fds (\<lambda>n. moebius_mu n * f n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverse (fds f) = fds (\<lambda>n. moebius_mu n * f n)
[PROOF STEP]
interpret completely_multiplicative_function f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverse (fds f) = fds (\<lambda>n. moebius_mu n * f n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
completely_multiplicative_function f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
completely_multiplicative_function f

goal (1 subgoal):
 1. inverse (fds f) = fds (\<lambda>n. moebius_mu n * f n)
[PROOF STEP]
by (subst (asm) completely_multiplicative_iff_inverse_moebius_mu)
       (auto simp: inverse_fds_def multiplicative_function_axioms)
[PROOF STATE]
proof (state)
this:
inverse (fds f) = fds (\<lambda>n. moebius_mu n * f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_edges_betw_sigma_neighbor:
"all_edges_between X Y = (SIGMA x:X. neighbors_ss x Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between X Y = (SIGMA x:X. neighbors_ss x Y)
[PROOF STEP]
by (auto simp add: all_edges_between_def neighbors_ss_def vert_adj_def)


[STATEMENT]
lemma matrix_inv_Gauss_Jordan_PA:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
assumes inv_A: "invertible A"
shows "matrix_inv A = fst (Gauss_Jordan_PA A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_inv A = fst (Gauss_Jordan_PA A)
[PROOF STEP]
by (metis Gauss_Jordan_PA_eq fst_Gauss_Jordan_PA inv_A matrix_inv_Gauss)


[STATEMENT]
lemma DERIV_isconst_all:
  fixes f :: "real \<Rightarrow> real"
  shows "\<forall>x. DERIV f x :> 0 \<Longrightarrow> f x = f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (f has_real_derivative 0) (at x) \<Longrightarrow> f x = f y
[PROOF STEP]
apply (rule linorder_cases [of x y])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<forall>x. (f has_real_derivative 0) (at x); x < y\<rbrakk> \<Longrightarrow> f x = f y
 2. \<lbrakk>\<forall>x. (f has_real_derivative 0) (at x); x = y\<rbrakk> \<Longrightarrow> f x = f y
 3. \<lbrakk>\<forall>x. (f has_real_derivative 0) (at x); y < x\<rbrakk> \<Longrightarrow> f x = f y
[PROOF STEP]
apply (metis DERIV_continuous DERIV_isconst_end continuous_at_imp_continuous_on)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma suffixes_conv_prefixes: "suffixes xs = map rev (prefixes (rev xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suffixes xs = map rev (prefixes (rev xs))
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma res_c3: "residuated f \<Longrightarrow> residual f (f (residual f (f x))) = residual f (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated f \<Longrightarrow> residual f (f (residual f (f x))) = residual f (f x)
[PROOF STEP]
by (metis order.eq_iff local.order_trans res_c1 residual_galois)


[STATEMENT]
lemma powr_of_real:
  fixes x::real and y::real
  shows "0 \<le> x \<Longrightarrow> of_real x powr (of_real y::complex) = of_real (x powr y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> complex_of_real x powr complex_of_real y = complex_of_real (x powr y)
[PROOF STEP]
by (simp_all add: powr_def exp_eq_polar)


[STATEMENT]
lemma emeasure_bind_prob_algebra:
  assumes A: "A \<in> space (prob_algebra N)"
  assumes B: "B \<in> N \<rightarrow>\<^sub>M prob_algebra L"
  assumes X: "X \<in> sets L"
  shows "emeasure (bind A B) X = (\<integral>\<^sup>+x. emeasure (B x) X \<partial>A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (A \<bind> B) X = \<integral>\<^sup>+ x. emeasure (B x) X \<partial>A
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> space (prob_algebra N)
B \<in> N \<rightarrow>\<^sub>M prob_algebra L

goal (1 subgoal):
 1. emeasure (A \<bind> B) X = \<integral>\<^sup>+ x. emeasure (B x) X \<partial>A
[PROOF STEP]
by (intro emeasure_bind[OF _ _ X])
     (auto simp: space_prob_algebra measurable_prob_algebraD cong: measurable_cong_sets intro!: prob_space.not_empty)


[STATEMENT]
lemma valid_path_join_D2:
  fixes g2 :: "real \<Rightarrow> 'a::real_normed_field"
  shows "\<lbrakk>valid_path (g1 +++ g2); pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> valid_path g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valid_path (g1 +++ g2); pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> valid_path g2
[PROOF STEP]
unfolding valid_path_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g1 +++ g2 piecewise_C1_differentiable_on {0..1}; pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> g2 piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
by (rule piecewise_C1_differentiable_D2)


[STATEMENT]
lemma finite_nlists_iff: "finite (nlists A n) \<longleftrightarrow> finite A \<or> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (nlists A n) = (finite A \<or> n = 0)
[PROOF STEP]
by(auto dest: finite_nlistsD)


[STATEMENT]
lemma (in product_prob_space) emeasure_PiM_Collect:
  assumes X: "J \<subseteq> I" "finite J" "\<And>i. i \<in> J \<Longrightarrow> X i \<in> sets (M i)"
  shows "emeasure (Pi\<^sub>M I M) {x\<in>space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<Prod> i\<in>J. emeasure (M i) (X i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M I M) {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<Prod>i\<in>J. emeasure (M i) (X i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M I M) {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<Prod>i\<in>J. emeasure (M i) (X i))
[PROOF STEP]
have "{x\<in>space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = emb I J (Pi\<^sub>E J X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = emb I J (Pi\<^sub>E J X)
[PROOF STEP]
unfolding prod_emb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<lambda>x. restrict x J) -` Pi\<^sub>E J X \<inter> (\<Pi>\<^sub>E i\<in>I. space (M i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
J \<subseteq> I
finite J
?i1 \<in> J \<Longrightarrow> X ?i1 \<in> M.events ?i1

goal (1 subgoal):
 1. {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<lambda>x. restrict x J) -` Pi\<^sub>E J X \<inter> (\<Pi>\<^sub>E i\<in>I. space (M i))
[PROOF STEP]
by (auto simp: space_PiM Pi_iff)
[PROOF STATE]
proof (state)
this:
{x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = emb I J (Pi\<^sub>E J X)

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M I M) {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<Prod>i\<in>J. emeasure (M i) (X i))
[PROOF STEP]
with emeasure_PiM_emb[OF assms]
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i \<in> J \<Longrightarrow> i \<in> J) \<Longrightarrow> emeasure (Pi\<^sub>M I M) (emb I J (Pi\<^sub>E J X)) = (\<Prod>i\<in>J. emeasure (M i) (X i))
{x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = emb I J (Pi\<^sub>E J X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> J \<Longrightarrow> i \<in> J) \<Longrightarrow> emeasure (Pi\<^sub>M I M) (emb I J (Pi\<^sub>E J X)) = (\<Prod>i\<in>J. emeasure (M i) (X i))
{x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = emb I J (Pi\<^sub>E J X)

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M I M) {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<Prod>i\<in>J. emeasure (M i) (X i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M I M) {x \<in> space (Pi\<^sub>M I M). \<forall>i\<in>J. x i \<in> X i} = (\<Prod>i\<in>J. emeasure (M i) (X i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_tan: "bij_betw tan {-pi/2<..<pi/2} UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw tan {- pi / 2<..<pi / 2} UNIV
[PROOF STEP]
using arctan_ubound
[PROOF STATE]
proof (prove)
using this:
arctan ?y < pi / 2

goal (1 subgoal):
 1. bij_betw tan {- pi / 2<..<pi / 2} UNIV
[PROOF STEP]
by (intro bij_betw_byWitness[where f'=arctan]) (auto simp: arctan arctan_tan)


[STATEMENT]
lemma SUPSEQ_union [simp]:
  shows "SUPSEQ (A \<union> B) = SUPSEQ A \<union> SUPSEQ B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SUPSEQ (A \<union> B) = SUPSEQ A \<union> SUPSEQ B
[PROOF STEP]
unfolding SUPSEQ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>y\<in>A \<union> B. subseq y x} = {x. \<exists>y\<in>A. subseq y x} \<union> {x. \<exists>y\<in>B. subseq y x}
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_mult_nth_1' [simp]: "(f * g) $ Suc 0 = f$0 * g$Suc 0 + f$Suc 0 * g$0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * g) $ Suc 0 = f $ 0 * g $ Suc 0 + f $ Suc 0 * g $ 0
[PROOF STEP]
by (simp add: fps_mult_nth)


[STATEMENT]
lemma degree_prod_sum_le: "finite S \<Longrightarrow> degree (prod f S) \<le> sum (degree \<circ> f) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> degree (prod f S) \<le> sum (degree \<circ> f) S
[PROOF STEP]
proof (induct S rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree (prod f {}) \<le> sum (degree \<circ> f) {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; degree (prod f F) \<le> sum (degree \<circ> f) F\<rbrakk> \<Longrightarrow> degree (prod f (insert x F)) \<le> sum (degree \<circ> f) (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. degree (prod f {}) \<le> sum (degree \<circ> f) {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; degree (prod f F) \<le> sum (degree \<circ> f) F\<rbrakk> \<Longrightarrow> degree (prod f (insert x F)) \<le> sum (degree \<circ> f) (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (prod f {}) \<le> sum (degree \<circ> f) {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (prod f {}) \<le> sum (degree \<circ> f) {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; degree (prod f F) \<le> sum (degree \<circ> f) F\<rbrakk> \<Longrightarrow> degree (prod f (insert x F)) \<le> sum (degree \<circ> f) (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; degree (prod f F) \<le> sum (degree \<circ> f) F\<rbrakk> \<Longrightarrow> degree (prod f (insert x F)) \<le> sum (degree \<circ> f) (insert x F)
[PROOF STEP]
case (insert a S)
[PROOF STATE]
proof (state)
this:
finite S
a \<notin> S
degree (prod f S) \<le> sum (degree \<circ> f) S

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; degree (prod f F) \<le> sum (degree \<circ> f) F\<rbrakk> \<Longrightarrow> degree (prod f (insert x F)) \<le> sum (degree \<circ> f) (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (prod f (insert a S)) \<le> sum (degree \<circ> f) (insert a S)
[PROOF STEP]
unfolding prod.insert[OF insert(1-2)] sum.insert[OF insert(1-2)]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (f a * prod f S) \<le> (degree \<circ> f) a + sum (degree \<circ> f) S
[PROOF STEP]
by (rule le_trans[OF degree_mult_le]) (use insert in auto)
[PROOF STATE]
proof (state)
this:
degree (prod f (insert a S)) \<le> sum (degree \<circ> f) (insert a S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_supp_wf_Pred [simp]: "finite (supp (binsert (Pred \<phi>) (bsingleton x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (supp (binsert (Pred \<phi>) (bsingleton x)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (supp (binsert (Pred \<phi>) (bsingleton x)))
[PROOF STEP]
have "supp (bsingleton x) \<subseteq> supp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (bsingleton x) \<subseteq> supp x
[PROOF STEP]
by (simp add: eqvtI supp_fun_app_eqvt)
[PROOF STATE]
proof (state)
this:
supp (bsingleton x) \<subseteq> supp x

goal (1 subgoal):
 1. finite (supp (binsert (Pred \<phi>) (bsingleton x)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
supp (bsingleton x) \<subseteq> supp x

goal (1 subgoal):
 1. finite (supp (binsert (Pred \<phi>) (bsingleton x)))
[PROOF STEP]
have "eqvt binsert"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqvt binsert
[PROOF STEP]
by (simp add: eqvtI)
[PROOF STATE]
proof (state)
this:
eqvt binsert

goal (1 subgoal):
 1. finite (supp (binsert (Pred \<phi>) (bsingleton x)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
supp (bsingleton x) \<subseteq> supp x
eqvt binsert
[PROOF STEP]
have "supp (binsert (Pred \<phi>) (bsingleton x)) \<subseteq> supp \<phi> \<union> supp x"
[PROOF STATE]
proof (prove)
using this:
supp (bsingleton x) \<subseteq> supp x
eqvt binsert

goal (1 subgoal):
 1. supp (binsert (Pred \<phi>) (bsingleton x)) \<subseteq> supp \<phi> \<union> supp x
[PROOF STEP]
using supp_fun_app supp_fun_app_eqvt
[PROOF STATE]
proof (prove)
using this:
supp (bsingleton x) \<subseteq> supp x
eqvt binsert
supp (?f ?x) \<subseteq> supp ?f \<union> supp ?x
eqvt ?f \<Longrightarrow> supp (?f ?x) \<subseteq> supp ?x

goal (1 subgoal):
 1. supp (binsert (Pred \<phi>) (bsingleton x)) \<subseteq> supp \<phi> \<union> supp x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
supp (binsert (Pred \<phi>) (bsingleton x)) \<subseteq> supp \<phi> \<union> supp x

goal (1 subgoal):
 1. finite (supp (binsert (Pred \<phi>) (bsingleton x)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
supp (binsert (Pred \<phi>) (bsingleton x)) \<subseteq> supp \<phi> \<union> supp x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
supp (binsert (Pred \<phi>) (bsingleton x)) \<subseteq> supp \<phi> \<union> supp x

goal (1 subgoal):
 1. finite (supp (binsert (Pred \<phi>) (bsingleton x)))
[PROOF STEP]
by (metis finite_UnI finite_supp rev_finite_subset)
[PROOF STATE]
proof (state)
this:
finite (supp (binsert (Pred \<phi>) (bsingleton x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_on_cmul [intro]:
  fixes c :: real
  assumes "0 \<le> c"
    and "convex_on S f"
  shows "convex_on S (\<lambda>x. c * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_on S (\<lambda>x. c * f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex_on S (\<lambda>x. c * f x)
[PROOF STEP]
have *: "u * (c * fx) + v * (c * fy) = c * (u * fx + v * fy)"
    for u c fx v fy :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u * (c * fx) + v * (c * fy) = c * (u * fx + v * fy)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
?u * (?c * ?fx) + ?v * (?c * ?fy) = ?c * (?u * ?fx + ?v * ?fy)

goal (1 subgoal):
 1. convex_on S (\<lambda>x. c * f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_on S (\<lambda>x. c * f x)
[PROOF STEP]
using assms(2) and mult_left_mono [OF _ assms(1)]
[PROOF STATE]
proof (prove)
using this:
convex_on S f
?a \<le> ?b \<Longrightarrow> c * ?a \<le> c * ?b

goal (1 subgoal):
 1. convex_on S (\<lambda>x. c * f x)
[PROOF STEP]
unfolding convex_on_def and *
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<forall>y\<in>S. \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> f (u *\<^sub>R x + v *\<^sub>R y) \<le> u * f x + v * f y
?a \<le> ?b \<Longrightarrow> c * ?a \<le> c * ?b

goal (1 subgoal):
 1. \<forall>x\<in>S. \<forall>y\<in>S. \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> c * f (u *\<^sub>R x + v *\<^sub>R y) \<le> c * (u * f x + v * f y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
convex_on S (\<lambda>x. c * f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem relcl_latticeof_eq:
     "[|refl r; trans r|] ==> relcl (latticeof r) = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>refl r; trans r\<rbrakk> \<Longrightarrow> relcl (latticeof r) = r
[PROOF STEP]
by (simp add: relcl_def cl_latticeof)


[STATEMENT]
lemma inner_add_right: "inner x (y + z) = inner x y + inner x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
have "inner x (y + z) = cnj (inner (y + z) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (y + z) = cnj_class.cnj (inner (y + z) x)
[PROOF STEP]
using inner_commute
[PROOF STATE]
proof (prove)
using this:
inner ?x ?y = cnj_class.cnj (inner ?y ?x)

goal (1 subgoal):
 1. inner x (y + z) = cnj_class.cnj (inner (y + z) x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inner x (y + z) = cnj_class.cnj (inner (y + z) x)

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner x (y + z) = cnj_class.cnj (inner (y + z) x)

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
have "... = cnj ((inner y x) +(inner z x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (inner (y + z) x) = cnj_class.cnj (inner y x + inner z x)
[PROOF STEP]
using inner_add_left
[PROOF STATE]
proof (prove)
using this:
inner (?x + ?y) ?z = inner ?x ?z + inner ?y ?z

goal (1 subgoal):
 1. cnj_class.cnj (inner (y + z) x) = cnj_class.cnj (inner y x + inner z x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (inner (y + z) x) = cnj_class.cnj (inner y x + inner z x)

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (inner (y + z) x) = cnj_class.cnj (inner y x + inner z x)

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
have "... = cnj (inner y x) + cnj (inner z x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (inner y x + inner z x) = cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x)
[PROOF STEP]
using cnj_add
[PROOF STATE]
proof (prove)
using this:
cnj_class.cnj (?a + ?b) = cnj_class.cnj ?a + cnj_class.cnj ?b

goal (1 subgoal):
 1. cnj_class.cnj (inner y x + inner z x) = cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (inner y x + inner z x) = cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x)

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (inner y x + inner z x) = cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x)

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
have "... = inner x y + inner x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x) = inner x y + inner x z
[PROOF STEP]
using inner_commute[of x y]
[PROOF STATE]
proof (prove)
using this:
inner x y = cnj_class.cnj (inner y x)

goal (1 subgoal):
 1. cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x) = inner x y + inner x z
[PROOF STEP]
using inner_commute[of x z]
[PROOF STATE]
proof (prove)
using this:
inner x y = cnj_class.cnj (inner y x)
inner x z = cnj_class.cnj (inner z x)

goal (1 subgoal):
 1. cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x) = inner x y + inner x z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (inner y x) + cnj_class.cnj (inner z x) = inner x y + inner x z

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inner x (y + z) = inner x y + inner x z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inner x (y + z) = inner x y + inner x z

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inner x (y + z) = inner x y + inner x z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_shattered_by:
  assumes "A \<subseteq> B"
  shows "shattered_by A \<subseteq> shattered_by B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shattered_by A \<subseteq> shattered_by B
[PROOF STEP]
unfolding shattered_by_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Aa. A shatters Aa} \<subseteq> {A. B shatters A}
[PROOF STEP]
using subset_shatters[OF assms]
[PROOF STATE]
proof (prove)
using this:
A shatters ?X \<Longrightarrow> B shatters ?X

goal (1 subgoal):
 1. {Aa. A shatters Aa} \<subseteq> {A. B shatters A}
[PROOF STEP]
by force


[STATEMENT]
lemma consec_un_min_max:
  "consec i j \<longrightarrow> Rep_nat_int(i \<squnion> j) = {minimum i .. maximum j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consec i j \<longrightarrow> Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. consec i j \<Longrightarrow> Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}
[PROOF STEP]
assume assm:"consec i j"
[PROOF STATE]
proof (state)
this:
consec i j

goal (1 subgoal):
 1. consec i j \<Longrightarrow> Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
consec i j
[PROOF STEP]
have 1:"minimum j = maximum i +1"
[PROOF STATE]
proof (prove)
using this:
consec i j

goal (1 subgoal):
 1. minimum j = maximum i + 1
[PROOF STEP]
by (simp add: nat_int.consec_def)
[PROOF STATE]
proof (state)
this:
minimum j = maximum i + 1

goal (1 subgoal):
 1. consec i j \<Longrightarrow> Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}
[PROOF STEP]
have i:"Rep_nat_int i = {minimum i..maximum i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_nat_int i = {minimum i..maximum i}
[PROOF STEP]
by (metis Rep_nat_int_inverse assm nat_int.consec_def nat_int.leq_max_sup' nat_int.leq_min_inf'
        rep_non_empty_means_seq)
[PROOF STATE]
proof (state)
this:
Rep_nat_int i = {minimum i..maximum i}

goal (1 subgoal):
 1. consec i j \<Longrightarrow> Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}
[PROOF STEP]
have j:"Rep_nat_int j = {minimum j..maximum j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_nat_int j = {minimum j..maximum j}
[PROOF STEP]
by (metis Rep_nat_int_inverse assm nat_int.consec_def nat_int.leq_max_sup' nat_int.leq_min_inf'
        rep_non_empty_means_seq)
[PROOF STATE]
proof (state)
this:
Rep_nat_int j = {minimum j..maximum j}

goal (1 subgoal):
 1. consec i j \<Longrightarrow> Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}
[PROOF STEP]
show "Rep_nat_int(i \<squnion> j) = {minimum i .. maximum j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}
[PROOF STEP]
by (metis Rep_nat_int_inverse antisym assm bot.extremum i nat_int.consec_un_max
        nat_int.consec_un_min nat_int.leq_max_sup' nat_int.leq_min_inf' nat_int.un_subset1
        rep_non_empty_means_seq)
[PROOF STATE]
proof (state)
this:
Rep_nat_int (i \<squnion> j) = {minimum i..maximum j}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem meet_connection: "(x \<sqsubseteq> y) = (x \<sqinter> y = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqsubseteq> y) = (x \<sqinter> y = x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x
 2. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
assume "x \<sqsubseteq> y"
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> y

goal (2 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x
 2. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<sqsubseteq> y
[PROOF STEP]
have "is_inf x y x"
[PROOF STATE]
proof (prove)
using this:
x \<sqsubseteq> y

goal (1 subgoal):
 1. is_inf x y x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
is_inf x y x

goal (2 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x
 2. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_inf x y x
[PROOF STEP]
show "x \<sqinter> y = x"
[PROOF STATE]
proof (prove)
using this:
is_inf x y x

goal (1 subgoal):
 1. x \<sqinter> y = x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> y = x

goal (1 subgoal):
 1. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
have "x \<sqinter> y \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> y

goal (1 subgoal):
 1. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> y

goal (1 subgoal):
 1. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
assume "x \<sqinter> y = x"
[PROOF STATE]
proof (state)
this:
x \<sqinter> y = x

goal (1 subgoal):
 1. x \<sqinter> y = x \<Longrightarrow> x \<sqsubseteq> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqsubseteq> y
[PROOF STEP]
show "x \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
using this:
x \<sqsubseteq> y

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isolated_singularity_at_holomorphic:
  assumes "f holomorphic_on s-{z}" "open s" "z\<in>s"
  shows "isolated_singularity_at f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isolated_singularity_at f z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on s - {z}
open s
z \<in> s

goal (1 subgoal):
 1. isolated_singularity_at f z
[PROOF STEP]
unfolding isolated_singularity_at_def
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on s - {z}
open s
z \<in> s

goal (1 subgoal):
 1. \<exists>r>0. f analytic_on ball z r - {z}
[PROOF STEP]
by (metis analytic_on_holomorphic centre_in_ball insert_Diff openE open_delete subset_insert_iff)


[STATEMENT]
lemma lemParallelTrans:
    assumes "lineA \<parallel> lineB"
      and   "lineB \<parallel> lineC"
      and   "direction lineB \<noteq> vecZero"
    shows   "lineA \<parallel> lineC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
have case1: "direction lineA = vecZero \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. direction lineA = 0 \<longrightarrow> lineA \<parallel>  lineC
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
direction lineA = 0 \<longrightarrow> lineA \<parallel>  lineC

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
have case2: "direction lineC = vecZero \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. direction lineC = 0 \<longrightarrow> lineA \<parallel>  lineC
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
direction lineC = 0 \<longrightarrow> lineA \<parallel>  lineC

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
direction lineC = 0 \<longrightarrow> lineA \<parallel>  lineC

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
assume case3: "direction lineA \<noteq> vecZero \<and> direction lineC \<noteq> vecZero"
[PROOF STATE]
proof (state)
this:
direction lineA \<noteq> 0 \<and> direction lineC \<noteq> 0

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
have exists_kab: "\<exists>kab.(kab \<noteq> (0::'a) \<and> direction lineB = kab**direction lineA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA
[PROOF STEP]
by (metis parallel.simps assms(1) case3 assms(3))
[PROOF STATE]
proof (state)
this:
\<exists>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA
[PROOF STEP]
obtain kab where kab_props: "kab \<noteq> 0 \<and> direction lineB = kab**direction lineA"
[PROOF STATE]
proof (prove)
using this:
\<exists>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA

goal (1 subgoal):
 1. (\<And>kab. kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kab \<noteq> (0::'a) \<and> direction lineB = kab ** direction lineA

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
have exists_kbc: "\<exists>kbc.(kbc \<noteq> (0::'a) \<and> direction lineC = kbc**direction lineB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>kbc. kbc \<noteq> (0::'a) \<and> direction lineC = kbc ** direction lineB
[PROOF STEP]
by (metis parallel.simps assms(2) case3 assms(3))
[PROOF STATE]
proof (state)
this:
\<exists>kbc. kbc \<noteq> (0::'a) \<and> direction lineC = kbc ** direction lineB

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>kbc. kbc \<noteq> (0::'a) \<and> direction lineC = kbc ** direction lineB
[PROOF STEP]
obtain kbc where kbc_props: "kbc \<noteq> 0 \<and> direction lineC = kbc**direction lineB"
[PROOF STATE]
proof (prove)
using this:
\<exists>kbc. kbc \<noteq> (0::'a) \<and> direction lineC = kbc ** direction lineB

goal (1 subgoal):
 1. (\<And>kbc. kbc \<noteq> (0::'a) \<and> direction lineC = kbc ** direction lineB \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kbc \<noteq> (0::'a) \<and> direction lineC = kbc ** direction lineB

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
define kac where "kac = kbc * kab"
[PROOF STATE]
proof (state)
this:
kac = kbc * kab

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
have kac_nonzero: "kac \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kac \<noteq> (0::'a)
[PROOF STEP]
by (metis kab_props kac_def kbc_props no_zero_divisors)
[PROOF STATE]
proof (state)
this:
kac \<noteq> (0::'a)

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
have "direction lineC = kac**direction lineA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. direction lineC = kac ** direction lineA
[PROOF STEP]
by (metis kab_props kbc_props kac_def lemScaleScale)
[PROOF STATE]
proof (state)
this:
direction lineC = kac ** direction lineA

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
hence ?thesis
[PROOF STATE]
proof (prove)
using this:
direction lineC = kac ** direction lineA

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
by (metis kac_nonzero parallel.simps)
[PROOF STATE]
proof (state)
this:
lineA \<parallel>  lineC

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
direction lineA \<noteq> 0 \<and> direction lineC \<noteq> 0 \<Longrightarrow> lineA \<parallel>  lineC

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
direction lineA \<noteq> 0 \<and> direction lineC \<noteq> 0 \<Longrightarrow> lineA \<parallel>  lineC
[PROOF STEP]
have "(direction lineA \<noteq> vecZero \<and> direction lineC \<noteq> vecZero) \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
using this:
direction lineA \<noteq> 0 \<and> direction lineC \<noteq> 0 \<Longrightarrow> lineA \<parallel>  lineC

goal (1 subgoal):
 1. direction lineA \<noteq> 0 \<and> direction lineC \<noteq> 0 \<longrightarrow> lineA \<parallel>  lineC
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
direction lineA \<noteq> 0 \<and> direction lineC \<noteq> 0 \<longrightarrow> lineA \<parallel>  lineC

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
direction lineA \<noteq> 0 \<and> direction lineC \<noteq> 0 \<longrightarrow> lineA \<parallel>  lineC

goal (1 subgoal):
 1. lineA \<parallel>  lineC
[PROOF STEP]
by (metis case1 case2)
[PROOF STATE]
proof (state)
this:
lineA \<parallel>  lineC

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rk_triple_to_rk_couple :
  assumes "rk {A, B, C} = 3"
  shows "rk {A, B} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B} = 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rk {A, B} = 2
[PROOF STEP]
have "rk {A, B} \<le> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B} \<le> 2
[PROOF STEP]
using matroid_ax_1b
[PROOF STATE]
proof (prove)
using this:
rk ?X \<le> card ?X

goal (1 subgoal):
 1. rk {A, B} \<le> 2
[PROOF STEP]
by (metis one_le_numeral rk_ax_couple rk_couple rk_singleton_bis)
[PROOF STATE]
proof (state)
this:
rk {A, B} \<le> 2

goal (1 subgoal):
 1. rk {A, B} = 2
[PROOF STEP]
have "rk {A, B, C} \<le> 2" if "rk {A, B} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C} \<le> 2
[PROOF STEP]
using matroid_ax_2_alt[of "{A, B}" C]
[PROOF STATE]
proof (prove)
using this:
rk {A, B} \<le> rk ({A, B} \<union> {C}) \<and> rk ({A, B} \<union> {C}) \<le> rk {A, B} + 1

goal (1 subgoal):
 1. rk {A, B, C} \<le> 2
[PROOF STEP]
by (simp add: insert_commute that)
[PROOF STATE]
proof (state)
this:
rk {A, B} = 1 \<Longrightarrow> rk {A, B, C} \<le> 2

goal (1 subgoal):
 1. rk {A, B} = 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B} = 1 \<Longrightarrow> rk {A, B, C} \<le> 2
[PROOF STEP]
have "rk {A, B} \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
rk {A, B} = 1 \<Longrightarrow> rk {A, B, C} \<le> 2

goal (1 subgoal):
 1. 2 \<le> rk {A, B}
[PROOF STEP]
using assms rk_ax_couple rk_singleton_bis
[PROOF STATE]
proof (prove)
using this:
rk {A, B} = 1 \<Longrightarrow> rk {A, B, C} \<le> 2
rk {A, B, C} = 3
?P \<noteq> ?Q \<longrightarrow> 2 \<le> rk {?P, ?Q}
?A = ?B \<Longrightarrow> rk {?A, ?B} = 1

goal (1 subgoal):
 1. 2 \<le> rk {A, B}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
2 \<le> rk {A, B}

goal (1 subgoal):
 1. rk {A, B} = 2
[PROOF STEP]
thus "rk {A, B} = 2"
[PROOF STATE]
proof (prove)
using this:
2 \<le> rk {A, B}

goal (1 subgoal):
 1. rk {A, B} = 2
[PROOF STEP]
by (simp add: \<open>rk {A, B} \<le> 2\<close> le_antisym)
[PROOF STATE]
proof (state)
this:
rk {A, B} = 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_within_open: "a \<in> S \<Longrightarrow> open S \<Longrightarrow> (f \<longlongrightarrow> l) (at a within S) \<longleftrightarrow> (f \<midarrow>a\<rightarrow> l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; open S\<rbrakk> \<Longrightarrow> (f \<longlongrightarrow> l) (at a within S) = f \<midarrow>a\<rightarrow> l
[PROOF STEP]
by (simp add: tendsto_def at_within_open[where S = S])


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

goal (1 subgoal):
 1. P\<inverse> `` (Range P - Y) \<inter> P\<inverse> `` Y = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma card_mostly_constant_maps:
  assumes "y \<in> B"
  shows "card {f. range f \<subseteq> B \<and> (\<forall>x. x \<ge> n \<longrightarrow> f x = y)} = card B ^ n" (is "card ?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
define f where "f = (\<lambda>f k. if k < n then f k else y)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>f k. if k < n then f k else y)

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
have a:"?A \<subseteq> (f ` ({0..<n}  \<rightarrow>\<^sub>E B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} \<subseteq> f ` ({0..<n} \<rightarrow>\<^sub>E B)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} \<subseteq> (\<lambda>f k. if k < n then f k else y) ` ({0..<n} \<rightarrow>\<^sub>E B)
[PROOF STEP]
by (rule in_image_by_witness[where g="\<lambda>f. restrict f {0..<n}"], auto)
[PROOF STATE]
proof (state)
this:
{f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} \<subseteq> f ` ({0..<n} \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
have b:"(f ` ({0..<n}  \<rightarrow>\<^sub>E B)) \<subseteq> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` ({0..<n} \<rightarrow>\<^sub>E B) \<subseteq> {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)}
[PROOF STEP]
using f_def assms
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>f k. if k < n then f k else y)
y \<in> B

goal (1 subgoal):
 1. f ` ({0..<n} \<rightarrow>\<^sub>E B) \<subseteq> {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` ({0..<n} \<rightarrow>\<^sub>E B) \<subseteq> {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)}

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
have c: "inj_on f ({0..<n} \<rightarrow>\<^sub>E B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f ({0..<n} \<rightarrow>\<^sub>E B)
[PROOF STEP]
by (rule inj_onI, metis PiE_E atLeastLessThan_iff ext f_def)
[PROOF STATE]
proof (state)
this:
inj_on f ({0..<n} \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
have "card ?A = card (f ` ({0..<n}  \<rightarrow>\<^sub>E B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card (f ` ({0..<n} \<rightarrow>\<^sub>E B))
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
{f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} \<subseteq> f ` ({0..<n} \<rightarrow>\<^sub>E B)
f ` ({0..<n} \<rightarrow>\<^sub>E B) \<subseteq> {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)}

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card (f ` ({0..<n} \<rightarrow>\<^sub>E B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card (f ` ({0..<n} \<rightarrow>\<^sub>E B))

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card (f ` ({0..<n} \<rightarrow>\<^sub>E B))

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
have "... = card ({0..<n} \<rightarrow>\<^sub>E B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f ` ({0..<n} \<rightarrow>\<^sub>E B)) = card ({0..<n} \<rightarrow>\<^sub>E B)
[PROOF STEP]
by (metis c card_image)
[PROOF STATE]
proof (state)
this:
card (f ` ({0..<n} \<rightarrow>\<^sub>E B)) = card ({0..<n} \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (f ` ({0..<n} \<rightarrow>\<^sub>E B)) = card ({0..<n} \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
have "... = card B ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({0..<n} \<rightarrow>\<^sub>E B) = card B ^ n
[PROOF STEP]
by (simp add: card_PiE[OF finite_atLeastLessThan])
[PROOF STATE]
proof (state)
this:
card ({0..<n} \<rightarrow>\<^sub>E B) = card B ^ n

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n

goal (1 subgoal):
 1. card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {f. range f \<subseteq> B \<and> (\<forall>x\<ge>n. f x = y)} = card B ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary_is_sq_length_preserving [simp]:
  assumes "unitary U" and "dim_vec v = dim_col U"
  shows "\<parallel>U * |v\<rangle>\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
have "\<langle>U * |v\<rangle>|U * |v\<rangle> \<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger>) * |U * |v\<rangle>\<rangle>) $$ (0,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * |col_fst (U * |v\<rangle>)\<rangle>) $$ (0, 0)
[PROOF STEP]
using assms(2) bra_mat_on_vec
[PROOF STATE]
proof (prove)
using this:
dim_vec v = dim_col U
dim_col ?A = dim_vec ?v \<Longrightarrow> \<langle>?A * |?v\<rangle>| = \<langle>|?v\<rangle>| * ?A\<^sup>\<dagger>

goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * |col_fst (U * |v\<rangle>)\<rangle>) $$ (0, 0)
[PROOF STEP]
by (metis inner_prod_with_times_mat mult_ket_vec_is_ket_vec_of_mult)
[PROOF STATE]
proof (state)
this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * |col_fst (U * |v\<rangle>)\<rangle>) $$ (0, 0)

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * |col_fst (U * |v\<rangle>)\<rangle>) $$ (0, 0)
[PROOF STEP]
have "\<langle>U * |v\<rangle>|U * |v\<rangle> \<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger>) * (U * |v\<rangle>)) $$ (0,0)"
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * |col_fst (U * |v\<rangle>)\<rangle>) $$ (0, 0)

goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * (U * |v\<rangle>)) $$ (0, 0)
[PROOF STEP]
using assms(2) mult_ket_vec_is_ket_vec_of_mult
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * |col_fst (U * |v\<rangle>)\<rangle>) $$ (0, 0)
dim_vec v = dim_col U
dim_col ?A = dim_vec ?v \<Longrightarrow> |col_fst (?A * |?v\<rangle>)\<rangle> = ?A * |?v\<rangle>

goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * (U * |v\<rangle>)) $$ (0, 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * (U * |v\<rangle>)) $$ (0, 0)

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * (U * |v\<rangle>)) $$ (0, 0)

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
have f1:"dim_col \<langle>|v\<rangle>| = dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col \<langle>|v\<rangle>| = dim_vec v
[PROOF STEP]
using ket_vec_def bra_def
[PROOF STATE]
proof (prove)
using this:
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)
\<langle>?v| \<equiv> mat 1 (dim_row ?v) (\<lambda>(i, j). cnj (?v $$ (j, i)))

goal (1 subgoal):
 1. dim_col \<langle>|v\<rangle>| = dim_vec v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col \<langle>|v\<rangle>| = dim_vec v

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_col \<langle>|v\<rangle>| = dim_vec v

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
have "dim_row (U\<^sup>\<dagger>) = dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row U\<^sup>\<dagger> = dim_vec v
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
dim_vec v = dim_col U

goal (1 subgoal):
 1. dim_row U\<^sup>\<dagger> = dim_vec v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row U\<^sup>\<dagger> = dim_vec v

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * (U * |v\<rangle>)) $$ (0, 0)
dim_col \<langle>|v\<rangle>| = dim_vec v
dim_row U\<^sup>\<dagger> = dim_vec v
[PROOF STEP]
have "\<langle>U * |v\<rangle>|U * |v\<rangle> \<rangle> = (\<langle>|v\<rangle>| * ((U\<^sup>\<dagger>) * U) * |v\<rangle>) $$ (0,0)"
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * (U * |v\<rangle>)) $$ (0, 0)
dim_col \<langle>|v\<rangle>| = dim_vec v
dim_row U\<^sup>\<dagger> = dim_vec v

goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger> * U) * |v\<rangle>) $$ (0, 0)
[PROOF STEP]
using assoc_mult_mat
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * U\<^sup>\<dagger> * (U * |v\<rangle>)) $$ (0, 0)
dim_col \<langle>|v\<rangle>| = dim_vec v
dim_row U\<^sup>\<dagger> = dim_vec v
\<lbrakk>?A \<in> carrier_mat ?n\<^sub>1 ?n\<^sub>2; ?B \<in> carrier_mat ?n\<^sub>2 ?n\<^sub>3; ?C \<in> carrier_mat ?n\<^sub>3 ?n\<^sub>4\<rbrakk> \<Longrightarrow> ?A * ?B * ?C = ?A * (?B * ?C)

goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger> * U) * |v\<rangle>) $$ (0, 0)
[PROOF STEP]
by(smt carrier_mat_triv dim_row_mat(1) dagger_def ket_vec_def mat_carrier times_mat_def)
[PROOF STATE]
proof (state)
this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger> * U) * |v\<rangle>) $$ (0, 0)

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger> * U) * |v\<rangle>) $$ (0, 0)
[PROOF STEP]
have "\<langle>U * |v\<rangle>|U * |v\<rangle> \<rangle> = (\<langle>|v\<rangle>| * |v\<rangle>) $$ (0,0)"
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger> * U) * |v\<rangle>) $$ (0, 0)

goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * |v\<rangle>) $$ (0, 0)
[PROOF STEP]
using assms f1 unitary_def
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * (U\<^sup>\<dagger> * U) * |v\<rangle>) $$ (0, 0)
unitary U
dim_vec v = dim_col U
dim_col \<langle>|v\<rangle>| = dim_vec v
unitary ?M \<equiv> ?M\<^sup>\<dagger> * ?M = 1\<^sub>m (dim_col ?M) \<and> ?M * ?M\<^sup>\<dagger> = 1\<^sub>m (dim_row ?M)

goal (1 subgoal):
 1. \<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * |v\<rangle>) $$ (0, 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * |v\<rangle>) $$ (0, 0)

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * |v\<rangle>) $$ (0, 0)

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
using cpx_vec_length_inner_prod
[PROOF STATE]
proof (prove)
using this:
\<langle>col_fst (U * |v\<rangle>)|col_fst (U * |v\<rangle>)\<rangle> = (\<langle>|v\<rangle>| * |v\<rangle>) $$ (0, 0)
complex_of_real (\<parallel>?v\<parallel>\<^sup>2) = \<langle>?v|?v\<rangle>

goal (1 subgoal):
 1. \<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
by(metis Re_complex_of_real inner_prod_with_times_mat)
[PROOF STATE]
proof (state)
this:
\<parallel>col_fst (U * |v\<rangle>)\<parallel>\<^sup>2 = \<parallel>v\<parallel>\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_mirror: "inorder(mirror t) = rev(inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder (mirror t) = rev (inorder t)
[PROOF STEP]
by (induction t) simp_all


[STATEMENT]
lemma IS_LEFT_TOTAL_alt: "IS_LEFT_TOTAL R \<longleftrightarrow> (\<forall>x. \<exists>y. (x,y)\<in>R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IS_LEFT_TOTAL R = (\<forall>x. \<exists>y. (x, y) \<in> R)
[PROOF STEP]
by (auto simp: IS_LEFT_TOTAL_def)