[STATEMENT]
theorem (in Gromov_hyperbolic_space_geodesic) Morse_Gromov_theorem_BH_proof:
  fixes c::"real \<Rightarrow> 'a"
  assumes "lambda C-quasi_isometry_on {A..B} c"
  shows "hausdorff_distance (c`{A..B}) {c A--c B} \<le> 72 * lambda^2 * (C + lambda + deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have C: "C \<ge> 0" "lambda \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> C &&& 1 \<le> lambda
[PROOF STEP]
using quasi_isometry_onD[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> {A..B}; ?y \<in> {A..B}\<rbrakk> \<Longrightarrow> dist (c ?x) (c ?y) \<le> lambda * dist ?x ?y + C
\<lbrakk>?x \<in> {A..B}; ?y \<in> {A..B}\<rbrakk> \<Longrightarrow> 1 / lambda * dist ?x ?y - C \<le> dist (c ?x) (c ?y)
1 \<le> lambda
0 \<le> C

goal (1 subgoal):
 1. 0 \<le> C &&& 1 \<le> lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
consider "B-A < 0" | "B-A \<ge> 0 \<and> dist (c A) (c B) \<le> 2 * C" | "B-A \<ge> 0 \<and> dist (c A) (c B) > 2 * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B - A < 0 \<Longrightarrow> thesis; 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> thesis; 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>B - A < 0 \<Longrightarrow> ?thesis; 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> ?thesis; 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>B - A < 0 \<Longrightarrow> ?thesis; 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> ?thesis; 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>B - A < 0 \<Longrightarrow> ?thesis; 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> ?thesis; 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. B - A < 0 \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 3. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
B - A < 0

goal (3 subgoals):
 1. B - A < 0 \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 3. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B - A < 0
[PROOF STEP]
have "c`{A..B} = {}"
[PROOF STATE]
proof (prove)
using this:
B - A < 0

goal (1 subgoal):
 1. c ` {A..B} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c ` {A..B} = {}

goal (3 subgoals):
 1. B - A < 0 \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 3. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c ` {A..B} = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c ` {A..B} = {}

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
unfolding hausdorff_distance_def
[PROOF STATE]
proof (prove)
using this:
c ` {A..B} = {}

goal (1 subgoal):
 1. (if c ` {A..B} = {} \<or> {c A--c B} = {} \<or> \<not> bounded (c ` {A..B}) \<or> \<not> bounded {c A--c B} then 0 else max (SUP x\<in>c ` {A..B}. infdist x {c A--c B}) (SUP x\<in>{c A--c B}. infdist x (c ` {A..B}))) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
using delta_nonneg C
[PROOF STATE]
proof (prove)
using this:
c ` {A..B} = {}
0 \<le> deltaG TYPE('a)
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. (if c ` {A..B} = {} \<or> {c A--c B} = {} \<or> \<not> bounded (c ` {A..B}) \<or> \<not> bounded {c A--c B} then 0 else max (SUP x\<in>c ` {A..B}. infdist x {c A--c B}) (SUP x\<in>{c A--c B}. infdist x (c ` {A..B}))) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "(1/lambda) * dist A B - C \<le> dist (c A) (c B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / lambda * dist A B - C \<le> dist (c A) (c B)
[PROOF STEP]
apply (rule quasi_isometry_onD[OF assms])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A \<in> {A..B}
 2. B \<in> {A..B}
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (2 subgoals):
 1. A \<in> {A..B}
 2. B \<in> {A..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / lambda * dist A B - C \<le> dist (c A) (c B)

goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / lambda * dist A B - C \<le> dist (c A) (c B)

goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> 2 * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (c A) (c B) \<le> 2 * C
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (1 subgoal):
 1. dist (c A) (c B) \<le> 2 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (c A) (c B) \<le> 2 * C

goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 / lambda * dist A B - C \<le> 2 * C
[PROOF STEP]
have "dist A B \<le> 3 * lambda * C"
[PROOF STATE]
proof (prove)
using this:
1 / lambda * dist A B - C \<le> 2 * C

goal (1 subgoal):
 1. dist A B \<le> 3 * lambda * C
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
1 / lambda * dist A B - C \<le> 2 * C
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. dist A B \<le> 3 * lambda * C
[PROOF STEP]
by (auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
dist A B \<le> 3 * lambda * C

goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist A B \<le> 3 * lambda * C
[PROOF STEP]
have *: "B - A \<le> 3 * lambda * C"
[PROOF STATE]
proof (prove)
using this:
dist A B \<le> 3 * lambda * C

goal (1 subgoal):
 1. B - A \<le> 3 * lambda * C
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
dist A B \<le> 3 * lambda * C
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (1 subgoal):
 1. B - A \<le> 3 * lambda * C
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
\<bar>A - B\<bar> \<le> 3 * lambda * C
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (1 subgoal):
 1. B - A \<le> 3 * lambda * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B - A \<le> 3 * lambda * C

goal (2 subgoals):
 1. 0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
proof (rule hausdorff_distanceI2)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 3. 0 \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
show "0 \<le> 72 * lambda^2 * (C + lambda + deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. 0 \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
assume "x \<in> c`{A..B}"
[PROOF STATE]
proof (state)
this:
x \<in> c ` {A..B}

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> c ` {A..B}
[PROOF STEP]
obtain t where t: "x = c t" "t \<in> {A..B}"
[PROOF STATE]
proof (prove)
using this:
x \<in> c ` {A..B}

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>x = c t; t \<in> {A..B}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = c t
t \<in> {A..B}

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "dist x (c A) \<le> lambda * dist t A + C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x (c A) \<le> lambda * dist t A + C
[PROOF STEP]
unfolding t(1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (c t) (c A) \<le> lambda * dist t A + C
[PROOF STEP]
using quasi_isometry_onD(1)[OF assms t(2), of A] 2
[PROOF STATE]
proof (prove)
using this:
A \<in> {A..B} \<Longrightarrow> dist (c t) (c A) \<le> lambda * dist t A + C
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (1 subgoal):
 1. dist (c t) (c A) \<le> lambda * dist t A + C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist x (c A) \<le> lambda * dist t A + C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist x (c A) \<le> lambda * dist t A + C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> lambda * (B-A) + C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * dist t A + C \<le> lambda * (B - A) + C
[PROOF STEP]
using t(2) 2 C
[PROOF STATE]
proof (prove)
using this:
t \<in> {A..B}
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. lambda * dist t A + C \<le> lambda * (B - A) + C
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
t \<in> {A..B}
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. lambda * \<bar>t - A\<bar> + C \<le> lambda * (B - A) + C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * dist t A + C \<le> lambda * (B - A) + C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lambda * dist t A + C \<le> lambda * (B - A) + C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> 3 * lambda * lambda * C + 1 * 1 * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * (B - A) + C \<le> 3 * lambda * lambda * C + 1 * 1 * C
[PROOF STEP]
using * C
[PROOF STATE]
proof (prove)
using this:
B - A \<le> 3 * lambda * C
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. lambda * (B - A) + C \<le> 3 * lambda * lambda * C + 1 * 1 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * (B - A) + C \<le> 3 * lambda * lambda * C + 1 * 1 * C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lambda * (B - A) + C \<le> 3 * lambda * lambda * C + 1 * 1 * C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> 3 * lambda * lambda * C + lambda * lambda * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * lambda * lambda * C + 1 * 1 * C \<le> 3 * lambda * lambda * C + lambda * lambda * C
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 0 \<le> C
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (5 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 0 \<le> C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 * lambda * lambda * C + 1 * 1 * C \<le> 3 * lambda * lambda * C + lambda * lambda * C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3 * lambda * lambda * C + 1 * 1 * C \<le> 3 * lambda * lambda * C + lambda * lambda * C

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... = 4 * lambda * lambda * (C + 0 + 0^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * lambda * lambda * C + lambda * lambda * C = 4 * lambda * lambda * (C + 0 + 0\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 * lambda * lambda * C + lambda * lambda * C = 4 * lambda * lambda * (C + 0 + 0\<^sup>2)

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3 * lambda * lambda * C + lambda * lambda * C = 4 * lambda * lambda * (C + 0 + 0\<^sup>2)

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> 72 * lambda * lambda * (C + lambda + deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * lambda * lambda * (C + 0 + 0\<^sup>2) \<le> 72 * lambda * lambda * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. 4 \<le> 72
 2. 0 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> lambda
 5. 0 \<le> 0
 6. 0 \<le> 72 * lambda * lambda
 7. 0 \<le> C + 0 + 0\<^sup>2
[PROOF STEP]
using C delta_nonneg
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
0 \<le> deltaG TYPE('a)

goal (7 subgoals):
 1. 4 \<le> 72
 2. 0 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> lambda
 5. 0 \<le> 0
 6. 0 \<le> 72 * lambda * lambda
 7. 0 \<le> C + 0 + 0\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
4 * lambda * lambda * (C + 0 + 0\<^sup>2) \<le> 72 * lambda * lambda * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have *: "dist x (c A) \<le> 72 * lambda^2 * (C + lambda + deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
using this:
dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. dist x (c A) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
unfolding power2_eq_square
[PROOF STATE]
proof (prove)
using this:
dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))

goal (1 subgoal):
 1. dist x (c A) \<le> 72 * (lambda * lambda) * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist x (c A) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (2 subgoals):
 1. \<And>x. x \<in> c ` {A..B} \<Longrightarrow> \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
show "\<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda^2 * (C + lambda + deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
apply (rule bexI[of _ "c A"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dist x (c A) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. c A \<in> {c A--c B}
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
dist x (c A) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (2 subgoals):
 1. dist x (c A) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. c A \<in> {c A--c B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>{c A--c B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
assume "x \<in> {c A-- c B}"
[PROOF STATE]
proof (state)
this:
x \<in> {c A--c B}

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {c A--c B}
[PROOF STEP]
have "dist x (c A) \<le> dist (c A) (c B)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {c A--c B}

goal (1 subgoal):
 1. dist x (c A) \<le> dist (c A) (c B)
[PROOF STEP]
by (meson geodesic_segment_dist_le geodesic_segment_endpoints(1) local.some_geodesic_is_geodesic_segment(1))
[PROOF STATE]
proof (state)
this:
dist x (c A) \<le> dist (c A) (c B)

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist x (c A) \<le> dist (c A) (c B)

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> 2 * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (c A) (c B) \<le> 2 * C
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (1 subgoal):
 1. dist (c A) (c B) \<le> 2 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (c A) (c B) \<le> 2 * C

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (c A) (c B) \<le> 2 * C

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> 2 * 1 * 1 * (C + lambda + 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * C \<le> 2 * 1 * 1 * (C + lambda + 0)
[PROOF STEP]
using 2 C
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. 2 * C \<le> 2 * 1 * 1 * (C + lambda + 0)
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. 2 * C \<le> 2 * 1 * 1 * (C + lambda + 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * C \<le> 2 * 1 * 1 * (C + lambda + 0)

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * C \<le> 2 * 1 * 1 * (C + lambda + 0)

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> 72 * lambda * lambda * (C + lambda + deltaG(TYPE('a)) * deltaG(TYPE('a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * 1 * 1 * (C + lambda + 0) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. 2 \<le> 72
 2. 1 \<le> lambda
 3. 0 \<le> 72
 4. 0 \<le> 1
 5. 1 \<le> lambda
 6. 0 \<le> 72 * lambda
 7. 0 \<le> 1
 8. 0 \<le> deltaG TYPE('a) * deltaG TYPE('a)
 9. 0 \<le> 72 * lambda * lambda
 10. 0 \<le> C + lambda + 0
[PROOF STEP]
using C delta_nonneg
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
0 \<le> deltaG TYPE('a)

goal (10 subgoals):
 1. 2 \<le> 72
 2. 1 \<le> lambda
 3. 0 \<le> 72
 4. 0 \<le> 1
 5. 1 \<le> lambda
 6. 0 \<le> 72 * lambda
 7. 0 \<le> 1
 8. 0 \<le> deltaG TYPE('a) * deltaG TYPE('a)
 9. 0 \<le> 72 * lambda * lambda
 10. 0 \<le> C + lambda + 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * 1 * 1 * (C + lambda + 0) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
have *: "dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + deltaG(TYPE('a)) * deltaG(TYPE('a)))"
[PROOF STATE]
proof (prove)
using this:
dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))

goal (1 subgoal):
 1. dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
show "\<exists>y\<in>c`{A..B}. dist x y \<le> 72 * lambda^2 * (C + lambda + deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
apply (rule bexI[of _ "c A"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dist x (c A) \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
 2. c A \<in> c ` {A..B}
[PROOF STEP]
unfolding power2_eq_square
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dist x (c A) \<le> 72 * (lambda * lambda) * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))
 2. c A \<in> c ` {A..B}
[PROOF STEP]
using * 2
[PROOF STATE]
proof (prove)
using this:
dist x (c A) \<le> 72 * lambda * lambda * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))
0 \<le> B - A \<and> dist (c A) (c B) \<le> 2 * C

goal (2 subgoals):
 1. dist x (c A) \<le> 72 * (lambda * lambda) * (C + lambda + deltaG TYPE('a) * deltaG TYPE('a))
 2. c A \<in> c ` {A..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>c ` {A..B}. dist x y \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
case 3
[PROOF STATE]
proof (state)
this:
0 \<le> B - A \<and> 2 * C < dist (c A) (c B)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> B - A \<and> 2 * C < dist (c A) (c B)
[PROOF STEP]
obtain d where d: "continuous_on {A..B} d" "d A = c A" "d B = c B"
              "\<And>x. x \<in> {A..B} \<Longrightarrow> dist (c x) (d x) \<le> 4 *C"
              "lambda (4 * C)-quasi_isometry_on {A..B} d"
              "(2 * lambda)-lipschitz_on {A..B} d"
              "hausdorff_distance (c`{A..B}) (d`{A..B}) \<le> 2 * C"
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> 2 * C < dist (c A) (c B)

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>continuous_on {A..B} d; d A = c A; d B = c B; \<And>x. x \<in> {A..B} \<Longrightarrow> dist (c x) (d x) \<le> 4 * C; lambda (4 * C) -quasi_isometry_on {A..B} d; (2 * lambda)-lipschitz_on {A..B} d; hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 2 * C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using quasi_geodesic_made_lipschitz[OF assms] C(1)
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> 2 * C < dist (c A) (c B)
2 * C \<le> dist (c A) (c B) \<Longrightarrow> \<exists>d. continuous_on {A..B} d \<and> d A = c A \<and> d B = c B \<and> (\<forall>x\<in>{A..B}. dist (c x) (d x) \<le> 4 * C) \<and> lambda (4 * C) -quasi_isometry_on {A..B} d \<and> (2 * lambda)-lipschitz_on {A..B} d \<and> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 2 * C
0 \<le> C

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>continuous_on {A..B} d; d A = c A; d B = c B; \<And>x. x \<in> {A..B} \<Longrightarrow> dist (c x) (d x) \<le> 4 * C; lambda (4 * C) -quasi_isometry_on {A..B} d; (2 * lambda)-lipschitz_on {A..B} d; hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 2 * C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
continuous_on {A..B} d
d A = c A
d B = c B
?x \<in> {A..B} \<Longrightarrow> dist (c ?x) (d ?x) \<le> 4 * C
lambda (4 * C) -quasi_isometry_on {A..B} d
(2 * lambda)-lipschitz_on {A..B} d
hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 2 * C

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "A \<in> {A..B}" "B \<in> {A..B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> {A..B} &&& B \<in> {A..B}
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> 2 * C < dist (c A) (c B)

goal (1 subgoal):
 1. A \<in> {A..B} &&& B \<in> {A..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> {A..B}
B \<in> {A..B}

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
text \<open>We show that the distance of any point in the geodesic from $c(A)$ to $c(B)$ is a bounded
    distance away from the quasi-geodesic $d$, by considering a point $x$ where the distance $D$ is
    maximal and arguing around this point.

    Consider the point $x_m$ on the geodesic $[c(A), c(B)]$ at distance $2D$ from $x$, and the closest
    point $y_m$ on the image of $d$. Then the distance between $x_m$ and $y_m$ is at most $D$. Hence
    a point on $[x_m,y_m]$ is at distance at least $2D - D = D$ of $x$. In the same way, define $x_M$
    and $y_M$ on the other side of $x$. Then the excursion from $x_m$ to $y_m$, then to $y_M$ along
    $d$, then to $x_M$, has length at most $D + (\lambda \cdot 6D + C) + D$ and is always at distance
    at least $D$ from $x$. It follows from the previous lemma that $D \leq \log(length)$, which
    implies a bound on $D$.

    This argument has to be amended if $x$ is at distance $ < 2D$ from $c(A)$ or $c(B)$. In this case,
    simply use $x_m = y_m = c(A)$ or $x_M = y_M = c(B)$, then everything goes through.\<close>
[PROOF STATE]
proof (state)
this:
A \<in> {A..B}
B \<in> {A..B}

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "\<exists>x \<in> {c A--c B}. \<forall>y \<in> {c A--c B}. infdist y (d`{A..B}) \<le> infdist x (d`{A..B})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>{c A--c B}. \<forall>y\<in>{c A--c B}. infdist y (d ` {A..B}) \<le> infdist x (d ` {A..B})
[PROOF STEP]
by (rule continuous_attains_sup, auto intro: continuous_intros)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{c A--c B}. \<forall>y\<in>{c A--c B}. infdist y (d ` {A..B}) \<le> infdist x (d ` {A..B})

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>{c A--c B}. \<forall>y\<in>{c A--c B}. infdist y (d ` {A..B}) \<le> infdist x (d ` {A..B})
[PROOF STEP]
obtain x where x: "x \<in> {c A--c B}" "\<And>y. y \<in> {c A--c B} \<Longrightarrow> infdist y (d`{A..B}) \<le> infdist x (d`{A..B})"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>{c A--c B}. \<forall>y\<in>{c A--c B}. infdist y (d ` {A..B}) \<le> infdist x (d ` {A..B})

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> {c A--c B}; \<And>y. y \<in> {c A--c B} \<Longrightarrow> infdist y (d ` {A..B}) \<le> infdist x (d ` {A..B})\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {c A--c B}
?y \<in> {c A--c B} \<Longrightarrow> infdist ?y (d ` {A..B}) \<le> infdist x (d ` {A..B})

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
define D where "D = infdist x (d`{A..B})"
[PROOF STATE]
proof (state)
this:
D = infdist x (d ` {A..B})

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "D \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> infdist x (d ` {A..B})
[PROOF STEP]
by (rule infdist_nonneg)
[PROOF STATE]
proof (state)
this:
0 \<le> D

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have D_bound: "D \<le> 24 * lambda + 12 * C + 24 * deltaG(TYPE('a))^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
proof (cases "D \<le> 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
 2. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
D \<le> 1

goal (2 subgoals):
 1. D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
 2. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "1 * 1 + 1 * 0 + 0 * 0 \<le> 24 * lambda + 12 * C + 24 * deltaG(TYPE('a))^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * 1 + 1 * 0 + 0 * 0 \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (12 subgoals):
 1. 1 \<le> 24
 2. 1 \<le> lambda
 3. 0 \<le> 24
 4. 0 \<le> 1
 5. 1 \<le> 12
 6. 0 \<le> C
 7. 0 \<le> 12
 8. 0 \<le> 0
 9. 0 \<le> 24
 10. 0 \<le> (deltaG TYPE('a))\<^sup>2
A total of 12 subgoals...
[PROOF STEP]
using C delta_nonneg
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
0 \<le> deltaG TYPE('a)

goal (12 subgoals):
 1. 1 \<le> 24
 2. 1 \<le> lambda
 3. 0 \<le> 24
 4. 0 \<le> 1
 5. 1 \<le> 12
 6. 0 \<le> C
 7. 0 \<le> 12
 8. 0 \<le> 0
 9. 0 \<le> 24
 10. 0 \<le> (deltaG TYPE('a))\<^sup>2
A total of 12 subgoals...
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 * 1 + 1 * 0 + 0 * 0 \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal (2 subgoals):
 1. D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
 2. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 * 1 + 1 * 0 + 0 * 0 \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 * 1 + 1 * 0 + 0 * 0 \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal (1 subgoal):
 1. D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
1 * 1 + 1 * 0 + 0 * 0 \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
D \<le> 1

goal (1 subgoal):
 1. D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> D \<le> 1

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> D \<le> 1
[PROOF STEP]
have "D \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
\<not> D \<le> 1

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

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have ln2mult: "2 * ln t = ln (t * t)" if "t > 0" for t::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * ln t = ln (t * t)
[PROOF STEP]
by (simp add: that ln_mult)
[PROOF STATE]
proof (state)
this:
0 < ?t \<Longrightarrow> 2 * ln ?t = ln (?t * ?t)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "infdist (c A) (d`{A..B}) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (c A) (d ` {A..B}) = 0
[PROOF STEP]
using \<open>d A = c A\<close>
[PROOF STATE]
proof (prove)
using this:
d A = c A

goal (1 subgoal):
 1. infdist (c A) (d ` {A..B}) = 0
[PROOF STEP]
by (metis \<open>A \<in> {A..B}\<close> image_eqI infdist_zero)
[PROOF STATE]
proof (state)
this:
infdist (c A) (d ` {A..B}) = 0

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infdist (c A) (d ` {A..B}) = 0
[PROOF STEP]
have "x \<noteq> c A"
[PROOF STATE]
proof (prove)
using this:
infdist (c A) (d ` {A..B}) = 0

goal (1 subgoal):
 1. x \<noteq> c A
[PROOF STEP]
using \<open>D \<ge> 1\<close> D_def
[PROOF STATE]
proof (prove)
using this:
infdist (c A) (d ` {A..B}) = 0
1 \<le> D
D = infdist x (d ` {A..B})

goal (1 subgoal):
 1. x \<noteq> c A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<noteq> c A

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define tx where "tx = dist (c A) x"
[PROOF STATE]
proof (state)
this:
tx = dist (c A) x

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tx = dist (c A) x
[PROOF STEP]
have "tx \<in> {0..dist (c A) (c B)}"
[PROOF STATE]
proof (prove)
using this:
tx = dist (c A) x

goal (1 subgoal):
 1. tx \<in> {0..dist (c A) (c B)}
[PROOF STEP]
using \<open>x \<in> {c A--c B}\<close>
[PROOF STATE]
proof (prove)
using this:
tx = dist (c A) x
x \<in> {c A--c B}

goal (1 subgoal):
 1. tx \<in> {0..dist (c A) (c B)}
[PROOF STEP]
by (meson atLeastAtMost_iff geodesic_segment_dist_le some_geodesic_is_geodesic_segment(1) metric_space_class.zero_le_dist some_geodesic_endpoints(1))
[PROOF STATE]
proof (state)
this:
tx \<in> {0..dist (c A) (c B)}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "tx > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < tx
[PROOF STEP]
using \<open>x \<noteq> c A\<close> tx_def
[PROOF STATE]
proof (prove)
using this:
x \<noteq> c A
tx = dist (c A) x

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

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have x_param: "x = geodesic_segment_param {c A--c B} (c A) tx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = geodesic_segment_param {c A--c B} (c A) tx
[PROOF STEP]
using \<open>x \<in> {c A--c B}\<close> geodesic_segment_param[OF some_geodesic_is_geodesic_segment(1)] tx_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {c A--c B}
geodesic_segment_param {?x--?y} ?x 0 = ?x
geodesic_segment_param {?x--?y} ?x (dist ?x ?y) = ?y
?t \<in> {0..dist ?x ?y} \<Longrightarrow> geodesic_segment_param {?x--?y} ?x ?t \<in> {?x--?y}
isometry_on {0..dist ?x ?y} (geodesic_segment_param {?x--?y} ?x)
geodesic_segment_param {?x--?y} ?x ` {0..dist ?x ?y} = {?x--?y}
?t \<in> {0..dist ?x ?y} \<Longrightarrow> dist ?x (geodesic_segment_param {?x--?y} ?x ?t) = ?t
\<lbrakk>?s \<in> {0..dist ?x ?y}; ?t \<in> {0..dist ?x ?y}\<rbrakk> \<Longrightarrow> dist (geodesic_segment_param {?x--?y} ?x ?s) (geodesic_segment_param {?x--?y} ?x ?t) = \<bar>?s - ?t\<bar>
?z \<in> {?x--?y} \<Longrightarrow> ?z = geodesic_segment_param {?x--?y} ?x (dist ?x ?z)
tx = dist (c A) x

goal (1 subgoal):
 1. x = geodesic_segment_param {c A--c B} (c A) tx
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = geodesic_segment_param {c A--c B} (c A) tx

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define tm where "tm = max (tx - 2 * D) 0"
[PROOF STATE]
proof (state)
this:
tm = max (tx - 2 * D) 0

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "tm \<in> {0..dist (c A) (c B)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tm \<in> {0..dist (c A) (c B)}
[PROOF STEP]
unfolding tm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (tx - 2 * D) 0 \<in> {0..dist (c A) (c B)}
[PROOF STEP]
using \<open>tx \<in> {0..dist (c A) (c B)}\<close> \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {0..dist (c A) (c B)}
0 \<le> D

goal (1 subgoal):
 1. max (tx - 2 * D) 0 \<in> {0..dist (c A) (c B)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tm \<in> {0..dist (c A) (c B)}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define xm where "xm = geodesic_segment_param {c A--c B} (c A) tm"
[PROOF STATE]
proof (state)
this:
xm = geodesic_segment_param {c A--c B} (c A) tm

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "xm \<in> {c A--c B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xm \<in> {c A--c B}
[PROOF STEP]
using \<open>tm \<in> {0..dist (c A) (c B)}\<close>
[PROOF STATE]
proof (prove)
using this:
tm \<in> {0..dist (c A) (c B)}

goal (1 subgoal):
 1. xm \<in> {c A--c B}
[PROOF STEP]
by (metis geodesic_segment_param(3) local.some_geodesic_is_geodesic_segment(1) xm_def)
[PROOF STATE]
proof (state)
this:
xm \<in> {c A--c B}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "dist xm x = abs((max (tx - 2 * D) 0) - tx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xm x = \<bar>max (tx - 2 * D) 0 - tx\<bar>
[PROOF STEP]
unfolding xm_def tm_def x_param
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (geodesic_segment_param {c A--c B} (c A) (max (tx - 2 * D) 0)) (geodesic_segment_param {c A--c B} (c A) tx) = \<bar>max (tx - 2 * D) 0 - tx\<bar>
[PROOF STEP]
apply (rule geodesic_segment_param[of _ _ "c B"], auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. tx - 2 * D \<le> dist (c A) (c B)
 2. 0 \<le> tx
 3. tx \<le> dist (c A) (c B)
[PROOF STEP]
using \<open>tx \<in> {0..dist (c A) (c B)}\<close> \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {0..dist (c A) (c B)}
0 \<le> D

goal (3 subgoals):
 1. tx - 2 * D \<le> dist (c A) (c B)
 2. 0 \<le> tx
 3. tx \<le> dist (c A) (c B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xm x = \<bar>max (tx - 2 * D) 0 - tx\<bar>

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist xm x = \<bar>max (tx - 2 * D) 0 - tx\<bar>

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> 2 * D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>max (tx - 2 * D) 0 - tx\<bar> \<le> 2 * D
[PROOF STEP]
by (simp add: \<open>0 \<le> D\<close> tx_def)
[PROOF STATE]
proof (state)
this:
\<bar>max (tx - 2 * D) 0 - tx\<bar> \<le> 2 * D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist xm x \<le> 2 * D
[PROOF STEP]
have "dist xm x \<le> 2 * D"
[PROOF STATE]
proof (prove)
using this:
dist xm x \<le> 2 * D

goal (1 subgoal):
 1. dist xm x \<le> 2 * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xm x \<le> 2 * D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "\<exists>ym\<in>d`{A..B}. infdist xm (d`{A..B}) = dist xm ym"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ym\<in>d ` {A..B}. infdist xm (d ` {A..B}) = dist xm ym
[PROOF STEP]
apply (rule infdist_proper_attained)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. proper (d ` {A..B})
 2. d ` {A..B} \<noteq> {}
[PROOF STEP]
using 3 d(1) proper_of_compact compact_continuous_image
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> 2 * C < dist (c A) (c B)
continuous_on {A..B} d
compact ?S \<Longrightarrow> proper ?S
\<lbrakk>continuous_on ?s ?f; compact ?s\<rbrakk> \<Longrightarrow> compact (?f ` ?s)

goal (2 subgoals):
 1. proper (d ` {A..B})
 2. d ` {A..B} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ym\<in>d ` {A..B}. infdist xm (d ` {A..B}) = dist xm ym

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>ym\<in>d ` {A..B}. infdist xm (d ` {A..B}) = dist xm ym
[PROOF STEP]
obtain ym where ym: "ym \<in> d`{A..B}" "dist xm ym = infdist xm (d`{A..B})"
[PROOF STATE]
proof (prove)
using this:
\<exists>ym\<in>d ` {A..B}. infdist xm (d ` {A..B}) = dist xm ym

goal (1 subgoal):
 1. (\<And>ym. \<lbrakk>ym \<in> d ` {A..B}; dist xm ym = infdist xm (d ` {A..B})\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
ym \<in> d ` {A..B}
dist xm ym = infdist xm (d ` {A..B})

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ym \<in> d ` {A..B}
dist xm ym = infdist xm (d ` {A..B})
[PROOF STEP]
obtain um where um: "um \<in> {A..B}" "ym = d um"
[PROOF STATE]
proof (prove)
using this:
ym \<in> d ` {A..B}
dist xm ym = infdist xm (d ` {A..B})

goal (1 subgoal):
 1. (\<And>um. \<lbrakk>um \<in> {A..B}; ym = d um\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
um \<in> {A..B}
ym = d um

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "dist xm ym \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xm ym \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xm ym \<le> infdist x (d ` {A..B})
[PROOF STEP]
using x ym
[PROOF STATE]
proof (prove)
using this:
x \<in> {c A--c B}
?y \<in> {c A--c B} \<Longrightarrow> infdist ?y (d ` {A..B}) \<le> infdist x (d ` {A..B})
ym \<in> d ` {A..B}
dist xm ym = infdist xm (d ` {A..B})

goal (1 subgoal):
 1. dist xm ym \<le> infdist x (d ` {A..B})
[PROOF STEP]
by (simp add: \<open>xm \<in> {c A--c B}\<close>)
[PROOF STATE]
proof (state)
this:
dist xm ym \<le> D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have D1: "dist x z \<ge> D" if "z \<in> {xm--ym}" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
proof (cases "tx - 2 * D < 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
tx - 2 * D < 0

goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tx - 2 * D < 0
[PROOF STEP]
have "tm = 0"
[PROOF STATE]
proof (prove)
using this:
tx - 2 * D < 0

goal (1 subgoal):
 1. tm = 0
[PROOF STEP]
unfolding tm_def
[PROOF STATE]
proof (prove)
using this:
tx - 2 * D < 0

goal (1 subgoal):
 1. max (tx - 2 * D) 0 = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tm = 0

goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tm = 0
[PROOF STEP]
have "xm = c A"
[PROOF STATE]
proof (prove)
using this:
tm = 0

goal (1 subgoal):
 1. xm = c A
[PROOF STEP]
unfolding xm_def
[PROOF STATE]
proof (prove)
using this:
tm = 0

goal (1 subgoal):
 1. geodesic_segment_param {c A--c B} (c A) tm = c A
[PROOF STEP]
by (meson geodesic_segment_param(1) local.some_geodesic_is_geodesic_segment(1))
[PROOF STATE]
proof (state)
this:
xm = c A

goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xm = c A
[PROOF STEP]
have "infdist xm (d`{A..B}) = 0"
[PROOF STATE]
proof (prove)
using this:
xm = c A

goal (1 subgoal):
 1. infdist xm (d ` {A..B}) = 0
[PROOF STEP]
using \<open>d A = c A\<close> \<open>A \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
xm = c A
d A = c A
A \<in> {A..B}

goal (1 subgoal):
 1. infdist xm (d ` {A..B}) = 0
[PROOF STEP]
by (metis image_eqI infdist_zero)
[PROOF STATE]
proof (state)
this:
infdist xm (d ` {A..B}) = 0

goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infdist xm (d ` {A..B}) = 0
[PROOF STEP]
have "ym = xm"
[PROOF STATE]
proof (prove)
using this:
infdist xm (d ` {A..B}) = 0

goal (1 subgoal):
 1. ym = xm
[PROOF STEP]
using ym(2)
[PROOF STATE]
proof (prove)
using this:
infdist xm (d ` {A..B}) = 0
dist xm ym = infdist xm (d ` {A..B})

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

goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ym = xm
[PROOF STEP]
have "z = xm"
[PROOF STATE]
proof (prove)
using this:
ym = xm

goal (1 subgoal):
 1. z = xm
[PROOF STEP]
using \<open>z \<in> {xm--ym}\<close> geodesic_segment_between_x_x(3)
[PROOF STATE]
proof (prove)
using this:
ym = xm
z \<in> {xm--ym}
geodesic_segment_between ?G ?x ?x = (?G = {?x})

goal (1 subgoal):
 1. z = xm
[PROOF STEP]
by (metis empty_iff insert_iff some_geodesic_is_geodesic_segment(1))
[PROOF STATE]
proof (state)
this:
z = xm

goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = xm
[PROOF STEP]
have "z \<in> d`{A..B}"
[PROOF STATE]
proof (prove)
using this:
z = xm

goal (1 subgoal):
 1. z \<in> d ` {A..B}
[PROOF STEP]
using \<open>ym = xm\<close> ym(1)
[PROOF STATE]
proof (prove)
using this:
z = xm
ym = xm
ym \<in> d ` {A..B}

goal (1 subgoal):
 1. z \<in> d ` {A..B}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<in> d ` {A..B}

goal (2 subgoals):
 1. tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
 2. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> d ` {A..B}
[PROOF STEP]
show "dist x z \<ge> D"
[PROOF STATE]
proof (prove)
using this:
z \<in> d ` {A..B}

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
using this:
z \<in> d ` {A..B}

goal (1 subgoal):
 1. infdist x (d ` {A..B}) \<le> dist x z
[PROOF STEP]
by (simp add: infdist_le)
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> tx - 2 * D < 0

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> tx - 2 * D < 0
[PROOF STEP]
have *: "tm = tx - 2 * D"
[PROOF STATE]
proof (prove)
using this:
\<not> tx - 2 * D < 0

goal (1 subgoal):
 1. tm = tx - 2 * D
[PROOF STEP]
unfolding tm_def
[PROOF STATE]
proof (prove)
using this:
\<not> tx - 2 * D < 0

goal (1 subgoal):
 1. max (tx - 2 * D) 0 = tx - 2 * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tm = tx - 2 * D

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "dist xm x = abs((tx - 2 * D) - tx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xm x = \<bar>tx - 2 * D - tx\<bar>
[PROOF STEP]
unfolding xm_def x_param *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (geodesic_segment_param {c A--c B} (c A) (tx - 2 * D)) (geodesic_segment_param {c A--c B} (c A) tx) = \<bar>tx - 2 * D - tx\<bar>
[PROOF STEP]
apply (rule geodesic_segment_param[of _ _ "c B"], auto)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 2 * D \<le> tx
 2. tx - 2 * D \<le> dist (c A) (c B)
 3. 0 \<le> tx
 4. tx \<le> dist (c A) (c B)
[PROOF STEP]
using False \<open>tx \<in> {0..dist (c A) (c B)}\<close> \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> tx - 2 * D < 0
tx \<in> {0..dist (c A) (c B)}
0 \<le> D

goal (4 subgoals):
 1. 2 * D \<le> tx
 2. tx - 2 * D \<le> dist (c A) (c B)
 3. 0 \<le> tx
 4. tx \<le> dist (c A) (c B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xm x = \<bar>tx - 2 * D - tx\<bar>

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist xm x = \<bar>tx - 2 * D - tx\<bar>
[PROOF STEP]
have "2 * D = dist xm x"
[PROOF STATE]
proof (prove)
using this:
dist xm x = \<bar>tx - 2 * D - tx\<bar>

goal (1 subgoal):
 1. 2 * D = dist xm x
[PROOF STEP]
using \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
dist xm x = \<bar>tx - 2 * D - tx\<bar>
0 \<le> D

goal (1 subgoal):
 1. 2 * D = dist xm x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * D = dist xm x

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * D = dist xm x

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "... \<le> dist xm z + dist x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xm x \<le> dist xm z + dist x z
[PROOF STEP]
using metric_space_class.dist_triangle2
[PROOF STATE]
proof (prove)
using this:
dist ?x ?y \<le> dist ?x ?z + dist ?y ?z

goal (1 subgoal):
 1. dist xm x \<le> dist xm z + dist x z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xm x \<le> dist xm z + dist x z

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist xm x \<le> dist xm z + dist x z

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "... \<le> dist xm ym + dist x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xm z + dist x z \<le> dist xm ym + dist x z
[PROOF STEP]
using \<open>z \<in> {xm--ym}\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> {xm--ym}

goal (1 subgoal):
 1. dist xm z + dist x z \<le> dist xm ym + dist x z
[PROOF STEP]
by (auto, meson geodesic_segment_dist_le some_geodesic_is_geodesic_segment(1) some_geodesic_endpoints(1))
[PROOF STATE]
proof (state)
this:
dist xm z + dist x z \<le> dist xm ym + dist x z

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist xm z + dist x z \<le> dist xm ym + dist x z

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "... \<le> D + dist x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xm ym + dist x z \<le> D + dist x z
[PROOF STEP]
using \<open>dist xm ym \<le> D\<close>
[PROOF STATE]
proof (prove)
using this:
dist xm ym \<le> D

goal (1 subgoal):
 1. dist xm ym + dist x z \<le> D + dist x z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist xm ym + dist x z \<le> D + dist x z

goal (1 subgoal):
 1. \<not> tx - 2 * D < 0 \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * D \<le> D + dist x z
[PROOF STEP]
show "dist x z \<ge> D"
[PROOF STATE]
proof (prove)
using this:
2 * D \<le> D + dist x z

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?z \<in> {xm--ym} \<Longrightarrow> D \<le> dist x ?z

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define tM where "tM = min (tx + 2 * D) (dist (c A) (c B))"
[PROOF STATE]
proof (state)
this:
tM = min (tx + 2 * D) (dist (c A) (c B))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "tM \<in> {0..dist (c A) (c B)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tM \<in> {0..dist (c A) (c B)}
[PROOF STEP]
unfolding tM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (tx + 2 * D) (dist (c A) (c B)) \<in> {0..dist (c A) (c B)}
[PROOF STEP]
using \<open>tx \<in> {0..dist (c A) (c B)}\<close> \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {0..dist (c A) (c B)}
0 \<le> D

goal (1 subgoal):
 1. min (tx + 2 * D) (dist (c A) (c B)) \<in> {0..dist (c A) (c B)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tM \<in> {0..dist (c A) (c B)}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "tm \<le> tM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tm \<le> tM
[PROOF STEP]
unfolding tM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tm \<le> min (tx + 2 * D) (dist (c A) (c B))
[PROOF STEP]
using \<open>D \<ge> 0\<close> \<open>tm \<in> {0..dist (c A) (c B)}\<close> \<open>tx \<equiv> dist (c A) x\<close> tm_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> D
tm \<in> {0..dist (c A) (c B)}
tx \<equiv> dist (c A) x
tm = max (tx - 2 * D) 0

goal (1 subgoal):
 1. tm \<le> min (tx + 2 * D) (dist (c A) (c B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tm \<le> tM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define xM where "xM = geodesic_segment_param {c A--c B} (c A) tM"
[PROOF STATE]
proof (state)
this:
xM = geodesic_segment_param {c A--c B} (c A) tM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "xM \<in> {c A--c B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xM \<in> {c A--c B}
[PROOF STEP]
using \<open>tM \<in> {0..dist (c A) (c B)}\<close>
[PROOF STATE]
proof (prove)
using this:
tM \<in> {0..dist (c A) (c B)}

goal (1 subgoal):
 1. xM \<in> {c A--c B}
[PROOF STEP]
by (metis geodesic_segment_param(3) local.some_geodesic_is_geodesic_segment(1) xM_def)
[PROOF STATE]
proof (state)
this:
xM \<in> {c A--c B}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "dist xM x = abs((min (tx + 2 * D) (dist (c A) (c B))) - tx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xM x = \<bar>min (tx + 2 * D) (dist (c A) (c B)) - tx\<bar>
[PROOF STEP]
unfolding xM_def tM_def x_param
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (geodesic_segment_param {c A--c B} (c A) (min (tx + 2 * D) (dist (c A) (c B)))) (geodesic_segment_param {c A--c B} (c A) tx) = \<bar>min (tx + 2 * D) (dist (c A) (c B)) - tx\<bar>
[PROOF STEP]
apply (rule geodesic_segment_param[of _ _ "c B"], auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 \<le> tx + 2 * D
 2. 0 \<le> tx
 3. tx \<le> dist (c A) (c B)
[PROOF STEP]
using \<open>tx \<in> {0..dist (c A) (c B)}\<close> \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {0..dist (c A) (c B)}
0 \<le> D

goal (3 subgoals):
 1. 0 \<le> tx + 2 * D
 2. 0 \<le> tx
 3. tx \<le> dist (c A) (c B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xM x = \<bar>min (tx + 2 * D) (dist (c A) (c B)) - tx\<bar>

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist xM x = \<bar>min (tx + 2 * D) (dist (c A) (c B)) - tx\<bar>

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> 2 * D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>min (tx + 2 * D) (dist (c A) (c B)) - tx\<bar> \<le> 2 * D
[PROOF STEP]
using \<open>0 \<le> D\<close> \<open>tx \<in> {0..dist (c A) (c B)}\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> D
tx \<in> {0..dist (c A) (c B)}

goal (1 subgoal):
 1. \<bar>min (tx + 2 * D) (dist (c A) (c B)) - tx\<bar> \<le> 2 * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>min (tx + 2 * D) (dist (c A) (c B)) - tx\<bar> \<le> 2 * D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist xM x \<le> 2 * D
[PROOF STEP]
have "dist xM x \<le> 2 * D"
[PROOF STATE]
proof (prove)
using this:
dist xM x \<le> 2 * D

goal (1 subgoal):
 1. dist xM x \<le> 2 * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xM x \<le> 2 * D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "\<exists>yM\<in>d`{A..B}. infdist xM (d`{A..B}) = dist xM yM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>yM\<in>d ` {A..B}. infdist xM (d ` {A..B}) = dist xM yM
[PROOF STEP]
apply (rule infdist_proper_attained)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. proper (d ` {A..B})
 2. d ` {A..B} \<noteq> {}
[PROOF STEP]
using 3 d(1) proper_of_compact compact_continuous_image
[PROOF STATE]
proof (prove)
using this:
0 \<le> B - A \<and> 2 * C < dist (c A) (c B)
continuous_on {A..B} d
compact ?S \<Longrightarrow> proper ?S
\<lbrakk>continuous_on ?s ?f; compact ?s\<rbrakk> \<Longrightarrow> compact (?f ` ?s)

goal (2 subgoals):
 1. proper (d ` {A..B})
 2. d ` {A..B} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>yM\<in>d ` {A..B}. infdist xM (d ` {A..B}) = dist xM yM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>yM\<in>d ` {A..B}. infdist xM (d ` {A..B}) = dist xM yM
[PROOF STEP]
obtain yM where yM: "yM \<in> d`{A..B}" "dist xM yM = infdist xM (d`{A..B})"
[PROOF STATE]
proof (prove)
using this:
\<exists>yM\<in>d ` {A..B}. infdist xM (d ` {A..B}) = dist xM yM

goal (1 subgoal):
 1. (\<And>yM. \<lbrakk>yM \<in> d ` {A..B}; dist xM yM = infdist xM (d ` {A..B})\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
yM \<in> d ` {A..B}
dist xM yM = infdist xM (d ` {A..B})

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
yM \<in> d ` {A..B}
dist xM yM = infdist xM (d ` {A..B})
[PROOF STEP]
obtain uM where uM: "uM \<in> {A..B}" "yM = d uM"
[PROOF STATE]
proof (prove)
using this:
yM \<in> d ` {A..B}
dist xM yM = infdist xM (d ` {A..B})

goal (1 subgoal):
 1. (\<And>uM. \<lbrakk>uM \<in> {A..B}; yM = d uM\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uM \<in> {A..B}
yM = d uM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "dist xM yM \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xM yM \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xM yM \<le> infdist x (d ` {A..B})
[PROOF STEP]
using x yM
[PROOF STATE]
proof (prove)
using this:
x \<in> {c A--c B}
?y \<in> {c A--c B} \<Longrightarrow> infdist ?y (d ` {A..B}) \<le> infdist x (d ` {A..B})
yM \<in> d ` {A..B}
dist xM yM = infdist xM (d ` {A..B})

goal (1 subgoal):
 1. dist xM yM \<le> infdist x (d ` {A..B})
[PROOF STEP]
by (simp add: \<open>xM \<in> {c A--c B}\<close>)
[PROOF STATE]
proof (state)
this:
dist xM yM \<le> D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have D3: "dist x z \<ge> D" if "z \<in> {xM--yM}" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
proof (cases "tx + 2 * D > dist (c A) (c B)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
dist (c A) (c B) < tx + 2 * D

goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist (c A) (c B) < tx + 2 * D
[PROOF STEP]
have "tM = dist (c A) (c B)"
[PROOF STATE]
proof (prove)
using this:
dist (c A) (c B) < tx + 2 * D

goal (1 subgoal):
 1. tM = dist (c A) (c B)
[PROOF STEP]
unfolding tM_def
[PROOF STATE]
proof (prove)
using this:
dist (c A) (c B) < tx + 2 * D

goal (1 subgoal):
 1. min (tx + 2 * D) (dist (c A) (c B)) = dist (c A) (c B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tM = dist (c A) (c B)

goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tM = dist (c A) (c B)
[PROOF STEP]
have "xM = c B"
[PROOF STATE]
proof (prove)
using this:
tM = dist (c A) (c B)

goal (1 subgoal):
 1. xM = c B
[PROOF STEP]
unfolding xM_def
[PROOF STATE]
proof (prove)
using this:
tM = dist (c A) (c B)

goal (1 subgoal):
 1. geodesic_segment_param {c A--c B} (c A) tM = c B
[PROOF STEP]
by (meson geodesic_segment_param(2) local.some_geodesic_is_geodesic_segment(1))
[PROOF STATE]
proof (state)
this:
xM = c B

goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xM = c B
[PROOF STEP]
have "infdist xM (d`{A..B}) = 0"
[PROOF STATE]
proof (prove)
using this:
xM = c B

goal (1 subgoal):
 1. infdist xM (d ` {A..B}) = 0
[PROOF STEP]
using \<open>d B = c B\<close> \<open>B \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
xM = c B
d B = c B
B \<in> {A..B}

goal (1 subgoal):
 1. infdist xM (d ` {A..B}) = 0
[PROOF STEP]
by (metis image_eqI infdist_zero)
[PROOF STATE]
proof (state)
this:
infdist xM (d ` {A..B}) = 0

goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infdist xM (d ` {A..B}) = 0
[PROOF STEP]
have "yM = xM"
[PROOF STATE]
proof (prove)
using this:
infdist xM (d ` {A..B}) = 0

goal (1 subgoal):
 1. yM = xM
[PROOF STEP]
using yM(2)
[PROOF STATE]
proof (prove)
using this:
infdist xM (d ` {A..B}) = 0
dist xM yM = infdist xM (d ` {A..B})

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

goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
yM = xM
[PROOF STEP]
have "z = xM"
[PROOF STATE]
proof (prove)
using this:
yM = xM

goal (1 subgoal):
 1. z = xM
[PROOF STEP]
using \<open>z \<in> {xM--yM}\<close> geodesic_segment_between_x_x(3)
[PROOF STATE]
proof (prove)
using this:
yM = xM
z \<in> {xM--yM}
geodesic_segment_between ?G ?x ?x = (?G = {?x})

goal (1 subgoal):
 1. z = xM
[PROOF STEP]
by (metis empty_iff insert_iff some_geodesic_is_geodesic_segment(1))
[PROOF STATE]
proof (state)
this:
z = xM

goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = xM
[PROOF STEP]
have "z \<in> d`{A..B}"
[PROOF STATE]
proof (prove)
using this:
z = xM

goal (1 subgoal):
 1. z \<in> d ` {A..B}
[PROOF STEP]
using \<open>yM = xM\<close> yM(1)
[PROOF STATE]
proof (prove)
using this:
z = xM
yM = xM
yM \<in> d ` {A..B}

goal (1 subgoal):
 1. z \<in> d ` {A..B}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<in> d ` {A..B}

goal (2 subgoals):
 1. dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
 2. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> d ` {A..B}
[PROOF STEP]
show "dist x z \<ge> D"
[PROOF STATE]
proof (prove)
using this:
z \<in> d ` {A..B}

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
using this:
z \<in> d ` {A..B}

goal (1 subgoal):
 1. infdist x (d ` {A..B}) \<le> dist x z
[PROOF STEP]
by (simp add: infdist_le)
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> dist (c A) (c B) < tx + 2 * D

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> dist (c A) (c B) < tx + 2 * D
[PROOF STEP]
have *: "tM = tx + 2 * D"
[PROOF STATE]
proof (prove)
using this:
\<not> dist (c A) (c B) < tx + 2 * D

goal (1 subgoal):
 1. tM = tx + 2 * D
[PROOF STEP]
unfolding tM_def
[PROOF STATE]
proof (prove)
using this:
\<not> dist (c A) (c B) < tx + 2 * D

goal (1 subgoal):
 1. min (tx + 2 * D) (dist (c A) (c B)) = tx + 2 * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tM = tx + 2 * D

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "dist xM x = abs((tx + 2 * D) - tx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xM x = \<bar>tx + 2 * D - tx\<bar>
[PROOF STEP]
unfolding xM_def x_param *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (geodesic_segment_param {c A--c B} (c A) (tx + 2 * D)) (geodesic_segment_param {c A--c B} (c A) tx) = \<bar>tx + 2 * D - tx\<bar>
[PROOF STEP]
apply (rule geodesic_segment_param[of _ _ "c B"], auto)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 \<le> tx + 2 * D
 2. tx + 2 * D \<le> dist (c A) (c B)
 3. 0 \<le> tx
 4. tx \<le> dist (c A) (c B)
[PROOF STEP]
using False \<open>tx \<in> {0..dist (c A) (c B)}\<close> \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> dist (c A) (c B) < tx + 2 * D
tx \<in> {0..dist (c A) (c B)}
0 \<le> D

goal (4 subgoals):
 1. 0 \<le> tx + 2 * D
 2. tx + 2 * D \<le> dist (c A) (c B)
 3. 0 \<le> tx
 4. tx \<le> dist (c A) (c B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xM x = \<bar>tx + 2 * D - tx\<bar>

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist xM x = \<bar>tx + 2 * D - tx\<bar>
[PROOF STEP]
have "2 * D = dist xM x"
[PROOF STATE]
proof (prove)
using this:
dist xM x = \<bar>tx + 2 * D - tx\<bar>

goal (1 subgoal):
 1. 2 * D = dist xM x
[PROOF STEP]
using \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
dist xM x = \<bar>tx + 2 * D - tx\<bar>
0 \<le> D

goal (1 subgoal):
 1. 2 * D = dist xM x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * D = dist xM x

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * D = dist xM x

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "... \<le> dist xM z + dist x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xM x \<le> dist xM z + dist x z
[PROOF STEP]
using metric_space_class.dist_triangle2
[PROOF STATE]
proof (prove)
using this:
dist ?x ?y \<le> dist ?x ?z + dist ?y ?z

goal (1 subgoal):
 1. dist xM x \<le> dist xM z + dist x z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist xM x \<le> dist xM z + dist x z

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist xM x \<le> dist xM z + dist x z

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "... \<le> dist xM yM + dist x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xM z + dist x z \<le> dist xM yM + dist x z
[PROOF STEP]
using \<open>z \<in> {xM--yM}\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> {xM--yM}

goal (1 subgoal):
 1. dist xM z + dist x z \<le> dist xM yM + dist x z
[PROOF STEP]
by (auto, meson geodesic_segment_dist_le local.some_geodesic_is_geodesic_segment(1) some_geodesic_endpoints(1))
[PROOF STATE]
proof (state)
this:
dist xM z + dist x z \<le> dist xM yM + dist x z

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist xM z + dist x z \<le> dist xM yM + dist x z

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
have "... \<le> D + dist x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist xM yM + dist x z \<le> D + dist x z
[PROOF STEP]
using \<open>dist xM yM \<le> D\<close>
[PROOF STATE]
proof (prove)
using this:
dist xM yM \<le> D

goal (1 subgoal):
 1. dist xM yM + dist x z \<le> D + dist x z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist xM yM + dist x z \<le> D + dist x z

goal (1 subgoal):
 1. \<not> dist (c A) (c B) < tx + 2 * D \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * D \<le> D + dist x z
[PROOF STEP]
show "dist x z \<ge> D"
[PROOF STATE]
proof (prove)
using this:
2 * D \<le> D + dist x z

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?z \<in> {xM--yM} \<Longrightarrow> D \<le> dist x ?z

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define excursion:: "real\<Rightarrow>'a" where "excursion = (\<lambda>t.
        if t \<in> {0..dist xm ym} then (geodesic_segment_param {xm--ym} xm t)
        else if t \<in> {dist xm ym..dist xm ym + abs(uM - um)} then d (um + sgn(uM-um) * (t - dist xm ym))
        else geodesic_segment_param {yM--xM} yM (t - dist xm ym - abs (uM -um)))"
[PROOF STATE]
proof (state)
this:
excursion = (\<lambda>t. if t \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm t else if t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (t - dist xm ym)) else geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define L where "L = dist xm ym + abs(uM - um) + dist yM xM"
[PROOF STATE]
proof (state)
this:
L = dist xm ym + \<bar>uM - um\<bar> + dist yM xM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have E1: "excursion t = geodesic_segment_param {xm--ym} xm t" if "t \<in> {0..dist xm ym}" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. excursion t = geodesic_segment_param {xm--ym} xm t
[PROOF STEP]
unfolding excursion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if t \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm t else if t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (t - dist xm ym)) else geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)) = geodesic_segment_param {xm--ym} xm t
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
t \<in> {0..dist xm ym}

goal (1 subgoal):
 1. (if t \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm t else if t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (t - dist xm ym)) else geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)) = geodesic_segment_param {xm--ym} xm t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?t \<in> {0..dist xm ym} \<Longrightarrow> excursion ?t = geodesic_segment_param {xm--ym} xm ?t

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have E2: "excursion t = d (um + sgn(uM-um) * (t - dist xm ym))" if "t \<in> {dist xm ym..dist xm ym + abs(uM - um)}" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. excursion t = d (um + sgn (uM - um) * (t - dist xm ym))
[PROOF STEP]
unfolding excursion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if t \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm t else if t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (t - dist xm ym)) else geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)) = d (um + sgn (uM - um) * (t - dist xm ym))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>}

goal (1 subgoal):
 1. (if t \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm t else if t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (t - dist xm ym)) else geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)) = d (um + sgn (uM - um) * (t - dist xm ym))
[PROOF STEP]
by (auto simp add: \<open>ym = d um\<close>)
[PROOF STATE]
proof (state)
this:
?t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> excursion ?t = d (um + sgn (uM - um) * (?t - dist xm ym))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have E3: "excursion t = geodesic_segment_param {yM--xM} yM (t - dist xm ym - abs (uM -um))"
        if "t \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. excursion t = geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)
[PROOF STEP]
unfolding excursion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if t \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm t else if t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (t - dist xm ym)) else geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)) = geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)
[PROOF STEP]
using that \<open>yM = d uM\<close> \<open>ym = d um\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}
yM = d uM
ym = d um

goal (1 subgoal):
 1. (if t \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm t else if t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (t - dist xm ym)) else geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)) = geodesic_segment_param {yM--xM} yM (t - dist xm ym - \<bar>uM - um\<bar>)
[PROOF STEP]
by (auto simp add: sgn_mult_abs)
[PROOF STATE]
proof (state)
this:
?t \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> excursion ?t = geodesic_segment_param {yM--xM} yM (?t - dist xm ym - \<bar>uM - um\<bar>)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have E0: "excursion 0 = xm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. excursion 0 = xm
[PROOF STEP]
unfolding excursion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm 0 else if 0 \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (0 - dist xm ym)) else geodesic_segment_param {yM--xM} yM (0 - dist xm ym - \<bar>uM - um\<bar>)) = xm
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
excursion 0 = xm

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have EL: "excursion L = xM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. excursion L = xM
[PROOF STEP]
unfolding excursion_def L_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if dist xm ym + \<bar>uM - um\<bar> + dist yM xM \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm (dist xm ym + \<bar>uM - um\<bar> + dist yM xM) else if dist xm ym + \<bar>uM - um\<bar> + dist yM xM \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (dist xm ym + \<bar>uM - um\<bar> + dist yM xM - dist xm ym)) else geodesic_segment_param {yM--xM} yM (dist xm ym + \<bar>uM - um\<bar> + dist yM xM - dist xm ym - \<bar>uM - um\<bar>)) = xM
[PROOF STEP]
apply (auto simp add: uM(2) um(2) sgn_mult_abs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d uM \<noteq> xM; \<bar>uM - um\<bar> + dist (d uM) xM \<le> 0\<rbrakk> \<Longrightarrow> geodesic_segment_param {xm--d um} xm (dist xm (d um) + \<bar>uM - um\<bar> + dist (d uM) xM) = xM
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) add.left_neutral add_increasing2 add_le_same_cancel1 dist_real_def
              Gromov_product_e_x_x Gromov_product_nonneg metric_space_class.dist_le_zero_iff)
[PROOF STATE]
proof (state)
this:
excursion L = xM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have [simp]: "L \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> L
[PROOF STEP]
unfolding L_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> dist xm ym + \<bar>uM - um\<bar> + dist yM xM
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> L

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "L > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < L
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(L > 0)"
[PROOF STATE]
proof (state)
this:
\<not> 0 < L

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < L
[PROOF STEP]
have "L = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < L

goal (1 subgoal):
 1. L = 0
[PROOF STEP]
using \<open>L \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < L
0 \<le> L

goal (1 subgoal):
 1. L = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
L = 0

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
L = 0
[PROOF STEP]
have "xm = xM"
[PROOF STATE]
proof (prove)
using this:
L = 0

goal (1 subgoal):
 1. xm = xM
[PROOF STEP]
using E0 EL
[PROOF STATE]
proof (prove)
using this:
L = 0
excursion 0 = xm
excursion L = xM

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

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xm = xM
[PROOF STEP]
have "tM = tm"
[PROOF STATE]
proof (prove)
using this:
xm = xM

goal (1 subgoal):
 1. tM = tm
[PROOF STEP]
unfolding xm_def xM_def
[PROOF STATE]
proof (prove)
using this:
geodesic_segment_param {c A--c B} (c A) tm = geodesic_segment_param {c A--c B} (c A) tM

goal (1 subgoal):
 1. tM = tm
[PROOF STEP]
using \<open>tM \<in> {0..dist (c A) (c B)}\<close> \<open>tm \<in> {0..dist (c A) (c B)}\<close> local.geodesic_segment_param_in_geodesic_spaces(6)
[PROOF STATE]
proof (prove)
using this:
geodesic_segment_param {c A--c B} (c A) tm = geodesic_segment_param {c A--c B} (c A) tM
tM \<in> {0..dist (c A) (c B)}
tm \<in> {0..dist (c A) (c B)}
?t \<in> {0..dist ?x ?y} \<Longrightarrow> dist ?x (geodesic_segment_param {?x--?y} ?x ?t) = ?t

goal (1 subgoal):
 1. tM = tm
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
tM = tm

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
tM = tm

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
have "... < tx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tm < tx
[PROOF STEP]
unfolding tm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (tx - 2 * D) 0 < tx
[PROOF STEP]
using \<open>tx > 0\<close> \<open>D \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 < tx
1 \<le> D

goal (1 subgoal):
 1. max (tx - 2 * D) 0 < tx
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tm < tx

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
tm < tx

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
have "... \<le> tM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tx \<le> tM
[PROOF STEP]
unfolding tM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tx \<le> min (tx + 2 * D) (dist (c A) (c B))
[PROOF STEP]
using \<open>D \<ge> 0\<close> \<open>tx \<in> {0..dist (c A) (c B)}\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> D
tx \<in> {0..dist (c A) (c B)}

goal (1 subgoal):
 1. tx \<le> min (tx + 2 * D) (dist (c A) (c B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tx \<le> tM

goal (1 subgoal):
 1. \<not> 0 < L \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
tM < tM
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
tM < tM

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < L

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "(1/lambda) * dist um uM - (4 * C) \<le> dist (d um) (d uM)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / lambda * dist um uM - 4 * C \<le> dist (d um) (d uM)
[PROOF STEP]
by (rule quasi_isometry_onD(2)[OF \<open>lambda (4 * C)-quasi_isometry_on {A..B} d\<close> \<open>um \<in> {A..B}\<close> \<open>uM \<in> {A..B}\<close>])
[PROOF STATE]
proof (state)
this:
1 / lambda * dist um uM - 4 * C \<le> dist (d um) (d uM)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / lambda * dist um uM - 4 * C \<le> dist (d um) (d uM)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> dist ym xm + dist xm x + dist x xM + dist xM yM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (d um) (d uM) \<le> dist ym xm + dist xm x + dist x xM + dist xM yM
[PROOF STEP]
unfolding um(2)[symmetric] uM(2)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist ym yM \<le> dist ym xm + dist xm x + dist x xM + dist xM yM
[PROOF STEP]
by (rule dist_triangle5)
[PROOF STATE]
proof (state)
this:
dist (d um) (d uM) \<le> dist ym xm + dist xm x + dist x xM + dist xM yM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (d um) (d uM) \<le> dist ym xm + dist xm x + dist x xM + dist xM yM

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> D + (2*D) + (2*D) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist ym xm + dist xm x + dist x xM + dist xM yM \<le> D + 2 * D + 2 * D + D
[PROOF STEP]
using \<open>dist xm ym \<le> D\<close> \<open>dist xm x \<le> 2*D\<close> \<open>dist xM x \<le> 2*D\<close> \<open>dist xM yM \<le> D\<close>
[PROOF STATE]
proof (prove)
using this:
dist xm ym \<le> D
dist xm x \<le> 2 * D
dist xM x \<le> 2 * D
dist xM yM \<le> D

goal (1 subgoal):
 1. dist ym xm + dist xm x + dist x xM + dist xM yM \<le> D + 2 * D + 2 * D + D
[PROOF STEP]
by (auto simp add: metric_space_class.dist_commute intro: add_mono)
[PROOF STATE]
proof (state)
this:
dist ym xm + dist xm x + dist x xM + dist xM yM \<le> D + 2 * D + 2 * D + D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 / lambda * dist um uM - 4 * C \<le> D + 2 * D + 2 * D + D
[PROOF STEP]
have "(1/lambda) * dist um uM \<le> 6*D + 4*C"
[PROOF STATE]
proof (prove)
using this:
1 / lambda * dist um uM - 4 * C \<le> D + 2 * D + 2 * D + D

goal (1 subgoal):
 1. 1 / lambda * dist um uM \<le> 6 * D + 4 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / lambda * dist um uM \<le> 6 * D + 4 * C

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 / lambda * dist um uM \<le> 6 * D + 4 * C
[PROOF STEP]
have "dist um uM \<le> 6*D*lambda + 4*C*lambda"
[PROOF STATE]
proof (prove)
using this:
1 / lambda * dist um uM \<le> 6 * D + 4 * C

goal (1 subgoal):
 1. dist um uM \<le> 6 * D * lambda + 4 * C * lambda
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
1 / lambda * dist um uM \<le> 6 * D + 4 * C
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. dist um uM \<le> 6 * D * lambda + 4 * C * lambda
[PROOF STEP]
by (auto simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
dist um uM \<le> 6 * D * lambda + 4 * C * lambda

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist um uM \<le> 6 * D * lambda + 4 * C * lambda
[PROOF STEP]
have "L \<le> D + (6*D*lambda + 4*C*lambda) + D"
[PROOF STATE]
proof (prove)
using this:
dist um uM \<le> 6 * D * lambda + 4 * C * lambda

goal (1 subgoal):
 1. L \<le> D + (6 * D * lambda + 4 * C * lambda) + D
[PROOF STEP]
unfolding L_def dist_real_def
[PROOF STATE]
proof (prove)
using this:
\<bar>um - uM\<bar> \<le> 6 * D * lambda + 4 * C * lambda

goal (1 subgoal):
 1. dist xm ym + \<bar>uM - um\<bar> + dist yM xM \<le> D + (6 * D * lambda + 4 * C * lambda) + D
[PROOF STEP]
using \<open>dist xm ym \<le> D\<close> \<open>dist xM yM \<le> D\<close>
[PROOF STATE]
proof (prove)
using this:
\<bar>um - uM\<bar> \<le> 6 * D * lambda + 4 * C * lambda
dist xm ym \<le> D
dist xM yM \<le> D

goal (1 subgoal):
 1. dist xm ym + \<bar>uM - um\<bar> + dist yM xM \<le> D + (6 * D * lambda + 4 * C * lambda) + D
[PROOF STEP]
by (auto simp add: metric_space_class.dist_commute intro: add_mono)
[PROOF STATE]
proof (state)
this:
L \<le> D + (6 * D * lambda + 4 * C * lambda) + D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
L \<le> D + (6 * D * lambda + 4 * C * lambda) + D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> 8 * D * lambda + 4*C*lambda"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D + (6 * D * lambda + 4 * C * lambda) + D \<le> 8 * D * lambda + 4 * C * lambda
[PROOF STEP]
using C \<open>D \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
0 \<le> D

goal (1 subgoal):
 1. D + (6 * D * lambda + 4 * C * lambda) + D \<le> 8 * D * lambda + 4 * C * lambda
[PROOF STEP]
by (auto intro: mono_intros)
[PROOF STATE]
proof (state)
this:
D + (6 * D * lambda + 4 * C * lambda) + D \<le> 8 * D * lambda + 4 * C * lambda

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
L \<le> 8 * D * lambda + 4 * C * lambda
[PROOF STEP]
have L_bound: "L \<le> lambda * (8 * D + 4 * C)"
[PROOF STATE]
proof (prove)
using this:
L \<le> 8 * D * lambda + 4 * C * lambda

goal (1 subgoal):
 1. L \<le> lambda * (8 * D + 4 * C)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
L \<le> lambda * (8 * D + 4 * C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "1 * (1 * 1 + 0) \<le> lambda * (8 * D + 4 * C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * (1 * 1 + 0) \<le> lambda * (8 * D + 4 * C)
[PROOF STEP]
using C \<open>D \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
1 \<le> D

goal (1 subgoal):
 1. 1 * (1 * 1 + 0) \<le> lambda * (8 * D + 4 * C)
[PROOF STEP]
by (intro mono_intros, auto)
[PROOF STATE]
proof (state)
this:
1 * (1 * 1 + 0) \<le> lambda * (8 * D + 4 * C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
consider "um < uM" | "um = uM" | "um > uM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>um < uM \<Longrightarrow> thesis; um = uM \<Longrightarrow> thesis; uM < um \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>um < uM \<Longrightarrow> ?thesis; um = uM \<Longrightarrow> ?thesis; uM < um \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>um < uM \<Longrightarrow> ?thesis; um = uM \<Longrightarrow> ?thesis; uM < um \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
have "((\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>}) \<subseteq> {min um uM..max um uM}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>um < uM \<Longrightarrow> ?thesis; um = uM \<Longrightarrow> ?thesis; uM < um \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {min um uM..max um uM}
[PROOF STEP]
by (cases, auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {min um uM..max um uM}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {min um uM..max um uM}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<subseteq> {A..B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {min um uM..max um uM} \<subseteq> {A..B}
[PROOF STEP]
using \<open>um \<in> {A..B}\<close> \<open>uM \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
um \<in> {A..B}
uM \<in> {A..B}

goal (1 subgoal):
 1. {min um uM..max um uM} \<subseteq> {A..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{min um uM..max um uM} \<subseteq> {A..B}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {A..B}
[PROOF STEP]
have middle: "((\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>}) \<subseteq> {A..B}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {A..B}

goal (1 subgoal):
 1. (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {A..B}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {A..B}

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "(2 * lambda)-lipschitz_on {0..L} excursion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {0..L} excursion
[PROOF STEP]
proof (unfold L_def, rule lipschitz_on_closed_Union[of "{{0..dist xm ym}, {dist xm ym..dist xm ym + abs(uM - um)}, {dist xm ym + abs(uM - um)..dist xm ym + abs(uM - um) + dist yM xM}}" _ "\<lambda> i. i"], auto)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (2 * lambda)-lipschitz_on {0..dist xm ym} excursion
 2. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
 3. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
 4. 0 \<le> lambda
[PROOF STEP]
show "lambda \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> lambda
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. 0 \<le> lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> lambda

goal (3 subgoals):
 1. (2 * lambda)-lipschitz_on {0..dist xm ym} excursion
 2. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
 3. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
have *: "1-lipschitz_on {0..dist xm ym} (geodesic_segment_param {xm--ym} xm)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1-lipschitz_on {0..dist xm ym} (geodesic_segment_param {xm--ym} xm)
[PROOF STEP]
by (rule isometry_on_lipschitz, simp)
[PROOF STATE]
proof (state)
this:
1-lipschitz_on {0..dist xm ym} (geodesic_segment_param {xm--ym} xm)

goal (3 subgoals):
 1. (2 * lambda)-lipschitz_on {0..dist xm ym} excursion
 2. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
 3. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
have **: "1-lipschitz_on {0..dist xm ym} excursion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1-lipschitz_on {0..dist xm ym} excursion
[PROOF STEP]
using lipschitz_on_transform[OF * E1]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> {0..dist xm ym} \<Longrightarrow> x \<in> {0..dist xm ym}) \<Longrightarrow> 1-lipschitz_on {0..dist xm ym} excursion

goal (1 subgoal):
 1. 1-lipschitz_on {0..dist xm ym} excursion
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1-lipschitz_on {0..dist xm ym} excursion

goal (3 subgoals):
 1. (2 * lambda)-lipschitz_on {0..dist xm ym} excursion
 2. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
 3. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
show "(2 * lambda)-lipschitz_on {0..dist xm ym} excursion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {0..dist xm ym} excursion
[PROOF STEP]
apply (rule lipschitz_on_mono[OF **])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {0..dist xm ym} \<subseteq> {0..dist xm ym}
 2. 1 \<le> 2 * lambda
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (2 subgoals):
 1. {0..dist xm ym} \<subseteq> {0..dist xm ym}
 2. 1 \<le> 2 * lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 * lambda)-lipschitz_on {0..dist xm ym} excursion

goal (2 subgoals):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
 2. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
have *: "(1*(1+0))-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}
                ((geodesic_segment_param {yM--xM} yM) o (\<lambda>t. t - (dist xm ym + abs (uM -um))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 * (1 + 0))-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} (geodesic_segment_param {yM--xM} yM \<circ> (\<lambda>t. t - (dist xm ym + \<bar>uM - um\<bar>)))
[PROOF STEP]
by (intro lipschitz_intros, rule isometry_on_lipschitz, auto)
[PROOF STATE]
proof (state)
this:
(1 * (1 + 0))-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} (geodesic_segment_param {yM--xM} yM \<circ> (\<lambda>t. t - (dist xm ym + \<bar>uM - um\<bar>)))

goal (2 subgoals):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
 2. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
have **: "(1*(1+0))-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 * (1 + 0))-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
apply (rule lipschitz_on_transform[OF *])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> excursion x = (geodesic_segment_param {yM--xM} yM \<circ> (\<lambda>t. t - (dist xm ym + \<bar>uM - um\<bar>))) x
[PROOF STEP]
using E3
[PROOF STATE]
proof (prove)
using this:
?t \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> excursion ?t = geodesic_segment_param {yM--xM} yM (?t - dist xm ym - \<bar>uM - um\<bar>)

goal (1 subgoal):
 1. \<And>x. x \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> excursion x = (geodesic_segment_param {yM--xM} yM \<circ> (\<lambda>t. t - (dist xm ym + \<bar>uM - um\<bar>))) x
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
?t \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> excursion ?t = geodesic_segment_param {yM--xM} yM (?t - dist xm ym - \<bar>uM - um\<bar>)

goal (1 subgoal):
 1. \<And>x. x \<in> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> excursion x = geodesic_segment_param {yM--xM} yM (x - (dist xm ym + \<bar>uM - um\<bar>))
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(1 * (1 + 0))-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion

goal (2 subgoals):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
 2. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
show "(2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion
[PROOF STEP]
apply (rule lipschitz_on_mono[OF **])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<subseteq> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}
 2. 1 * (1 + 0) \<le> 2 * lambda
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (2 subgoals):
 1. {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<subseteq> {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}
 2. 1 * (1 + 0) \<le> 2 * lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 * lambda)-lipschitz_on {dist xm ym + \<bar>uM - um\<bar>..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} excursion

goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
[PROOF STEP]
have **: "((2 * lambda) * (0 + abs(sgn (uM - um)) * (1 + 0)))-lipschitz_on {dist xm ym..dist xm ym + abs(uM - um)} (d o (\<lambda>t. um + sgn(uM-um) * (t - dist xm ym)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda * (0 + \<bar>sgn (uM - um)\<bar> * (1 + 0)))-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} (d \<circ> (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)))
[PROOF STEP]
apply (intro lipschitz_intros, rule lipschitz_on_subset[OF _ middle])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {A..B} d
[PROOF STEP]
using \<open>(2 * lambda)-lipschitz_on {A..B} d\<close>
[PROOF STATE]
proof (prove)
using this:
(2 * lambda)-lipschitz_on {A..B} d

goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {A..B} d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(2 * lambda * (0 + \<bar>sgn (uM - um)\<bar> * (1 + 0)))-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} (d \<circ> (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)))

goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
[PROOF STEP]
have ***: "(2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + abs(uM - um)} (d o (\<lambda>t. um + sgn(uM-um) * (t - dist xm ym)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} (d \<circ> (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)))
[PROOF STEP]
apply (rule lipschitz_on_mono[OF **])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>}
 2. 2 * lambda * (0 + \<bar>sgn (uM - um)\<bar> * (1 + 0)) \<le> 2 * lambda
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (2 subgoals):
 1. {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>}
 2. 2 * lambda * (0 + \<bar>sgn (uM - um)\<bar> * (1 + 0)) \<le> 2 * lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} (d \<circ> (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)))

goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
[PROOF STEP]
show "(2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + abs(uM - um)} excursion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion
[PROOF STEP]
apply (rule lipschitz_on_transform[OF ***])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> excursion x = (d \<circ> (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym))) x
[PROOF STEP]
using E2
[PROOF STATE]
proof (prove)
using this:
?t \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> excursion ?t = d (um + sgn (uM - um) * (?t - dist xm ym))

goal (1 subgoal):
 1. \<And>x. x \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> excursion x = (d \<circ> (\<lambda>t. um + sgn (uM - um) * (t - dist xm ym))) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 * lambda)-lipschitz_on {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} excursion

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(2 * lambda)-lipschitz_on {0..L} excursion

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have *: "dist x z \<ge> D" if z: "z \<in> excursion`{0..L}" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
obtain tz where tz: "z = excursion tz" "tz \<in> {0..dist xm ym + abs(uM - um) + dist yM xM}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>tz. \<lbrakk>z = excursion tz; tz \<in> {0..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using z L_def
[PROOF STATE]
proof (prove)
using this:
z \<in> excursion ` {0..L}
L = dist xm ym + \<bar>uM - um\<bar> + dist yM xM

goal (1 subgoal):
 1. (\<And>tz. \<lbrakk>z = excursion tz; tz \<in> {0..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z = excursion tz
tz \<in> {0..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
consider "tz \<in> {0..dist xm ym}" | "tz \<in> {dist xm ym<..dist xm ym + abs(uM - um)}" | "tz \<in> {dist xm ym + abs(uM - um)<..dist xm ym + abs(uM - um) + dist yM xM}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>tz \<in> {0..dist xm ym} \<Longrightarrow> thesis; tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> thesis; tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using tz
[PROOF STATE]
proof (prove)
using this:
z = excursion tz
tz \<in> {0..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}

goal (1 subgoal):
 1. \<lbrakk>tz \<in> {0..dist xm ym} \<Longrightarrow> thesis; tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> thesis; tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrakk>tz \<in> {0..dist xm ym} \<Longrightarrow> ?thesis; tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> ?thesis; tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>tz \<in> {0..dist xm ym} \<Longrightarrow> ?thesis; tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> ?thesis; tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>tz \<in> {0..dist xm ym} \<Longrightarrow> ?thesis; tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> ?thesis; tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. tz \<in> {0..dist xm ym} \<Longrightarrow> D \<le> dist x z
 2. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
 3. tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
tz \<in> {0..dist xm ym}

goal (3 subgoals):
 1. tz \<in> {0..dist xm ym} \<Longrightarrow> D \<le> dist x z
 2. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
 3. tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tz \<in> {0..dist xm ym}
[PROOF STEP]
have "z \<in> {xm--ym}"
[PROOF STATE]
proof (prove)
using this:
tz \<in> {0..dist xm ym}

goal (1 subgoal):
 1. z \<in> {xm--ym}
[PROOF STEP]
unfolding tz(1) excursion_def
[PROOF STATE]
proof (prove)
using this:
tz \<in> {0..dist xm ym}

goal (1 subgoal):
 1. (if tz \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm tz else if tz \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (tz - dist xm ym)) else geodesic_segment_param {yM--xM} yM (tz - dist xm ym - \<bar>uM - um\<bar>)) \<in> {xm--ym}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> {xm--ym}

goal (3 subgoals):
 1. tz \<in> {0..dist xm ym} \<Longrightarrow> D \<le> dist x z
 2. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
 3. tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> {xm--ym}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> {xm--ym}

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
using D1
[PROOF STATE]
proof (prove)
using this:
z \<in> {xm--ym}
?z \<in> {xm--ym} \<Longrightarrow> D \<le> dist x ?z

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal (2 subgoals):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
 2. tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
 2. tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
case 3
[PROOF STATE]
proof (state)
this:
tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}

goal (2 subgoals):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
 2. tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}
[PROOF STEP]
have "z \<in> {yM--xM}"
[PROOF STATE]
proof (prove)
using this:
tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}

goal (1 subgoal):
 1. z \<in> {yM--xM}
[PROOF STEP]
unfolding tz(1) excursion_def
[PROOF STATE]
proof (prove)
using this:
tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}

goal (1 subgoal):
 1. (if tz \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm tz else if tz \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (tz - dist xm ym)) else geodesic_segment_param {yM--xM} yM (tz - dist xm ym - \<bar>uM - um\<bar>)) \<in> {yM--xM}
[PROOF STEP]
using tz(2)
[PROOF STATE]
proof (prove)
using this:
tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}
tz \<in> {0..dist xm ym + \<bar>uM - um\<bar> + dist yM xM}

goal (1 subgoal):
 1. (if tz \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm tz else if tz \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (tz - dist xm ym)) else geodesic_segment_param {yM--xM} yM (tz - dist xm ym - \<bar>uM - um\<bar>)) \<in> {yM--xM}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> {yM--xM}

goal (2 subgoals):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
 2. tz \<in> {dist xm ym + \<bar>uM - um\<bar><..dist xm ym + \<bar>uM - um\<bar> + dist yM xM} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> {yM--xM}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> {yM--xM}

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
using D3
[PROOF STATE]
proof (prove)
using this:
z \<in> {yM--xM}
?z \<in> {xM--yM} \<Longrightarrow> D \<le> dist x ?z

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
by (simp add: some_geodesic_commute)
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal (1 subgoal):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>}

goal (1 subgoal):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>}
[PROOF STEP]
have "z \<in> d`{A..B}"
[PROOF STATE]
proof (prove)
using this:
tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>}

goal (1 subgoal):
 1. z \<in> d ` {A..B}
[PROOF STEP]
unfolding tz(1) excursion_def
[PROOF STATE]
proof (prove)
using this:
tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>}

goal (1 subgoal):
 1. (if tz \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm tz else if tz \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (tz - dist xm ym)) else geodesic_segment_param {yM--xM} yM (tz - dist xm ym - \<bar>uM - um\<bar>)) \<in> d ` {A..B}
[PROOF STEP]
using middle
[PROOF STATE]
proof (prove)
using this:
tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>}
(\<lambda>t. um + sgn (uM - um) * (t - dist xm ym)) ` {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} \<subseteq> {A..B}

goal (1 subgoal):
 1. (if tz \<in> {0..dist xm ym} then geodesic_segment_param {xm--ym} xm tz else if tz \<in> {dist xm ym..dist xm ym + \<bar>uM - um\<bar>} then d (um + sgn (uM - um) * (tz - dist xm ym)) else geodesic_segment_param {yM--xM} yM (tz - dist xm ym - \<bar>uM - um\<bar>)) \<in> d ` {A..B}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
z \<in> d ` {A..B}

goal (1 subgoal):
 1. tz \<in> {dist xm ym<..dist xm ym + \<bar>uM - um\<bar>} \<Longrightarrow> D \<le> dist x z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> d ` {A..B}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> d ` {A..B}

goal (1 subgoal):
 1. D \<le> dist x z
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
using this:
z \<in> d ` {A..B}

goal (1 subgoal):
 1. infdist x (d ` {A..B}) \<le> dist x z
[PROOF STEP]
by (simp add: infdist_le)
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
D \<le> dist x z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?z \<in> excursion ` {0..L} \<Longrightarrow> D \<le> dist x ?z

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
text \<open>Now comes the main point: the excursion is always at distance at least $D$ of $x$,
      but this distance is also bounded by the log of its length, i.e., essentially $\log D$. To
      have an efficient estimate, we use a rescaled version, to get rid of one term on the right
      hand side.\<close>
[PROOF STATE]
proof (state)
this:
?z \<in> excursion ` {0..L} \<Longrightarrow> D \<le> dist x ?z

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "1 * 1 * 1 * (1 + 0/1) \<le> 512 * lambda * lambda * (1+C/D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * 1 * 1 * (1 + 0 / 1) \<le> 512 * lambda * lambda * (1 + C / D)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. 1 \<le> 512
 2. 1 \<le> lambda
 3. 0 \<le> 512
 4. 0 \<le> 1
 5. 1 \<le> lambda
 6. 0 \<le> 512 * lambda
 7. 0 \<le> 1
 8. 0 / 1 \<le> C / D
 9. 0 \<le> 512 * lambda * lambda
 10. 0 \<le> 1 + 0 / 1
[PROOF STEP]
using \<open>lambda \<ge> 1\<close> \<open>D \<ge> 1\<close> \<open>C \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> lambda
1 \<le> D
0 \<le> C

goal (10 subgoals):
 1. 1 \<le> 512
 2. 1 \<le> lambda
 3. 0 \<le> 512
 4. 0 \<le> 1
 5. 1 \<le> lambda
 6. 0 \<le> 512 * lambda
 7. 0 \<le> 1
 8. 0 / 1 \<le> C / D
 9. 0 \<le> 512 * lambda * lambda
 10. 0 \<le> 1 + 0 / 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 * 1 * 1 * (1 + 0 / 1) \<le> 512 * lambda * lambda * (1 + C / D)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 * 1 * 1 * (1 + 0 / 1) \<le> 512 * lambda * lambda * (1 + C / D)
[PROOF STEP]
have "ln (512 * lambda * lambda * (1+C/D)) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
1 * 1 * 1 * (1 + 0 / 1) \<le> 512 * lambda * lambda * (1 + C / D)

goal (1 subgoal):
 1. 0 \<le> ln (512 * lambda * lambda * (1 + C / D))
[PROOF STEP]
apply (subst ln_ge_zero_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 1 * 1 * 1 * (1 + 0 / 1) \<le> 512 * lambda * lambda * (1 + C / D) \<Longrightarrow> 0 < 512 * lambda * lambda * (1 + C / D)
 2. 1 * 1 * 1 * (1 + 0 / 1) \<le> 512 * lambda * lambda * (1 + C / D) \<Longrightarrow> 1 \<le> 512 * lambda * lambda * (1 + C / D)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> ln (512 * lambda * lambda * (1 + C / D))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
define a where "a = 64 * lambda/D"
[PROOF STATE]
proof (state)
this:
a = 64 * lambda / D

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "a > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 64 * lambda / D
[PROOF STEP]
using \<open>D \<ge> 1\<close> \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> D
1 \<le> lambda

goal (1 subgoal):
 1. 0 < 64 * lambda / D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "D \<le> infdist x (excursion`{0..L})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<le> infdist x (excursion ` {0..L})
[PROOF STEP]
unfolding infdist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<le> (if excursion ` {0..L} = {} then 0 else Inf (dist x ` excursion ` {0..L}))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<le> Inf (dist x ` excursion ` {0..L})
[PROOF STEP]
apply (rule cInf_greatest)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dist x ` excursion ` {0..L} \<noteq> {}
 2. \<And>xa. xa \<in> dist x ` excursion ` {0..L} \<Longrightarrow> D \<le> xa
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
?z \<in> excursion ` {0..L} \<Longrightarrow> D \<le> dist x ?z

goal (2 subgoals):
 1. dist x ` excursion ` {0..L} \<noteq> {}
 2. \<And>xa. xa \<in> dist x ` excursion ` {0..L} \<Longrightarrow> D \<le> xa
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<le> infdist x (excursion ` {0..L})

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
D \<le> infdist x (excursion ` {0..L})

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> (4/ln 2) * deltaG(TYPE('a)) * max 0 (ln (a * (L-0))) + (2 * lambda) / a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x (excursion ` {0..L}) \<le> 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * (L - 0))) + 2 * lambda / a
[PROOF STEP]
proof (rule lipschitz_path_close_to_geodesic'[of _ _ _ _ "geodesic_subsegment {c A--c B} (c A) tm tM"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (2 * lambda)-lipschitz_on {0..L} excursion
 2. geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (excursion 0) (excursion L)
 3. x \<in> geodesic_subsegment {c A--c B} (c A) tm tM
 4. 0 < a
[PROOF STEP]
show "(2 * lambda)-lipschitz_on {0..L} excursion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * lambda)-lipschitz_on {0..L} excursion
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
(2 * lambda)-lipschitz_on {0..L} excursion

goal (3 subgoals):
 1. geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (excursion 0) (excursion L)
 2. x \<in> geodesic_subsegment {c A--c B} (c A) tm tM
 3. 0 < a
[PROOF STEP]
have *: "geodesic_subsegment {c A--c B} (c A) tm tM = geodesic_segment_param {c A--c B} (c A) ` {tm..tM} "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_subsegment {c A--c B} (c A) tm tM = geodesic_segment_param {c A--c B} (c A) ` {tm..tM}
[PROOF STEP]
apply (rule geodesic_subsegment(1)[of _ _ "c B"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. geodesic_segment_between {c A--c B} (c A) (c B)
 2. 0 \<le> tm
 3. tm \<le> tM
 4. tM \<le> dist (c A) (c B)
[PROOF STEP]
using \<open>tm \<in> {0..dist (c A) (c B)}\<close> \<open>tM \<in> {0..dist (c A) (c B)}\<close> \<open>tm \<le> tM\<close>
[PROOF STATE]
proof (prove)
using this:
tm \<in> {0..dist (c A) (c B)}
tM \<in> {0..dist (c A) (c B)}
tm \<le> tM

goal (4 subgoals):
 1. geodesic_segment_between {c A--c B} (c A) (c B)
 2. 0 \<le> tm
 3. tm \<le> tM
 4. tM \<le> dist (c A) (c B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
geodesic_subsegment {c A--c B} (c A) tm tM = geodesic_segment_param {c A--c B} (c A) ` {tm..tM}

goal (3 subgoals):
 1. geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (excursion 0) (excursion L)
 2. x \<in> geodesic_subsegment {c A--c B} (c A) tm tM
 3. 0 < a
[PROOF STEP]
show "x \<in> geodesic_subsegment {c A--c B} (c A) tm tM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> geodesic_subsegment {c A--c B} (c A) tm tM
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> geodesic_segment_param {c A--c B} (c A) ` {tm..tM}
[PROOF STEP]
unfolding x_param tm_def tM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_segment_param {c A--c B} (c A) tx \<in> geodesic_segment_param {c A--c B} (c A) ` {max (tx - 2 * D) 0..min (tx + 2 * D) (dist (c A) (c B))}
[PROOF STEP]
using \<open>tx \<in> {0..dist (c A) (c B)}\<close> \<open>0 \<le> D\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {0..dist (c A) (c B)}
0 \<le> D

goal (1 subgoal):
 1. geodesic_segment_param {c A--c B} (c A) tx \<in> geodesic_segment_param {c A--c B} (c A) ` {max (tx - 2 * D) 0..min (tx + 2 * D) (dist (c A) (c B))}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> geodesic_subsegment {c A--c B} (c A) tm tM

goal (2 subgoals):
 1. geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (excursion 0) (excursion L)
 2. 0 < a
[PROOF STEP]
show "geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (excursion 0) (excursion L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (excursion 0) (excursion L)
[PROOF STEP]
unfolding E0 EL xm_def xM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (geodesic_segment_param {c A--c B} (c A) tm) (geodesic_segment_param {c A--c B} (c A) tM)
[PROOF STEP]
apply (rule geodesic_subsegment[of _ _ "c B"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. geodesic_segment_between {c A--c B} (c A) (c B)
 2. 0 \<le> tm
 3. tm \<le> tM
 4. tM \<le> dist (c A) (c B)
[PROOF STEP]
using \<open>tm \<in> {0..dist (c A) (c B)}\<close> \<open>tM \<in> {0..dist (c A) (c B)}\<close> \<open>tm \<le> tM\<close>
[PROOF STATE]
proof (prove)
using this:
tm \<in> {0..dist (c A) (c B)}
tM \<in> {0..dist (c A) (c B)}
tm \<le> tM

goal (4 subgoals):
 1. geodesic_segment_between {c A--c B} (c A) (c B)
 2. 0 \<le> tm
 3. tm \<le> tM
 4. tM \<le> dist (c A) (c B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
geodesic_segment_between (geodesic_subsegment {c A--c B} (c A) tm tM) (excursion 0) (excursion L)

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
qed (fact)
[PROOF STATE]
proof (state)
this:
infdist x (excursion ` {0..L}) \<le> 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * (L - 0))) + 2 * lambda / a

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist x (excursion ` {0..L}) \<le> 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * (L - 0))) + 2 * lambda / a

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... = (4/ln 2) * deltaG(TYPE('a)) * max 0 (ln (a *L)) + D/32"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * (L - 0))) + 2 * lambda / a = 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * L)) + D / 32
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (L - 0))) + 2 * lambda / (64 * lambda / D) = 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (64 * lambda / D * L)) + D / 32
[PROOF STEP]
using \<open>D \<ge> 1\<close> \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> D
1 \<le> lambda

goal (1 subgoal):
 1. 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (L - 0))) + 2 * lambda / (64 * lambda / D) = 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (64 * lambda / D * L)) + D / 32
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * (L - 0))) + 2 * lambda / a = 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * L)) + D / 32

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
D \<le> 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * L)) + D / 32
[PROOF STEP]
have "(31 * ln 2 / 128) * D \<le> deltaG(TYPE('a)) * max 0 (ln (a * L))"
[PROOF STATE]
proof (prove)
using this:
D \<le> 4 / ln 2 * deltaG TYPE('a) * max 0 (ln (a * L)) + D / 32

goal (1 subgoal):
 1. 31 * ln 2 / 128 * D \<le> deltaG TYPE('a) * max 0 (ln (a * L))
[PROOF STEP]
by (auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
31 * ln 2 / 128 * D \<le> deltaG TYPE('a) * max 0 (ln (a * L))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
31 * ln 2 / 128 * D \<le> deltaG TYPE('a) * max 0 (ln (a * L))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> deltaG(TYPE('a)) * max 0 (ln ((64 * lambda/D) * (lambda * (8 * D + 4 * C))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * max 0 (ln (a * L)) \<le> deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 4 * C))))
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * max 0 (ln (64 * lambda / D * L)) \<le> deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 4 * C))))
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 \<le> 0
 2. 0 < 64 * lambda / D * L
 3. L \<le> lambda * (8 * D + 4 * C)
 4. 0 \<le> 64 * lambda / D
[PROOF STEP]
using L_bound \<open>L > 0\<close> \<open>lambda \<ge> 1\<close> \<open>D \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
L \<le> lambda * (8 * D + 4 * C)
0 < L
1 \<le> lambda
1 \<le> D

goal (4 subgoals):
 1. 0 \<le> 0
 2. 0 < 64 * lambda / D * L
 3. L \<le> lambda * (8 * D + 4 * C)
 4. 0 \<le> 64 * lambda / D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (a * L)) \<le> deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 4 * C))))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (a * L)) \<le> deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 4 * C))))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> deltaG(TYPE('a)) * max 0 (ln ((64 * lambda/D) * (lambda * (8 * D + 8 * C))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 4 * C)))) \<le> deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 8 * C))))
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. 0 \<le> 0
 2. 0 < 64 * lambda / D * (lambda * (8 * D + 4 * C))
 3. 4 \<le> 8
 4. 0 \<le> C
 5. 0 \<le> lambda
 6. 0 \<le> 64 * lambda / D
[PROOF STEP]
using L_bound \<open>L > 0\<close> \<open>lambda \<ge> 1\<close> \<open>D \<ge> 1\<close> \<open>C \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
L \<le> lambda * (8 * D + 4 * C)
0 < L
1 \<le> lambda
1 \<le> D
0 \<le> C

goal (6 subgoals):
 1. 0 \<le> 0
 2. 0 < 64 * lambda / D * (lambda * (8 * D + 4 * C))
 3. 4 \<le> 8
 4. 0 \<le> C
 5. 0 \<le> lambda
 6. 0 \<le> 64 * lambda / D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 4 * C)))) \<le> deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 8 * C))))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 4 * C)))) \<le> deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 8 * C))))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... = deltaG(TYPE('a)) * max 0 (ln (512 * lambda * lambda * (1+C/D)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 8 * C)))) = deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D)))
[PROOF STEP]
using \<open>D \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> D

goal (1 subgoal):
 1. deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 8 * C)))) = deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D)))
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 8 * C)))) = deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D)))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (64 * lambda / D * (lambda * (8 * D + 8 * C)))) = deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D)))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... = deltaG(TYPE('a)) * ln (512 * lambda * lambda * (1+C/D))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D))) = deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D))
[PROOF STEP]
using \<open>ln (512 * lambda * lambda * (1+C/D)) \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> ln (512 * lambda * lambda * (1 + C / D))

goal (1 subgoal):
 1. deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D))) = deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D))) = deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * max 0 (ln (512 * lambda * lambda * (1 + C / D))) = deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> deltaG(TYPE('a)) * ln (512 * lambda * lambda * (1+C/1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D)) \<le> deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1))
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < 512 * lambda * lambda * (1 + C / D)
 2. C / D \<le> C / 1
 3. 0 \<le> 512 * lambda * lambda
[PROOF STEP]
using \<open>lambda \<ge> 1\<close> \<open>C \<ge> 0\<close> \<open>D \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> lambda
0 \<le> C
1 \<le> D

goal (3 subgoals):
 1. 0 < 512 * lambda * lambda * (1 + C / D)
 2. C / D \<le> C / 1
 3. 0 \<le> 512 * lambda * lambda
[PROOF STEP]
by (auto simp add: divide_simps mult_ge1_mono(1))
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D)) \<le> deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
text \<open>We have obtained a bound on $D$, of the form $D \leq M \delta \ln(M \lambda^2(1+C))$.
      This is a nice bound, but we tweak it a little bit to obtain something more manageable,
      without the logarithm.\<close>
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D)) \<le> deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / D)) \<le> deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... = deltaG(TYPE('a)) * (ln 512 + 2 * ln lambda + ln (1+C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln 512 + 2 * ln lambda + ln (1 + C))
[PROOF STEP]
apply (subst ln2mult)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < lambda
 2. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln 512 + ln (lambda * lambda) + ln (1 + C))
[PROOF STEP]
using \<open>C \<ge> 0\<close> \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (2 subgoals):
 1. 0 < lambda
 2. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln 512 + ln (lambda * lambda) + ln (1 + C))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln 512 + ln (lambda * lambda) + ln (1 + C))
[PROOF STEP]
apply (subst ln_mult[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < 512
 2. 0 < lambda * lambda
 3. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln (512 * (lambda * lambda)) + ln (1 + C))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < lambda * lambda
 2. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln (512 * (lambda * lambda)) + ln (1 + C))
[PROOF STEP]
using \<open>C \<ge> 0\<close> \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (2 subgoals):
 1. 0 < lambda * lambda
 2. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln (512 * (lambda * lambda)) + ln (1 + C))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln (512 * (lambda * lambda)) + ln (1 + C))
[PROOF STEP]
apply (subst ln_mult[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < 512 * (lambda * lambda)
 2. 0 < 1 + C
 3. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * ln (512 * (lambda * lambda) * (1 + C))
[PROOF STEP]
using \<open>C \<ge> 0\<close> \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (3 subgoals):
 1. 0 < 512 * (lambda * lambda)
 2. 0 < 1 + C
 3. deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * ln (512 * (lambda * lambda) * (1 + C))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln 512 + 2 * ln lambda + ln (1 + C))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * ln (512 * lambda * lambda * (1 + C / 1)) = deltaG TYPE('a) * (ln 512 + 2 * ln lambda + ln (1 + C))

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... = (deltaG(TYPE('a)) * 1) * ln 512 + 2 * (deltaG(TYPE('a)) * ln lambda) + (deltaG(TYPE('a)) * ln (1+C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * (ln 512 + 2 * ln lambda + ln (1 + C)) = deltaG TYPE('a) * 1 * ln 512 + 2 * (deltaG TYPE('a) * ln lambda) + deltaG TYPE('a) * ln (1 + C)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * (ln 512 + 2 * ln lambda + ln (1 + C)) = deltaG TYPE('a) * 1 * ln 512 + 2 * (deltaG TYPE('a) * ln lambda) + deltaG TYPE('a) * ln (1 + C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
text \<open>For each term, of the form $\delta \ln c$, we bound it by $(\delta^2 + (\ln c)^2)/2$, and
      then bound $(\ln c)^2$ by $2c-2$. In fact, to get coefficients of the same order of
      magnitude on $\delta^2$ and $\lambda$, we tweak a little bit the inequality for the last two
      terms, using rather $uv \leq (u^2/2 + 2v^2)/2$. We also bound $\ln(32)$ by a good
      approximation $16/3$.\<close>
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * (ln 512 + 2 * ln lambda + ln (1 + C)) = deltaG TYPE('a) * 1 * ln 512 + 2 * (deltaG TYPE('a) * ln lambda) + deltaG TYPE('a) * ln (1 + C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * (ln 512 + 2 * ln lambda + ln (1 + C)) = deltaG TYPE('a) * 1 * ln 512 + 2 * (deltaG TYPE('a) * ln lambda) + deltaG TYPE('a) * ln (1 + C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> (deltaG(TYPE('a))^2/2 + 1^2/2) * (25/4)
            + 2 * ((1/2) * deltaG(TYPE('a))^2/2 + 2 * (ln lambda)^2 / 2) + ((1/2) * deltaG(TYPE('a))^2/2 + 2 * (ln (1+C))^2 / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('a) * 1 * ln 512 + 2 * (deltaG TYPE('a) * ln lambda) + deltaG TYPE('a) * ln (1 + C) \<le> ((deltaG TYPE('a))\<^sup>2 / 2 + 1\<^sup>2 / 2) * (25 / 4) + 2 * (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln lambda)\<^sup>2 / 2) + (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln (1 + C))\<^sup>2 / 2)
[PROOF STEP]
by (intro mono_intros, auto, approximation 10)
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * 1 * ln 512 + 2 * (deltaG TYPE('a) * ln lambda) + deltaG TYPE('a) * ln (1 + C) \<le> ((deltaG TYPE('a))\<^sup>2 / 2 + 1\<^sup>2 / 2) * (25 / 4) + 2 * (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln lambda)\<^sup>2 / 2) + (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln (1 + C))\<^sup>2 / 2)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deltaG TYPE('a) * 1 * ln 512 + 2 * (deltaG TYPE('a) * ln lambda) + deltaG TYPE('a) * ln (1 + C) \<le> ((deltaG TYPE('a))\<^sup>2 / 2 + 1\<^sup>2 / 2) * (25 / 4) + 2 * (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln lambda)\<^sup>2 / 2) + (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln (1 + C))\<^sup>2 / 2)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... = (31/8) * deltaG(TYPE('a))^2 + 25/8 + 2 * (ln lambda)^2 + (ln (1+C))^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((deltaG TYPE('a))\<^sup>2 / 2 + 1\<^sup>2 / 2) * (25 / 4) + 2 * (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln lambda)\<^sup>2 / 2) + (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln (1 + C))\<^sup>2 / 2) = 31 / 8 * (deltaG TYPE('a))\<^sup>2 + 25 / 8 + 2 * (ln lambda)\<^sup>2 + (ln (1 + C))\<^sup>2
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
((deltaG TYPE('a))\<^sup>2 / 2 + 1\<^sup>2 / 2) * (25 / 4) + 2 * (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln lambda)\<^sup>2 / 2) + (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln (1 + C))\<^sup>2 / 2) = 31 / 8 * (deltaG TYPE('a))\<^sup>2 + 25 / 8 + 2 * (ln lambda)\<^sup>2 + (ln (1 + C))\<^sup>2

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((deltaG TYPE('a))\<^sup>2 / 2 + 1\<^sup>2 / 2) * (25 / 4) + 2 * (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln lambda)\<^sup>2 / 2) + (1 / 2 * (deltaG TYPE('a))\<^sup>2 / 2 + 2 * (ln (1 + C))\<^sup>2 / 2) = 31 / 8 * (deltaG TYPE('a))\<^sup>2 + 25 / 8 + 2 * (ln lambda)\<^sup>2 + (ln (1 + C))\<^sup>2

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> 4 * deltaG(TYPE('a))^2 + 4 + 2 * (2 * lambda - 2) + (2 * (1+C) - 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 31 / 8 * (deltaG TYPE('a))\<^sup>2 + 25 / 8 + 2 * (ln lambda)\<^sup>2 + (ln (1 + C))\<^sup>2 \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 + 2 * (2 * lambda - 2) + (2 * (1 + C) - 2)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. 31 / 8 \<le> 4
 2. 0 \<le> (deltaG TYPE('a))\<^sup>2
 3. 25 / 8 \<le> 4
 4. 1 \<le> lambda
 5. 0 \<le> 2
 6. 1 \<le> 1 + C
[PROOF STEP]
using \<open>C \<ge> 0\<close> \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (6 subgoals):
 1. 31 / 8 \<le> 4
 2. 0 \<le> (deltaG TYPE('a))\<^sup>2
 3. 25 / 8 \<le> 4
 4. 1 \<le> lambda
 5. 0 \<le> 2
 6. 1 \<le> 1 + C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
31 / 8 * (deltaG TYPE('a))\<^sup>2 + 25 / 8 + 2 * (ln lambda)\<^sup>2 + (ln (1 + C))\<^sup>2 \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 + 2 * (2 * lambda - 2) + (2 * (1 + C) - 2)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
31 / 8 * (deltaG TYPE('a))\<^sup>2 + 25 / 8 + 2 * (ln lambda)\<^sup>2 + (ln (1 + C))\<^sup>2 \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 + 2 * (2 * lambda - 2) + (2 * (1 + C) - 2)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> 4 * deltaG(TYPE('a))^2 + 4 * lambda + 2 * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * (deltaG TYPE('a))\<^sup>2 + 4 + 2 * (2 * lambda - 2) + (2 * (1 + C) - 2) \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
4 * (deltaG TYPE('a))\<^sup>2 + 4 + 2 * (2 * lambda - 2) + (2 * (1 + C) - 2) \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
31 * ln 2 / 128 * D \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C
[PROOF STEP]
have "D \<le> (128 / (31 * ln 2)) * (4 * deltaG(TYPE('a))^2 + 4 * lambda + 2 * C)"
[PROOF STATE]
proof (prove)
using this:
31 * ln 2 / 128 * D \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C

goal (1 subgoal):
 1. D \<le> 128 / (31 * ln 2) * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C)
[PROOF STEP]
by (auto simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
D \<le> 128 / (31 * ln 2) * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
D \<le> 128 / (31 * ln 2) * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> 6 * (4 * deltaG(TYPE('a))^2 + 4 * lambda + 2 * C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 128 / (31 * ln 2) * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C) \<le> 6 * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C)
[PROOF STEP]
apply (intro mono_intros, approximation 10)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C
[PROOF STEP]
using \<open>lambda \<ge> 1\<close> \<open>C \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> lambda
0 \<le> C

goal (1 subgoal):
 1. 0 \<le> 4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
128 / (31 * ln 2) * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C) \<le> 6 * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
128 / (31 * ln 2) * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C) \<le> 6 * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C)

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
have "... \<le> 24 * deltaG(TYPE('a))^2 + 24 * lambda + 12 * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 6 * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C) \<le> 24 * (deltaG TYPE('a))\<^sup>2 + 24 * lambda + 12 * C
[PROOF STEP]
using \<open>lambda \<ge> 1\<close> \<open>C \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> lambda
0 \<le> C

goal (1 subgoal):
 1. 6 * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C) \<le> 24 * (deltaG TYPE('a))\<^sup>2 + 24 * lambda + 12 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
6 * (4 * (deltaG TYPE('a))\<^sup>2 + 4 * lambda + 2 * C) \<le> 24 * (deltaG TYPE('a))\<^sup>2 + 24 * lambda + 12 * C

goal (1 subgoal):
 1. \<not> D \<le> 1 \<Longrightarrow> D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
D \<le> 24 * (deltaG TYPE('a))\<^sup>2 + 24 * lambda + 12 * C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
D \<le> 24 * (deltaG TYPE('a))\<^sup>2 + 24 * lambda + 12 * C

goal (1 subgoal):
 1. D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
define D0 where "D0 = 24 * lambda + 12 * C + 24 * deltaG(TYPE('a))^2"
[PROOF STATE]
proof (state)
this:
D0 = 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have first_step: "infdist y (d`{A..B}) \<le> D0" if "y \<in> {c A--c B}" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist y (d ` {A..B}) \<le> D0
[PROOF STEP]
using x(2)[OF that] D_bound
[PROOF STATE]
proof (prove)
using this:
infdist y (d ` {A..B}) \<le> infdist x (d ` {A..B})
D \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal (1 subgoal):
 1. infdist y (d ` {A..B}) \<le> D0
[PROOF STEP]
unfolding D0_def D_def
[PROOF STATE]
proof (prove)
using this:
infdist y (d ` {A..B}) \<le> infdist x (d ` {A..B})
infdist x (d ` {A..B}) \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2

goal (1 subgoal):
 1. infdist y (d ` {A..B}) \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y \<in> {c A--c B} \<Longrightarrow> infdist ?y (d ` {A..B}) \<le> D0

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "1 * 1 + 4 * 0 + 24 * 0 \<le> D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * 1 + 4 * 0 + 24 * 0 \<le> D0
[PROOF STEP]
unfolding D0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * 1 + 4 * 0 + 24 * 0 \<le> 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. 1 \<le> 24
 2. 1 \<le> lambda
 3. 0 \<le> 24
 4. 0 \<le> 1
 5. 4 \<le> 12
 6. 0 \<le> C
 7. 0 \<le> 12
 8. 0 \<le> 0
 9. 0 \<le> (deltaG TYPE('a))\<^sup>2
 10. 0 \<le> 24
[PROOF STEP]
using C delta_nonneg
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
0 \<le> deltaG TYPE('a)

goal (10 subgoals):
 1. 1 \<le> 24
 2. 1 \<le> lambda
 3. 0 \<le> 24
 4. 0 \<le> 1
 5. 4 \<le> 12
 6. 0 \<le> C
 7. 0 \<le> 12
 8. 0 \<le> 0
 9. 0 \<le> (deltaG TYPE('a))\<^sup>2
 10. 0 \<le> 24
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 * 1 + 4 * 0 + 24 * 0 \<le> D0

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 * 1 + 4 * 0 + 24 * 0 \<le> D0
[PROOF STEP]
have "D0 > 0"
[PROOF STATE]
proof (prove)
using this:
1 * 1 + 4 * 0 + 24 * 0 \<le> D0

goal (1 subgoal):
 1. 0 < D0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < D0

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
text \<open>This is the end of the first step, i.e., showing that $[c(A), c(B)]$ is included in
    the neighborhood of size $D0$ of the quasi-geodesic.\<close>
[PROOF STATE]
proof (state)
this:
0 < D0

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
text \<open>Now, we start the second step: we show that the quasi-geodesic is included in the
    neighborhood of size $D1$ of the geodesic, where $D1 \geq D0$ is the constant defined below.
    The argument goes as follows. Assume that a point $y$ on the quasi-geodesic is at distance $ > D0$
    of the geodesic. Consider the last point $y_m$ before $y$ which is at distance $D0$ of the
    geodesic, and the first point $y_M$ after $y$ likewise. On $(y_m, y_M)$, one is always at distance
    $ > D0$ of the geodesic. However, by the first step, the geodesic is covered by the balls of radius
    $D0$ centered at points on the quasi-geodesic -- and only the points before $y_m$ or after $y_M$
    can be used. Let $K_m$ be the points on the geodesics that are at distance $\leq D0$ of a point
    on the quasi-geodesic before $y_m$, and likewise define $K_M$. These are two closed subsets of
    the geodesic. By connectedness, they have to intersect. This implies that some points before $y_m$
    and after $y_M$ are at distance at most $2D0$. Since we are dealing with a quasi-geodesic, this
    gives a bound on the distance between $y_m$ and $y_M$, and therefore a bound between $y$ and the
    geodesic, as desired.\<close>
[PROOF STATE]
proof (state)
this:
0 < D0

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
define D1 where "D1 = lambda * lambda * (72 * lambda + 44 * C + 72 * deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (state)
this:
D1 = lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "1 * 1 * (24 * lambda + 12 * C + 24 * deltaG(TYPE('a))^2)
            \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * 1 * (24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (12 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 24 \<le> 72
 6. 0 \<le> lambda
 7. 12 \<le> 44
 8. 0 \<le> C
 9. 24 \<le> 72
 10. 0 \<le> (deltaG TYPE('a))\<^sup>2
A total of 12 subgoals...
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda

goal (12 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 24 \<le> 72
 6. 0 \<le> lambda
 7. 12 \<le> 44
 8. 0 \<le> C
 9. 24 \<le> 72
 10. 0 \<le> (deltaG TYPE('a))\<^sup>2
A total of 12 subgoals...
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 * 1 * (24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 * 1 * (24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "D0 \<le> D1"
[PROOF STATE]
proof (prove)
using this:
1 * 1 * (24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. D0 \<le> D1
[PROOF STEP]
unfolding D0_def D1_def
[PROOF STATE]
proof (prove)
using this:
1 * 1 * (24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. 24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2 \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D0 \<le> D1

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have second_step: "infdist y {c A--c B} \<le> D1" if "y \<in> d`{A..B}" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist y {c A--c B} \<le> D1
[PROOF STEP]
proof (cases "infdist y {c A--c B} \<le> D0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
 2. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
infdist y {c A--c B} \<le> D0

goal (2 subgoals):
 1. infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
 2. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infdist y {c A--c B} \<le> D0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infdist y {c A--c B} \<le> D0

goal (1 subgoal):
 1. infdist y {c A--c B} \<le> D1
[PROOF STEP]
using \<open>D0 \<le> D1\<close>
[PROOF STATE]
proof (prove)
using this:
infdist y {c A--c B} \<le> D0
D0 \<le> D1

goal (1 subgoal):
 1. infdist y {c A--c B} \<le> D1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist y {c A--c B} \<le> D1

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> infdist y {c A--c B} \<le> D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
obtain ty where "ty \<in> {A..B}" "y = d ty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ty. \<lbrakk>ty \<in> {A..B}; y = d ty\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>y \<in> d`{A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> d ` {A..B}

goal (1 subgoal):
 1. (\<And>ty. \<lbrakk>ty \<in> {A..B}; y = d ty\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ty \<in> {A..B}
y = d ty

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
define tm where "tm = Sup ((\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {A..ty})"
[PROOF STATE]
proof (state)
this:
tm = Sup ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have tm: "tm \<in> (\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {A..ty}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
[PROOF STEP]
unfolding tm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}) \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
[PROOF STEP]
proof (rule closed_contains_Sup)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty} \<noteq> {}
 2. bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
 3. closed ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
show "closed ((\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {A..ty})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
apply (rule closed_vimage_Int, auto, intro continuous_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {A..ty} d
[PROOF STEP]
apply (rule continuous_on_subset[OF d(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {A..ty} \<subseteq> {A..B}
[PROOF STEP]
using \<open>ty \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
ty \<in> {A..B}

goal (1 subgoal):
 1. {A..ty} \<subseteq> {A..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closed ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})

goal (2 subgoals):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty} \<noteq> {}
 2. bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
have "A \<in> (\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {A..ty}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
[PROOF STEP]
using \<open>D0 > 0\<close> \<open>ty \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
0 < D0
ty \<in> {A..B}

goal (1 subgoal):
 1. A \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
[PROOF STEP]
by (auto simp add: \<open>d A = c A\<close>)
[PROOF STATE]
proof (state)
this:
A \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}

goal (2 subgoals):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty} \<noteq> {}
 2. bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
[PROOF STEP]
show "(\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {A..ty} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
A \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}

goal (1 subgoal):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty} \<noteq> {}

goal (1 subgoal):
 1. bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
show "bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have *: "infdist (d t) {c A--c B} > D0" if "t \<in> {tm<..ty}" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D0 < infdist (d t) {c A--c B}
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(infdist (d t) {c A--c B} > D0)"
[PROOF STATE]
proof (state)
this:
\<not> D0 < infdist (d t) {c A--c B}

goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> D0 < infdist (d t) {c A--c B}
[PROOF STEP]
have *: "t \<in> (\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {A..ty}"
[PROOF STATE]
proof (prove)
using this:
\<not> D0 < infdist (d t) {c A--c B}

goal (1 subgoal):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
[PROOF STEP]
using that tm
[PROOF STATE]
proof (prove)
using this:
\<not> D0 < infdist (d t) {c A--c B}
t \<in> {tm<..ty}
tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}

goal (1 subgoal):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}

goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
have "t \<le> tm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<le> tm
[PROOF STEP]
unfolding tm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<le> Sup ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
apply (rule cSup_upper)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
 2. bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}

goal (2 subgoals):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
 2. bdd_above ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<le> tm

goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<le> tm
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
t \<le> tm

goal (1 subgoal):
 1. False
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
t \<le> tm
t \<in> {tm<..ty}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?t \<in> {tm<..ty} \<Longrightarrow> D0 < infdist (d ?t) {c A--c B}

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
define tM where "tM = Inf ((\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {ty..B})"
[PROOF STATE]
proof (state)
this:
tM = Inf ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have tM: "tM \<in> (\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {ty..B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
[PROOF STEP]
unfolding tM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}) \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
[PROOF STEP]
proof (rule closed_contains_Inf)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B} \<noteq> {}
 2. bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
 3. closed ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
show "closed ((\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {ty..B})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
apply (rule closed_vimage_Int, auto, intro continuous_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {ty..B} d
[PROOF STEP]
apply (rule continuous_on_subset[OF d(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ty..B} \<subseteq> {A..B}
[PROOF STEP]
using \<open>ty \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
ty \<in> {A..B}

goal (1 subgoal):
 1. {ty..B} \<subseteq> {A..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closed ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})

goal (2 subgoals):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B} \<noteq> {}
 2. bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
have "B \<in> (\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {ty..B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
[PROOF STEP]
using \<open>D0 > 0\<close> \<open>ty \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
0 < D0
ty \<in> {A..B}

goal (1 subgoal):
 1. B \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
[PROOF STEP]
by (auto simp add: \<open>d B = c B\<close>)
[PROOF STATE]
proof (state)
this:
B \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (2 subgoals):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B} \<noteq> {}
 2. bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
[PROOF STEP]
show "(\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {ty..B} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
B \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (1 subgoal):
 1. (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B} \<noteq> {}

goal (1 subgoal):
 1. bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
show "bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "infdist (d t) {c A--c B} > D0" if "t \<in> {ty..<tM}" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D0 < infdist (d t) {c A--c B}
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(infdist (d t) {c A--c B} > D0)"
[PROOF STATE]
proof (state)
this:
\<not> D0 < infdist (d t) {c A--c B}

goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> D0 < infdist (d t) {c A--c B}
[PROOF STEP]
have *: "t \<in> (\<lambda>t. infdist (d t) {c A--c B})-`{..D0} \<inter> {ty..B}"
[PROOF STATE]
proof (prove)
using this:
\<not> D0 < infdist (d t) {c A--c B}

goal (1 subgoal):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
[PROOF STEP]
using that tM
[PROOF STATE]
proof (prove)
using this:
\<not> D0 < infdist (d t) {c A--c B}
t \<in> {ty..<tM}
tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (1 subgoal):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
have "t \<ge> tM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tM \<le> t
[PROOF STEP]
unfolding tM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}) \<le> t
[PROOF STEP]
apply (rule cInf_lower)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
 2. bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (2 subgoals):
 1. t \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
 2. bdd_below ((\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tM \<le> t

goal (1 subgoal):
 1. \<not> D0 < infdist (d t) {c A--c B} \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tM \<le> t
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
tM \<le> t

goal (1 subgoal):
 1. False
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
tM \<le> t
t \<in> {ty..<tM}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?t \<in> {ty..<tM} \<Longrightarrow> D0 < infdist (d ?t) {c A--c B}

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?t \<in> {ty..<tM} \<Longrightarrow> D0 < infdist (d ?t) {c A--c B}
[PROOF STEP]
have lower_tm_tM: "infdist (d t) {c A--c B} > D0" if "t \<in> {tm<..<tM}" for t
[PROOF STATE]
proof (prove)
using this:
?t \<in> {ty..<tM} \<Longrightarrow> D0 < infdist (d ?t) {c A--c B}

goal (1 subgoal):
 1. D0 < infdist (d t) {c A--c B}
[PROOF STEP]
using * that
[PROOF STATE]
proof (prove)
using this:
?t \<in> {ty..<tM} \<Longrightarrow> D0 < infdist (d ?t) {c A--c B}
?t \<in> {tm<..ty} \<Longrightarrow> D0 < infdist (d ?t) {c A--c B}
t \<in> {tm<..<tM}

goal (1 subgoal):
 1. D0 < infdist (d t) {c A--c B}
[PROOF STEP]
by (cases "t \<ge> ty", auto)
[PROOF STATE]
proof (state)
this:
?t \<in> {tm<..<tM} \<Longrightarrow> D0 < infdist (d ?t) {c A--c B}

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
define Km where "Km = (\<Union>z \<in> d`{A..tm}. cball z D0)"
[PROOF STATE]
proof (state)
this:
Km = (\<Union>z\<in>d ` {A..tm}. cball z D0)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
define KM where "KM = (\<Union>z \<in> d`{tM..B}. cball z D0)"
[PROOF STATE]
proof (state)
this:
KM = (\<Union>z\<in>d ` {tM..B}. cball z D0)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "{c A--c B} \<subseteq> Km \<union> KM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {c A--c B} \<subseteq> Km \<union> KM
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
assume "x \<in> {c A--c B}"
[PROOF STATE]
proof (state)
this:
x \<in> {c A--c B}

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
have "\<exists>z \<in> d`{A..B}. infdist x (d`{A..B}) = dist x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z\<in>d ` {A..B}. infdist x (d ` {A..B}) = dist x z
[PROOF STEP]
apply (rule infdist_proper_attained[OF proper_of_compact], rule compact_continuous_image[OF \<open>continuous_on {A..B} d\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. compact {A..B}
 2. d ` {A..B} \<noteq> {}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
y \<in> d ` {A..B}

goal (2 subgoals):
 1. compact {A..B}
 2. d ` {A..B} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z\<in>d ` {A..B}. infdist x (d ` {A..B}) = dist x z

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z\<in>d ` {A..B}. infdist x (d ` {A..B}) = dist x z
[PROOF STEP]
obtain tx where "tx \<in> {A..B}" "infdist x (d`{A..B}) = dist x (d tx)"
[PROOF STATE]
proof (prove)
using this:
\<exists>z\<in>d ` {A..B}. infdist x (d ` {A..B}) = dist x z

goal (1 subgoal):
 1. (\<And>tx. \<lbrakk>tx \<in> {A..B}; infdist x (d ` {A..B}) = dist x (d tx)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
tx \<in> {A..B}
infdist x (d ` {A..B}) = dist x (d tx)

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tx \<in> {A..B}
infdist x (d ` {A..B}) = dist x (d tx)
[PROOF STEP]
have "dist x (d tx) \<le> D0"
[PROOF STATE]
proof (prove)
using this:
tx \<in> {A..B}
infdist x (d ` {A..B}) = dist x (d tx)

goal (1 subgoal):
 1. dist x (d tx) \<le> D0
[PROOF STEP]
using first_step[OF \<open>x \<in> {c A--c B}\<close>]
[PROOF STATE]
proof (prove)
using this:
tx \<in> {A..B}
infdist x (d ` {A..B}) = dist x (d tx)
infdist x (d ` {A..B}) \<le> D0

goal (1 subgoal):
 1. dist x (d tx) \<le> D0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist x (d tx) \<le> D0

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist x (d tx) \<le> D0
[PROOF STEP]
have "x \<in> cball (d tx) D0"
[PROOF STATE]
proof (prove)
using this:
dist x (d tx) \<le> D0

goal (1 subgoal):
 1. x \<in> cball (d tx) D0
[PROOF STEP]
by (auto simp add: metric_space_class.dist_commute)
[PROOF STATE]
proof (state)
this:
x \<in> cball (d tx) D0

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
consider "tx \<in> {A..tm}" | "tx \<in> {tm<..<tM}" | "tx \<in> {tM..B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>tx \<in> {A..tm} \<Longrightarrow> thesis; tx \<in> {tm<..<tM} \<Longrightarrow> thesis; tx \<in> {tM..B} \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using \<open>tx \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {A..B}

goal (1 subgoal):
 1. \<lbrakk>tx \<in> {A..tm} \<Longrightarrow> thesis; tx \<in> {tm<..<tM} \<Longrightarrow> thesis; tx \<in> {tM..B} \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>tx \<in> {A..tm} \<Longrightarrow> ?thesis; tx \<in> {tm<..<tM} \<Longrightarrow> ?thesis; tx \<in> {tM..B} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>tx \<in> {A..tm} \<Longrightarrow> ?thesis; tx \<in> {tm<..<tM} \<Longrightarrow> ?thesis; tx \<in> {tM..B} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "x \<in> Km \<union> KM"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>tx \<in> {A..tm} \<Longrightarrow> ?thesis; tx \<in> {tm<..<tM} \<Longrightarrow> ?thesis; tx \<in> {tM..B} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. x \<in> Km \<union> KM
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. tx \<in> {A..tm} \<Longrightarrow> x \<in> Km \<union> KM
 2. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
 3. tx \<in> {tM..B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
tx \<in> {A..tm}

goal (3 subgoals):
 1. tx \<in> {A..tm} \<Longrightarrow> x \<in> Km \<union> KM
 2. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
 3. tx \<in> {tM..B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tx \<in> {A..tm}
[PROOF STEP]
have "x \<in> Km"
[PROOF STATE]
proof (prove)
using this:
tx \<in> {A..tm}

goal (1 subgoal):
 1. x \<in> Km
[PROOF STEP]
unfolding Km_def
[PROOF STATE]
proof (prove)
using this:
tx \<in> {A..tm}

goal (1 subgoal):
 1. x \<in> (\<Union>z\<in>d ` {A..tm}. cball z D0)
[PROOF STEP]
using \<open>x \<in> cball (d tx) D0\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {A..tm}
x \<in> cball (d tx) D0

goal (1 subgoal):
 1. x \<in> (\<Union>z\<in>d ` {A..tm}. cball z D0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> Km

goal (3 subgoals):
 1. tx \<in> {A..tm} \<Longrightarrow> x \<in> Km \<union> KM
 2. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
 3. tx \<in> {tM..B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> Km
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> Km

goal (1 subgoal):
 1. x \<in> Km \<union> KM
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> Km \<union> KM

goal (2 subgoals):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
 2. tx \<in> {tM..B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
 2. tx \<in> {tM..B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
case 3
[PROOF STATE]
proof (state)
this:
tx \<in> {tM..B}

goal (2 subgoals):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
 2. tx \<in> {tM..B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tx \<in> {tM..B}
[PROOF STEP]
have "x \<in> KM"
[PROOF STATE]
proof (prove)
using this:
tx \<in> {tM..B}

goal (1 subgoal):
 1. x \<in> KM
[PROOF STEP]
unfolding KM_def
[PROOF STATE]
proof (prove)
using this:
tx \<in> {tM..B}

goal (1 subgoal):
 1. x \<in> (\<Union>z\<in>d ` {tM..B}. cball z D0)
[PROOF STEP]
using \<open>x \<in> cball (d tx) D0\<close>
[PROOF STATE]
proof (prove)
using this:
tx \<in> {tM..B}
x \<in> cball (d tx) D0

goal (1 subgoal):
 1. x \<in> (\<Union>z\<in>d ` {tM..B}. cball z D0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> KM

goal (2 subgoals):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
 2. tx \<in> {tM..B} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> KM
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> KM

goal (1 subgoal):
 1. x \<in> Km \<union> KM
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> Km \<union> KM

goal (1 subgoal):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
tx \<in> {tm<..<tM}

goal (1 subgoal):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
have "infdist (d tx) {c A--c B} \<le> dist (d tx) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (d tx) {c A--c B} \<le> dist (d tx) x
[PROOF STEP]
using \<open>x \<in> {c A--c B}\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> {c A--c B}

goal (1 subgoal):
 1. infdist (d tx) {c A--c B} \<le> dist (d tx) x
[PROOF STEP]
by (rule infdist_le)
[PROOF STATE]
proof (state)
this:
infdist (d tx) {c A--c B} \<le> dist (d tx) x

goal (1 subgoal):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist (d tx) {c A--c B} \<le> dist (d tx) x

goal (1 subgoal):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
have "... \<le> D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (d tx) x \<le> D0
[PROOF STEP]
using \<open>x \<in> cball (d tx) D0\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> cball (d tx) D0

goal (1 subgoal):
 1. dist (d tx) x \<le> D0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (d tx) x \<le> D0

goal (1 subgoal):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
infdist (d tx) {c A--c B} \<le> D0
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
infdist (d tx) {c A--c B} \<le> D0

goal (1 subgoal):
 1. False
[PROOF STEP]
using lower_tm_tM[OF 2]
[PROOF STATE]
proof (prove)
using this:
infdist (d tx) {c A--c B} \<le> D0
D0 < infdist (d tx) {c A--c B}

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

goal (1 subgoal):
 1. tx \<in> {tm<..<tM} \<Longrightarrow> x \<in> Km \<union> KM
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. x \<in> Km \<union> KM
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> Km \<union> KM

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> Km \<union> KM

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{c A--c B} \<subseteq> Km \<union> KM

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{c A--c B} \<subseteq> Km \<union> KM
[PROOF STEP]
have *: "{c A--c B} = (Km \<inter> {c A--c B}) \<union> (KM \<inter> {c A--c B})"
[PROOF STATE]
proof (prove)
using this:
{c A--c B} \<subseteq> Km \<union> KM

goal (1 subgoal):
 1. {c A--c B} = Km \<inter> {c A--c B} \<union> KM \<inter> {c A--c B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{c A--c B} = Km \<inter> {c A--c B} \<union> KM \<inter> {c A--c B}

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "(Km \<inter> {c A--c B}) \<inter> (KM \<inter> {c A--c B}) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Km \<inter> {c A--c B} \<inter> (KM \<inter> {c A--c B}) \<noteq> {}
[PROOF STEP]
proof (rule connected_as_closed_union[OF _ *])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. connected {c A--c B}
 2. closed (Km \<inter> {c A--c B})
 3. closed (KM \<inter> {c A--c B})
 4. Km \<inter> {c A--c B} \<noteq> {}
 5. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
have "closed Km"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed Km
[PROOF STEP]
unfolding Km_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (\<Union>z\<in>d ` {A..tm}. cball z D0)
[PROOF STEP]
apply (rule compact_has_closed_thickening)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. compact (d ` {A..tm})
 2. continuous_on (d ` {A..tm}) (\<lambda>x. D0)
[PROOF STEP]
apply (rule compact_continuous_image)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on {A..tm} d
 2. compact {A..tm}
 3. continuous_on (d ` {A..tm}) (\<lambda>x. D0)
[PROOF STEP]
apply (rule continuous_on_subset[OF \<open>continuous_on {A..B} d\<close>])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. {A..tm} \<subseteq> {A..B}
 2. compact {A..tm}
 3. continuous_on (d ` {A..tm}) (\<lambda>x. D0)
[PROOF STEP]
using tm \<open>ty \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
ty \<in> {A..B}

goal (3 subgoals):
 1. {A..tm} \<subseteq> {A..B}
 2. compact {A..tm}
 3. continuous_on (d ` {A..tm}) (\<lambda>x. D0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closed Km

goal (5 subgoals):
 1. connected {c A--c B}
 2. closed (Km \<inter> {c A--c B})
 3. closed (KM \<inter> {c A--c B})
 4. Km \<inter> {c A--c B} \<noteq> {}
 5. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed Km
[PROOF STEP]
show "closed (Km \<inter> {c A--c B})"
[PROOF STATE]
proof (prove)
using this:
closed Km

goal (1 subgoal):
 1. closed (Km \<inter> {c A--c B})
[PROOF STEP]
by (rule topological_space_class.closed_Int, auto)
[PROOF STATE]
proof (state)
this:
closed (Km \<inter> {c A--c B})

goal (4 subgoals):
 1. connected {c A--c B}
 2. closed (KM \<inter> {c A--c B})
 3. Km \<inter> {c A--c B} \<noteq> {}
 4. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
have "closed KM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed KM
[PROOF STEP]
unfolding KM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (\<Union>z\<in>d ` {tM..B}. cball z D0)
[PROOF STEP]
apply (rule compact_has_closed_thickening)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. compact (d ` {tM..B})
 2. continuous_on (d ` {tM..B}) (\<lambda>x. D0)
[PROOF STEP]
apply (rule compact_continuous_image)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on {tM..B} d
 2. compact {tM..B}
 3. continuous_on (d ` {tM..B}) (\<lambda>x. D0)
[PROOF STEP]
apply (rule continuous_on_subset[OF \<open>continuous_on {A..B} d\<close>])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. {tM..B} \<subseteq> {A..B}
 2. compact {tM..B}
 3. continuous_on (d ` {tM..B}) (\<lambda>x. D0)
[PROOF STEP]
using tM \<open>ty \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
ty \<in> {A..B}

goal (3 subgoals):
 1. {tM..B} \<subseteq> {A..B}
 2. compact {tM..B}
 3. continuous_on (d ` {tM..B}) (\<lambda>x. D0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closed KM

goal (4 subgoals):
 1. connected {c A--c B}
 2. closed (KM \<inter> {c A--c B})
 3. Km \<inter> {c A--c B} \<noteq> {}
 4. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed KM
[PROOF STEP]
show "closed (KM \<inter> {c A--c B})"
[PROOF STATE]
proof (prove)
using this:
closed KM

goal (1 subgoal):
 1. closed (KM \<inter> {c A--c B})
[PROOF STEP]
by (rule topological_space_class.closed_Int, auto)
[PROOF STATE]
proof (state)
this:
closed (KM \<inter> {c A--c B})

goal (3 subgoals):
 1. connected {c A--c B}
 2. Km \<inter> {c A--c B} \<noteq> {}
 3. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
show "connected {c A--c B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected {c A--c B}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
connected {c A--c B}

goal (2 subgoals):
 1. Km \<inter> {c A--c B} \<noteq> {}
 2. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
have "c A \<in> Km \<inter> {c A--c B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c A \<in> Km \<inter> {c A--c B}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c A \<in> Km
[PROOF STEP]
unfolding Km_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c A \<in> (\<Union>z\<in>d ` {A..tm}. cball z D0)
[PROOF STEP]
using tm \<open>d A = c A\<close> \<open>D0 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
d A = c A
0 < D0

goal (1 subgoal):
 1. c A \<in> (\<Union>z\<in>d ` {A..tm}. cball z D0)
[PROOF STEP]
by (auto) (rule bexI[of _ A], auto)
[PROOF STATE]
proof (state)
this:
c A \<in> Km \<inter> {c A--c B}

goal (2 subgoals):
 1. Km \<inter> {c A--c B} \<noteq> {}
 2. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c A \<in> Km \<inter> {c A--c B}
[PROOF STEP]
show "Km \<inter> {c A--c B} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
c A \<in> Km \<inter> {c A--c B}

goal (1 subgoal):
 1. Km \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Km \<inter> {c A--c B} \<noteq> {}

goal (1 subgoal):
 1. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
have "c B \<in> KM \<inter> {c A--c B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c B \<in> KM \<inter> {c A--c B}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c B \<in> KM
[PROOF STEP]
unfolding KM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c B \<in> (\<Union>z\<in>d ` {tM..B}. cball z D0)
[PROOF STEP]
using tM \<open>d B = c B\<close> \<open>D0 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
d B = c B
0 < D0

goal (1 subgoal):
 1. c B \<in> (\<Union>z\<in>d ` {tM..B}. cball z D0)
[PROOF STEP]
by (auto) (rule bexI[of _ B], auto)
[PROOF STATE]
proof (state)
this:
c B \<in> KM \<inter> {c A--c B}

goal (1 subgoal):
 1. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c B \<in> KM \<inter> {c A--c B}
[PROOF STEP]
show "KM \<inter> {c A--c B} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
c B \<in> KM \<inter> {c A--c B}

goal (1 subgoal):
 1. KM \<inter> {c A--c B} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
KM \<inter> {c A--c B} \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Km \<inter> {c A--c B} \<inter> (KM \<inter> {c A--c B}) \<noteq> {}

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Km \<inter> {c A--c B} \<inter> (KM \<inter> {c A--c B}) \<noteq> {}
[PROOF STEP]
obtain w where "w \<in> {c A--c B}" "w \<in> Km" "w \<in> KM"
[PROOF STATE]
proof (prove)
using this:
Km \<inter> {c A--c B} \<inter> (KM \<inter> {c A--c B}) \<noteq> {}

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> {c A--c B}; w \<in> Km; w \<in> KM\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> {c A--c B}
w \<in> Km
w \<in> KM

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> {c A--c B}
w \<in> Km
w \<in> KM
[PROOF STEP]
obtain twm twM where tw: "twm \<in> {A..tm}" "w \<in> cball (d twm) D0" "twM \<in> {tM..B}" "w \<in> cball (d twM) D0"
[PROOF STATE]
proof (prove)
using this:
w \<in> {c A--c B}
w \<in> Km
w \<in> KM

goal (1 subgoal):
 1. (\<And>twm twM. \<lbrakk>twm \<in> {A..tm}; w \<in> cball (d twm) D0; twM \<in> {tM..B}; w \<in> cball (d twM) D0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Km_def KM_def
[PROOF STATE]
proof (prove)
using this:
w \<in> {c A--c B}
w \<in> (\<Union>z\<in>d ` {A..tm}. cball z D0)
w \<in> (\<Union>z\<in>d ` {tM..B}. cball z D0)

goal (1 subgoal):
 1. (\<And>twm twM. \<lbrakk>twm \<in> {A..tm}; w \<in> cball (d twm) D0; twM \<in> {tM..B}; w \<in> cball (d twM) D0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
twm \<in> {A..tm}
w \<in> cball (d twm) D0
twM \<in> {tM..B}
w \<in> cball (d twM) D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "(1/lambda) * dist twm twM - (4*C) \<le> dist (d twm) (d twM)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / lambda * dist twm twM - 4 * C \<le> dist (d twm) (d twM)
[PROOF STEP]
apply (rule quasi_isometry_onD(2)[OF d(5)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. twm \<in> {A..B}
 2. twM \<in> {A..B}
[PROOF STEP]
using tw tm tM
[PROOF STATE]
proof (prove)
using this:
twm \<in> {A..tm}
w \<in> cball (d twm) D0
twM \<in> {tM..B}
w \<in> cball (d twM) D0
tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (2 subgoals):
 1. twm \<in> {A..B}
 2. twM \<in> {A..B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / lambda * dist twm twM - 4 * C \<le> dist (d twm) (d twM)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / lambda * dist twm twM - 4 * C \<le> dist (d twm) (d twM)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... \<le> dist (d twm) w + dist w (d twM)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (d twm) (d twM) \<le> dist (d twm) w + dist w (d twM)
[PROOF STEP]
by (rule metric_space_class.dist_triangle)
[PROOF STATE]
proof (state)
this:
dist (d twm) (d twM) \<le> dist (d twm) w + dist w (d twM)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (d twm) (d twM) \<le> dist (d twm) w + dist w (d twM)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... \<le> 2 * D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (d twm) w + dist w (d twM) \<le> 2 * D0
[PROOF STEP]
using tw
[PROOF STATE]
proof (prove)
using this:
twm \<in> {A..tm}
w \<in> cball (d twm) D0
twM \<in> {tM..B}
w \<in> cball (d twM) D0

goal (1 subgoal):
 1. dist (d twm) w + dist w (d twM) \<le> 2 * D0
[PROOF STEP]
by (auto simp add: metric_space_class.dist_commute)
[PROOF STATE]
proof (state)
this:
dist (d twm) w + dist w (d twM) \<le> 2 * D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 / lambda * dist twm twM - 4 * C \<le> 2 * D0
[PROOF STEP]
have "dist twm twM \<le> lambda * (4*C + 2*D0)"
[PROOF STATE]
proof (prove)
using this:
1 / lambda * dist twm twM - 4 * C \<le> 2 * D0

goal (1 subgoal):
 1. dist twm twM \<le> lambda * (4 * C + 2 * D0)
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
1 / lambda * dist twm twM - 4 * C \<le> 2 * D0
0 \<le> C
1 \<le> lambda

goal (1 subgoal):
 1. dist twm twM \<le> lambda * (4 * C + 2 * D0)
[PROOF STEP]
by (auto simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
dist twm twM \<le> lambda * (4 * C + 2 * D0)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist twm twM \<le> lambda * (4 * C + 2 * D0)
[PROOF STEP]
have *: "dist twm ty \<le> lambda * (4*C + 2*D0)"
[PROOF STATE]
proof (prove)
using this:
dist twm twM \<le> lambda * (4 * C + 2 * D0)

goal (1 subgoal):
 1. dist twm ty \<le> lambda * (4 * C + 2 * D0)
[PROOF STEP]
using tw tm tM dist_real_def
[PROOF STATE]
proof (prove)
using this:
dist twm twM \<le> lambda * (4 * C + 2 * D0)
twm \<in> {A..tm}
w \<in> cball (d twm) D0
twM \<in> {tM..B}
w \<in> cball (d twM) D0
tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}
dist ?x ?y = \<bar>?x - ?y\<bar>

goal (1 subgoal):
 1. dist twm ty \<le> lambda * (4 * C + 2 * D0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist twm ty \<le> lambda * (4 * C + 2 * D0)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "dist (d ty) w \<le> dist (d ty) (d twm) + dist (d twm) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (d ty) w \<le> dist (d ty) (d twm) + dist (d twm) w
[PROOF STEP]
by (rule metric_space_class.dist_triangle)
[PROOF STATE]
proof (state)
this:
dist (d ty) w \<le> dist (d ty) (d twm) + dist (d twm) w

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (d ty) w \<le> dist (d ty) (d twm) + dist (d twm) w

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... \<le> (lambda * dist ty twm + (4*C)) + D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (d ty) (d twm) + dist (d twm) w \<le> lambda * dist ty twm + 4 * C + D0
[PROOF STEP]
apply (intro add_mono, rule quasi_isometry_onD(1)[OF d(5)])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ty \<in> {A..B}
 2. twm \<in> {A..B}
 3. dist (d twm) w \<le> D0
[PROOF STEP]
using tw tm tM
[PROOF STATE]
proof (prove)
using this:
twm \<in> {A..tm}
w \<in> cball (d twm) D0
twM \<in> {tM..B}
w \<in> cball (d twM) D0
tm \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {A..ty}
tM \<in> (\<lambda>t. infdist (d t) {c A--c B}) -` {..D0} \<inter> {ty..B}

goal (3 subgoals):
 1. ty \<in> {A..B}
 2. twm \<in> {A..B}
 3. dist (d twm) w \<le> D0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (d ty) (d twm) + dist (d twm) w \<le> lambda * dist ty twm + 4 * C + D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (d ty) (d twm) + dist (d twm) w \<le> lambda * dist ty twm + 4 * C + D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... \<le> (lambda * (lambda * (4*C + 2*D0))) + (4*C) + D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * dist ty twm + 4 * C + D0 \<le> lambda * (lambda * (4 * C + 2 * D0)) + 4 * C + D0
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dist ty twm \<le> lambda * (4 * C + 2 * D0)
 2. 0 \<le> lambda
[PROOF STEP]
using C *
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
dist twm ty \<le> lambda * (4 * C + 2 * D0)

goal (2 subgoals):
 1. dist ty twm \<le> lambda * (4 * C + 2 * D0)
 2. 0 \<le> lambda
[PROOF STEP]
by (auto simp add: metric_space_class.dist_commute)
[PROOF STATE]
proof (state)
this:
lambda * dist ty twm + 4 * C + D0 \<le> lambda * (lambda * (4 * C + 2 * D0)) + 4 * C + D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lambda * dist ty twm + 4 * C + D0 \<le> lambda * (lambda * (4 * C + 2 * D0)) + 4 * C + D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... = lambda * lambda * (4*C + 2*D0) + 1 * 1 * (4 * C) + 1 * 1 * D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * (lambda * (4 * C + 2 * D0)) + 4 * C + D0 = lambda * lambda * (4 * C + 2 * D0) + 1 * 1 * (4 * C) + 1 * 1 * D0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lambda * (lambda * (4 * C + 2 * D0)) + 4 * C + D0 = lambda * lambda * (4 * C + 2 * D0) + 1 * 1 * (4 * C) + 1 * 1 * D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lambda * (lambda * (4 * C + 2 * D0)) + 4 * C + D0 = lambda * lambda * (4 * C + 2 * D0) + 1 * 1 * (4 * C) + 1 * 1 * D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... \<le> lambda * lambda * (4*C + 2*D0) + lambda * lambda * (4 * C) + lambda * lambda * D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * lambda * (4 * C + 2 * D0) + 1 * 1 * (4 * C) + 1 * 1 * D0 \<le> lambda * lambda * (4 * C + 2 * D0) + lambda * lambda * (4 * C) + lambda * lambda * D0
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 0 \<le> 4 * C
 6. 1 \<le> lambda
 7. 1 \<le> lambda
 8. 0 \<le> lambda
 9. 0 \<le> 1
 10. 0 \<le> D0
[PROOF STEP]
using C * \<open>D0 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
dist twm ty \<le> lambda * (4 * C + 2 * D0)
0 < D0

goal (10 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 0 \<le> 4 * C
 6. 1 \<le> lambda
 7. 1 \<le> lambda
 8. 0 \<le> lambda
 9. 0 \<le> 1
 10. 0 \<le> D0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * lambda * (4 * C + 2 * D0) + 1 * 1 * (4 * C) + 1 * 1 * D0 \<le> lambda * lambda * (4 * C + 2 * D0) + lambda * lambda * (4 * C) + lambda * lambda * D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lambda * lambda * (4 * C + 2 * D0) + 1 * 1 * (4 * C) + 1 * 1 * D0 \<le> lambda * lambda * (4 * C + 2 * D0) + lambda * lambda * (4 * C) + lambda * lambda * D0

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... = lambda * lambda * (8 * C + 3 * D0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * lambda * (4 * C + 2 * D0) + lambda * lambda * (4 * C) + lambda * lambda * D0 = lambda * lambda * (8 * C + 3 * D0)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
lambda * lambda * (4 * C + 2 * D0) + lambda * lambda * (4 * C) + lambda * lambda * D0 = lambda * lambda * (8 * C + 3 * D0)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lambda * lambda * (4 * C + 2 * D0) + lambda * lambda * (4 * C) + lambda * lambda * D0 = lambda * lambda * (8 * C + 3 * D0)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
have "... = lambda * lambda * (44 * C + 72 * lambda + 72 * deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * lambda * (8 * C + 3 * D0) = lambda * lambda * (44 * C + 72 * lambda + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
unfolding D0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * lambda * (8 * C + 3 * (24 * lambda + 12 * C + 24 * (deltaG TYPE('a))\<^sup>2)) = lambda * lambda * (44 * C + 72 * lambda + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * lambda * (8 * C + 3 * D0) = lambda * lambda * (44 * C + 72 * lambda + 72 * (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (d ty) w \<le> lambda * lambda * (44 * C + 72 * lambda + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "dist y w \<le> D1"
[PROOF STATE]
proof (prove)
using this:
dist (d ty) w \<le> lambda * lambda * (44 * C + 72 * lambda + 72 * (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. dist y w \<le> D1
[PROOF STEP]
unfolding D1_def \<open>y = d ty\<close>
[PROOF STATE]
proof (prove)
using this:
dist (d ty) w \<le> lambda * lambda * (44 * C + 72 * lambda + 72 * (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. dist (d ty) w \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
dist y w \<le> D1

goal (1 subgoal):
 1. \<not> infdist y {c A--c B} \<le> D0 \<Longrightarrow> infdist y {c A--c B} \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist y w \<le> D1
[PROOF STEP]
show "infdist y {c A--c B} \<le> D1"
[PROOF STATE]
proof (prove)
using this:
dist y w \<le> D1

goal (1 subgoal):
 1. infdist y {c A--c B} \<le> D1
[PROOF STEP]
using infdist_le[OF \<open>w \<in> {c A--c B}\<close>, of y]
[PROOF STATE]
proof (prove)
using this:
dist y w \<le> D1
infdist y {c A--c B} \<le> dist y w

goal (1 subgoal):
 1. infdist y {c A--c B} \<le> D1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist y {c A--c B} \<le> D1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y \<in> d ` {A..B} \<Longrightarrow> infdist ?y {c A--c B} \<le> D1

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
text \<open>This concludes the second step.\<close>
[PROOF STATE]
proof (state)
this:
?y \<in> d ` {A..B} \<Longrightarrow> infdist ?y {c A--c B} \<le> D1

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
text \<open>Putting the two steps together, we deduce that the Hausdorff distance between the
    geodesic and the quasi-geodesic is bounded by $D1$. A bound between the geodesic and
    the original (untamed) quasi-geodesic follows.\<close>
[PROOF STATE]
proof (state)
this:
?y \<in> d ` {A..B} \<Longrightarrow> infdist ?y {c A--c B} \<le> D1

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have a: "hausdorff_distance (d`{A..B}) {c A--c B} \<le> D1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (d ` {A..B}) {c A--c B} \<le> D1
[PROOF STEP]
proof (rule hausdorff_distanceI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> d ` {A..B} \<Longrightarrow> infdist x {c A--c B} \<le> D1
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
 3. 0 \<le> D1
[PROOF STEP]
show "D1 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> D1
[PROOF STEP]
unfolding D1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
using C delta_nonneg
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
0 \<le> deltaG TYPE('a)

goal (1 subgoal):
 1. 0 \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> D1

goal (2 subgoals):
 1. \<And>x. x \<in> d ` {A..B} \<Longrightarrow> infdist x {c A--c B} \<le> D1
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> d ` {A..B} \<Longrightarrow> infdist x {c A--c B} \<le> D1
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
assume "x \<in> d ` {A..B}"
[PROOF STATE]
proof (state)
this:
x \<in> d ` {A..B}

goal (2 subgoals):
 1. \<And>x. x \<in> d ` {A..B} \<Longrightarrow> infdist x {c A--c B} \<le> D1
 2. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> d ` {A..B}
[PROOF STEP]
show "infdist x {c A--c B} \<le> D1"
[PROOF STATE]
proof (prove)
using this:
x \<in> d ` {A..B}

goal (1 subgoal):
 1. infdist x {c A--c B} \<le> D1
[PROOF STEP]
using second_step
[PROOF STATE]
proof (prove)
using this:
x \<in> d ` {A..B}
?y \<in> d ` {A..B} \<Longrightarrow> infdist ?y {c A--c B} \<le> D1

goal (1 subgoal):
 1. infdist x {c A--c B} \<le> D1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist x {c A--c B} \<le> D1

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
assume "x \<in> {c A--c B}"
[PROOF STATE]
proof (state)
this:
x \<in> {c A--c B}

goal (1 subgoal):
 1. \<And>x. x \<in> {c A--c B} \<Longrightarrow> infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {c A--c B}
[PROOF STEP]
show "infdist x (d`{A..B}) \<le> D1"
[PROOF STATE]
proof (prove)
using this:
x \<in> {c A--c B}

goal (1 subgoal):
 1. infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
using first_step \<open>D0 \<le> D1\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> {c A--c B}
?y \<in> {c A--c B} \<Longrightarrow> infdist ?y (d ` {A..B}) \<le> D0
D0 \<le> D1

goal (1 subgoal):
 1. infdist x (d ` {A..B}) \<le> D1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
infdist x (d ` {A..B}) \<le> D1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
hausdorff_distance (d ` {A..B}) {c A--c B} \<le> D1

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "hausdorff_distance (c`{A..B}) {c A--c B} \<le>
        hausdorff_distance (c`{A..B}) (d`{A..B}) + hausdorff_distance (d`{A..B}) {c A--c B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> hausdorff_distance (c ` {A..B}) (d ` {A..B}) + hausdorff_distance (d ` {A..B}) {c A--c B}
[PROOF STEP]
apply (rule hausdorff_distance_triangle)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d ` {A..B} \<noteq> {}
 2. bounded (d ` {A..B})
[PROOF STEP]
using \<open>A \<in> {A..B}\<close>
[PROOF STATE]
proof (prove)
using this:
A \<in> {A..B}

goal (2 subgoals):
 1. d ` {A..B} \<noteq> {}
 2. bounded (d ` {A..B})
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (d ` {A..B})
[PROOF STEP]
by (rule quasi_isometry_on_bounded[OF d(5)], auto)
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> hausdorff_distance (c ` {A..B}) (d ` {A..B}) + hausdorff_distance (d ` {A..B}) {c A--c B}

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> hausdorff_distance (c ` {A..B}) (d ` {A..B}) + hausdorff_distance (d ` {A..B}) {c A--c B}

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> D1 + 2*C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) + hausdorff_distance (d ` {A..B}) {c A--c B} \<le> D1 + 2 * C
[PROOF STEP]
using a d
[PROOF STATE]
proof (prove)
using this:
hausdorff_distance (d ` {A..B}) {c A--c B} \<le> D1
continuous_on {A..B} d
d A = c A
d B = c B
?x \<in> {A..B} \<Longrightarrow> dist (c ?x) (d ?x) \<le> 4 * C
lambda (4 * C) -quasi_isometry_on {A..B} d
(2 * lambda)-lipschitz_on {A..B} d
hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 2 * C

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) + hausdorff_distance (d ` {A..B}) {c A--c B} \<le> D1 + 2 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) + hausdorff_distance (d ` {A..B}) {c A--c B} \<le> D1 + 2 * C

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) + hausdorff_distance (d ` {A..B}) {c A--c B} \<le> D1 + 2 * C

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... = lambda * lambda * (72 * lambda + 44 * C + 72 * deltaG(TYPE('a))^2) + 1 * 1 * (2 * C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D1 + 2 * C = lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 1 * 1 * (2 * C)
[PROOF STEP]
unfolding D1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 2 * C = lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 1 * 1 * (2 * C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D1 + 2 * C = lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 1 * 1 * (2 * C)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
D1 + 2 * C = lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 1 * 1 * (2 * C)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * deltaG(TYPE('a))^2)
                      + lambda * lambda * (28 * C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 1 * 1 * (2 * C) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + lambda * lambda * (28 * C)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 2 \<le> 28
 6. 0 \<le> C
 7. 0 \<le> lambda * lambda
 8. 0 \<le> 2 * C
[PROOF STEP]
using C delta_nonneg
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
1 \<le> lambda
0 \<le> deltaG TYPE('a)

goal (8 subgoals):
 1. 1 \<le> lambda
 2. 1 \<le> lambda
 3. 0 \<le> lambda
 4. 0 \<le> 1
 5. 2 \<le> 28
 6. 0 \<le> C
 7. 0 \<le> lambda * lambda
 8. 0 \<le> 2 * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 1 * 1 * (2 * C) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + lambda * lambda * (28 * C)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + 1 * 1 * (2 * C) \<le> lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + lambda * lambda * (28 * C)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
have "... = 72 * lambda^2 * (lambda + C + deltaG(TYPE('a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + lambda * lambda * (28 * C) = 72 * lambda\<^sup>2 * (lambda + C + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by (auto simp add: algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
lambda * lambda * (72 * lambda + 44 * C + 72 * (deltaG TYPE('a))\<^sup>2) + lambda * lambda * (28 * C) = 72 * lambda\<^sup>2 * (lambda + C + (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. 0 \<le> B - A \<and> 2 * C < dist (c A) (c B) \<Longrightarrow> hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (lambda + C + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (lambda + C + (deltaG TYPE('a))\<^sup>2)

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 72 * lambda\<^sup>2 * (C + lambda + (deltaG TYPE('a))\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed