[STATEMENT]
lemma det_minor_col: "det (minor B i j) = det (upd_col B j (axis i 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (minor B i j) = Square_Matrix.det (upd_col B j (axis i (1::'a)))
[PROOF STEP]
using det_minor_row[of "transpose B" j i]
[PROOF STATE]
proof (prove)
using this:
Square_Matrix.det (minor (Square_Matrix.transpose B) j i) = Square_Matrix.det (upd_row (Square_Matrix.transpose B) j (axis i (1::'a)))

goal (1 subgoal):
 1. Square_Matrix.det (minor B i j) = Square_Matrix.det (upd_col B j (axis i (1::'a)))
[PROOF STEP]
by (simp add: minor_transpose det_transpose upd_row_transpose)


[STATEMENT]
lemma span_def: "span S = subspace hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span S = subspace hull S
[PROOF STEP]
by (intro hull_unique[symmetric] span_superset subspace_span span_minimal)


[STATEMENT]
lemma eventually_at_right_field_le:
  "eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y \<le> b \<longrightarrow> P y)"
  for x :: "'a::{linordered_field, linorder_topology}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (at_right x) = (\<exists>b>x. \<forall>y>x. y \<le> b \<longrightarrow> P y)
[PROOF STEP]
by (smt dense eventually_at_right_field le_less_trans less_le_not_le order.strict_trans1)


[STATEMENT]
lemma tan_bound_pi2: "\<bar>x\<bar> < pi/4 \<Longrightarrow> \<bar>tan x\<bar> < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> < pi / 4 \<Longrightarrow> \<bar>tan x\<bar> < 1
[PROOF STEP]
using tan_45 tan_monotone [of x "pi/4"] tan_monotone [of "-x" "pi/4"]
[PROOF STATE]
proof (prove)
using this:
tan (pi / 4) = 1
\<lbrakk>- (pi / 2) < x; x < pi / 4; pi / 4 < pi / 2\<rbrakk> \<Longrightarrow> tan x < tan (pi / 4)
\<lbrakk>- (pi / 2) < - x; - x < pi / 4; pi / 4 < pi / 2\<rbrakk> \<Longrightarrow> tan (- x) < tan (pi / 4)

goal (1 subgoal):
 1. \<bar>x\<bar> < pi / 4 \<Longrightarrow> \<bar>tan x\<bar> < 1
[PROOF STEP]
by (auto simp: abs_if split: if_split_asm)


[STATEMENT]
lemma filterlim_uminus_at_top: "(LIM x F. f x :> at_top) \<longleftrightarrow> (LIM x F. - (f x) :: real :> at_bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F = (LIM x F. - f x :> at_bot)
[PROOF STEP]
using filterlim_compose[OF filterlim_uminus_at_bot_at_top, of f F]
    and filterlim_compose[OF filterlim_uminus_at_top_at_bot, of "\<lambda>x. - f x" F]
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F \<Longrightarrow> LIM x F. - f x :> at_bot
LIM x F. - f x :> at_bot \<Longrightarrow> LIM x F. - (- f x) :> at_top

goal (1 subgoal):
 1. filterlim f at_top F = (LIM x F. - f x :> at_bot)
[PROOF STEP]
by auto


[STATEMENT]
lemma connected_diff_ball:
    fixes S :: "'a :: euclidean_space set"
    assumes "connected S" "cball a r \<subseteq> S" "2 \<le> DIM('a)"
      shows "connected (S - ball a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (S - ball a r)
[PROOF STEP]
proof (rule connected_diff_open_from_closed [OF ball_subset_cball])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. cball a r \<subseteq> S
 2. open (ball a r)
 3. closed (cball a r)
 4. connected S
 5. connected (cball a r - ball a r)
[PROOF STEP]
show "connected (cball a r - ball a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (cball a r - ball a r)
[PROOF STEP]
using assms connected_sphere
[PROOF STATE]
proof (prove)
using this:
connected S
cball a r \<subseteq> S
2 \<le> DIM('a)
2 \<le> DIM(?'a) \<Longrightarrow> connected (sphere ?a ?r)

goal (1 subgoal):
 1. connected (cball a r - ball a r)
[PROOF STEP]
by (auto simp: cball_diff_eq_sphere)
[PROOF STATE]
proof (state)
this:
connected (cball a r - ball a r)

goal (4 subgoals):
 1. cball a r \<subseteq> S
 2. open (ball a r)
 3. closed (cball a r)
 4. connected S
[PROOF STEP]
qed (auto simp: assms dist_norm)


[STATEMENT]
lemma rank_le_nrows:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  shows "rank A \<le> nrows A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A \<le> nrows A
[PROOF STEP]
unfolding rank_eq_dim_col_space nrows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) \<le> CARD('m)
[PROOF STEP]
by (metis top_greatest vec.dim_subset vec_dim_card)


[STATEMENT]
lemma simply_connected_eq_homotopic_paths:
  fixes S :: "_::real_normed_vector set"
  shows "simply_connected S \<longleftrightarrow>
          path_connected S \<and>
          (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and>
                path q \<and> path_image q \<subseteq> S \<and>
                pathstart q = pathstart p \<and> pathfinish q = pathfinish p
                \<longrightarrow> homotopic_paths S p q)"
         (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S = (path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q)
 2. path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q) \<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 q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q)
 2. path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q) \<Longrightarrow> simply_connected S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
simply_connected S
[PROOF STEP]
have pc: "path_connected S"
        and *:  "\<And>p. \<lbrakk>path p; path_image p \<subseteq> S;
                       pathfinish p = pathstart p\<rbrakk>
                      \<Longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))"
[PROOF STATE]
proof (prove)
using this:
simply_connected S

goal (1 subgoal):
 1. path_connected S &&& (\<And>p. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p\<rbrakk> \<Longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))
[PROOF STEP]
by (auto simp: simply_connected_eq_contractible_path)
[PROOF STATE]
proof (state)
this:
path_connected S
\<lbrakk>path ?p; path_image ?p \<subseteq> S; pathfinish ?p = pathstart ?p\<rbrakk> \<Longrightarrow> homotopic_paths S ?p (linepath (pathstart ?p) (pathstart ?p))

goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q)
 2. path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q) \<Longrightarrow> simply_connected S
[PROOF STEP]
have "homotopic_paths S p q"
        if "path p" "path_image p \<subseteq> S" "path q"
           "path_image q \<subseteq> S" "pathstart q = pathstart p"
           "pathfinish q = pathfinish p" for p q
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
have "homotopic_paths S p (p +++ linepath (pathfinish p) (pathfinish p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths S p (p +++ linepath (pathfinish p) (pathfinish p))
[PROOF STEP]
by (simp add: homotopic_paths_rid homotopic_paths_sym that)
[PROOF STATE]
proof (state)
this:
homotopic_paths S p (p +++ linepath (pathfinish p) (pathfinish p))

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
homotopic_paths S p (p +++ linepath (pathfinish p) (pathfinish p))

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
have "homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p))
                                 (p +++ reversepath q +++ q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p)) (p +++ reversepath q +++ q)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
path p
path_image p \<subseteq> S
path q
path_image q \<subseteq> S
pathstart q = pathstart p
pathfinish q = pathfinish p

goal (1 subgoal):
 1. homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p)) (p +++ reversepath q +++ q)
[PROOF STEP]
by (metis homotopic_paths_join homotopic_paths_linv homotopic_paths_refl homotopic_paths_sym_eq pathstart_linepath)
[PROOF STATE]
proof (state)
this:
homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p)) (p +++ reversepath q +++ q)

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p)) (p +++ reversepath q +++ q)

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
have "homotopic_paths S (p +++ reversepath q +++ q)
                                 ((p +++ reversepath q) +++ q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths S (p +++ reversepath q +++ q) ((p +++ reversepath q) +++ q)
[PROOF STEP]
by (simp add: that homotopic_paths_assoc)
[PROOF STATE]
proof (state)
this:
homotopic_paths S (p +++ reversepath q +++ q) ((p +++ reversepath q) +++ q)

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
homotopic_paths S (p +++ reversepath q +++ q) ((p +++ reversepath q) +++ q)

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
have "homotopic_paths S ((p +++ reversepath q) +++ q)
                                 (linepath (pathstart q) (pathstart q) +++ q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths S ((p +++ reversepath q) +++ q) (linepath (pathstart q) (pathstart q) +++ q)
[PROOF STEP]
using * [of "p +++ reversepath q"] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path (p +++ reversepath q); path_image (p +++ reversepath q) \<subseteq> S; pathfinish (p +++ reversepath q) = pathstart (p +++ reversepath q)\<rbrakk> \<Longrightarrow> homotopic_paths S (p +++ reversepath q) (linepath (pathstart (p +++ reversepath q)) (pathstart (p +++ reversepath q)))
path p
path_image p \<subseteq> S
path q
path_image q \<subseteq> S
pathstart q = pathstart p
pathfinish q = pathfinish p

goal (1 subgoal):
 1. homotopic_paths S ((p +++ reversepath q) +++ q) (linepath (pathstart q) (pathstart q) +++ q)
[PROOF STEP]
by (simp add: homotopic_paths_join path_image_join)
[PROOF STATE]
proof (state)
this:
homotopic_paths S ((p +++ reversepath q) +++ q) (linepath (pathstart q) (pathstart q) +++ q)

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
homotopic_paths S ((p +++ reversepath q) +++ q) (linepath (pathstart q) (pathstart q) +++ q)

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
have "homotopic_paths S (linepath (pathstart q) (pathstart q) +++ q) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths S (linepath (pathstart q) (pathstart q) +++ q) q
[PROOF STEP]
using that homotopic_paths_lid
[PROOF STATE]
proof (prove)
using this:
path p
path_image p \<subseteq> S
path q
path_image q \<subseteq> S
pathstart q = pathstart p
pathfinish q = pathfinish p
\<lbrakk>path ?p; path_image ?p \<subseteq> ?s\<rbrakk> \<Longrightarrow> homotopic_paths ?s (linepath (pathstart ?p) (pathstart ?p) +++ ?p) ?p

goal (1 subgoal):
 1. homotopic_paths S (linepath (pathstart q) (pathstart q) +++ q) q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
homotopic_paths S (linepath (pathstart q) (pathstart q) +++ q) q

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
homotopic_paths S p q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homotopic_paths S p q

goal (1 subgoal):
 1. homotopic_paths S p q
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
homotopic_paths S p q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>path ?p; path_image ?p \<subseteq> S; path ?q; path_image ?q \<subseteq> S; pathstart ?q = pathstart ?p; pathfinish ?q = pathfinish ?p\<rbrakk> \<Longrightarrow> homotopic_paths S ?p ?q

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

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q)
[PROOF STEP]
by (blast intro: pc *)
[PROOF STATE]
proof (state)
this:
path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q)

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

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q) \<Longrightarrow> simply_connected S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
path_connected S \<and> (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and> path q \<and> path_image q \<subseteq> S \<and> pathstart q = pathstart p \<and> pathfinish q = pathfinish p \<longrightarrow> homotopic_paths S p q)

goal (1 subgoal):
 1. simply_connected S
[PROOF STEP]
by (force simp: simply_connected_eq_contractible_path)
[PROOF STATE]
proof (state)
this:
simply_connected S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem hoare_Sup:
  "(\<forall> p \<in> P . \<Turnstile> p {| S |} q) = \<Turnstile> Sup P {| S |} q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>p\<in>P. \<Turnstile> p{| S |}q) = \<Turnstile> \<Squnion>P{| S |}q
[PROOF STEP]
apply (simp add: Hoare_def, safe, simp add: Sup_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<Squnion>P \<sqsubseteq> S q; p \<in> P\<rbrakk> \<Longrightarrow> p \<sqsubseteq> S q
[PROOF STEP]
apply (rule_tac y = "\<Squnion>P" in order_trans, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<Squnion>P \<sqsubseteq> S q; p \<in> P\<rbrakk> \<Longrightarrow> p \<sqsubseteq> \<Squnion>P
[PROOF STEP]
by (simp add: Sup_upper)


[STATEMENT]
lemma attractor_lowerbound: "attractor_step p W S \<subseteq> S \<Longrightarrow> attractor p W \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<union> S \<union> directly_attracted p S \<subseteq> S \<Longrightarrow> attractor p W \<subseteq> S
[PROOF STEP]
unfolding attractor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<union> S \<union> directly_attracted p S \<subseteq> S \<Longrightarrow> lfp (\<lambda>S. W \<union> S \<union> directly_attracted p S) \<subseteq> S
[PROOF STEP]
using attractor_step_mono
[PROOF STATE]
proof (prove)
using this:
mono (\<lambda>S. ?W \<union> S \<union> directly_attracted ?p S)

goal (1 subgoal):
 1. W \<union> S \<union> directly_attracted p S \<subseteq> S \<Longrightarrow> lfp (\<lambda>S. W \<union> S \<union> directly_attracted p S) \<subseteq> S
[PROOF STEP]
by (simp add: lfp_lowerbound)


[STATEMENT]
lemma sum_of_2_squares_nat_0 [simp, intro]: "sum_of_2_squares_nat 0"
  and sum_of_2_squares_nat_1 [simp, intro]: "sum_of_2_squares_nat 1"
  and sum_of_2_squares_nat_Suc_0 [simp, intro]: "sum_of_2_squares_nat (Suc 0)"
  and sum_of_2_squares_nat_2 [simp, intro]: "sum_of_2_squares_nat 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum_of_2_squares_nat 0 &&& sum_of_2_squares_nat 1) &&& sum_of_2_squares_nat (Suc 0) &&& sum_of_2_squares_nat 2
[PROOF STEP]
using sum_of_2_squares_nat.intros[of 0 0] sum_of_2_squares_nat.intros[of 0 1]
        sum_of_2_squares_nat.intros[of 1 1]
[PROOF STATE]
proof (prove)
using this:
sum_of_2_squares_nat (0\<^sup>2 + 0\<^sup>2)
sum_of_2_squares_nat (0\<^sup>2 + 1\<^sup>2)
sum_of_2_squares_nat (1\<^sup>2 + 1\<^sup>2)

goal (1 subgoal):
 1. (sum_of_2_squares_nat 0 &&& sum_of_2_squares_nat 1) &&& sum_of_2_squares_nat (Suc 0) &&& sum_of_2_squares_nat 2
[PROOF STEP]
by (simp_all add: numeral_2_eq_2)


[STATEMENT]
lemma tensor_mat_adjoint:
  assumes "m1 \<in> carrier_mat d1 d1"
    and "m2 \<in> carrier_mat d2 d2"
  shows "adjoint (tensor_mat m1 m2) = tensor_mat (adjoint m1) (adjoint m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (tensor_mat m1 m2) = tensor_mat (adjoint m1) (adjoint m2)
[PROOF STEP]
apply (rule eq_matI, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> adjoint (tensor_mat m1 m2) $$ (i, j) = tensor_mat (adjoint m1) (adjoint m2) $$ (i, j)
[PROOF STEP]
unfolding tensor_mat_def adjoint_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> mat (dim_col (mat d d (\<lambda>(i, j). m1 $$ (encode1 i, encode1 j) * m2 $$ (encode2 i, encode2 j)))) (dim_row (mat d d (\<lambda>(i, j). m1 $$ (encode1 i, encode1 j) * m2 $$ (encode2 i, encode2 j)))) (\<lambda>(i, j). conjugate (mat d d (\<lambda>(i, j). m1 $$ (encode1 i, encode1 j) * m2 $$ (encode2 i, encode2 j)) $$ (j, i))) $$ (i, j) = mat d d (\<lambda>(i, j). mat (dim_col m1) (dim_row m1) (\<lambda>(i, j). conjugate (m1 $$ (j, i))) $$ (encode1 i, encode1 j) * mat (dim_col m2) (dim_row m2) (\<lambda>(i, j). conjugate (m2 $$ (j, i))) $$ (encode2 i, encode2 j)) $$ (i, j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat d1 d1
m2 \<in> carrier_mat d2 d2

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> mat (dim_col (mat d d (\<lambda>(i, j). m1 $$ (encode1 i, encode1 j) * m2 $$ (encode2 i, encode2 j)))) (dim_row (mat d d (\<lambda>(i, j). m1 $$ (encode1 i, encode1 j) * m2 $$ (encode2 i, encode2 j)))) (\<lambda>(i, j). conjugate (mat d d (\<lambda>(i, j). m1 $$ (encode1 i, encode1 j) * m2 $$ (encode2 i, encode2 j)) $$ (j, i))) $$ (i, j) = mat d d (\<lambda>(i, j). mat (dim_col m1) (dim_row m1) (\<lambda>(i, j). conjugate (m1 $$ (j, i))) $$ (encode1 i, encode1 j) * mat (dim_col m2) (dim_row m2) (\<lambda>(i, j). conjugate (m2 $$ (j, i))) $$ (encode2 i, encode2 j)) $$ (i, j)
[PROOF STEP]
by (simp add: conjugate_dist_mul)


[STATEMENT]
lemma fps_power_nth_Suc:
  fixes m :: nat
    and a :: "'a::comm_ring_1 fps"
  shows "(a ^ Suc m)$n = sum (\<lambda>v. prod (\<lambda>j. a $ (v!j)) {0..m}) (natpermute n (m+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ Suc m $ n = (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j = 0..m. a $ v ! j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a ^ Suc m $ n = (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j = 0..m. a $ v ! j)
[PROOF STEP]
have th0: "a^Suc m = prod (\<lambda>i. a) {0..m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ Suc m = (\<Prod>i = 0..m. a)
[PROOF STEP]
by (simp add: prod_constant)
[PROOF STATE]
proof (state)
this:
a ^ Suc m = (\<Prod>i = 0..m. a)

goal (1 subgoal):
 1. a ^ Suc m $ n = (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j = 0..m. a $ v ! j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ Suc m $ n = (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j = 0..m. a $ v ! j)
[PROOF STEP]
unfolding th0 fps_prod_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j = 0..m. a $ v ! j) = (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j = 0..m. a $ v ! j)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a ^ Suc m $ n = (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j = 0..m. a $ v ! j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma content_lt_nz: "0 < content (cbox a b) \<longleftrightarrow> content (cbox a b) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < content (cbox a b)) = (content (cbox a b) \<noteq> 0)
[PROOF STEP]
unfolding content_pos_lt_eq content_eq_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i) = (\<not> (\<exists>i\<in>Basis. b \<bullet> i \<le> a \<bullet> i))
[PROOF STEP]
unfolding not_ex not_le
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i) = (\<not> (\<exists>i\<in>Basis. b \<bullet> i \<le> a \<bullet> i))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma fds_divisor_sum_times_moebius_mu:
  "fds (divisor_sigma (1 :: 'a :: {nat_power,comm_ring_1})) * fds moebius_mu = fds of_nat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat
[PROOF STEP]
have "fds (divisor_sigma 1) * fds moebius_mu =
          fds of_nat * (fds_zeta * fds moebius_mu :: 'a fds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat * (fds_zeta * fds moebius_mu)
[PROOF STEP]
by (subst mult.assoc [symmetric], subst fds_zeta_commutes [symmetric])
       (simp add: fds_divisor_sigma fds_shift_zeta_1)
[PROOF STATE]
proof (state)
this:
fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat * (fds_zeta * fds moebius_mu)

goal (1 subgoal):
 1. fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat * (fds_zeta * fds moebius_mu)

goal (1 subgoal):
 1. fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat
[PROOF STEP]
have "fds_zeta * fds moebius_mu = (1 :: 'a fds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_zeta * fds moebius_mu = 1
[PROOF STEP]
by (fact fds_zeta_times_moebius_mu)
[PROOF STATE]
proof (state)
this:
fds_zeta * fds moebius_mu = 1

goal (1 subgoal):
 1. fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat * 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat * 1

goal (1 subgoal):
 1. fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fds (divisor_sigma (1::'a)) * fds moebius_mu = fds of_nat

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_times_const:"(\<Sum>y\<leftarrow>lst. (cmod (a * y))\<^sup>2) = (cmod a)\<^sup>2 * (\<Sum>y\<leftarrow>lst. (cmod y)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<leftarrow>lst. (cmod (a * y))\<^sup>2) = (cmod a)\<^sup>2 * (\<Sum>y\<leftarrow>lst. (cmod y)\<^sup>2)
[PROOF STEP]
by(induct lst,auto simp:ring_distribs)


[STATEMENT]
lemma ffact_Suc_rev:
  "ffact (Suc n) m = (m - of_nat n) * ffact n m"
    for m :: "'a :: {comm_semiring_1_cancel, ab_group_add}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffact (Suc n) m = (m - of_nat n) * ffact n m
[PROOF STEP]
unfolding ffact_def pochhammer_rec
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m + (1::'a) - of_nat (Suc n)) * pochhammer (m + (1::'a) - of_nat (Suc n) + (1::'a)) n = (m - of_nat n) * pochhammer (m + (1::'a) - of_nat n) n
[PROOF STEP]
by (simp add: diff_add_eq)


[STATEMENT]
lemma prime_dvd_multD: "prime p \<Longrightarrow> p dvd a * b \<Longrightarrow> p dvd a \<or> p dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; p dvd a * b\<rbrakk> \<Longrightarrow> p dvd a \<or> p dvd b
[PROOF STEP]
by (intro prime_elem_dvd_multD) simp_all


[STATEMENT]
lemma Re_winding_number:
    "\<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>\<rbrakk>
     \<Longrightarrow> Re(winding_number \<gamma> z) = Im(contour_integral \<gamma> (\<lambda>w. 1/(w - z))) / (2*pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>\<rbrakk> \<Longrightarrow> Re (winding_number \<gamma> z) = Im (contour_integral \<gamma> (\<lambda>w. 1 / (w - z))) / (2 * pi)
[PROOF STEP]
by (simp add: winding_number_valid_path field_simps Re_divide power2_eq_square)


[STATEMENT]
lemma (in finite_comm_group) restrict_char_kernel:
  assumes "subgroup H G"
  shows "kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
       = {\<chi>\<in>characters G. \<forall>x\<in>H. \<chi> x = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H) = {\<chi> \<in> characters G. \<forall>x\<in>H. \<chi> x = 1}
[PROOF STEP]
by (unfold restrict_char_def kernel_def one_Characters
             carrier_Characters principal_char_def characters_def, simp, metis)


[STATEMENT]
lemma map_sq_matrix_diff:
  "(\<And>a b. f (a - b) = f a - f b) \<Longrightarrow> map_sq_matrix f (A - B) = map_sq_matrix f A - map_sq_matrix f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. f (a - b) = f a - f b) \<Longrightarrow> map_sq_matrix f (A - B) = map_sq_matrix f A - map_sq_matrix f B
[PROOF STEP]
by transfer (simp add: vec_eq_iff)


[STATEMENT]
theorem binomial_ring: "(a + b :: 'a::comm_semiring_1)^n =
  (\<Sum>k\<le>n. (of_nat (n choose k)) * a^k * b^(n-k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (a + b) ^ 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * a ^ k * b ^ (0 - k))
 2. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

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

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have decomp: "{0..n+1} = {0} \<union> {n + 1} \<union> {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..n + 1} = {0} \<union> {n + 1} \<union> {1..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..n + 1} = {0} \<union> {n + 1} \<union> {1..n}

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have decomp2: "{0..n} = {0} \<union> {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..n} = {0} \<union> {1..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..n} = {0} \<union> {1..n}

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have "(a + b)^(n+1) = (a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a^k * b^(n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) ^ (n + 1) = (a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))
[PROOF STEP]
using Suc.hyps
[PROOF STATE]
proof (prove)
using this:
(a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))

goal (1 subgoal):
 1. (a + b) ^ (n + 1) = (a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a + b) ^ (n + 1) = (a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a + b) ^ (n + 1) = (a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have "\<dots> = a * (\<Sum>k\<le>n. of_nat (n choose k) * a^k * b^(n-k)) +
      b * (\<Sum>k\<le>n. of_nat (n choose k) * a^k * b^(n-k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) = a * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) + b * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))
[PROOF STEP]
by (rule distrib_right)
[PROOF STATE]
proof (state)
this:
(a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) = a * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) + b * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a + b) * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) = a * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) + b * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>n. of_nat (n choose k) * a^(k+1) * b^(n-k)) +
      (\<Sum>k\<le>n. of_nat (n choose k) * a^k * b^(n - k + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) + b * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ (k + 1) * b ^ (n - k)) + (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k + 1))
[PROOF STEP]
by (auto simp add: sum_distrib_left ac_simps)
[PROOF STATE]
proof (state)
this:
a * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) + b * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ (k + 1) * b ^ (n - k)) + (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k + 1))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) + b * (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ (k + 1) * b ^ (n - k)) + (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k + 1))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>n. of_nat (n choose k) * a^k * b^(n + 1 - k)) +
      (\<Sum>k=1..n+1. of_nat (n choose (k - 1)) * a^k * b^(n + 1 - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. of_nat (n choose k) * a ^ (k + 1) * b ^ (n - k)) + (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k + 1)) = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (\<Sum>k = 1..n + 1. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k))
[PROOF STEP]
by (simp add: atMost_atLeast0 sum.shift_bounds_cl_Suc_ivl Suc_diff_le field_simps del: sum.cl_ivl_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. of_nat (n choose k) * a ^ (k + 1) * b ^ (n - k)) + (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k + 1)) = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (\<Sum>k = 1..n + 1. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. of_nat (n choose k) * a ^ (k + 1) * b ^ (n - k)) + (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k + 1)) = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (\<Sum>k = 1..n + 1. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have "\<dots> = b^(n + 1) +
      (\<Sum>k=1..n. of_nat (n choose k) * a^k * b^(n + 1 - k)) + (a^(n + 1) +
      (\<Sum>k=1..n. of_nat (n choose (k - 1)) * a^k * b^(n + 1 - k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (\<Sum>k = 1..n + 1. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)) = b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (a ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)))
[PROOF STEP]
using sum.nat_ivl_Suc' [of 1 n "\<lambda>k. of_nat (n choose (k-1)) * a ^ k * b ^ (n + 1 - k)"]
[PROOF STATE]
proof (prove)
using this:
1 \<le> Suc n \<Longrightarrow> (\<Sum>k = 1..Suc n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)) = of_nat (n choose (Suc n - 1)) * a ^ Suc n * b ^ (n + 1 - Suc n) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (\<Sum>k = 1..n + 1. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)) = b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (a ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)))
[PROOF STEP]
by (simp add: sum.atLeast_Suc_atMost atMost_atLeast0)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (\<Sum>k = 1..n + 1. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)) = b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (a ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (\<Sum>k = 1..n + 1. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)) = b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (a ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k)))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have "\<dots> = a^(n + 1) + b^(n + 1) +
      (\<Sum>k=1..n. of_nat (n + 1 choose k) * a^k * b^(n + 1 - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (a ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k))) = a ^ (n + 1) + b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))
[PROOF STEP]
by (auto simp add: field_simps sum.distrib [symmetric] choose_reduce_nat)
[PROOF STATE]
proof (state)
this:
b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (a ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k))) = a ^ (n + 1) + b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose k) * a ^ k * b ^ (n + 1 - k)) + (a ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n choose (k - 1)) * a ^ k * b ^ (n + 1 - k))) = a ^ (n + 1) + b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>n+1. of_nat (n + 1 choose k) * a^k * b^(n + 1 - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ (n + 1) + b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k)) = (\<Sum>k\<le>n + 1. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))
[PROOF STEP]
using decomp
[PROOF STATE]
proof (prove)
using this:
{0..n + 1} = {0} \<union> {n + 1} \<union> {1..n}

goal (1 subgoal):
 1. a ^ (n + 1) + b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k)) = (\<Sum>k\<le>n + 1. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))
[PROOF STEP]
by (simp add: atMost_atLeast0 field_simps)
[PROOF STATE]
proof (state)
this:
a ^ (n + 1) + b ^ (n + 1) + (\<Sum>k = 1..n. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k)) = (\<Sum>k\<le>n + 1. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))

goal (1 subgoal):
 1. \<And>n. (a + b) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * a ^ k * b ^ (n - k)) \<Longrightarrow> (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(a + b) ^ (n + 1) = (\<Sum>k\<le>n + 1. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(a + b) ^ (n + 1) = (\<Sum>k\<le>n + 1. of_nat (n + 1 choose k) * a ^ k * b ^ (n + 1 - k))

goal (1 subgoal):
 1. (a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a + b) ^ Suc n = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * a ^ k * b ^ (Suc n - k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_closedin_homeomorphic_image:
  assumes "homeomorphic_map X Y f"
  shows "(\<forall>V. closedin Y V \<longrightarrow> P V) \<longleftrightarrow> (\<forall>U. closedin X U \<longrightarrow> P(f ` U))"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>V. closedin Y V \<longrightarrow> P V) = (\<forall>U. closedin X U \<longrightarrow> P (f ` U))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>V. closedin Y V \<longrightarrow> P V \<Longrightarrow> \<forall>U. closedin X U \<longrightarrow> P (f ` U)
 2. \<forall>U. closedin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. closedin Y V \<longrightarrow> P V
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
\<forall>V. closedin Y V \<longrightarrow> P V

goal (2 subgoals):
 1. \<forall>V. closedin Y V \<longrightarrow> P V \<Longrightarrow> \<forall>U. closedin X U \<longrightarrow> P (f ` U)
 2. \<forall>U. closedin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. closedin Y V \<longrightarrow> P V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>V. closedin Y V \<longrightarrow> P V
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
\<forall>V. closedin Y V \<longrightarrow> P V

goal (1 subgoal):
 1. \<forall>U. closedin X U \<longrightarrow> P (f ` U)
[PROOF STEP]
by (meson assms homeomorphic_map_closedness_eq)
[PROOF STATE]
proof (state)
this:
\<forall>U. closedin X U \<longrightarrow> P (f ` U)

goal (1 subgoal):
 1. \<forall>U. closedin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. closedin Y V \<longrightarrow> P V
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>U. closedin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. closedin Y V \<longrightarrow> P V
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>U. closedin X U \<longrightarrow> P (f ` U)

goal (1 subgoal):
 1. \<forall>U. closedin X U \<longrightarrow> P (f ` U) \<Longrightarrow> \<forall>V. closedin Y V \<longrightarrow> P V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>U. closedin X U \<longrightarrow> P (f ` U)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<forall>U. closedin X U \<longrightarrow> P (f ` U)

goal (1 subgoal):
 1. \<forall>V. closedin Y V \<longrightarrow> P V
[PROOF STEP]
by (metis (no_types, lifting) assms homeomorphic_imp_surjective_map homeomorphic_map_closedness closedin_subset subset_image_iff)
[PROOF STATE]
proof (state)
this:
\<forall>V. closedin Y V \<longrightarrow> P V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det3_nonneg_scaleR_segment2:
  assumes "det3 x y z \<ge> 0"
  assumes "a > 0"
  shows "det3 x ((1 - a) *\<^sub>R x + a *\<^sub>R y) z \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> det3 x ((1 - a) *\<^sub>R x + a *\<^sub>R y) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> det3 x ((1 - a) *\<^sub>R x + a *\<^sub>R y) z
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> det3 x y z
0 < a
[PROOF STEP]
have "0 \<le> det3 0 (a *\<^sub>R (y - x)) (z - x)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> det3 x y z
0 < a

goal (1 subgoal):
 1. 0 \<le> det3 0 (a *\<^sub>R (y - x)) (z - x)
[PROOF STEP]
by (intro det3_nonneg_scaleR1) (simp_all add: det3_translate_origin)
[PROOF STATE]
proof (state)
this:
0 \<le> det3 0 (a *\<^sub>R (y - x)) (z - x)

goal (1 subgoal):
 1. 0 \<le> det3 x ((1 - a) *\<^sub>R x + a *\<^sub>R y) z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> det3 0 (a *\<^sub>R (y - x)) (z - x)

goal (1 subgoal):
 1. 0 \<le> det3 x ((1 - a) *\<^sub>R x + a *\<^sub>R y) z
[PROOF STEP]
by (simp add: algebra_simps det3_translate_origin)
[PROOF STATE]
proof (state)
this:
0 \<le> det3 x ((1 - a) *\<^sub>R x + a *\<^sub>R y) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trees_of_size_disjoint:
  assumes "m \<noteq> n"
  shows   "trees_of_size m \<inter> trees_of_size n = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trees_of_size m \<inter> trees_of_size n = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<noteq> n

goal (1 subgoal):
 1. trees_of_size m \<inter> trees_of_size n = {}
[PROOF STEP]
by (auto simp: trees_of_size_def)


[STATEMENT]
lemma max_shift:
fixes f :: "nat \<Rightarrow> Clocktime" and S
assumes notEmpFin: "S \<noteq> {}" "finite S"
shows
"Max (f`S) + x = Max ( (\<lambda> p. f p + x) ` S) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (f ` S) + x = (MAX p\<in>S. f p + x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Max (f ` S) + x = (MAX p\<in>S. f p + x)
[PROOF STEP]
from notEmpFin
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
finite S
[PROOF STEP]
have "f`S \<noteq> {}" and "(\<lambda> p. f p + x) ` S \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
finite S

goal (1 subgoal):
 1. f ` S \<noteq> {} &&& (\<lambda>p. f p + x) ` S \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` S \<noteq> {}
(\<lambda>p. f p + x) ` S \<noteq> {}

goal (1 subgoal):
 1. Max (f ` S) + x = (MAX p\<in>S. f p + x)
[PROOF STEP]
with notEmpFin
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
finite S
f ` S \<noteq> {}
(\<lambda>p. f p + x) ` S \<noteq> {}
[PROOF STEP]
have
    "Max (f`S) \<in> f ` S " "Max ((\<lambda> p. f p + x)`S) \<in> (\<lambda> p. f p + x) ` S "
    "(\<forall>fs \<in> (f`S). fs \<le> Max (f`S))"
    "(\<forall>fs \<in> ((\<lambda> p. f p + x)`S). fs \<le> Max ((\<lambda> p. f p + x)`S))"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
finite S
f ` S \<noteq> {}
(\<lambda>p. f p + x) ` S \<noteq> {}

goal (1 subgoal):
 1. (Max (f ` S) \<in> f ` S &&& (MAX p\<in>S. f p + x) \<in> (\<lambda>p. f p + x) ` S) &&& \<forall>fs\<in>f ` S. fs \<le> Max (f ` S) &&& \<forall>fs\<in>(\<lambda>p. f p + x) ` S. fs \<le> (MAX p\<in>S. f p + x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Max (f ` S) \<in> f ` S
(MAX p\<in>S. f p + x) \<in> (\<lambda>p. f p + x) ` S
\<forall>fs\<in>f ` S. fs \<le> Max (f ` S)
\<forall>fs\<in>(\<lambda>p. f p + x) ` S. fs \<le> (MAX p\<in>S. f p + x)

goal (1 subgoal):
 1. Max (f ` S) + x = (MAX p\<in>S. f p + x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Max (f ` S) \<in> f ` S
(MAX p\<in>S. f p + x) \<in> (\<lambda>p. f p + x) ` S
\<forall>fs\<in>f ` S. fs \<le> Max (f ` S)
\<forall>fs\<in>(\<lambda>p. f p + x) ` S. fs \<le> (MAX p\<in>S. f p + x)

goal (1 subgoal):
 1. Max (f ` S) + x = (MAX p\<in>S. f p + x)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Max (f ` S) + x = (MAX p\<in>S. f p + x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_norm_zero:
  fixes v ::  "complex vec"
  assumes dim: "v \<in> carrier_vec n"
  shows "vec_norm v = 0 \<longleftrightarrow> v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec_norm v = 0) = (v = 0\<^sub>v n)
[PROOF STEP]
unfolding vec_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (csqrt (inner_prod v v) = 0) = (v = 0\<^sub>v n)
[PROOF STEP]
by (subst conjugate_square_eq_0_vec[OF dim, symmetric], rule csqrt_eq_0)


[STATEMENT]
lemma
  shows jumpF_pathfinish_reversepath: "jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z"
    and jumpF_pathstart_reversepath: "jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z &&& jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z
 2. jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z
[PROOF STEP]
define f where "f=(\<lambda>t. Im (g t - z) / Re (g t - z))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>t. Im (g t - z) / Re (g t - z))

goal (2 subgoals):
 1. jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z
 2. jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z
[PROOF STEP]
define f' where "f'=(\<lambda>t. Im (reversepath g t - z) / Re (reversepath g t - z))"
[PROOF STATE]
proof (state)
this:
f' = (\<lambda>t. Im (reversepath g t - z) / Re (reversepath g t - z))

goal (2 subgoals):
 1. jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z
 2. jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z
[PROOF STEP]
have "f o (\<lambda>t. 1 - t) = f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> (-) 1 = f'
[PROOF STEP]
unfolding f_def f'_def comp_def reversepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Im (g (1 - x) - z) / Re (g (1 - x) - z)) = (\<lambda>t. Im (g (1 - t) - z) / Re (g (1 - t) - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<circ> (-) 1 = f'

goal (2 subgoals):
 1. jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z
 2. jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<circ> (-) 1 = f'
[PROOF STEP]
show "jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z"
        "jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z"
[PROOF STATE]
proof (prove)
using this:
f \<circ> (-) 1 = f'

goal (1 subgoal):
 1. jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z &&& jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z
[PROOF STEP]
unfolding jumpF_pathstart_def jumpF_pathfinish_def
[PROOF STATE]
proof (prove)
using this:
f \<circ> (-) 1 = f'

goal (1 subgoal):
 1. jumpF (\<lambda>t. Im (reversepath g t - z) / Re (reversepath g t - z)) (at_left 1) = jumpF (\<lambda>t. Im (g t - z) / Re (g t - z)) (at_right 0) &&& jumpF (\<lambda>t. Im (reversepath g t - z) / Re (reversepath g t - z)) (at_right 0) = jumpF (\<lambda>t. Im (g t - z) / Re (g t - z)) (at_left 1)
[PROOF STEP]
using jumpF_linear_comp(2)[of "-1" f 1 0,simplified] jumpF_linear_comp(1)[of "-1" f 1 1,simplified]
[PROOF STATE]
proof (prove)
using this:
f \<circ> (-) 1 = f'
jumpF (f \<circ> (-) 1) (at_right 0) = jumpF f (at_left 1)
jumpF (f \<circ> (-) 1) (at_left 1) = jumpF f (at_right 0)

goal (1 subgoal):
 1. jumpF (\<lambda>t. Im (reversepath g t - z) / Re (reversepath g t - z)) (at_left 1) = jumpF (\<lambda>t. Im (g t - z) / Re (g t - z)) (at_right 0) &&& jumpF (\<lambda>t. Im (reversepath g t - z) / Re (reversepath g t - z)) (at_right 0) = jumpF (\<lambda>t. Im (g t - z) / Re (g t - z)) (at_left 1)
[PROOF STEP]
apply (fold f_def f'_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>f \<circ> (-) 1 = f'; jumpF (f \<circ> (-) 1) (at_right 0) = jumpF f (at_left 1); jumpF (f \<circ> (-) 1) (at_left 1) = jumpF f (at_right 0)\<rbrakk> \<Longrightarrow> jumpF f' (at_left 1) = jumpF f (at_right 0)
 2. \<lbrakk>f \<circ> (-) 1 = f'; jumpF (f \<circ> (-) 1) (at_right 0) = jumpF f (at_left 1); jumpF (f \<circ> (-) 1) (at_left 1) = jumpF f (at_right 0)\<rbrakk> \<Longrightarrow> jumpF f' (at_right 0) = jumpF f (at_left 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish (reversepath g) z = jumpF_pathstart g z
jumpF_pathstart (reversepath g) z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fpower_inductr:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "mono f \<Longrightarrow> mono g \<Longrightarrow> h \<le> g \<sqinter> (h \<circ> f) \<Longrightarrow> h \<le> g \<circ> fpower f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g; h \<le> g \<sqinter> (h \<circ> f)\<rbrakk> \<Longrightarrow> h \<le> g \<circ> fpower f i
[PROOF STEP]
by (induct i, simp_all add: le_fun_def, metis comp_eq_elim fun_mon.power_commutes order_trans)


[STATEMENT]
lemma mult_two_impl3[dest]:
  assumes "a * 2 = 1 + (2 * b - 1)"
  shows "(a::enat) = b \<and> a \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b \<and> 1 \<le> a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a * 2 = 1 + (2 * b - 1)

goal (1 subgoal):
 1. a = b \<and> 1 \<le> a
[PROOF STEP]
by(cases a;cases b,auto simp add: one_enat_def mult_2 mult_2_right)


[STATEMENT]
lemma all_countable_subset_image_inj:
   "(\<forall>T. countable T \<and> T \<subseteq> f ` S \<longrightarrow> P T) \<longleftrightarrow> (\<forall>T. countable T \<and> T \<subseteq> S \<and> inj_on f T \<longrightarrow>P(f ` T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>T. countable T \<and> T \<subseteq> f ` S \<longrightarrow> P T) = (\<forall>T. countable T \<and> T \<subseteq> S \<and> inj_on f T \<longrightarrow> P (f ` T))
[PROOF STEP]
by (metis countable_image_inj_eq subset_image_inj)


[STATEMENT]
lemma choose_dvd:
  assumes "k \<le> n" shows "fact k * fact (n - k) dvd (fact n :: 'a::linordered_semidom)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact k * fact (n - k) dvd fact n
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ka. fact n = fact k * fact (n - k) * ka
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fact n = fact k * fact (n - k) * ?k
[PROOF STEP]
show "fact n = fact k * fact (n - k) * of_nat (n choose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n = fact k * fact (n - k) * of_nat (n choose k)
[PROOF STEP]
by (metis assms binomial_fact_lemma of_nat_fact of_nat_mult)
[PROOF STATE]
proof (state)
this:
fact n = fact k * fact (n - k) * of_nat (n choose k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sgn_squared_ereal:
  assumes "l \<noteq> (0::ereal)"
  shows "sgn(l) * sgn(l) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn l * sgn l = 1
[PROOF STEP]
apply (cases l)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>r. l = ereal r \<Longrightarrow> sgn l * sgn l = 1
 2. l = \<infinity> \<Longrightarrow> sgn l * sgn l = 1
 3. l = - \<infinity> \<Longrightarrow> sgn l * sgn l = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l \<noteq> 0

goal (3 subgoals):
 1. \<And>r. l = ereal r \<Longrightarrow> sgn l * sgn l = 1
 2. l = \<infinity> \<Longrightarrow> sgn l * sgn l = 1
 3. l = - \<infinity> \<Longrightarrow> sgn l * sgn l = 1
[PROOF STEP]
by (auto simp add: one_ereal_def sgn_if)


[STATEMENT]
theorem Join_singleton: "\<Squnion>{x} = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{x} = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Squnion>{x} = x
[PROOF STEP]
have "dual (\<Squnion>{x}) = \<Sqinter>{dual x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual (\<Squnion>{x}) = \<Sqinter>{dual x}
[PROOF STEP]
by (simp add: dual_Join)
[PROOF STATE]
proof (state)
this:
dual (\<Squnion>{x}) = \<Sqinter>{dual x}

goal (1 subgoal):
 1. \<Squnion>{x} = x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dual (\<Squnion>{x}) = \<Sqinter>{dual x}

goal (1 subgoal):
 1. \<Squnion>{x} = x
[PROOF STEP]
have "\<dots> = dual x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>{dual x} = dual x
[PROOF STEP]
by (rule Meet_singleton)
[PROOF STATE]
proof (state)
this:
\<Sqinter>{dual x} = dual x

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nullhomotopic_into_contractible_space:
  assumes f: "continuous_map X Y f" and Y: "contractible_space Y"
  obtains c where "homotopic_with (\<lambda>h. True) X Y f (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. homotopic_with (\<lambda>h. True) X Y f (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using nullhomotopic_through_contractible_space [OF f _ Y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_map Y ?Z ?g; \<And>c. homotopic_with (\<lambda>h. True) X ?Z (?g \<circ> f) (\<lambda>x. c) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>c. homotopic_with (\<lambda>h. True) X Y f (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis continuous_map_id id_comp)


[STATEMENT]
lemma fps_power_first_eq: "a $ 0 = 1 \<Longrightarrow> a^n $ 1 = of_nat n * a$1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a $ 0 = (1::'a) \<Longrightarrow> a ^ n $ 1 = of_nat n * a $ 1
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a $ 0 = (1::'a) \<Longrightarrow> a ^ 0 $ 1 = of_nat 0 * a $ 1
 2. \<And>n. \<lbrakk>a $ 0 = (1::'a) \<Longrightarrow> a ^ n $ 1 = of_nat n * a $ 1; a $ 0 = (1::'a)\<rbrakk> \<Longrightarrow> a ^ Suc n $ 1 = of_nat (Suc n) * a $ 1
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
a $ 0 = (1::'a) \<Longrightarrow> a ^ n $ 1 = of_nat n * a $ 1
a $ 0 = (1::'a)

goal (2 subgoals):
 1. a $ 0 = (1::'a) \<Longrightarrow> a ^ 0 $ 1 = of_nat 0 * a $ 1
 2. \<And>n. \<lbrakk>a $ 0 = (1::'a) \<Longrightarrow> a ^ n $ 1 = of_nat n * a $ 1; a $ 0 = (1::'a)\<rbrakk> \<Longrightarrow> a ^ Suc n $ 1 = of_nat (Suc n) * a $ 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ Suc n $ 1 = of_nat (Suc n) * a $ 1
[PROOF STEP]
unfolding power_Suc fps_mult_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..1. a $ i * a ^ n $ (1 - i)) = of_nat (Suc n) * a $ 1
[PROOF STEP]
using Suc.hyps[OF \<open>a$0 = 1\<close>] \<open>a$0 = 1\<close> fps_power_zeroth_eq_one[OF \<open>a$0=1\<close>]
[PROOF STATE]
proof (prove)
using this:
a ^ n $ 1 = of_nat n * a $ 1
a $ 0 = (1::'a)
a ^ ?n $ 0 = (1::'a)

goal (1 subgoal):
 1. (\<Sum>i = 0..1. a $ i * a ^ n $ (1 - i)) = of_nat (Suc n) * a $ 1
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
a ^ Suc n $ 1 = of_nat (Suc n) * a $ 1

goal (1 subgoal):
 1. a $ 0 = (1::'a) \<Longrightarrow> a ^ 0 $ 1 = of_nat 0 * a $ 1
[PROOF STEP]
qed simp


[STATEMENT]
lemma suminf_ennreal[simp]:
  "(\<And>i. 0 \<le> f i) \<Longrightarrow> (\<Sum>i. ennreal (f i)) \<noteq> top \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal (\<Sum>i. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. 0 \<le> f i; (\<Sum>i. ennreal (f i)) \<noteq> top\<rbrakk> \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal (\<Sum>i. f i)
[PROOF STEP]
by (rule sums_unique[symmetric]) (simp add: summable_suminf_not_top suminf_nonneg summable_sums)


[STATEMENT]
lemma local_time_cocycle:
  "local_time A n x + local_time A m ((T^^n)x) = local_time A (n+m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_time A n x + local_time A m ((T ^^ n) x) = local_time A (n + m) x
[PROOF STEP]
by (metis local_time_birkhoff birkhoff_sum_cocycle)


[STATEMENT]
lemma sum_Un2:
  assumes "finite (A \<union> B)"
  shows "sum_0 f (A \<union> B) = sum_0 f (A - B) + sum_0 f (B - A) + sum_0 f (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_0 f (A \<union> B) = sum_0 f (A - B) + sum_0 f (B - A) + sum_0 f (A \<inter> B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_0 f (A \<union> B) = sum_0 f (A - B) + sum_0 f (B - A) + sum_0 f (A \<inter> B)
[PROOF STEP]
have "A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B

goal (1 subgoal):
 1. sum_0 f (A \<union> B) = sum_0 f (A - B) + sum_0 f (B - A) + sum_0 f (A \<inter> B)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite (A \<union> B)
A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (A \<union> B)
A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B

goal (1 subgoal):
 1. sum_0 f (A \<union> B) = sum_0 f (A - B) + sum_0 f (B - A) + sum_0 f (A \<inter> B)
[PROOF STEP]
by simp (subst sum_0.union_disjoint, auto)+
[PROOF STATE]
proof (state)
this:
sum_0 f (A \<union> B) = sum_0 f (A - B) + sum_0 f (B - A) + sum_0 f (A \<inter> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pell_valuation_power [simp]: "pell_valuation (pell_power z n) = pell_valuation z ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pell_valuation (pell_power z n) = pell_valuation z ^ n
[PROOF STEP]
by (induction n) (simp_all add: pell_power_Suc)


[STATEMENT]
lemma iMin_the:  "iMin I = (THE x. x \<in> I \<and> (\<forall>y. y \<in> I \<longrightarrow> x \<le> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iMin I = (THE x. x \<in> I \<and> (\<forall>y. y \<in> I \<longrightarrow> x \<le> y))
[PROOF STEP]
by (simp add: iMin_def Least_def)


[STATEMENT]
lemma mult_minus_eq_nat:
  fixes  x::nat and y ::nat and z::nat
  assumes " x+y = z"
  shows " -x-y = -z "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - int x - int y = - int z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x + y = z

goal (1 subgoal):
 1. - int x - int y = - int z
[PROOF STEP]
by linarith


[STATEMENT]
lemma mono_natI:
fixes f :: "nat \<Rightarrow> 'a::order"
shows "(\<And>n. f n \<le> f (Suc n)) \<Longrightarrow> mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. f n \<le> f (Suc n)) \<Longrightarrow> mono f
[PROOF STEP]
apply (rule monoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<And>n. f n \<le> f (Suc n); x \<le> y\<rbrakk> \<Longrightarrow> f x \<le> f y
[PROOF STEP]
apply (drule le_add_diff_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<And>n. f n \<le> f (Suc n); x + (y - x) = y\<rbrakk> \<Longrightarrow> f x \<le> f y
[PROOF STEP]
apply (subgoal_tac "\<forall>k. f x \<le> f (x + k)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>\<And>n. f n \<le> f (Suc n); x + (y - x) = y; \<forall>k. f x \<le> f (x + k)\<rbrakk> \<Longrightarrow> f x \<le> f y
 2. \<And>x y. \<lbrakk>\<And>n. f n \<le> f (Suc n); x + (y - x) = y\<rbrakk> \<Longrightarrow> \<forall>k. f x \<le> f (x + k)
[PROOF STEP]
apply (erule subst, erule spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<And>n. f n \<le> f (Suc n); x + (y - x) = y\<rbrakk> \<Longrightarrow> \<forall>k. f x \<le> f (x + k)
[PROOF STEP]
apply (rule allI, induct_tac k, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y k n. \<lbrakk>\<And>n. f n \<le> f (Suc n); x + (y - x) = y; f x \<le> f (x + n)\<rbrakk> \<Longrightarrow> f x \<le> f (x + Suc n)
[PROOF STEP]
apply (erule order_trans, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inter_result: "\<forall>x \<in> {S . (\<exists> (m::nat) n .  {m..n }=S) }.
         \<forall>y \<in> {S . (\<exists> (m::nat) n . {m..n }=S) }.
           x \<inter> y \<in>{S . (\<exists> (m::nat) n .  {m..n }=S)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{S. \<exists>m n. {m..n} = S}. \<forall>y\<in>{S. \<exists>m n. {m..n} = S}. x \<inter> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
using Int_atLeastAtMost
[PROOF STATE]
proof (prove)
using this:
{?a..?b} \<inter> {?c..?d} = {max ?a ?c..min ?b ?d}

goal (1 subgoal):
 1. \<forall>x\<in>{S. \<exists>m n. {m..n} = S}. \<forall>y\<in>{S. \<exists>m n. {m..n} = S}. x \<inter> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
by blast


[STATEMENT]
lemma z1pdiv2: "(2 * b + 1) div 2 = b"
  for b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * b + 1) div 2 = b
[PROOF STEP]
by arith


[STATEMENT]
lemma ell2_norm_uminus:
  assumes "has_ell2_norm x"
  shows \<open>has_ell2_norm (\<lambda>i. - x i)\<close> and \<open>ell2_norm (\<lambda>i. - x i) = ell2_norm x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_ell2_norm (\<lambda>i. - x i) &&& ell2_norm (\<lambda>i. - x i) = ell2_norm x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
has_ell2_norm x

goal (1 subgoal):
 1. has_ell2_norm (\<lambda>i. - x i) &&& ell2_norm (\<lambda>i. - x i) = ell2_norm x
[PROOF STEP]
by (auto simp: has_ell2_norm_def ell2_norm_def)


[STATEMENT]
lemma continuous_on_closed_segment_transform:
  assumes f: "continuous_on (closed_segment a b) f"
      and k: "0 \<le> k" "k \<le> 1"
      and c: "c - a = k *\<^sub>R (b - a)"
    shows "continuous_on (closed_segment a c) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closed_segment a c) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on (closed_segment a c) f
[PROOF STEP]
have c': "c = (1 - k) *\<^sub>R a + k *\<^sub>R b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c = (1 - k) *\<^sub>R a + k *\<^sub>R b
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
c - a = k *\<^sub>R (b - a)

goal (1 subgoal):
 1. c = (1 - k) *\<^sub>R a + k *\<^sub>R b
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
c = (1 - k) *\<^sub>R a + k *\<^sub>R b

goal (1 subgoal):
 1. continuous_on (closed_segment a c) f
[PROOF STEP]
have "closed_segment a c \<subseteq> closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a c \<subseteq> closed_segment a b
[PROOF STEP]
by (metis c' ends_in_segment(1) in_segment(1) k subset_closed_segment)
[PROOF STATE]
proof (state)
this:
closed_segment a c \<subseteq> closed_segment a b

goal (1 subgoal):
 1. continuous_on (closed_segment a c) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed_segment a c \<subseteq> closed_segment a b
[PROOF STEP]
show "continuous_on (closed_segment a c) f"
[PROOF STATE]
proof (prove)
using this:
closed_segment a c \<subseteq> closed_segment a b

goal (1 subgoal):
 1. continuous_on (closed_segment a c) f
[PROOF STEP]
by (rule continuous_on_subset [OF f])
[PROOF STATE]
proof (state)
this:
continuous_on (closed_segment a c) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSDERIV_add:
  assumes "NSDERIV f x :> Da" "NSDERIV g x :> Db"
  shows "NSDERIV (\<lambda>x. f x + g x) x :> Da + Db"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSDERIV (\<lambda>x. f x + g x) x :> Da + Db
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. NSDERIV (\<lambda>x. f x + g x) x :> Da + Db
[PROOF STEP]
have "((\<lambda>x. f x + g x) has_field_derivative Da + Db) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) has_field_derivative Da + Db) (at x)
[PROOF STEP]
using assms DERIV_NS_iff NSDERIV_NSLIM_iff field_differentiable_add
[PROOF STATE]
proof (prove)
using this:
NSDERIV f x :> Da
NSDERIV g x :> Db
(?f has_field_derivative ?D) (at ?x) = (\<lambda>h. (?f (?x + h) - ?f ?x) / h) \<midarrow>0::?'a\<rightarrow>\<^sub>N\<^sub>S ?D
NSDERIV ?f ?x :> ?D = (\<lambda>h. (?f (?x + h) - ?f ?x) / h) \<midarrow>0::?'a\<rightarrow>\<^sub>N\<^sub>S ?D
\<lbrakk>(?f has_field_derivative ?f') ?F; (?g has_field_derivative ?g') ?F\<rbrakk> \<Longrightarrow> ((\<lambda>z. ?f z + ?g z) has_field_derivative ?f' + ?g') ?F

goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) has_field_derivative Da + Db) (at x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x + g x) has_field_derivative Da + Db) (at x)

goal (1 subgoal):
 1. NSDERIV (\<lambda>x. f x + g x) x :> Da + Db
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f x + g x) has_field_derivative Da + Db) (at x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x + g x) has_field_derivative Da + Db) (at x)

goal (1 subgoal):
 1. NSDERIV (\<lambda>x. f x + g x) x :> Da + Db
[PROOF STEP]
by (simp add: DERIV_NS_iff NSDERIV_NSLIM_iff)
[PROOF STATE]
proof (state)
this:
NSDERIV (\<lambda>x. f x + g x) x :> Da + Db

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_vectors_carrier_vec [simp]:
  "unit_vectors n \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_vectors n \<subseteq> carrier_vec n
[PROOF STEP]
using unit_vectors_def
[PROOF STATE]
proof (prove)
using this:
unit_vectors ?n \<equiv> {unit_vec ?n i |i. 0 \<le> i \<and> i < ?n}

goal (1 subgoal):
 1. unit_vectors n \<subseteq> carrier_vec n
[PROOF STEP]
by auto


[STATEMENT]
lemma sums_SUP[simp, intro]: "f sums (SUP n. \<Sum>i<n. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums (SUP n. sum f {..<n})
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (SUP n. sum f {..<n})
[PROOF STEP]
by (intro LIMSEQ_SUP monoI sum_mono2 zero_le) auto


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_partitionE:
  assumes "S partitions A"
  shows "disjoint S"
        "\<Union> S = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint S &&& \<Union> S = A
[PROOF STEP]
using assms is_partition_def
[PROOF STATE]
proof (prove)
using this:
S partitions A
?S partitions ?A = (disjoint ?S \<and> \<Union> ?S = ?A)

goal (1 subgoal):
 1. disjoint S &&& \<Union> S = A
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> S = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S partitions A

goal (1 subgoal):
 1. \<Union> S = A
[PROOF STEP]
by (simp add: is_partition_def)


[STATEMENT]
theorem succ_bound_size_univ': "invar_vebt t n \<Longrightarrow> u =  2^n \<Longrightarrow>   T\<^sub>s\<^sub>u\<^sub>c\<^sub>c' t x \<le> 2 +  lb (lb u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; u = 2 ^ n\<rbrakk> \<Longrightarrow> real (T\<^sub>s\<^sub>u\<^sub>c\<^sub>c' t x) \<le> 2 + log 2 (log 2 u)
[PROOF STEP]
using succ'_bound_height[of t n x] height_double_log_univ_size[of u n t]
[PROOF STATE]
proof (prove)
using this:
invar_vebt t n \<Longrightarrow> T\<^sub>s\<^sub>u\<^sub>c\<^sub>c' t x \<le> 1 + height t
\<lbrakk>u = 2 ^ n; invar_vebt t n\<rbrakk> \<Longrightarrow> real (height t) \<le> 1 + log 2 (log 2 u)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; u = 2 ^ n\<rbrakk> \<Longrightarrow> real (T\<^sub>s\<^sub>u\<^sub>c\<^sub>c' t x) \<le> 2 + log 2 (log 2 u)
[PROOF STEP]
by simp


[STATEMENT]
lemma card_sum [simp]: "CARD('a + 'b) = CARD('a::finite) + CARD('b::finite)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a + 'b) = CARD('a) + CARD('b)
[PROOF STEP]
by(simp add: card_UNIV_sum)