[STATEMENT]
lemma not_icard_Diff2_less: "\<exists>(A::nat set)x y. x \<in> A \<and> y \<in> A \<and> \<not> icard (A - {x} - {y}) < icard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A x y. x \<in> A \<and> y \<in> A \<and> \<not> icard (A - {x} - {y}) < icard A
[PROOF STEP]
by (rule_tac x="{0..}" in exI, simp)


[STATEMENT]
theorem (in prob_space) median_bound:
  fixes n :: nat
  fixes I :: "('b :: {linorder_topology, second_countable_topology}) set"
  assumes "interval I"
  assumes "\<alpha> > 0"
  assumes "\<epsilon> \<in> {0<..<1}"
  assumes "indep_vars (\<lambda>_. borel) X {0..<n}"
  assumes "n \<ge> - ln \<epsilon> / (2 * \<alpha>\<^sup>2)"
  assumes "\<And>i. i < n \<Longrightarrow> \<P>(\<omega> in M. X i \<omega> \<in> I) \<ge> 1/2+\<alpha>"
  shows "\<P>(\<omega> in M. median n (\<lambda>i. X i \<omega>) \<in> I) \<ge> 1-\<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
define Y :: "nat \<Rightarrow> 'a \<Rightarrow> real" where "Y = (\<lambda>i. indicator I \<circ> (X i))"
[PROOF STATE]
proof (state)
this:
Y = (\<lambda>i. indicat_real I \<circ> X i)

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
define t where "t = (\<Sum>i = 0..<n. expectation (Y i)) - n/2"
[PROOF STATE]
proof (state)
this:
t = (\<Sum>i = 0..<n. expectation (Y i)) - real n / 2

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "0 < -ln \<epsilon> / (2 * \<alpha>\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < - ln \<epsilon> / (2 * \<alpha>\<^sup>2)
[PROOF STEP]
apply (rule divide_pos_pos)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < - ln \<epsilon>
 2. 0 < 2 * \<alpha>\<^sup>2
[PROOF STEP]
apply (simp, subst ln_less_zero_iff)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < \<epsilon>
 2. \<epsilon> < 1
 3. 0 < 2 * \<alpha>\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
interval I
0 < \<alpha>
\<epsilon> \<in> {0<..<1}
indep_vars (\<lambda>_. borel) X {0..<n}
- ln \<epsilon> / (2 * \<alpha>\<^sup>2) \<le> real n
?i8 < n \<Longrightarrow> 1 / 2 + \<alpha> \<le> prob {\<omega> \<in> space M. X ?i8 \<omega> \<in> I}

goal (3 subgoals):
 1. 0 < \<epsilon>
 2. \<epsilon> < 1
 3. 0 < 2 * \<alpha>\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < - ln \<epsilon> / (2 * \<alpha>\<^sup>2)

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < - ln \<epsilon> / (2 * \<alpha>\<^sup>2)

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... \<le> real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ln \<epsilon> / (2 * \<alpha>\<^sup>2) \<le> real n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
interval I
0 < \<alpha>
\<epsilon> \<in> {0<..<1}
indep_vars (\<lambda>_. borel) X {0..<n}
- ln \<epsilon> / (2 * \<alpha>\<^sup>2) \<le> real n
?i8 < n \<Longrightarrow> 1 / 2 + \<alpha> \<le> prob {\<omega> \<in> space M. X ?i8 \<omega> \<in> I}

goal (1 subgoal):
 1. - ln \<epsilon> / (2 * \<alpha>\<^sup>2) \<le> real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- ln \<epsilon> / (2 * \<alpha>\<^sup>2) \<le> real n

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < real n
[PROOF STEP]
have "real n > 0"
[PROOF STATE]
proof (prove)
using this:
0 < real n

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

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
hence n_ge_1:"n \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < real n

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

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
hence n_ge_0:"n > 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

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

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have ind_comp: "\<And>i. indicator I \<circ> (X i) = indicator {\<omega>. X i \<omega> \<in> I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. indicator I \<circ> X i = indicator {\<omega>. X i \<omega> \<in> I}
[PROOF STEP]
by (rule ext, simp add:indicator_def comp_def)
[PROOF STATE]
proof (state)
this:
indicator I \<circ> X ?i8 = indicator {\<omega>. X ?i8 \<omega> \<in> I}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "\<alpha> * n \<le> (\<Sum> i =0..<n. 1/2 + \<alpha>) - n/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> * real n \<le> (\<Sum>i = 0..<n. 1 / 2 + \<alpha>) - real n / 2
[PROOF STEP]
by (simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
\<alpha> * real n \<le> (\<Sum>i = 0..<n. 1 / 2 + \<alpha>) - real n / 2

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<alpha> * real n \<le> (\<Sum>i = 0..<n. 1 / 2 + \<alpha>) - real n / 2

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... \<le> (\<Sum> i = 0..<n. expectation (Y i)) - n/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. 1 / 2 + \<alpha>) - real n / 2 \<le> (\<Sum>i = 0..<n. expectation (Y i)) - real n / 2
[PROOF STEP]
apply (rule diff_right_mono, rule sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n} \<Longrightarrow> 1 / 2 + \<alpha> \<le> expectation (Y i)
[PROOF STEP]
using assms(6)
[PROOF STATE]
proof (prove)
using this:
?i8 < n \<Longrightarrow> 1 / 2 + \<alpha> \<le> prob {\<omega> \<in> space M. X ?i8 \<omega> \<in> I}

goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n} \<Longrightarrow> 1 / 2 + \<alpha> \<le> expectation (Y i)
[PROOF STEP]
by (simp add:Y_def ind_comp Collect_conj_eq inf_commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. 1 / 2 + \<alpha>) - real n / 2 \<le> (\<Sum>i = 0..<n. expectation (Y i)) - real n / 2

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. 1 / 2 + \<alpha>) - real n / 2 \<le> (\<Sum>i = 0..<n. expectation (Y i)) - real n / 2

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... = t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. expectation (Y i)) - real n / 2 = t
[PROOF STEP]
by (simp add:t_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. expectation (Y i)) - real n / 2 = t

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<alpha> * real n \<le> t
[PROOF STEP]
have t_ge_a: "t \<ge> \<alpha> * n"
[PROOF STATE]
proof (prove)
using this:
\<alpha> * real n \<le> t

goal (1 subgoal):
 1. \<alpha> * real n \<le> t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> * real n \<le> t

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have d: "0 \<le> \<alpha> * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<alpha> * real n
[PROOF STEP]
apply (rule mult_nonneg_nonneg)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> \<alpha>
 2. 0 \<le> real n
[PROOF STEP]
using assms(2) n_ge_0
[PROOF STATE]
proof (prove)
using this:
0 < \<alpha>
0 < n

goal (2 subgoals):
 1. 0 \<le> \<alpha>
 2. 0 \<le> real n
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
0 \<le> \<alpha> * real n

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> \<alpha> * real n

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... \<le> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> * real n \<le> t
[PROOF STEP]
using t_ge_a
[PROOF STATE]
proof (prove)
using this:
\<alpha> * real n \<le> t

goal (1 subgoal):
 1. \<alpha> * real n \<le> t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> * real n \<le> t

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> t
[PROOF STEP]
have t_ge_0: "t \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> t

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

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have  "(\<alpha> * n)\<^sup>2 \<le> t\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<alpha> * real n)\<^sup>2 \<le> t\<^sup>2
[PROOF STEP]
using t_ge_a d power_mono
[PROOF STATE]
proof (prove)
using this:
\<alpha> * real n \<le> t
0 \<le> \<alpha> * real n
\<lbrakk>?a \<le> ?b; (0::?'a) \<le> ?a\<rbrakk> \<Longrightarrow> ?a ^ ?n \<le> ?b ^ ?n

goal (1 subgoal):
 1. (\<alpha> * real n)\<^sup>2 \<le> t\<^sup>2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<alpha> * real n)\<^sup>2 \<le> t\<^sup>2

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
hence t_ge_a_sq: "\<alpha>\<^sup>2 * real n * real n \<le> t\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(\<alpha> * real n)\<^sup>2 \<le> t\<^sup>2

goal (1 subgoal):
 1. \<alpha>\<^sup>2 * real n * real n \<le> t\<^sup>2
[PROOF STEP]
by (simp add:algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
\<alpha>\<^sup>2 * real n * real n \<le> t\<^sup>2

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have Y_indep: "indep_vars (\<lambda>_. borel) Y {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>_. borel) Y {0..<n}
[PROOF STEP]
apply (subst Y_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>_. borel) (\<lambda>i. indicat_real I \<circ> X i) {0..<n}
[PROOF STEP]
apply (rule indep_vars_compose[where M'="(\<lambda>_. borel)", OF assms(4)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n} \<Longrightarrow> indicat_real I \<in> borel_measurable borel
[PROOF STEP]
using interval_borel[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
I \<in> sets borel

goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n} \<Longrightarrow> indicat_real I \<in> borel_measurable borel
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
indep_vars (\<lambda>_. borel) Y {0..<n}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
hence b:"Hoeffding_ineq M {0..<n} Y (\<lambda>i. 0) (\<lambda>i. 1)"
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. borel) Y {0..<n}

goal (1 subgoal):
 1. Hoeffding_ineq M {0..<n} Y (\<lambda>i. 0) (\<lambda>i. 1)
[PROOF STEP]
apply (simp add:Hoeffding_ineq_def indep_interval_bounded_random_variables_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>_. borel) Y {0..<n} \<Longrightarrow> prob_space M \<and> indep_interval_bounded_random_variables_axioms M {0..<n} Y (\<lambda>i. 0) (\<lambda>i. 1)
[PROOF STEP]
by (simp add:prob_space_axioms indep_interval_bounded_random_variables_axioms_def Y_def Y_indep)
[PROOF STATE]
proof (state)
this:
Hoeffding_ineq M {0..<n} Y (\<lambda>i. 0) (\<lambda>i. 1)

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have c: "\<And>\<omega>. (\<Sum>i = 0..<n. Y i \<omega>) > n/2 \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
fix \<omega>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
assume "(\<Sum>i = 0..<n. Y i \<omega>) > n/2"
[PROOF STATE]
proof (state)
this:
real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)

goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
hence "n < 2 * card ({0..<n} \<inter> {i. X i \<omega> \<in> I})"
[PROOF STATE]
proof (prove)
using this:
real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)

goal (1 subgoal):
 1. n < 2 * card ({0..<n} \<inter> {i. X i \<omega> \<in> I})
[PROOF STEP]
by (simp add:Y_def indicator_def)
[PROOF STATE]
proof (state)
this:
n < 2 * card ({0..<n} \<inter> {i. X i \<omega> \<in> I})

goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n < 2 * card ({0..<n} \<inter> {i. X i \<omega> \<in> I})

goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
have "... = 2 * card {i. i < n \<and> X i \<omega> \<in> I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * card ({0..<n} \<inter> {i. X i \<omega> \<in> I}) = 2 * card {i. i < n \<and> X i \<omega> \<in> I}
[PROOF STEP]
apply (simp, rule arg_cong[where f="card"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<n} \<inter> {i. X i \<omega> \<in> I} = {i. i < n \<and> X i \<omega> \<in> I}
[PROOF STEP]
by (rule order_antisym, rule subsetI, simp, rule subsetI, simp)
[PROOF STATE]
proof (state)
this:
2 * card ({0..<n} \<inter> {i. X i \<omega> \<in> I}) = 2 * card {i. i < n \<and> X i \<omega> \<in> I}

goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n < 2 * card {i. i < n \<and> X i \<omega> \<in> I}
[PROOF STEP]
have "2 * card {i. i < n \<and> X i \<omega> \<in> I} > n"
[PROOF STATE]
proof (prove)
using this:
n < 2 * card {i. i < n \<and> X i \<omega> \<in> I}

goal (1 subgoal):
 1. n < 2 * card {i. i < n \<and> X i \<omega> \<in> I}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < 2 * card {i. i < n \<and> X i \<omega> \<in> I}

goal (1 subgoal):
 1. \<And>\<omega>. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>) \<Longrightarrow> median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
thus "median n (\<lambda>i. X i \<omega>) \<in> I"
[PROOF STATE]
proof (prove)
using this:
n < 2 * card {i. i < n \<and> X i \<omega> \<in> I}

goal (1 subgoal):
 1. median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
using median_est[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
n < 2 * card {i. i < n \<and> X i \<omega> \<in> I}
?n < 2 * card {k. k < ?n \<and> ?f k \<in> I} \<Longrightarrow> median ?n ?f \<in> I

goal (1 subgoal):
 1. median n (\<lambda>i. X i \<omega>) \<in> I
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
median n (\<lambda>i. X i \<omega>) \<in> I

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real n / 2 < (\<Sum>i = 0..<n. Y i ?\<omega>9) \<Longrightarrow> median n (\<lambda>i. X i ?\<omega>9) \<in> I

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "1 - \<epsilon> \<le> 1- exp (- (2 * \<alpha>\<^sup>2 * real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - \<epsilon> \<le> 1 - exp (- (2 * \<alpha>\<^sup>2 * real n))
[PROOF STEP]
apply (simp, subst ln_ge_iff[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < \<epsilon>
 2. - (2 * \<alpha>\<^sup>2 * real n) \<le> ln \<epsilon>
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
\<epsilon> \<in> {0<..<1}

goal (2 subgoals):
 1. 0 < \<epsilon>
 2. - (2 * \<alpha>\<^sup>2 * real n) \<le> ln \<epsilon>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (2 * \<alpha>\<^sup>2 * real n) \<le> ln \<epsilon>
[PROOF STEP]
using assms(5)
[PROOF STATE]
proof (prove)
using this:
- ln \<epsilon> / (2 * \<alpha>\<^sup>2) \<le> real n

goal (1 subgoal):
 1. - (2 * \<alpha>\<^sup>2 * real n) \<le> ln \<epsilon>
[PROOF STEP]
apply (subst (asm) pos_divide_le_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < 2 * \<alpha>\<^sup>2
 2. - ln \<epsilon> \<le> real n * (2 * \<alpha>\<^sup>2) \<Longrightarrow> - (2 * \<alpha>\<^sup>2 * real n) \<le> ln \<epsilon>
[PROOF STEP]
apply (simp add: assms(2) power2_eq_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ln \<epsilon> \<le> real n * (2 * \<alpha>\<^sup>2) \<Longrightarrow> - (2 * \<alpha>\<^sup>2 * real n) \<le> ln \<epsilon>
[PROOF STEP]
by (simp add: mult_of_nat_commute)
[PROOF STATE]
proof (state)
this:
1 - \<epsilon> \<le> 1 - exp (- (2 * \<alpha>\<^sup>2 * real n))

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 - \<epsilon> \<le> 1 - exp (- (2 * \<alpha>\<^sup>2 * real n))

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... \<le> 1- exp (- (2 * t\<^sup>2 / real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - exp (- (2 * \<alpha>\<^sup>2 * real n)) \<le> 1 - exp (- (2 * t\<^sup>2 / real n))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * \<alpha>\<^sup>2 * real n \<le> 2 * t\<^sup>2 / real n
[PROOF STEP]
apply (subst pos_le_divide_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < real n
 2. 2 * \<alpha>\<^sup>2 * real n * real n \<le> 2 * t\<^sup>2
[PROOF STEP]
using n_ge_0
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (2 subgoals):
 1. 0 < real n
 2. 2 * \<alpha>\<^sup>2 * real n * real n \<le> 2 * t\<^sup>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * \<alpha>\<^sup>2 * real n * real n \<le> 2 * t\<^sup>2
[PROOF STEP]
using t_ge_a_sq
[PROOF STATE]
proof (prove)
using this:
\<alpha>\<^sup>2 * real n * real n \<le> t\<^sup>2

goal (1 subgoal):
 1. 2 * \<alpha>\<^sup>2 * real n * real n \<le> 2 * t\<^sup>2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 - exp (- (2 * \<alpha>\<^sup>2 * real n)) \<le> 1 - exp (- (2 * t\<^sup>2 / real n))

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 - exp (- (2 * \<alpha>\<^sup>2 * real n)) \<le> 1 - exp (- (2 * t\<^sup>2 / real n))

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... \<le> 1 - \<P>(\<omega> in M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> n/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - exp (- (2 * t\<^sup>2 / real n)) \<le> 1 - prob {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}
[PROOF STEP]
using Hoeffding_ineq.Hoeffding_ineq_le[OF b, where \<epsilon>="t", simplified] n_ge_0 t_ge_0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> t; 0 < n\<rbrakk> \<Longrightarrow> prob {x \<in> space M. (\<Sum>i = 0..<n. Y i x) \<le> (\<Sum>i = 0..<n. expectation (Y i)) - t} \<le> exp (- (2 * t\<^sup>2 / real n))
0 < n
0 \<le> t

goal (1 subgoal):
 1. 1 - exp (- (2 * t\<^sup>2 / real n)) \<le> 1 - prob {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}
[PROOF STEP]
by (simp add:t_def)
[PROOF STATE]
proof (state)
this:
1 - exp (- (2 * t\<^sup>2 / real n)) \<le> 1 - prob {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 - exp (- (2 * t\<^sup>2 / real n)) \<le> 1 - prob {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... = \<P>(\<omega> in M. (\<Sum>i = 0..<n. Y i \<omega>) > n/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - prob {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2} = prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}
[PROOF STEP]
apply (subst prob_compl[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2} \<in> events
 2. prob (space M - {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}) = prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}
[PROOF STEP]
apply measurable
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i \<in> {0..<n} \<Longrightarrow> random_variable borel (Y i)
 2. prob (space M - {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}) = prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}
[PROOF STEP]
using Y_indep
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. borel) Y {0..<n}

goal (2 subgoals):
 1. \<And>i. i \<in> {0..<n} \<Longrightarrow> random_variable borel (Y i)
 2. prob (space M - {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}) = prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}
[PROOF STEP]
apply (simp add:indep_vars_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (space M - {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2}) = prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}
[PROOF STEP]
apply (rule arg_cong2[where f="measure"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space M - {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2} = {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}
[PROOF STEP]
by (rule order_antisym, rule subsetI, simp add:not_le, rule subsetI, simp add:not_le)
[PROOF STATE]
proof (state)
this:
1 - prob {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2} = prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 - prob {\<omega> \<in> space M. (\<Sum>i = 0..<n. Y i \<omega>) \<le> real n / 2} = prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
have "... \<le> \<P>(\<omega> in M. median n (\<lambda>i. X i \<omega>) \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)} \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
apply (rule finite_measure_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)} \<subseteq> {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
 2. {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I} \<in> events
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)} \<Longrightarrow> x \<in> {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
 2. {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I} \<in> events
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
real n / 2 < (\<Sum>i = 0..<n. Y i ?\<omega>9) \<Longrightarrow> median n (\<lambda>i. X i ?\<omega>9) \<in> I

goal (2 subgoals):
 1. \<And>x. x \<in> {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)} \<Longrightarrow> x \<in> {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
 2. {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I} \<in> events
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I} \<in> events
[PROOF STEP]
using interval_borel[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
I \<in> sets borel

goal (1 subgoal):
 1. {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I} \<in> events
[PROOF STEP]
apply measurable
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_variable borel (\<lambda>x. median n (\<lambda>i. X i x))
[PROOF STEP]
apply (rule median_measurable[OF n_ge_1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> random_variable borel (X i)
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. borel) X {0..<n}

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> random_variable borel (X i)
[PROOF STEP]
by (simp add:indep_vars_def)
[PROOF STATE]
proof (state)
this:
prob {\<omega> \<in> space M. real n / 2 < (\<Sum>i = 0..<n. Y i \<omega>)} \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}

goal (1 subgoal):
 1. 1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 - \<epsilon> \<le> prob {\<omega> \<in> space M. median n (\<lambda>i. X i \<omega>) \<in> I}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma blaschke_preserve_distance_formula [simp]:
  assumes "of_complex k \<in> unit_disc" "u \<in> unit_disc" "v \<in> unit_disc"
  shows "poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) =
         poincare_distance_formula (to_complex u) (to_complex v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
proof (cases "k = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
 2. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
 2. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
k = 0

goal (1 subgoal):
 1. poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
obtain u' v' where *: "u' = to_complex u" "v' = to_complex v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u' v'. \<lbrakk>u' = to_complex u; v' = to_complex v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u' = to_complex u
v' = to_complex v

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "cmod u' < 1" "cmod v' < 1" "cmod k < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod u' < 1 &&& cmod v' < 1 &&& cmod k < 1
[PROOF STEP]
using assms *
[PROOF STATE]
proof (prove)
using this:
of_complex k \<in> unit_disc
u \<in> unit_disc
v \<in> unit_disc
u' = to_complex u
v' = to_complex v

goal (1 subgoal):
 1. cmod u' < 1 &&& cmod v' < 1 &&& cmod k < 1
[PROOF STEP]
using inf_or_of_complex[of u] inf_or_of_complex[of v]
[PROOF STATE]
proof (prove)
using this:
of_complex k \<in> unit_disc
u \<in> unit_disc
v \<in> unit_disc
u' = to_complex u
v' = to_complex v
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)

goal (1 subgoal):
 1. cmod u' < 1 &&& cmod v' < 1 &&& cmod k < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod u' < 1
cmod v' < 1
cmod k < 1

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
obtain nu du nv dv d kk ddu ddv where
    **: "nu = u' - k" "du = 1 - cnj k *u'" "nv = v' - k" "dv = 1 - cnj k * v'"
        "d = u' - v'" "ddu = 1 - u'*cnj u'" "ddv = 1 - v'*cnj v'" "kk = 1 - k*cnj k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>nu du nv dv d ddu ddv kk. \<lbrakk>nu = u' - k; du = 1 - cnj k * u'; nv = v' - k; dv = 1 - cnj k * v'; d = u' - v'; ddu = 1 - u' * cnj u'; ddv = 1 - v' * cnj v'; kk = 1 - k * cnj k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
d = u' - v'
ddu = 1 - u' * cnj u'
ddv = 1 - v' * cnj v'
kk = 1 - k * cnj k

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have d: "nu*dv - nv*du = d*kk"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nu * dv - nv * du = d * kk
[PROOF STEP]
by (subst **)+ (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
nu * dv - nv * du = d * kk

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have ddu: "du*cnj du - nu*cnj nu = ddu*kk"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. du * cnj du - nu * cnj nu = ddu * kk
[PROOF STEP]
by (subst **)+ (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
du * cnj du - nu * cnj nu = ddu * kk

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have ddv: "dv*cnj dv - nv*cnj nv = ddv*kk"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dv * cnj dv - nv * cnj nv = ddv * kk
[PROOF STEP]
by (subst **)+ (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
dv * cnj dv - nv * cnj nv = ddv * kk

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "du \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. du \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> du \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> du \<noteq> 0

goal (1 subgoal):
 1. \<not> du \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "cmod (1 - cnj k * u') = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> du \<noteq> 0

goal (1 subgoal):
 1. cmod (1 - cnj k * u') = 0
[PROOF STEP]
using \<open>du = 1 - cnj k * u'\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> du \<noteq> 0
du = 1 - cnj k * u'

goal (1 subgoal):
 1. cmod (1 - cnj k * u') = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (1 - cnj k * u') = 0

goal (1 subgoal):
 1. \<not> du \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "cmod (cnj k * u') = 1"
[PROOF STATE]
proof (prove)
using this:
cmod (1 - cnj k * u') = 0

goal (1 subgoal):
 1. cmod (cnj k * u') = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (cnj k * u') = 1

goal (1 subgoal):
 1. \<not> du \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
cmod (cnj k * u') = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>cmod k < 1\<close> \<open>cmod u' < 1\<close>
[PROOF STATE]
proof (prove)
using this:
cmod (cnj k * u') = 1
cmod k < 1
cmod u' < 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using mult_strict_mono[of "cmod k" 1 "cmod u'" 1]
[PROOF STATE]
proof (prove)
using this:
cmod (cnj k * u') = 1
cmod k < 1
cmod u' < 1
\<lbrakk>cmod k < 1; cmod u' < 1; 0 < 1; 0 \<le> cmod u'\<rbrakk> \<Longrightarrow> cmod k * cmod u' < 1 * 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
du \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "dv \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dv \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> dv \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> dv \<noteq> 0

goal (1 subgoal):
 1. \<not> dv \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "cmod (1 - cnj k * v') = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> dv \<noteq> 0

goal (1 subgoal):
 1. cmod (1 - cnj k * v') = 0
[PROOF STEP]
using \<open>dv = 1 - cnj k * v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> dv \<noteq> 0
dv = 1 - cnj k * v'

goal (1 subgoal):
 1. cmod (1 - cnj k * v') = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (1 - cnj k * v') = 0

goal (1 subgoal):
 1. \<not> dv \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "cmod (cnj k * v') = 1"
[PROOF STATE]
proof (prove)
using this:
cmod (1 - cnj k * v') = 0

goal (1 subgoal):
 1. cmod (cnj k * v') = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (cnj k * v') = 1

goal (1 subgoal):
 1. \<not> dv \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
cmod (cnj k * v') = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>cmod k < 1\<close> \<open>cmod v' < 1\<close>
[PROOF STATE]
proof (prove)
using this:
cmod (cnj k * v') = 1
cmod k < 1
cmod v' < 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using mult_strict_mono[of "cmod k" 1 "cmod v'" 1]
[PROOF STATE]
proof (prove)
using this:
cmod (cnj k * v') = 1
cmod k < 1
cmod v' < 1
\<lbrakk>cmod k < 1; cmod v' < 1; 0 < 1; 0 \<le> cmod v'\<rbrakk> \<Longrightarrow> cmod k * cmod v' < 1 * 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dv \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "kk \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kk \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> kk \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> kk \<noteq> 0

goal (1 subgoal):
 1. \<not> kk \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "cmod (1 - k * cnj k) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> kk \<noteq> 0

goal (1 subgoal):
 1. cmod (1 - k * cnj k) = 0
[PROOF STEP]
using \<open>kk = 1 - k * cnj k\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> kk \<noteq> 0
kk = 1 - k * cnj k

goal (1 subgoal):
 1. cmod (1 - k * cnj k) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (1 - k * cnj k) = 0

goal (1 subgoal):
 1. \<not> kk \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "cmod (k * cnj k) = 1"
[PROOF STATE]
proof (prove)
using this:
cmod (1 - k * cnj k) = 0

goal (1 subgoal):
 1. cmod (k * cnj k) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (k * cnj k) = 1

goal (1 subgoal):
 1. \<not> kk \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
cmod (k * cnj k) = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>cmod k < 1\<close>
[PROOF STATE]
proof (prove)
using this:
cmod (k * cnj k) = 1
cmod k < 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using mult_strict_mono[of "cmod k" 1 "cmod k" 1]
[PROOF STATE]
proof (prove)
using this:
cmod (k * cnj k) = 1
cmod k < 1
\<lbrakk>cmod k < 1; cmod k < 1; 0 < 1; 0 \<le> cmod k\<rbrakk> \<Longrightarrow> cmod k * cmod k < 1 * 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using complex_mod_sqrt_Re_mult_cnj
[PROOF STATE]
proof (prove)
using this:
cmod (k * cnj k) = 1
cmod k < 1
\<lbrakk>cmod k < 1; cmod k < 1; 0 < 1; 0 \<le> cmod k\<rbrakk> \<Longrightarrow> cmod k * cmod k < 1 * 1
cmod ?z = sqrt (Re (?z * cnj ?z))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
kk \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
note nz = \<open>du \<noteq> 0\<close> \<open>dv \<noteq> 0\<close> \<open>kk \<noteq> 0\<close>
[PROOF STATE]
proof (state)
this:
du \<noteq> 0
dv \<noteq> 0
kk \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "nu / du - nv / dv = (nu*dv - nv*du) / (du * dv)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nu / du - nv / dv = (nu * dv - nv * du) / (du * dv)
[PROOF STEP]
using nz
[PROOF STATE]
proof (prove)
using this:
du \<noteq> 0
dv \<noteq> 0
kk \<noteq> 0

goal (1 subgoal):
 1. nu / du - nv / dv = (nu * dv - nv * du) / (du * dv)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
nu / du - nv / dv = (nu * dv - nv * du) / (du * dv)

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
hence "(cmod (nu/du - nv/dv))\<^sup>2 = cmod ((d*kk) / (du*dv) * (cnj ((d*kk) / (du*dv))))" (is "?lhs = _")
[PROOF STATE]
proof (prove)
using this:
nu / du - nv / dv = (nu * dv - nv * du) / (du * dv)

goal (1 subgoal):
 1. (cmod (nu / du - nv / dv))\<^sup>2 = cmod (d * kk / (du * dv) * cnj (d * kk / (du * dv)))
[PROOF STEP]
unfolding complex_mod_mult_cnj[symmetric]
[PROOF STATE]
proof (prove)
using this:
nu / du - nv / dv = (nu * dv - nv * du) / (du * dv)

goal (1 subgoal):
 1. cmod ((nu / du - nv / dv) * cnj (nu / du - nv / dv)) = cmod (d * kk / (du * dv) * cnj (d * kk / (du * dv)))
[PROOF STEP]
by (subst (asm) d) simp
[PROOF STATE]
proof (state)
this:
(cmod (nu / du - nv / dv))\<^sup>2 = cmod (d * kk / (du * dv) * cnj (d * kk / (du * dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(cmod (nu / du - nv / dv))\<^sup>2 = cmod (d * kk / (du * dv) * cnj (d * kk / (du * dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "... = cmod ((d*cnj d*kk*kk) / (du*cnj du*dv*cnj dv))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (d * kk / (du * dv) * cnj (d * kk / (du * dv))) = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv))
[PROOF STEP]
by (simp add: field_simps norm_mult norm_divide)
[PROOF STATE]
proof (state)
this:
cmod (d * kk / (du * dv) * cnj (d * kk / (du * dv))) = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(cmod (nu / du - nv / dv))\<^sup>2 = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv))
[PROOF STEP]
have 1: "?lhs = cmod ((d*cnj d*kk*kk) / (du*cnj du*dv*cnj dv))"
[PROOF STATE]
proof (prove)
using this:
(cmod (nu / du - nv / dv))\<^sup>2 = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. (cmod (nu / du - nv / dv))\<^sup>2 = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(cmod (nu / du - nv / dv))\<^sup>2 = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "(1 - ((cmod nu) / (cmod du))\<^sup>2)*(1 - ((cmod nv) / (cmod dv))\<^sup>2) =
        (1 - cmod((nu * cnj nu) / (du * cnj du)))*(1 - cmod((nv * cnj nv) / (dv * cnj dv)))" (is "?rhs = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2) = (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv)))
[PROOF STEP]
by (metis norm_divide complex_mod_mult_cnj power_divide)
[PROOF STATE]
proof (state)
this:
(1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2) = (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2) = (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "... = cmod(((du*cnj du - nu*cnj nu) / (du * cnj du)) * ((dv*cnj dv - nv*cnj nv) / (dv * cnj dv)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
have "u' \<noteq> 1 / cnj k" "v' \<noteq> 1 / cnj k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u' \<noteq> 1 / cnj k &&& v' \<noteq> 1 / cnj k
[PROOF STEP]
using \<open>cmod u' < 1\<close> \<open>cmod v' < 1\<close> \<open>cmod k < 1\<close>
[PROOF STATE]
proof (prove)
using this:
cmod u' < 1
cmod v' < 1
cmod k < 1

goal (1 subgoal):
 1. u' \<noteq> 1 / cnj k &&& v' \<noteq> 1 / cnj k
[PROOF STEP]
by (auto simp add: False norm_divide)
[PROOF STATE]
proof (state)
this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
have "cmod k \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod k \<noteq> 1
[PROOF STEP]
using \<open>cmod k < 1\<close>
[PROOF STATE]
proof (prove)
using this:
cmod k < 1

goal (1 subgoal):
 1. cmod k \<noteq> 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
cmod k \<noteq> 1

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1
[PROOF STEP]
have "cmod (nu/du) < 1" "cmod (nv/dv) < 1"
[PROOF STATE]
proof (prove)
using this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1

goal (1 subgoal):
 1. cmod (nu / du) < 1 &&& cmod (nv / dv) < 1
[PROOF STEP]
using **(1-4)
[PROOF STATE]
proof (prove)
using this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'

goal (1 subgoal):
 1. cmod (nu / du) < 1 &&& cmod (nv / dv) < 1
[PROOF STEP]
using unit_disc_fix_discI[OF blaschke_unit_disc_fix[OF \<open>cmod k < 1\<close>] \<open>u \<in> unit_disc\<close>] \<open>u' = to_complex u\<close>
[PROOF STATE]
proof (prove)
using this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
moebius_pt (blaschke k) u \<in> unit_disc
u' = to_complex u

goal (1 subgoal):
 1. cmod (nu / du) < 1 &&& cmod (nv / dv) < 1
[PROOF STEP]
using unit_disc_fix_discI[OF blaschke_unit_disc_fix[OF \<open>cmod k < 1\<close>] \<open>v \<in> unit_disc\<close>] \<open>v' = to_complex v\<close>
[PROOF STATE]
proof (prove)
using this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
moebius_pt (blaschke k) u \<in> unit_disc
u' = to_complex u
moebius_pt (blaschke k) v \<in> unit_disc
v' = to_complex v

goal (1 subgoal):
 1. cmod (nu / du) < 1 &&& cmod (nv / dv) < 1
[PROOF STEP]
using inf_or_of_complex[of u] \<open>u \<in> unit_disc\<close> inf_or_of_complex[of v] \<open>v \<in> unit_disc\<close>
[PROOF STATE]
proof (prove)
using this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
moebius_pt (blaschke k) u \<in> unit_disc
u' = to_complex u
moebius_pt (blaschke k) v \<in> unit_disc
v' = to_complex v
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)
u \<in> unit_disc
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)
v \<in> unit_disc

goal (1 subgoal):
 1. cmod (nu / du) < 1 &&& cmod (nv / dv) < 1
[PROOF STEP]
using moebius_pt_blaschke[of k u']
[PROOF STATE]
proof (prove)
using this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
moebius_pt (blaschke k) u \<in> unit_disc
u' = to_complex u
moebius_pt (blaschke k) v \<in> unit_disc
v' = to_complex v
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)
u \<in> unit_disc
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)
v \<in> unit_disc
\<lbrakk>cmod k \<noteq> 1; u' \<noteq> 1 / cnj k\<rbrakk> \<Longrightarrow> moebius_pt (blaschke k) (of_complex u') = of_complex ((u' - k) / (1 - cnj k * u'))

goal (1 subgoal):
 1. cmod (nu / du) < 1 &&& cmod (nv / dv) < 1
[PROOF STEP]
using moebius_pt_blaschke[of k v']
[PROOF STATE]
proof (prove)
using this:
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
cmod k \<noteq> 1
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
moebius_pt (blaschke k) u \<in> unit_disc
u' = to_complex u
moebius_pt (blaschke k) v \<in> unit_disc
v' = to_complex v
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)
u \<in> unit_disc
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)
v \<in> unit_disc
\<lbrakk>cmod k \<noteq> 1; u' \<noteq> 1 / cnj k\<rbrakk> \<Longrightarrow> moebius_pt (blaschke k) (of_complex u') = of_complex ((u' - k) / (1 - cnj k * u'))
\<lbrakk>cmod k \<noteq> 1; v' \<noteq> 1 / cnj k\<rbrakk> \<Longrightarrow> moebius_pt (blaschke k) (of_complex v') = of_complex ((v' - k) / (1 - cnj k * v'))

goal (1 subgoal):
 1. cmod (nu / du) < 1 &&& cmod (nv / dv) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (nu / du) < 1
cmod (nv / dv) < 1

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
hence "(cmod (nu/du))\<^sup>2 < 1" "(cmod (nv/dv))\<^sup>2 < 1"
[PROOF STATE]
proof (prove)
using this:
cmod (nu / du) < 1
cmod (nv / dv) < 1

goal (1 subgoal):
 1. (cmod (nu / du))\<^sup>2 < 1 &&& (cmod (nv / dv))\<^sup>2 < 1
[PROOF STEP]
by (simp_all add: cmod_def)
[PROOF STATE]
proof (state)
this:
(cmod (nu / du))\<^sup>2 < 1
(cmod (nv / dv))\<^sup>2 < 1

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
hence "cmod (nu * cnj nu / (du * cnj du)) < 1"  "cmod (nv * cnj nv / (dv * cnj dv)) < 1"
[PROOF STATE]
proof (prove)
using this:
(cmod (nu / du))\<^sup>2 < 1
(cmod (nv / dv))\<^sup>2 < 1

goal (1 subgoal):
 1. cmod (nu * cnj nu / (du * cnj du)) < 1 &&& cmod (nv * cnj nv / (dv * cnj dv)) < 1
[PROOF STEP]
by (metis complex_mod_mult_cnj norm_divide power_divide)+
[PROOF STATE]
proof (state)
this:
cmod (nu * cnj nu / (du * cnj du)) < 1
cmod (nv * cnj nv / (dv * cnj dv)) < 1

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cmod (nu * cnj nu / (du * cnj du)) < 1
cmod (nv * cnj nv / (dv * cnj dv)) < 1

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
have "is_real (nu * cnj nu / (du * cnj du))" "is_real (nv * cnj nv / (dv * cnj dv))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (nu * cnj nu / (du * cnj du)) &&& is_real (nv * cnj nv / (dv * cnj dv))
[PROOF STEP]
using eq_cnj_iff_real[of "nu * cnj nu / (du * cnj du)"]
[PROOF STATE]
proof (prove)
using this:
(cnj (nu * cnj nu / (du * cnj du)) = nu * cnj nu / (du * cnj du)) = is_real (nu * cnj nu / (du * cnj du))

goal (1 subgoal):
 1. is_real (nu * cnj nu / (du * cnj du)) &&& is_real (nv * cnj nv / (dv * cnj dv))
[PROOF STEP]
using eq_cnj_iff_real[of "nv * cnj nv / (dv * cnj dv)"]
[PROOF STATE]
proof (prove)
using this:
(cnj (nu * cnj nu / (du * cnj du)) = nu * cnj nu / (du * cnj du)) = is_real (nu * cnj nu / (du * cnj du))
(cnj (nv * cnj nv / (dv * cnj dv)) = nv * cnj nv / (dv * cnj dv)) = is_real (nv * cnj nv / (dv * cnj dv))

goal (1 subgoal):
 1. is_real (nu * cnj nu / (du * cnj du)) &&& is_real (nv * cnj nv / (dv * cnj dv))
[PROOF STEP]
by (auto simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
is_real (nu * cnj nu / (du * cnj du))
is_real (nv * cnj nv / (dv * cnj dv))

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_real (nu * cnj nu / (du * cnj du))
is_real (nv * cnj nv / (dv * cnj dv))

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
have "Re (nu * cnj nu / (du * cnj du)) \<ge> 0"  "Re (nv * cnj nv / (dv * cnj dv)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Re (nu * cnj nu / (du * cnj du)) &&& 0 \<le> Re (nv * cnj nv / (dv * cnj dv))
[PROOF STEP]
using \<open>du \<noteq> 0\<close> \<open>dv \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
du \<noteq> 0
dv \<noteq> 0

goal (1 subgoal):
 1. 0 \<le> Re (nu * cnj nu / (du * cnj du)) &&& 0 \<le> Re (nv * cnj nv / (dv * cnj dv))
[PROOF STEP]
unfolding complex_mult_cnj_cmod
[PROOF STATE]
proof (prove)
using this:
du \<noteq> 0
dv \<noteq> 0

goal (1 subgoal):
 1. 0 \<le> Re (cor ((cmod nu)\<^sup>2) / cor ((cmod du)\<^sup>2)) &&& 0 \<le> Re (cor ((cmod nv)\<^sup>2) / cor ((cmod dv)\<^sup>2))
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 \<le> Re (nu * cnj nu / (du * cnj du))
0 \<le> Re (nv * cnj nv / (dv * cnj dv))

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cmod (nu * cnj nu / (du * cnj du)) < 1
cmod (nv * cnj nv / (dv * cnj dv)) < 1
is_real (nu * cnj nu / (du * cnj du))
is_real (nv * cnj nv / (dv * cnj dv))
0 \<le> Re (nu * cnj nu / (du * cnj du))
0 \<le> Re (nv * cnj nv / (dv * cnj dv))
[PROOF STEP]
have "1 - cmod (nu * cnj nu / (du * cnj du)) = cmod (1 - nu * cnj nu / (du * cnj du))"
         "1 - cmod (nv * cnj nv / (dv * cnj dv)) = cmod (1 - nv * cnj nv / (dv * cnj dv))"
[PROOF STATE]
proof (prove)
using this:
cmod (nu * cnj nu / (du * cnj du)) < 1
cmod (nv * cnj nv / (dv * cnj dv)) < 1
is_real (nu * cnj nu / (du * cnj du))
is_real (nv * cnj nv / (dv * cnj dv))
0 \<le> Re (nu * cnj nu / (du * cnj du))
0 \<le> Re (nv * cnj nv / (dv * cnj dv))

goal (1 subgoal):
 1. 1 - cmod (nu * cnj nu / (du * cnj du)) = cmod (1 - nu * cnj nu / (du * cnj du)) &&& 1 - cmod (nv * cnj nv / (dv * cnj dv)) = cmod (1 - nv * cnj nv / (dv * cnj dv))
[PROOF STEP]
by (simp_all add: cmod_def)
[PROOF STATE]
proof (state)
this:
1 - cmod (nu * cnj nu / (du * cnj du)) = cmod (1 - nu * cnj nu / (du * cnj du))
1 - cmod (nv * cnj nv / (dv * cnj dv)) = cmod (1 - nv * cnj nv / (dv * cnj dv))

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1 - cmod (nu * cnj nu / (du * cnj du)) = cmod (1 - nu * cnj nu / (du * cnj du))
1 - cmod (nv * cnj nv / (dv * cnj dv)) = cmod (1 - nv * cnj nv / (dv * cnj dv))

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
using nz
[PROOF STATE]
proof (prove)
using this:
1 - cmod (nu * cnj nu / (du * cnj du)) = cmod (1 - nu * cnj nu / (du * cnj du))
1 - cmod (nv * cnj nv / (dv * cnj dv)) = cmod (1 - nv * cnj nv / (dv * cnj dv))
du \<noteq> 0
dv \<noteq> 0
kk \<noteq> 0

goal (1 subgoal):
 1. (1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))
[PROOF STEP]
by (simp add: diff_divide_distrib norm_mult)
[PROOF STATE]
proof (state)
this:
(1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - cmod (nu * cnj nu / (du * cnj du))) * (1 - cmod (nv * cnj nv / (dv * cnj dv))) = cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "... = cmod(((ddu * kk) / (du * cnj du)) * ((ddv * kk) / (dv * cnj dv)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv))) = cmod (ddu * kk / (du * cnj du) * (ddv * kk / (dv * cnj dv)))
[PROOF STEP]
by (subst ddu, subst ddv, simp)
[PROOF STATE]
proof (state)
this:
cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv))) = cmod (ddu * kk / (du * cnj du) * (ddv * kk / (dv * cnj dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod ((du * cnj du - nu * cnj nu) / (du * cnj du) * ((dv * cnj dv - nv * cnj nv) / (dv * cnj dv))) = cmod (ddu * kk / (du * cnj du) * (ddv * kk / (dv * cnj dv)))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "... = cmod((ddu*ddv*kk*kk) / (du*cnj du*dv*cnj dv))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (ddu * kk / (du * cnj du) * (ddv * kk / (dv * cnj dv))) = cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
cmod (ddu * kk / (du * cnj du) * (ddv * kk / (dv * cnj dv))) = cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2) = cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))
[PROOF STEP]
have 2: "?rhs = cmod((ddu*ddv*kk*kk) / (du*cnj du*dv*cnj dv))"
[PROOF STATE]
proof (prove)
using this:
(1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2) = cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. (1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2) = cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2) = cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "?lhs / ?rhs =
       cmod ((d*cnj d*kk*kk) / (du*cnj du*dv*cnj dv)) / cmod((ddu*ddv*kk*kk) / (du*cnj du*dv*cnj dv))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv)) / cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))
[PROOF STEP]
by (subst 1, subst 2, simp)
[PROOF STATE]
proof (state)
this:
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv)) / cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv)) / cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "... = cmod ((d*cnj d)/(ddu*ddv))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv)) / cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv)) = cmod (d * cnj d / (ddu * ddv))
[PROOF STEP]
using nz
[PROOF STATE]
proof (prove)
using this:
du \<noteq> 0
dv \<noteq> 0
kk \<noteq> 0

goal (1 subgoal):
 1. cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv)) / cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv)) = cmod (d * cnj d / (ddu * ddv))
[PROOF STEP]
by (simp add: norm_mult norm_divide)
[PROOF STATE]
proof (state)
this:
cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv)) / cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv)) = cmod (d * cnj d / (ddu * ddv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (d * cnj d * kk * kk / (du * cnj du * dv * cnj dv)) / cmod (ddu * ddv * kk * kk / (du * cnj du * dv * cnj dv)) = cmod (d * cnj d / (ddu * ddv))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "... = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2)*(1 - (cmod v')\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
have "(cmod u')\<^sup>2 < 1" "(cmod v')\<^sup>2 < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod u')\<^sup>2 < 1 &&& (cmod v')\<^sup>2 < 1
[PROOF STEP]
using \<open>cmod u' < 1\<close> \<open>cmod v' < 1\<close>
[PROOF STATE]
proof (prove)
using this:
cmod u' < 1
cmod v' < 1

goal (1 subgoal):
 1. (cmod u')\<^sup>2 < 1 &&& (cmod v')\<^sup>2 < 1
[PROOF STEP]
by (simp_all add: cmod_def)
[PROOF STATE]
proof (state)
this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
hence "cmod (1 - u' * cnj u') = 1 - (cmod u')\<^sup>2" "cmod (1 - v' * cnj v') = 1 - (cmod v')\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. cmod (1 - u' * cnj u') = 1 - (cmod u')\<^sup>2 &&& cmod (1 - v' * cnj v') = 1 - (cmod v')\<^sup>2
[PROOF STEP]
by (auto simp add: cmod_eq_Re cmod_power2 power2_eq_square[symmetric])
[PROOF STATE]
proof (state)
this:
cmod (1 - u' * cnj u') = 1 - (cmod u')\<^sup>2
cmod (1 - v' * cnj v') = 1 - (cmod v')\<^sup>2

goal (1 subgoal):
 1. cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (1 - u' * cnj u') = 1 - (cmod u')\<^sup>2
cmod (1 - v' * cnj v') = 1 - (cmod v')\<^sup>2

goal (1 subgoal):
 1. cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using nz
[PROOF STATE]
proof (prove)
using this:
cmod (1 - u' * cnj u') = 1 - (cmod u')\<^sup>2
cmod (1 - v' * cnj v') = 1 - (cmod v')\<^sup>2
du \<noteq> 0
dv \<noteq> 0
kk \<noteq> 0

goal (1 subgoal):
 1. cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
by (simp add: "**"(6) "**"(7) norm_divide norm_mult power2_eq_square)
[PROOF STATE]
proof (state)
this:
cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmod (d * cnj d / (ddu * ddv)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
have 3: "?lhs / ?rhs = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2)*(1 - (cmod v')\<^sup>2))"
[PROOF STATE]
proof (prove)
using this:
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. (cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
have "cmod k \<noteq> 1" "u' \<noteq> 1 / cnj k" "v' \<noteq> 1 / cnj k" "u \<noteq> \<infinity>\<^sub>h" "v \<noteq> \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod k \<noteq> 1 &&& u' \<noteq> 1 / cnj k) &&& v' \<noteq> 1 / cnj k &&& u \<noteq> \<infinity>\<^sub>h &&& v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
using \<open>cmod k < 1\<close> \<open>u \<in> unit_disc\<close> \<open>v \<in> unit_disc\<close> * \<open>k \<noteq> 0\<close> ** \<open>kk \<noteq> 0\<close> nz
[PROOF STATE]
proof (prove)
using this:
cmod k < 1
u \<in> unit_disc
v \<in> unit_disc
u' = to_complex u
v' = to_complex v
k \<noteq> 0
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
d = u' - v'
ddu = 1 - u' * cnj u'
ddv = 1 - v' * cnj v'
kk = 1 - k * cnj k
kk \<noteq> 0
du \<noteq> 0
dv \<noteq> 0
kk \<noteq> 0

goal (1 subgoal):
 1. (cmod k \<noteq> 1 &&& u' \<noteq> 1 / cnj k) &&& v' \<noteq> 1 / cnj k &&& u \<noteq> \<infinity>\<^sub>h &&& v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod k \<noteq> 1
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
u \<noteq> \<infinity>\<^sub>h
v \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod k \<noteq> 1
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
u \<noteq> \<infinity>\<^sub>h
v \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod k \<noteq> 1
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
u \<noteq> \<infinity>\<^sub>h
v \<noteq> \<infinity>\<^sub>h
of_complex k \<in> unit_disc
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
using * ** 3
[PROOF STATE]
proof (prove)
using this:
cmod k \<noteq> 1
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
u \<noteq> \<infinity>\<^sub>h
v \<noteq> \<infinity>\<^sub>h
of_complex k \<in> unit_disc
u \<in> unit_disc
v \<in> unit_disc
u' = to_complex u
v' = to_complex v
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
d = u' - v'
ddu = 1 - u' * cnj u'
ddv = 1 - v' * cnj v'
kk = 1 - k * cnj k
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
using moebius_pt_blaschke[of k u']
[PROOF STATE]
proof (prove)
using this:
cmod k \<noteq> 1
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
u \<noteq> \<infinity>\<^sub>h
v \<noteq> \<infinity>\<^sub>h
of_complex k \<in> unit_disc
u \<in> unit_disc
v \<in> unit_disc
u' = to_complex u
v' = to_complex v
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
d = u' - v'
ddu = 1 - u' * cnj u'
ddv = 1 - v' * cnj v'
kk = 1 - k * cnj k
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
\<lbrakk>cmod k \<noteq> 1; u' \<noteq> 1 / cnj k\<rbrakk> \<Longrightarrow> moebius_pt (blaschke k) (of_complex u') = of_complex ((u' - k) / (1 - cnj k * u'))

goal (1 subgoal):
 1. poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
using moebius_pt_blaschke[of k v']
[PROOF STATE]
proof (prove)
using this:
cmod k \<noteq> 1
u' \<noteq> 1 / cnj k
v' \<noteq> 1 / cnj k
u \<noteq> \<infinity>\<^sub>h
v \<noteq> \<infinity>\<^sub>h
of_complex k \<in> unit_disc
u \<in> unit_disc
v \<in> unit_disc
u' = to_complex u
v' = to_complex v
nu = u' - k
du = 1 - cnj k * u'
nv = v' - k
dv = 1 - cnj k * v'
d = u' - v'
ddu = 1 - u' * cnj u'
ddv = 1 - v' * cnj v'
kk = 1 - k * cnj k
(cmod (nu / du - nv / dv))\<^sup>2 / ((1 - (cmod nu / cmod du)\<^sup>2) * (1 - (cmod nv / cmod dv)\<^sup>2)) = (cmod d)\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
\<lbrakk>cmod k \<noteq> 1; u' \<noteq> 1 / cnj k\<rbrakk> \<Longrightarrow> moebius_pt (blaschke k) (of_complex u') = of_complex ((u' - k) / (1 - cnj k * u'))
\<lbrakk>cmod k \<noteq> 1; v' \<noteq> 1 / cnj k\<rbrakk> \<Longrightarrow> moebius_pt (blaschke k) (of_complex v') = of_complex ((v' - k) / (1 - cnj k * v'))

goal (1 subgoal):
 1. poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)
[PROOF STEP]
by (simp add: norm_divide)
[PROOF STATE]
proof (state)
this:
poincare_distance_formula (to_complex (moebius_pt (blaschke k) u)) (to_complex (moebius_pt (blaschke k) v)) = poincare_distance_formula (to_complex u) (to_complex v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma f_classification: "(\<forall>x. f x = 0) \<or> (\<forall>x. f x = 2 * x + f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. f x = 0) \<or> (\<forall>x. f x = 2 * x + f 0)
[PROOF STEP]
using f_eq[of 0 0] f_eq[of 0 1]
[PROOF STATE]
proof (prove)
using this:
f (2 * 0) + 2 * f 0 = f (f (0 + 0))
f (2 * 0) + 2 * f 1 = f (f (0 + 1))

goal (1 subgoal):
 1. (\<forall>x. f x = 0) \<or> (\<forall>x. f x = 2 * x + f 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma infinite_UNIV_listI: "\<not> finite(UNIV::'a list set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
by (metis UNIV_I finite_maxlen length_replicate less_irrefl)


[STATEMENT]
lemma integrable_cos_cx:
  "integrable (lebesgue_on {-pi..pi}) (\<lambda>x. cos(x * c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (x * c))
[PROOF STEP]
by (intro continuous_imp_integrable_real continuous_intros)


[STATEMENT]
lemma T_on_rand'_append: "T_on_rand' A s (xs@ys) = T_on_rand' A s xs + T_on_rand' A (config'_rand A s xs) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_on_rand' A s (xs @ ys) = T_on_rand' A s xs + T_on_rand' A (config'_rand A s xs) ys
[PROOF STEP]
apply(induct xs arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. T_on_rand' A s ([] @ ys) = T_on_rand' A s [] + T_on_rand' A (config'_rand A s []) ys
 2. \<And>a xs s. (\<And>s. T_on_rand' A s (xs @ ys) = T_on_rand' A s xs + T_on_rand' A (config'_rand A s xs) ys) \<Longrightarrow> T_on_rand' A s ((a # xs) @ ys) = T_on_rand' A s (a # xs) + T_on_rand' A (config'_rand A s (a # xs)) ys
[PROOF STEP]
by simp_all


[STATEMENT]
lemma Un_set_plus: "(A \<union> B) + C = (A+C) \<union> (B+C)" and set_plus_Un: "C + (A \<union> B) = (C+A) \<union> (C+B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> B + C = A + C \<union> (B + C) &&& C + (A \<union> B) = C + A \<union> (C + B)
[PROOF STEP]
by (auto simp: set_plus_def)


[STATEMENT]
lemma mset_cols_index_map:  "image_mset (\<lambda> j. col M j) (mset_set {0..< dim_col M}) = mset (cols M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset (col M) (mset_set {0..<dim_col M}) = mset (cols M)
[PROOF STEP]
by (simp add: cols_def)


[STATEMENT]
lemma has_integral_integral_lebesgue:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes f: "integrable lebesgue f"
  shows "(f has_integral (integral\<^sup>L lebesgue f)) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
have "((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. integral\<^sup>L lebesgue (\<lambda>x. f x \<bullet> b) *\<^sub>R b)) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (LINT x|lebesgue. f x \<bullet> b) *\<^sub>R b)) UNIV
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue f

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (LINT x|lebesgue. f x \<bullet> b) *\<^sub>R b)) UNIV
[PROOF STEP]
by (intro has_integral_sum finite_Basis ballI has_integral_scaleR_left has_integral_integral_lebesgue_real) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (LINT x|lebesgue. f x \<bullet> b) *\<^sub>R b)) UNIV

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (LINT x|lebesgue. f x \<bullet> b) *\<^sub>R b)) UNIV

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
have eq_f: "(\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f
[PROOF STEP]
by (simp add: fun_eq_iff euclidean_representation)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
have "(\<Sum>b\<in>Basis. integral\<^sup>L lebesgue (\<lambda>x. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lebesgue f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. (LINT x|lebesgue. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lebesgue f
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue f

goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. (LINT x|lebesgue. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lebesgue f
[PROOF STEP]
by (subst (2) eq_f[symmetric]) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. (LINT x|lebesgue. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lebesgue f

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f has_integral integral\<^sup>L lebesgue f) UNIV

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L lebesgue f) UNIV
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f has_integral integral\<^sup>L lebesgue f) UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_on_ereal_alt_mem:
  fixes C :: "'a::real_vector set"
  assumes "convex C"
  assumes "convex_on C f"
  assumes "x : C" "y : C"
  assumes "(m::real) \<ge> 0" "m \<le> 1"
  shows "f (m *\<^sub>R x + (1 - m) *\<^sub>R y) \<le> (ereal m) * f x + (1 - (ereal m)) * f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (m *\<^sub>R x + (1 - m) *\<^sub>R y) \<le> ereal m * f x + (1 - ereal m) * f y
[PROOF STEP]
by (metis assms convex_on_ereal_alt)


[STATEMENT]
lemma infinite_solutions_no_homogeneous_imp_dim_solution_set_not_zero_imp:
  fixes A::"'a::{field}^'n::{mod_type}^'rows::{mod_type}"
  assumes i: "infinite (solution_set A b)"
  shows "vec.dim (solution_set A 0) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < vec.dim (solution_set A 0)
[PROOF STEP]
using i independent_and_consistent_imp_card_1 infinite_solution_set_imp_consistent
[PROOF STATE]
proof (prove)
using this:
infinite (solution_set A b)
\<lbrakk>vec.dim (solution_set ?A 0) = 0; consistent ?A ?b\<rbrakk> \<Longrightarrow> card (solution_set ?A ?b) = 1
infinite (solution_set ?A ?b) \<Longrightarrow> consistent ?A ?b

goal (1 subgoal):
 1. 0 < vec.dim (solution_set A 0)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma some_choice: "(\<exists>a. \<forall>b. P b (a b)) \<longleftrightarrow> (\<forall>b. \<exists>a. P b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>a. \<forall>b. P b (a b)) = (\<forall>b. \<exists>a. P b a)
[PROOF STEP]
by metis


[STATEMENT]
lemma child_card_decr:
  assumes "e \<in> out_arcs T r"
  shows "Finite_Set.card {x. (head T e) \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x} < Finite_Set.card {x. r \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. head T e \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x} < card {x. r \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x}
[PROOF STEP]
using assms child_strict_subtree
[PROOF STATE]
proof (prove)
using this:
e \<in> out_arcs T r
?e \<in> out_arcs T ?r \<Longrightarrow> {x. head T ?e \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x} \<subset> {x. ?r \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x}

goal (1 subgoal):
 1. card {x. head T e \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x} < card {x. r \<rightarrow>\<^sup>*\<^bsub>T\<^esub> x}
[PROOF STEP]
by (meson psubset_card_mono reachable_verts_finite)


[STATEMENT]
lemma homotopy_eqv_Borsukianness:
  fixes S :: "'a::real_normed_vector set"
    and T :: "'b::real_normed_vector set"
   assumes "S homotopy_eqv T"
     shows "(Borsukian S \<longleftrightarrow> Borsukian T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Borsukian S = Borsukian T
[PROOF STEP]
by (meson Borsukian_def assms homotopy_eqv_cohomotopic_triviality_null)


[STATEMENT]
lemma finite_zero_cardI [intro!]:
  "\<lbrakk> A = {}; finite A \<rbrakk> \<Longrightarrow> card A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = {}; finite A\<rbrakk> \<Longrightarrow> card A = 0
[PROOF STEP]
by (auto)


[STATEMENT]
theorem block_unique:
  "\<lbrakk> a \<in> A; A \<in> P; a \<in> B; B \<in> P \<rbrakk> \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; A \<in> P; a \<in> B; B \<in> P\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
using disjoint
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> P; ?B \<in> P; ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B = {}

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; A \<in> P; a \<in> B; B \<in> P\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
by blast


[STATEMENT]
lemma interleave_unconc_eq: "!! l2 w1 w2 . l1@l2 \<in> w1\<otimes>w2 = (\<exists> w11 w12 w21 w22 . w1=w11@w12 \<and> w2=w21@w22 \<and> l1\<in>w11\<otimes>w21 \<and> l2\<in>w12\<otimes>w22)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l2 w1 w2. (l1 @ l2 \<in> w1 \<otimes> w2) = (\<exists>w11 w12 w21 w22. w1 = w11 @ w12 \<and> w2 = w21 @ w22 \<and> l1 \<in> w11 \<otimes> w21 \<and> l2 \<in> w12 \<otimes> w22)
[PROOF STEP]
by (fast dest: interleave_reconc interleave_unconc)


[STATEMENT]
lemma (in t2_space) separation_t2: "x \<noteq> y \<longleftrightarrow> (\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<noteq> y) = (\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {})
[PROOF STEP]
using hausdorff [of x y]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}

goal (1 subgoal):
 1. (x \<noteq> y) = (\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {})
[PROOF STEP]
by blast


[STATEMENT]
lemma geodesic_quasi_isometric_image:
  fixes f::"'a::metric_space \<Rightarrow> 'b::Gromov_hyperbolic_space_geodesic"
  assumes "lambda C-quasi_isometry_on UNIV f"
          "geodesic_segment_between G x y"
  shows "hausdorff_distance (f`G) {f x--f y} \<le> 92 * lambda^2 * (C + deltaG(TYPE('b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
define c where "c = f o (geodesic_segment_param G x)"
[PROOF STATE]
proof (state)
this:
c = f \<circ> geodesic_segment_param G x

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
have *: "(1 * lambda) (0 * lambda + C)-quasi_isometry_on {0..dist x y} c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 * lambda) (0 * lambda + C) -quasi_isometry_on {0..dist x y} c
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 * lambda) (0 * lambda + C) -quasi_isometry_on {0..dist x y} (f \<circ> geodesic_segment_param G x)
[PROOF STEP]
by (rule quasi_isometry_on_compose[where Y = UNIV], auto intro!: isometry_quasi_isometry_on simp add: assms)
[PROOF STATE]
proof (state)
this:
(1 * lambda) (0 * lambda + C) -quasi_isometry_on {0..dist x y} c

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
have "hausdorff_distance (c`{0..dist x y}) {c 0--c (dist x y)} \<le> 92 * lambda^2 * (C + deltaG(TYPE('b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {0..dist x y}) {c 0--c (dist x y)} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
apply (rule Morse_Gromov_theorem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lambda C -quasi_isometry_on {0..dist x y} c
 2. geodesic_segment_between {c 0--c (dist x y)} (c 0) (c (dist x y))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
(1 * lambda) (0 * lambda + C) -quasi_isometry_on {0..dist x y} c

goal (2 subgoals):
 1. lambda C -quasi_isometry_on {0..dist x y} c
 2. geodesic_segment_between {c 0--c (dist x y)} (c 0) (c (dist x y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {0..dist x y}) {c 0--c (dist x y)} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {0..dist x y}) {c 0--c (dist x y)} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
have "c`{0..dist x y} = f`G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ` {0..dist x y} = f ` G
[PROOF STEP]
unfolding c_def image_comp[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` geodesic_segment_param G x ` {0..dist x y} = f ` G
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
geodesic_segment_between G x y

goal (1 subgoal):
 1. f ` geodesic_segment_param G x ` {0..dist x y} = f ` G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c ` {0..dist x y} = f ` G

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c ` {0..dist x y} = f ` G

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
have "c 0 = f x" "c (dist x y) = f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c 0 = f x &&& c (dist x y) = f y
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> geodesic_segment_param G x) 0 = f x &&& (f \<circ> geodesic_segment_param G x) (dist x y) = f y
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
geodesic_segment_between G x y

goal (1 subgoal):
 1. (f \<circ> geodesic_segment_param G x) 0 = f x &&& (f \<circ> geodesic_segment_param G x) (dist x y) = f y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c 0 = f x
c (dist x y) = f y

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
hausdorff_distance (c ` {0..dist x y}) {c 0--c (dist x y)} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
c ` {0..dist x y} = f ` G
c 0 = f x
c (dist x y) = f y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hausdorff_distance (c ` {0..dist x y}) {c 0--c (dist x y)} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
c ` {0..dist x y} = f ` G
c 0 = f x
c (dist x y) = f y

goal (1 subgoal):
 1. hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (f ` G) {f x--f y} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<forall>x. P x \<longrightarrow> (\<forall>x. Q x)) \<and>
      ((\<forall>x. Q x \<or> R x) \<longrightarrow> (\<exists>x. Q x \<and> S x)) \<and>
      ((\<exists>x. S x) \<longrightarrow> (\<forall>x. L x \<longrightarrow> M x))
    \<longrightarrow> (\<forall>x. P x \<and> L x \<longrightarrow> M x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x \<longrightarrow> (\<forall>x. Q x)) \<and> ((\<forall>x. Q x \<or> R x) \<longrightarrow> (\<exists>x. Q x \<and> S x)) \<and> ((\<exists>x. S x) \<longrightarrow> (\<forall>x. L x \<longrightarrow> M x)) \<longrightarrow> (\<forall>x. P x \<and> L x \<longrightarrow> M x)
[PROOF STEP]
by blast


[STATEMENT]
lemma ord_ultrametric_noteq'':
  assumes "x \<in> nonzero Q\<^sub>p"
  assumes "y \<in> nonzero Q\<^sub>p"
  assumes "ord y > ord x"
  shows "ord (x \<ominus> y) = (ord x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (x \<ominus> y) = ord x
[PROOF STEP]
using assms ord_ultrametric_noteq'[of y x]
[PROOF STATE]
proof (prove)
using this:
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p
ord x < ord y
\<lbrakk>y \<in> nonzero Q\<^sub>p; x \<in> nonzero Q\<^sub>p; ord x < ord y\<rbrakk> \<Longrightarrow> ord (y \<ominus> x) = ord x

goal (1 subgoal):
 1. ord (x \<ominus> y) = ord x
[PROOF STEP]
by (metis Qp.minus_a_inv Qp.nonzero_closed Qp.not_eq_diff_nonzero ord_minus)


[STATEMENT]
theorem p14: "(p \<longleftrightarrow> q) \<longleftrightarrow> ((q \<or> \<not>p) \<and> (\<not>q \<or> p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p = q) = ((q \<or> \<not> p) \<and> (\<not> q \<or> p))
[PROOF STEP]
by auto2


[STATEMENT]
lemma isin_prefix_trie:
  "isin (prefix_trie ps t) ks
   = (ps = take (length ps) ks \<and> isin t (drop (length ps) ks))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isin (prefix_trie ps t) ks = (ps = take (length ps) ks \<and> isin t (drop (length ps) ks))
[PROOF STEP]
apply(induction ps arbitrary: ks)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ks. isin (prefix_trie [] t) ks = ([] = take (length []) ks \<and> isin t (drop (length []) ks))
 2. \<And>a ps ks. (\<And>ks. isin (prefix_trie ps t) ks = (ps = take (length ps) ks \<and> isin t (drop (length ps) ks))) \<Longrightarrow> isin (prefix_trie (a # ps) t) ks = (a # ps = take (length (a # ps)) ks \<and> isin t (drop (length (a # ps)) ks))
[PROOF STEP]
apply(auto split: list.split)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma even_addI:
  "even a \<Longrightarrow> even b \<Longrightarrow> even (a + b)"
  "odd a \<Longrightarrow> odd b \<Longrightarrow> even (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>even a; even b\<rbrakk> \<Longrightarrow> even (a + b)) &&& (\<lbrakk>odd a; odd b\<rbrakk> \<Longrightarrow> even (a + b))
[PROOF STEP]
by auto


[STATEMENT]
lemma minus_plus_minus:
  assumes "s adds t" and "u adds v"
  shows "(t - s) + (v - u) = (t + v) - (s + u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t - s + (v - u) = t + v - (s + u)
[PROOF STEP]
using add_commute assms(1) assms(2) diff_diff_add minus_plus
[PROOF STATE]
proof (prove)
using this:
?a + ?b = ?b + ?a
s adds t
u adds v
?a - ?b - ?c = ?a - (?b + ?c)
?s adds ?t \<Longrightarrow> ?t - ?s + ?u = ?t + ?u - ?s

goal (1 subgoal):
 1. t - s + (v - u) = t + v - (s + u)
[PROOF STEP]
by auto


[STATEMENT]
lemma eSuc_minus_eSuc [simp]: "eSuc n - eSuc m = n - m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eSuc n - eSuc m = n - m
[PROOF STEP]
by (simp add: eSuc_def split: enat.split)


[STATEMENT]
lemma closed_rel_boundary:
  fixes S :: "'n::euclidean_space set"
  shows "closed S \<Longrightarrow> closed(S - rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S \<Longrightarrow> closed (S - rel_interior S)
[PROOF STEP]
by (metis closed_rel_frontier closure_closed rel_frontier_def)


[STATEMENT]
lemma rev_tl_rev: "rev (tl (rev l)) = butlast l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (tl (rev l)) = butlast l
[PROOF STEP]
by (induct l) auto


[STATEMENT]
theorem complement_of_product_is_sum_of_complements:
  "O x y \<Longrightarrow> x \<oplus> y \<noteq> u \<Longrightarrow> \<midarrow>(x \<otimes> y) = (\<midarrow>x) \<oplus> (\<midarrow>y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>O x y; x \<oplus> y \<noteq> u\<rbrakk> \<Longrightarrow> \<midarrow> (x \<otimes> y) = \<midarrow> x \<oplus> \<midarrow> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>O x y; x \<oplus> y \<noteq> u\<rbrakk> \<Longrightarrow> \<midarrow> (x \<otimes> y) = \<midarrow> x \<oplus> \<midarrow> y
[PROOF STEP]
assume "O x y"
[PROOF STATE]
proof (state)
this:
O x y

goal (1 subgoal):
 1. \<lbrakk>O x y; x \<oplus> y \<noteq> u\<rbrakk> \<Longrightarrow> \<midarrow> (x \<otimes> y) = \<midarrow> x \<oplus> \<midarrow> y
[PROOF STEP]
assume "x \<oplus> y \<noteq> u"
[PROOF STATE]
proof (state)
this:
x \<oplus> y \<noteq> u

goal (1 subgoal):
 1. \<lbrakk>O x y; x \<oplus> y \<noteq> u\<rbrakk> \<Longrightarrow> \<midarrow> (x \<otimes> y) = \<midarrow> x \<oplus> \<midarrow> y
[PROOF STEP]
show "\<midarrow>(x \<otimes> y) = (\<midarrow>x) \<oplus> (\<midarrow>y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<midarrow> (x \<otimes> y) = \<midarrow> x \<oplus> \<midarrow> y
[PROOF STEP]
proof (rule part_antisymmetry)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P (\<midarrow> (x \<otimes> y)) (\<midarrow> x \<oplus> \<midarrow> y)
 2. P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))
[PROOF STEP]
have "x \<noteq> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> u
[PROOF STEP]
using \<open>x \<oplus> y \<noteq> u\<close>
[PROOF STATE]
proof (prove)
using this:
x \<oplus> y \<noteq> u

goal (1 subgoal):
 1. x \<noteq> u
[PROOF STEP]
by (rule first_summand_not_universe)
[PROOF STATE]
proof (state)
this:
x \<noteq> u

goal (2 subgoals):
 1. P (\<midarrow> (x \<otimes> y)) (\<midarrow> x \<oplus> \<midarrow> y)
 2. P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))
[PROOF STEP]
have "y \<noteq> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<noteq> u
[PROOF STEP]
using \<open>x \<oplus> y \<noteq> u\<close>
[PROOF STATE]
proof (prove)
using this:
x \<oplus> y \<noteq> u

goal (1 subgoal):
 1. y \<noteq> u
[PROOF STEP]
by (rule second_summand_not_universe)
[PROOF STATE]
proof (state)
this:
y \<noteq> u

goal (2 subgoals):
 1. P (\<midarrow> (x \<otimes> y)) (\<midarrow> x \<oplus> \<midarrow> y)
 2. P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))
[PROOF STEP]
show "P (\<midarrow> (x \<otimes> y)) (\<midarrow> x \<oplus> \<midarrow> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (\<midarrow> (x \<otimes> y)) (\<midarrow> x \<oplus> \<midarrow> y)
[PROOF STEP]
using \<open>x \<noteq> u\<close> \<open>y \<noteq> u\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> u
y \<noteq> u

goal (1 subgoal):
 1. P (\<midarrow> (x \<otimes> y)) (\<midarrow> x \<oplus> \<midarrow> y)
[PROOF STEP]
by (rule product_complement_in_complements_sum)
[PROOF STATE]
proof (state)
this:
P (\<midarrow> (x \<otimes> y)) (\<midarrow> x \<oplus> \<midarrow> y)

goal (1 subgoal):
 1. P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))
[PROOF STEP]
show " P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))
[PROOF STEP]
using \<open>O x y\<close> \<open>x \<noteq> u\<close> \<open>y \<noteq> u\<close>
[PROOF STATE]
proof (prove)
using this:
O x y
x \<noteq> u
y \<noteq> u

goal (1 subgoal):
 1. P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))
[PROOF STEP]
by (rule complement_sum_in_product_complement)
[PROOF STATE]
proof (state)
this:
P (\<midarrow> x \<oplus> \<midarrow> y) (\<midarrow> (x \<otimes> y))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<midarrow> (x \<otimes> y) = \<midarrow> x \<oplus> \<midarrow> y

goal:
No subgoals!
[PROOF STEP]
qed