[STATEMENT]
lemma extended_predist_weak_triangle:
  "extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
have Z: "esqrt 2 = eexp (ereal(ln 2/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt 2 = eexp (ereal (ln 2 / 2))
[PROOF STEP]
by (subst esqrt_eq_iff_square, auto simp add: exp_add[symmetric])
[PROOF STATE]
proof (state)
this:
esqrt 2 = eexp (ereal (ln 2 / 2))

goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
have A: "eexp(ereal(epsilonG TYPE('a)) * 1) \<le> esqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (epsilonG TYPE('a)) * 1) \<le> esqrt 2
[PROOF STEP]
unfolding Z epsilonG_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (ln 2 / (2 + 2 * deltaG TYPE('a))) * 1) \<le> eexp (ereal (ln 2 / 2))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln 2 * 2 / (2 + 2 * deltaG TYPE('a)) \<le> ln 2
[PROOF STEP]
apply (auto simp add: algebra_simps divide_simps intro!: mono_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 + deltaG TYPE('a) * 2 < 0 \<Longrightarrow> deltaG TYPE('a) * ln 2 \<le> 0
[PROOF STEP]
using delta_nonneg[where ?'a = 'a]
[PROOF STATE]
proof (prove)
using this:
0 \<le> deltaG TYPE('a)

goal (1 subgoal):
 1. 2 + deltaG TYPE('a) * 2 < 0 \<Longrightarrow> deltaG TYPE('a) * ln 2 \<le> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eexp (ereal (epsilonG TYPE('a)) * 1) \<le> esqrt 2

goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
text \<open>We have to show an inequality $d(x, z) \leq \sqrt{2} \max(d(x,y), d(y,z))$. Each of $d(x,y)$
  and $d(y,z)$ is either the extended distance, or the exponential of minus the Gromov product,
  depending on which is smaller. We split according to the four cases.\<close>
[PROOF STATE]
proof (state)
this:
eexp (ereal (epsilonG TYPE('a)) * 1) \<le> esqrt 2

goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
have "(esqrt (extended_Gromov_distance x y) \<le> eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y)
        \<or> esqrt (extended_Gromov_distance x y) \<ge> eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y))
        \<and>
      ((esqrt (extended_Gromov_distance y z) \<le> eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint y z)
        \<or> esqrt (extended_Gromov_distance y z) \<ge> eexp (- epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint y z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)) \<and> (esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)) \<and> (esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z))

goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)) \<and> (esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z))
[PROOF STEP]
have "ereal(extended_predist x z) \<le> ereal (sqrt 2) * max (ereal(extended_predist x y)) (ereal (extended_predist y z))"
[PROOF STATE]
proof (prove)
using this:
(esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)) \<and> (esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z))

goal (1 subgoal):
 1. ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>First, consider the case where the minimum is the extended distance for both cases.
    Then $ed(x,z) \leq ed(x,y) + ed(y,z) \leq 2 \max(ed(x,y), ed(y,z))$. Therefore, $ed(x,z)^{1/2}
    \leq \sqrt{2} \max(ed(x,y)^{1/2}, ed(y,z)^{1/2})$. As predist is defined using
    the square root of $ed$, this readily gives the result.\<close>
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
assume H: "esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)"
              "esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)"
[PROOF STATE]
proof (state)
this:
esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)
esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)

goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "extended_Gromov_distance x z \<le> extended_Gromov_distance x y + extended_Gromov_distance y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extended_Gromov_distance x z \<le> extended_Gromov_distance x y + extended_Gromov_distance y z
[PROOF STEP]
by (rule extended_Gromov_distance_triangle)
[PROOF STATE]
proof (state)
this:
extended_Gromov_distance x z \<le> extended_Gromov_distance x y + extended_Gromov_distance y z

goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
extended_Gromov_distance x z \<le> extended_Gromov_distance x y + extended_Gromov_distance y z

goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> 2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extended_Gromov_distance x y + extended_Gromov_distance y z \<le> 2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z)
[PROOF STEP]
by (simp add: add_mono add_mono_thms_linordered_semiring(1) mult_2_ereal)
[PROOF STATE]
proof (state)
this:
extended_Gromov_distance x y + extended_Gromov_distance y z \<le> 2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z)

goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
extended_Gromov_distance x z \<le> 2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z)
[PROOF STEP]
have "esqrt (extended_Gromov_distance x z) \<le> esqrt (2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z))"
[PROOF STATE]
proof (prove)
using this:
extended_Gromov_distance x z \<le> 2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x z) \<le> esqrt (2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z))
[PROOF STEP]
by (intro mono_intros)
[PROOF STATE]
proof (state)
this:
esqrt (extended_Gromov_distance x z) \<le> esqrt (2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z))

goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
esqrt (extended_Gromov_distance x z) \<le> esqrt (2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z))

goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = esqrt 2 * max (esqrt (extended_Gromov_distance x y)) (esqrt (extended_Gromov_distance y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt (2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z)) = esqrt 2 * max (esqrt (extended_Gromov_distance x y)) (esqrt (extended_Gromov_distance y z))
[PROOF STEP]
by (auto simp add: esqrt_mult max_of_mono[OF esqrt_mono])
[PROOF STATE]
proof (state)
this:
esqrt (2 * max (extended_Gromov_distance x y) (extended_Gromov_distance y z)) = esqrt 2 * max (esqrt (extended_Gromov_distance x y)) (esqrt (extended_Gromov_distance y z))

goal (4 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 4. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
esqrt (extended_Gromov_distance x z) \<le> esqrt 2 * max (esqrt (extended_Gromov_distance x y)) (esqrt (extended_Gromov_distance y z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
esqrt (extended_Gromov_distance x z) \<le> esqrt 2 * max (esqrt (extended_Gromov_distance x y)) (esqrt (extended_Gromov_distance y z))

goal (1 subgoal):
 1. ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
unfolding extended_predist_ereal min_def
[PROOF STATE]
proof (prove)
using this:
esqrt (extended_Gromov_distance x z) \<le> esqrt 2 * max (esqrt (extended_Gromov_distance x y)) (esqrt (extended_Gromov_distance y z))

goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) then esqrt (extended_Gromov_distance x z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)) \<le> ereal (sqrt 2) * max (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
esqrt (extended_Gromov_distance x z) \<le> esqrt 2 * max (esqrt (extended_Gromov_distance x y)) (esqrt (extended_Gromov_distance y z))
esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)
esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)

goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) then esqrt (extended_Gromov_distance x z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)) \<le> ereal (sqrt 2) * max (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>Next, consider the case where the minimum comes from the Gromov product for both cases.
    Then, the conclusion will come for the hyperbolicity inequality (which is valid in the Gromov
    completion as well). There is an additive loss of $\delta$ in this inequality, which is converted
    to a multiplicative loss after taking the exponential to get the distance. Since, in the formula
    for the distance, the Gromov product is multiplied by a constant $\epsilon$ by design, the loss
    we get in the end is $\exp(\delta \epsilon)$. The precise value of $\epsilon$ we have taken is
    designed so that this is at most $\sqrt{2}$, giving the desired conclusion.\<close>
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
assume H: "eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)"
              "eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)"
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>First, check that $\epsilon$ and $\delta$ satisfy the required inequality
    $\exp(\epsilon \delta) \leq \sqrt{2}$ (but in the extended reals as this is what we will use.\<close>
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have B: "eexp (epsilonG(TYPE('a)) * deltaG(TYPE('a))) \<le> esqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) \<le> esqrt 2
[PROOF STEP]
unfolding epsilonG_def \<open>esqrt 2 = eexp (ereal(ln 2/2))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (ln 2 / (2 + 2 * deltaG TYPE('a)) * deltaG TYPE('a))) \<le> eexp (ereal (ln 2 / 2))
[PROOF STEP]
apply (auto simp add: algebra_simps divide_simps intro!: mono_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 + deltaG TYPE('a) * 2 < 0 \<Longrightarrow> False
[PROOF STEP]
using delta_nonneg[where ?'a = 'a]
[PROOF STATE]
proof (prove)
using this:
0 \<le> deltaG TYPE('a)

goal (1 subgoal):
 1. 2 + deltaG TYPE('a) * 2 < 0 \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) \<le> esqrt 2

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>We start the computation. First, use the hyperbolicity inequality.\<close>
[PROOF STATE]
proof (state)
this:
eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) \<le> esqrt 2

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "eexp (- epsilonG TYPE('a) * extended_Gromov_product_at basepoint x z)
      \<le> eexp (- epsilonG TYPE('a) * ((min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - deltaG(TYPE('a)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a))))
[PROOF STEP]
apply (subst uminus_ereal.simps(1)[symmetric], subst ereal_mult_minus_left)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (- (ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)) \<le> eexp (- (ereal (epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a)))))
[PROOF STEP]
by (intro mono_intros)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a))))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>Use distributivity to isolate the term $\epsilon \delta$. This requires some care
    as multiplication is not distributive in general in ereal.\<close>
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a))))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a))))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = eexp (- epsilonG TYPE('a) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)
            + epsilonG TYPE('a) * deltaG TYPE('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a)))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a)))
[PROOF STEP]
apply (rule cong[of eexp], auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a))) = ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
apply (subst times_ereal.simps(1)[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a))) = ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a)) * ereal (deltaG TYPE('a))
[PROOF STEP]
apply (subst ereal_distrib_minus_left, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (- (epsilonG TYPE('a) * deltaG TYPE('a))) = ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
apply (subst uminus_ereal.simps(1)[symmetric])+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ereal (epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - - ereal (epsilonG TYPE('a) * deltaG TYPE('a)) = - ereal (epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
apply (subst ereal_minus(6))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ereal (epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a)) = - ereal (epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a)))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a)))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>Use multiplicativity of exponential to extract the multiplicative error factor.\<close>
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a)))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a)))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) - ereal (deltaG TYPE('a)))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a)))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = eexp(- epsilonG TYPE('a) * (min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)))
                    * eexp(epsilonG(TYPE('a))* deltaG(TYPE('a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a)))
[PROOF STEP]
by (rule eexp_add_mult, auto)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a)))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>Extract the min outside of the exponential, using that all functions are monotonic.\<close>
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a)))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a)))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = eexp(epsilonG(TYPE('a))* deltaG(TYPE('a)))
                    * (max (eexp(- epsilonG TYPE('a) * extended_Gromov_product_at basepoint x y))
                            (eexp(- epsilonG TYPE('a) * extended_Gromov_product_at basepoint y z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
apply (subst max_of_antimono[of "\<lambda> (t::ereal). -epsilonG TYPE('a) * t", symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. antimono ((*) (ereal (- epsilonG TYPE('a))))
 2. eexp (max (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
apply (metis antimonoI constant_in_extended_predist_pos(2) enn2ereal_ennreal enn2ereal_nonneg ereal_minus_le_minus ereal_mult_left_mono ereal_mult_minus_left uminus_ereal.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (max (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
apply (subst max_of_mono[OF eexp_mono])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (max (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * eexp (max (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
apply (simp add: mult.commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>We recognize the distance of $x$ to $y$ and the distance from $y$ to $z$ on the right.\<close>
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * min (extended_Gromov_product_at basepoint x y) (extended_Gromov_product_at basepoint y z)) * eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = eexp(epsilonG(TYPE('a)) * deltaG(TYPE('a))) * (max (ereal (extended_predist x y)) (extended_predist y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
unfolding extended_predist_ereal min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)

goal (1 subgoal):
 1. eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)) = eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> esqrt 2 * max (ereal(extended_predist x y)) (ereal(extended_predist y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (ereal (extended_predist x y)) (ereal (extended_predist y z)) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
apply (intro mono_intros B)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
using extended_predist_nonneg[of x y]
[PROOF STATE]
proof (prove)
using this:
0 \<le> extended_predist x y

goal (1 subgoal):
 1. 0 \<le> max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
by (simp add: max_def)
[PROOF STATE]
proof (state)
this:
eexp (ereal (epsilonG TYPE('a) * deltaG TYPE('a))) * max (ereal (extended_predist x y)) (ereal (extended_predist y z)) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (3 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 3. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (1 subgoal):
 1. ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
unfolding extended_predist_ereal min_def
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> esqrt 2 * max (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))

goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) then esqrt (extended_Gromov_distance x z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)) \<le> ereal (sqrt 2) * max (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)) (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>Next consider the case where $d(x,y)$ comes from the exponential of minus the Gromov product,
    but $d(y,z)$ comes from their extended distance. Then $d(y,z) \leq 1$ (as $d(y,z)$ is smaller
    then the exponential of minus the Gromov distance, which is at most $1$), and this is all we use:
    the Gromov product between $x$ and $y$ or $x$ and $z$ differ by at most the distance from $y$ to $z$,
    i.e., $1$. Then the result follows directly as $\exp(\epsilon) \leq \sqrt{2}$, by the choice of
    $\epsilon$.\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
assume H: "eexp (- epsilonG TYPE('a) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)"
              "esqrt (extended_Gromov_distance y z) \<le> eexp (- epsilonG TYPE('a) * extended_Gromov_product_at basepoint y z)"
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)
esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)
esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)
[PROOF STEP]
have "esqrt(extended_Gromov_distance y z) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)
esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance y z) \<le> 1
[PROOF STEP]
by (auto intro!: order_trans[OF H(2)] simp add: ereal_mult_le_0_iff)
[PROOF STATE]
proof (state)
this:
esqrt (extended_Gromov_distance y z) \<le> 1

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
esqrt (extended_Gromov_distance y z) \<le> 1
[PROOF STEP]
have "extended_Gromov_distance y z \<le> 1"
[PROOF STATE]
proof (prove)
using this:
esqrt (extended_Gromov_distance y z) \<le> 1

goal (1 subgoal):
 1. extended_Gromov_distance y z \<le> 1
[PROOF STEP]
by (metis eq_iff esqrt_mono2 esqrt_simps(2) esqrt_square extended_Gromov_distance_nonneg le_cases zero_less_one_ereal)
[PROOF STATE]
proof (state)
this:
extended_Gromov_distance y z \<le> 1

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "ereal(extended_predist x z) \<le> eexp(- epsilonG TYPE('a) * extended_Gromov_product_at basepoint x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (extended_predist x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)
[PROOF STEP]
unfolding extended_predist_ereal min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) then esqrt (extended_Gromov_distance x z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> eexp(- epsilonG TYPE('a) * extended_Gromov_product_at basepoint x y
                          + epsilonG TYPE('a) * extended_Gromov_distance y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z \<le> ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z
[PROOF STEP]
apply (subst uminus_ereal.simps(1)[symmetric])+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z \<le> - ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z
[PROOF STEP]
apply (subst ereal_mult_minus_left)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> - (ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y \<le> ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z
[PROOF STEP]
using extended_Gromov_product_at_diff3[of basepoint x y z]
[PROOF STATE]
proof (prove)
using this:
extended_Gromov_product_at basepoint x y \<le> extended_Gromov_product_at basepoint x z + extended_Gromov_distance y z

goal (1 subgoal):
 1. ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y \<le> ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z
[PROOF STEP]
by (meson constant_in_extended_predist_pos(2) ereal_le_distrib ereal_mult_left_mono order_trans zero_le_ereal)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> eexp(-epsilonG TYPE('a) * extended_Gromov_product_at basepoint x y + ereal(epsilonG TYPE('a)) * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * 1)
[PROOF STEP]
by (intro mono_intros, fact)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * 1)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * 1)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = eexp(-epsilonG TYPE('a) * extended_Gromov_product_at basepoint x y) * eexp(ereal(epsilonG TYPE('a)) * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * 1) = eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * eexp (ereal (epsilonG TYPE('a)) * 1)
[PROOF STEP]
by (rule eexp_add_mult, auto)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * 1) = eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * eexp (ereal (epsilonG TYPE('a)) * 1)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y + ereal (epsilonG TYPE('a)) * 1) = eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * eexp (ereal (epsilonG TYPE('a)) * 1)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> eexp(-epsilonG TYPE('a) * extended_Gromov_product_at basepoint x y) * esqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * eexp (ereal (epsilonG TYPE('a)) * 1) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2
[PROOF STEP]
by (intro mono_intros A)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * eexp (ereal (epsilonG TYPE('a)) * 1) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * eexp (ereal (epsilonG TYPE('a)) * 1) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = esqrt 2 * ereal(extended_predist x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2 = esqrt 2 * ereal (extended_predist x y)
[PROOF STEP]
unfolding extended_predist_ereal min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2 = esqrt 2 * (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y)
esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)

goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2 = esqrt 2 * (if esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) then esqrt (extended_Gromov_distance x y) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
by (auto simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2 = esqrt 2 * ereal (extended_predist x y)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) * esqrt 2 = esqrt 2 * ereal (extended_predist x y)

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> esqrt 2 * max (ereal(extended_predist x y)) (ereal(extended_predist y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt 2 * ereal (extended_predist x y) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
unfolding max_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt 2 * ereal (extended_predist x y) \<le> esqrt 2 * (if ereal (extended_predist x y) \<le> ereal (extended_predist y z) then ereal (extended_predist y z) else ereal (extended_predist x y))
[PROOF STEP]
by (auto intro!: mono_intros)
[PROOF STATE]
proof (state)
this:
esqrt 2 * ereal (extended_predist x y) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (2 subgoals):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
 2. \<lbrakk>eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> esqrt (extended_Gromov_distance x y); esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal (extended_predist x z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ereal (extended_predist x z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (1 subgoal):
 1. ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
text \<open>The last case is the symmetric of the previous one, and is proved similarly.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
assume H: "eexp (- epsilonG TYPE('a) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)"
              "esqrt (extended_Gromov_distance x y) \<le> eexp (- epsilonG TYPE('a) * extended_Gromov_product_at basepoint x y)"
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)
esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)
esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)
[PROOF STEP]
have "esqrt(extended_Gromov_distance x y) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)
esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 1
[PROOF STEP]
by (auto intro!: order_trans[OF H(2)] simp add: ereal_mult_le_0_iff)
[PROOF STATE]
proof (state)
this:
esqrt (extended_Gromov_distance x y) \<le> 1

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
esqrt (extended_Gromov_distance x y) \<le> 1
[PROOF STEP]
have "extended_Gromov_distance x y \<le> 1"
[PROOF STATE]
proof (prove)
using this:
esqrt (extended_Gromov_distance x y) \<le> 1

goal (1 subgoal):
 1. extended_Gromov_distance x y \<le> 1
[PROOF STEP]
by (metis eq_iff esqrt_mono2 esqrt_simps(2) esqrt_square extended_Gromov_distance_nonneg le_cases zero_less_one_ereal)
[PROOF STATE]
proof (state)
this:
extended_Gromov_distance x y \<le> 1

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "ereal(extended_predist x z) \<le> eexp(- epsilonG TYPE('a) * extended_Gromov_product_at basepoint x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (extended_predist x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)
[PROOF STEP]
unfolding extended_predist_ereal min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if esqrt (extended_Gromov_distance x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) then esqrt (extended_Gromov_distance x z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> eexp(- epsilonG TYPE('a) * extended_Gromov_product_at basepoint y z
                          + epsilonG TYPE('a) * extended_Gromov_distance x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y)
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z \<le> ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y
[PROOF STEP]
apply (subst uminus_ereal.simps(1)[symmetric])+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z \<le> - ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y
[PROOF STEP]
apply (subst ereal_mult_minus_left)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> - (ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z \<le> ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y
[PROOF STEP]
using extended_Gromov_product_at_diff3[of basepoint z y x]
[PROOF STATE]
proof (prove)
using this:
extended_Gromov_product_at basepoint z y \<le> extended_Gromov_product_at basepoint z x + extended_Gromov_distance y x

goal (1 subgoal):
 1. ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z \<le> ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y
[PROOF STEP]
apply (simp add: extended_Gromov_product_at_commute extended_Gromov_distance_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extended_Gromov_product_at basepoint y z \<le> extended_Gromov_product_at basepoint x z + extended_Gromov_distance x y \<Longrightarrow> ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z \<le> ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y
[PROOF STEP]
by (meson constant_in_extended_predist_pos(2) ereal_le_distrib ereal_mult_left_mono order_trans zero_le_ereal)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> eexp(-epsilonG TYPE('a) * extended_Gromov_product_at basepoint y z + ereal(epsilonG TYPE('a)) * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * 1)
[PROOF STEP]
by (intro mono_intros, fact)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * 1)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * 1)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = eexp(-epsilonG TYPE('a) * extended_Gromov_product_at basepoint y z) * eexp(ereal(epsilonG TYPE('a)) * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * 1) = eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * eexp (ereal (epsilonG TYPE('a)) * 1)
[PROOF STEP]
by (rule eexp_add_mult, auto)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * 1) = eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * eexp (ereal (epsilonG TYPE('a)) * 1)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z + ereal (epsilonG TYPE('a)) * 1) = eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * eexp (ereal (epsilonG TYPE('a)) * 1)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> eexp(-epsilonG TYPE('a) * extended_Gromov_product_at basepoint y z) * esqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * eexp (ereal (epsilonG TYPE('a)) * 1) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2
[PROOF STEP]
by (intro mono_intros A)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * eexp (ereal (epsilonG TYPE('a)) * 1) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * eexp (ereal (epsilonG TYPE('a)) * 1) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... = esqrt 2 * ereal(extended_predist y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2 = esqrt 2 * ereal (extended_predist y z)
[PROOF STEP]
unfolding extended_predist_ereal min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2 = esqrt 2 * (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)
esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)

goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2 = esqrt 2 * (if esqrt (extended_Gromov_distance y z) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) then esqrt (extended_Gromov_distance y z) else eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z))
[PROOF STEP]
by (auto simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2 = esqrt 2 * ereal (extended_predist y z)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) * esqrt 2 = esqrt 2 * ereal (extended_predist y z)

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
have "... \<le> esqrt 2 * max (ereal(extended_predist x y)) (ereal(extended_predist y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt 2 * ereal (extended_predist y z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
unfolding max_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt 2 * ereal (extended_predist y z) \<le> esqrt 2 * (if ereal (extended_predist x y) \<le> ereal (extended_predist y z) then ereal (extended_predist y z) else ereal (extended_predist x y))
[PROOF STEP]
by (auto intro!: mono_intros)
[PROOF STATE]
proof (state)
this:
esqrt 2 * ereal (extended_predist y z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (1 subgoal):
 1. \<lbrakk>esqrt (extended_Gromov_distance x y) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y); eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint y z) \<le> esqrt (extended_Gromov_distance y z)\<rbrakk> \<Longrightarrow> ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal (extended_predist x z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ereal (extended_predist x z) \<le> esqrt 2 * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (1 subgoal):
 1. ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))
[PROOF STEP]
show "extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)"
[PROOF STATE]
proof (prove)
using this:
ereal (extended_predist x z) \<le> ereal (sqrt 2) * max (ereal (extended_predist x y)) (ereal (extended_predist y z))

goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
unfolding ereal_sqrt2[symmetric] max_of_mono[OF ereal_mono] times_ereal.simps(1)
[PROOF STATE]
proof (prove)
using this:
ereal (extended_predist x z) \<le> ereal (sqrt 2 * max (extended_predist x y) (extended_predist y z))

goal (1 subgoal):
 1. extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
extended_predist x z \<le> sqrt 2 * max (extended_predist x y) (extended_predist y z)

goal:
No subgoals!
[PROOF STEP]
qed