[STATEMENT]
lemma euclidean_size_lcm_le1:
  assumes "a \<noteq> 0" and "b \<noteq> 0"
  shows "euclidean_size a \<le> euclidean_size (lcm a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euclidean_size a \<le> euclidean_size (lcm a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. euclidean_size a \<le> euclidean_size (lcm a b)
[PROOF STEP]
have "a dvd lcm a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd lcm a b
[PROOF STEP]
by (rule dvd_lcm1)
[PROOF STATE]
proof (state)
this:
a dvd lcm a b

goal (1 subgoal):
 1. euclidean_size a \<le> euclidean_size (lcm a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a dvd lcm a b
[PROOF STEP]
obtain c where A: "lcm a b = a * c"
[PROOF STATE]
proof (prove)
using this:
a dvd lcm a b

goal (1 subgoal):
 1. (\<And>c. lcm a b = a * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
lcm a b = a * c

goal (1 subgoal):
 1. euclidean_size a \<le> euclidean_size (lcm a b)
[PROOF STEP]
with \<open>a \<noteq> 0\<close> and \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
b \<noteq> (0::'a)
lcm a b = a * c
[PROOF STEP]
have "c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)
b \<noteq> (0::'a)
lcm a b = a * c

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

goal (1 subgoal):
 1. euclidean_size a \<le> euclidean_size (lcm a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. euclidean_size a \<le> euclidean_size (lcm a b)
[PROOF STEP]
by (subst A, intro size_mult_mono)
[PROOF STATE]
proof (state)
this:
euclidean_size a \<le> euclidean_size (lcm a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vcard_vunion_vintersection:
  "vcard (A \<union>\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A \<oplus> vcard B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (A \<union>\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A \<oplus> vcard B
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vcard (A \<union>\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A \<oplus> vcard B
[PROOF STEP]
have AB_ABB: "A \<union>\<^sub>\<circ> B = B \<union>\<^sub>\<circ> (A -\<^sub>\<circ> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union>\<^sub>\<circ> B = B \<union>\<^sub>\<circ> (A -\<^sub>\<circ> B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union>\<^sub>\<circ> B = B \<union>\<^sub>\<circ> (A -\<^sub>\<circ> B)

goal (1 subgoal):
 1. vcard (A \<union>\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A \<oplus> vcard B
[PROOF STEP]
have ABB: "vdisjnt B (A -\<^sub>\<circ> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vdisjnt B (A -\<^sub>\<circ> B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vdisjnt B (A -\<^sub>\<circ> B)

goal (1 subgoal):
 1. vcard (A \<union>\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A \<oplus> vcard B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (A \<union>\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A \<oplus> vcard B
[PROOF STEP]
unfolding vcard_vunion[OF ABB, folded AB_ABB] cadd_assoc vcard_vdiff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard B \<oplus> vcard A = vcard A \<oplus> vcard B
[PROOF STEP]
by (simp add: cadd_commute)
[PROOF STATE]
proof (state)
this:
vcard (A \<union>\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A \<oplus> vcard B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem IF1map_cong:
  "(\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a) \<Longrightarrow> IF1map f x = IF1map g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a) \<Longrightarrow> IF1map f x = IF1map g x
[PROOF STEP]
apply (rule mp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a) \<Longrightarrow> ?P \<longrightarrow> IF1map f x = IF1map g x
 2. (\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a) \<Longrightarrow> ?P
[PROOF STEP]
apply (rule conjunct1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a) \<Longrightarrow> (?P \<longrightarrow> IF1map f x = IF1map g x) \<and> ?Q3
 2. (\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a) \<Longrightarrow> ?P
[PROOF STEP]
apply (rule IFmap_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a) \<Longrightarrow> \<forall>a\<in>IF1set x. f a = g a
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>\<And>a. a \<in> IF1set x \<Longrightarrow> f a = g a; a \<in> IF1set x\<rbrakk> \<Longrightarrow> f a = g a
[PROOF STEP]
apply (tactic \<open>Goal.assume_rule_tac @{context} 1\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_zfact_carr: "card (carrier (ZFact (int n))) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (carrier (ZFact (int n))) = n
[PROOF STEP]
using bij_betw_same_card[OF zfact_iso_bij]
[PROOF STATE]
proof (prove)
using this:
card {..<n} = card (carrier (ZFact (int n)))

goal (1 subgoal):
 1. card (carrier (ZFact (int n))) = n
[PROOF STEP]
by simp


[STATEMENT]
lemma sqrt_nat_ceiling[simp]: "sqrt_nat_ceiling x = \<lceil> sqrt (real x) \<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_nat_ceiling x = \<lceil>sqrt (real x)\<rceil>
[PROOF STEP]
unfolding sqrt_nat_ceiling_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root_nat_ceiling 2 x = \<lceil>sqrt (real x)\<rceil>
[PROOF STEP]
by (simp add: sqrt_def)


[STATEMENT]
lemma smult_distrib_left_minus_mat:
  fixes A B :: "'a::comm_ring_1 mat"
  assumes "A \<in> carrier_mat n n" "B \<in> carrier_mat n n"
  shows "c \<cdot>\<^sub>m (B - A) = c \<cdot>\<^sub>m B - c \<cdot>\<^sub>m A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<cdot>\<^sub>m (B - A) = c \<cdot>\<^sub>m B - c \<cdot>\<^sub>m A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. c \<cdot>\<^sub>m (B - A) = c \<cdot>\<^sub>m B - c \<cdot>\<^sub>m A
[PROOF STEP]
by (auto simp add: minus_add_uminus_mat add_smult_distrib_left_mat)


[STATEMENT]
lemma linear_surj_adj_imp_inj:
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  assumes "linear f" "surj (adjoint f)"
  shows "inj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj f
[PROOF STEP]
have "\<exists>x. y = adjoint f x" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. y = adjoint f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
linear f
surj (adjoint f)

goal (1 subgoal):
 1. \<exists>x. y = adjoint f x
[PROOF STEP]
by (simp add: surjD)
[PROOF STATE]
proof (state)
this:
\<exists>x. ?y = adjoint f x

goal (1 subgoal):
 1. inj f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. ?y = adjoint f x
[PROOF STEP]
show "inj f"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. ?y = adjoint f x

goal (1 subgoal):
 1. inj f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x. ?y = adjoint f x
linear f
surj (adjoint f)

goal (1 subgoal):
 1. inj f
[PROOF STEP]
unfolding inj_on_def image_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x. ?y = adjoint f x
linear f
{y. \<exists>x\<in>UNIV. y = adjoint f x} = UNIV

goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>y\<in>UNIV. f x = f y \<longrightarrow> x = y
[PROOF STEP]
by (metis (no_types) adjoint_works euclidean_eqI)
[PROOF STATE]
proof (state)
this:
inj f

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>\<^url>\<open>https://mathonline.wikidot.com/injectivity-and-surjectivity-of-the-adjoint-of-a-linear-map\<close>\<close>


[STATEMENT]
theorem binop_dfa_accepts:
  assumes A: "wf_dfa A n"
  and B: "wf_dfa B n"
  and X: "list_all (is_alph n) bss"
  shows "dfa_accepts (binop_dfa f A B) bss = f (dfa_accepts A bss) (dfa_accepts B bss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfa_accepts (binop_dfa f A B) bss = f (dfa_accepts A bss) (dfa_accepts B bss)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dfa_accepts (binop_dfa f A B) bss = f (dfa_accepts A bss) (dfa_accepts B bss)
[PROOF STEP]
from A B
[PROOF STATE]
proof (chain)
picking this:
wf_dfa A n
wf_dfa B n
[PROOF STEP]
interpret prod_DFS A B n
[PROOF STATE]
proof (prove)
using this:
wf_dfa A n
wf_dfa B n

goal (1 subgoal):
 1. prod_DFS A B n
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dfa_accepts (binop_dfa f A B) bss = f (dfa_accepts A bss) (dfa_accepts B bss)
[PROOF STEP]
from X
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) bss
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (binop_dfa f A B) bss = f (dfa_accepts A bss) (dfa_accepts B bss)
[PROOF STEP]
by (simp add: accepts_def dfa_accepting_def binop_dfa_steps)
[PROOF STATE]
proof (state)
this:
dfa_accepts (binop_dfa f A B) bss = f (dfa_accepts A bss) (dfa_accepts B bss)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma orthogonal_basis_exists:
  fixes V :: "(real^'b) list"
  assumes B: "is_basis (set V)"
  and d: "distinct V"
  shows "vec.independent (set (Gram_Schmidt V)) \<and> (set V) \<subseteq> vec.span (set (Gram_Schmidt V))
  \<and> (card (set (Gram_Schmidt V)) = vec.dim (set V)) \<and> pairwise orthogonal (set (Gram_Schmidt V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
have "(set V) \<subseteq> vec.span (set (Gram_Schmidt V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set V \<subseteq> vec.span (set (Gram_Schmidt V))
[PROOF STEP]
using basis_orthogonal'[of V]
[PROOF STATE]
proof (prove)
using this:
length (Gram_Schmidt V) = length V \<and> span (set (Gram_Schmidt V)) = span (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))

goal (1 subgoal):
 1. set V \<subseteq> vec.span (set (Gram_Schmidt V))
[PROOF STEP]
using vec.span_superset[where ?'a=real, where ?'b='b]
[PROOF STATE]
proof (prove)
using this:
length (Gram_Schmidt V) = length V \<and> span (set (Gram_Schmidt V)) = span (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
?S \<subseteq> vec.span ?S

goal (1 subgoal):
 1. set V \<subseteq> vec.span (set (Gram_Schmidt V))
[PROOF STEP]
by (auto simp: span_vec_eq)
[PROOF STATE]
proof (state)
this:
set V \<subseteq> vec.span (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set V \<subseteq> vec.span (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
have "pairwise orthogonal (set (Gram_Schmidt V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
using basis_orthogonal'[of V]
[PROOF STATE]
proof (prove)
using this:
length (Gram_Schmidt V) = length V \<and> span (set (Gram_Schmidt V)) = span (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))

goal (1 subgoal):
 1. pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pairwise orthogonal (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pairwise orthogonal (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
have c: "(card (set (Gram_Schmidt V)) = vec.dim (set V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) = vec.dim (set V)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) = vec.dim (set V)
[PROOF STEP]
have card_eq_dim: "card (set V) = vec.dim (set V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set V) = vec.dim (set V)
[PROOF STEP]
by (metis B independent_is_basis vec.dim_span vec.indep_card_eq_dim_span)
[PROOF STATE]
proof (state)
this:
card (set V) = vec.dim (set V)

goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) = vec.dim (set V)
[PROOF STEP]
have "vec.dim (set V) \<le> (card (set (Gram_Schmidt V)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (set V) \<le> card (set (Gram_Schmidt V))
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
is_basis (set V)

goal (1 subgoal):
 1. vec.dim (set V) \<le> card (set (Gram_Schmidt V))
[PROOF STEP]
unfolding is_basis_def
[PROOF STATE]
proof (prove)
using this:
vec.independent (set V) \<and> vec.span (set V) = UNIV

goal (1 subgoal):
 1. vec.dim (set V) \<le> card (set (Gram_Schmidt V))
[PROOF STEP]
using vec.independent_span_bound[of "(set (Gram_Schmidt V))" "set V"]
[PROOF STATE]
proof (prove)
using this:
vec.independent (set V) \<and> vec.span (set V) = UNIV
\<lbrakk>finite (set (Gram_Schmidt V)); vec.independent (set V); set V \<subseteq> vec.span (set (Gram_Schmidt V))\<rbrakk> \<Longrightarrow> finite (set V) \<and> card (set V) \<le> card (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.dim (set V) \<le> card (set (Gram_Schmidt V))
[PROOF STEP]
using basis_orthogonal'[of V]
[PROOF STATE]
proof (prove)
using this:
vec.independent (set V) \<and> vec.span (set V) = UNIV
\<lbrakk>finite (set (Gram_Schmidt V)); vec.independent (set V); set V \<subseteq> vec.span (set (Gram_Schmidt V))\<rbrakk> \<Longrightarrow> finite (set V) \<and> card (set V) \<le> card (set (Gram_Schmidt V))
length (Gram_Schmidt V) = length V \<and> span (set (Gram_Schmidt V)) = span (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.dim (set V) \<le> card (set (Gram_Schmidt V))
[PROOF STEP]
by (simp add: calculation(1) local.card_eq_dim)
[PROOF STATE]
proof (state)
this:
vec.dim (set V) \<le> card (set (Gram_Schmidt V))

goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) = vec.dim (set V)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec.dim (set V) \<le> card (set (Gram_Schmidt V))

goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) = vec.dim (set V)
[PROOF STEP]
have "(card (set (Gram_Schmidt V))) \<le> vec.dim (set V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) \<le> vec.dim (set V)
[PROOF STEP]
using card_Gram_Schmidt[OF d] card_eq_dim
[PROOF STATE]
proof (prove)
using this:
card (set (Gram_Schmidt V)) \<le> card (set V)
card (set V) = vec.dim (set V)

goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) \<le> vec.dim (set V)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt V)) \<le> vec.dim (set V)

goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) = vec.dim (set V)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vec.dim (set V) \<le> card (set (Gram_Schmidt V))
card (set (Gram_Schmidt V)) \<le> vec.dim (set V)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vec.dim (set V) \<le> card (set (Gram_Schmidt V))
card (set (Gram_Schmidt V)) \<le> vec.dim (set V)

goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) = vec.dim (set V)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt V)) = vec.dim (set V)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt V)) = vec.dim (set V)

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt V)) = vec.dim (set V)

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
have "vec.independent (set (Gram_Schmidt V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V))
[PROOF STEP]
proof (rule vec.card_le_dim_spanning[of _ "UNIV::(real^'b) set"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. set (Gram_Schmidt V) \<subseteq> UNIV
 2. UNIV \<subseteq> vec.span (set (Gram_Schmidt V))
 3. finite (set (Gram_Schmidt V))
 4. card (set (Gram_Schmidt V)) \<le> vec.dim UNIV
[PROOF STEP]
show "set (Gram_Schmidt V) \<subseteq> (UNIV::(real^'b) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (Gram_Schmidt V) \<subseteq> UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (Gram_Schmidt V) \<subseteq> UNIV

goal (3 subgoals):
 1. UNIV \<subseteq> vec.span (set (Gram_Schmidt V))
 2. finite (set (Gram_Schmidt V))
 3. card (set (Gram_Schmidt V)) \<le> vec.dim UNIV
[PROOF STEP]
show "UNIV \<subseteq> vec.span (set (Gram_Schmidt V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<subseteq> vec.span (set (Gram_Schmidt V))
[PROOF STEP]
using basis_orthogonal'[of V]
[PROOF STATE]
proof (prove)
using this:
length (Gram_Schmidt V) = length V \<and> span (set (Gram_Schmidt V)) = span (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))

goal (1 subgoal):
 1. UNIV \<subseteq> vec.span (set (Gram_Schmidt V))
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
length (Gram_Schmidt V) = length V \<and> span (set (Gram_Schmidt V)) = span (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
is_basis (set V)

goal (1 subgoal):
 1. UNIV \<subseteq> vec.span (set (Gram_Schmidt V))
[PROOF STEP]
unfolding is_basis_def
[PROOF STATE]
proof (prove)
using this:
length (Gram_Schmidt V) = length V \<and> span (set (Gram_Schmidt V)) = span (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
vec.independent (set V) \<and> vec.span (set V) = UNIV

goal (1 subgoal):
 1. UNIV \<subseteq> vec.span (set (Gram_Schmidt V))
[PROOF STEP]
by (simp add: span_vec_eq)
[PROOF STATE]
proof (state)
this:
UNIV \<subseteq> vec.span (set (Gram_Schmidt V))

goal (2 subgoals):
 1. finite (set (Gram_Schmidt V))
 2. card (set (Gram_Schmidt V)) \<le> vec.dim UNIV
[PROOF STEP]
show "finite (set (Gram_Schmidt V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set (Gram_Schmidt V))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (set (Gram_Schmidt V))

goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) \<le> vec.dim UNIV
[PROOF STEP]
show "card (set (Gram_Schmidt V)) \<le> vec.dim (UNIV::(real^'b) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt V)) \<le> vec.dim UNIV
[PROOF STEP]
by (metis c top_greatest vec.dim_subset)
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt V)) \<le> vec.dim UNIV

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vec.independent (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set V \<subseteq> vec.span (set (Gram_Schmidt V))
pairwise orthogonal (set (Gram_Schmidt V))
card (set (Gram_Schmidt V)) = vec.dim (set V)
vec.independent (set (Gram_Schmidt V))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set V \<subseteq> vec.span (set (Gram_Schmidt V))
pairwise orthogonal (set (Gram_Schmidt V))
card (set (Gram_Schmidt V)) = vec.dim (set V)
vec.independent (set (Gram_Schmidt V))

goal (1 subgoal):
 1. vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec.independent (set (Gram_Schmidt V)) \<and> set V \<subseteq> vec.span (set (Gram_Schmidt V)) \<and> card (set (Gram_Schmidt V)) = vec.dim (set V) \<and> pairwise orthogonal (set (Gram_Schmidt V))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_eq_impl_unitfactor: "\<bar>a::int\<bar> = \<bar>b\<bar> \<Longrightarrow> \<exists> u. a = u*b \<and> \<bar>u\<bar>=1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> \<exists>u. a = u * b \<and> \<bar>u\<bar> = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> \<exists>u. a = u * b \<and> \<bar>u\<bar> = 1
[PROOF STEP]
assume "\<bar>a\<bar> = \<bar>b\<bar>"
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> = \<bar>b\<bar>

goal (1 subgoal):
 1. \<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> \<exists>u. a = u * b \<and> \<bar>u\<bar> = 1
[PROOF STEP]
hence "a = 1*b \<or> a = (-1)*b"
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> = \<bar>b\<bar>

goal (1 subgoal):
 1. a = 1 * b \<or> a = - 1 * b
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
a = 1 * b \<or> a = - 1 * b

goal (1 subgoal):
 1. \<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> \<exists>u. a = u * b \<and> \<bar>u\<bar> = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 1 * b \<or> a = - 1 * b
[PROOF STEP]
obtain u where "a = u*b \<and> (u=1 \<or> u=-1)"
[PROOF STATE]
proof (prove)
using this:
a = 1 * b \<or> a = - 1 * b

goal (1 subgoal):
 1. (\<And>u. a = u * b \<and> (u = 1 \<or> u = - 1) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a = u * b \<and> (u = 1 \<or> u = - 1)

goal (1 subgoal):
 1. \<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> \<exists>u. a = u * b \<and> \<bar>u\<bar> = 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = u * b \<and> (u = 1 \<or> u = - 1)

goal (1 subgoal):
 1. \<exists>u. a = u * b \<and> \<bar>u\<bar> = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>u. a = u * b \<and> \<bar>u\<bar> = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_fds_add:
  assumes "fds_converges f s" "fds_converges g s"
  shows   "eval_fds (f + g) s = eval_fds f s + eval_fds g s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds (f + g) s = eval_fds f s + eval_fds g s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_fds (f + g) s = eval_fds f s + eval_fds g s
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
fds_converges f s
fds_converges g s
[PROOF STEP]
have "(\<lambda>n. fds_nth f n / nat_power n s) sums eval_fds f s"
                  "(\<lambda>n. fds_nth g n / nat_power n s) sums eval_fds g s"
[PROOF STATE]
proof (prove)
using this:
fds_converges f s
fds_converges g s

goal (1 subgoal):
 1. (\<lambda>n. fds_nth f n / nat_power n s) sums eval_fds f s &&& (\<lambda>n. fds_nth g n / nat_power n s) sums eval_fds g s
[PROOF STEP]
by (simp_all add: fds_converges_def sums_iff eval_fds_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. fds_nth f n / nat_power n s) sums eval_fds f s
(\<lambda>n. fds_nth g n / nat_power n s) sums eval_fds g s

goal (1 subgoal):
 1. eval_fds (f + g) s = eval_fds f s + eval_fds g s
[PROOF STEP]
from sums_add[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. fds_nth f n / nat_power n s + fds_nth g n / nat_power n s) sums (eval_fds f s + eval_fds g s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. fds_nth f n / nat_power n s + fds_nth g n / nat_power n s) sums (eval_fds f s + eval_fds g s)

goal (1 subgoal):
 1. eval_fds (f + g) s = eval_fds f s + eval_fds g s
[PROOF STEP]
by (simp add: eval_fds_def sums_iff add_divide_distrib)
[PROOF STATE]
proof (state)
this:
eval_fds (f + g) s = eval_fds f s + eval_fds g s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_nat_ex_max:
  assumes fin: "finite (N::nat set)"
  shows "\<exists>m. \<forall>n\<in>N. n < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. \<forall>n\<in>N. n < m
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
finite N

goal (1 subgoal):
 1. \<exists>m. \<forall>n\<in>N. n < m
[PROOF STEP]
proof (induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>m. \<forall>n\<in>{}. n < m
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>m. \<forall>n\<in>F. n < m\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>n\<in>insert x F. n < m
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>m. \<forall>n\<in>{}. n < m
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>m. \<forall>n\<in>F. n < m\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>n\<in>insert x F. n < m
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. \<forall>n\<in>{}. n < m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>m. \<forall>n\<in>{}. n < m

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>m. \<forall>n\<in>F. n < m\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>n\<in>insert x F. n < m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>m. \<forall>n\<in>F. n < m\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>n\<in>insert x F. n < m
[PROOF STEP]
case (insert k N)
[PROOF STATE]
proof (state)
this:
finite N
k \<notin> N
\<exists>m. \<forall>n\<in>N. n < m

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>m. \<forall>n\<in>F. n < m\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>n\<in>insert x F. n < m
[PROOF STEP]
have "\<exists>m. \<forall>n\<in>N. n < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. \<forall>n\<in>N. n < m
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
\<exists>m. \<forall>n\<in>N. n < m

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>m. \<forall>n\<in>F. n < m\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>n\<in>insert x F. n < m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>m. \<forall>n\<in>N. n < m
[PROOF STEP]
obtain m where m_max: "\<forall>n\<in>N. n < m"
[PROOF STATE]
proof (prove)
using this:
\<exists>m. \<forall>n\<in>N. n < m

goal (1 subgoal):
 1. (\<And>m. \<forall>n\<in>N. n < m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>n\<in>N. n < m

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>m. \<forall>n\<in>F. n < m\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>n\<in>insert x F. n < m
[PROOF STEP]
show "\<exists>m. \<forall>n\<in>insert k N. n < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. \<forall>n\<in>insert k N. n < m
[PROOF STEP]
proof (rule exI [where x="Suc (max k m)"])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>n\<in>insert k N. n < Suc (max k m)
[PROOF STEP]
qed (insert m_max, auto simp add: max_def)
[PROOF STATE]
proof (state)
this:
\<exists>m. \<forall>n\<in>insert k N. n < m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in finite_borel_measure) emeasure_Ioc:
  assumes "a \<le> b" shows "emeasure M {a <.. b} = cdf M b - cdf M a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
have "{a <.. b} = {..b} - {..a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a<..b} = {..b} - {..a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a<..b} = {..b} - {..a}

goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{a<..b} = {..b} - {..a}

goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
have "{..x} \<in> sets M" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..x} \<in> sets M
[PROOF STEP]
using atMost_borel[of x] M_is_borel
[PROOF STATE]
proof (prove)
using this:
{..x} \<in> sets borel
sets M = sets borel

goal (1 subgoal):
 1. {..x} \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..?x} \<in> sets M

goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{..?x} \<in> sets M

goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
note \<open>a \<le> b\<close>
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{a<..b} = {..b} - {..a}
{..?x} \<in> sets M
a \<le> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{a<..b} = {..b} - {..a}
{..?x} \<in> sets M
a \<le> b

goal (1 subgoal):
 1. emeasure M {a<..b} = ennreal (cdf M b - cdf M a)
[PROOF STEP]
by (simp add: emeasure_eq_measure finite_measure_Diff cdf_def)
[PROOF STATE]
proof (state)
this:
emeasure M {a<..b} = ennreal (cdf M b - cdf M a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Union_atLeastAtMost_real_of_int:
  assumes "a < b"
  shows   "(\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)}) = {real_of_int a..real_of_int b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)}) = {real_of_int a..real_of_int b}
[PROOF STEP]
proof (intro equalityI subsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)}) \<Longrightarrow> x \<in> {real_of_int a..real_of_int b}
 2. \<And>x. x \<in> {real_of_int a..real_of_int b} \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)}) \<Longrightarrow> x \<in> {real_of_int a..real_of_int b}
 2. \<And>x. x \<in> {real_of_int a..real_of_int b} \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
assume x: "x \<in> {real_of_int a..real_of_int b}"
[PROOF STATE]
proof (state)
this:
x \<in> {real_of_int a..real_of_int b}

goal (2 subgoals):
 1. \<And>x. x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)}) \<Longrightarrow> x \<in> {real_of_int a..real_of_int b}
 2. \<And>x. x \<in> {real_of_int a..real_of_int b} \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
thus "x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})"
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int a..real_of_int b}

goal (1 subgoal):
 1. x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
proof (cases "x = real_of_int b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x = real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
 2. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = real_of_int b

goal (2 subgoals):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x = real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
 2. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a < b
x = real_of_int b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a < b
x = real_of_int b

goal (1 subgoal):
 1. x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
by (auto intro!: bexI[of _ "b - 1"])
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})

goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> real_of_int b

goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {real_of_int a..real_of_int b}
x \<noteq> real_of_int b
[PROOF STEP]
have x: "x \<ge> real_of_int a" "x < real_of_int b"
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int a..real_of_int b}
x \<noteq> real_of_int b

goal (1 subgoal):
 1. real_of_int a \<le> x &&& x < real_of_int b
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
real_of_int a \<le> x
x < real_of_int b

goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
hence "x \<ge> of_int \<lfloor>x\<rfloor>" "x \<le> of_int \<lfloor>x\<rfloor> + 1"
[PROOF STATE]
proof (prove)
using this:
real_of_int a \<le> x
x < real_of_int b

goal (1 subgoal):
 1. real_of_int \<lfloor>x\<rfloor> \<le> x &&& x \<le> real_of_int \<lfloor>x\<rfloor> + 1
[PROOF STEP]
by linarith+
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>x\<rfloor> \<le> x
x \<le> real_of_int \<lfloor>x\<rfloor> + 1

goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>x\<rfloor> \<le> x
x \<le> real_of_int \<lfloor>x\<rfloor> + 1

goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
real_of_int a \<le> x
x < real_of_int b
[PROOF STEP]
have "\<lfloor>x\<rfloor> \<ge> a" "\<lfloor>x\<rfloor> < b"
[PROOF STATE]
proof (prove)
using this:
real_of_int a \<le> x
x < real_of_int b

goal (1 subgoal):
 1. a \<le> \<lfloor>x\<rfloor> &&& \<lfloor>x\<rfloor> < b
[PROOF STEP]
by linarith+
[PROOF STATE]
proof (state)
this:
a \<le> \<lfloor>x\<rfloor>
\<lfloor>x\<rfloor> < b

goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int \<lfloor>x\<rfloor> \<le> x
x \<le> real_of_int \<lfloor>x\<rfloor> + 1
a \<le> \<lfloor>x\<rfloor>
\<lfloor>x\<rfloor> < b
[PROOF STEP]
have "\<exists>n\<in>{a..<b}. x \<in> {of_int n..of_int (n + 1)}"
[PROOF STATE]
proof (prove)
using this:
real_of_int \<lfloor>x\<rfloor> \<le> x
x \<le> real_of_int \<lfloor>x\<rfloor> + 1
a \<le> \<lfloor>x\<rfloor>
\<lfloor>x\<rfloor> < b

goal (1 subgoal):
 1. \<exists>n\<in>{a..<b}. x \<in> {real_of_int n..real_of_int (n + 1)}
[PROOF STEP]
by (intro bexI[of _ "\<lfloor>x\<rfloor>"]) simp_all
[PROOF STATE]
proof (state)
this:
\<exists>n\<in>{a..<b}. x \<in> {real_of_int n..real_of_int (n + 1)}

goal (1 subgoal):
 1. \<lbrakk>x \<in> {real_of_int a..real_of_int b}; x \<noteq> real_of_int b\<rbrakk> \<Longrightarrow> x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>n\<in>{a..<b}. x \<in> {real_of_int n..real_of_int (n + 1)}

goal (1 subgoal):
 1. x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)})

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>n\<in>{a..<b}. {real_of_int n..real_of_int (n + 1)}) \<Longrightarrow> x \<in> {real_of_int a..real_of_int b}
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in Module) mHom_tOp_commute:"\<lbrakk>R module N; f \<in> mHom R M N;
        g \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N f g = tOp_mHom R M N g f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N f g = tOp_mHom R M N g f
[PROOF STEP]
apply (frule_tac f = f and g = g in tOp_mHom_closed [of N], assumption+,
       frule_tac f = g and g = f in tOp_mHom_closed [of N], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; tOp_mHom R M N f g \<in> mHom R M N; tOp_mHom R M N g f \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N f g = tOp_mHom R M N g f
[PROOF STEP]
apply (rule mHom_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; tOp_mHom R M N f g \<in> mHom R M N; tOp_mHom R M N g f \<in> mHom R M N\<rbrakk> \<Longrightarrow> \<forall>m\<in>carrier M. tOp_mHom R M N f g m = tOp_mHom R M N g f m
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; tOp_mHom R M N f g \<in> mHom R M N; tOp_mHom R M N g f \<in> mHom R M N; m \<in> carrier M\<rbrakk> \<Longrightarrow> tOp_mHom R M N f g m = tOp_mHom R M N g f m
[PROOF STEP]
apply (thin_tac "tOp_mHom R M N f g \<in> mHom R M N",
        thin_tac "tOp_mHom R M N g f \<in> mHom R M N")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; m \<in> carrier M\<rbrakk> \<Longrightarrow> tOp_mHom R M N f g m = tOp_mHom R M N g f m
[PROOF STEP]
apply (simp add:tOp_mHom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; m \<in> carrier M\<rbrakk> \<Longrightarrow> f m \<plusminus>\<^bsub>N\<^esub> g m = g m \<plusminus>\<^bsub>N\<^esub> f m
[PROOF STEP]
apply (frule_tac f = f and m = m in mHom_mem [of N], assumption+,
        frule_tac f = g and m = m in mHom_mem [of N], assumption+,
        frule Module.module_is_ag [of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; m \<in> carrier M; f m \<in> carrier N; g m \<in> carrier N; aGroup N\<rbrakk> \<Longrightarrow> f m \<plusminus>\<^bsub>N\<^esub> g m = g m \<plusminus>\<^bsub>N\<^esub> f m
[PROOF STEP]
apply (simp add:aGroup.ag_pOp_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convex_scaled:
  assumes "convex S"
  shows "convex ((\<lambda>x. x *\<^sub>R c) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex ((\<lambda>x. x *\<^sub>R c) ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex ((\<lambda>x. x *\<^sub>R c) ` S)
[PROOF STEP]
have "linear (\<lambda>x. x *\<^sub>R c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (\<lambda>x. x *\<^sub>R c)
[PROOF STEP]
by (simp add: linearI scaleR_add_left)
[PROOF STATE]
proof (state)
this:
linear (\<lambda>x. x *\<^sub>R c)

goal (1 subgoal):
 1. convex ((\<lambda>x. x *\<^sub>R c) ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
linear (\<lambda>x. x *\<^sub>R c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
linear (\<lambda>x. x *\<^sub>R c)

goal (1 subgoal):
 1. convex ((\<lambda>x. x *\<^sub>R c) ` S)
[PROOF STEP]
using \<open>convex S\<close>
[PROOF STATE]
proof (prove)
using this:
linear (\<lambda>x. x *\<^sub>R c)
convex S

goal (1 subgoal):
 1. convex ((\<lambda>x. x *\<^sub>R c) ` S)
[PROOF STEP]
by (rule convex_linear_image)
[PROOF STATE]
proof (state)
this:
convex ((\<lambda>x. x *\<^sub>R c) ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_space_eq:
  assumes A: "A \<in> carrier_mat nr n"
  shows "row_space A = {w\<in>carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_space A = {w \<in> carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}
[PROOF STEP]
using A col_space_eq
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr n
?A \<in> carrier_mat n ?nc \<Longrightarrow> col_space ?A = {y \<in> carrier_vec (dim_row ?A). \<exists>x\<in>carrier_vec (dim_col ?A). ?A *\<^sub>v x = y}

goal (1 subgoal):
 1. row_space A = {w \<in> carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}
[PROOF STEP]
unfolding row_space_eq_col_space_transpose
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr n
?A \<in> carrier_mat n ?nc \<Longrightarrow> col_space ?A = {y \<in> carrier_vec (dim_row ?A). \<exists>x\<in>carrier_vec (dim_col ?A). ?A *\<^sub>v x = y}

goal (1 subgoal):
 1. col_space A\<^sup>T = {w \<in> carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_split_eval: assumes "poly_split m p = (c,q)"
  shows "eval_poly \<alpha> p = (eval_monom \<alpha> m * c) + eval_poly \<alpha> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly \<alpha> p = eval_monom \<alpha> m * c + eval_poly \<alpha> q
[PROOF STEP]
using poly_split[OF assms]
[PROOF STATE]
proof (prove)
using this:
p =p (m, c) # q

goal (1 subgoal):
 1. eval_poly \<alpha> p = eval_monom \<alpha> m * c + eval_poly \<alpha> q
[PROOF STEP]
unfolding eq_poly_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<alpha>. eval_poly \<alpha> p = eval_poly \<alpha> ((m, c) # q)

goal (1 subgoal):
 1. eval_poly \<alpha> p = eval_monom \<alpha> m * c + eval_poly \<alpha> q
[PROOF STEP]
by auto


[STATEMENT]
lemma measurable_less_count_space [measurable (raw)]:
  assumes "countable A"
  assumes [measurable]: "a \<in> B \<rightarrow>\<^sub>M count_space A"
  assumes [measurable]: "b \<in> B \<rightarrow>\<^sub>M count_space A"
  shows   "Measurable.pred B (\<lambda>x. a x < b x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Measurable.pred B (\<lambda>x. a x < b x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Measurable.pred B (\<lambda>x. a x < b x)
[PROOF STEP]
have "Measurable.pred (count_space (A \<times> A)) (\<lambda>x. fst x < snd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Measurable.pred (count_space (A \<times> A)) (\<lambda>x. fst x < snd x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Measurable.pred (count_space (A \<times> A)) (\<lambda>x. fst x < snd x)

goal (1 subgoal):
 1. Measurable.pred B (\<lambda>x. a x < b x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Measurable.pred (count_space (A \<times> A)) (\<lambda>x. fst x < snd x)

goal (1 subgoal):
 1. Measurable.pred B (\<lambda>x. a x < b x)
[PROOF STEP]
have "count_space (A \<times> A) = count_space A \<Otimes>\<^sub>M count_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_space (A \<times> A) = count_space A \<Otimes>\<^sub>M count_space A
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
countable A

goal (1 subgoal):
 1. count_space (A \<times> A) = count_space A \<Otimes>\<^sub>M count_space A
[PROOF STEP]
by (simp add: pair_measure_countable)
[PROOF STATE]
proof (state)
this:
count_space (A \<times> A) = count_space A \<Otimes>\<^sub>M count_space A

goal (1 subgoal):
 1. Measurable.pred B (\<lambda>x. a x < b x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Measurable.pred (count_space A \<Otimes>\<^sub>M count_space A) (\<lambda>x. fst x < snd x)
[PROOF STEP]
have "Measurable.pred B ((\<lambda>x. fst x < snd x) \<circ> (\<lambda>x. (a x, b x)))"
[PROOF STATE]
proof (prove)
using this:
Measurable.pred (count_space A \<Otimes>\<^sub>M count_space A) (\<lambda>x. fst x < snd x)

goal (1 subgoal):
 1. Measurable.pred B ((\<lambda>x. fst x < snd x) \<circ> (\<lambda>x. (a x, b x)))
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
Measurable.pred B ((\<lambda>x. fst x < snd x) \<circ> (\<lambda>x. (a x, b x)))

goal (1 subgoal):
 1. Measurable.pred B (\<lambda>x. a x < b x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Measurable.pred B ((\<lambda>x. fst x < snd x) \<circ> (\<lambda>x. (a x, b x)))

goal (1 subgoal):
 1. Measurable.pred B (\<lambda>x. a x < b x)
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
Measurable.pred B (\<lambda>x. a x < b x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_scalar_commute:
  fixes A :: "'a::{field}^'m^'n"
  shows "A *v (c *s x) = c *s (A *v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v (c *s x) = c *s (A *v x)
[PROOF STEP]
by (simp add: vector_scalar_mult_def matrix_vector_mult_def mult_ac sum_distrib_left)


[STATEMENT]
lemma ex2_6: "\<bar>integral {0 .. 1} (\<lambda>x::real. arctan (sqrt (x\<^sup>2 + 2)) / (sqrt (x\<^sup>2 + 2) * (x\<^sup>2 + 1))) - 5*pi\<^sup>2/96\<bar> \<le> 1 / 10^6"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>integral {0..1} (\<lambda>x. arctan (sqrt (x\<^sup>2 + 2)) / (sqrt (x\<^sup>2 + 2) * (x\<^sup>2 + 1))) - 5 * pi\<^sup>2 / 96\<bar> \<le> 1 / 10 ^ 6
[PROOF STEP]
by (rule abs_minus_leI) (tactic \<open>integral_bnds_tac 1 40 10 6 26 "" @{thms pow_gt_zero} @{context} 1\<close>)


[STATEMENT]
lemma f_geom_series:
  assumes "b = 2^(Suc c)"
  shows "(F q c b = f) \<longleftrightarrow> ( (b-1) * f = 2^c * (b^(Suc q) - 1) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F q c b = f) = ((b - 1) * f = 2 ^ c * (b ^ Suc q - 1))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (F q c b = f) = ((b - 1) * f = 2 ^ c * (b ^ Suc q - 1))
[PROOF STEP]
have "F q c b = 2^c *  E q b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F q c b = 2 ^ c * E q b
[PROOF STEP]
by (auto simp: E_def F_def sum_distrib_left sum_distrib_right)
[PROOF STATE]
proof (state)
this:
F q c b = 2 ^ c * E q b

goal (1 subgoal):
 1. (F q c b = f) = ((b - 1) * f = 2 ^ c * (b ^ Suc q - 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
F q c b = 2 ^ c * E q b

goal (1 subgoal):
 1. (F q c b = f) = ((b - 1) * f = 2 ^ c * (b ^ Suc q - 1))
[PROOF STEP]
have "b \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b = 2 ^ Suc c

goal (1 subgoal):
 1. 2 \<le> b
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
2 \<le> b

goal (1 subgoal):
 1. (F q c b = f) = ((b - 1) * f = 2 ^ c * (b ^ Suc q - 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
F q c b = 2 ^ c * E q b
2 \<le> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
F q c b = 2 ^ c * E q b
2 \<le> b

goal (1 subgoal):
 1. (F q c b = f) = ((b - 1) * f = 2 ^ c * (b ^ Suc q - 1))
[PROOF STEP]
by (smt e_geom_series mult.left_commute mult_cancel_left)
[PROOF STATE]
proof (state)
this:
(F q c b = f) = ((b - 1) * f = 2 ^ c * (b ^ Suc q - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hlog_mult:
  "\<And>a x y. 0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> 0 < y \<Longrightarrow> hlog a (x * y) = hlog a x + hlog a y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x y. \<lbrakk>0 < a; a \<noteq> 1; 0 < x; 0 < y\<rbrakk> \<Longrightarrow> hlog a (x * y) = hlog a x + hlog a y
[PROOF STEP]
by transfer (rule log_mult)


[STATEMENT]
theorem ln_lower_13_eq: "0<x \<Longrightarrow>
    ln_lower_13 x = (1/70)*(10 + 1921*x + 20149*x^2 + 50774*x^3 + 38524*x^4 + 8389*x^5 + 353*x^6)*(x - 1) /
                    (x*(7 + 126*x + 525*x^2 + 700*x^3 + 315*x^4 + 42*x^5 + x^6))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln_lower_13 x = 1 / 70 * (10 + 1921 * x + 20149 * x\<^sup>2 + 50774 * x ^ 3 + 38524 * x ^ 4 + 8389 * x ^ 5 + 353 * x ^ 6) * (x - 1) / (x * (7 + 126 * x + 525 * x\<^sup>2 + 700 * x ^ 3 + 315 * x ^ 4 + 42 * x ^ 5 + x ^ 6))
[PROOF STEP]
unfolding ln_lower_13_def ln_upper_13_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> - ((353 + 8389 * inverse x + 20149 * inverse x ^ 4 + 50774 * inverse x ^ 3 + 38524 * (inverse x)\<^sup>2 + 1921 * inverse x ^ 5 + 10 * inverse x ^ 6) * (inverse x - 1) / (70 * (1 + 42 * inverse x + 525 * inverse x ^ 4 + 700 * inverse x ^ 3 + 315 * (inverse x)\<^sup>2 + 126 * inverse x ^ 5 + 7 * inverse x ^ 6))) = 1 / 70 * (10 + 1921 * x + 20149 * x\<^sup>2 + 50774 * x ^ 3 + 38524 * x ^ 4 + 8389 * x ^ 5 + 353 * x ^ 6) * (x - 1) / (x * (7 + 126 * x + 525 * x\<^sup>2 + 700 * x ^ 3 + 315 * x ^ 4 + 42 * x ^ 5 + x ^ 6))
[PROOF STEP]
by (simp add: zero_less_mult_iff add_pos_pos dual_order.strict_implies_not_eq divide_simps)
     algebra


[STATEMENT]
lemma scaleC_le_0_iff:
  "a *\<^sub>C b \<le> 0 \<longleftrightarrow> 0 < a \<and> b \<le> 0 \<or> a < 0 \<and> 0 \<le> b \<or> a = 0"
  if "a \<in> \<real>" (* Not present in Real_Vector_Spaces *)
  for b::"'a::ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>C b \<le> (0::'a)) = (0 < a \<and> b \<le> (0::'a) \<or> a < 0 \<and> (0::'a) \<le> b \<or> a = 0)
[PROOF STEP]
apply (insert zero_le_scaleC_iff [of "-a" b])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- a \<in> \<real> \<Longrightarrow> ((0::'a) \<le> - a *\<^sub>C b) = (0 < - a \<and> (0::'a) \<le> b \<or> - a < 0 \<and> b \<le> (0::'a) \<or> - a = 0)) \<Longrightarrow> (a *\<^sub>C b \<le> (0::'a)) = (0 < a \<and> b \<le> (0::'a) \<or> a < 0 \<and> (0::'a) \<le> b \<or> a = 0)
[PROOF STEP]
using less_complex_def that
[PROOF STATE]
proof (prove)
using this:
(?x < ?y) = (Re ?x < Re ?y \<and> Im ?x = Im ?y)
a \<in> \<real>

goal (1 subgoal):
 1. (- a \<in> \<real> \<Longrightarrow> ((0::'a) \<le> - a *\<^sub>C b) = (0 < - a \<and> (0::'a) \<le> b \<or> - a < 0 \<and> b \<le> (0::'a) \<or> - a = 0)) \<Longrightarrow> (a *\<^sub>C b \<le> (0::'a)) = (0 < a \<and> b \<le> (0::'a) \<or> a < 0 \<and> (0::'a) \<le> b \<or> a = 0)
[PROOF STEP]
by force


[STATEMENT]
lemma Im_abs[simp]: "Im (abs x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im \<bar>x\<bar> = 0
[PROOF STEP]
using abs_complex_real complex_is_Real_iff
[PROOF STATE]
proof (prove)
using this:
\<bar>?x\<bar> \<in> \<real>
(?z \<in> \<real>) = (Im ?z = 0)

goal (1 subgoal):
 1. Im \<bar>x\<bar> = 0
[PROOF STEP]
by blast


[STATEMENT]
lemma mat_mult_assoc_n:
  assumes wf1: "mat n n m1"
  and wf2: "mat n n m2"
  and wf3: "mat n n m3"
  shows "mat_mult n (mat_mult n m1 m2) m3 = mat_mult n m1 (mat_mult n m2 m3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mult n (mat_mult n m1 m2) m3 = mat_mult n m1 (mat_mult n m2 m3)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat n n m1
mat n n m2
mat n n m3

goal (1 subgoal):
 1. mat_mult n (mat_mult n m1 m2) m3 = mat_mult n m1 (mat_mult n m2 m3)
[PROOF STEP]
by (rule mat_mult_assoc)


[STATEMENT]
theorem (in group) action_by_conjugation_on_subgroups_set:
  "group_action G {H. subgroup H G} (\<lambda>g. \<lambda>H \<in> {H. subgroup H G}. g <# H #> (inv g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_action G {H. subgroup H G} (\<lambda>g. \<lambda>H\<in>{H. subgroup H G}. g <# H #> inv g)
[PROOF STEP]
unfolding group_action_def group_hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group G \<and> Group.group (BijGroup {H. subgroup H G}) \<and> group_hom_axioms G (BijGroup {H. subgroup H G}) (\<lambda>g. \<lambda>H\<in>{H. subgroup H G}. g <# H #> inv g)
[PROOF STEP]
using subgroup_conjugation_is_hom
[PROOF STATE]
proof (prove)
using this:
(\<lambda>g. \<lambda>H\<in>{H. subgroup H G}. g <# H #> inv g) \<in> hom G (BijGroup {H. subgroup H G})

goal (1 subgoal):
 1. Group.group G \<and> Group.group (BijGroup {H. subgroup H G}) \<and> group_hom_axioms G (BijGroup {H. subgroup H G}) (\<lambda>g. \<lambda>H\<in>{H. subgroup H G}. g <# H #> inv g)
[PROOF STEP]
by (simp add: group_BijGroup group_hom_axioms.intro is_group)


[STATEMENT]
lemma affinity_inverses:
  assumes m0: "m \<noteq> (0::'a::field)"
  shows "(\<lambda>x. m *s x + c) \<circ> (\<lambda>x. inverse(m) *s x + (-(inverse(m) *s c))) = id"
  "(\<lambda>x. inverse(m) *s x + (-(inverse(m) *s c))) \<circ> (\<lambda>x. m *s x + c) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. m *s x + c) \<circ> (\<lambda>x. inverse m *s x + - (inverse m *s c)) = id &&& (\<lambda>x. inverse m *s x + - (inverse m *s c)) \<circ> (\<lambda>x. m *s x + c) = id
[PROOF STEP]
using m0
[PROOF STATE]
proof (prove)
using this:
m \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>x. m *s x + c) \<circ> (\<lambda>x. inverse m *s x + - (inverse m *s c)) = id &&& (\<lambda>x. inverse m *s x + - (inverse m *s c)) \<circ> (\<lambda>x. m *s x + c) = id
[PROOF STEP]
by (auto simp add: fun_eq_iff vector_add_ldistrib diff_conv_add_uminus simp del: add_uminus_conv_diff)


[STATEMENT]
theorem (in group) action_by_conjugation_on_power_set:
  "group_action G {H. H \<subseteq> carrier G} (\<lambda>g. \<lambda>H \<in> {H. H \<subseteq> carrier G}. g <# H #> (inv g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_action G {H. H \<subseteq> carrier G} (\<lambda>g. \<lambda>H\<in>{H. H \<subseteq> carrier G}. g <# H #> inv g)
[PROOF STEP]
unfolding group_action_def group_hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group G \<and> Group.group (BijGroup {H. H \<subseteq> carrier G}) \<and> group_hom_axioms G (BijGroup {H. H \<subseteq> carrier G}) (\<lambda>g. \<lambda>H\<in>{H. H \<subseteq> carrier G}. g <# H #> inv g)
[PROOF STEP]
using subset_conjugation_is_hom
[PROOF STATE]
proof (prove)
using this:
(\<lambda>g. \<lambda>H\<in>{H. H \<subseteq> carrier G}. g <# H #> inv g) \<in> hom G (BijGroup {H. H \<subseteq> carrier G})

goal (1 subgoal):
 1. Group.group G \<and> Group.group (BijGroup {H. H \<subseteq> carrier G}) \<and> group_hom_axioms G (BijGroup {H. H \<subseteq> carrier G}) (\<lambda>g. \<lambda>H\<in>{H. H \<subseteq> carrier G}. g <# H #> inv g)
[PROOF STEP]
by (simp add: group_BijGroup group_hom_axioms.intro is_group)


[STATEMENT]
lemma n_inter_num_choose: "finite b1 \<Longrightarrow> finite b2 \<Longrightarrow> b1 |\<inter>|\<^sub>n b2 = (card (b1 \<inter> b2) choose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite b1; finite b2\<rbrakk> \<Longrightarrow> (b1 |\<inter>|\<^sub>n b2) = card (b1 \<inter> b2) choose n
[PROOF STEP]
using n_subsets n_intersect_num_subset_def
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> card {B. B \<subseteq> ?A \<and> card B = ?k} = card ?A choose ?k
(?b1.0 |\<inter>|\<^sub>?n ?b2.0) = card {x. x \<subseteq> ?b1.0 \<inter> ?b2.0 \<and> card x = ?n}

goal (1 subgoal):
 1. \<lbrakk>finite b1; finite b2\<rbrakk> \<Longrightarrow> (b1 |\<inter>|\<^sub>n b2) = card (b1 \<inter> b2) choose n
[PROOF STEP]
by (metis (full_types) finite_Int)


[STATEMENT]
lemma card_bijections_range_permutation_eq_1:
  assumes "finite A" "finite B"
  assumes "card A = card B"
  shows "card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B) = 1
[PROOF STEP]
using bij_betw_quotient_range_permutation_eq[OF assms]
[PROOF STATE]
proof (prove)
using this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B) = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma not_empty_means_seq:"\<forall>i \<in> {S . (\<exists> (m::nat) n .  {m..n }=S) } . i \<noteq> {}
                            \<longrightarrow> ( \<exists>m n . m \<le> n \<and> {m..n} = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>{S. \<exists>m n. {m..n} = S}. i \<noteq> {} \<longrightarrow> (\<exists>m n. m \<le> n \<and> {m..n} = i)
[PROOF STEP]
using atLeastatMost_empty_iff
[PROOF STATE]
proof (prove)
using this:
({?a..?b} = {}) = (\<not> ?a \<le> ?b)

goal (1 subgoal):
 1. \<forall>i\<in>{S. \<exists>m n. {m..n} = S}. i \<noteq> {} \<longrightarrow> (\<exists>m n. m \<le> n \<and> {m..n} = i)
[PROOF STEP]
by force


[STATEMENT]
lemma set_quicksort: "set (quicksort xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (quicksort xs) = set xs
[PROOF STEP]
by(rule mset_eq_setD[OF mset_quicksort])


[STATEMENT]
lemma list_rel_append2: "(l,as @ bs) \<in> \<langle>R\<rangle>list_rel
  \<longleftrightarrow> (\<exists>cs ds. l = cs@ds \<and> (cs,as)\<in>\<langle>R\<rangle>list_rel \<and> (ds,bs)\<in>\<langle>R\<rangle>list_rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((l, as @ bs) \<in> \<langle>R\<rangle>list_rel) = (\<exists>cs ds. l = cs @ ds \<and> (cs, as) \<in> \<langle>R\<rangle>list_rel \<and> (ds, bs) \<in> \<langle>R\<rangle>list_rel)
[PROOF STEP]
apply (simp add: list_rel_def list_all2_append2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>us vs. l = us @ vs \<and> length us = length as \<and> length vs = length bs \<and> list_all2 (\<lambda>x x'. (x, x') \<in> R) us as \<and> list_all2 (\<lambda>x x'. (x, x') \<in> R) vs bs) = (\<exists>cs ds. l = cs @ ds \<and> list_all2 (\<lambda>x x'. (x, x') \<in> R) cs as \<and> list_all2 (\<lambda>x x'. (x, x') \<in> R) ds bs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs ds. \<lbrakk>l = cs @ ds; list_all2 (\<lambda>x x'. (x, x') \<in> R) cs as; list_all2 (\<lambda>x x'. (x, x') \<in> R) ds bs\<rbrakk> \<Longrightarrow> \<exists>us vs. cs @ ds = us @ vs \<and> length us = length as \<and> length vs = length bs \<and> list_all2 (\<lambda>x x'. (x, x') \<in> R) us as \<and> list_all2 (\<lambda>x x'. (x, x') \<in> R) vs bs
[PROOF STEP]
apply (metis list_all2_lengthD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_list_two_pow_aux:
  "(\<Sum>x\<leftarrow>[0..< n]. (2::nat) ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n
[PROOF STEP]
proof(induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>x\<leftarrow>[0..<0]. 2 ^ (0 - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc 0
 2. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>x\<leftarrow>[0..<0]. 2 ^ (0 - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc 0
 2. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<0]. 2 ^ (0 - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<0]. 2 ^ (0 - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc 0

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
case c1: (Suc n)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
have "x \<le> n \<Longrightarrow> 2 ^ (Suc n - x) = 2 * 2^ (n - x)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> n \<Longrightarrow> (2::'a) ^ (Suc n - x) = (2::'a) * (2::'a) ^ (n - x)
[PROOF STEP]
by (simp add: Suc_diff_le)
[PROOF STATE]
proof (state)
this:
?x1 \<le> n \<Longrightarrow> (2::?'a2) ^ (Suc n - ?x1) = (2::?'a2) * (2::?'a2) ^ (n - ?x1)

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
?x1 \<le> n \<Longrightarrow> (2::?'a2) ^ (Suc n - ?x1) = (2::?'a2) * (2::?'a2) ^ (n - ?x1)

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
have "x \<in> set [0..<Suc n] \<Longrightarrow> x \<le> n" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set [0..<Suc n] \<Longrightarrow> x \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x1 \<in> set [0..<Suc n] \<Longrightarrow> ?x1 \<le> n

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x1 \<le> n \<Longrightarrow> (2::?'a2) ^ (Suc n - ?x1) = (2::?'a2) * (2::?'a2) ^ (n - ?x1)
?x1 \<in> set [0..<Suc n] \<Longrightarrow> ?x1 \<le> n
[PROOF STEP]
have "(\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) = (\<Sum>x\<leftarrow>[0..<Suc n]. 2* 2 ^ (n - x))"
[PROOF STATE]
proof (prove)
using this:
?x1 \<le> n \<Longrightarrow> (2::?'a2) ^ (Suc n - ?x1) = (2::?'a2) * (2::?'a2) ^ (n - ?x1)
?x1 \<in> set [0..<Suc n] \<Longrightarrow> ?x1 \<le> n

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<Suc n]. (2::'a) ^ (Suc n - x)) = (\<Sum>x\<leftarrow>[0..<Suc n]. (2::'a) * (2::'a) ^ (n - x))
[PROOF STEP]
by (metis (mono_tags, lifting) map_eq_conv)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a2) ^ (Suc n - x)) = (\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a2) * (2::?'a2) ^ (n - x))

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a2) ^ (Suc n - x)) = (\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a2) * (2::?'a2) ^ (n - x))

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
have "... = (\<Sum>x\<leftarrow>[0..< n]. 2* 2 ^ (n - x)) + 2* 2 ^ (0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<Suc n]. (2::'a) * (2::'a) ^ (n - x)) = (\<Sum>x\<leftarrow>[0..<n]. (2::'a) * (2::'a) ^ (n - x)) + (2::'a) * (2::'a) ^ 0
[PROOF STEP]
using sum_list_extract_last
[PROOF STATE]
proof (prove)
using this:
sum_list (map ?f [0..<Suc ?n]) = sum_list (map ?f [0..<?n]) + ?f ?n

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<Suc n]. (2::'a) * (2::'a) ^ (n - x)) = (\<Sum>x\<leftarrow>[0..<n]. (2::'a) * (2::'a) ^ (n - x)) + (2::'a) * (2::'a) ^ 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a3) * (2::?'a3) ^ (n - x)) = (\<Sum>x\<leftarrow>[0..<n]. (2::?'a3) * (2::?'a3) ^ (n - x)) + (2::?'a3) * (2::?'a3) ^ 0

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a3) * (2::?'a3) ^ (n - x)) = (\<Sum>x\<leftarrow>[0..<n]. (2::?'a3) * (2::?'a3) ^ (n - x)) + (2::?'a3) * (2::?'a3) ^ 0

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
have "(\<Sum>x\<leftarrow>[0..< n]. (2::nat)* (2::nat) ^ (n - x)) = 2*(\<Sum>x\<leftarrow>[0..< n]. 2 ^ (n - x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<n]. 2 * 2 ^ (n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x))
[PROOF STEP]
using sum_list_const_mult
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>?xs. ?c * ?f x) = ?c * sum_list (map ?f ?xs)

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<n]. 2 * 2 ^ (n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x))
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<n]. 2 * 2 ^ (n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x))

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a4) ^ (Suc n - x)) = (\<Sum>x\<leftarrow>[0..<n]. (2::?'a4) * (2::?'a4) ^ (n - x)) + (2::?'a4) * (2::?'a4) ^ 0
(\<Sum>x\<leftarrow>[0..<n]. 2 * 2 ^ (n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x))
[PROOF STEP]
have "(\<Sum>x\<leftarrow>[0..<Suc n]. (2::nat) ^ (Suc n - x))
      = 2*(\<Sum>x\<leftarrow>[0..< n]. 2 ^ (n - x)) + 2* 2 ^ (0)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>[0..<Suc n]. (2::?'a4) ^ (Suc n - x)) = (\<Sum>x\<leftarrow>[0..<n]. (2::?'a4) * (2::?'a4) ^ (n - x)) + (2::?'a4) * (2::?'a4) ^ 0
(\<Sum>x\<leftarrow>[0..<n]. 2 * 2 ^ (n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x))

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 * 2 ^ 0
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 * 2 ^ 0

goal (1 subgoal):
 1. \<And>n. (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n \<Longrightarrow> (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 * 2 ^ 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 * 2 ^ 0

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
using c1
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) = 2 * (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 * 2 ^ 0
(\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc n

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>[0..<Suc n]. 2 ^ (Suc n - x)) + 2 ^ (0 - 1) + 2 ^ 0 = 2 ^ Suc (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uminus_scalar_prod:
  assumes [simp]: "v : carrier_vec n" "w : carrier_vec n"
  shows "- ((v::'a::field vec) \<bullet> w) = (- v) \<bullet> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (v \<bullet> w) = - v \<bullet> w
[PROOF STEP]
unfolding scalar_prod_def uminus_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>i = 0..<dim_vec w. v $ i * w $ i) = (\<Sum>i = 0..<dim_vec w. vec (dim_vec v) (\<lambda>i. - v $ i) $ i * w $ i)
[PROOF STEP]
apply (subst sum_negf[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x = 0..<dim_vec w. - (v $ x * w $ x)) = (\<Sum>i = 0..<dim_vec w. vec (dim_vec v) (\<lambda>i. - v $ i) $ i * w $ i)
[PROOF STEP]
proof (rule sum.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<dim_vec w} \<Longrightarrow> - (v $ x * w $ x) = vec (dim_vec v) (\<lambda>i. - v $ i) $ x * w $ x
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<dim_vec w} \<Longrightarrow> - (v $ x * w $ x) = vec (dim_vec v) (\<lambda>i. - v $ i) $ x * w $ x
[PROOF STEP]
assume i: "i : {0 ..<dim_vec w}"
[PROOF STATE]
proof (state)
this:
i \<in> {0..<dim_vec w}

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<dim_vec w} \<Longrightarrow> - (v $ x * w $ x) = vec (dim_vec v) (\<lambda>i. - v $ i) $ x * w $ x
[PROOF STEP]
have [simp]: "dim_vec v = n" "dim_vec w = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = n &&& dim_vec w = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_vec v = n
dim_vec w = n

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<dim_vec w} \<Longrightarrow> - (v $ x * w $ x) = vec (dim_vec v) (\<lambda>i. - v $ i) $ x * w $ x
[PROOF STEP]
show "- (v $ i * w $ i) = vec (dim_vec v) (\<lambda>i. - v $ i) $ i * w $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (v $ i * w $ i) = vec (dim_vec v) (\<lambda>i. - v $ i) $ i * w $ i
[PROOF STEP]
unfolding minus_mult_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - v $ i * w $ i = vec (dim_vec v) (\<lambda>i. - v $ i) $ i * w $ i
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<in> {0..<dim_vec w}

goal (1 subgoal):
 1. - v $ i * w $ i = vec (dim_vec v) (\<lambda>i. - v $ i) $ i * w $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (v $ i * w $ i) = vec (dim_vec v) (\<lambda>i. - v $ i) $ i * w $ i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_basis_exists:
  fixes V :: "'n::real_vector set"
  shows "\<exists>B. B \<subseteq> V \<and> \<not> affine_dependent B \<and> affine hull V = affine hull B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
proof (cases "V = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. V = {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
 2. V \<noteq> {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
V = {}

goal (2 subgoals):
 1. V = {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
 2. V \<noteq> {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
V = {}

goal (1 subgoal):
 1. \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
using affine_independent_0
[PROOF STATE]
proof (prove)
using this:
V = {}
\<not> affine_dependent {}

goal (1 subgoal):
 1. \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B

goal (1 subgoal):
 1. V \<noteq> {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. V \<noteq> {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
V \<noteq> {}

goal (1 subgoal):
 1. V \<noteq> {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V \<noteq> {}
[PROOF STEP]
obtain x where "x \<in> V"
[PROOF STATE]
proof (prove)
using this:
V \<noteq> {}

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

goal (1 subgoal):
 1. V \<noteq> {} \<Longrightarrow> \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
using affine_dependent_def[of "{x}"] extend_to_affine_basis_nonempty[of "{x}" V]
[PROOF STATE]
proof (prove)
using this:
x \<in> V
affine_dependent {x} = (\<exists>xa\<in>{x}. xa \<in> affine hull ({x} - {xa}))
\<lbrakk>\<not> affine_dependent {x}; {x} \<subseteq> V; {x} \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>T. \<not> affine_dependent T \<and> {x} \<subseteq> T \<and> T \<subseteq> V \<and> affine hull T = affine hull V

goal (1 subgoal):
 1. \<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>B\<subseteq>V. \<not> affine_dependent B \<and> affine hull V = affine hull B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_on_UnI: "\<lbrakk> inj_on f A; inj_on f B; f ` (A - B) \<inter> f ` (B - A) = {} \<rbrakk> \<Longrightarrow> inj_on f (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A; inj_on f B; f ` (A - B) \<inter> f ` (B - A) = {}\<rbrakk> \<Longrightarrow> inj_on f (A \<union> B)
[PROOF STEP]
by (auto iff: inj_on_Un)


[STATEMENT]
lemma hnorm_triangle_ineq2: "\<And>a b::'a::real_normed_vector star. hnorm a - hnorm b \<le> hnorm (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. hnorm a - hnorm b \<le> hnorm (a - b)
[PROOF STEP]
by transfer (rule norm_triangle_ineq2)


[STATEMENT]
lemma "((\<lambda>x::real. ((3 powr x + 4 powr x) / 4) powr (1/x)) \<longlongrightarrow> 4) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ((3 powr x + 4 powr x) / 4) powr (1 / x)) \<longlongrightarrow> 4) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma "((\<lambda>x::real. x powr (3/2) * (sqrt (x + 1) + sqrt (x - 1) - 2 * sqrt x)) \<longlongrightarrow> -1/4) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x powr (3 / 2) * (sqrt (x + 1) + sqrt (x - 1) - 2 * sqrt x)) \<longlongrightarrow> - 1 / 4) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma finestpartSubset:
  assumes "X \<subseteq> Y"
  shows "finestpart X \<subseteq> finestpart Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finestpart X \<subseteq> finestpart Y
[PROOF STEP]
using assms finestpart_def
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> Y
finestpart ?X = (\<lambda>x. {x}) ` ?X

goal (1 subgoal):
 1. finestpart X \<subseteq> finestpart Y
[PROOF STEP]
by (metis image_mono)


[STATEMENT]
lemma ordered_nsets_2_eq:
  fixes A :: "'a::linorder set"
  shows "nsets A 2 = {{x,y} | x y. x \<in> A \<and> y \<in> A \<and> x<y}"
     (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A]\<^bsup>2\<^esup> = {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. [A]\<^bsup>2\<^esup> \<subseteq> {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y}
 2. {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y} \<subseteq> [A]\<^bsup>2\<^esup>
[PROOF STEP]
show "nsets A 2 \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A]\<^bsup>2\<^esup> \<subseteq> {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y}
[PROOF STEP]
unfolding numeral_nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A]\<^bsup>Suc (Suc 0)\<^esup> \<subseteq> {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y}
[PROOF STEP]
apply (clarsimp simp add: nsets_def card_Suc_eq Set.doubleton_eq_iff not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b ba. \<lbrakk>\<forall>x y. y \<in> A \<longrightarrow> x \<in> A \<longrightarrow> (b = x \<longrightarrow> ba \<noteq> y) \<and> (b = y \<longrightarrow> ba \<noteq> x) \<or> y \<le> x; b \<in> A; ba \<in> A\<rbrakk> \<Longrightarrow> b = ba
[PROOF STEP]
by (metis antisym)
[PROOF STATE]
proof (state)
this:
[A]\<^bsup>2\<^esup> \<subseteq> {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y}

goal (1 subgoal):
 1. {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y} \<subseteq> [A]\<^bsup>2\<^esup>
[PROOF STEP]
show "?rhs \<subseteq> nsets A 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y} \<subseteq> [A]\<^bsup>2\<^esup>
[PROOF STEP]
unfolding numeral_nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y} \<subseteq> [A]\<^bsup>Suc (Suc 0)\<^esup>
[PROOF STEP]
by (auto simp: nsets_def card_Suc_eq)
[PROOF STATE]
proof (state)
this:
{{x, y} |x y. x \<in> A \<and> y \<in> A \<and> x < y} \<subseteq> [A]\<^bsup>2\<^esup>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interior_convex_hull_3_minimal:
  fixes a :: "'a::euclidean_space"
  assumes "\<not> collinear{a,b,c}" and 2: "DIM('a) = 2"
  shows "interior(convex hull {a,b,c}) =
         {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (convex hull {a, b, c}) = {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. interior (convex hull {a, b, c}) \<subseteq> {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}
 2. {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v} \<subseteq> interior (convex hull {a, b, c})
[PROOF STEP]
have abc: "a \<noteq> b" "a \<noteq> c" "b \<noteq> c" "\<not> affine_dependent {a, b, c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<noteq> b &&& a \<noteq> c) &&& b \<noteq> c &&& \<not> affine_dependent {a, b, c}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> collinear {a, b, c}
DIM('a) = 2

goal (1 subgoal):
 1. (a \<noteq> b &&& a \<noteq> c) &&& b \<noteq> c &&& \<not> affine_dependent {a, b, c}
[PROOF STEP]
by (auto simp: collinear_3_eq_affine_dependent)
[PROOF STATE]
proof (state)
this:
a \<noteq> b
a \<noteq> c
b \<noteq> c
\<not> affine_dependent {a, b, c}

goal (2 subgoals):
 1. interior (convex hull {a, b, c}) \<subseteq> {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}
 2. {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v} \<subseteq> interior (convex hull {a, b, c})
[PROOF STEP]
with 2
[PROOF STATE]
proof (chain)
picking this:
DIM('a) = 2
a \<noteq> b
a \<noteq> c
b \<noteq> c
\<not> affine_dependent {a, b, c}
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
using this:
DIM('a) = 2
a \<noteq> b
a \<noteq> c
b \<noteq> c
\<not> affine_dependent {a, b, c}

goal (1 subgoal):
 1. interior (convex hull {a, b, c}) \<subseteq> {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}
[PROOF STEP]
by (fastforce simp add: interior_convex_hull_explicit_minimal)
[PROOF STATE]
proof (state)
this:
interior (convex hull {a, b, c}) \<subseteq> {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}

goal (1 subgoal):
 1. {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v} \<subseteq> interior (convex hull {a, b, c})
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v} \<subseteq> interior (convex hull {a, b, c})
[PROOF STEP]
using abc 2
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
a \<noteq> c
b \<noteq> c
\<not> affine_dependent {a, b, c}
DIM('a) = 2

goal (1 subgoal):
 1. {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v} \<subseteq> interior (convex hull {a, b, c})
[PROOF STEP]
apply (clarsimp simp add: interior_convex_hull_explicit_minimal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y z. \<lbrakk>a \<noteq> b; a \<noteq> c; b \<noteq> c; \<not> affine_dependent {a, b, c}; DIM('a) = 2; 0 < xa; 0 < y; 0 < z; xa + y + z = 1\<rbrakk> \<Longrightarrow> \<exists>u. 0 < u a \<and> 0 < u b \<and> 0 < u c \<and> u a + (u b + u c) = 1 \<and> u a *\<^sub>R a + (u b *\<^sub>R b + u c *\<^sub>R c) = xa *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c
[PROOF STEP]
subgoal for x y z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> b; a \<noteq> c; b \<noteq> c; \<not> affine_dependent {a, b, c}; DIM('a) = 2; 0 < x; 0 < y; 0 < z; x + y + z = 1\<rbrakk> \<Longrightarrow> \<exists>u. 0 < u a \<and> 0 < u b \<and> 0 < u c \<and> u a + (u b + u c) = 1 \<and> u a *\<^sub>R a + (u b *\<^sub>R b + u c *\<^sub>R c) = x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c
[PROOF STEP]
by (rule_tac x="\<lambda>r. (if r=a then x else if r=b then y else if r=c then z else 0)" in exI) auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
{v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v} \<subseteq> interior (convex hull {a, b, c})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_unit_diagonal:
  fixes U::"'a::{comm_ring_1, algebraic_semidom}^'n::{finite, wellorder}^'n::{finite, wellorder}"
  assumes U: "upper_triangular U"
  and det_U: "is_unit (det U)"
  shows "\<forall>i. is_unit (U $ i $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. is_unit (U $ i $ i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i. is_unit (U $ i $ i)
[PROOF STEP]
have "is_unit (prod (\<lambda>i. U $ i $ i) UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>UNIV. U $ i $ i)
[PROOF STEP]
using det_U  det_upperdiagonal[of U] U
[PROOF STATE]
proof (prove)
using this:
is_unit (det U)
(\<And>i j. j < i \<Longrightarrow> U $ i $ j = (0::'a)) \<Longrightarrow> det U = (\<Prod>i\<in>UNIV. U $ i $ i)
upper_triangular U

goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>UNIV. U $ i $ i)
[PROOF STEP]
unfolding upper_triangular_def
[PROOF STATE]
proof (prove)
using this:
is_unit (det U)
(\<And>i j. j < i \<Longrightarrow> U $ i $ j = (0::'a)) \<Longrightarrow> det U = (\<Prod>i\<in>UNIV. U $ i $ i)
\<forall>i j. j < i \<longrightarrow> U $ i $ j = (0::'a)

goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>UNIV. U $ i $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_unit (\<Prod>i\<in>UNIV. U $ i $ i)

goal (1 subgoal):
 1. \<forall>i. is_unit (U $ i $ i)
[PROOF STEP]
hence "\<forall>i\<in>UNIV. is_unit (U $ i $ i)"
[PROOF STATE]
proof (prove)
using this:
is_unit (\<Prod>i\<in>UNIV. U $ i $ i)

goal (1 subgoal):
 1. \<forall>i\<in>UNIV. is_unit (U $ i $ i)
[PROOF STEP]
using unit_prod[of UNIV U]
[PROOF STATE]
proof (prove)
using this:
is_unit (\<Prod>i\<in>UNIV. U $ i $ i)
finite UNIV \<Longrightarrow> is_unit (\<Prod>i\<in>UNIV. U $ i $ i) = (\<forall>i\<in>UNIV. is_unit (U $ i $ i))

goal (1 subgoal):
 1. \<forall>i\<in>UNIV. is_unit (U $ i $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>UNIV. is_unit (U $ i $ i)

goal (1 subgoal):
 1. \<forall>i. is_unit (U $ i $ i)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>UNIV. is_unit (U $ i $ i)

goal (1 subgoal):
 1. \<forall>i. is_unit (U $ i $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i. is_unit (U $ i $ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lead_coeff_div:
  fixes p q::"('a::{idom_divide, inverse}) poly"
  assumes "q dvd p"
  shows "lead_coeff (p div q) = lead_coeff p / lead_coeff q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff (p div q) = lead_coeff p / lead_coeff q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
q dvd p

goal (1 subgoal):
 1. lead_coeff (p div q) = lead_coeff p / lead_coeff q
[PROOF STEP]
by (smt (z3) div_by_0 dvd_div_mult_self lead_coeff_mult leading_coeff_0_iff
      nonzero_mult_div_cancel_right)


[STATEMENT]
lemma coplanar_4 :
  assumes "rk {A, B, C} = 3" and "rk {B, C, \<alpha>} = 2"
  shows "rk {A, B, C, \<alpha>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3
[PROOF STEP]
have f1:"rk {A, B, C, \<alpha>} \<ge> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> rk {A, B, C, \<alpha>}
[PROOF STEP]
using matroid_ax_2
[PROOF STATE]
proof (prove)
using this:
?X \<subseteq> ?Y \<longrightarrow> rk ?X \<le> rk ?Y

goal (1 subgoal):
 1. 3 \<le> rk {A, B, C, \<alpha>}
[PROOF STEP]
by (metis assms(1) empty_subsetI insert_mono)
[PROOF STATE]
proof (state)
this:
3 \<le> rk {A, B, C, \<alpha>}

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3
[PROOF STEP]
have "rk {A, B, C, \<alpha>} + rk {B, C} \<le> rk {A, B, C} + rk {B, C, \<alpha>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} + rk {B, C} \<le> rk {A, B, C} + rk {B, C, \<alpha>}
[PROOF STEP]
using matroid_ax_3_alt
[PROOF STATE]
proof (prove)
using this:
?I \<subseteq> ?X \<inter> ?Y \<Longrightarrow> rk (?X \<union> ?Y) + rk ?I \<le> rk ?X + rk ?Y

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} + rk {B, C} \<le> rk {A, B, C} + rk {B, C, \<alpha>}
[PROOF STEP]
by (metis Un_insert_right add_One_commute add_mono assms(1) assms(2) matroid_ax_2_alt
        nat_1_add_1 numeral_plus_one rk_singleton semiring_norm(3) sup_bot.right_neutral)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>} + rk {B, C} \<le> rk {A, B, C} + rk {B, C, \<alpha>}

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

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} \<le> 3
[PROOF STEP]
by (metis Un_insert_right add_One_commute assms(2) matroid_ax_2_alt numeral_plus_one
        semiring_norm(3) sup_bot.right_neutral)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>} \<le> 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3
[PROOF STEP]
from f1 and f2
[PROOF STATE]
proof (chain)
picking this:
3 \<le> rk {A, B, C, \<alpha>}
rk {A, B, C, \<alpha>} \<le> 3
[PROOF STEP]
show "rk {A, B, C, \<alpha>} = 3"
[PROOF STATE]
proof (prove)
using this:
3 \<le> rk {A, B, C, \<alpha>}
rk {A, B, C, \<alpha>} \<le> 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>} = 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem join_idem: "x \<squnion> x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> x = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<squnion> x = x
[PROOF STEP]
have "dual x \<sqinter> dual x = dual x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual x \<sqinter> dual x = dual x
[PROOF STEP]
by (rule meet_idem)
[PROOF STATE]
proof (state)
this:
dual x \<sqinter> dual x = dual x

goal (1 subgoal):
 1. x \<squnion> x = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dual x \<sqinter> dual x = dual x
[PROOF STEP]
have "dual (x \<squnion> x) = dual x"
[PROOF STATE]
proof (prove)
using this:
dual x \<sqinter> dual x = dual x

goal (1 subgoal):
 1. dual (x \<squnion> x) = dual x
[PROOF STEP]
by (simp only: dual_join)
[PROOF STATE]
proof (state)
this:
dual (x \<squnion> x) = dual x

goal (1 subgoal):
 1. x \<squnion> x = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dual (x \<squnion> x) = dual x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dual (x \<squnion> x) = dual x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closer_point_lemma:
  assumes "inner (y - x) (z - x) > 0"
  shows "\<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y
[PROOF STEP]
obtain u where "u > 0"
    and u: "\<And>v. \<lbrakk>0<v; v \<le> u\<rbrakk> \<Longrightarrow> norm (v *\<^sub>R (z - x) - (y - x)) < norm (y - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 < u; \<And>v. \<lbrakk>0 < v; v \<le> u\<rbrakk> \<Longrightarrow> norm (v *\<^sub>R (z - x) - (y - x)) < norm (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using closer_points_lemma[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>u>0. \<forall>v>0. v \<le> u \<longrightarrow> norm (v *\<^sub>R (z - x) - (y - x)) < norm (y - x)

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 < u; \<And>v. \<lbrakk>0 < v; v \<le> u\<rbrakk> \<Longrightarrow> norm (v *\<^sub>R (z - x) - (y - x)) < norm (y - x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < u
\<lbrakk>0 < ?v; ?v \<le> u\<rbrakk> \<Longrightarrow> norm (?v *\<^sub>R (z - x) - (y - x)) < norm (y - x)

goal (1 subgoal):
 1. \<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y
[PROOF STEP]
using u[of "min u 1"] and \<open>u > 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < min u 1; min u 1 \<le> u\<rbrakk> \<Longrightarrow> norm (min u 1 *\<^sub>R (z - x) - (y - x)) < norm (y - x)
0 < u

goal (1 subgoal):
 1. \<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y
[PROOF STEP]
by (metis diff_diff_add dist_commute dist_norm less_eq_real_def not_less u zero_less_one)
[PROOF STATE]
proof (state)
this:
\<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_bound:
  fixes f g h :: "real \<Rightarrow> real"
  assumes "mono h" "eventually (\<lambda>x. f x \<le> g x) at_top"
  shows   "eventually (\<lambda>x. h (f x) \<le> h (g x)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. h (f x) \<le> h (g x)
[PROOF STEP]
by (intro eventually_mono[OF assms(2)] monoD[OF assms(1)])


[STATEMENT]
lemma open_segment_translation_eq [simp]:
    "d + x \<in> open_segment (d + a) (d + b) \<longleftrightarrow> x \<in> open_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d + x \<in> open_segment (d + a) (d + b)) = (x \<in> open_segment a b)
[PROOF STEP]
by (simp add: open_segment_def)


[STATEMENT]
lemma sinh_double: "sinh (2 * x) = 2 * sinh x * cosh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sinh ((2::'a) * x) = (2::'a) * sinh x * cosh x
[PROOF STEP]
using sinh_add[of x]
[PROOF STATE]
proof (prove)
using this:
sinh (x + x) = sinh x * cosh x + cosh x * sinh x

goal (1 subgoal):
 1. sinh ((2::'a) * x) = (2::'a) * sinh x * cosh x
[PROOF STEP]
by simp


[STATEMENT]
lemma leq_ccsubspace_code[code]:
  \<comment> \<open>Code equation for deciding inclusion of one space in another.
     Uses the constant \<^term>\<open>is_subspace_of_vec_list\<close> which implements the actual
     computation by checking for each generator of A whether it is in the
     span of B (by orthogonal projection onto an orthonormal basis of B
     which is computed using Gram-Schmidt).\<close>
  "SPAN A \<le> (SPAN B :: 'a::onb_enum ccsubspace)
      \<longleftrightarrow> (let d = length (canonical_basis :: 'a list) in
          is_subspace_of_vec_list d
          (filter (\<lambda>v. dim_vec v = d) A)
          (filter (\<lambda>v. dim_vec v = d) B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SPAN A \<le> SPAN B) = (let d = length canonical_basis in is_subspace_of_vec_list d (filter (\<lambda>v. dim_vec v = d) A) (filter (\<lambda>v. dim_vec v = d) B))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (SPAN A \<le> SPAN B) = (let d = length canonical_basis in is_subspace_of_vec_list d (filter (\<lambda>v. dim_vec v = d) A) (filter (\<lambda>v. dim_vec v = d) B))
[PROOF STEP]
define d A' B' where "d = length (canonical_basis :: 'a list)"
    and "A' = filter (\<lambda>v. dim_vec v = d) A"
    and "B' = filter (\<lambda>v. dim_vec v = d) B"
[PROOF STATE]
proof (state)
this:
d = length canonical_basis
A' = filter (\<lambda>v. dim_vec v = d) A
B' = filter (\<lambda>v. dim_vec v = d) B

goal (1 subgoal):
 1. (SPAN A \<le> SPAN B) = (let d = length canonical_basis in is_subspace_of_vec_list d (filter (\<lambda>v. dim_vec v = d) A) (filter (\<lambda>v. dim_vec v = d) B))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SPAN A \<le> SPAN B) = (let d = length canonical_basis in is_subspace_of_vec_list d (filter (\<lambda>v. dim_vec v = d) A) (filter (\<lambda>v. dim_vec v = d) B))
[PROOF STEP]
unfolding SPAN_def d_def[symmetric] filter_set Let_def
      A'_def[symmetric] B'_def[symmetric] image_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ccspan (set (map basis_enum_of_vec A')) \<le> ccspan (set (map basis_enum_of_vec B'))) = is_subspace_of_vec_list d A' B'
[PROOF STEP]
apply (subst ccspan_leq_using_vec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum (map basis_enum_of_vec A')) (map vec_of_basis_enum (map basis_enum_of_vec B')) = is_subspace_of_vec_list d A' B'
[PROOF STEP]
unfolding d_def[symmetric] map_map o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_subspace_of_vec_list d (map (\<lambda>x. vec_of_basis_enum (basis_enum_of_vec x)) A') (map (\<lambda>x. vec_of_basis_enum (basis_enum_of_vec x)) B') = is_subspace_of_vec_list d A' B'
[PROOF STEP]
apply (subst map_cong[where xs=A', OF refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set A' \<Longrightarrow> vec_of_basis_enum (basis_enum_of_vec x) = ?g x
 2. is_subspace_of_vec_list d (map ?g A') (map (\<lambda>x. vec_of_basis_enum (basis_enum_of_vec x)) B') = is_subspace_of_vec_list d A' B'
[PROOF STEP]
apply (rule basis_enum_of_vec_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set A' \<Longrightarrow> dim_vec x = length canonical_basis
 2. is_subspace_of_vec_list d (map (\<lambda>x. x) A') (map (\<lambda>x. vec_of_basis_enum (basis_enum_of_vec x)) B') = is_subspace_of_vec_list d A' B'
[PROOF STEP]
apply (simp add: A'_def d_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_subspace_of_vec_list d (map (\<lambda>x. x) A') (map (\<lambda>x. vec_of_basis_enum (basis_enum_of_vec x)) B') = is_subspace_of_vec_list d A' B'
[PROOF STEP]
apply (subst map_cong[where xs=B', OF refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set B' \<Longrightarrow> vec_of_basis_enum (basis_enum_of_vec x) = ?g3 x
 2. is_subspace_of_vec_list d (map (\<lambda>x. x) A') (map ?g3 B') = is_subspace_of_vec_list d A' B'
[PROOF STEP]
apply (rule basis_enum_of_vec_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set B' \<Longrightarrow> dim_vec x = length canonical_basis
 2. is_subspace_of_vec_list d (map (\<lambda>x. x) A') (map (\<lambda>x. x) B') = is_subspace_of_vec_list d A' B'
[PROOF STEP]
by (simp_all add: B'_def d_def)
[PROOF STATE]
proof (state)
this:
(SPAN A \<le> SPAN B) = (let d = length canonical_basis in is_subspace_of_vec_list d (filter (\<lambda>v. dim_vec v = d) A) (filter (\<lambda>v. dim_vec v = d) B))

goal:
No subgoals!
[PROOF STEP]
qed