[STATEMENT]
theorem smallest_dist_is_ortho:
  fixes M::\<open>'a::complex_inner set\<close> and h k::'a
  assumes b1: \<open>closed_csubspace M\<close>
  shows  \<open>(is_arg_min (\<lambda> x. dist x h) (\<lambda> x. x \<in> M) k) \<longleftrightarrow>
          h - k \<in> orthogonal_complement M \<and> k \<in> M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
include notation_norm
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
have  \<open>csubspace M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csubspace M
[PROOF STEP]
using \<open>closed_csubspace M\<close>
[PROOF STATE]
proof (prove)
using this:
closed_csubspace M

goal (1 subgoal):
 1. csubspace M
[PROOF STEP]
unfolding closed_csubspace_def
[PROOF STATE]
proof (prove)
using this:
csubspace M \<and> closed M

goal (1 subgoal):
 1. csubspace M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
csubspace M

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
have r1: \<open>2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel> f \<parallel>^2\<close>
    if "f \<in> M" and \<open>k \<in> M\<close> and \<open>is_arg_min (\<lambda>x. dist x h) (\<lambda> x. x \<in> M) k\<close>
    for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
have \<open>k + f \<in>  M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k + f \<in> M
[PROOF STEP]
using \<open>csubspace M\<close>
[PROOF STATE]
proof (prove)
using this:
csubspace M

goal (1 subgoal):
 1. k + f \<in> M
[PROOF STEP]
by (simp add:complex_vector.subspace_add that)
[PROOF STATE]
proof (state)
this:
k + f \<in> M

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
have "\<forall>f A a b. \<not> is_arg_min f (\<lambda> x. x \<in> A) (a::'a) \<or> (f a::real) \<le> f b \<or> b \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f A a b. \<not> is_arg_min f (\<lambda>x. x \<in> A) a \<or> f a \<le> f b \<or> b \<notin> A
[PROOF STEP]
by (metis (no_types) is_arg_min_linorder)
[PROOF STATE]
proof (state)
this:
\<forall>f A a b. \<not> is_arg_min f (\<lambda>x. x \<in> A) a \<or> f a \<le> f b \<or> b \<notin> A

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
hence "dist k h \<le> dist (f + k) h"
[PROOF STATE]
proof (prove)
using this:
\<forall>f A a b. \<not> is_arg_min f (\<lambda>x. x \<in> A) a \<or> f a \<le> f b \<or> b \<notin> A

goal (1 subgoal):
 1. dist k h \<le> dist (f + k) h
[PROOF STEP]
by (metis \<open>is_arg_min (\<lambda>x. dist x h) (\<lambda> x. x \<in> M) k\<close> \<open>k + f \<in> M\<close> add.commute)
[PROOF STATE]
proof (state)
this:
dist k h \<le> dist (f + k) h

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
hence \<open>dist h k \<le> dist  h (k + f)\<close>
[PROOF STATE]
proof (prove)
using this:
dist k h \<le> dist (f + k) h

goal (1 subgoal):
 1. dist h k \<le> dist h (k + f)
[PROOF STEP]
by (simp add: add.commute dist_commute)
[PROOF STATE]
proof (state)
this:
dist h k \<le> dist h (k + f)

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
hence \<open>\<parallel> h - k \<parallel> \<le> \<parallel> h - (k + f) \<parallel>\<close>
[PROOF STATE]
proof (prove)
using this:
dist h k \<le> dist h (k + f)

goal (1 subgoal):
 1. \<parallel>h - k\<parallel> \<le> \<parallel>h - (k + f)\<parallel>
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
\<parallel>h - k\<parallel> \<le> \<parallel>h - (k + f)\<parallel>

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
hence \<open>\<parallel> h - k \<parallel>^2 \<le> \<parallel> h - (k + f) \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
using this:
\<parallel>h - k\<parallel> \<le> \<parallel>h - (k + f)\<parallel>

goal (1 subgoal):
 1. \<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - (k + f)\<parallel>\<^sup>2
[PROOF STEP]
by (simp add: power_mono)
[PROOF STATE]
proof (state)
this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - (k + f)\<parallel>\<^sup>2

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - (k + f)\<parallel>\<^sup>2

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
have \<open>... \<le> \<parallel> (h - k) - f \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>h - (k + f)\<parallel>\<^sup>2 \<le> \<parallel>h - k - f\<parallel>\<^sup>2
[PROOF STEP]
by (simp add: diff_diff_add)
[PROOF STATE]
proof (state)
this:
\<parallel>h - (k + f)\<parallel>\<^sup>2 \<le> \<parallel>h - k - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>h - (k + f)\<parallel>\<^sup>2 \<le> \<parallel>h - k - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
have \<open>... \<le> \<parallel> (h - k) \<parallel>^2 + \<parallel> f \<parallel>^2 -  2 * Re ((h - k) \<bullet>\<^sub>C f)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>h - k - f\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>f\<parallel>\<^sup>2 - 2 * Re ((h - k) \<bullet>\<^sub>C f)
[PROOF STEP]
by (simp add: polar_identity_minus)
[PROOF STATE]
proof (state)
this:
\<parallel>h - k - f\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>f\<parallel>\<^sup>2 - 2 * Re ((h - k) \<bullet>\<^sub>C f)

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>f\<parallel>\<^sup>2 - 2 * Re ((h - k) \<bullet>\<^sub>C f)
[PROOF STEP]
have \<open>\<parallel> (h - k) \<parallel>^2 \<le> \<parallel> (h - k) \<parallel>^2 + \<parallel> f \<parallel>^2 -  2 * Re ((h - k) \<bullet>\<^sub>C f)\<close>
[PROOF STATE]
proof (prove)
using this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>f\<parallel>\<^sup>2 - 2 * Re ((h - k) \<bullet>\<^sub>C f)

goal (1 subgoal):
 1. \<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>f\<parallel>\<^sup>2 - 2 * Re ((h - k) \<bullet>\<^sub>C f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>f\<parallel>\<^sup>2 - 2 * Re ((h - k) \<bullet>\<^sub>C f)

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>f\<parallel>\<^sup>2 - 2 * Re ((h - k) \<bullet>\<^sub>C f)

goal (1 subgoal):
 1. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?f \<in> M; k \<in> M; is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k\<rbrakk> \<Longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> \<parallel>?f\<parallel>\<^sup>2

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
have q4: \<open>\<forall> c > 0.  2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c\<close>
    if  \<open>\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2\<close>
    for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
proof (cases \<open>\<parallel> f \<parallel>^2 > 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
 2. \<not> 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < \<parallel>f\<parallel>\<^sup>2

goal (2 subgoals):
 1. 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
 2. \<not> 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
hence \<open>\<forall> c > 0.  2 * Re (((h - k) \<bullet>\<^sub>C f)) \<le> (c/\<parallel> f \<parallel>^2)*\<parallel> f \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c / \<parallel>f\<parallel>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
using that linordered_field_class.divide_pos_pos
[PROOF STATE]
proof (prove)
using this:
0 < \<parallel>f\<parallel>\<^sup>2
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2
\<lbrakk>(0::?'a) < ?x; (0::?'a) < ?y\<rbrakk> \<Longrightarrow> (0::?'a) < ?x / ?y

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c / \<parallel>f\<parallel>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c / \<parallel>f\<parallel>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2

goal (2 subgoals):
 1. 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
 2. \<not> 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c / \<parallel>f\<parallel>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c / \<parallel>f\<parallel>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2
0 < \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c

goal (1 subgoal):
 1. \<not> 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<not> 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
hence \<open>\<parallel> f \<parallel>^2 = 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>f\<parallel>\<^sup>2 = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<^sup>2 = 0

goal (1 subgoal):
 1. \<not> 0 < \<parallel>f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<parallel>f\<parallel>\<^sup>2 = 0

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> c * \<parallel>?f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> c

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
have q3: \<open>\<forall> c::real. c > 0 \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) \<le> 0\<close>
    if a3: \<open>\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2)\<close>
      and a2: "f \<in>  M"
      and a1: "is_arg_min (\<lambda> x. dist x h) (\<lambda> x. x \<in> M) k"
    for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0
[PROOF STEP]
have \<open>\<forall> c > 0.  2 * Re (((h - k) \<bullet>\<^sub>C f)) \<le> c*\<parallel> f \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
by (simp add: that )
[PROOF STATE]
proof (state)
this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0
[PROOF STEP]
using q4
[PROOF STATE]
proof (prove)
using this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> c * \<parallel>?f\<parallel>\<^sup>2 \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> c

goal (1 subgoal):
 1. \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0
[PROOF STEP]
by smt
[PROOF STATE]
proof (state)
this:
\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2); ?f \<in> M; is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k\<rbrakk> \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> 0

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
have w2: "h - k \<in> orthogonal_complement M \<and> k \<in> M"
    if a1: "is_arg_min (\<lambda> x. dist x h) (\<lambda> x. x \<in> M) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have  \<open>k \<in> M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> M
[PROOF STEP]
using is_arg_min_def that
[PROOF STATE]
proof (prove)
using this:
is_arg_min ?f ?P ?x = (?P ?x \<and> (\<nexists>y. ?P y \<and> ?f y < ?f ?x))
is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k

goal (1 subgoal):
 1. k \<in> M
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
k \<in> M

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence \<open>\<forall> f. f \<in>  M \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) \<le> \<parallel> f \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
using this:
k \<in> M

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
using r1
[PROOF STATE]
proof (prove)
using this:
k \<in> M
\<lbrakk>?f \<in> M; k \<in> M; is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k\<rbrakk> \<Longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> \<parallel>?f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
by (simp add: that)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real.  2 * Re ((h - k) \<bullet>\<^sub>C (c *\<^sub>R f)) \<le> \<parallel> c *\<^sub>R f \<parallel>^2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c. 2 * Re ((h - k) \<bullet>\<^sub>C c *\<^sub>R f) \<le> \<parallel>c *\<^sub>R f\<parallel>\<^sup>2)
[PROOF STEP]
using  assms scaleR_scaleC complex_vector.subspace_def \<open>csubspace M\<close>
[PROOF STATE]
proof (prove)
using this:
closed_csubspace M
(*\<^sub>R) ?r = (*\<^sub>C) (complex_of_real ?r)
csubspace ?S = ((0::?'a) \<in> ?S \<and> (\<forall>x\<in>?S. \<forall>y\<in>?S. x + y \<in> ?S) \<and> (\<forall>c. \<forall>x\<in>?S. c *\<^sub>C x \<in> ?S))
csubspace M

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c. 2 * Re ((h - k) \<bullet>\<^sub>C c *\<^sub>R f) \<le> \<parallel>c *\<^sub>R f\<parallel>\<^sup>2)
[PROOF STEP]
by (metis \<open>\<forall>f. f \<in> M \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> \<parallel>f\<parallel>\<^sup>2\<close>)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. 2 * Re ((h - k) \<bullet>\<^sub>C c *\<^sub>R f) \<le> \<parallel>c *\<^sub>R f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c * (2 * Re (((h - k) \<bullet>\<^sub>C f))) \<le> \<parallel> c *\<^sub>R f \<parallel>^2)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. 2 * Re ((h - k) \<bullet>\<^sub>C c *\<^sub>R f) \<le> \<parallel>c *\<^sub>R f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> \<parallel>c *\<^sub>R f\<parallel>\<^sup>2)
[PROOF STEP]
by (metis Re_complex_of_real cinner_scaleC_right complex_add_cnj complex_cnj_complex_of_real
          complex_cnj_mult of_real_mult scaleR_scaleC semiring_normalization_rules(34))
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> \<parallel>c *\<^sub>R f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c * (2 * Re (((h - k) \<bullet>\<^sub>C f))) \<le> \<bar>c\<bar>^2*\<parallel> f \<parallel>^2)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> \<parallel>c *\<^sub>R f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> \<bar>c\<bar>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> \<bar>c\<bar>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c * (2 * Re (((h - k) \<bullet>\<^sub>C f))) \<le> c^2*\<parallel> f \<parallel>^2)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> \<bar>c\<bar>\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> c * (2 * Re (((h - k) \<bullet>\<^sub>C f))) \<le> c^2*\<parallel> f \<parallel>^2)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> c*(2 * Re (((h - k) \<bullet>\<^sub>C f))) \<le> c*(c*\<parallel> f \<parallel>^2))\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c\<^sup>2 * \<parallel>f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c * (c * \<parallel>f\<parallel>\<^sup>2))
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c * (c * \<parallel>f\<parallel>\<^sup>2))

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  q4: \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) \<le> c*\<parallel> f \<parallel>^2)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. c * (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> c * (c * \<parallel>f\<parallel>\<^sup>2))

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) \<le> 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0)
[PROOF STEP]
using q3
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> c * \<parallel>f\<parallel>\<^sup>2); ?f \<in> M; is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k\<rbrakk> \<Longrightarrow> \<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C ?f) \<le> 0

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0)
[PROOF STEP]
by (simp add: q4 that)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> (2 * Re ((h - k) \<bullet>\<^sub>C (-1 *\<^sub>R f))) \<le> 0)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C - 1 *\<^sub>R f) \<le> 0)
[PROOF STEP]
using assms scaleR_scaleC complex_vector.subspace_def
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0)
closed_csubspace M
(*\<^sub>R) ?r = (*\<^sub>C) (complex_of_real ?r)
csubspace ?S = ((0::?'a) \<in> ?S \<and> (\<forall>x\<in>?S. \<forall>y\<in>?S. x + y \<in> ?S) \<and> (\<forall>c. \<forall>x\<in>?S. c *\<^sub>C x \<in> ?S))

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C - 1 *\<^sub>R f) \<le> 0)
[PROOF STEP]
by (metis \<open>csubspace M\<close>)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C - 1 *\<^sub>R f) \<le> 0)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> -(2 * Re (((h - k) \<bullet>\<^sub>C f))) \<le> 0)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C - 1 *\<^sub>R f) \<le> 0)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. - (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. - (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> 0)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) \<ge> 0)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. - (2 * Re ((h - k) \<bullet>\<^sub>C f)) \<le> 0)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 0 \<le> 2 * Re ((h - k) \<bullet>\<^sub>C f))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 0 \<le> 2 * Re ((h - k) \<bullet>\<^sub>C f))

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) = 0)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 0 \<le> 2 * Re ((h - k) \<bullet>\<^sub>C f))

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0)
[PROOF STEP]
using  \<open>\<forall> f. f \<in>  M \<longrightarrow>
                (\<forall> c::real. c > 0 \<longrightarrow> (2 * Re (((h - k) \<bullet>\<^sub>C f))) \<le> 0)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 0 \<le> 2 * Re ((h - k) \<bullet>\<^sub>C f))
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) \<le> 0)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0)

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have \<open>\<forall> f. f \<in>  M \<longrightarrow>
                 ((1::real) > 0 \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) = 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> 0 < 1 \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0
[PROOF STEP]
using \<open>\<forall>f. f \<in>  M \<longrightarrow> (\<forall>c>0. 2 * Re (((h - k) \<bullet>\<^sub>C f) ) = 0)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> (\<forall>c>0. 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> 0 < 1 \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> 0 < 1 \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence \<open>\<forall> f. f \<in>  M \<longrightarrow> 2 * Re (((h - k) \<bullet>\<^sub>C f)) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> 0 < 1 \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence \<open>\<forall> f. f \<in>  M \<longrightarrow> Re (((h - k) \<bullet>\<^sub>C f)) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> 2 * Re ((h - k) \<bullet>\<^sub>C f) = 0

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C f) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C f) = 0

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have  \<open>\<forall> f. f \<in>  M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C ((Complex 0 (-1)) *\<^sub>C f)) = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C Complex 0 (- 1) *\<^sub>C f) = 0
[PROOF STEP]
using assms  complex_vector.subspace_def \<open>csubspace M\<close>
[PROOF STATE]
proof (prove)
using this:
closed_csubspace M
csubspace ?S = ((0::?'a) \<in> ?S \<and> (\<forall>x\<in>?S. \<forall>y\<in>?S. x + y \<in> ?S) \<and> (\<forall>c. \<forall>x\<in>?S. c *\<^sub>C x \<in> ?S))
csubspace M

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C Complex 0 (- 1) *\<^sub>C f) = 0
[PROOF STEP]
by (metis \<open>\<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C f) = 0\<close>)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C Complex 0 (- 1) *\<^sub>C f) = 0

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence  \<open>\<forall> f. f \<in>  M \<longrightarrow> Re ( (Complex 0 (-1))*(((h - k) \<bullet>\<^sub>C f)) ) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C Complex 0 (- 1) *\<^sub>C f) = 0

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> Re (Complex 0 (- 1) * ((h - k) \<bullet>\<^sub>C f)) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> Re (Complex 0 (- 1) * ((h - k) \<bullet>\<^sub>C f)) = 0

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence \<open>\<forall> f. f \<in>  M \<longrightarrow> Im (((h - k) \<bullet>\<^sub>C f)) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> Re (Complex 0 (- 1) * ((h - k) \<bullet>\<^sub>C f)) = 0

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> Im ((h - k) \<bullet>\<^sub>C f) = 0
[PROOF STEP]
using Complex_eq_neg_1 Re_i_times cinner_scaleC_right complex_of_real_def
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> Re (Complex 0 (- 1) * ((h - k) \<bullet>\<^sub>C f)) = 0
(Complex ?a ?b = - 1) = (?a = - 1 \<and> ?b = 0)
Re (\<i> * ?z) = - Im ?z
?x \<bullet>\<^sub>C ?r *\<^sub>C ?y = ?r * (?x \<bullet>\<^sub>C ?y)
complex_of_real ?r = Complex ?r 0

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> Im ((h - k) \<bullet>\<^sub>C f) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> Im ((h - k) \<bullet>\<^sub>C f) = 0

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have \<open>\<forall> f. f \<in>  M \<longrightarrow> (((h - k) \<bullet>\<^sub>C f)) = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> is_orthogonal (h - k) f
[PROOF STEP]
using complex_eq_iff
[PROOF STATE]
proof (prove)
using this:
(?x = ?y) = (Re ?x = Re ?y \<and> Im ?x = Im ?y)

goal (1 subgoal):
 1. \<forall>f. f \<in> M \<longrightarrow> is_orthogonal (h - k) f
[PROOF STEP]
by (simp add: \<open>\<forall>f. f \<in> M \<longrightarrow> Im ((h - k) \<bullet>\<^sub>C f) = 0\<close> \<open>\<forall>f. f \<in> M \<longrightarrow> Re ((h - k) \<bullet>\<^sub>C f) = 0\<close>)
[PROOF STATE]
proof (state)
this:
\<forall>f. f \<in> M \<longrightarrow> is_orthogonal (h - k) f

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence \<open>h - k \<in> orthogonal_complement M \<and> k \<in> M\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>f. f \<in> M \<longrightarrow> is_orthogonal (h - k) f

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
by (simp add: \<open>k \<in> M\<close> orthogonal_complementI)
[PROOF STATE]
proof (state)
this:
h - k \<in> orthogonal_complement M \<and> k \<in> M

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have  \<open>\<forall> c. c *\<^sub>R f \<in> M\<close>
      if "f \<in> M"
      for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>c. c *\<^sub>R f \<in> M
[PROOF STEP]
using that scaleR_scaleC  \<open>csubspace M\<close> complex_vector.subspace_def
[PROOF STATE]
proof (prove)
using this:
f \<in> M
(*\<^sub>R) ?r = (*\<^sub>C) (complex_of_real ?r)
csubspace M
csubspace ?S = ((0::?'a) \<in> ?S \<and> (\<forall>x\<in>?S. \<forall>y\<in>?S. x + y \<in> ?S) \<and> (\<forall>c. \<forall>x\<in>?S. c *\<^sub>C x \<in> ?S))

goal (1 subgoal):
 1. \<forall>c. c *\<^sub>R f \<in> M
[PROOF STEP]
by (simp add: complex_vector.subspace_def scaleR_scaleC)
[PROOF STATE]
proof (state)
this:
?f \<in> M \<Longrightarrow> \<forall>c. c *\<^sub>R ?f \<in> M

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
have \<open>((h - k) \<bullet>\<^sub>C f) = 0\<close>
      if "f \<in> M"
      for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_orthogonal (h - k) f
[PROOF STEP]
using \<open>h - k \<in> orthogonal_complement M \<and> k \<in> M\<close> orthogonal_complement_orthoI that
[PROOF STATE]
proof (prove)
using this:
h - k \<in> orthogonal_complement M \<and> k \<in> M
\<lbrakk>?x \<in> orthogonal_complement ?M; ?y \<in> ?M\<rbrakk> \<Longrightarrow> is_orthogonal ?x ?y
f \<in> M

goal (1 subgoal):
 1. is_orthogonal (h - k) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?f \<in> M \<Longrightarrow> is_orthogonal (h - k) ?f

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
hence \<open>h - k \<in> orthogonal_complement M\<close>
[PROOF STATE]
proof (prove)
using this:
?f \<in> M \<Longrightarrow> is_orthogonal (h - k) ?f

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M
[PROOF STEP]
by (simp add: orthogonal_complement_def)
[PROOF STATE]
proof (state)
this:
h - k \<in> orthogonal_complement M

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
h - k \<in> orthogonal_complement M

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
using \<open>k \<in> M\<close>
[PROOF STATE]
proof (prove)
using this:
h - k \<in> orthogonal_complement M
k \<in> M

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M \<and> k \<in> M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h - k \<in> orthogonal_complement M \<and> k \<in> M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k \<Longrightarrow> h - k \<in> orthogonal_complement M \<and> k \<in> M

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
have q1: \<open>dist h k \<le> dist h f \<close>
    if "f \<in> M" and  \<open>h - k \<in> orthogonal_complement M \<and> k \<in> M\<close>
    for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
have \<open>(h - k) \<bullet>\<^sub>C (k - f) = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_orthogonal (h - k) (k - f)
[PROOF STEP]
by (metis (no_types, lifting) that
          cinner_diff_right diff_0_right orthogonal_complement_orthoI that)
[PROOF STATE]
proof (state)
this:
is_orthogonal (h - k) (k - f)

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
have \<open>\<parallel> h - f \<parallel>^2 = \<parallel> (h - k) + (k - f) \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>h - f\<parallel>\<^sup>2 = \<parallel>h - k + (k - f)\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>h - f\<parallel>\<^sup>2 = \<parallel>h - k + (k - f)\<parallel>\<^sup>2

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>h - f\<parallel>\<^sup>2 = \<parallel>h - k + (k - f)\<parallel>\<^sup>2

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
have \<open>... = \<parallel> h - k \<parallel>^2 + \<parallel> k - f \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>h - k + (k - f)\<parallel>\<^sup>2 = \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>k - f\<parallel>\<^sup>2
[PROOF STEP]
using  \<open>((h - k) \<bullet>\<^sub>C (k - f)) = 0\<close> pythagorean_theorem
[PROOF STATE]
proof (prove)
using this:
is_orthogonal (h - k) (k - f)
is_orthogonal ?x ?y \<Longrightarrow> \<parallel>?x + ?y\<parallel>\<^sup>2 = \<parallel>?x\<parallel>\<^sup>2 + \<parallel>?y\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>h - k + (k - f)\<parallel>\<^sup>2 = \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>k - f\<parallel>\<^sup>2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<parallel>h - k + (k - f)\<parallel>\<^sup>2 = \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>k - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>h - k + (k - f)\<parallel>\<^sup>2 = \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>k - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
have \<open>... \<ge> \<parallel> h - k \<parallel>^2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>k - f\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - k\<parallel>\<^sup>2 + \<parallel>k - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - f\<parallel>\<^sup>2
[PROOF STEP]
have \<open>\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - f\<parallel>\<^sup>2 \<close>
[PROOF STATE]
proof (prove)
using this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - f\<parallel>\<^sup>2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
hence \<open>\<parallel>h - k\<parallel> \<le> \<parallel>h - f\<parallel>\<close>
[PROOF STATE]
proof (prove)
using this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>h - k\<parallel> \<le> \<parallel>h - f\<parallel>
[PROOF STEP]
using norm_ge_zero power2_le_imp_le
[PROOF STATE]
proof (prove)
using this:
\<parallel>h - k\<parallel>\<^sup>2 \<le> \<parallel>h - f\<parallel>\<^sup>2
0 \<le> \<parallel>?x\<parallel>
\<lbrakk>?x\<^sup>2 \<le> ?y\<^sup>2; (0::?'a) \<le> ?y\<rbrakk> \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. \<parallel>h - k\<parallel> \<le> \<parallel>h - f\<parallel>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<parallel>h - k\<parallel> \<le> \<parallel>h - f\<parallel>

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<parallel>h - k\<parallel> \<le> \<parallel>h - f\<parallel>

goal (1 subgoal):
 1. dist h k \<le> dist h f
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist h k \<le> dist h f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?f \<in> M; h - k \<in> orthogonal_complement M \<and> k \<in> M\<rbrakk> \<Longrightarrow> dist h k \<le> dist h ?f

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
have  w1: "is_arg_min (\<lambda> x. dist x h) (\<lambda> x. x \<in> M) k"
    if "h - k \<in> orthogonal_complement M \<and> k \<in>  M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k
[PROOF STEP]
have \<open>h - k \<in> orthogonal_complement M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
h - k \<in> orthogonal_complement M \<and> k \<in> M

goal (1 subgoal):
 1. h - k \<in> orthogonal_complement M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h - k \<in> orthogonal_complement M

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k
[PROOF STEP]
have \<open>k \<in> M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> M
[PROOF STEP]
using \<open>h - k \<in> orthogonal_complement M \<and> k \<in>  M\<close>
[PROOF STATE]
proof (prove)
using this:
h - k \<in> orthogonal_complement M \<and> k \<in> M

goal (1 subgoal):
 1. k \<in> M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k \<in> M

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<in> M

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k
[PROOF STEP]
by (metis (no_types, lifting) dist_commute is_arg_min_linorder q1 that)
[PROOF STATE]
proof (state)
this:
is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h - k \<in> orthogonal_complement M \<and> k \<in> M \<Longrightarrow> is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
using w1 w2
[PROOF STATE]
proof (prove)
using this:
h - k \<in> orthogonal_complement M \<and> k \<in> M \<Longrightarrow> is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k
is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k \<Longrightarrow> h - k \<in> orthogonal_complement M \<and> k \<in> M

goal (1 subgoal):
 1. is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_arg_min (\<lambda>x. dist x h) (\<lambda>x. x \<in> M) k = (h - k \<in> orthogonal_complement M \<and> k \<in> M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma llexord_lappend_left:
  "\<lbrakk> lfinite xs; !!x. x \<in> lset xs \<Longrightarrow> \<not> r x x \<rbrakk>
  \<Longrightarrow> llexord r (lappend xs ys) (lappend xs zs) \<longleftrightarrow> llexord r ys zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lfinite xs; \<And>x. x \<in> lset xs \<Longrightarrow> \<not> r x x\<rbrakk> \<Longrightarrow> llexord r (lappend xs ys) (lappend xs zs) = llexord r ys zs
[PROOF STEP]
by(blast intro: llexord_lappend_leftI llexord_lappend_leftD)


[STATEMENT]
lemma gfp_the_while_option_lattice:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  assumes "mono f" and "finite (UNIV :: 'a set)"
  shows "gfp f = the(while_option (\<lambda>A. f A \<noteq> A) f top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp f = the (while_option (\<lambda>A. f A \<noteq> A) f top)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gfp f = the (while_option (\<lambda>A. f A \<noteq> A) f top)
[PROOF STEP]
obtain P where "while_option (\<lambda>A. f A \<noteq> A) f top = Some P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. while_option (\<lambda>A. f A \<noteq> A) f top = Some P \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using while_option_finite_decreasing_Some[OF assms, where s=top]
[PROOF STATE]
proof (prove)
using this:
f top \<le> top \<Longrightarrow> \<exists>P. while_option (\<lambda>A. f A \<noteq> A) f top = Some P

goal (1 subgoal):
 1. (\<And>P. while_option (\<lambda>A. f A \<noteq> A) f top = Some P \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp blast
[PROOF STATE]
proof (state)
this:
while_option (\<lambda>A. f A \<noteq> A) f top = Some P

goal (1 subgoal):
 1. gfp f = the (while_option (\<lambda>A. f A \<noteq> A) f top)
[PROOF STEP]
with while_option_stop2[OF this] gfp_Kleene_iter[OF assms(1)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. P = (f ^^ k) top \<and> \<not> f P \<noteq> P
(f ^^ Suc ?k) top = (f ^^ ?k) top \<Longrightarrow> gfp f = (f ^^ ?k) top
while_option (\<lambda>A. f A \<noteq> A) f top = Some P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>k. P = (f ^^ k) top \<and> \<not> f P \<noteq> P
(f ^^ Suc ?k) top = (f ^^ ?k) top \<Longrightarrow> gfp f = (f ^^ ?k) top
while_option (\<lambda>A. f A \<noteq> A) f top = Some P

goal (1 subgoal):
 1. gfp f = the (while_option (\<lambda>A. f A \<noteq> A) f top)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gfp f = the (while_option (\<lambda>A. f A \<noteq> A) f top)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vint_commutative_law_addition:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "x +\<^sub>\<int> y = y +\<^sub>\<int> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x +\<^sub>\<int> y = y +\<^sub>\<int> x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x +\<^sub>\<int> y = y +\<^sub>\<int> x
[PROOF STEP]
have "x' + y' = y' + x'" for x' y' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' + y' = y' + x'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' + ?y' = ?y' + ?x'

goal (1 subgoal):
 1. x +\<^sub>\<int> y = y +\<^sub>\<int> x
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x +\<^sub>\<int> y = y +\<^sub>\<int> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x +\<^sub>\<int> y = y +\<^sub>\<int> x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma maximalI: "x \<in> S \<Longrightarrow> (\<And>y. y \<in> S \<Longrightarrow> f y \<le> f x) \<Longrightarrow> x \<in> maximal f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> S; \<And>y. y \<in> S \<Longrightarrow> f y \<le> f x\<rbrakk> \<Longrightarrow> x \<in> maximal f S
[PROOF STEP]
by (simp add: maximal_def)


[STATEMENT]
lemma tendsto_Lambert_W [tendsto_intros]:
  assumes "(f \<longlongrightarrow> L) F" "eventually (\<lambda>x. f x \<ge> -exp (-1)) F \<or> L > -exp (-1)"
  shows   "((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
(\<forall>\<^sub>F x in F. - exp (- 1) \<le> f x) \<or> - exp (- 1) < L

goal (1 subgoal):
 1. ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in F. - exp (- 1) \<le> f x \<Longrightarrow> ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
 2. - exp (- 1) < L \<Longrightarrow> ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
[PROOF STEP]
assume "L > -exp (-1)"
[PROOF STATE]
proof (state)
this:
- exp (- 1) < L

goal (2 subgoals):
 1. \<forall>\<^sub>F x in F. - exp (- 1) \<le> f x \<Longrightarrow> ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
 2. - exp (- 1) < L \<Longrightarrow> ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
[PROOF STEP]
from order_tendstoD(1)[OF assms(1) this] assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. - exp (- 1) < f x
(f \<longlongrightarrow> L) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. - exp (- 1) < f x
(f \<longlongrightarrow> L) F

goal (1 subgoal):
 1. ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
[PROOF STEP]
by (intro tendsto_Lambert_W_1) (auto elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. - exp (- 1) \<le> f x \<Longrightarrow> ((\<lambda>x. Lambert_W (f x)) \<longlongrightarrow> Lambert_W L) F
[PROOF STEP]
qed (use tendsto_Lambert_W_1[OF assms(1)] in auto)


[STATEMENT]
lemma nonzero_abs_divide:
  "b \<noteq> 0 \<Longrightarrow> \<bar>a / b\<bar> = \<bar>a\<bar> / \<bar>b\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> \<bar>a / b\<bar> = \<bar>a\<bar> / \<bar>b\<bar>
[PROOF STEP]
by (rule abs_divide)


[STATEMENT]
lemma suminf_le: "(\<And>n. f n \<le> g n) \<Longrightarrow> summable f \<Longrightarrow> summable g \<Longrightarrow> suminf f \<le> suminf g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>n. f n \<le> g n; summable f; summable g\<rbrakk> \<Longrightarrow> suminf f \<le> suminf g
[PROOF STEP]
using sums_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>n. ?f n \<le> ?g n; ?f sums ?s; ?g sums ?t\<rbrakk> \<Longrightarrow> ?s \<le> ?t

goal (1 subgoal):
 1. \<lbrakk>\<And>n. f n \<le> g n; summable f; summable g\<rbrakk> \<Longrightarrow> suminf f \<le> suminf g
[PROOF STEP]
by blast


[STATEMENT]
lemma one_le_ceiling [simp]: "1 \<le> \<lceil>x\<rceil> \<longleftrightarrow> 0 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> \<lceil>x\<rceil>) = ((0::'a) < x)
[PROOF STEP]
by (simp add: le_ceiling_iff)


[STATEMENT]
lemma injective_linorder_matrix:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.injective f \<longleftrightarrow> (\<forall>i j k . f (j,i) \<noteq> bot \<and> f (k,i) \<noteq> bot \<longrightarrow> j = k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.injective f = (\<forall>i j k. f (j, i) \<noteq> bot \<and> f (k, i) \<noteq> bot \<longrightarrow> j = k)
[PROOF STEP]
by (unfold matrix_stone_relation_algebra.injective_conv_univalent univalent_linorder_matrix) (simp add: conv_matrix_def)


[STATEMENT]
lemma graph_eq_to_snd_dom: "graph m = (\<lambda>x. (x, the (m x))) ` dom m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph m = (\<lambda>x. (x, the (m x))) ` dom m
[PROOF STEP]
unfolding graph_def dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a, b) |a b. m a = Some b} = (\<lambda>x. (x, the (m x))) ` {a. m a \<noteq> None}
[PROOF STEP]
by force


[STATEMENT]
lemma dvd_fact: "1 \<le> m \<Longrightarrow> m \<le> n \<Longrightarrow> m dvd fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> m; m \<le> n\<rbrakk> \<Longrightarrow> m dvd fact n
[PROOF STEP]
by (induct n) (auto simp: dvdI le_Suc_eq)


[STATEMENT]
lemma sqrt_nat[simp]: "set (sqrt_nat x) = { y. y * y = x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (sqrt_nat x) = {y. y * y = x}
[PROOF STEP]
unfolding sqrt_nat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (root_nat 2 x) = {y. y * y = x}
[PROOF STEP]
using root_nat[of 2 x]
[PROOF STATE]
proof (prove)
using this:
2 \<noteq> 0 \<or> x \<noteq> 1 \<Longrightarrow> set (root_nat 2 x) = {y. y\<^sup>2 = x}

goal (1 subgoal):
 1. set (root_nat 2 x) = {y. y * y = x}
[PROOF STEP]
by (simp add: power2_eq_square)


[STATEMENT]
lemma test_axiom_inf:
  assumes "\<And>x. x \<in> A \<Longrightarrow> smaller_interp z x"
  shows "smaller_interp z (local.Inf A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smaller_interp z (local.Inf A)
[PROOF STEP]
proof (rule smaller_interpI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s x. x \<in> z s \<Longrightarrow> x \<in> local.Inf A s
[PROOF STEP]
fix s x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s x. x \<in> z s \<Longrightarrow> x \<in> local.Inf A s
[PROOF STEP]
assume "x \<in> z s"
[PROOF STATE]
proof (state)
this:
x \<in> z s

goal (1 subgoal):
 1. \<And>s x. x \<in> z s \<Longrightarrow> x \<in> local.Inf A s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> z s
[PROOF STEP]
have "\<And>y. y \<in> A \<Longrightarrow> x \<in> y s"
[PROOF STATE]
proof (prove)
using this:
x \<in> z s

goal (1 subgoal):
 1. \<And>y. y \<in> A \<Longrightarrow> x \<in> y s
[PROOF STEP]
by (metis assms in_mono smaller_interp_def)
[PROOF STATE]
proof (state)
this:
?y48 \<in> A \<Longrightarrow> x \<in> ?y48 s

goal (1 subgoal):
 1. \<And>s x. x \<in> z s \<Longrightarrow> x \<in> local.Inf A s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y48 \<in> A \<Longrightarrow> x \<in> ?y48 s
[PROOF STEP]
show "x \<in> local.Inf A s"
[PROOF STATE]
proof (prove)
using this:
?y48 \<in> A \<Longrightarrow> x \<in> ?y48 s

goal (1 subgoal):
 1. x \<in> local.Inf A s
[PROOF STEP]
by (simp add: Inf_def)
[PROOF STATE]
proof (state)
this:
x \<in> local.Inf A s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_generated_UNIV_insert:
  assumes "ideal_generated S = UNIV"
  shows "ideal_generated (insert a S) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated (insert a S) = UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ideal_generated S = UNIV

goal (1 subgoal):
 1. ideal_generated (insert a S) = UNIV
[PROOF STEP]
using local.ideal_generated_subset
[PROOF STATE]
proof (prove)
using this:
ideal_generated S = UNIV
?S \<subseteq> ?T \<Longrightarrow> ideal_generated ?S \<subseteq> ideal_generated ?T

goal (1 subgoal):
 1. ideal_generated (insert a S) = UNIV
[PROOF STEP]
by blast


[STATEMENT]
lemma smallo_abs_powr_iff [simp]:
  "0 < p \<Longrightarrow> (\<lambda>x. \<bar>f x :: real\<bar> powr p) \<in> o[F](\<lambda>x. \<bar>g x\<bar> powr p) \<longleftrightarrow> f \<in> o[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar> powr p) \<in> o[F](\<lambda>x. \<bar>g x\<bar> powr p)) = (f \<in> o[F](g))
[PROOF STEP]
by(subst smallo_powr_iff; simp)


[STATEMENT]
lemma option_bind_eq_None [simp]:
    "((option_bind m f) = None) = ((m=None) | (\<exists>p. m = Some p \<and> f p = None))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (option_bind m f = None) = (m = None \<or> (\<exists>p. m = Some p \<and> f p = None))
[PROOF STEP]
by (simp split: split_option_bind)


[STATEMENT]
lemma matrix_add_commute [simp]:
  "(A::('a::ab_semigroup_add,'m,'n) matrix) + B = B + A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B = B + A
[PROOF STEP]
by (cases A, cases B, simp add: add.commute)


[STATEMENT]
lemma is_arg_min_size_subprop:
  fixes   m :: "'a\<Rightarrow>'b::linorder"
  assumes "is_arg_min m P x" "Q x" "\<And>y. Q y \<Longrightarrow> P y"
  shows   "m (arg_min m Q) = m (arg_min m P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m (arg_min m Q) = m (arg_min m P)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m (arg_min m Q) = m (arg_min m P)
[PROOF STEP]
have "\<not> is_arg_min m Q x \<Longrightarrow> \<not> is_arg_min m P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_arg_min m Q x \<Longrightarrow> \<not> is_arg_min m P x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> is_arg_min m Q x; is_arg_min m P x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume x: "\<not> is_arg_min m Q x"
[PROOF STATE]
proof (state)
this:
\<not> is_arg_min m Q x

goal (1 subgoal):
 1. \<lbrakk>\<not> is_arg_min m Q x; is_arg_min m P x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from assms(2,3)
[PROOF STATE]
proof (chain)
picking this:
Q x
Q ?y \<Longrightarrow> P ?y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Q x
Q ?y \<Longrightarrow> P ?y

goal (1 subgoal):
 1. False
[PROOF STEP]
using contrapos_nn[OF x, OF is_arg_minI] is_arg_minD2[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
Q x
Q ?y \<Longrightarrow> P ?y
\<lbrakk>?P \<Longrightarrow> Q x; \<And>y. \<lbrakk>?P; Q y\<rbrakk> \<Longrightarrow> \<not> m y < m x\<rbrakk> \<Longrightarrow> \<not> ?P
P ?y \<Longrightarrow> \<not> m ?y < m x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> is_arg_min m Q x \<Longrightarrow> \<not> is_arg_min m P x

goal (1 subgoal):
 1. m (arg_min m Q) = m (arg_min m P)
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
is_arg_min m P x
\<not> is_arg_min m Q x \<Longrightarrow> \<not> is_arg_min m P x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_arg_min m P x
\<not> is_arg_min m Q x \<Longrightarrow> \<not> is_arg_min m P x

goal (1 subgoal):
 1. m (arg_min m Q) = m (arg_min m P)
[PROOF STEP]
using is_arg_min_size[of m] is_arg_min_size[of m]
[PROOF STATE]
proof (prove)
using this:
is_arg_min m P x
\<not> is_arg_min m Q x \<Longrightarrow> \<not> is_arg_min m P x
is_arg_min m ?P ?x \<Longrightarrow> m ?x = m (arg_min m ?P)
is_arg_min m ?P ?x \<Longrightarrow> m ?x = m (arg_min m ?P)

goal (1 subgoal):
 1. m (arg_min m Q) = m (arg_min m P)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
m (arg_min m Q) = m (arg_min m P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_elem_dvd_power:
  "prime_elem p \<Longrightarrow> p dvd x ^ n \<Longrightarrow> p dvd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime_elem p; p dvd x ^ n\<rbrakk> \<Longrightarrow> p dvd x
[PROOF STEP]
by (induction n) (auto dest: prime_elem_dvd_multD intro: dvd_trans[of _ 1])


[STATEMENT]
lemma arr_Rel_comp_Rel_converse_Rel_left_if_v11[dg_Rel_cs_simps]:
  assumes "arr_Rel \<alpha> T"
    and "\<D>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) = A"
    and "T\<lparr>ArrDom\<rparr> = A"
    and "v11 (T\<lparr>ArrVal\<rparr>)"
    and "A \<in>\<^sub>\<circ> Vset \<alpha>"
  shows "T\<inverse>\<^sub>R\<^sub>e\<^sub>l \<circ>\<^sub>R\<^sub>e\<^sub>l T = id_Rel A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T\<inverse>\<^sub>R\<^sub>e\<^sub>l \<circ>\<^sub>R\<^sub>e\<^sub>l T = id_Rel A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T\<inverse>\<^sub>R\<^sub>e\<^sub>l \<circ>\<^sub>R\<^sub>e\<^sub>l T = id_Rel A
[PROOF STEP]
interpret T: arr_Rel \<alpha> T
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr_Rel \<alpha> T
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T\<inverse>\<^sub>R\<^sub>e\<^sub>l \<circ>\<^sub>R\<^sub>e\<^sub>l T = id_Rel A
[PROOF STEP]
interpret v11: v11 \<open>T\<lparr>ArrVal\<rparr>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v11 (T\<lparr>ArrVal\<rparr>)
[PROOF STEP]
by (rule assms(4))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T\<inverse>\<^sub>R\<^sub>e\<^sub>l \<circ>\<^sub>R\<^sub>e\<^sub>l T = id_Rel A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T\<inverse>\<^sub>R\<^sub>e\<^sub>l \<circ>\<^sub>R\<^sub>e\<^sub>l T = id_Rel A
[PROOF STEP]
by (rule arr_Rel_eqI[of \<alpha>])
      (
        auto simp:
          converse_Rel_components
          comp_Rel_components
          id_Rel_components
          assms(1,3,5)
          arr_Rel.arr_Rel_converse_Rel
          arr_Rel_comp_Rel
          T.arr_Rel_id_RelI
          v11.v11_vcomp_vconverse[unfolded assms(2)]
      )
[PROOF STATE]
proof (state)
this:
T\<inverse>\<^sub>R\<^sub>e\<^sub>l \<circ>\<^sub>R\<^sub>e\<^sub>l T = id_Rel A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tminus_cancel_1:
  "0 \<le> a \<Longrightarrow> a + 1 \<ominus> 1 = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a \<Longrightarrow> a + 1 \<ominus> 1 = a
[PROOF STEP]
unfolding tminus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a \<Longrightarrow> max (a + 1 - 1) 0 = a
[PROOF STEP]
by(simp)


[STATEMENT]
lemma rtranclp_closed_sub: "rtranclp R q q' \<Longrightarrow> {q'. \<exists>q \<in> X. R q q'} \<subseteq> X \<Longrightarrow>
  q \<in> X \<Longrightarrow> q' \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R\<^sup>*\<^sup>* q q'; {q'. \<exists>q\<in>X. R q q'} \<subseteq> X; q \<in> X\<rbrakk> \<Longrightarrow> q' \<in> X
[PROOF STEP]
by (induction q q' rule: rtranclp.induct) auto


[STATEMENT]
lemma ub_ln_1200: "ln 1200 \<le> 57 / (8 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln 1200 \<le> 57 / 8
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln 1200 \<le> 57 / 8
[PROOF STEP]
have "Some (Float 57 (-3)) = ub_ln 8 1200"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (Float 57 (- 3)) = ub_ln 8 1200
[PROOF STEP]
by code_simp
[PROOF STATE]
proof (state)
this:
Some (Float 57 (- 3)) = ub_ln 8 1200

goal (1 subgoal):
 1. ln 1200 \<le> 57 / 8
[PROOF STEP]
from ub_ln(1)[OF this]
[PROOF STATE]
proof (chain)
picking this:
ln (real_of_float 1200) \<le> real_of_float (Float 57 (- 3))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln (real_of_float 1200) \<le> real_of_float (Float 57 (- 3))

goal (1 subgoal):
 1. ln 1200 \<le> 57 / 8
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln 1200 \<le> 57 / 8

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem ZFC_yoneda_lemma:
    assumes "ide a" and "functor Cop.comp S.comp F"
    shows "\<exists>\<phi>. bij_betw \<phi> (S.set (F a)) {\<tau>. natural_transformation Cop.comp S.comp (Y.Y a) F \<tau>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (S.set (F a)) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (S.set (F a)) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
interpret F: "functor" Cop.comp S.comp F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. functor (\<cdot>\<^sup>o\<^sup>p) S.comp F
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
functor (\<cdot>\<^sup>o\<^sup>p) S.comp F

goal (1 subgoal):
 1. functor (\<cdot>\<^sup>o\<^sup>p) S.comp F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (S.set (F a)) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
interpret F: set_valued_functor Cop.comp S.comp S.setp F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_valued_functor (\<cdot>\<^sup>o\<^sup>p) S.comp (\<lambda>A. A \<subseteq> S.S.Univ \<and> small A) F
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (F.SET a) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
interpret Ya: yoneda_functor_fixed_object C S.comp S.setp Hom a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. yoneda_functor_fixed_object (\<cdot>) S.comp (\<lambda>A. A \<subseteq> S.S.Univ \<and> small A) Hom a
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
ide a

goal (1 subgoal):
 1. yoneda_functor_fixed_object (\<cdot>) S.comp (\<lambda>A. A \<subseteq> S.S.Univ \<and> small A) Hom a
[PROOF STEP]
by unfold_locales blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (F.SET a) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
interpret Ya: yoneda_lemma C S.comp S.setp Hom F a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. yoneda_lemma (\<cdot>) S.comp (\<lambda>A. A \<subseteq> S.S.Univ \<and> small A) Hom F a
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (F.SET a) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (F.SET a) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
using Ya.yoneda_lemma
[PROOF STATE]
proof (prove)
using this:
bij_betw Ya.\<T> (F.SET a) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}

goal (1 subgoal):
 1. \<exists>\<phi>. bij_betw \<phi> (F.SET a) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>\<phi>. bij_betw \<phi> (F.SET a) {\<tau>. natural_transformation (\<cdot>\<^sup>o\<^sup>p) S.comp (Y.Y a) F \<tau>}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Union_path_component [simp]:
   "Union {path_component_set S x |x. x \<in> S} = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {path_component_set S x |x. x \<in> S} = S
[PROOF STEP]
apply (rule subset_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> {path_component_set S x |x. x \<in> S} \<subseteq> S
 2. S \<subseteq> \<Union> {path_component_set S x |x. x \<in> S}
[PROOF STEP]
using path_component_subset
[PROOF STATE]
proof (prove)
using this:
path_component_set ?S ?x \<subseteq> ?S

goal (2 subgoals):
 1. \<Union> {path_component_set S x |x. x \<in> S} \<subseteq> S
 2. S \<subseteq> \<Union> {path_component_set S x |x. x \<in> S}
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> \<Union> {path_component_set S x |x. x \<in> S}
[PROOF STEP]
using path_component_refl
[PROOF STATE]
proof (prove)
using this:
?x \<in> ?S \<Longrightarrow> path_component ?S ?x ?x

goal (1 subgoal):
 1. S \<subseteq> \<Union> {path_component_set S x |x. x \<in> S}
[PROOF STEP]
by auto


[STATEMENT]
lemma tendsto_neg_powr:
  assumes "s < 0"
    and f: "LIM x F. f x :> at_top"
  shows "((\<lambda>x. f x powr s) \<longlongrightarrow> (0::real)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
have "((\<lambda>x. exp (s * ln (f x))) \<longlongrightarrow> (0::real)) F" (is "?X")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (s * ln (f x))) \<longlongrightarrow> 0) F
[PROOF STEP]
by (auto intro!: filterlim_compose[OF exp_at_bot] filterlim_compose[OF ln_at_top]
        filterlim_tendsto_neg_mult_at_bot assms)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (s * ln (f x))) \<longlongrightarrow> 0) F

goal (1 subgoal):
 1. ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (s * ln (f x))) \<longlongrightarrow> 0) F

goal (1 subgoal):
 1. ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
have "?X \<longleftrightarrow> ((\<lambda>x. f x powr s) \<longlongrightarrow> (0::real)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (s * ln (f x))) \<longlongrightarrow> 0) F = ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
using f filterlim_at_top_dense[of f F]
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F
filterlim f at_top F = (\<forall>Z. \<forall>\<^sub>F x in F. Z < f x)

goal (1 subgoal):
 1. ((\<lambda>x. exp (s * ln (f x))) \<longlongrightarrow> 0) F = ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
by (intro filterlim_cong[OF refl refl]) (auto simp: neq_iff powr_def elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (s * ln (f x))) \<longlongrightarrow> 0) F = ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F

goal (1 subgoal):
 1. ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F

goal (1 subgoal):
 1. ((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x powr s) \<longlongrightarrow> 0) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_xor_eq:
  \<open>1 XOR a = a + of_bool (even a) - of_bool (odd a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) XOR a = a + of_bool (even a) - of_bool (odd a)
[PROOF STEP]
by (simp add: bit_eq_iff bit_xor_iff add.commute [of _ 1] even_bit_succ_iff)
    (auto simp add: bit_1_iff odd_bit_iff_bit_pred bit_0 elim: oddE)


[STATEMENT]
lemma A_A'D_eq_first_n_rows:
 assumes A_def: "A = A' @\<^sub>r D \<cdot>\<^sub>m 1\<^sub>m n"
  and A': "A' \<in> carrier_mat m n"
  and mn: "m\<ge>n"
shows "(mat_of_rows n (map (Matrix.row A') [0..<n]))
  = (mat_of_rows n (map (Matrix.row A) [0..<n]))" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows n (map (row A') [0..<n]) = mat_of_rows n (map (row A) [0..<n])
[PROOF STEP]
proof (rule eq_matI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
 2. dim_row (mat_of_rows n (map (row A') [0..<n])) = dim_row (mat_of_rows n (map (row A) [0..<n]))
 3. dim_col (mat_of_rows n (map (row A') [0..<n])) = dim_col (mat_of_rows n (map (row A) [0..<n]))
[PROOF STEP]
show dr: "dim_row ?lhs = dim_row ?rhs" and dc: "dim_col ?lhs = dim_col ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_of_rows n (map (row A') [0..<n])) = dim_row (mat_of_rows n (map (row A) [0..<n])) &&& dim_col (mat_of_rows n (map (row A') [0..<n])) = dim_col (mat_of_rows n (map (row A) [0..<n]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row (mat_of_rows n (map (row A') [0..<n])) = dim_row (mat_of_rows n (map (row A) [0..<n]))
dim_col (mat_of_rows n (map (row A') [0..<n])) = dim_col (mat_of_rows n (map (row A) [0..<n]))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
have D: "D \<cdot>\<^sub>m 1\<^sub>m n : carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<cdot>\<^sub>m 1\<^sub>m n \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
D \<cdot>\<^sub>m 1\<^sub>m n \<in> carrier_mat n n

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
assume i: "i<dim_row ?rhs" and j: "j<dim_col ?rhs"
[PROOF STATE]
proof (state)
this:
i < dim_row (mat_of_rows n (map (row A) [0..<n]))
j < dim_col (mat_of_rows n (map (row A) [0..<n]))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
have "?lhs $$ (i,j) = A' $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = A' $$ (i, j)
[PROOF STEP]
using i j dr dc A' mn
[PROOF STATE]
proof (prove)
using this:
i < dim_row (mat_of_rows n (map (row A) [0..<n]))
j < dim_col (mat_of_rows n (map (row A) [0..<n]))
dim_row (mat_of_rows n (map (row A') [0..<n])) = dim_row (mat_of_rows n (map (row A) [0..<n]))
dim_col (mat_of_rows n (map (row A') [0..<n])) = dim_col (mat_of_rows n (map (row A) [0..<n]))
A' \<in> carrier_mat m n
n \<le> m

goal (1 subgoal):
 1. mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = A' $$ (i, j)
[PROOF STEP]
by (simp add: mat_of_rows_def)
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = A' $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = A' $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
have "... = A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' $$ (i, j) = A $$ (i, j)
[PROOF STEP]
using append_rows_nth[OF A' D] i j dr dc A' mn A_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < m + n; ?j < n\<rbrakk> \<Longrightarrow> (A' @\<^sub>r D \<cdot>\<^sub>m 1\<^sub>m n) $$ (?i, ?j) = (if ?i < dim_row A' then A' $$ (?i, ?j) else (D \<cdot>\<^sub>m 1\<^sub>m n) $$ (?i - m, ?j))
i < dim_row (mat_of_rows n (map (row A) [0..<n]))
j < dim_col (mat_of_rows n (map (row A) [0..<n]))
dim_row (mat_of_rows n (map (row A') [0..<n])) = dim_row (mat_of_rows n (map (row A) [0..<n]))
dim_col (mat_of_rows n (map (row A') [0..<n])) = dim_col (mat_of_rows n (map (row A) [0..<n]))
A' \<in> carrier_mat m n
n \<le> m
A = A' @\<^sub>r D \<cdot>\<^sub>m 1\<^sub>m n

goal (1 subgoal):
 1. A' $$ (i, j) = A $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A' $$ (i, j) = A $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A' $$ (i, j) = A $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
have "... = ?rhs $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
using i j dr dc A' A_def mn
[PROOF STATE]
proof (prove)
using this:
i < dim_row (mat_of_rows n (map (row A) [0..<n]))
j < dim_col (mat_of_rows n (map (row A) [0..<n]))
dim_row (mat_of_rows n (map (row A') [0..<n])) = dim_row (mat_of_rows n (map (row A) [0..<n]))
dim_col (mat_of_rows n (map (row A') [0..<n])) = dim_col (mat_of_rows n (map (row A) [0..<n]))
A' \<in> carrier_mat m n
A = A' @\<^sub>r D \<cdot>\<^sub>m 1\<^sub>m n
n \<le> m

goal (1 subgoal):
 1. A $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
by (metis D calculation carrier_matD(1) diff_zero gr_implies_not0 length_map length_upt
        linordered_semidom_class.add_diff_inverse mat_of_rows_carrier(2,3)
        mat_of_rows_index nat_SN.compat nth_map_upt row_append_rows1)
[PROOF STATE]
proof (state)
this:
A $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<n])); j < dim_col (mat_of_rows n (map (row A) [0..<n]))\<rbrakk> \<Longrightarrow> mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
show "?lhs $$ (i,j) = ?rhs $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)

goal (1 subgoal):
 1. mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A') [0..<n]) $$ (i, j) = mat_of_rows n (map (row A) [0..<n]) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma part12: assumes "infinite V"  shows "part12_pred V (part12 V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. part12_pred V (part12 V)
[PROOF STEP]
using part12_pred[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>V1_V2. part12_pred V V1_V2

goal (1 subgoal):
 1. part12_pred V (part12 V)
[PROOF STEP]
unfolding part12_def
[PROOF STATE]
proof (prove)
using this:
\<exists>V1_V2. part12_pred V V1_V2

goal (1 subgoal):
 1. part12_pred V (SOME V1_V2. part12_pred V V1_V2)
[PROOF STEP]
by(rule someI_ex)


[STATEMENT]
lemma dirichlet_prod'_assoc:
  "dirichlet_prod' f (\<lambda>y. dirichlet_prod' g h y) x = dirichlet_prod' (dirichlet_prod f g) h x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
have "dirichlet_prod' f (\<lambda>y. dirichlet_prod' g h y) x =
          (\<Sum>m | m > 0 \<and> real m \<le> x. \<Sum>n | n > 0 \<and> real n \<le> x / m. f m * g n * h (x / (m * n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = (\<Sum>m | 0 < m \<and> real m \<le> x. \<Sum>n | 0 < n \<and> real n \<le> x / real m. f m * g n * h (x / real (m * n)))
[PROOF STEP]
by (simp add: algebra_simps dirichlet_prod'_def dirichlet_prod_def
                  sum_upto_def sum_distrib_left sum_distrib_right)
[PROOF STATE]
proof (state)
this:
dirichlet_prod' f (dirichlet_prod' g h) x = (\<Sum>m | 0 < m \<and> real m \<le> x. \<Sum>n | 0 < n \<and> real n \<le> x / real m. f m * g n * h (x / real (m * n)))

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod' f (dirichlet_prod' g h) x = (\<Sum>m | 0 < m \<and> real m \<le> x. \<Sum>n | 0 < n \<and> real n \<le> x / real m. f m * g n * h (x / real (m * n)))

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
have "\<dots> = (\<Sum>(m,n)\<in>(SIGMA m:{m. m > 0 \<and> real m \<le> x}. {n. n > 0 \<and> real n \<le> x / m}).
                     f m * g n * h (x / (m * n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m | 0 < m \<and> real m \<le> x. \<Sum>n | 0 < n \<and> real n \<le> x / real m. f m * g n * h (x / real (m * n))) = (\<Sum>(m, n)\<in>(SIGMA xa:{m. 0 < m \<and> real m \<le> x}. {n. 0 < n \<and> real n \<le> x / real xa}). f m * g n * h (x / real (m * n)))
[PROOF STEP]
by (subst sum.Sigma) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>m | 0 < m \<and> real m \<le> x. \<Sum>n | 0 < n \<and> real n \<le> x / real m. f m * g n * h (x / real (m * n))) = (\<Sum>(m, n)\<in>(SIGMA xa:{m. 0 < m \<and> real m \<le> x}. {n. 0 < n \<and> real n \<le> x / real xa}). f m * g n * h (x / real (m * n)))

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m | 0 < m \<and> real m \<le> x. \<Sum>n | 0 < n \<and> real n \<le> x / real m. f m * g n * h (x / real (m * n))) = (\<Sum>(m, n)\<in>(SIGMA xa:{m. 0 < m \<and> real m \<le> x}. {n. 0 < n \<and> real n \<le> x / real xa}). f m * g n * h (x / real (m * n)))

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
have "\<dots> = (\<Sum>(mn, m)\<in>(SIGMA mn:{mn. mn > 0 \<and> real mn \<le> x}. {m. m dvd mn}).
                    f m * g (mn div m) * h (x / mn))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(m, n)\<in>(SIGMA xa:{m. 0 < m \<and> real m \<le> x}. {n. 0 < n \<and> real n \<le> x / real xa}). f m * g n * h (x / real (m * n))) = (\<Sum>(mn, m)\<in>(SIGMA mn:{mn. 0 < mn \<and> real mn \<le> x}. {m. m dvd mn}). f m * g (mn div m) * h (x / real mn))
[PROOF STEP]
by (rule sum.reindex_bij_witness[of _ "\<lambda>(mn, m). (m, mn div m)" "\<lambda>(m, n). (m * n, m)"])
       (auto simp: case_prod_unfold field_simps dest: dvd_imp_le)
[PROOF STATE]
proof (state)
this:
(\<Sum>(m, n)\<in>(SIGMA xa:{m. 0 < m \<and> real m \<le> x}. {n. 0 < n \<and> real n \<le> x / real xa}). f m * g n * h (x / real (m * n))) = (\<Sum>(mn, m)\<in>(SIGMA mn:{mn. 0 < mn \<and> real mn \<le> x}. {m. m dvd mn}). f m * g (mn div m) * h (x / real mn))

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(m, n)\<in>(SIGMA xa:{m. 0 < m \<and> real m \<le> x}. {n. 0 < n \<and> real n \<le> x / real xa}). f m * g n * h (x / real (m * n))) = (\<Sum>(mn, m)\<in>(SIGMA mn:{mn. 0 < mn \<and> real mn \<le> x}. {m. m dvd mn}). f m * g (mn div m) * h (x / real mn))

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
have "\<dots> = dirichlet_prod' (dirichlet_prod f g) h x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(mn, m)\<in>(SIGMA mn:{mn. 0 < mn \<and> real mn \<le> x}. {m. m dvd mn}). f m * g (mn div m) * h (x / real mn)) = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
by (subst sum.Sigma [symmetric])
       (simp_all add: dirichlet_prod'_def dirichlet_prod_def sum_upto_def
                      algebra_simps sum_distrib_left sum_distrib_right)
[PROOF STATE]
proof (state)
this:
(\<Sum>(mn, m)\<in>(SIGMA mn:{mn. 0 < mn \<and> real mn \<le> x}. {m. m dvd mn}). f m * g (mn div m) * h (x / real mn)) = dirichlet_prod' (dirichlet_prod f g) h x

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x

goal (1 subgoal):
 1. dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dirichlet_prod' f (dirichlet_prod' g h) x = dirichlet_prod' (dirichlet_prod f g) h x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aminus_mult_minus: "(- (ant z)) * (ant w) = - ((ant z) * (ant w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ant z * ant w = - (ant z * ant w)
[PROOF STEP]
apply (simp add:ant_def minus_ant_def,
       cut_tac ant_z_in_Ainteg[of "z"],
       cut_tac ant_z_in_Ainteg[of "-z"],
       cut_tac ant_z_in_Ainteg[of "w"],
       simp add:Abs_Ainteg_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(z, 0) \<in> Ainteg; (- z, 0) \<in> Ainteg; (w, 0) \<in> Ainteg\<rbrakk> \<Longrightarrow> Abs_Ainteg (- z, 0) * Abs_Ainteg (w, 0) = Abs_Ainteg (- fst (Rep_Ainteg (Abs_Ainteg (z, 0) * Abs_Ainteg (w, 0))), - snd (Rep_Ainteg (Abs_Ainteg (z, 0) * Abs_Ainteg (w, 0))))
[PROOF STEP]
apply (simp add:mult_ant_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(z, 0) \<in> Ainteg; (- z, 0) \<in> Ainteg; (w, 0) \<in> Ainteg\<rbrakk> \<Longrightarrow> Abs_Ainteg (zag_t (Rep_Ainteg (Abs_Ainteg (- z, 0))) (Rep_Ainteg (Abs_Ainteg (w, 0)))) = Abs_Ainteg (- fst (Rep_Ainteg (Abs_Ainteg (zag_t (Rep_Ainteg (Abs_Ainteg (z, 0))) (Rep_Ainteg (Abs_Ainteg (w, 0)))))), - snd (Rep_Ainteg (Abs_Ainteg (zag_t (Rep_Ainteg (Abs_Ainteg (z, 0))) (Rep_Ainteg (Abs_Ainteg (w, 0)))))))
[PROOF STEP]
apply (simp add:Abs_Ainteg_inverse,
       simp add:zag_t_def,
       cut_tac ant_z_in_Ainteg[of "z * w"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(z, 0) \<in> Ainteg; (- z, 0) \<in> Ainteg; (w, 0) \<in> Ainteg; (z * w, 0) \<in> Ainteg\<rbrakk> \<Longrightarrow> Abs_Ainteg (- (z * w), 0) = Abs_Ainteg (- fst (Rep_Ainteg (Abs_Ainteg (z * w, 0))), - snd (Rep_Ainteg (Abs_Ainteg (z * w, 0))))
[PROOF STEP]
apply (simp add:Abs_Ainteg_inverse)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma le_conv_radius_iff:
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
  shows "r \<le> conv_radius a \<longleftrightarrow> (\<forall>x. norm (x-\<xi>) < r \<longrightarrow> summable (\<lambda>i. a i * (x - \<xi>) ^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ereal r \<le> conv_radius a) = (\<forall>x. norm (x - \<xi>) < r \<longrightarrow> summable (\<lambda>i. a i * (x - \<xi>) ^ i))
[PROOF STEP]
apply (intro iffI allI impI summable_in_conv_radius conv_radius_geI_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>ereal r \<le> conv_radius a; norm (x - \<xi>) < r\<rbrakk> \<Longrightarrow> ereal (norm (x - \<xi>)) < conv_radius a
 2. \<And>ra. \<lbrakk>\<forall>x. norm (x - \<xi>) < r \<longrightarrow> summable (\<lambda>i. a i * (x - \<xi>) ^ i); 0 < ra; ereal ra < ereal r\<rbrakk> \<Longrightarrow> \<exists>z. norm z = ra \<and> summable (\<lambda>n. a n * z ^ n)
[PROOF STEP]
apply (meson less_ereal.simps(1) not_le order_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ra. \<lbrakk>\<forall>x. norm (x - \<xi>) < r \<longrightarrow> summable (\<lambda>i. a i * (x - \<xi>) ^ i); 0 < ra; ereal ra < ereal r\<rbrakk> \<Longrightarrow> \<exists>z. norm z = ra \<and> summable (\<lambda>n. a n * z ^ n)
[PROOF STEP]
apply (rule_tac x="of_real ra" in exI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ra. \<lbrakk>\<forall>x. norm (x - \<xi>) < r \<longrightarrow> summable (\<lambda>i. a i * (x - \<xi>) ^ i); 0 < ra; ra < r\<rbrakk> \<Longrightarrow> summable (\<lambda>n. a n * of_real ra ^ n)
[PROOF STEP]
apply (metis abs_of_nonneg add_diff_cancel_left' less_eq_real_def norm_of_real)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma from_nat_into_inj:
  "countable A \<Longrightarrow> m \<in> to_nat_on A ` A \<Longrightarrow> n \<in> to_nat_on A ` A \<Longrightarrow>
    from_nat_into A m = from_nat_into A n \<longleftrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; m \<in> to_nat_on A ` A; n \<in> to_nat_on A ` A\<rbrakk> \<Longrightarrow> (from_nat_into A m = from_nat_into A n) = (m = n)
[PROOF STEP]
by (subst to_nat_on_inj[symmetric, of A]) auto


[STATEMENT]
lemma fds_divisor_sigma: "fds (divisor_sigma x) = fds_zeta * fds_shift x fds_zeta"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (divisor_sigma x) = fds_zeta * fds_shift x fds_zeta
[PROOF STEP]
by (rule fds_eqI) (simp add: fds_nth_mult dirichlet_prod_altdef1 divisor_sigma_def)


[STATEMENT]
theorem LT25[simp_unl]: "\<turnstile> (F \<leadsto> #False) = \<box>\<not>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (F \<leadsto> #False) = \<box>\<not> F
[PROOF STEP]
unfolding leadsto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>(F \<longrightarrow> \<diamond>#False) = \<box>\<not> F
[PROOF STEP]
proof (rule MM1)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> (F \<longrightarrow> \<diamond>#False) = \<not> F
[PROOF STEP]
show "\<turnstile> (F \<longrightarrow> \<diamond>#False) = \<not>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (F \<longrightarrow> \<diamond>#False) = \<not> F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<turnstile> (F \<longrightarrow> \<diamond>#False) = \<not> F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace>
          \<lbrace>\<acute>Abr = ''Break''\<rbrace>\<bullet> WHILE True INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace>
           DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break''
              ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1
              FI
           OD
          \<lbrace>\<acute>S = a * b\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace> \<lbrace>\<acute>Abr = ''Break''\<rbrace>\<bullet>WHILE True INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace> DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break'' ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 FI OD \<lbrace>\<acute>S = a * b\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b
 2. \<And>M S. \<lbrakk>S = M * b; True\<rbrakk> \<Longrightarrow> (M = a \<longrightarrow> S = a * b) \<and> (M \<noteq> a \<longrightarrow> S + b = (M + 1) * b)
 3. \<And>M S. \<lbrakk>S = M * b; \<not> True\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma zer_iff:
  fixes p:: "real poly"
  fixes ls:: "real poly list"
  shows "poly (sum_list (map (\<lambda>x. x^2) ls)) x = 0 \<longleftrightarrow> (\<forall>i \<in> set ls. poly i x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0)
[PROOF STEP]
proof (induct ls)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)
 2. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)
 2. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)

goal (1 subgoal):
 1. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
case (Cons a I1)
[PROOF STATE]
proof (state)
this:
(poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0)

goal (1 subgoal):
 1. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0)

goal (1 subgoal):
 1. (poly (sum_list (map power2 (a # I1))) x = 0) = (\<forall>i\<in>set (a # I1). poly i x = 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 + poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
apply (subst add_nonneg_eq_0_iff)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> (poly a x)\<^sup>2
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 3. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
using zero_le_power2
[PROOF STATE]
proof (prove)
using this:
(0::?'a) \<le> ?a\<^sup>2

goal (3 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> (poly a x)\<^sup>2
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 3. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
using sum_list_map_power2_poly
[PROOF STATE]
proof (prove)
using this:
0 \<le> poly (sum_list (map power2 ?ls)) ?x

goal (2 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
apply presburger
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(poly (sum_list (map power2 (a # I1))) x = 0) = (\<forall>i\<in>set (a # I1). poly i x = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fimage_Suc_o_Suc_eq_fimage_Suc_iff[simp]:
  "((Suc \<circ> Suc) |`| X = Suc |`| Y) \<longleftrightarrow> (Suc |`| X = Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Suc \<circ> Suc) |`| X = Suc |`| Y) = (Suc |`| X = Y)
[PROOF STEP]
by (metis fimage_Suc_inj fset.map_comp)