[STATEMENT]
lemma homeomorphic_balls:
  fixes a b ::"'a::real_normed_vector"
  assumes "0 < d"  "0 < e"
  shows "(ball a d) homeomorphic  (ball b e)" (is ?th)
    and "(cball a d) homeomorphic (cball b e)" (is ?cth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball a d homeomorphic ball b e &&& cball a d homeomorphic cball b e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ball a d homeomorphic ball b e
 2. cball a d homeomorphic cball b e
[PROOF STEP]
show ?th
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball a d homeomorphic ball b e
[PROOF STEP]
unfolding homeomorphic_minimal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>ball a d. f x \<in> ball b e \<and> g (f x) = x) \<and> (\<forall>y\<in>ball b e. g y \<in> ball a d \<and> f (g y) = y) \<and> continuous_on (ball a d) f \<and> continuous_on (ball b e) g
[PROOF STEP]
apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. (\<forall>x\<in>ball a d. b + (e / d) *\<^sub>R (x - a) \<in> ball b e \<and> g (b + (e / d) *\<^sub>R (x - a)) = x) \<and> (\<forall>y\<in>ball b e. g y \<in> ball a d \<and> b + (e / d) *\<^sub>R (g y - a) = y) \<and> continuous_on (ball a d) (\<lambda>x. b + (e / d) *\<^sub>R (x - a)) \<and> continuous_on (ball b e) g
[PROOF STEP]
apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>ball a d. b + (e / d) *\<^sub>R (x - a) \<in> ball b e \<and> a + (d / e) *\<^sub>R (b + (e / d) *\<^sub>R (x - a) - b) = x) \<and> (\<forall>y\<in>ball b e. a + (d / e) *\<^sub>R (y - b) \<in> ball a d \<and> b + (e / d) *\<^sub>R (a + (d / e) *\<^sub>R (y - b) - a) = y) \<and> continuous_on (ball a d) (\<lambda>x. b + (e / d) *\<^sub>R (x - a)) \<and> continuous_on (ball b e) (\<lambda>x. a + (d / e) *\<^sub>R (x - b))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < d
0 < e

goal (1 subgoal):
 1. (\<forall>x\<in>ball a d. b + (e / d) *\<^sub>R (x - a) \<in> ball b e \<and> a + (d / e) *\<^sub>R (b + (e / d) *\<^sub>R (x - a) - b) = x) \<and> (\<forall>y\<in>ball b e. a + (d / e) *\<^sub>R (y - b) \<in> ball a d \<and> b + (e / d) *\<^sub>R (a + (d / e) *\<^sub>R (y - b) - a) = y) \<and> continuous_on (ball a d) (\<lambda>x. b + (e / d) *\<^sub>R (x - a)) \<and> continuous_on (ball b e) (\<lambda>x. a + (d / e) *\<^sub>R (x - b))
[PROOF STEP]
by (auto intro!: continuous_intros simp: dist_commute dist_norm pos_divide_less_eq)
[PROOF STATE]
proof (state)
this:
ball a d homeomorphic ball b e

goal (1 subgoal):
 1. cball a d homeomorphic cball b e
[PROOF STEP]
show ?cth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball a d homeomorphic cball b e
[PROOF STEP]
unfolding homeomorphic_minimal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>cball a d. f x \<in> cball b e \<and> g (f x) = x) \<and> (\<forall>y\<in>cball b e. g y \<in> cball a d \<and> f (g y) = y) \<and> continuous_on (cball a d) f \<and> continuous_on (cball b e) g
[PROOF STEP]
apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. (\<forall>x\<in>cball a d. b + (e / d) *\<^sub>R (x - a) \<in> cball b e \<and> g (b + (e / d) *\<^sub>R (x - a)) = x) \<and> (\<forall>y\<in>cball b e. g y \<in> cball a d \<and> b + (e / d) *\<^sub>R (g y - a) = y) \<and> continuous_on (cball a d) (\<lambda>x. b + (e / d) *\<^sub>R (x - a)) \<and> continuous_on (cball b e) g
[PROOF STEP]
apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>cball a d. b + (e / d) *\<^sub>R (x - a) \<in> cball b e \<and> a + (d / e) *\<^sub>R (b + (e / d) *\<^sub>R (x - a) - b) = x) \<and> (\<forall>y\<in>cball b e. a + (d / e) *\<^sub>R (y - b) \<in> cball a d \<and> b + (e / d) *\<^sub>R (a + (d / e) *\<^sub>R (y - b) - a) = y) \<and> continuous_on (cball a d) (\<lambda>x. b + (e / d) *\<^sub>R (x - a)) \<and> continuous_on (cball b e) (\<lambda>x. a + (d / e) *\<^sub>R (x - b))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < d
0 < e

goal (1 subgoal):
 1. (\<forall>x\<in>cball a d. b + (e / d) *\<^sub>R (x - a) \<in> cball b e \<and> a + (d / e) *\<^sub>R (b + (e / d) *\<^sub>R (x - a) - b) = x) \<and> (\<forall>y\<in>cball b e. a + (d / e) *\<^sub>R (y - b) \<in> cball a d \<and> b + (e / d) *\<^sub>R (a + (d / e) *\<^sub>R (y - b) - a) = y) \<and> continuous_on (cball a d) (\<lambda>x. b + (e / d) *\<^sub>R (x - a)) \<and> continuous_on (cball b e) (\<lambda>x. a + (d / e) *\<^sub>R (x - b))
[PROOF STEP]
by (auto intro!: continuous_intros simp: dist_commute dist_norm pos_divide_le_eq)
[PROOF STATE]
proof (state)
this:
cball a d homeomorphic cball b e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem allT:  "\<turnstile> (\<forall>x. \<box>(F x)) = (\<box>(\<forall>x. F x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (\<forall>x. \<box>F x) = \<box>(\<forall>x. F x)
[PROOF STEP]
by (auto simp: always_def)


[STATEMENT]
lemma simply_connected_eq_contractible_loop_some:
  fixes S :: "_::real_normed_vector set"
  shows "simply_connected S \<longleftrightarrow>
                path_connected S \<and>
                (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
                    \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))"
     (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S = (path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a))))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))
 2. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a))) \<Longrightarrow> simply_connected S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
simply_connected S

goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))
 2. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a))) \<Longrightarrow> simply_connected S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
simply_connected S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
simply_connected S

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))
[PROOF STEP]
using simply_connected_eq_contractible_loop_any
[PROOF STATE]
proof (prove)
using this:
simply_connected S
simply_connected ?S = (\<forall>p a. path p \<and> path_image p \<subseteq> ?S \<and> pathfinish p = pathstart p \<and> a \<in> ?S \<longrightarrow> homotopic_loops ?S p (linepath a a))

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))
[PROOF STEP]
by (blast intro: simply_connected_imp_path_connected)
[PROOF STATE]
proof (state)
this:
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a))) \<Longrightarrow> simply_connected S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a))) \<Longrightarrow> simply_connected S
[PROOF STEP]
assume r: ?rhs
[PROOF STATE]
proof (state)
this:
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a))) \<Longrightarrow> simply_connected S
[PROOF STEP]
note pa = r [THEN conjunct2, rule_format]
[PROOF STATE]
proof (state)
this:
path ?p \<and> path_image ?p \<subseteq> S \<and> pathfinish ?p = pathstart ?p \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S ?p (linepath a a)

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a))) \<Longrightarrow> simply_connected S
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S
[PROOF STEP]
proof (clarsimp simp add: simply_connected_eq_contractible_loop_any)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p a. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p; a \<in> S\<rbrakk> \<Longrightarrow> homotopic_loops S p (linepath a a)
[PROOF STEP]
fix p a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p a. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p; a \<in> S\<rbrakk> \<Longrightarrow> homotopic_loops S p (linepath a a)
[PROOF STEP]
assume "path p" and "path_image p \<subseteq> S" "pathfinish p = pathstart p"
      and "a \<in> S"
[PROOF STATE]
proof (state)
this:
path p
path_image p \<subseteq> S
pathfinish p = pathstart p
a \<in> S

goal (1 subgoal):
 1. \<And>p a. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p; a \<in> S\<rbrakk> \<Longrightarrow> homotopic_loops S p (linepath a a)
[PROOF STEP]
with pa [of p]
[PROOF STATE]
proof (chain)
picking this:
path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
path p
path_image p \<subseteq> S
pathfinish p = pathstart p
a \<in> S
[PROOF STEP]
show "homotopic_loops S p (linepath a a)"
[PROOF STATE]
proof (prove)
using this:
path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
path p
path_image p \<subseteq> S
pathfinish p = pathstart p
a \<in> S

goal (1 subgoal):
 1. homotopic_loops S p (linepath a a)
[PROOF STEP]
using homotopic_loops_trans path_connected_eq_homotopic_points r
[PROOF STATE]
proof (prove)
using this:
path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
path p
path_image p \<subseteq> S
pathfinish p = pathstart p
a \<in> S
\<lbrakk>homotopic_loops ?s ?p ?q; homotopic_loops ?s ?q ?r\<rbrakk> \<Longrightarrow> homotopic_loops ?s ?p ?r
path_connected ?S = (\<forall>a b. a \<in> ?S \<and> b \<in> ?S \<longrightarrow> homotopic_loops ?S (linepath a a) (linepath b b))
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))

goal (1 subgoal):
 1. homotopic_loops S p (linepath a a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
homotopic_loops S p (linepath a a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rcis_divide: "rcis r1 a / rcis r2 b = rcis (r1 / r2) (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis r1 a / rcis r2 b = rcis (r1 / r2) (a - b)
[PROOF STEP]
by (simp add: rcis_def cis_divide [symmetric])


[STATEMENT]
lemma segment_Suc: "segment n ` {..<Suc k} = insert {k/n..(1 + real k) / n} (segment n ` {..<k})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. segment n ` {..<Suc k} = insert {real k / real n..(1 + real k) / real n} (segment n ` {..<k})
[PROOF STEP]
by (simp add: segment_def lessThan_Suc)


[STATEMENT]
lemma gisom1: "\<lbrakk>Group F; Group G; f \<in> gHom F G \<rbrakk> \<Longrightarrow>
     (F/ (gker\<^bsub>F,G\<^esub> f)) \<cong> (Img\<^bsub>F,G\<^esub> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> (F / gker\<^bsub>F,G\<^esub> f) \<cong> (Img\<^bsub>F,G\<^esub> f)
[PROOF STEP]
apply (simp add:isomorphic_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> \<exists>fa. gbij\<^bsub>(F / gker\<^bsub>F,G\<^esub> f),Img\<^bsub>F,G\<^esub> f\<^esub> fa
[PROOF STEP]
apply (frule homomthm1 [of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; gbij\<^bsub>(F / gker\<^bsub>F,G\<^esub> f),Img\<^bsub>F,G\<^esub> f\<^esub> (f\<dieresis>\<^bsub>F,Img\<^bsub>F,G\<^esub> f\<^esub>)\<rbrakk> \<Longrightarrow> \<exists>fa. gbij\<^bsub>(F / gker\<^bsub>F,G\<^esub> f),Img\<^bsub>F,G\<^esub> f\<^esub> fa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma negative_imp_inverse_negative:
  "a < 0 \<Longrightarrow> inverse a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < (0::'a) \<Longrightarrow> inverse a < (0::'a)
[PROOF STEP]
by (insert positive_imp_inverse_positive [of "-a"],
      simp add: nonzero_inverse_minus_eq less_imp_not_eq)


[STATEMENT]
lemma matrix_to_iarray_Gauss_Jordan_column_k_1:
  fixes A::"'a::{field}^'columns::{mod_type}^'rows::{mod_type}"
  assumes k: "k<ncols A"
  and i: "i\<le>nrows A"
  shows "(fst (Gauss_Jordan_column_k (i, A) k)) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
proof (cases "i<nrows A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
 2. \<not> i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < nrows A

goal (2 subgoals):
 1. i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
 2. \<not> i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
unfolding Gauss_Jordan_column_k_def Let_def Gauss_Jordan_column_k_iarrays_def fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (i, A) else (i + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k))) = fst (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (i, matrix_to_iarray A) else (Suc i, Gauss_Jordan_in_ij_iarrays (matrix_to_iarray A) i k))
[PROOF STEP]
unfolding vec_to_iarray_column[of "from_nat k" A, unfolded to_nat_from_nat_id[OF k[unfolded ncols_def]], symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (i, A) else (i + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k))) = fst (if vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (i, matrix_to_iarray A) else (Suc i, Gauss_Jordan_in_ij_iarrays (matrix_to_iarray A) i k))
[PROOF STEP]
using matrix_vector_all_zero_from_index[symmetric, of "from_nat i::'rows" "from_nat k::'columns"]
[PROOF STATE]
proof (prove)
using this:
vector_all_zero_from_index (mod_type_class.to_nat (mod_type_class.from_nat i), vec_to_iarray (column (mod_type_class.from_nat k) ?A)) = (\<forall>m\<ge>mod_type_class.from_nat i. ?A $ m $ mod_type_class.from_nat k = (0::?'a))

goal (1 subgoal):
 1. fst (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (i, A) else (i + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k))) = fst (if vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (i, matrix_to_iarray A) else (Suc i, Gauss_Jordan_in_ij_iarrays (matrix_to_iarray A) i k))
[PROOF STEP]
unfolding to_nat_from_nat_id[OF True[unfolded nrows_def]] to_nat_from_nat_id[OF k[unfolded ncols_def]]
[PROOF STATE]
proof (prove)
using this:
vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) ?A)) = (\<forall>m\<ge>mod_type_class.from_nat i. ?A $ m $ mod_type_class.from_nat k = (0::?'a))

goal (1 subgoal):
 1. fst (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (i, A) else (i + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k))) = fst (if vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (i, matrix_to_iarray A) else (Suc i, Gauss_Jordan_in_ij_iarrays (matrix_to_iarray A) i k))
[PROOF STEP]
using matrix_to_iarray_Gauss_Jordan_in_ij
[PROOF STATE]
proof (prove)
using this:
vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) ?A)) = (\<forall>m\<ge>mod_type_class.from_nat i. ?A $ m $ mod_type_class.from_nat k = (0::?'a))
\<not> vector_all_zero_from_index (mod_type_class.to_nat ?i, vec_to_iarray (column ?j ?A)) \<Longrightarrow> matrix_to_iarray (Gauss_Jordan_in_ij ?A ?i ?j) = Gauss_Jordan_in_ij_iarrays (matrix_to_iarray ?A) (mod_type_class.to_nat ?i) (mod_type_class.to_nat ?j)

goal (1 subgoal):
 1. fst (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (i, A) else (i + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k))) = fst (if vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (i, matrix_to_iarray A) else (Suc i, Gauss_Jordan_in_ij_iarrays (matrix_to_iarray A) i k))
[PROOF STEP]
unfolding matrix_to_iarray_nrows snd_conv
[PROOF STATE]
proof (prove)
using this:
vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) ?A)) = (\<forall>m\<ge>mod_type_class.from_nat i. ?A $ m $ mod_type_class.from_nat k = (0::?'a))
\<not> vector_all_zero_from_index (mod_type_class.to_nat ?i, vec_to_iarray (column ?j ?A)) \<Longrightarrow> matrix_to_iarray (Gauss_Jordan_in_ij ?A ?i ?j) = Gauss_Jordan_in_ij_iarrays (matrix_to_iarray ?A) (mod_type_class.to_nat ?i) (mod_type_class.to_nat ?j)

goal (1 subgoal):
 1. fst (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows_iarray (matrix_to_iarray A) then (i, A) else (i + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k))) = fst (if vector_all_zero_from_index (i, vec_to_iarray (column (mod_type_class.from_nat k) A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (i, matrix_to_iarray A) else (Suc i, Gauss_Jordan_in_ij_iarrays (matrix_to_iarray A) i k))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)

goal (1 subgoal):
 1. \<not> i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < nrows A

goal (1 subgoal):
 1. \<not> i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
have "vector_all_zero_from_index (nrows A, column_iarray k (matrix_to_iarray A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_all_zero_from_index (nrows A, column_iarray k (matrix_to_iarray A))
[PROOF STEP]
unfolding vector_all_zero_from_index_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let i = fst (nrows A, column_iarray k (matrix_to_iarray A)); A = snd (nrows A, column_iarray k (matrix_to_iarray A)) in IArray.all (\<lambda>x. A !! x = (0::'a)) (IArray [i..<IArray.length A])
[PROOF STEP]
unfolding Let_def  snd_conv fst_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.all (\<lambda>x. column_iarray k (matrix_to_iarray A) !! x = (0::'a)) (IArray [nrows A..<IArray.length (column_iarray k (matrix_to_iarray A))])
[PROOF STEP]
unfolding nrows_def column_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.all (\<lambda>x. IArray.of_fun (\<lambda>m. matrix_to_iarray A !! m !! k) (IArray.length (matrix_to_iarray A)) !! x = (0::'a)) (IArray [CARD('rows)..<IArray.length (IArray.of_fun (\<lambda>m. matrix_to_iarray A !! m !! k) (IArray.length (matrix_to_iarray A)))])
[PROOF STEP]
unfolding length_eq_card_rows
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.all (\<lambda>x. IArray.of_fun (\<lambda>m. matrix_to_iarray A !! m !! k) CARD('rows) !! x = (0::'a)) (IArray [CARD('rows)..<IArray.length (IArray.of_fun (\<lambda>m. matrix_to_iarray A !! m !! k) CARD('rows))])
[PROOF STEP]
by (simp add: is_none_code(1))
[PROOF STATE]
proof (state)
this:
vector_all_zero_from_index (nrows A, column_iarray k (matrix_to_iarray A))

goal (1 subgoal):
 1. \<not> i < nrows A \<Longrightarrow> fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
vector_all_zero_from_index (nrows A, column_iarray k (matrix_to_iarray A))

goal (1 subgoal):
 1. fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
using i False
[PROOF STATE]
proof (prove)
using this:
vector_all_zero_from_index (nrows A, column_iarray k (matrix_to_iarray A))
i \<le> nrows A
\<not> i < nrows A

goal (1 subgoal):
 1. fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)
[PROOF STEP]
unfolding Gauss_Jordan_column_k_iarrays_def Gauss_Jordan_column_k_def Let_def
[PROOF STATE]
proof (prove)
using this:
vector_all_zero_from_index (nrows A, column_iarray k (matrix_to_iarray A))
i \<le> nrows A
\<not> i < nrows A

goal (1 subgoal):
 1. fst (if (\<forall>m\<ge>mod_type_class.from_nat (fst (i, A)). snd (i, A) $ m $ mod_type_class.from_nat k = (0::'a)) \<or> fst (i, A) = nrows (snd (i, A)) then (fst (i, A), snd (i, A)) else (fst (i, A) + 1, Gauss_Jordan_in_ij (snd (i, A)) (mod_type_class.from_nat (fst (i, A))) (mod_type_class.from_nat k))) = fst (if vector_all_zero_from_index (fst (i, matrix_to_iarray A), column_iarray k (snd (i, matrix_to_iarray A))) \<or> fst (i, matrix_to_iarray A) = nrows_iarray (snd (i, matrix_to_iarray A)) then (fst (i, matrix_to_iarray A), snd (i, matrix_to_iarray A)) else (Suc (fst (i, matrix_to_iarray A)), Gauss_Jordan_in_ij_iarrays (snd (i, matrix_to_iarray A)) (fst (i, matrix_to_iarray A)) k))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_column_k (i, A) k) = fst (Gauss_Jordan_column_k_iarrays (i, matrix_to_iarray A) k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bilinear_continuous_on_compose:
  fixes h :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space \<Rightarrow> 'c::real_normed_vector"
    and f :: "'d::t2_space \<Rightarrow> 'a"
  assumes "continuous_on S f" "continuous_on S g" "bilinear h"
  shows "continuous_on S (\<lambda>x. h (f x) (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. h (f x) (g x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
continuous_on S g
bilinear h

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. h (f x) (g x))
[PROOF STEP]
by (simp add: continuous_on_eq_continuous_within bilinear_continuous_compose)


[STATEMENT]
lemma relImage_relInvImage:
  assumes "R \<subseteq> f ` A \<times> f ` A"
  shows "relImage (relInvImage A R f) f = R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relImage (relInvImage A R f) f = R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> f ` A \<times> f ` A

goal (1 subgoal):
 1. relImage (relInvImage A R f) f = R
[PROOF STEP]
unfolding relImage_def relInvImage_def
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> f ` A \<times> f ` A

goal (1 subgoal):
 1. {(f a1, f a2) |a1 a2. (a1, a2) \<in> {(a1, a2) |a1 a2. a1 \<in> A \<and> a2 \<in> A \<and> (f a1, f a2) \<in> R}} = R
[PROOF STEP]
by fast


[STATEMENT]
lemma t1_space_closed_map_image:
   "\<lbrakk>closed_map X Y f; f ` (topspace X) = topspace Y; t1_space X\<rbrakk> \<Longrightarrow> t1_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed_map X Y f; f ` topspace X = topspace Y; t1_space X\<rbrakk> \<Longrightarrow> t1_space Y
[PROOF STEP]
by (metis closed_map_def finite_subset_image t1_space_closedin_finite)


[STATEMENT]
lemma zero_less_o_G: "0 < order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < order G
[PROOF STEP]
by (simp add: order_def card_gt_0_iff carrier_not_empty)


[STATEMENT]
lemma integral_has_real_derivative':
  assumes "continuous_on {a..b} g"
  assumes "t \<in> {a..b}"
  shows "((\<lambda>x. integral {x..b} g) has_real_derivative -g t) (at t within {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. integral {x..b} g) has_real_derivative - g t) (at t within {a..b})
[PROOF STEP]
using integral_has_vector_derivative'[OF assms]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. integral {u..b} g) has_vector_derivative - g t) (at t within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. integral {x..b} g) has_real_derivative - g t) (at t within {a..b})
[PROOF STEP]
by (auto simp: has_real_derivative_iff_has_vector_derivative)


[STATEMENT]
lemma finprod_mono_neutral_cong_right:
  assumes "finite B"
    and "A \<subseteq> B" "\<And>i. i \<in> B - A \<Longrightarrow> g i = \<one>" "\<And>x. x \<in> A \<Longrightarrow> g x = h x" "g \<in> B \<rightarrow> carrier G"
  shows "finprod G g B = finprod G h A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G g B = finprod G h A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite B
A \<subseteq> B
?i \<in> B - A \<Longrightarrow> g ?i = \<one>
?x \<in> A \<Longrightarrow> g ?x = h ?x
g \<in> B \<rightarrow> carrier G

goal (1 subgoal):
 1. finprod G g B = finprod G h A
[PROOF STEP]
by (auto intro!: finprod_mono_neutral_cong_left [symmetric])


[STATEMENT]
theorem meet_connection2: "(x \<sqsubseteq> y) = (y \<sqinter> x = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqsubseteq> y) = (y \<sqinter> x = x)
[PROOF STEP]
using meet_commute meet_connection
[PROOF STATE]
proof (prove)
using this:
?x \<sqinter> ?y = ?y \<sqinter> ?x
(?x \<sqsubseteq> ?y) = (?x \<sqinter> ?y = ?x)

goal (1 subgoal):
 1. (x \<sqsubseteq> y) = (y \<sqinter> x = x)
[PROOF STEP]
by simp


[STATEMENT]
lemma pred_succ[simp]:
assumes "aboveS j \<noteq> {}"  shows "pred (succ j) = j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred (succ j) = j
[PROOF STEP]
unfolding pred_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME ja. ja \<in> Field r \<and> local.aboveS ja \<noteq> {} \<and> succ ja = succ j) = j
[PROOF STEP]
apply(rule some_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. j \<in> Field r \<and> local.aboveS j \<noteq> {} \<and> succ j = succ j
 2. \<And>ja. ja \<in> Field r \<and> local.aboveS ja \<noteq> {} \<and> succ ja = succ j \<Longrightarrow> ja = j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
local.aboveS j \<noteq> {}

goal (2 subgoals):
 1. j \<in> Field r \<and> local.aboveS j \<noteq> {} \<and> succ j = succ j
 2. \<And>ja. ja \<in> Field r \<and> local.aboveS ja \<noteq> {} \<and> succ ja = succ j \<Longrightarrow> ja = j
[PROOF STEP]
apply(force simp: Field_def aboveS_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ja. ja \<in> Field r \<and> local.aboveS ja \<noteq> {} \<and> succ ja = succ j \<Longrightarrow> ja = j
[PROOF STEP]
by (metis assms succ_inj)


[STATEMENT]
lemma check_eqv_sound:
  "\<lbrakk>#\<^sub>V \<AA> = idx; check_eqv idx \<phi> \<psi>\<rbrakk> \<Longrightarrow> (WS1S_Alt.sat \<AA> \<phi> \<longleftrightarrow> WS1S_Alt.sat \<AA> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>#\<^sub>V \<AA> = idx; check_eqv idx \<phi> \<psi>\<rbrakk> \<Longrightarrow> WS1S_Alt.sat \<AA> \<phi> = WS1S_Alt.sat \<AA> \<psi>
[PROOF STEP]
unfolding check_eqv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>#\<^sub>V \<AA> = idx; WS1S_Alt.check_eqv idx \<phi> \<psi>\<rbrakk> \<Longrightarrow> WS1S_Alt.sat \<AA> \<phi> = WS1S_Alt.sat \<AA> \<psi>
[PROOF STEP]
by (rule WS1S_Alt.check_eqv_soundness)


[STATEMENT]
lemma set_mergesort:
  "set (mergesort f xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (mergesort f xs) = set xs
[PROOF STEP]
by (induction f xs rule: mergesort.induct)
     (simp_all add: set_merge split_at_take_drop_conv, metis list.simps(15) set_take_drop)


[STATEMENT]
lemma widen_antisym [trans]:
  assumes a_b: "a \<preceq> b"
  assumes b_c: "b \<preceq> a"
  shows "a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
using a_b b_c antisym_rtrancl_direct_subtype
[PROOF STATE]
proof (prove)
using this:
a \<preceq> b
b \<preceq> a
antisym (direct_subtype\<^sup>*)

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by (unfold antisym_def) blast


[STATEMENT]
lemma inversions_between_permute1:
  assumes "\<pi> permutes {..<length xs}"
  shows   "inversions_between (permute_list \<pi> xs) ys =
             map_prod (inv \<pi>) id ` inversions_between xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inversions_between (permute_list \<pi> xs) ys = map_prod (inv \<pi>) id ` inversions_between xs ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inversions_between (permute_list \<pi> xs) ys = map_prod (inv \<pi>) id ` inversions_between xs ys
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<pi> permutes {..<length xs}
[PROOF STEP]
have [simp]: "\<pi> i < length xs" if "i < length xs" "\<pi> permutes {..<length xs}" for i \<pi>
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length xs}

goal (1 subgoal):
 1. \<pi> i < length xs
[PROOF STEP]
using permutes_in_image[OF that(2)] that
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length xs}
(\<pi> ?x \<in> {..<length xs}) = (?x \<in> {..<length xs})
i < length xs
\<pi> permutes {..<length xs}

goal (1 subgoal):
 1. \<pi> i < length xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < length xs; ?\<pi> permutes {..<length xs}\<rbrakk> \<Longrightarrow> ?\<pi> ?i < length xs

goal (1 subgoal):
 1. inversions_between (permute_list \<pi> xs) ys = map_prod (inv \<pi>) id ` inversions_between xs ys
[PROOF STEP]
have *: "inv \<pi> permutes {..<length xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv \<pi> permutes {..<length xs}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length xs}

goal (1 subgoal):
 1. inv \<pi> permutes {..<length xs}
[PROOF STEP]
by (rule permutes_inv)
[PROOF STATE]
proof (state)
this:
inv \<pi> permutes {..<length xs}

goal (1 subgoal):
 1. inversions_between (permute_list \<pi> xs) ys = map_prod (inv \<pi>) id ` inversions_between xs ys
[PROOF STEP]
from assms *
[PROOF STATE]
proof (chain)
picking this:
\<pi> permutes {..<length xs}
inv \<pi> permutes {..<length xs}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length xs}
inv \<pi> permutes {..<length xs}

goal (1 subgoal):
 1. inversions_between (permute_list \<pi> xs) ys = map_prod (inv \<pi>) id ` inversions_between xs ys
[PROOF STEP]
unfolding inversions_between_def map_prod_def
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length xs}
inv \<pi> permutes {..<length xs}

goal (1 subgoal):
 1. {(i, j). (i, j) \<in> {..<length (permute_list \<pi> xs)} \<times> {..<length ys} \<and> ys ! j < permute_list \<pi> xs ! i} = (\<lambda>(x, y). (inv \<pi> x, id y)) ` {(i, j). (i, j) \<in> {..<length xs} \<times> {..<length ys} \<and> ys ! j < xs ! i}
[PROOF STEP]
by (force simp: image_iff permute_list_nth permutes_inverses intro: exI[of _ "\<pi> i" for i])
[PROOF STATE]
proof (state)
this:
inversions_between (permute_list \<pi> xs) ys = map_prod (inv \<pi>) id ` inversions_between xs ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma start_pres_conj: "x \<in> conjunctive \<Longrightarrow> (x ^ *) \<in> conjunctive"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ * \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*)
[PROOF STEP]
apply (subst conjunctive_def, safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ * * (y \<sqinter> z) = x ^ * * y \<sqinter> (x ^ * * z)
[PROOF STEP]
apply (rule order.antisym, simp_all)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ * * (y \<sqinter> z) \<le> x ^ * * y \<and> x ^ * * (y \<sqinter> z) \<le> x ^ * * z
 2. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ * * y \<sqinter> (x ^ * * z) \<le> x ^ * * (y \<sqinter> z)
[PROOF STEP]
apply (metis inf_le1 inf_le2 le_comp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ * * y \<sqinter> (x ^ * * z) \<le> x ^ * * (y \<sqinter> z)
[PROOF STEP]
apply (rule star_greatest)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ * * y \<sqinter> (x ^ * * z) \<le> x * (x ^ * * y \<sqinter> (x ^ * * z)) \<sqinter> (y \<sqinter> z)
[PROOF STEP]
apply (subst conjunctiveD, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ * * y \<sqinter> (x ^ * * z) \<le> x * (x ^ * * y) \<sqinter> (x * (x ^ * * z)) \<sqinter> (y \<sqinter> z)
[PROOF STEP]
apply (subst star_comp_fix)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x * x ^ * * y \<sqinter> y \<sqinter> (x ^ * * z) \<le> x * (x ^ * * y) \<sqinter> (x * (x ^ * * z)) \<sqinter> (y \<sqinter> z)
[PROOF STEP]
apply (subst star_comp_fix)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x * x ^ * * y \<sqinter> y \<sqinter> (x * x ^ * * z \<sqinter> z) \<le> x * (x ^ * * y) \<sqinter> (x * (x ^ * * z)) \<sqinter> (y \<sqinter> z)
[PROOF STEP]
by (metis inf.assoc inf_left_commute mult.assoc order_refl)


[STATEMENT]
lemma permute_list_closed':
  assumes "\<sigma> permutes {..<n}"
  assumes "permute_list \<sigma> a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
apply(rule cartesian_power_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length a = n
 2. set a \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
apply (metis assms(2) cartesian_power_car_memE length_permute_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set a \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
using assms cartesian_power_car_memE'[of "permute_list \<sigma> a" Q\<^sub>p n]
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
permute_list \<sigma> a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
\<lbrakk>permute_list \<sigma> a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>); ?i < n\<rbrakk> \<Longrightarrow> permute_list \<sigma> a ! ?i \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. set a \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
by (metis cartesian_power_car_memE in_set_conv_nth length_permute_list set_permute_list subsetI)


[STATEMENT]
lemma (in Module) mHom_inv:"\<lbrakk>R module N; m \<in> carrier M; f \<in> mHom R M N\<rbrakk> \<Longrightarrow>
                 f (-\<^sub>a m) = -\<^sub>a\<^bsub>N\<^esub> (f m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; m \<in> carrier M; f \<in> mHom R M N\<rbrakk> \<Longrightarrow> f (-\<^sub>a m) = -\<^sub>a\<^bsub>N\<^esub> f m
[PROOF STEP]
apply (cut_tac module_is_ag,
       frule Module.module_is_ag [of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; m \<in> carrier M; f \<in> mHom R M N; aGroup M; aGroup N\<rbrakk> \<Longrightarrow> f (-\<^sub>a m) = -\<^sub>a\<^bsub>N\<^esub> f m
[PROOF STEP]
apply (simp add:mHom_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; m \<in> carrier M; aGroup M; aGroup N; f \<in> aHom M N; \<forall>a\<in>carrier R. \<forall>m\<in>carrier M. f (a \<cdot>\<^sub>s m) = a \<cdot>\<^sub>s\<^bsub>N\<^esub> f m\<rbrakk> \<Longrightarrow> f (-\<^sub>a m) = -\<^sub>a\<^bsub>N\<^esub> f m
[PROOF STEP]
apply (rule aHom_inv_inv, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lincomb_list_alt:
  shows "lincomb_list c s =
    sumlist (map2 (\<lambda>i j. i \<cdot>\<^sub>v s ! j) (map (\<lambda>i. c i) [0..<length s]) [0..<length s])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list c s = M.sumlist (map2 (\<lambda>x y. x \<cdot>\<^sub>v s ! y) (map c [0..<length s]) [0..<length s])
[PROOF STEP]
unfolding lincomb_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. c i \<cdot>\<^sub>v s ! i) [0..<length s]) = M.sumlist (map2 (\<lambda>x y. x \<cdot>\<^sub>v s ! y) (map c [0..<length s]) [0..<length s])
[PROOF STEP]
by (smt length_map map2_map_map map_nth nth_equalityI nth_map)


[STATEMENT]
lemma closedin_Inter[intro]:
  assumes Ke: "K \<noteq> {}"
    and Kc: "\<And>S. S \<in>K \<Longrightarrow> closedin U S"
  shows "closedin U (\<Inter>K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin U (\<Inter> K)
[PROOF STEP]
using Ke Kc
[PROOF STATE]
proof (prove)
using this:
K \<noteq> {}
?S \<in> K \<Longrightarrow> closedin U ?S

goal (1 subgoal):
 1. closedin U (\<Inter> K)
[PROOF STEP]
unfolding closedin_def Diff_Inter
[PROOF STATE]
proof (prove)
using this:
K \<noteq> {}
?S \<in> K \<Longrightarrow> ?S \<subseteq> topspace U \<and> openin U (topspace U - ?S)

goal (1 subgoal):
 1. \<Inter> K \<subseteq> topspace U \<and> openin U (\<Union> {topspace U - s |s. s \<in> K})
[PROOF STEP]
by auto


[STATEMENT]
lemma SUP_comp: "(\<Squnion>(f ` A)) * z = (SUP a \<in> A . (f a) * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (f ` A) * z = (\<Squnion>a\<in>A. f a * z)
[PROOF STEP]
unfolding Sup_comp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>x\<in>f ` A. x * z) = (\<Squnion>a\<in>A. f a * z)
[PROOF STEP]
apply (subgoal_tac "((\<lambda>x::'a. x * z) ` f ` A) = ((\<lambda>a::'b. f a * z) ` A)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. x * z) ` f ` A = (\<lambda>a. f a * z) ` A \<Longrightarrow> (\<Squnion>x\<in>f ` A. x * z) = (\<Squnion>a\<in>A. f a * z)
 2. (\<lambda>x. x * z) ` f ` A = (\<lambda>a. f a * z) ` A
[PROOF STEP]
by auto


[STATEMENT]
lemma d_OUT_diff:
  assumes "\<And>y. g (x, y) \<le> f (x, y)" "d_OUT g x \<noteq> \<top>"
  shows "d_OUT (\<lambda>e. f e - g e) x = d_OUT f x - d_OUT g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>e. f e - g e) x = d_OUT f x - d_OUT g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g (x, ?y) \<le> f (x, ?y)
d_OUT g x \<noteq> \<top>

goal (1 subgoal):
 1. d_OUT (\<lambda>e. f e - g e) x = d_OUT f x - d_OUT g x
[PROOF STEP]
by(simp add: nn_integral_diff d_OUT_def)


[STATEMENT]
lemma eigenvalue_root_char_poly: assumes A: "(A :: 'a :: field mat) \<in> carrier_mat n n"
  shows "eigenvalue A k \<longleftrightarrow> poly (char_poly A) k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigenvalue A k = (poly (char_poly A) k = (0::'a))
[PROOF STEP]
unfolding eigenvalue_det[OF A] char_poly_matrix[OF A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (det (char_matrix A k) = (0::'a)) = (det (- char_matrix A k) = (0::'a))
[PROOF STEP]
by (subst det_0_negate[of _ n], insert A, auto)


[STATEMENT]
lemma minus_closed'[simp]: "\<forall>x\<in>U\<^sub>V\<^sub>S. \<forall>y\<in>U\<^sub>V\<^sub>S. x -\<^sub>V\<^sub>S y \<in> U\<^sub>V\<^sub>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>U\<^sub>V\<^sub>S. \<forall>y\<in>U\<^sub>V\<^sub>S. x -\<^sub>V\<^sub>S y \<in> U\<^sub>V\<^sub>S
[PROOF STEP]
by (simp add: ab_diff_conv_add_uminus add_closed' uminus_closed)


[STATEMENT]
lemma norm_less_p1: "norm x < norm (of_real (norm x) + 1 :: 'a)"
  for x :: "'a::real_normed_algebra_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x < norm (of_real (norm x) + (1::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm x < norm (of_real (norm x) + (1::'a))
[PROOF STEP]
have "norm x < norm (of_real (norm x + 1) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x < norm (of_real (norm x + 1))
[PROOF STEP]
by (simp add: of_real_def)
[PROOF STATE]
proof (state)
this:
norm x < norm (of_real (norm x + 1))

goal (1 subgoal):
 1. norm x < norm (of_real (norm x) + (1::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm x < norm (of_real (norm x + 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm x < norm (of_real (norm x + 1))

goal (1 subgoal):
 1. norm x < norm (of_real (norm x) + (1::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x < norm (of_real (norm x) + (1::'a))

goal:
No subgoals!
[PROOF STEP]
qed


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

goal (1 subgoal):
 1. continuous_on s (\<lambda>x. sgn (f x))
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s)
\<forall>x\<in>s. f x \<noteq> (0::'b)

goal (1 subgoal):
 1. \<forall>x\<in>s. ((\<lambda>x. sgn (f x)) \<longlongrightarrow> sgn (f x)) (at x within s)
[PROOF STEP]
by (blast intro: tendsto_sgn)


[STATEMENT]
lemma norm_summable_moebius_over_square:
  "summable (\<lambda>n. norm (moebius_mu n / real n ^ 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (moebius_mu n / (real n)\<^sup>2))
[PROOF STEP]
proof (subst summable_Suc_iff [symmetric], rule summable_comparison_test)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>N. \<forall>n\<ge>N. norm (norm (moebius_mu (Suc n) / (real (Suc n))\<^sup>2)) \<le> ?g n
 2. summable ?g
[PROOF STEP]
show "summable (\<lambda>n. 1 / real (Suc n) ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. 1 / (real (Suc n))\<^sup>2)
[PROOF STEP]
using inverse_squares_sums
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 / real ((n + 1)\<^sup>2)) sums (pi\<^sup>2 / 6)

goal (1 subgoal):
 1. summable (\<lambda>n. 1 / (real (Suc n))\<^sup>2)
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. 1 / (real (Suc n))\<^sup>2)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (norm (moebius_mu (Suc n) / (real (Suc n))\<^sup>2)) \<le> 1 / (real (Suc n))\<^sup>2
[PROOF STEP]
qed (auto simp del: of_nat_Suc simp: field_simps abs_moebius_mu_le)


[STATEMENT]
lemma vcard_vintersection_left: "vcard (A \<inter>\<^sub>\<circ> B) \<le> vcard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (A \<inter>\<^sub>\<circ> B) \<subseteq>\<^sub>\<circ> vcard A
[PROOF STEP]
by (simp add: vcard_mono)


[STATEMENT]
lemma T_insert_bound:
  assumes "invar ts"
  shows "T_insert x ts \<le> log 2 (size (mset_trees ts) + 1) + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2
[PROOF STEP]
have "real (T_insert x ts) \<le> real (length ts) + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_insert x ts) \<le> real (length ts) + 2
[PROOF STEP]
unfolding T_insert_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_ins_tree (Node 0 x []) ts + 1) \<le> real (length ts) + 2
[PROOF STEP]
using T_ins_tree_simple_bound
[PROOF STATE]
proof (prove)
using this:
T_ins_tree ?t ?ts \<le> length ?ts + 1

goal (1 subgoal):
 1. real (T_ins_tree (Node 0 x []) ts + 1) \<le> real (length ts) + 2
[PROOF STEP]
using of_nat_mono
[PROOF STATE]
proof (prove)
using this:
T_ins_tree ?t ?ts \<le> length ?ts + 1
?i \<le> ?j \<Longrightarrow> of_nat ?i \<le> of_nat ?j

goal (1 subgoal):
 1. real (T_ins_tree (Node 0 x []) ts + 1) \<le> real (length ts) + 2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
real (T_insert x ts) \<le> real (length ts) + 2

goal (1 subgoal):
 1. real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (T_insert x ts) \<le> real (length ts) + 2

goal (1 subgoal):
 1. real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2
[PROOF STEP]
note size_mset_trees[OF \<open>invar ts\<close>]
[PROOF STATE]
proof (state)
this:
real (length ts) \<le> log 2 (real (size (mset_trees ts) + 1))

goal (1 subgoal):
 1. real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> x + 2 \<le> y + 2) \<Longrightarrow> real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x + 2 \<le> y + 2) \<Longrightarrow> real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2

goal (1 subgoal):
 1. real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (T_insert x ts) \<le> log 2 (real (size (mset_trees ts) + 1)) + 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma leadsETo_Trans:
     "[| F \<in> A leadsTo[CC] B;  F \<in> B leadsTo[CC] C |] ==> F \<in> A leadsTo[CC] C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A leadsTo[CC] B; F \<in> B leadsTo[CC] C\<rbrakk> \<Longrightarrow> F \<in> A leadsTo[CC] C
[PROOF STEP]
apply (unfold leadsETo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> {F. (A, B) \<in> elt CC F}; F \<in> {F. (B, C) \<in> elt CC F}\<rbrakk> \<Longrightarrow> F \<in> {F. (A, C) \<in> elt CC F}
[PROOF STEP]
apply (blast intro: elt.Trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma orthogonal_comp_UNIV [simp]: "UNIV\<^sup>\<bottom> = {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV\<^sup>\<bottom> = {0::'a}
[PROOF STEP]
unfolding orthogonal_comp_def orthogonal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<forall>y\<in>UNIV. y \<bullet> x = 0} = {0::'a}
[PROOF STEP]
by auto (use inner_eq_zero_iff in blast)


[STATEMENT]
lemma sqrt_code[code]: "sqrt n = Max (Set.filter (\<lambda>m. m\<^sup>2 \<le> n) {0..n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sqrt n = Max (Set.filter (\<lambda>m. m\<^sup>2 \<le> n) {0..n})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.sqrt n = Max (Set.filter (\<lambda>m. m\<^sup>2 \<le> n) {0..n})
[PROOF STEP]
from power2_nat_le_imp_le [of _ n]
[PROOF STATE]
proof (chain)
picking this:
?m\<^sup>2 \<le> n \<Longrightarrow> ?m \<le> n
[PROOF STEP]
have "{m. m \<le> n \<and> m\<^sup>2 \<le> n} = {m. m\<^sup>2 \<le> n}"
[PROOF STATE]
proof (prove)
using this:
?m\<^sup>2 \<le> n \<Longrightarrow> ?m \<le> n

goal (1 subgoal):
 1. {m. m \<le> n \<and> m\<^sup>2 \<le> n} = {m. m\<^sup>2 \<le> n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{m. m \<le> n \<and> m\<^sup>2 \<le> n} = {m. m\<^sup>2 \<le> n}

goal (1 subgoal):
 1. local.sqrt n = Max (Set.filter (\<lambda>m. m\<^sup>2 \<le> n) {0..n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{m. m \<le> n \<and> m\<^sup>2 \<le> n} = {m. m\<^sup>2 \<le> n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{m. m \<le> n \<and> m\<^sup>2 \<le> n} = {m. m\<^sup>2 \<le> n}

goal (1 subgoal):
 1. local.sqrt n = Max (Set.filter (\<lambda>m. m\<^sup>2 \<le> n) {0..n})
[PROOF STEP]
by (simp add: sqrt_def Set.filter_def)
[PROOF STATE]
proof (state)
this:
local.sqrt n = Max (Set.filter (\<lambda>m. m\<^sup>2 \<le> n) {0..n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem join_mono: "x \<sqsubseteq> z \<Longrightarrow> y \<sqsubseteq> w \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
assume "x \<sqsubseteq> z"
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> z

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<sqsubseteq> z
[PROOF STEP]
have "dual z \<sqsubseteq> dual x"
[PROOF STATE]
proof (prove)
using this:
x \<sqsubseteq> z

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

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dual z \<sqsubseteq> dual x

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
assume "y \<sqsubseteq> w"
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> w

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<sqsubseteq> w
[PROOF STEP]
have "dual w \<sqsubseteq> dual y"
[PROOF STATE]
proof (prove)
using this:
y \<sqsubseteq> w

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

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dual z \<sqsubseteq> dual x
dual w \<sqsubseteq> dual y
[PROOF STEP]
have "dual z \<sqinter> dual w \<sqsubseteq> dual x \<sqinter> dual y"
[PROOF STATE]
proof (prove)
using this:
dual z \<sqsubseteq> dual x
dual w \<sqsubseteq> dual y

goal (1 subgoal):
 1. dual z \<sqinter> dual w \<sqsubseteq> dual x \<sqinter> dual y
[PROOF STEP]
by (rule meet_mono)
[PROOF STATE]
proof (state)
this:
dual z \<sqinter> dual w \<sqsubseteq> dual x \<sqinter> dual y

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dual z \<sqinter> dual w \<sqsubseteq> dual x \<sqinter> dual y
[PROOF STEP]
have "dual (z \<squnion> w) \<sqsubseteq> dual (x \<squnion> y)"
[PROOF STATE]
proof (prove)
using this:
dual z \<sqinter> dual w \<sqsubseteq> dual x \<sqinter> dual y

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

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<squnion> y \<sqsubseteq> z \<squnion> w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dual (z \<squnion> w) \<sqsubseteq> dual (x \<squnion> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dual (z \<squnion> w) \<sqsubseteq> dual (x \<squnion> y)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Opair: "(Opair a b = Opair c d) = (a = c & b = d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Opair a b = Opair c d) = (a = c \<and> b = d)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Opair a b = Opair c d) = (a = c \<and> b = d)
[PROOF STEP]
have fst: "(Opair a b = Opair c d) \<Longrightarrow> a = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Opair a b = Opair c d \<Longrightarrow> a = c
[PROOF STEP]
apply (simp add: Opair_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Upair (Upair a a) (Upair a b) = Upair (Upair c c) (Upair c d) \<Longrightarrow> a = c
[PROOF STEP]
apply (simp add: Ext[where x="Upair (Upair a a) (Upair a b)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z. Elem z (Upair (Upair a a) (Upair a b)) = Elem z (Upair (Upair c c) (Upair c d)) \<Longrightarrow> a = c
[PROOF STEP]
apply (drule spec[where x="Upair a a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Elem (Upair a a) (Upair (Upair a a) (Upair a b)) = Elem (Upair a a) (Upair (Upair c c) (Upair c d)) \<Longrightarrow> a = c
[PROOF STEP]
apply (auto simp add: Upair Upair_singleton)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Opair a b = Opair c d \<Longrightarrow> a = c

goal (1 subgoal):
 1. (Opair a b = Opair c d) = (a = c \<and> b = d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Opair a b = Opair c d) = (a = c \<and> b = d)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Opair a b = Opair c d \<Longrightarrow> a = c
 2. Opair a b = Opair c d \<Longrightarrow> b = d
[PROOF STEP]
apply (erule fst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Opair a b = Opair c d \<Longrightarrow> b = d
[PROOF STEP]
apply (frule fst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Opair a b = Opair c d; a = c\<rbrakk> \<Longrightarrow> b = d
[PROOF STEP]
apply (auto simp add: Opair_def Upair_fsteq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(Opair a b = Opair c d) = (a = c \<and> b = d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Hausdorff_space_discrete_topology [simp]:
   "Hausdorff_space (discrete_topology U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hausdorff_space (discrete_topology U)
[PROOF STEP]
unfolding Hausdorff_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<in> topspace (discrete_topology U) \<and> y \<in> topspace (discrete_topology U) \<and> x \<noteq> y \<longrightarrow> (\<exists>Ua V. openin (discrete_topology U) Ua \<and> openin (discrete_topology U) V \<and> x \<in> Ua \<and> y \<in> V \<and> disjnt Ua V)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> topspace (discrete_topology U); y \<in> topspace (discrete_topology U); x \<noteq> y\<rbrakk> \<Longrightarrow> \<exists>Ua V. openin (discrete_topology U) Ua \<and> openin (discrete_topology U) V \<and> x \<in> Ua \<and> y \<in> V \<and> disjnt Ua V
[PROOF STEP]
by (metis discrete_topology_unique_alt disjnt_empty2 disjnt_insert2 insert_iff mk_disjoint_insert topspace_discrete_topology)


[STATEMENT]
lemma Partition_less:
  assumes "m < k"
  shows "Partition m k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partition m k = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m < k

goal (1 subgoal):
 1. Partition m k = 0
[PROOF STEP]
by (induct m k rule: Partition.induct) auto


[STATEMENT]
lemma lattice_of_append:
  assumes fs: "set fs \<subseteq> carrier_vec n"
  assumes gs: "set gs \<subseteq> carrier_vec n"
  shows "lattice_of (fs @ gs) = lattice_of (gs @ fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (fs @ gs) = lattice_of (gs @ fs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice_of (fs @ gs) = lattice_of (gs @ fs)
[PROOF STEP]
have fsgs: "set (fs @ gs) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fs @ gs) \<subseteq> carrier_vec n
[PROOF STEP]
using fs gs
[PROOF STATE]
proof (prove)
using this:
set fs \<subseteq> carrier_vec n
set gs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. set (fs @ gs) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (fs @ gs) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lattice_of (fs @ gs) = lattice_of (gs @ fs)
[PROOF STEP]
have gsfs: "set (gs @ fs) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (gs @ fs) \<subseteq> carrier_vec n
[PROOF STEP]
using fs gs
[PROOF STATE]
proof (prove)
using this:
set fs \<subseteq> carrier_vec n
set gs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. set (gs @ fs) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (gs @ fs) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lattice_of (fs @ gs) = lattice_of (gs @ fs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (fs @ gs) = lattice_of (gs @ fs)
[PROOF STEP]
unfolding lattice_of_altdef_lincomb[OF fsgs] lattice_of_altdef_lincomb[OF gsfs]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>f. lincomb (of_int \<circ> f) (set (fs @ gs)) = y} = {y. \<exists>f. lincomb (of_int \<circ> f) (set (gs @ fs)) = y}
[PROOF STEP]
by auto (metis Un_commute)+
[PROOF STATE]
proof (state)
this:
lattice_of (fs @ gs) = lattice_of (gs @ fs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSLIM_zero:
  assumes f: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l"
  shows "(\<lambda>x. f(x) - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (0::'b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (0::'b)
[PROOF STEP]
have "(\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l - l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l - l
[PROOF STEP]
by (rule NSLIM_diff [OF f NSLIM_const])
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l - l

goal (1 subgoal):
 1. (\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (0::'b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l - l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l - l

goal (1 subgoal):
 1. (\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_vector_derivative_within_subset:
  "(f has_vector_derivative f') (at x within S) \<Longrightarrow> T \<subseteq> S \<Longrightarrow> (f has_vector_derivative f') (at x within T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_vector_derivative f') (at x within S); T \<subseteq> S\<rbrakk> \<Longrightarrow> (f has_vector_derivative f') (at x within T)
[PROOF STEP]
by (auto simp: has_vector_derivative_def intro: has_derivative_subset)


[STATEMENT]
lemma sum_upper:
  fixes f :: "'i \<Rightarrow> 'a :: ordered_comm_monoid_add"
  assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i"
  shows "(\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I
[PROOF STEP]
have "sum f I = (\<Sum>i \<in> I. if P i then f i else f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f I = (\<Sum>i\<in>I. if P i then f i else f i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f I = (\<Sum>i\<in>I. if P i then f i else f i)

goal (1 subgoal):
 1. (\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I
[PROOF STEP]
hence "sum f I = (\<Sum>i | i \<in> I \<and> P i. f i) + (\<Sum>i | i \<in> I \<and> \<not>P i. f i)"
[PROOF STATE]
proof (prove)
using this:
sum f I = (\<Sum>i\<in>I. if P i then f i else f i)

goal (1 subgoal):
 1. sum f I = (\<Sum>i | i \<in> I \<and> P i. f i) + (\<Sum>i | i \<in> I \<and> \<not> P i. f i)
[PROOF STEP]
by (simp only: sum_split[OF \<open>finite I\<close>])
[PROOF STATE]
proof (state)
this:
sum f I = (\<Sum>i | i \<in> I \<and> P i. f i) + (\<Sum>i | i \<in> I \<and> \<not> P i. f i)

goal (1 subgoal):
 1. (\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum f I = (\<Sum>i | i \<in> I \<and> P i. f i) + (\<Sum>i | i \<in> I \<and> \<not> P i. f i)

goal (1 subgoal):
 1. (\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I
[PROOF STEP]
have "0 \<le> (\<Sum>i | i \<in> I \<and> \<not>P i. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> (\<Sum>i | i \<in> I \<and> \<not> P i. f i)
[PROOF STEP]
by (rule sum_nonneg) (simp add: assms)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> (\<Sum>i | i \<in> I \<and> \<not> P i. f i)

goal (1 subgoal):
 1. (\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum f I = (\<Sum>i | i \<in> I \<and> P i. f i) + (\<Sum>i | i \<in> I \<and> \<not> P i. f i)
(0::'a) \<le> (\<Sum>i | i \<in> I \<and> \<not> P i. f i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f I = (\<Sum>i | i \<in> I \<and> P i. f i) + (\<Sum>i | i \<in> I \<and> \<not> P i. f i)
(0::'a) \<le> (\<Sum>i | i \<in> I \<and> \<not> P i. f i)

goal (1 subgoal):
 1. (\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I
[PROOF STEP]
by (metis (full_types) add.comm_neutral add_left_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>i | i \<in> I \<and> P i. f i) \<le> sum f I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_neq_0_inv:
  assumes fin_A: "finite {x. h x (f x) (g x) \<noteq> 0}" and fin_B: "finite {x. f x \<noteq> 0}" and "\<And>x y. h x 0 y = y"
  shows "finite {x. g x \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. g x \<noteq> (0::'b)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {x. g x \<noteq> (0::'b)}
[PROOF STEP]
from fin_A and fin_B
[PROOF STATE]
proof (chain)
picking this:
finite {x. h x (f x) (g x) \<noteq> (0::'b)}
finite {x. f x \<noteq> (0::'c)}
[PROOF STEP]
have "finite ({x. h x (f x) (g x) \<noteq> 0} \<union> {x. f x \<noteq> 0})"
[PROOF STATE]
proof (prove)
using this:
finite {x. h x (f x) (g x) \<noteq> (0::'b)}
finite {x. f x \<noteq> (0::'c)}

goal (1 subgoal):
 1. finite ({x. h x (f x) (g x) \<noteq> (0::'b)} \<union> {x. f x \<noteq> (0::'c)})
[PROOF STEP]
by (intro finite_UnI)
[PROOF STATE]
proof (state)
this:
finite ({x. h x (f x) (g x) \<noteq> (0::'b)} \<union> {x. f x \<noteq> (0::'c)})

goal (1 subgoal):
 1. finite {x. g x \<noteq> (0::'b)}
[PROOF STEP]
hence finite_union: "finite {x. (h x (f x) (g x) \<noteq> 0) \<or> f x \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
finite ({x. h x (f x) (g x) \<noteq> (0::'b)} \<union> {x. f x \<noteq> (0::'c)})

goal (1 subgoal):
 1. finite {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}
[PROOF STEP]
by (simp only: Collect_disj_eq)
[PROOF STATE]
proof (state)
this:
finite {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}

goal (1 subgoal):
 1. finite {x. g x \<noteq> (0::'b)}
[PROOF STEP]
have "{x. g x \<noteq> 0} \<subseteq> {x. (h x (f x) (g x) \<noteq> 0) \<or> f x \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. g x \<noteq> (0::'b)} \<subseteq> {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}
[PROOF STEP]
by (intro Collect_mono, rule, rule disjCI, simp add: assms(3))
[PROOF STATE]
proof (state)
this:
{x. g x \<noteq> (0::'b)} \<subseteq> {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}

goal (1 subgoal):
 1. finite {x. g x \<noteq> (0::'b)}
[PROOF STEP]
from this finite_union
[PROOF STATE]
proof (chain)
picking this:
{x. g x \<noteq> (0::'b)} \<subseteq> {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}
finite {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}
[PROOF STEP]
show "finite {x. g x \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
{x. g x \<noteq> (0::'b)} \<subseteq> {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}
finite {x. h x (f x) (g x) \<noteq> (0::'b) \<or> f x \<noteq> (0::'c)}

goal (1 subgoal):
 1. finite {x. g x \<noteq> (0::'b)}
[PROOF STEP]
by (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite {x. g x \<noteq> (0::'b)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_bounded_clinear:
  fixes  A :: \<open>'b::complex_normed_vector \<Rightarrow> 'c::complex_normed_vector\<close>
    and B :: \<open>'a::complex_normed_vector \<Rightarrow> 'b\<close>
  assumes \<open>bounded_clinear A\<close> and \<open>bounded_clinear B\<close>
  shows \<open>bounded_clinear (A \<circ> B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear (A \<circ> B)
[PROOF STEP]
by (metis clinear_compose assms(1) assms(2) bounded_clinear_axioms_def bounded_clinear_compose bounded_clinear_def o_def)


[STATEMENT]
lemma cot_pi [simp]: "cot pi = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cot pi = 0
[PROOF STEP]
by (simp add: cot_def)


[STATEMENT]
lemma mignotte_helper_coeff:
  "cmod (coeff h i) \<le> (degree h - 1 choose i) * mahler_measure_poly h
      + min i 1 * (degree h - 1 choose (i - 1)) * cmod (lead_coeff h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
let ?r = "complex_roots_complex h"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
have "cmod (coeff h i) = cmod (coeff (smult (lead_coeff h) (\<Prod>a\<leftarrow>?r. [:- a, 1:])) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (poly.coeff h i) = cmod (poly.coeff (Polynomial.smult (lead_coeff h) (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:])) i)
[PROOF STEP]
unfolding complex_roots
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (poly.coeff h i) = cmod (poly.coeff h i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (poly.coeff h i) = cmod (poly.coeff (Polynomial.smult (lead_coeff h) (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:])) i)

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (poly.coeff h i) = cmod (poly.coeff (Polynomial.smult (lead_coeff h) (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:])) i)

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
have "\<dots> = cmod (lead_coeff h) * cmod (coeff (\<Prod>a\<leftarrow>?r. [:- a, 1:]) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (poly.coeff (Polynomial.smult (lead_coeff h) (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:])) i) = cmod (lead_coeff h) * cmod (poly.coeff (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:]) i)
[PROOF STEP]
by(simp add:norm_mult)
[PROOF STATE]
proof (state)
this:
cmod (poly.coeff (Polynomial.smult (lead_coeff h) (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:])) i) = cmod (lead_coeff h) * cmod (poly.coeff (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:]) i)

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (poly.coeff (Polynomial.smult (lead_coeff h) (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:])) i) = cmod (lead_coeff h) * cmod (poly.coeff (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:]) i)

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
have "\<dots> \<le> cmod (lead_coeff h) * ((degree h - 1 choose i) * mahler_measure_monic h +
    (min i 1 * ((degree h - 1) choose nat (int i - 1))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (lead_coeff h) * cmod (poly.coeff (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:]) i) \<le> cmod (lead_coeff h) * (real (degree h - 1 choose i) * mahler_measure_monic h + real (min i 1 * (degree h - 1 choose nat (int i - 1))))
[PROOF STEP]
unfolding mahler_measure_monic_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (lead_coeff h) * cmod (poly.coeff (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:]) i) \<le> cmod (lead_coeff h) * (real (degree h - 1 choose i) * (\<Prod>a\<leftarrow>complex_roots_complex h. max 1 (cmod a)) + real (min i 1 * (degree h - 1 choose nat (int i - 1))))
[PROOF STEP]
by (rule mult_left_mono, insert mignotte_helper_coeff_int'[of ?r i], auto)
[PROOF STATE]
proof (state)
this:
cmod (lead_coeff h) * cmod (poly.coeff (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:]) i) \<le> cmod (lead_coeff h) * (real (degree h - 1 choose i) * mahler_measure_monic h + real (min i 1 * (degree h - 1 choose nat (int i - 1))))

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (lead_coeff h) * cmod (poly.coeff (\<Prod>a\<leftarrow>complex_roots_complex h. [:- a, 1:]) i) \<le> cmod (lead_coeff h) * (real (degree h - 1 choose i) * mahler_measure_monic h + real (min i 1 * (degree h - 1 choose nat (int i - 1))))

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
have "\<dots> = (degree h - 1 choose i) * mahler_measure_poly h + cmod (lead_coeff h) * (
    min i 1 * ((degree h - 1) choose nat (int i - 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (lead_coeff h) * (real (degree h - 1 choose i) * mahler_measure_monic h + real (min i 1 * (degree h - 1 choose nat (int i - 1)))) = real (degree h - 1 choose i) * mahler_measure_poly h + cmod (lead_coeff h) * real (min i 1 * (degree h - 1 choose nat (int i - 1)))
[PROOF STEP]
unfolding mahler_measure_poly_via_monic
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (lead_coeff h) * (real (degree h - 1 choose i) * mahler_measure_monic h + real (min i 1 * (degree h - 1 choose nat (int i - 1)))) = real (degree h - 1 choose i) * (cmod (lead_coeff h) * mahler_measure_monic h) + cmod (lead_coeff h) * real (min i 1 * (degree h - 1 choose nat (int i - 1)))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
cmod (lead_coeff h) * (real (degree h - 1 choose i) * mahler_measure_monic h + real (min i 1 * (degree h - 1 choose nat (int i - 1)))) = real (degree h - 1 choose i) * mahler_measure_poly h + cmod (lead_coeff h) * real (min i 1 * (degree h - 1 choose nat (int i - 1)))

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (lead_coeff h) * (real (degree h - 1 choose i) * mahler_measure_monic h + real (min i 1 * (degree h - 1 choose nat (int i - 1)))) = real (degree h - 1 choose i) * mahler_measure_poly h + cmod (lead_coeff h) * real (min i 1 * (degree h - 1 choose nat (int i - 1)))

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
have "nat (int i - 1) = i - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat (int i - 1) = i - 1
[PROOF STEP]
by (cases i, auto)
[PROOF STATE]
proof (state)
this:
nat (int i - 1) = i - 1

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + cmod (lead_coeff h) * real (min i 1 * (degree h - 1 choose (i - 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + cmod (lead_coeff h) * real (min i 1 * (degree h - 1 choose (i - 1)))

goal (1 subgoal):
 1. cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)
[PROOF STEP]
by (simp add: ac_simps split: if_splits)
[PROOF STATE]
proof (state)
this:
cmod (poly.coeff h i) \<le> real (degree h - 1 choose i) * mahler_measure_poly h + real (min i 1 * (degree h - 1 choose (i - 1))) * cmod (lead_coeff h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_sum_univ_singleton: "(sum g UNIV) = sum g {i::'a::finite} + sum g (UNIV - {i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g UNIV = sum g {i} + sum g (UNIV - {i})
[PROOF STEP]
by (metis add.commute finite_class.finite_UNIV sum.subset_diff top_greatest)


[STATEMENT]
lemma enat_mult_minus_distrib: "enat x * (y - z) = enat x * y - enat x * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat x * (y - z) = enat x * y - enat x * z
[PROOF STEP]
by (cases y; cases z; auto simp: enat_0 right_diff_distrib')


[STATEMENT]
lemma (in PolynRg) polyn_add_n:"\<lbrakk>pol_coeff S (n, f); pol_coeff S (n, g)\<rbrakk> \<Longrightarrow>
      (polyn_expr R X n (n, f)) \<plusminus> (polyn_expr R X n (n, g)) =
           nsum R (\<lambda>j. ((f j) \<plusminus>\<^bsub>S\<^esub> (g j)) \<cdot>\<^sub>r (X^\<^bsup>R j\<^esup>)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pol_coeff S (n, f); pol_coeff S (n, g)\<rbrakk> \<Longrightarrow> polyn_expr R X n (n, f) \<plusminus> polyn_expr R X n (n, g) = \<Sigma>\<^sub>e R (\<lambda>j. (f j \<plusminus>\<^bsub>S\<^esub> g j) \<cdot>\<^sub>r X^\<^bsup>R j\<^esup>) n
[PROOF STEP]
by (simp add:polyn_addTr)


[STATEMENT]
lemma max_input_Eq:
  "max_input (Eq a1 a2) = max (AExp.max_input a1) (AExp.max_input a2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GExp.max_input (Eq a1 a2) = max (AExp.max_input a1) (AExp.max_input a2)
[PROOF STEP]
apply (simp add: AExp.max_input_def max_input_def Let_def max_absorb2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enumerate_aexp_inputs a1 \<noteq> {} \<longrightarrow> enumerate_aexp_inputs a2 \<noteq> {} \<longrightarrow> Some (Max (enumerate_aexp_inputs a1 \<union> enumerate_aexp_inputs a2)) = max (Some (Max (enumerate_aexp_inputs a1))) (Some (Max (enumerate_aexp_inputs a2)))
[PROOF STEP]
by (metis List.finite_set Max.union bot_option_def enumerate_aexp_inputs_not_empty max_bot2 sup_Some sup_max)


[STATEMENT]
lemma closed_map_snd:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "compact S" "closedin (top_of_set (S \<times> T)) c"
   shows "closedin (top_of_set T) (snd ` c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) (snd ` c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin (top_of_set T) (snd ` c)
[PROOF STEP]
have *: "snd ` (S \<times> T) \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd ` (S \<times> T) \<subseteq> T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
snd ` (S \<times> T) \<subseteq> T

goal (1 subgoal):
 1. closedin (top_of_set T) (snd ` c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) (snd ` c)
[PROOF STEP]
using proper_map [OF _ _ *]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closedin (top_of_set (S \<times> T)) ?K; \<And>U. \<lbrakk>U \<subseteq> T; compact U\<rbrakk> \<Longrightarrow> compact (S \<times> T \<inter> snd -` U)\<rbrakk> \<Longrightarrow> closedin (top_of_set T) (snd ` ?K)

goal (1 subgoal):
 1. closedin (top_of_set T) (snd ` c)
[PROOF STEP]
by (simp add: proper_map_snd assms)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set T) (snd ` c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma up_filter_dist_sup:
  "up_filter ((x::'a::lattice) \<squnion> y) = up_filter x \<sqinter> up_filter y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. up_filter (x \<squnion> y) = up_filter x \<sqinter> up_filter y
[PROOF STEP]
by (metis eq_onp_def inf_filter.abs_eq up_dist_sup up_filter)


[STATEMENT]
lemma not_nonzero_iff: "\<not> nonzero x \<longleftrightarrow> x = zeroes (length x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> nonzero x) = (x = zeroes (length x))
[PROOF STEP]
by (auto simp: nonzero_iff replicate_length_same eq_0_iff)


[STATEMENT]
lemma ordinal_times_left_cancel_less [simp]:
"0 < w \<Longrightarrow> (w * x < w * y) = (x < (y::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < w \<Longrightarrow> (w * x < w * y) = (x < y)
[PROOF STEP]
by (rule normal.cancel_less[OF normal_times])


[STATEMENT]
lemma Im_power_real [simp]: "Im x = 0 \<Longrightarrow> Im (x ^ n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im x = 0 \<Longrightarrow> Im (x ^ n) = 0
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma solve_system_imp_is_solution:
  fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
  assumes xAb: "is_solution x (fst (solve_system A b)) (snd (solve_system A b))"
  shows "is_solution x A b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
have "fst (solve_system A b) *v x = snd (solve_system A b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (solve_system A b) *v x = snd (solve_system A b)
[PROOF STEP]
using xAb
[PROOF STATE]
proof (prove)
using this:
is_solution x (fst (solve_system A b)) (snd (solve_system A b))

goal (1 subgoal):
 1. fst (solve_system A b) *v x = snd (solve_system A b)
[PROOF STEP]
unfolding is_solution_def
[PROOF STATE]
proof (prove)
using this:
fst (solve_system A b) *v x = snd (solve_system A b)

goal (1 subgoal):
 1. fst (solve_system A b) *v x = snd (solve_system A b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fst (solve_system A b) *v x = snd (solve_system A b)

goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
hence "snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b"
[PROOF STATE]
proof (prove)
using this:
fst (solve_system A b) *v x = snd (solve_system A b)

goal (1 subgoal):
 1. snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b
[PROOF STEP]
unfolding solve_system_def Let_def fst_conv snd_conv
[PROOF STATE]
proof (prove)
using this:
snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
hence "(fst (Gauss_Jordan_PA A) ** A) *v x = fst (Gauss_Jordan_PA A) *v b"
[PROOF STATE]
proof (prove)
using this:
snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. fst (Gauss_Jordan_PA A) ** A *v x = fst (Gauss_Jordan_PA A) *v b
[PROOF STEP]
unfolding fst_Gauss_Jordan_PA
[PROOF STATE]
proof (prove)
using this:
snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. snd (Gauss_Jordan_PA A) *v x = fst (Gauss_Jordan_PA A) *v b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_PA A) ** A *v x = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
hence "fst (Gauss_Jordan_PA A) *v (A *v x) = fst (Gauss_Jordan_PA A) *v b"
[PROOF STATE]
proof (prove)
using this:
fst (Gauss_Jordan_PA A) ** A *v x = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. fst (Gauss_Jordan_PA A) *v (A *v x) = fst (Gauss_Jordan_PA A) *v b
[PROOF STEP]
unfolding matrix_vector_mul_assoc
[PROOF STATE]
proof (prove)
using this:
fst (Gauss_Jordan_PA A) ** A *v x = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. fst (Gauss_Jordan_PA A) ** A *v x = fst (Gauss_Jordan_PA A) *v b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_PA A) *v (A *v x) = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
hence "matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v (A *v x))
  = matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v b)"
[PROOF STATE]
proof (prove)
using this:
fst (Gauss_Jordan_PA A) *v (A *v x) = fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v (A *v x)) = matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v (A *v x)) = matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v b)

goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
hence "(A *v x) = b"
[PROOF STATE]
proof (prove)
using this:
matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v (A *v x)) = matrix_inv (fst (Gauss_Jordan_PA A)) *v (fst (Gauss_Jordan_PA A) *v b)

goal (1 subgoal):
 1. A *v x = b
[PROOF STEP]
unfolding matrix_vector_mul_assoc[of "matrix_inv (fst (Gauss_Jordan_PA A))"]
[PROOF STATE]
proof (prove)
using this:
matrix_inv (fst (Gauss_Jordan_PA A)) ** fst (Gauss_Jordan_PA A) *v (A *v x) = matrix_inv (fst (Gauss_Jordan_PA A)) ** fst (Gauss_Jordan_PA A) *v b

goal (1 subgoal):
 1. A *v x = b
[PROOF STEP]
unfolding matrix_inv_left[OF invertible_fst_Gauss_Jordan_PA]
[PROOF STATE]
proof (prove)
using this:
mat (1::'a) *v (A *v x) = mat (1::'a) *v b

goal (1 subgoal):
 1. A *v x = b
[PROOF STEP]
unfolding matrix_vector_mul_lid
[PROOF STATE]
proof (prove)
using this:
A *v x = b

goal (1 subgoal):
 1. A *v x = b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A *v x = b

goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A *v x = b

goal (1 subgoal):
 1. is_solution x A b
[PROOF STEP]
unfolding is_solution_def
[PROOF STATE]
proof (prove)
using this:
A *v x = b

goal (1 subgoal):
 1. A *v x = b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
is_solution x A b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Pring_is_cring:
  assumes "cring R"
  shows "cring (Pring R I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring (Pring R I)
[PROOF STEP]
apply(rule cringI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. abelian_group (Pring R I)
 2. Group.comm_monoid (Pring R I)
 3. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>Pring R I\<^esub> y) \<otimes>\<^bsub>Pring R I\<^esub> z = x \<otimes>\<^bsub>Pring R I\<^esub> z \<oplus>\<^bsub>Pring R I\<^esub> y \<otimes>\<^bsub>Pring R I\<^esub> z
[PROOF STEP]
apply (simp add: Pring_is_abelian_group)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Group.comm_monoid (Pring R I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>Pring R I\<^esub> y) \<otimes>\<^bsub>Pring R I\<^esub> z = x \<otimes>\<^bsub>Pring R I\<^esub> z \<oplus>\<^bsub>Pring R I\<^esub> y \<otimes>\<^bsub>Pring R I\<^esub> z
[PROOF STEP]
apply (simp add: Pring_is_monoid assms local.ring_axioms
          monoid.monoid_comm_monoidI ring.Pring_mult_comm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>Pring R I\<^esub> y) \<otimes>\<^bsub>Pring R I\<^esub> z = x \<otimes>\<^bsub>Pring R I\<^esub> z \<oplus>\<^bsub>Pring R I\<^esub> y \<otimes>\<^bsub>Pring R I\<^esub> z
[PROOF STEP]
by (simp add: Pring_mult_ldistr)


[STATEMENT]
lemma (in aGroup) nt_mult_pm:"\<lbrakk>a \<in> carrier A; 0 \<le> m; n < 0\<rbrakk> \<Longrightarrow>
                        m\<triangleright>(n\<triangleright>a\<^bsub>A\<^esub>)\<^bsub>A\<^esub> = (m * n)\<triangleright>a\<^bsub>A\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> m; n < 0\<rbrakk> \<Longrightarrow> m\<triangleright>n\<triangleright>a\<^bsub>A\<^esub>\<^bsub>A\<^esub> = (m * n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (frule zmult_zle_mono1_neg [of "0" "m" "n"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> m; n < 0\<rbrakk> \<Longrightarrow> n \<le> 0
 2. \<lbrakk>a \<in> carrier A; 0 \<le> m; n < 0; m * n \<le> 0 * n\<rbrakk> \<Longrightarrow> m\<triangleright>n\<triangleright>a\<^bsub>A\<^esub>\<^bsub>A\<^esub> = (m * n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (simp add:zless_imp_zle, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> m; n < 0; m * n \<le> 0\<rbrakk> \<Longrightarrow> m\<triangleright>n\<triangleright>a\<^bsub>A\<^esub>\<^bsub>A\<^esub> = (m * n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (simp add:sprod_n_a_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> m; n < 0; m * n \<le> 0\<rbrakk> \<Longrightarrow> m \<noteq> 0 \<longrightarrow> aSum A (nat m) (aSum A (nat (- n)) (-\<^sub>a a)) = aSum A (nat (- (m * n))) (-\<^sub>a a)
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> m; n < 0; m * n \<le> 0; m \<noteq> 0\<rbrakk> \<Longrightarrow> aSum A (nat m) (aSum A (nat (- n)) (-\<^sub>a a)) = aSum A (nat (- (m * n))) (-\<^sub>a a)
[PROOF STEP]
apply (simp add: asum_multTr_pm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Im_Ln_eq_0: "z \<noteq> 0 \<Longrightarrow> (Im(Ln z) = 0 \<longleftrightarrow> 0 < Re(z) \<and> Im(z) = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> (Im (Ln z) = 0) = (0 < Re z \<and> Im z = 0)
[PROOF STEP]
using Im_Ln_pos_le Im_Ln_pos_lt Re_Ln_pos_lt
[PROOF STATE]
proof (prove)
using this:
?z \<noteq> 0 \<Longrightarrow> (0 \<le> Im (Ln ?z) \<and> Im (Ln ?z) \<le> pi) = (0 \<le> Im ?z)
?z \<noteq> 0 \<Longrightarrow> (0 < Im (Ln ?z) \<and> Im (Ln ?z) < pi) = (0 < Im ?z)
?z \<noteq> 0 \<Longrightarrow> (\<bar>Im (Ln ?z)\<bar> < pi / 2) = (0 < Re ?z)

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> (Im (Ln z) = 0) = (0 < Re z \<and> Im z = 0)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma min_ennreal: "0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> min (ennreal x) (ennreal y) = ennreal (min x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 \<le> y\<rbrakk> \<Longrightarrow> min (ennreal x) (ennreal y) = ennreal (min x y)
[PROOF STEP]
by (auto split: split_min)


[STATEMENT]
theorem Von_Neumann_Morgenstern_Utility_Theorem:
  assumes fnt: "finite outcomes" and "outcomes \<noteq> {}"
  shows "rational_preference (lotteries_on outcomes) \<R> \<and>
         independent_vnm (lotteries_on outcomes) \<R> \<and>
         continuous_vnm (lotteries_on outcomes) \<R> \<longleftrightarrow>
   (\<exists>u. ordinal_utility (lotteries_on outcomes) \<R> (\<lambda>x. measure_pmf.expectation x u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rational_preference (\<P> outcomes) \<R> \<and> independent_vnm (\<P> outcomes) \<R> \<and> continuous_vnm (\<P> outcomes) \<R>) = (\<exists>u. ordinal_utility (\<P> outcomes) \<R> (\<lambda>x. measure_pmf.expectation x u))
[PROOF STEP]
using vNM_utility_implies_independence[OF assms, of \<R>]
    system_U_implies_vNM_utility[OF assms, of \<R>]
    vNM_utilty_implies_continuity[OF assms, of \<R>]
    ordinal_util_imp_rat_prefs[of "lotteries_on outcomes" \<R>]
[PROOF STATE]
proof (prove)
using this:
\<exists>u. ordinal_utility (\<P> outcomes) \<R> (\<lambda>x. measure_pmf.expectation x u) \<Longrightarrow> independent_vnm (\<P> outcomes) \<R>
\<lbrakk>rational_preference (\<P> outcomes) \<R>; independent_vnm (\<P> outcomes) \<R>; continuous_vnm (\<P> outcomes) \<R>\<rbrakk> \<Longrightarrow> \<exists>u. ordinal_utility (\<P> outcomes) \<R> (\<lambda>x. measure_pmf.expectation x u)
\<exists>u. ordinal_utility (\<P> outcomes) \<R> (\<lambda>x. measure_pmf.expectation x u) \<Longrightarrow> continuous_vnm (\<P> outcomes) \<R>
ordinal_utility (\<P> outcomes) \<R> ?u \<Longrightarrow> rational_preference (\<P> outcomes) \<R>

goal (1 subgoal):
 1. (rational_preference (\<P> outcomes) \<R> \<and> independent_vnm (\<P> outcomes) \<R> \<and> continuous_vnm (\<P> outcomes) \<R>) = (\<exists>u. ordinal_utility (\<P> outcomes) \<R> (\<lambda>x. measure_pmf.expectation x u))
[PROOF STEP]
by auto