[STATEMENT]
theorem Borsuk_homotopy_extension_homotopic:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes cloTS: "closedin (top_of_set T) S"
      and anr: "(ANR S \<and> ANR T) \<or> ANR U"
      and contf: "continuous_on T f"
      and "f ` T \<subseteq> U"
      and "homotopic_with_canon (\<lambda>x. True) S U f g"
   obtains g' where "homotopic_with_canon (\<lambda>x. True) T U f g'"
                    "continuous_on T g'" "image g' T \<subseteq> U"
                    "\<And>x. x \<in> S \<Longrightarrow> g' x = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "S \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> T
[PROOF STEP]
using assms closedin_imp_subset
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set T) S
ANR S \<and> ANR T \<or> ANR U
continuous_on T f
f ` T \<subseteq> U
homotopic_with_canon (\<lambda>x. True) S U f g
closedin (subtopology ?U ?S) ?T \<Longrightarrow> ?T \<subseteq> ?S

goal (1 subgoal):
 1. S \<subseteq> T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S \<subseteq> T

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain h where conth: "continuous_on ({0..1} \<times> S) h"
             and him: "h ` ({0..1} \<times> S) \<subseteq> U"
             and [simp]: "\<And>x. h(0, x) = f x" "\<And>x. h(1::real, x) = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>continuous_on ({0..1} \<times> S) h; h ` ({0..1} \<times> S) \<subseteq> U; \<And>x. h (0, x) = f x; \<And>x. h (1, x) = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set T) S
ANR S \<and> ANR T \<or> ANR U
continuous_on T f
f ` T \<subseteq> U
homotopic_with_canon (\<lambda>x. True) S U f g

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>continuous_on ({0..1} \<times> S) h; h ` ({0..1} \<times> S) \<subseteq> U; \<And>x. h (0, x) = f x; \<And>x. h (1, x) = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: homotopic_with_def)
[PROOF STATE]
proof (state)
this:
continuous_on ({0..1} \<times> S) h
h ` ({0..1} \<times> S) \<subseteq> U
h (0, ?x) = f ?x
h (1, ?x) = g ?x

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define h' where "h' \<equiv>  \<lambda>z. if snd z \<in> S then h z else (f \<circ> snd) z"
[PROOF STATE]
proof (state)
this:
h' \<equiv> \<lambda>z. if snd z \<in> S then h z else (f \<circ> snd) z

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define B where "B \<equiv> {0::real} \<times> T \<union> {0..1} \<times> S"
[PROOF STATE]
proof (state)
this:
B \<equiv> {0} \<times> T \<union> {0..1} \<times> S

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have clo0T: "closedin (top_of_set ({0..1} \<times> T)) ({0::real} \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set ({0..1} \<times> T)) ({0} \<times> T)
[PROOF STEP]
by (simp add: Abstract_Topology.closedin_Times)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set ({0..1} \<times> T)) ({0} \<times> T)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
closedin (top_of_set ({0..1} \<times> T)) ({0} \<times> T)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have cloT1S: "closedin (top_of_set ({0..1} \<times> T)) ({0..1} \<times> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set ({0::'c..1::'c} \<times> T)) ({0::'c..1::'c} \<times> S)
[PROOF STEP]
by (simp add: Abstract_Topology.closedin_Times assms)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set ({0::?'c1..1::?'c1} \<times> T)) ({0::?'c1..1::?'c1} \<times> S)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
closedin (top_of_set ({0..1} \<times> T)) ({0} \<times> T)
closedin (top_of_set ({0::?'c1..1::?'c1} \<times> T)) ({0::?'c1..1::?'c1} \<times> S)
[PROOF STEP]
have clo0TB:"closedin (top_of_set ({0..1} \<times> T)) B"
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set ({0..1} \<times> T)) ({0} \<times> T)
closedin (top_of_set ({0::?'c1..1::?'c1} \<times> T)) ({0::?'c1..1::?'c1} \<times> S)

goal (1 subgoal):
 1. closedin (top_of_set ({0..1} \<times> T)) B
[PROOF STEP]
by (auto simp: B_def)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set ({0..1} \<times> T)) B

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have cloBS: "closedin (top_of_set B) ({0..1} \<times> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set B) ({0..1} \<times> S)
[PROOF STEP]
by (metis (no_types) Un_subset_iff B_def closedin_subset_trans [OF cloT1S] clo0TB closedin_imp_subset closedin_self)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set B) ({0..1} \<times> S)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
closedin (top_of_set B) ({0..1} \<times> S)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have cloBT: "closedin (top_of_set B) ({0} \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set B) ({0} \<times> T)
[PROOF STEP]
using \<open>S \<subseteq> T\<close> closedin_subset_trans [OF clo0T]
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> T
\<lbrakk>{0} \<times> T \<subseteq> ?T; ?T \<subseteq> {0..1} \<times> T\<rbrakk> \<Longrightarrow> closedin (top_of_set ?T) ({0} \<times> T)

goal (1 subgoal):
 1. closedin (top_of_set B) ({0} \<times> T)
[PROOF STEP]
by (metis B_def Un_upper1 clo0TB closedin_closed inf_le1)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set B) ({0} \<times> T)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
closedin (top_of_set B) ({0} \<times> T)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "continuous_on ({0} \<times> T) (f \<circ> snd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ({0::'c} \<times> T) (f \<circ> snd)
[PROOF STEP]
proof (rule continuous_intros)+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on (snd ` ({0::'c} \<times> T)) f
[PROOF STEP]
show "continuous_on (snd ` ({0} \<times> T)) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (snd ` ({0::'d} \<times> T)) f
[PROOF STEP]
by (simp add: contf)
[PROOF STATE]
proof (state)
this:
continuous_on (snd ` ({0::?'d2} \<times> T)) f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on ({0::?'c2} \<times> T) (f \<circ> snd)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
closedin (top_of_set B) ({0..1} \<times> S)
closedin (top_of_set B) ({0} \<times> T)
continuous_on ({0::?'c2} \<times> T) (f \<circ> snd)
[PROOF STEP]
have "continuous_on ({0..1} \<times> S \<union> {0} \<times> T) (\<lambda>x. if snd x \<in> S then h x else (f \<circ> snd) x)"
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set B) ({0..1} \<times> S)
closedin (top_of_set B) ({0} \<times> T)
continuous_on ({0::?'c2} \<times> T) (f \<circ> snd)

goal (1 subgoal):
 1. continuous_on ({0..1} \<times> S \<union> {0} \<times> T) (\<lambda>x. if snd x \<in> S then h x else (f \<circ> snd) x)
[PROOF STEP]
by (auto intro!: continuous_on_cases_local conth simp: B_def Un_commute [of "{0} \<times> T"])
[PROOF STATE]
proof (state)
this:
continuous_on ({0..1} \<times> S \<union> {0} \<times> T) (\<lambda>x. if snd x \<in> S then h x else (f \<circ> snd) x)

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on ({0..1} \<times> S \<union> {0} \<times> T) (\<lambda>x. if snd x \<in> S then h x else (f \<circ> snd) x)
[PROOF STEP]
have conth': "continuous_on B h'"
[PROOF STATE]
proof (prove)
using this:
continuous_on ({0..1} \<times> S \<union> {0} \<times> T) (\<lambda>x. if snd x \<in> S then h x else (f \<circ> snd) x)

goal (1 subgoal):
 1. continuous_on B h'
[PROOF STEP]
by (simp add: h'_def B_def Un_commute [of "{0} \<times> T"])
[PROOF STATE]
proof (state)
this:
continuous_on B h'

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "image h' B \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h' ` B \<subseteq> U
[PROOF STEP]
using \<open>f ` T \<subseteq> U\<close> him
[PROOF STATE]
proof (prove)
using this:
f ` T \<subseteq> U
h ` ({0..1} \<times> S) \<subseteq> U

goal (1 subgoal):
 1. h' ` B \<subseteq> U
[PROOF STEP]
by (auto simp: h'_def B_def)
[PROOF STATE]
proof (state)
this:
h' ` B \<subseteq> U

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain V k where "B \<subseteq> V" and opeTV: "openin (top_of_set ({0..1} \<times> T)) V"
               and contk: "continuous_on V k" and kim: "k ` V \<subseteq> U"
               and keq: "\<And>x. x \<in> B \<Longrightarrow> k x = h' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using anr
[PROOF STATE]
proof (prove)
using this:
ANR S \<and> ANR T \<or> ANR U

goal (1 subgoal):
 1. (\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR S \<and> ANR T\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
assume ST: "ANR S \<and> ANR T"
[PROOF STATE]
proof (state)
this:
ANR S \<and> ANR T

goal (2 subgoals):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR S \<and> ANR T\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have eq: "({0} \<times> T \<inter> {0..1} \<times> S) = {0::real} \<times> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0} \<times> T \<inter> {0..1} \<times> S = {0} \<times> S
[PROOF STEP]
using \<open>S \<subseteq> T\<close>
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> T

goal (1 subgoal):
 1. {0} \<times> T \<inter> {0..1} \<times> S = {0} \<times> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0} \<times> T \<inter> {0..1} \<times> S = {0} \<times> S

goal (2 subgoals):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR S \<and> ANR T\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "ANR B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ANR B
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ANR ({0} \<times> T \<union> {0..1} \<times> S)
[PROOF STEP]
proof (rule ANR_closed_Un_local)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0} \<times> T)
 2. closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0..1} \<times> S)
 3. ANR ({0} \<times> T)
 4. ANR ({0..1} \<times> S)
 5. ANR ({0} \<times> T \<inter> {0..1} \<times> S)
[PROOF STEP]
show "closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0::real} \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0} \<times> T)
[PROOF STEP]
by (metis cloBT B_def)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0} \<times> T)

goal (4 subgoals):
 1. closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0..1} \<times> S)
 2. ANR ({0} \<times> T)
 3. ANR ({0..1} \<times> S)
 4. ANR ({0} \<times> T \<inter> {0..1} \<times> S)
[PROOF STEP]
show "closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0..1::real} \<times> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0..1} \<times> S)
[PROOF STEP]
by (metis Un_commute cloBS B_def)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set ({0} \<times> T \<union> {0..1} \<times> S)) ({0..1} \<times> S)

goal (3 subgoals):
 1. ANR ({0} \<times> T)
 2. ANR ({0..1} \<times> S)
 3. ANR ({0} \<times> T \<inter> {0..1} \<times> S)
[PROOF STEP]
qed (simp_all add: ANR_Times convex_imp_ANR ANR_singleton ST eq)
[PROOF STATE]
proof (state)
this:
ANR B

goal (2 subgoals):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR S \<and> ANR T\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
note Vk = that
[PROOF STATE]
proof (state)
this:
\<lbrakk>B \<subseteq> ?V2; openin (top_of_set ({0..1} \<times> T)) ?V2; continuous_on ?V2 ?k2; ?k2 ` ?V2 \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> ?k2 x = h' x\<rbrakk> \<Longrightarrow> thesis

goal (2 subgoals):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR S \<and> ANR T\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have *: thesis if "openin (top_of_set ({0..1::real} \<times> T)) V"
                      "retraction V B r" for V r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
have "continuous_on V (h' \<circ> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on V (h' \<circ> r)
[PROOF STEP]
using conth' continuous_on_compose retractionE that(2)
[PROOF STATE]
proof (prove)
using this:
continuous_on B h'
\<lbrakk>continuous_on ?s ?f; continuous_on (?f ` ?s) ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (?g \<circ> ?f)
\<lbrakk>retraction ?S ?T ?r; \<lbrakk>?T = ?r ` ?S; ?r ` ?S \<subseteq> ?S; continuous_on ?S ?r; \<And>x. x \<in> ?S \<Longrightarrow> ?r (?r x) = ?r x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
retraction V B r

goal (1 subgoal):
 1. continuous_on V (h' \<circ> r)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on V (h' \<circ> r)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on V (h' \<circ> r)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
have "(h' \<circ> r) ` V \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h' \<circ> r) ` V \<subseteq> U
[PROOF STEP]
by (metis \<open>h' ` B \<subseteq> U\<close> image_comp retractionE that(2))
[PROOF STATE]
proof (state)
this:
(h' \<circ> r) ` V \<subseteq> U

goal (1 subgoal):
 1. thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on V (h' \<circ> r)
(h' \<circ> r) ` V \<subseteq> U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on V (h' \<circ> r)
(h' \<circ> r) ` V \<subseteq> U

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using Vk [of V "h' \<circ> r"]
[PROOF STATE]
proof (prove)
using this:
continuous_on V (h' \<circ> r)
(h' \<circ> r) ` V \<subseteq> U
\<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V (h' \<circ> r); (h' \<circ> r) ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> (h' \<circ> r) x = h' x\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (metis comp_apply retraction that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>openin (top_of_set ({0..1} \<times> T)) ?V2; retraction ?V2 B ?r2\<rbrakk> \<Longrightarrow> thesis

goal (2 subgoals):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR S \<and> ANR T\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (meson "*" ANR_imp_neighbourhood_retract \<open>ANR B\<close> clo0TB retract_of_def)
[PROOF STATE]
proof (state)
this:
thesis

goal (1 subgoal):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
assume "ANR U"
[PROOF STATE]
proof (state)
this:
ANR U

goal (1 subgoal):
 1. \<lbrakk>\<And>V k. \<lbrakk>B \<subseteq> V; openin (top_of_set ({0..1} \<times> T)) V; continuous_on V k; k ` V \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> k x = h' x\<rbrakk> \<Longrightarrow> thesis; ANR U\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with ANR_imp_absolute_neighbourhood_extensor \<open>h' ` B \<subseteq> U\<close> clo0TB conth' that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>ANR ?S; continuous_on ?T ?f; ?f ` ?T \<subseteq> ?S; closedin (top_of_set ?U) ?T; \<And>V g. \<lbrakk>?T \<subseteq> V; openin (top_of_set ?U) V; continuous_on V g; g ` V \<subseteq> ?S; \<And>x. x \<in> ?T \<Longrightarrow> g x = ?f x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
h' ` B \<subseteq> U
closedin (top_of_set ({0..1} \<times> T)) B
continuous_on B h'
\<lbrakk>B \<subseteq> ?V2; openin (top_of_set ({0..1} \<times> T)) ?V2; continuous_on ?V2 ?k2; ?k2 ` ?V2 \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> ?k2 x = h' x\<rbrakk> \<Longrightarrow> thesis
ANR U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ANR ?S; continuous_on ?T ?f; ?f ` ?T \<subseteq> ?S; closedin (top_of_set ?U) ?T; \<And>V g. \<lbrakk>?T \<subseteq> V; openin (top_of_set ?U) V; continuous_on V g; g ` V \<subseteq> ?S; \<And>x. x \<in> ?T \<Longrightarrow> g x = ?f x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
h' ` B \<subseteq> U
closedin (top_of_set ({0..1} \<times> T)) B
continuous_on B h'
\<lbrakk>B \<subseteq> ?V2; openin (top_of_set ({0..1} \<times> T)) ?V2; continuous_on ?V2 ?k2; ?k2 ` ?V2 \<subseteq> U; \<And>x. x \<in> B \<Longrightarrow> ?k2 x = h' x\<rbrakk> \<Longrightarrow> thesis
ANR U

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B \<subseteq> V
openin (top_of_set ({0..1} \<times> T)) V
continuous_on V k
k ` V \<subseteq> U
?x2 \<in> B \<Longrightarrow> k ?x2 = h' ?x2

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define S' where "S' \<equiv> {x. \<exists>u::real. u \<in> {0..1} \<and> (u, x::'a) \<in> {0..1} \<times> T - V}"
[PROOF STATE]
proof (state)
this:
S' \<equiv> {x. \<exists>u. u \<in> {0..1} \<and> (u, x) \<in> {0..1} \<times> T - V}

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "closedin (top_of_set T) S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) S'
[PROOF STEP]
unfolding S'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) {x. \<exists>u. u \<in> {0..1} \<and> (u, x) \<in> {0..1} \<times> T - V}
[PROOF STEP]
using closedin_self opeTV
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set ?S) ?S
openin (top_of_set ({0..1} \<times> T)) V

goal (1 subgoal):
 1. closedin (top_of_set T) {x. \<exists>u. u \<in> {0..1} \<and> (u, x) \<in> {0..1} \<times> T - V}
[PROOF STEP]
by (blast intro: closedin_compact_projection)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set T) S'

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have S'_def: "S' = {x. \<exists>u::real.  (u, x::'a) \<in> {0..1} \<times> T - V}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' = {x. \<exists>u. (u, x) \<in> {0..1} \<times> T - V}
[PROOF STEP]
by (auto simp: S'_def)
[PROOF STATE]
proof (state)
this:
S' = {x. \<exists>u. (u, x) \<in> {0..1} \<times> T - V}

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have cloTS': "closedin (top_of_set T) S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) S'
[PROOF STEP]
using S'_def \<open>closedin (top_of_set T) S'\<close>
[PROOF STATE]
proof (prove)
using this:
S' = {x. \<exists>u. (u, x) \<in> {0..1} \<times> T - V}
closedin (top_of_set T) S'

goal (1 subgoal):
 1. closedin (top_of_set T) S'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closedin (top_of_set T) S'

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "S \<inter> S' = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> S' = {}
[PROOF STEP]
using S'_def B_def \<open>B \<subseteq> V\<close>
[PROOF STATE]
proof (prove)
using this:
S' = {x. \<exists>u. (u, x) \<in> {0..1} \<times> T - V}
B \<equiv> {0} \<times> T \<union> {0..1} \<times> S
B \<subseteq> V

goal (1 subgoal):
 1. S \<inter> S' = {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
S \<inter> S' = {}

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain a :: "'a \<Rightarrow> real" where conta: "continuous_on T a"
      and "\<And>x. x \<in> T \<Longrightarrow> a x \<in> closed_segment 1 0"
      and a1: "\<And>x. x \<in> S \<Longrightarrow> a x = 1"
      and a0: "\<And>x. x \<in> S' \<Longrightarrow> a x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>continuous_on T a; \<And>x. x \<in> T \<Longrightarrow> a x \<in> closed_segment 1 0; \<And>x. x \<in> S \<Longrightarrow> a x = 1; \<And>x. x \<in> S' \<Longrightarrow> a x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule Urysohn_local [OF cloTS cloTS' \<open>S \<inter> S' = {}\<close>, of 1 0], blast)
[PROOF STATE]
proof (state)
this:
continuous_on T a
?x2 \<in> T \<Longrightarrow> a ?x2 \<in> closed_segment 1 0
?x2 \<in> S \<Longrightarrow> a ?x2 = 1
?x2 \<in> S' \<Longrightarrow> a ?x2 = 0

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on T a
?x2 \<in> T \<Longrightarrow> a ?x2 \<in> closed_segment 1 0
?x2 \<in> S \<Longrightarrow> a ?x2 = 1
?x2 \<in> S' \<Longrightarrow> a ?x2 = 0
[PROOF STEP]
have ain: "\<And>x. x \<in> T \<Longrightarrow> a x \<in> {0..1}"
[PROOF STATE]
proof (prove)
using this:
continuous_on T a
?x2 \<in> T \<Longrightarrow> a ?x2 \<in> closed_segment 1 0
?x2 \<in> S \<Longrightarrow> a ?x2 = 1
?x2 \<in> S' \<Longrightarrow> a ?x2 = 0

goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> a x \<in> {0..1}
[PROOF STEP]
using closed_segment_eq_real_ivl
[PROOF STATE]
proof (prove)
using this:
continuous_on T a
?x2 \<in> T \<Longrightarrow> a ?x2 \<in> closed_segment 1 0
?x2 \<in> S \<Longrightarrow> a ?x2 = 1
?x2 \<in> S' \<Longrightarrow> a ?x2 = 0
closed_segment ?a ?b = (if ?a \<le> ?b then {?a..?b} else {?b..?a})

goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> a x \<in> {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x2 \<in> T \<Longrightarrow> a ?x2 \<in> {0..1}

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have inV: "(u * a t, t) \<in> V" if "t \<in> T" "0 \<le> u" "u \<le> 1" for t u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u * a t, t) \<in> V
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (u * a t, t) \<notin> V \<Longrightarrow> False
[PROOF STEP]
assume "(u * a t, t) \<notin> V"
[PROOF STATE]
proof (state)
this:
(u * a t, t) \<notin> V

goal (1 subgoal):
 1. (u * a t, t) \<notin> V \<Longrightarrow> False
[PROOF STEP]
with ain [OF \<open>t \<in> T\<close>]
[PROOF STATE]
proof (chain)
picking this:
a t \<in> {0..1}
(u * a t, t) \<notin> V
[PROOF STEP]
have "a t = 0"
[PROOF STATE]
proof (prove)
using this:
a t \<in> {0..1}
(u * a t, t) \<notin> V

goal (1 subgoal):
 1. a t = 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a t \<and> a t \<le> 1; (u * a t, t) \<notin> V\<rbrakk> \<Longrightarrow> a t = 0
[PROOF STEP]
by (metis (no_types, lifting) a0 DiffI S'_def SigmaI atLeastAtMost_iff mem_Collect_eq mult_le_one mult_nonneg_nonneg that)
[PROOF STATE]
proof (state)
this:
a t = 0

goal (1 subgoal):
 1. (u * a t, t) \<notin> V \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using B_def \<open>(u * a t, t) \<notin> V\<close> \<open>B \<subseteq> V\<close> \<open>a t = 0\<close> that
[PROOF STATE]
proof (prove)
using this:
B \<equiv> {0} \<times> T \<union> {0..1} \<times> S
(u * a t, t) \<notin> V
B \<subseteq> V
a t = 0
t \<in> T
0 \<le> u
u \<le> 1

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:
\<lbrakk>?t2 \<in> T; 0 \<le> ?u2; ?u2 \<le> 1\<rbrakk> \<Longrightarrow> (?u2 * a ?t2, ?t2) \<in> V

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>homotopic_with_canon (\<lambda>x. True) T U f g'; continuous_on T g'; g' ` T \<subseteq> U; \<And>x. x \<in> S \<Longrightarrow> g' x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. homotopic_with_canon (\<lambda>x. True) T U f ?g'
 2. continuous_on T ?g'
 3. ?g' ` T \<subseteq> U
 4. \<And>x. x \<in> S \<Longrightarrow> ?g' x = g x
[PROOF STEP]
show hom: "homotopic_with_canon (\<lambda>x. True) T U f (\<lambda>x. k (a x, x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>x. True) T U f (\<lambda>x. k (a x, x))
[PROOF STEP]
proof (simp add: homotopic_with, intro exI conjI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. continuous_on ({0..1} \<times> T) ?h8
 2. ?h8 ` ({0..1} \<times> T) \<subseteq> U
 3. \<forall>x\<in>T. ?h8 (0, x) = f x
 4. \<forall>x\<in>T. ?h8 (1, x) = k (a x, x)
[PROOF STEP]
show "continuous_on ({0..1} \<times> T) (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ({0..1} \<times> T) (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z)))
[PROOF STEP]
apply (intro continuous_on_compose continuous_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on (snd ` ({0..1} \<times> T)) a
 2. continuous_on ((\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z)) ` ({0..1} \<times> T)) k
[PROOF STEP]
apply (force intro: inV continuous_on_subset [OF contk] continuous_on_subset [OF conta])+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
continuous_on ({0..1} \<times> T) (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z)))

goal (3 subgoals):
 1. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) ` ({0..1} \<times> T) \<subseteq> U
 2. \<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (0, x) = f x
 3. \<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (1, x) = k (a x, x)
[PROOF STEP]
show "(k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) ` ({0..1} \<times> T) \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) ` ({0..1} \<times> T) \<subseteq> U
[PROOF STEP]
using inV kim
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t2 \<in> T; 0 \<le> ?u2; ?u2 \<le> 1\<rbrakk> \<Longrightarrow> (?u2 * a ?t2, ?t2) \<in> V
k ` V \<subseteq> U

goal (1 subgoal):
 1. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) ` ({0..1} \<times> T) \<subseteq> U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) ` ({0..1} \<times> T) \<subseteq> U

goal (2 subgoals):
 1. \<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (0, x) = f x
 2. \<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (1, x) = k (a x, x)
[PROOF STEP]
show "\<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (0, x) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (0, x) = f x
[PROOF STEP]
by (simp add: B_def h'_def keq)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (0, x) = f x

goal (1 subgoal):
 1. \<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (1, x) = k (a x, x)
[PROOF STEP]
show "\<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (1, x) = k (a x, x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (1, x) = k (a x, x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>T. (k \<circ> (\<lambda>z. (fst z *\<^sub>R (a \<circ> snd) z, snd z))) (1, x) = k (a x, x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>x. True) T U f (\<lambda>x. k (a x, x))

goal (3 subgoals):
 1. continuous_on T (\<lambda>x. k (a x, x))
 2. (\<lambda>x. k (a x, x)) ` T \<subseteq> U
 3. \<And>x. x \<in> S \<Longrightarrow> k (a x, x) = g x
[PROOF STEP]
show "continuous_on T (\<lambda>x. k (a x, x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on T (\<lambda>x. k (a x, x))
[PROOF STEP]
using homotopic_with_imp_continuous_maps [OF hom]
[PROOF STATE]
proof (prove)
using this:
continuous_map (top_of_set T) (top_of_set U) f \<and> continuous_map (top_of_set T) (top_of_set U) (\<lambda>x. k (a x, x))

goal (1 subgoal):
 1. continuous_on T (\<lambda>x. k (a x, x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on T (\<lambda>x. k (a x, x))

goal (2 subgoals):
 1. (\<lambda>x. k (a x, x)) ` T \<subseteq> U
 2. \<And>x. x \<in> S \<Longrightarrow> k (a x, x) = g x
[PROOF STEP]
show "(\<lambda>x. k (a x, x)) ` T \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. k (a x, x)) ` T \<subseteq> U
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> T \<Longrightarrow> k (a xa, xa) \<in> U
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> T \<Longrightarrow> k (a xa, xa) \<in> U
[PROOF STEP]
assume "t \<in> T"
[PROOF STATE]
proof (state)
this:
t \<in> T

goal (1 subgoal):
 1. \<And>x xa. xa \<in> T \<Longrightarrow> k (a xa, xa) \<in> U
[PROOF STEP]
show "k (a t, t) \<in> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k (a t, t) \<in> U
[PROOF STEP]
by (metis \<open>t \<in> T\<close> image_subset_iff inV kim not_one_le_zero linear mult_cancel_right1)
[PROOF STATE]
proof (state)
this:
k (a t, t) \<in> U

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. k (a x, x)) ` T \<subseteq> U

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> k (a x, x) = g x
[PROOF STEP]
show "\<And>x. x \<in> S \<Longrightarrow> k (a x, x) = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> k (a x, x) = g x
[PROOF STEP]
by (simp add: B_def a1 h'_def keq)
[PROOF STATE]
proof (state)
this:
?x2 \<in> S \<Longrightarrow> k (a ?x2, ?x2) = g ?x2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lit_plus [lit_simps]: "\<guillemotleft>x + y\<guillemotright> = \<guillemotleft>x\<guillemotright> + \<guillemotleft>y\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>x + y\<guillemotright> = \<guillemotleft>x\<guillemotright> + \<guillemotleft>y\<guillemotright>
[PROOF STEP]
by (simp add: uexpr_defs, transfer, simp)


[STATEMENT]
lemma sums_Suc:
  assumes "(\<lambda>n. f (Suc n)) sums l"
  shows "f sums (l + f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
proof  -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
have "(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f (Suc n)) sums l

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
[PROOF STEP]
by (auto intro!: tendsto_add simp: sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
have "(\<Sum>i<n. f (Suc i)) + f 0 = (\<Sum>i<Suc n. f i)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (Suc i)) + f 0 = sum f {..<Suc n}
[PROOF STEP]
unfolding lessThan_Suc_eq_insert_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (Suc i)) + f 0 = sum f (insert 0 (Suc ` {..<n}))
[PROOF STEP]
by (simp add: ac_simps sum.atLeast1_atMost_eq image_Suc_lessThan)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
by (auto simp: sums_def simp del: sum.lessThan_Suc intro: filterlim_sequentially_Suc[THEN iffD1])
[PROOF STATE]
proof (state)
this:
f sums (l + f 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem BisT_trace:
  assumes bis: "c \<approx>T c" "s \<approx> t"
  and T: "mustT c s" "mustT c t"
  and tr: "finTrace tr" "iconfig tr = (c,s)"
  shows "\<exists>tr'. finTrace tr' \<and> iconfig tr' = (c,t) \<and> fstate tr \<approx> fstate tr'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>tr'. finTrace tr' \<and> iconfig tr' = (c, t) \<and> fstate tr \<approx> fstate tr'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>tr'. finTrace tr' \<and> iconfig tr' = (c, t) \<and> fstate tr \<approx> fstate tr'
[PROOF STEP]
from tr finTrace_imp_MtransT[of tr]
[PROOF STATE]
proof (chain)
picking this:
finTrace tr
iconfig tr = (c, s)
finTrace tr \<Longrightarrow> iconfig tr \<rightarrow>*t fstate tr
[PROOF STEP]
have "(c, s) \<rightarrow>*t fstate tr"
[PROOF STATE]
proof (prove)
using this:
finTrace tr
iconfig tr = (c, s)
finTrace tr \<Longrightarrow> iconfig tr \<rightarrow>*t fstate tr

goal (1 subgoal):
 1. (c, s) \<rightarrow>*t fstate tr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c, s) \<rightarrow>*t fstate tr

goal (1 subgoal):
 1. \<exists>tr'. finTrace tr' \<and> iconfig tr' = (c, t) \<and> fstate tr \<approx> fstate tr'
[PROOF STEP]
from BisT_MtransT[OF bis(1) T bis(2) this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>t'. \<lbrakk>(c, t) \<rightarrow>*t t'; fstate tr \<approx> t'\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain t' where "(c,t) \<rightarrow>*t t'" "fstate tr \<approx> t'"
[PROOF STATE]
proof (prove)
using this:
(\<And>t'. \<lbrakk>(c, t) \<rightarrow>*t t'; fstate tr \<approx> t'\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>t'. \<lbrakk>(c, t) \<rightarrow>*t t'; fstate tr \<approx> t'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(c, t) \<rightarrow>*t t'
fstate tr \<approx> t'

goal (1 subgoal):
 1. \<exists>tr'. finTrace tr' \<and> iconfig tr' = (c, t) \<and> fstate tr \<approx> fstate tr'
[PROOF STEP]
from MtransT_Ex_finTrace[OF this(1)] this(2)
[PROOF STATE]
proof (chain)
picking this:
\<exists>tr. finTrace tr \<and> iconfig tr = (c, t) \<and> fstate tr = t'
fstate tr \<approx> t'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>tr. finTrace tr \<and> iconfig tr = (c, t) \<and> fstate tr = t'
fstate tr \<approx> t'

goal (1 subgoal):
 1. \<exists>tr'. finTrace tr' \<and> iconfig tr' = (c, t) \<and> fstate tr \<approx> fstate tr'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>tr'. finTrace tr' \<and> iconfig tr' = (c, t) \<and> fstate tr \<approx> fstate tr'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma L1_indicator:
  assumes [measurable]: "A \<in> sets M"
  shows "eNorm (\<LL> 1 M) (indicator A) = emeasure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm (\<LL> 1 M) (indicat_real A) = emeasure M A
[PROOF STEP]
by (subst L1_Norm, auto, metis assms ennreal_indicator nn_integral_cong nn_integral_indicator)


[STATEMENT]
lemma star_sq_power: "star_sq x = Sup {pd.p_power (sup 1\<^sub>\<sigma> x) i | i. i \<in> \<nat>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star_sq x = Sup {proto_dioid.p_power 1\<^sub>\<sigma> (\<cdot>) (sup 1\<^sub>\<sigma> x) i |i. i \<in> \<nat>}
[PROOF STEP]
by (auto simp: star_sq_def pd.power_sq_power [symmetric] intro: Sup_eqI)


[STATEMENT]
lemma winding_number_uminus_comp:
  assumes "valid_path \<gamma>" "- z \<notin> path_image \<gamma>"
  shows "winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (-z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
define c where "c= 2 * pi * \<i>"
[PROOF STATE]
proof (state)
this:
c = complex_of_real (2 * pi) * \<i>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
have "winding_number (uminus \<circ> \<gamma>) z = 1/c * contour_integral \<gamma> (\<lambda>w. deriv uminus w / (-w-z)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = 1 / c * contour_integral \<gamma> (\<lambda>w. deriv uminus w / (- w - z))
[PROOF STEP]
proof (rule winding_number_comp[of UNIV, folded c_def])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. open UNIV
 2. uminus holomorphic_on UNIV
 3. path_image \<gamma> \<subseteq> UNIV
 4. valid_path \<gamma>
 5. z \<notin> path_image (uminus \<circ> \<gamma>)
[PROOF STEP]
show "open UNIV" "uminus holomorphic_on UNIV" "path_image \<gamma> \<subseteq> UNIV" "valid_path \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (open UNIV &&& uminus holomorphic_on UNIV) &&& path_image \<gamma> \<subseteq> UNIV &&& valid_path \<gamma>
[PROOF STEP]
using \<open>valid_path \<gamma>\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path \<gamma>

goal (1 subgoal):
 1. (open UNIV &&& uminus holomorphic_on UNIV) &&& path_image \<gamma> \<subseteq> UNIV &&& valid_path \<gamma>
[PROOF STEP]
by (auto intro:holomorphic_intros)
[PROOF STATE]
proof (state)
this:
open UNIV
uminus holomorphic_on UNIV
path_image \<gamma> \<subseteq> UNIV
valid_path \<gamma>

goal (1 subgoal):
 1. z \<notin> path_image (uminus \<circ> \<gamma>)
[PROOF STEP]
show "z \<notin> path_image (uminus \<circ> \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image (uminus \<circ> \<gamma>)
[PROOF STEP]
unfolding path_image_compose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> uminus ` path_image \<gamma>
[PROOF STEP]
using \<open>- z \<notin> path_image \<gamma>\<close>
[PROOF STATE]
proof (prove)
using this:
- z \<notin> path_image \<gamma>

goal (1 subgoal):
 1. z \<notin> uminus ` path_image \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<notin> path_image (uminus \<circ> \<gamma>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
winding_number (uminus \<circ> \<gamma>) z = 1 / c * contour_integral \<gamma> (\<lambda>w. deriv uminus w / (- w - z))

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
winding_number (uminus \<circ> \<gamma>) z = 1 / c * contour_integral \<gamma> (\<lambda>w. deriv uminus w / (- w - z))

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
have "\<dots> = 1/c * contour_integral \<gamma> (\<lambda>w. 1 / (w- (-z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / c * contour_integral \<gamma> (\<lambda>w. deriv uminus w / (- w - z)) = 1 / c * contour_integral \<gamma> (\<lambda>w. 1 / (w - - z))
[PROOF STEP]
by (auto intro!:contour_integral_eq simp add:field_simps minus_divide_right)
[PROOF STATE]
proof (state)
this:
1 / c * contour_integral \<gamma> (\<lambda>w. deriv uminus w / (- w - z)) = 1 / c * contour_integral \<gamma> (\<lambda>w. 1 / (w - - z))

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / c * contour_integral \<gamma> (\<lambda>w. deriv uminus w / (- w - z)) = 1 / c * contour_integral \<gamma> (\<lambda>w. 1 / (w - - z))

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
have "\<dots> = winding_number \<gamma> (-z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / c * contour_integral \<gamma> (\<lambda>w. 1 / (w - - z)) = winding_number \<gamma> (- z)
[PROOF STEP]
using winding_number_valid_path[OF \<open>valid_path \<gamma>\<close> \<open>- z \<notin> path_image \<gamma>\<close>,folded c_def]
[PROOF STATE]
proof (prove)
using this:
winding_number \<gamma> (- z) = 1 / c * contour_integral \<gamma> (\<lambda>w. 1 / (w - - z))

goal (1 subgoal):
 1. 1 / c * contour_integral \<gamma> (\<lambda>w. 1 / (w - - z)) = winding_number \<gamma> (- z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / c * contour_integral \<gamma> (\<lambda>w. 1 / (w - - z)) = winding_number \<gamma> (- z)

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
winding_number (uminus \<circ> \<gamma>) z = winding_number \<gamma> (- z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isCont_sum [simp]: "\<forall>i\<in>A. isCont (f i) a \<Longrightarrow> isCont (\<lambda>x. \<Sum>i\<in>A. f i x) a"
  for f :: "'a \<Rightarrow> 'b::t2_space \<Rightarrow> 'c::topological_comm_monoid_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>A. isCont (f i) a \<Longrightarrow> isCont (\<lambda>x. \<Sum>i\<in>A. f i x) a
[PROOF STEP]
by (auto intro: continuous_sum)


[STATEMENT]
lemma suminf_divide: "summable f \<Longrightarrow> suminf (\<lambda>n. f n / c) = suminf f / c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<Sum>n. f n / c) = suminf f / c
[PROOF STEP]
by (rule bounded_linear.suminf [OF bounded_linear_divide, symmetric])


[STATEMENT]
lemma Gromov_product_at_quasi_isometry:
  fixes f::"'a::Gromov_hyperbolic_space_geodesic \<Rightarrow> 'b::Gromov_hyperbolic_space_geodesic"
  assumes "lambda C-quasi_isometry f"
  shows "Gromov_product_at (f x) (f y) (f z) \<ge> Gromov_product_at x y z / lambda - 187 * lambda^2 * (C + deltaG(TYPE('a)) + deltaG(TYPE('b)))"
        "Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda^2 * (C + deltaG(TYPE('a)) + deltaG(TYPE('b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z) &&& Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "lambda \<ge> 1" "C \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> lambda &&& 0 \<le> C
[PROOF STEP]
using quasi_isometry_onD[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> UNIV; ?y \<in> UNIV\<rbrakk> \<Longrightarrow> dist (f ?x) (f ?y) \<le> lambda * dist ?x ?y + C
\<lbrakk>?x \<in> UNIV; ?y \<in> UNIV\<rbrakk> \<Longrightarrow> 1 / lambda * dist ?x ?y - C \<le> dist (f ?x) (f ?y)
1 \<le> lambda
0 \<le> C

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

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
define D where "D = 92 * lambda^2 * (C + deltaG(TYPE('b)))"
[PROOF STATE]
proof (state)
this:
D = 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have Dxy: "hausdorff_distance (f`{x--y}) {f x--f y} \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (f ` {x--y}) {f x--f y} \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (f ` {x--y}) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
apply (rule geodesic_quasi_isometric_image[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_segment_between {x--y} x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (f ` {x--y}) {f x--f y} \<le> D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have Dyz: "hausdorff_distance (f`{y--z}) {f y--f z} \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (f ` {y--z}) {f y--f z} \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (f ` {y--z}) {f y--f z} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
apply (rule geodesic_quasi_isometric_image[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_segment_between {y--z} y z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (f ` {y--z}) {f y--f z} \<le> D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have Dxz: "hausdorff_distance (f`{x--z}) {f x--f z} \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (f ` {x--z}) {f x--f z} \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (f ` {x--z}) {f x--f z} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
apply (rule geodesic_quasi_isometric_image[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_segment_between {x--z} x z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (f ` {x--z}) {f x--f z} \<le> D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
define E where "E = (lambda * (4 * deltaG(TYPE('a))) + C) + D"
[PROOF STATE]
proof (state)
this:
E = lambda * (4 * deltaG TYPE('a)) + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "E \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> E
[PROOF STEP]
unfolding E_def D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> lambda * (4 * deltaG TYPE('a)) + C + 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[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> lambda * (4 * deltaG TYPE('a)) + C + 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> E

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
obtain w where w: "infdist w {x--y} \<le> 4 * deltaG(TYPE('a))"
                    "infdist w {x--z} \<le> 4 * deltaG(TYPE('a))"
                    "infdist w {y--z} \<le> 4 * deltaG(TYPE('a))"
                    "dist w x = Gromov_product_at x y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>w. \<lbrakk>infdist w {x--y} \<le> 4 * deltaG TYPE('a); infdist w {x--z} \<le> 4 * deltaG TYPE('a); infdist w {y--z} \<le> 4 * deltaG TYPE('a); dist w x = Gromov_product_at x y z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using slim_triangle[of "{x--y}" x y "{x--z}" z "{y--z}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>geodesic_segment_between {x--y} x y; geodesic_segment_between {x--z} x z; geodesic_segment_between {y--z} y z\<rbrakk> \<Longrightarrow> \<exists>w. infdist w {x--y} \<le> 4 * deltaG TYPE('a) \<and> infdist w {x--z} \<le> 4 * deltaG TYPE('a) \<and> infdist w {y--z} \<le> 4 * deltaG TYPE('a) \<and> dist w x = Gromov_product_at x y z \<and> w \<in> {x--y}

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>infdist w {x--y} \<le> 4 * deltaG TYPE('a); infdist w {x--z} \<le> 4 * deltaG TYPE('a); infdist w {y--z} \<le> 4 * deltaG TYPE('a); dist w x = Gromov_product_at x y z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist w {x--y} \<le> 4 * deltaG TYPE('a)
infdist w {x--z} \<le> 4 * deltaG TYPE('a)
infdist w {y--z} \<le> 4 * deltaG TYPE('a)
dist w x = Gromov_product_at x y z

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "infdist (f w) {f x--f y} \<le> infdist (f w) (f`{x--y}) + hausdorff_distance (f`{x--y}) {f x--f y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (f w) {f x--f y} \<le> infdist (f w) (f ` {x--y}) + hausdorff_distance (f ` {x--y}) {f x--f y}
[PROOF STEP]
by (intro mono_intros quasi_isometry_on_bounded[OF quasi_isometry_on_subset[OF assms(1)], of "{x--y}"], auto)
[PROOF STATE]
proof (state)
this:
infdist (f w) {f x--f y} \<le> infdist (f w) (f ` {x--y}) + hausdorff_distance (f ` {x--y}) {f x--f y}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist (f w) {f x--f y} \<le> infdist (f w) (f ` {x--y}) + hausdorff_distance (f ` {x--y}) {f x--f y}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (lambda * infdist w {x--y} + C) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (f w) (f ` {x--y}) + hausdorff_distance (f ` {x--y}) {f x--f y} \<le> lambda * infdist w {x--y} + C + D
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infdist (f w) (f ` {x--y}) \<le> lambda * infdist w {x--y} + C
 2. hausdorff_distance (f ` {x--y}) {f x--f y} \<le> D
[PROOF STEP]
using quasi_isometry_on_infdist[OF assms(1)] Dxy
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> UNIV; ?S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> infdist (f ?w) (f ` ?S) \<le> lambda * infdist ?w ?S + C
\<lbrakk>?w \<in> UNIV; ?S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> 1 / lambda * infdist ?w ?S - C \<le> infdist (f ?w) (f ` ?S)
hausdorff_distance (f ` {x--y}) {f x--f y} \<le> D

goal (2 subgoals):
 1. infdist (f w) (f ` {x--y}) \<le> lambda * infdist w {x--y} + C
 2. hausdorff_distance (f ` {x--y}) {f x--f y} \<le> D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist (f w) (f ` {x--y}) + hausdorff_distance (f ` {x--y}) {f x--f y} \<le> lambda * infdist w {x--y} + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist (f w) (f ` {x--y}) + hausdorff_distance (f ` {x--y}) {f x--f y} \<le> lambda * infdist w {x--y} + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (lambda * (4 * deltaG(TYPE('a))) + C) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * infdist w {x--y} + C + D \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infdist w {x--y} \<le> 4 * deltaG TYPE('a)
 2. 0 \<le> lambda
[PROOF STEP]
using w \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
infdist w {x--y} \<le> 4 * deltaG TYPE('a)
infdist w {x--z} \<le> 4 * deltaG TYPE('a)
infdist w {y--z} \<le> 4 * deltaG TYPE('a)
dist w x = Gromov_product_at x y z
1 \<le> lambda

goal (2 subgoals):
 1. infdist w {x--y} \<le> 4 * deltaG TYPE('a)
 2. 0 \<le> lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * infdist w {x--y} + C + D \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
infdist (f w) {f x--f y} \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
have Exy: "infdist (f w) {f x--f y} \<le> E"
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f x--f y} \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (1 subgoal):
 1. infdist (f w) {f x--f y} \<le> E
[PROOF STEP]
unfolding E_def
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f x--f y} \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (1 subgoal):
 1. infdist (f w) {f x--f y} \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist (f w) {f x--f y} \<le> E

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "infdist (f w) {f y--f z} \<le> infdist (f w) (f`{y--z}) + hausdorff_distance (f`{y--z}) {f y--f z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (f w) {f y--f z} \<le> infdist (f w) (f ` {y--z}) + hausdorff_distance (f ` {y--z}) {f y--f z}
[PROOF STEP]
by (intro mono_intros quasi_isometry_on_bounded[OF quasi_isometry_on_subset[OF assms(1)], of "{y--z}"], auto)
[PROOF STATE]
proof (state)
this:
infdist (f w) {f y--f z} \<le> infdist (f w) (f ` {y--z}) + hausdorff_distance (f ` {y--z}) {f y--f z}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist (f w) {f y--f z} \<le> infdist (f w) (f ` {y--z}) + hausdorff_distance (f ` {y--z}) {f y--f z}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (lambda * infdist w {y--z} + C) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (f w) (f ` {y--z}) + hausdorff_distance (f ` {y--z}) {f y--f z} \<le> lambda * infdist w {y--z} + C + D
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infdist (f w) (f ` {y--z}) \<le> lambda * infdist w {y--z} + C
 2. hausdorff_distance (f ` {y--z}) {f y--f z} \<le> D
[PROOF STEP]
using quasi_isometry_on_infdist[OF assms(1)] Dyz
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> UNIV; ?S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> infdist (f ?w) (f ` ?S) \<le> lambda * infdist ?w ?S + C
\<lbrakk>?w \<in> UNIV; ?S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> 1 / lambda * infdist ?w ?S - C \<le> infdist (f ?w) (f ` ?S)
hausdorff_distance (f ` {y--z}) {f y--f z} \<le> D

goal (2 subgoals):
 1. infdist (f w) (f ` {y--z}) \<le> lambda * infdist w {y--z} + C
 2. hausdorff_distance (f ` {y--z}) {f y--f z} \<le> D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist (f w) (f ` {y--z}) + hausdorff_distance (f ` {y--z}) {f y--f z} \<le> lambda * infdist w {y--z} + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist (f w) (f ` {y--z}) + hausdorff_distance (f ` {y--z}) {f y--f z} \<le> lambda * infdist w {y--z} + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (lambda * (4 * deltaG(TYPE('a))) + C) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * infdist w {y--z} + C + D \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infdist w {y--z} \<le> 4 * deltaG TYPE('a)
 2. 0 \<le> lambda
[PROOF STEP]
using w \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
infdist w {x--y} \<le> 4 * deltaG TYPE('a)
infdist w {x--z} \<le> 4 * deltaG TYPE('a)
infdist w {y--z} \<le> 4 * deltaG TYPE('a)
dist w x = Gromov_product_at x y z
1 \<le> lambda

goal (2 subgoals):
 1. infdist w {y--z} \<le> 4 * deltaG TYPE('a)
 2. 0 \<le> lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * infdist w {y--z} + C + D \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
infdist (f w) {f y--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
have Eyz: "infdist (f w) {f y--f z} \<le> E"
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f y--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (1 subgoal):
 1. infdist (f w) {f y--f z} \<le> E
[PROOF STEP]
unfolding E_def
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f y--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (1 subgoal):
 1. infdist (f w) {f y--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist (f w) {f y--f z} \<le> E

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "infdist (f w) {f x--f z} \<le> infdist (f w) (f`{x--z}) + hausdorff_distance (f`{x--z}) {f x--f z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (f w) {f x--f z} \<le> infdist (f w) (f ` {x--z}) + hausdorff_distance (f ` {x--z}) {f x--f z}
[PROOF STEP]
by (intro mono_intros quasi_isometry_on_bounded[OF quasi_isometry_on_subset[OF assms(1)], of "{x--z}"], auto)
[PROOF STATE]
proof (state)
this:
infdist (f w) {f x--f z} \<le> infdist (f w) (f ` {x--z}) + hausdorff_distance (f ` {x--z}) {f x--f z}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist (f w) {f x--f z} \<le> infdist (f w) (f ` {x--z}) + hausdorff_distance (f ` {x--z}) {f x--f z}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (lambda * infdist w {x--z} + C) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist (f w) (f ` {x--z}) + hausdorff_distance (f ` {x--z}) {f x--f z} \<le> lambda * infdist w {x--z} + C + D
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infdist (f w) (f ` {x--z}) \<le> lambda * infdist w {x--z} + C
 2. hausdorff_distance (f ` {x--z}) {f x--f z} \<le> D
[PROOF STEP]
using quasi_isometry_on_infdist[OF assms(1)] Dxz
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> UNIV; ?S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> infdist (f ?w) (f ` ?S) \<le> lambda * infdist ?w ?S + C
\<lbrakk>?w \<in> UNIV; ?S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> 1 / lambda * infdist ?w ?S - C \<le> infdist (f ?w) (f ` ?S)
hausdorff_distance (f ` {x--z}) {f x--f z} \<le> D

goal (2 subgoals):
 1. infdist (f w) (f ` {x--z}) \<le> lambda * infdist w {x--z} + C
 2. hausdorff_distance (f ` {x--z}) {f x--f z} \<le> D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist (f w) (f ` {x--z}) + hausdorff_distance (f ` {x--z}) {f x--f z} \<le> lambda * infdist w {x--z} + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infdist (f w) (f ` {x--z}) + hausdorff_distance (f ` {x--z}) {f x--f z} \<le> lambda * infdist w {x--z} + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (lambda * (4 * deltaG(TYPE('a))) + C) + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda * infdist w {x--z} + C + D \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infdist w {x--z} \<le> 4 * deltaG TYPE('a)
 2. 0 \<le> lambda
[PROOF STEP]
using w \<open>lambda \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
infdist w {x--y} \<le> 4 * deltaG TYPE('a)
infdist w {x--z} \<le> 4 * deltaG TYPE('a)
infdist w {y--z} \<le> 4 * deltaG TYPE('a)
dist w x = Gromov_product_at x y z
1 \<le> lambda

goal (2 subgoals):
 1. infdist w {x--z} \<le> 4 * deltaG TYPE('a)
 2. 0 \<le> lambda
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda * infdist w {x--z} + C + D \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
infdist (f w) {f x--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
have Exz: "infdist (f w) {f x--f z} \<le> E"
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f x--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (1 subgoal):
 1. infdist (f w) {f x--f z} \<le> E
[PROOF STEP]
unfolding E_def
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f x--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D

goal (1 subgoal):
 1. infdist (f w) {f x--f z} \<le> lambda * (4 * deltaG TYPE('a)) + C + D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist (f w) {f x--f z} \<le> E

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "2 * ((1/lambda * dist w x - C)) \<le> 2 * dist (f w) (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (1 / lambda * dist w x - C) \<le> 2 * dist (f w) (f x)
[PROOF STEP]
using quasi_isometry_onD(2)[OF assms(1), of w x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>w \<in> UNIV; x \<in> UNIV\<rbrakk> \<Longrightarrow> 1 / lambda * dist w x - C \<le> dist (f w) (f x)

goal (1 subgoal):
 1. 2 * (1 / lambda * dist w x - C) \<le> 2 * dist (f w) (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * (1 / lambda * dist w x - C) \<le> 2 * dist (f w) (f x)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (1 / lambda * dist w x - C) \<le> 2 * dist (f w) (f x)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... = (dist (f w) (f x) + dist (f w) (f y)) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * dist (f w) (f x) = dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * dist (f w) (f x) = dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * dist (f w) (f x) = dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (dist (f x) (f y) + 2 * infdist (f w) {f x--f y}) + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z)) \<le> dist (f x) (f y) + 2 * infdist (f w) {f x--f y} + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z)
[PROOF STEP]
by (intro geodesic_segment_distance mono_intros, auto)
[PROOF STATE]
proof (state)
this:
dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z)) \<le> dist (f x) (f y) + 2 * infdist (f w) {f x--f y} + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z)) \<le> dist (f x) (f y) + 2 * infdist (f w) {f x--f y} + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> 2 * Gromov_product_at (f x) (f y) (f z) + 4 * E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f x) (f y) + 2 * infdist (f w) {f x--f y} + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z) \<le> 2 * Gromov_product_at (f x) (f y) (f z) + 4 * E
[PROOF STEP]
unfolding Gromov_product_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f x) (f y) + 2 * infdist (f w) {f x--f y} + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z) \<le> 2 * ((dist (f x) (f y) + dist (f x) (f z) - dist (f y) (f z)) / 2) + 4 * E
[PROOF STEP]
using Exy Exz
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f x--f y} \<le> E
infdist (f w) {f x--f z} \<le> E

goal (1 subgoal):
 1. dist (f x) (f y) + 2 * infdist (f w) {f x--f y} + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z) \<le> 2 * ((dist (f x) (f y) + dist (f x) (f z) - dist (f y) (f z)) / 2) + 4 * E
[PROOF STEP]
by (auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
dist (f x) (f y) + 2 * infdist (f w) {f x--f y} + (dist (f x) (f z) + 2 * infdist (f w) {f x--f z}) - dist (f y) (f z) \<le> 2 * Gromov_product_at (f x) (f y) (f z) + 4 * E

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * (1 / lambda * dist w x - C) \<le> 2 * Gromov_product_at (f x) (f y) (f z) + 4 * E
[PROOF STEP]
have *: "Gromov_product_at x y z / lambda - C - 2 * E \<le> Gromov_product_at (f x) (f y) (f z)"
[PROOF STATE]
proof (prove)
using this:
2 * (1 / lambda * dist w x - C) \<le> 2 * Gromov_product_at (f x) (f y) (f z) + 4 * E

goal (1 subgoal):
 1. Gromov_product_at x y z / lambda - C - 2 * E \<le> Gromov_product_at (f x) (f y) (f z)
[PROOF STEP]
unfolding w(4)
[PROOF STATE]
proof (prove)
using this:
2 * (1 / lambda * Gromov_product_at x y z - C) \<le> 2 * Gromov_product_at (f x) (f y) (f z) + 4 * E

goal (1 subgoal):
 1. Gromov_product_at x y z / lambda - C - 2 * E \<le> Gromov_product_at (f x) (f y) (f z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Gromov_product_at x y z / lambda - C - 2 * E \<le> Gromov_product_at (f x) (f y) (f z)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "2 * Gromov_product_at (f x) (f y) (f z) - 2 * E \<le> 2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Gromov_product_at (f x) (f y) (f z) - 2 * E \<le> 2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z}
[PROOF STEP]
using Eyz
[PROOF STATE]
proof (prove)
using this:
infdist (f w) {f y--f z} \<le> E

goal (1 subgoal):
 1. 2 * Gromov_product_at (f x) (f y) (f z) - 2 * E \<le> 2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * Gromov_product_at (f x) (f y) (f z) - 2 * E \<le> 2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * Gromov_product_at (f x) (f y) (f z) - 2 * E \<le> 2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z}

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... = dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z} = dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z})
[PROOF STEP]
unfolding Gromov_product_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * ((dist (f x) (f y) + dist (f x) (f z) - dist (f y) (f z)) / 2) - 2 * infdist (f w) {f y--f z} = dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z})
[PROOF STEP]
by (auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z} = dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z})

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * Gromov_product_at (f x) (f y) (f z) - 2 * infdist (f w) {f y--f z} = dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z})

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> (dist (f w) (f x) + dist (f w) (f y)) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z}) \<le> dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))
[PROOF STEP]
by (intro geodesic_segment_distance mono_intros, auto)
[PROOF STATE]
proof (state)
this:
dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z}) \<le> dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (f x) (f y) + dist (f x) (f z) - (dist (f y) (f z) + 2 * infdist (f w) {f y--f z}) \<le> dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z))

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... = 2 * dist (f w) (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z)) = 2 * dist (f w) (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z)) = 2 * dist (f w) (f x)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (f w) (f x) + dist (f w) (f y) + (dist (f w) (f x) + dist (f w) (f z)) - (dist (f w) (f y) + dist (f w) (f z)) = 2 * dist (f w) (f x)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> 2 * (lambda * dist w x + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * dist (f w) (f x) \<le> 2 * (lambda * dist w x + C)
[PROOF STEP]
using quasi_isometry_onD(1)[OF assms(1), of w x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>w \<in> UNIV; x \<in> UNIV\<rbrakk> \<Longrightarrow> dist (f w) (f x) \<le> lambda * dist w x + C

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

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * Gromov_product_at (f x) (f y) (f z) - 2 * E \<le> 2 * (lambda * dist w x + C)
[PROOF STEP]
have "Gromov_product_at (f x) (f y) (f z) \<le> lambda * dist w x + C + E"
[PROOF STATE]
proof (prove)
using this:
2 * Gromov_product_at (f x) (f y) (f z) - 2 * E \<le> 2 * (lambda * dist w x + C)

goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) \<le> lambda * dist w x + C + E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * dist w x + C + E

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * dist w x + C + E
[PROOF STEP]
have **: "Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + 2 * E"
[PROOF STATE]
proof (prove)
using this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * dist w x + C + E

goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + 2 * E
[PROOF STEP]
unfolding w(4)
[PROOF STATE]
proof (prove)
using this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + E

goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + 2 * E
[PROOF STEP]
using \<open>E \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + E
0 \<le> E

goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + 2 * E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + 2 * E

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "C + 2 * E = 3 * 1 * C + 8 * lambda * deltaG(TYPE('a)) + 184 * lambda^2 * C + 184 * lambda^2 * deltaG(TYPE('b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C + 2 * E = 3 * 1 * C + 8 * lambda * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 184 * lambda\<^sup>2 * deltaG TYPE('b)
[PROOF STEP]
unfolding E_def D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C + 2 * (lambda * (4 * deltaG TYPE('a)) + C + 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))) = 3 * 1 * C + 8 * lambda * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 184 * lambda\<^sup>2 * deltaG TYPE('b)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
C + 2 * E = 3 * 1 * C + 8 * lambda * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 184 * lambda\<^sup>2 * deltaG TYPE('b)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C + 2 * E = 3 * 1 * C + 8 * lambda * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 184 * lambda\<^sup>2 * deltaG TYPE('b)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
have "... \<le> 3 * lambda^2 * C + 187 * lambda^2 * deltaG(TYPE('a)) + 184 * lambda^2 * C + 187 * lambda^2 * deltaG(TYPE('b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * 1 * C + 8 * lambda * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 184 * lambda\<^sup>2 * deltaG TYPE('b) \<le> 3 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('b)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. 1 \<le> lambda\<^sup>2
 2. 0 \<le> 3
 3. 0 \<le> C
 4. 8 \<le> 187
 5. 1 \<le> lambda
 6. 0 < 2
 7. 0 \<le> 187
 8. 0 \<le> lambda
 9. 184 \<le> 187
 10. 0 \<le> lambda\<^sup>2
[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 (10 subgoals):
 1. 1 \<le> lambda\<^sup>2
 2. 0 \<le> 3
 3. 0 \<le> C
 4. 8 \<le> 187
 5. 1 \<le> lambda
 6. 0 < 2
 7. 0 \<le> 187
 8. 0 \<le> lambda
 9. 184 \<le> 187
 10. 0 \<le> lambda\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 * 1 * C + 8 * lambda * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 184 * lambda\<^sup>2 * deltaG TYPE('b) \<le> 3 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('b)

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
C + 2 * E \<le> 3 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('b)
[PROOF STEP]
have I: "C + 2 * E \<le> 187 * lambda^2 * (C + deltaG(TYPE('a)) + deltaG(TYPE('b)))"
[PROOF STATE]
proof (prove)
using this:
C + 2 * E \<le> 3 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('a) + 184 * lambda\<^sup>2 * C + 187 * lambda\<^sup>2 * deltaG TYPE('b)

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

goal (2 subgoals):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
 2. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
show "Gromov_product_at (f x) (f y) (f z) \<ge> Gromov_product_at x y z / lambda - 187 * lambda^2 * (C + deltaG(TYPE('a)) + deltaG(TYPE('b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
[PROOF STEP]
using * I
[PROOF STATE]
proof (prove)
using this:
Gromov_product_at x y z / lambda - C - 2 * E \<le> Gromov_product_at (f x) (f y) (f z)
C + 2 * E \<le> 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))

goal (1 subgoal):
 1. Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_product_at x y z / lambda - 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b)) \<le> Gromov_product_at (f x) (f y) (f z)

goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
show "Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda^2 * (C + deltaG(TYPE('a)) + deltaG(TYPE('b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
using ** I
[PROOF STATE]
proof (prove)
using this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + C + 2 * E
C + 2 * E \<le> 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))

goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_product_at (f x) (f y) (f z) \<le> lambda * Gromov_product_at x y z + 187 * lambda\<^sup>2 * (C + deltaG TYPE('a) + deltaG TYPE('b))

goal:
No subgoals!
[PROOF STEP]
qed