[STATEMENT]
lemma has_derivative_inverse_basic:
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  assumes derf: "(f has_derivative f') (at (g y))"
    and ling': "bounded_linear g'"
    and "g' \<circ> f' = id"
    and contg: "continuous (at y) g"
    and "open T"
    and "y \<in> T"
    and fg: "\<And>z. z \<in> T \<Longrightarrow> f (g z) = z"
  shows "(g has_derivative g') (at y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
interpret f': bounded_linear f'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at (g y))
bounded_linear g'
g' \<circ> f' = id
isCont g y
open T
y \<in> T
?z \<in> T \<Longrightarrow> f (g ?z) = ?z

goal (1 subgoal):
 1. bounded_linear f'
[PROOF STEP]
unfolding has_derivative_def
[PROOF STATE]
proof (prove)
using this:
bounded_linear f' \<and> (\<lambda>ya. (f ya - f (netlimit (at (g y))) - f' (ya - netlimit (at (g y)))) /\<^sub>R norm (ya - netlimit (at (g y)))) \<midarrow>g y\<rightarrow> (0::'b)
bounded_linear g'
g' \<circ> f' = id
isCont g y
open T
y \<in> T
?z \<in> T \<Longrightarrow> f (g ?z) = ?z

goal (1 subgoal):
 1. bounded_linear f'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
interpret g': bounded_linear g'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear g'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at (g y))
bounded_linear g'
g' \<circ> f' = id
isCont g y
open T
y \<in> T
?z \<in> T \<Longrightarrow> f (g ?z) = ?z

goal (1 subgoal):
 1. bounded_linear g'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
obtain C where C: "0 < C" "\<And>x. norm (g' x) \<le> norm x * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>0 < C; \<And>x. norm (g' x) \<le> norm x * C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using bounded_linear.pos_bounded[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<exists>K>0. \<forall>x. norm (g' x) \<le> norm x * K

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>0 < C; \<And>x. norm (g' x) \<le> norm x * C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < C
norm (g' ?x) \<le> norm ?x * C

goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
have lem1: "\<forall>e>0. \<exists>d>0. \<forall>z.
    norm (z - y) < d \<longrightarrow> norm (g z - g y - g'(z - y)) \<le> e * norm (g z - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
fix e :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
with C(1)
[PROOF STATE]
proof (chain)
picking this:
0 < C
0 < e
[PROOF STEP]
have *: "e / C > 0"
[PROOF STATE]
proof (prove)
using this:
0 < C
0 < e

goal (1 subgoal):
 1. 0 < e / C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e / C

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
obtain d0 where  "0 < d0" and d0:
        "\<And>u. norm (u - g y) < d0 \<Longrightarrow> norm (f u - f (g y) - f' (u - g y)) \<le> e / C * norm (u - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d0. \<lbrakk>0 < d0; \<And>u. norm (u - g y) < d0 \<Longrightarrow> norm (f u - f (g y) - f' (u - g y)) \<le> e / C * norm (u - g y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using derf *
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at (g y))
0 < e / C

goal (1 subgoal):
 1. (\<And>d0. \<lbrakk>0 < d0; \<And>u. norm (u - g y) < d0 \<Longrightarrow> norm (f u - f (g y) - f' (u - g y)) \<le> e / C * norm (u - g y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding has_derivative_at_alt
[PROOF STATE]
proof (prove)
using this:
bounded_linear f' \<and> (\<forall>e>0. \<exists>d>0. \<forall>ya. norm (ya - g y) < d \<longrightarrow> norm (f ya - f (g y) - f' (ya - g y)) \<le> e * norm (ya - g y))
0 < e / C

goal (1 subgoal):
 1. (\<And>d0. \<lbrakk>0 < d0; \<And>u. norm (u - g y) < d0 \<Longrightarrow> norm (f u - f (g y) - f' (u - g y)) \<le> e / C * norm (u - g y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d0
norm (?u - g y) < d0 \<Longrightarrow> norm (f ?u - f (g y) - f' (?u - g y)) \<le> e / C * norm (?u - g y)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
obtain d1 where "0 < d1" and d1: "\<And>x. \<lbrakk>0 < dist x y; dist x y < d1\<rbrakk> \<Longrightarrow> dist (g x) (g y) < d0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d1. \<lbrakk>0 < d1; \<And>x. \<lbrakk>0 < dist x y; dist x y < d1\<rbrakk> \<Longrightarrow> dist (g x) (g y) < d0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using contg \<open>0 < d0\<close>
[PROOF STATE]
proof (prove)
using this:
isCont g y
0 < d0

goal (1 subgoal):
 1. (\<And>d1. \<lbrakk>0 < d1; \<And>x. \<lbrakk>0 < dist x y; dist x y < d1\<rbrakk> \<Longrightarrow> dist (g x) (g y) < d0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding continuous_at Lim_at
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>d>0. \<forall>x. 0 < dist x y \<and> dist x y < d \<longrightarrow> dist (g x) (g y) < e
0 < d0

goal (1 subgoal):
 1. (\<And>d1. \<lbrakk>0 < d1; \<And>x. \<lbrakk>0 < dist x y; dist x y < d1\<rbrakk> \<Longrightarrow> dist (g x) (g y) < d0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d1
\<lbrakk>0 < dist ?x y; dist ?x y < d1\<rbrakk> \<Longrightarrow> dist (g ?x) (g y) < d0

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
obtain d2 where "0 < d2" and d2: "\<And>u. dist u y < d2 \<Longrightarrow> u \<in> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d2. \<lbrakk>0 < d2; \<And>u. dist u y < d2 \<Longrightarrow> u \<in> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>open T\<close> \<open>y \<in> T\<close>
[PROOF STATE]
proof (prove)
using this:
open T
y \<in> T

goal (1 subgoal):
 1. (\<And>d2. \<lbrakk>0 < d2; \<And>u. dist u y < d2 \<Longrightarrow> u \<in> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding open_dist
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>T. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> T
y \<in> T

goal (1 subgoal):
 1. (\<And>d2. \<lbrakk>0 < d2; \<And>u. dist u y < d2 \<Longrightarrow> u \<in> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d2
dist ?u y < d2 \<Longrightarrow> ?u \<in> T

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
obtain d where d: "0 < d" "d < d1" "d < d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; d < d1; d < d2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using field_lbound_gt_zero[OF \<open>0 < d1\<close> \<open>0 < d2\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>e>0. e < d1 \<and> e < d2

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; d < d1; d < d2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d
d < d1
d < d2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
show "\<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
proof (intro exI allI impI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
assume as: "norm (z - y) < d"
[PROOF STATE]
proof (state)
this:
norm (z - y) < d

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (z - y) < d
[PROOF STEP]
have "z \<in> T"
[PROOF STATE]
proof (prove)
using this:
norm (z - y) < d

goal (1 subgoal):
 1. z \<in> T
[PROOF STEP]
using d2 d
[PROOF STATE]
proof (prove)
using this:
norm (z - y) < d
dist ?u y < d2 \<Longrightarrow> ?u \<in> T
0 < d
d < d1
d < d2

goal (1 subgoal):
 1. z \<in> T
[PROOF STEP]
unfolding dist_norm
[PROOF STATE]
proof (prove)
using this:
norm (z - y) < d
norm (?u - y) < d2 \<Longrightarrow> ?u \<in> T
0 < d
d < d1
d < d2

goal (1 subgoal):
 1. z \<in> T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> T

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
have "norm (g z - g y - g' (z - y)) \<le> norm (g' (f (g z) - y - f' (g z - g y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g z - g y - g' (z - y)) \<le> norm (g' (f (g z) - y - f' (g z - g y)))
[PROOF STEP]
unfolding g'.diff f'.diff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g z - g y - (g' z - g' y)) \<le> norm (g' (f (g z)) - g' y - (g' (f' (g z)) - g' (f' (g y))))
[PROOF STEP]
unfolding assms(3)[unfolded o_def id_def, THEN fun_cong] fg[OF \<open>z\<in>T\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g z - g y - (g' z - g' y)) \<le> norm (g' z - g' y - (g z - g y))
[PROOF STEP]
by (simp add: norm_minus_commute)
[PROOF STATE]
proof (state)
this:
norm (g z - g y - g' (z - y)) \<le> norm (g' (f (g z) - y - f' (g z - g y)))

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (g z - g y - g' (z - y)) \<le> norm (g' (f (g z) - y - f' (g z - g y)))

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
have "\<dots> \<le> norm (f (g z) - y - f' (g z - g y)) * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g' (f (g z) - y - f' (g z - g y))) \<le> norm (f (g z) - y - f' (g z - g y)) * C
[PROOF STEP]
by (rule C(2))
[PROOF STATE]
proof (state)
this:
norm (g' (f (g z) - y - f' (g z - g y))) \<le> norm (f (g z) - y - f' (g z - g y)) * C

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (g' (f (g z) - y - f' (g z - g y))) \<le> norm (f (g z) - y - f' (g z - g y)) * C

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
have "\<dots> \<le> (e / C) * norm (g z - g y) * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f (g z) - y - f' (g z - g y)) * C \<le> e / C * norm (g z - g y) * C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (f (g z) - y - f' (g z - g y)) * C \<le> e / C * norm (g z - g y) * C
[PROOF STEP]
have "norm (g z - g y) < d0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g z - g y) < d0
[PROOF STEP]
by (metis as cancel_comm_monoid_add_class.diff_cancel d(2) \<open>0 < d0\<close> d1 diff_gt_0_iff_gt diff_strict_mono dist_norm dist_self zero_less_dist_iff)
[PROOF STATE]
proof (state)
this:
norm (g z - g y) < d0

goal (1 subgoal):
 1. norm (f (g z) - y - f' (g z - g y)) * C \<le> e / C * norm (g z - g y) * C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (g z - g y) < d0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (g z - g y) < d0

goal (1 subgoal):
 1. norm (f (g z) - y - f' (g z - g y)) * C \<le> e / C * norm (g z - g y) * C
[PROOF STEP]
by (metis C(1) \<open>y \<in> T\<close> d0 fg mult_le_cancel_iff1)
[PROOF STATE]
proof (state)
this:
norm (f (g z) - y - f' (g z - g y)) * C \<le> e / C * norm (g z - g y) * C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm (f (g z) - y - f' (g z - g y)) * C \<le> e / C * norm (g z - g y) * C

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f (g z) - y - f' (g z - g y)) * C \<le> e / C * norm (g z - g y) * C

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
have "\<dots> \<le> e * norm (g z - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e / C * norm (g z - g y) * C \<le> e * norm (g z - g y)
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 < C
norm (g' ?x) \<le> norm ?x * C

goal (1 subgoal):
 1. e / C * norm (g z - g y) * C \<le> e * norm (g z - g y)
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
e / C * norm (g z - g y) * C \<le> e * norm (g z - g y)

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>z. norm (z - y) < ?d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
show "norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)"
[PROOF STATE]
proof (prove)
using this:
norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)

goal (1 subgoal):
 1. norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)

goal (1 subgoal):
 1. 0 < d
[PROOF STEP]
qed (use d in auto)
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>e>0. \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)

goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
have *: "(0::real) < 1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < 1 / 2

goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
obtain d where "0 < d" and d:
      "\<And>z. norm (z - y) < d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> 1/2 * norm (g z - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>z. norm (z - y) < d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> 1 / 2 * norm (g z - g y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lem1 *
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
0 < 1 / 2

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>z. norm (z - y) < d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> 1 / 2 * norm (g z - g y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d
norm (?z - y) < d \<Longrightarrow> norm (g ?z - g y - g' (?z - y)) \<le> 1 / 2 * norm (g ?z - g y)

goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
define B where "B = C * 2"
[PROOF STATE]
proof (state)
this:
B = C * 2

goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
have "B > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < B
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < C * 2
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 < C
norm (g' ?x) \<le> norm ?x * C

goal (1 subgoal):
 1. 0 < C * 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < B

goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
have lem2: "norm (g z - g y) \<le> B * norm (z - y)" if z: "norm(z - y) < d" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
have "norm (g z - g y) \<le> norm(g' (z - y)) + norm ((g z - g y) - g'(z - y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g z - g y) \<le> norm (g' (z - y)) + norm (g z - g y - g' (z - y))
[PROOF STEP]
by (rule norm_triangle_sub)
[PROOF STATE]
proof (state)
this:
norm (g z - g y) \<le> norm (g' (z - y)) + norm (g z - g y - g' (z - y))

goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (g z - g y) \<le> norm (g' (z - y)) + norm (g z - g y - g' (z - y))

goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
have "\<dots> \<le> norm (g' (z - y)) + 1 / 2 * norm (g z - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g' (z - y)) + norm (g z - g y - g' (z - y)) \<le> norm (g' (z - y)) + 1 / 2 * norm (g z - g y)
[PROOF STEP]
by (rule add_left_mono) (use d z in auto)
[PROOF STATE]
proof (state)
this:
norm (g' (z - y)) + norm (g z - g y - g' (z - y)) \<le> norm (g' (z - y)) + 1 / 2 * norm (g z - g y)

goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (g' (z - y)) + norm (g z - g y - g' (z - y)) \<le> norm (g' (z - y)) + 1 / 2 * norm (g z - g y)

goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
have "\<dots> \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (g' (z - y)) + 1 / 2 * norm (g z - g y) \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)
[PROOF STEP]
by (rule add_right_mono) (use C in auto)
[PROOF STATE]
proof (state)
this:
norm (g' (z - y)) + 1 / 2 * norm (g z - g y) \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)

goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (g z - g y) \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)
[PROOF STEP]
show "norm (g z - g y) \<le> B * norm (z - y)"
[PROOF STATE]
proof (prove)
using this:
norm (g z - g y) \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)

goal (1 subgoal):
 1. norm (g z - g y) \<le> B * norm (z - y)
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
using this:
norm (g z - g y) \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)

goal (1 subgoal):
 1. norm (g z - g y) \<le> C * 2 * norm (z - y)
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
norm (g z - g y) \<le> B * norm (z - y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm (?z - y) < d \<Longrightarrow> norm (g ?z - g y) \<le> B * norm (?z - y)

goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g') (at y)
[PROOF STEP]
unfolding has_derivative_at_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear g' \<and> (\<forall>e>0. \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y))
[PROOF STEP]
proof (intro conjI assms allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
fix e :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
have *: "e / B > 0"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. 0 < e / B
[PROOF STEP]
by (metis \<open>B > 0\<close> divide_pos_pos)
[PROOF STATE]
proof (state)
this:
0 < e / B

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
obtain d' where "0 < d'" and d':
        "\<And>z. norm (z - y) < d' \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d'. \<lbrakk>0 < d'; \<And>z. norm (z - y) < d' \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lem1 *
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)
0 < e / B

goal (1 subgoal):
 1. (\<And>d'. \<lbrakk>0 < d'; \<And>z. norm (z - y) < d' \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d'
norm (?z - y) < d' \<Longrightarrow> norm (g ?z - g y - g' (?z - y)) \<le> e / B * norm (g ?z - g y)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
obtain k where k: "0 < k" "k < d" "k < d'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. \<lbrakk>0 < k; k < d; k < d'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using field_lbound_gt_zero[OF \<open>0 < d\<close> \<open>0 < d'\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>e>0. e < d \<and> e < d'

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>0 < k; k < d; k < d'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < k
k < d
k < d'

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
show "\<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
proof (intro exI allI impI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?d
 2. \<And>ya. norm (ya - y) < ?d \<Longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?d
 2. \<And>ya. norm (ya - y) < ?d \<Longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
assume as: "norm (z - y) < k"
[PROOF STATE]
proof (state)
this:
norm (z - y) < k

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>ya. norm (ya - y) < ?d \<Longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (z - y) < k
[PROOF STEP]
have "norm (g z - g y - g' (z - y)) \<le> e / B * norm(g z - g y)"
[PROOF STATE]
proof (prove)
using this:
norm (z - y) < k

goal (1 subgoal):
 1. norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)
[PROOF STEP]
using d' k
[PROOF STATE]
proof (prove)
using this:
norm (z - y) < k
norm (?z - y) < d' \<Longrightarrow> norm (g ?z - g y - g' (?z - y)) \<le> e / B * norm (g ?z - g y)
0 < k
k < d
k < d'

goal (1 subgoal):
 1. norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>ya. norm (ya - y) < ?d \<Longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>ya. norm (ya - y) < ?d \<Longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
have "\<dots> \<le> e * norm (z - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e / B * norm (g z - g y) \<le> e * norm (z - y)
[PROOF STEP]
unfolding times_divide_eq_left pos_divide_le_eq[OF \<open>B>0\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e * norm (g z - g y) \<le> e * norm (z - y) * B
[PROOF STEP]
using lem2[of z] k as \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
norm (z - y) < d \<Longrightarrow> norm (g z - g y) \<le> B * norm (z - y)
0 < k
k < d
k < d'
norm (z - y) < k
0 < e

goal (1 subgoal):
 1. e * norm (g z - g y) \<le> e * norm (z - y) * B
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
e / B * norm (g z - g y) \<le> e * norm (z - y)

goal (2 subgoals):
 1. 0 < ?d
 2. \<And>ya. norm (ya - y) < ?d \<Longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)
[PROOF STEP]
show "norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)"
[PROOF STATE]
proof (prove)
using this:
norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)

goal (1 subgoal):
 1. norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)

goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
qed (use k in auto)
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(g has_derivative g') (at y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_convex_Int_superset:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S" "interior S \<noteq> {}" "interior S \<subseteq> closure T"
  shows "closure(S \<inter> T) = closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (S \<inter> T) = closure S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (S \<inter> T) = closure S
[PROOF STEP]
have "closure S \<subseteq> closure(interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure S \<subseteq> closure (interior S)
[PROOF STEP]
by (simp add: convex_closure_interior assms)
[PROOF STATE]
proof (state)
this:
closure S \<subseteq> closure (interior S)

goal (1 subgoal):
 1. closure (S \<inter> T) = closure S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure S \<subseteq> closure (interior S)

goal (1 subgoal):
 1. closure (S \<inter> T) = closure S
[PROOF STEP]
have "... \<subseteq> closure (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (interior S) \<subseteq> closure (S \<inter> T)
[PROOF STEP]
using interior_subset [of S] assms
[PROOF STATE]
proof (prove)
using this:
interior S \<subseteq> S
convex S
interior S \<noteq> {}
interior S \<subseteq> closure T

goal (1 subgoal):
 1. closure (interior S) \<subseteq> closure (S \<inter> T)
[PROOF STEP]
by (metis (no_types, lifting) Int_assoc Int_lower2 closure_mono closure_open_Int_superset inf.orderE open_interior)
[PROOF STATE]
proof (state)
this:
closure (interior S) \<subseteq> closure (S \<inter> T)

goal (1 subgoal):
 1. closure (S \<inter> T) = closure S
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closure S \<subseteq> closure (S \<inter> T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closure S \<subseteq> closure (S \<inter> T)

goal (1 subgoal):
 1. closure (S \<inter> T) = closure S
[PROOF STEP]
by (simp add: closure_mono dual_order.antisym)
[PROOF STATE]
proof (state)
this:
closure (S \<inter> T) = closure S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_ln_powr_upper_bound':
  "eventually (\<lambda>a. \<forall>b>a. \<exists>c. \<forall>x\<in>{a..b}. x powr p * ln x powr p' \<le> c) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F a in at_top. \<forall>b>a. \<exists>c. \<forall>x\<in>{a..b}. x powr p * ln x powr p' \<le> c
[PROOF STEP]
by (subst eventually_at_top_dense) (force intro: powr_ln_powr_upper_bound)


[STATEMENT]
lemma uniform_limit_le_const:
  fixes f::"'c \<Rightarrow> 'a \<Rightarrow> 'b::{metric_space, linorder_topology}"
  assumes I: "I \<noteq> bot"
  assumes u: "uniform_limit X f g I"
  assumes "\<forall>\<^sub>F i in I. \<forall>x \<in> X. f i x \<le> h x"
  assumes "x \<in> X"
  shows "g x \<le> h x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g x \<le> h x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g x \<le> h x
[PROOF STEP]
have "\<forall>\<^sub>F i in I. f i x \<le> h x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in I. f i x \<le> h x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I \<noteq> bot
uniform_limit X f g I
\<forall>\<^sub>F i in I. \<forall>x\<in>X. f i x \<le> h x
x \<in> X

goal (1 subgoal):
 1. \<forall>\<^sub>F i in I. f i x \<le> h x
[PROOF STEP]
by (simp add: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in I. f i x \<le> h x

goal (1 subgoal):
 1. g x \<le> h x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F i in I. f i x \<le> h x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F i in I. f i x \<le> h x

goal (1 subgoal):
 1. g x \<le> h x
[PROOF STEP]
by (metis tendsto_upperbound I tendsto_uniform_limitI[OF u \<open>x \<in> X\<close>])
[PROOF STATE]
proof (state)
this:
g x \<le> h x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma positively_invariant_barrier:
  fixes V :: "'a \<Rightarrow> real"
  assumes "\<And>x. (V has_derivative V' x) (at x)"
  assumes "continuous_on UNIV (\<lambda>x. V' x (f x))"
  assumes "\<And>s. V s = 0 \<Longrightarrow> V' s (f s) < 0"
  shows "positively_invariant {x. V x \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positively_invariant {x. V x \<le> 0}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. positively_invariant {x. V x \<le> 0}
[PROOF STEP]
from positively_invariant_barrier_domain[OF positively_invariant_UNIV assms]
[PROOF STATE]
proof (chain)
picking this:
(\<And>s. \<lbrakk>s \<in> UNIV; V s = 0\<rbrakk> \<Longrightarrow> V s = 0) \<Longrightarrow> positively_invariant (UNIV \<inter> {x. V x \<le> 0})
[PROOF STEP]
have "positively_invariant (UNIV \<inter> {x. V x \<le> 0})"
[PROOF STATE]
proof (prove)
using this:
(\<And>s. \<lbrakk>s \<in> UNIV; V s = 0\<rbrakk> \<Longrightarrow> V s = 0) \<Longrightarrow> positively_invariant (UNIV \<inter> {x. V x \<le> 0})

goal (1 subgoal):
 1. positively_invariant (UNIV \<inter> {x. V x \<le> 0})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
positively_invariant (UNIV \<inter> {x. V x \<le> 0})

goal (1 subgoal):
 1. positively_invariant {x. V x \<le> 0}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
positively_invariant (UNIV \<inter> {x. V x \<le> 0})

goal (1 subgoal):
 1. positively_invariant {x. V x \<le> 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
positively_invariant {x. V x \<le> 0}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in padic_integers) residues_closed:
  assumes "a \<in> carrier Zp"
  shows "a k \<in> carrier (Zp_res_ring k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a k \<in> carrier (residue_ring (p ^ k))
[PROOF STEP]
using Zp_def assms padic_integers.Zp_defs(3) padic_integers_axioms padic_set_res_closed
[PROOF STATE]
proof (prove)
using this:
Zp \<equiv> padic_int p
a \<in> carrier Zp
padic_integers ?p \<Longrightarrow> carrier (padic_int ?p) = padic_set ?p
padic_integers p
?f \<in> padic_set ?p \<Longrightarrow> ?f ?m \<in> carrier (residue_ring (?p ^ ?m))

goal (1 subgoal):
 1. a k \<in> carrier (residue_ring (p ^ k))
[PROOF STEP]
by blast


[STATEMENT]
lemma cnj_eq_of_real: "cnj q = octo_of_real x \<longleftrightarrow> q = octo_of_real x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Octonions.cnj q = octo_of_real x) = (q = octo_of_real x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Octonions.cnj q = octo_of_real x \<Longrightarrow> q = octo_of_real x
 2. q = octo_of_real x \<Longrightarrow> Octonions.cnj q = octo_of_real x
[PROOF STEP]
show "cnj q = octo_of_real x \<Longrightarrow> q = octo_of_real x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Octonions.cnj q = octo_of_real x \<Longrightarrow> q = octo_of_real x
[PROOF STEP]
by (metis cnj_of_real cnj_cnj)
[PROOF STATE]
proof (state)
this:
Octonions.cnj q = octo_of_real x \<Longrightarrow> q = octo_of_real x

goal (1 subgoal):
 1. q = octo_of_real x \<Longrightarrow> Octonions.cnj q = octo_of_real x
[PROOF STEP]
qed auto


[STATEMENT]
lemma inv_map_sum [simp]:
  "\<lbrakk> bij f; bij g \<rbrakk> \<Longrightarrow> inv_into UNIV (map_sum f g) = map_sum (inv_into UNIV f) (inv_into UNIV g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bij f; bij g\<rbrakk> \<Longrightarrow> inv (map_sum f g) = map_sum (inv f) (inv g)
[PROOF STEP]
by(rule inj_imp_inv_eq)(simp_all add: sum.map_comp sum.inj_map bij_def surj_iff sum.map_id)


[STATEMENT]
lemma summable_vec_nth :
  assumes "summable f"
  shows "summable (\<lambda>x. f x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>x. f x $ i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
summable f

goal (1 subgoal):
 1. summable (\<lambda>x. f x $ i)
[PROOF STEP]
unfolding summable_def
[PROOF STATE]
proof (prove)
using this:
Ex ((sums) f)

goal (1 subgoal):
 1. Ex ((sums) (\<lambda>x. f x $ i))
[PROOF STEP]
by (blast intro: sums_vec_nth)


[STATEMENT]
lemma rot_0[simp]: "rot 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rot (0::'a) = (0::'a)
[PROOF STEP]
using rot_scaleR[of 0]
[PROOF STATE]
proof (prove)
using this:
rot (0 *\<^sub>R ?v) = 0 *\<^sub>R rot ?v

goal (1 subgoal):
 1. rot (0::'a) = (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma ereal_minus_mono:
  fixes A B C D :: ereal assumes "A \<le> B" "D \<le> C"
  shows "A - C \<le> B - D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - C \<le> B - D
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<le> B
D \<le> C

goal (1 subgoal):
 1. A - C \<le> B - D
[PROOF STEP]
by (cases rule: ereal3_cases[case_product ereal_cases, of A B C D]) simp_all


[STATEMENT]
lemma deduct_if_deduct_num: "\<langle>M; k\<rangle> \<turnstile>\<^sub>n t \<Longrightarrow> M \<turnstile> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>M; k\<rangle> \<turnstile>\<^sub>n t \<Longrightarrow> M \<turnstile> t
[PROOF STEP]
by (induct t rule: intruder_deduct_num.induct)
   (metis intruder_deduct.Axiom,
    metis intruder_deduct.Compose,
    metis intruder_deduct.Decompose)


[STATEMENT]
lemma is_pure_the_pure_id_eq[simp]: "is_pure R \<Longrightarrow> the_pure R = Id \<longleftrightarrow> R=pure Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pure R \<Longrightarrow> (the_pure R = Id) = (R = pure Id)
[PROOF STEP]
by (auto simp: is_pure_conv)


[STATEMENT]
lemma sat_RESTRICT: "sat \<AA> \<phi> \<longleftrightarrow> \<AA> \<Turnstile> RESTRICT \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sat \<AA> \<phi> = (\<AA> \<Turnstile> RESTRICT \<phi>)
[PROOF STEP]
unfolding sat_def RESTRICT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sat_vars_gen (\<lambda>k P n. True) UNIV \<AA> \<phi> = (\<AA> \<Turnstile> RESTRICT_VARS enum_class.enum (sorted_list_of_set \<circ> FV \<phi>) \<phi>)
[PROOF STEP]
using sat_vars_RESTRICT_VARS[of Enum.enum, symmetric]
[PROOF STATE]
proof (prove)
using this:
\<forall>k\<in>set enum_class.enum. finite (FV ?\<phi> k) \<Longrightarrow> satisfies_gen ?r ?\<AA> (RESTRICT_VARS enum_class.enum (sorted_list_of_set \<circ> FV ?\<phi>) ?\<phi>) = sat_vars_gen ?r (set enum_class.enum) ?\<AA> ?\<phi>

goal (1 subgoal):
 1. sat_vars_gen (\<lambda>k P n. True) UNIV \<AA> \<phi> = (\<AA> \<Turnstile> RESTRICT_VARS enum_class.enum (sorted_list_of_set \<circ> FV \<phi>) \<phi>)
[PROOF STEP]
by (auto simp: finite_FV enum_UNIV)


[STATEMENT]
lemma Ex_surj_conv: assumes "surj f" shows "(\<exists>x. P (f x)) \<longleftrightarrow> (\<exists>y. P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P (f x)) = (\<exists>y. P y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. P (f x) \<Longrightarrow> \<exists>y. P y
 2. \<exists>y. P y \<Longrightarrow> \<exists>x. P (f x)
[PROOF STEP]
assume "\<exists>x. P (f x)"
[PROOF STATE]
proof (state)
this:
\<exists>x. P (f x)

goal (2 subgoals):
 1. \<exists>x. P (f x) \<Longrightarrow> \<exists>y. P y
 2. \<exists>y. P y \<Longrightarrow> \<exists>x. P (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. P (f x)
[PROOF STEP]
obtain x where "P (f x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. P (f x)

goal (1 subgoal):
 1. (\<And>x. P (f x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
P (f x)

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

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

goal (1 subgoal):
 1. \<exists>y. P y \<Longrightarrow> \<exists>x. P (f x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y. P y \<Longrightarrow> \<exists>x. P (f x)
[PROOF STEP]
assume "\<exists>y. P y"
[PROOF STATE]
proof (state)
this:
\<exists>y. P y

goal (1 subgoal):
 1. \<exists>y. P y \<Longrightarrow> \<exists>x. P (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. P y
[PROOF STEP]
obtain y where "P y"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. P y

goal (1 subgoal):
 1. (\<And>y. P y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
P y

goal (1 subgoal):
 1. \<exists>y. P y \<Longrightarrow> \<exists>x. P (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P y
[PROOF STEP]
have "P (f (inv f y))"
[PROOF STATE]
proof (prove)
using this:
P y

goal (1 subgoal):
 1. P (f (inv f y))
[PROOF STEP]
unfolding surj_f_inv_f[OF assms]
[PROOF STATE]
proof (prove)
using this:
P y

goal (1 subgoal):
 1. P y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P (f (inv f y))

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

goal (1 subgoal):
 1. \<exists>x. P (f x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>x. P (f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma U0_altdef: "U\<^sub>0 = {prenum e| e. e \<in> UNIV}" (is "U\<^sub>0 = ?W")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>0 = {prenum e |e. e \<in> UNIV}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. U\<^sub>0 \<subseteq> {prenum e |e. e \<in> UNIV}
 2. {prenum e |e. e \<in> UNIV} \<subseteq> U\<^sub>0
[PROOF STEP]
show "U\<^sub>0 \<subseteq> ?W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>0 \<subseteq> {prenum e |e. e \<in> UNIV}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> U\<^sub>0 \<Longrightarrow> x \<in> {prenum e |e. e \<in> UNIV}
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> U\<^sub>0 \<Longrightarrow> x \<in> {prenum e |e. e \<in> UNIV}
[PROOF STEP]
assume "f \<in> U\<^sub>0"
[PROOF STATE]
proof (state)
this:
f \<in> U\<^sub>0

goal (1 subgoal):
 1. \<And>x. x \<in> U\<^sub>0 \<Longrightarrow> x \<in> {prenum e |e. e \<in> UNIV}
[PROOF STEP]
with U0_def
[PROOF STATE]
proof (chain)
picking this:
U\<^sub>0 \<equiv> {vs \<odot> 0\<^sup>\<infinity> |vs. vs \<in> UNIV}
f \<in> U\<^sub>0
[PROOF STEP]
obtain vs where "f = vs \<odot> 0\<^sup>\<infinity>"
[PROOF STATE]
proof (prove)
using this:
U\<^sub>0 \<equiv> {vs \<odot> 0\<^sup>\<infinity> |vs. vs \<in> UNIV}
f \<in> U\<^sub>0

goal (1 subgoal):
 1. (\<And>vs. f = vs \<odot> 0\<^sup>\<infinity> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = vs \<odot> 0\<^sup>\<infinity>

goal (1 subgoal):
 1. \<And>x. x \<in> U\<^sub>0 \<Longrightarrow> x \<in> {prenum e |e. e \<in> UNIV}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = vs \<odot> 0\<^sup>\<infinity>
[PROOF STEP]
have "f = prenum (list_encode vs)"
[PROOF STATE]
proof (prove)
using this:
f = vs \<odot> 0\<^sup>\<infinity>

goal (1 subgoal):
 1. f = prenum (Partial_Recursive.list_encode vs)
[PROOF STEP]
using prenum_encode
[PROOF STATE]
proof (prove)
using this:
f = vs \<odot> 0\<^sup>\<infinity>
prenum (Partial_Recursive.list_encode ?vs) ?x \<down>= (if ?x < length ?vs then ?vs ! ?x else 0)

goal (1 subgoal):
 1. f = prenum (Partial_Recursive.list_encode vs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = prenum (Partial_Recursive.list_encode vs)

goal (1 subgoal):
 1. \<And>x. x \<in> U\<^sub>0 \<Longrightarrow> x \<in> {prenum e |e. e \<in> UNIV}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = prenum (Partial_Recursive.list_encode vs)
[PROOF STEP]
show "f \<in> ?W"
[PROOF STATE]
proof (prove)
using this:
f = prenum (Partial_Recursive.list_encode vs)

goal (1 subgoal):
 1. f \<in> {prenum e |e. e \<in> UNIV}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> {prenum e |e. e \<in> UNIV}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
U\<^sub>0 \<subseteq> {prenum e |e. e \<in> UNIV}

goal (1 subgoal):
 1. {prenum e |e. e \<in> UNIV} \<subseteq> U\<^sub>0
[PROOF STEP]
show "?W \<subseteq> U\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {prenum e |e. e \<in> UNIV} \<subseteq> U\<^sub>0
[PROOF STEP]
unfolding U0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {prenum e |e. e \<in> UNIV} \<subseteq> {vs \<odot> 0\<^sup>\<infinity> |vs. vs \<in> UNIV}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{prenum e |e. e \<in> UNIV} \<subseteq> U\<^sub>0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_rsplit_len: "n \<noteq> 0 \<Longrightarrow> length (bin_rsplit n (nw, w)) = (nw + n - 1) div n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> length (bin_rsplit n (nw, w)) = (nw + n - 1) div n
[PROOF STEP]
by (auto simp: bin_rsplit_def bin_rsplit_aux_len)


[STATEMENT]
lemma (in monoid_cancel) properfactor_mult_l [simp]:
  assumes carr: "a \<in> carrier G"  "b \<in> carrier G"  "c \<in> carrier G"
  shows "properfactor G (c \<otimes> a) (c \<otimes> b) = properfactor G a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properfactor G (c \<otimes> a) (c \<otimes> b) = properfactor G a b
[PROOF STEP]
using carr
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G
b \<in> carrier G
c \<in> carrier G

goal (1 subgoal):
 1. properfactor G (c \<otimes> a) (c \<otimes> b) = properfactor G a b
[PROOF STEP]
by (fastforce elim: properfactorE intro: properfactorI)


[STATEMENT]
lemma iterate_add_1: \<open>iterate_add n 1 = of_nat n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iterate_add n (1::'a) = of_nat n
[PROOF STEP]
using iterate_add_Numeral1
[PROOF STATE]
proof (prove)
using this:
iterate_add ?n Numeral1 = of_nat ?n

goal (1 subgoal):
 1. iterate_add n (1::'a) = of_nat n
[PROOF STEP]
by auto


[STATEMENT]
lemma aligned_add_offset_mod:
  fixes x :: "('a::len) word"
  assumes al: "is_aligned x sz"
  and     kv: "k < 2 ^ sz"
  shows   "(x + k) mod 2 ^ sz = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + k) mod 2 ^ sz = k
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> (x + k) mod 2 ^ sz = k
 2. \<not> ?P \<Longrightarrow> (x + k) mod 2 ^ sz = k
[PROOF STEP]
assume szv: "sz < LENGTH('a)"
[PROOF STATE]
proof (state)
this:
sz < LENGTH('a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> (x + k) mod 2 ^ sz = k
 2. \<not> ?P \<Longrightarrow> (x + k) mod 2 ^ sz = k
[PROOF STEP]
have ux: "unat x + unat k < 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat x + unat k < 2 ^ LENGTH('a)
[PROOF STEP]
by (rule aligned_add_offset_no_wrap) fact+
[PROOF STATE]
proof (state)
this:
unat x + unat k < 2 ^ LENGTH('a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> (x + k) mod 2 ^ sz = k
 2. \<not> ?P \<Longrightarrow> (x + k) mod 2 ^ sz = k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + k) mod 2 ^ sz = k
[PROOF STEP]
using al szv
[PROOF STATE]
proof (prove)
using this:
is_aligned x sz
sz < LENGTH('a)

goal (1 subgoal):
 1. (x + k) mod 2 ^ sz = k
[PROOF STEP]
apply (simp flip: take_bit_eq_mod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_aligned x sz; sz < LENGTH('a)\<rbrakk> \<Longrightarrow> take_bit sz (x + k) = k
[PROOF STEP]
apply (rule bit_word_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>is_aligned x sz; sz < LENGTH('a); n < LENGTH('a)\<rbrakk> \<Longrightarrow> bit (take_bit sz (x + k)) n = bit k n
[PROOF STEP]
apply (auto simp add: bit_simps)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. \<lbrakk>is_aligned x sz; sz < LENGTH('a); n < sz; bit (x + k) n\<rbrakk> \<Longrightarrow> bit k n
 2. \<And>n. \<lbrakk>is_aligned x sz; sz < LENGTH('a); n < LENGTH('a); bit k n\<rbrakk> \<Longrightarrow> n < sz
 3. \<And>n. \<lbrakk>is_aligned x sz; sz < LENGTH('a); n < LENGTH('a); bit k n\<rbrakk> \<Longrightarrow> bit (x + k) n
[PROOF STEP]
apply (metis assms(2) bit_or_iff is_aligned_mask is_aligned_nth leD less_mask_eq word_and_le1 word_bw_lcs(1) word_neq_0_conv word_plus_and_or_coroll)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>is_aligned x sz; sz < LENGTH('a); n < LENGTH('a); bit k n\<rbrakk> \<Longrightarrow> n < sz
 2. \<And>n. \<lbrakk>is_aligned x sz; sz < LENGTH('a); n < LENGTH('a); bit k n\<rbrakk> \<Longrightarrow> bit (x + k) n
[PROOF STEP]
apply (meson assms(2) leI less_2p_is_upper_bits_unset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>is_aligned x sz; sz < LENGTH('a); n < LENGTH('a); bit k n\<rbrakk> \<Longrightarrow> bit (x + k) n
[PROOF STEP]
apply (metis assms(2) bit_disjunctive_add_iff bit_imp_le_length bit_push_bit_iff is_alignedE' less_2p_is_upper_bits_unset)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(x + k) mod 2 ^ sz = k

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> (x + k) mod 2 ^ sz = k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> (x + k) mod 2 ^ sz = k
[PROOF STEP]
assume "\<not> sz < LENGTH('a)"
[PROOF STATE]
proof (state)
this:
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> (x + k) mod 2 ^ sz = k
[PROOF STEP]
with al
[PROOF STATE]
proof (chain)
picking this:
is_aligned x sz
\<not> sz < LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_aligned x sz
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. (x + k) mod 2 ^ sz = k
[PROOF STEP]
by (simp add: not_less power_overflow is_aligned_mask mask_eq_decr_exp
                  word_mod_by_0)
[PROOF STATE]
proof (state)
this:
(x + k) mod 2 ^ sz = k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isShortestPath_level_edge:
  assumes SP: "isShortestPath s p t"
  assumes EIP: "(u,v)\<in>set p"
  shows
    "connected s u" "connected u v" "connected v t" and
    "min_dist s v = min_dist s u + 1" (is ?G1) and
    "min_dist u t = 1 + min_dist v t" (is ?G2) and
    "min_dist s t = min_dist s u + 1 + min_dist v t" (is ?G3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((connected s u &&& connected u v &&& connected v t) &&& min_dist s v = min_dist s u + 1) &&& min_dist u t = 1 + min_dist v t &&& min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
proof -
  \<comment> \<open>Split the original path at the edge\<close>
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. connected s u
 2. connected u v
 3. connected v t
 4. min_dist s v = min_dist s u + 1
 5. min_dist u t = 1 + min_dist v t
 6. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from EIP
[PROOF STATE]
proof (chain)
picking this:
(u, v) \<in> set p
[PROOF STEP]
obtain p1 p2 where [simp]: "p=p1@(u,v)#p2"
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> set p

goal (1 subgoal):
 1. (\<And>p1 p2. p = p1 @ (u, v) # p2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: in_set_conv_decomp)
[PROOF STATE]
proof (state)
this:
p = p1 @ (u, v) # p2

goal (6 subgoals):
 1. connected s u
 2. connected u v
 3. connected v t
 4. min_dist s v = min_dist s u + 1
 5. min_dist u t = 1 + min_dist v t
 6. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from \<open>isShortestPath s p t\<close>
[PROOF STATE]
proof (chain)
picking this:
isShortestPath s p t
[PROOF STEP]
have
    MIN: "min_dist s t = length p" and
      P: "isPath s p t" and
     DV: "distinct (pathVertices s p)"
[PROOF STATE]
proof (prove)
using this:
isShortestPath s p t

goal (1 subgoal):
 1. min_dist s t = length p &&& isPath s p t &&& distinct (pathVertices s p)
[PROOF STEP]
by (auto simp: isShortestPath_alt isSimplePath_def)
[PROOF STATE]
proof (state)
this:
min_dist s t = length p
isPath s p t
distinct (pathVertices s p)

goal (6 subgoals):
 1. connected s u
 2. connected u v
 3. connected v t
 4. min_dist s v = min_dist s u + 1
 5. min_dist u t = 1 + min_dist v t
 6. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
isPath s p t
[PROOF STEP]
have DISTS: "dist s (length p1) u" "dist u 1 v" "dist v (length p2) t"
[PROOF STATE]
proof (prove)
using this:
isPath s p t

goal (1 subgoal):
 1. dist s (length p1) u &&& dist u 1 v &&& dist v (length p2) t
[PROOF STEP]
by (auto simp: isPath_append dist_def intro: exI[where x="[(u,v)]"])
[PROOF STATE]
proof (state)
this:
dist s (length p1) u
dist u 1 v
dist v (length p2) t

goal (6 subgoals):
 1. connected s u
 2. connected u v
 3. connected v t
 4. min_dist s v = min_dist s u + 1
 5. min_dist u t = 1 + min_dist v t
 6. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from DISTS
[PROOF STATE]
proof (chain)
picking this:
dist s (length p1) u
dist u 1 v
dist v (length p2) t
[PROOF STEP]
show "connected s u" "connected u v" "connected v t"
[PROOF STATE]
proof (prove)
using this:
dist s (length p1) u
dist u 1 v
dist v (length p2) t

goal (1 subgoal):
 1. connected s u &&& connected u v &&& connected v t
[PROOF STEP]
by auto

  \<comment> \<open>Express the minimum distances in terms of the split original path\<close>
[PROOF STATE]
proof (state)
this:
connected s u
connected u v
connected v t

goal (3 subgoals):
 1. min_dist s v = min_dist s u + 1
 2. min_dist u t = 1 + min_dist v t
 3. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from MIN
[PROOF STATE]
proof (chain)
picking this:
min_dist s t = length p
[PROOF STEP]
have MIN': "min_dist s t = length p1 + 1 + length p2"
[PROOF STATE]
proof (prove)
using this:
min_dist s t = length p

goal (1 subgoal):
 1. min_dist s t = length p1 + 1 + length p2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
min_dist s t = length p1 + 1 + length p2

goal (3 subgoals):
 1. min_dist s v = min_dist s u + 1
 2. min_dist u t = 1 + min_dist v t
 3. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from min_dist_split[OF dist_trans[OF DISTS(1,2)] DISTS(3) MIN']
[PROOF STATE]
proof (chain)
picking this:
min_dist s v = length p1 + 1
min_dist v t = length p2
[PROOF STEP]
have
      MDSV: "min_dist s v = length p1 + 1" and
    [simp]: "length p2 = min_dist v t"
[PROOF STATE]
proof (prove)
using this:
min_dist s v = length p1 + 1
min_dist v t = length p2

goal (1 subgoal):
 1. min_dist s v = length p1 + 1 &&& length p2 = min_dist v t
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
min_dist s v = length p1 + 1
length p2 = min_dist v t

goal (3 subgoals):
 1. min_dist s v = min_dist s u + 1
 2. min_dist u t = 1 + min_dist v t
 3. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from min_dist_split[OF DISTS(1) dist_trans[OF DISTS(2,3)]] MIN'
[PROOF STATE]
proof (chain)
picking this:
min_dist s t = length p1 + (1 + length p2) \<Longrightarrow> min_dist s u = length p1
min_dist s t = length p1 + (1 + length p2) \<Longrightarrow> min_dist u t = 1 + length p2
min_dist s t = length p1 + 1 + length p2
[PROOF STEP]
have
      MDUT: "min_dist u t = 1 + length p2" and
    [simp]: "length p1 = min_dist s u"
[PROOF STATE]
proof (prove)
using this:
min_dist s t = length p1 + (1 + length p2) \<Longrightarrow> min_dist s u = length p1
min_dist s t = length p1 + (1 + length p2) \<Longrightarrow> min_dist u t = 1 + length p2
min_dist s t = length p1 + 1 + length p2

goal (1 subgoal):
 1. min_dist u t = 1 + length p2 &&& length p1 = min_dist s u
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
min_dist u t = 1 + length p2
length p1 = min_dist s u

goal (3 subgoals):
 1. min_dist s v = min_dist s u + 1
 2. min_dist u t = 1 + min_dist v t
 3. min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
from MDSV MDUT MIN'
[PROOF STATE]
proof (chain)
picking this:
min_dist s v = length p1 + 1
min_dist u t = 1 + length p2
min_dist s t = length p1 + 1 + length p2
[PROOF STEP]
show ?G1 ?G2 ?G3
[PROOF STATE]
proof (prove)
using this:
min_dist s v = length p1 + 1
min_dist u t = 1 + length p2
min_dist s t = length p1 + 1 + length p2

goal (1 subgoal):
 1. min_dist s v = min_dist s u + 1 &&& min_dist u t = 1 + min_dist v t &&& min_dist s t = min_dist s u + 1 + min_dist v t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
min_dist s v = min_dist s u + 1
min_dist u t = 1 + min_dist v t
min_dist s t = min_dist s u + 1 + min_dist v t

goal:
No subgoals!
[PROOF STEP]
qed