[STATEMENT]
lemma poincare_between_sum_distances_x_axis_u0v:
  assumes "of_complex u' \<in> unit_disc" "of_complex v' \<in> unit_disc"
  assumes "is_real u'" "u' \<noteq> 0" "v' \<noteq> 0"
  shows  "poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v') \<longleftrightarrow>
          is_real v' \<and> Re u' * Re v' < 0" (is "?P u' v' \<longleftrightarrow> ?Q u' v'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
have "Re u' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re u' \<noteq> 0
[PROOF STEP]
using \<open>is_real u'\<close> \<open>u' \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
is_real u'
u' \<noteq> 0

goal (1 subgoal):
 1. Re u' \<noteq> 0
[PROOF STEP]
using complex_eq_if_Re_eq
[PROOF STATE]
proof (prove)
using this:
is_real u'
u' \<noteq> 0
\<lbrakk>is_real ?z1.0; is_real ?z2.0\<rbrakk> \<Longrightarrow> (?z1.0 = ?z2.0) = (Re ?z1.0 = Re ?z2.0)

goal (1 subgoal):
 1. Re u' \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Re u' \<noteq> 0

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
let ?u = "cmod u'" and ?v = "cmod v'" and ?uv = "cmod (u' - v')"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
have disc: "?u\<^sup>2 < 1" "?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 unit_disc_cmod_square_lt_1[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
(cmod (to_complex (of_complex u')))\<^sup>2 < 1

goal (1 subgoal):
 1. (cmod u')\<^sup>2 < 1 &&& (cmod v')\<^sup>2 < 1
[PROOF STEP]
using unit_disc_cmod_square_lt_1[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
(cmod (to_complex (of_complex u')))\<^sup>2 < 1
(cmod (to_complex (of_complex v')))\<^sup>2 < 1

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

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
have "poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') =
              arcosh (((1 + ?u\<^sup>2) * (1 + ?v\<^sup>2) + 4 * ?u * ?v) / ((1 - ?u\<^sup>2) * (1 - ?v\<^sup>2)))" (is "_ = arcosh ?r1")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
using poincare_distance_formula_zero_sum[OF assms(1-2)]
[PROOF STATE]
proof (prove)
using this:
poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = (let u' = cmod (to_complex (of_complex u')); v' = cmod (to_complex (of_complex v')) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))

goal (1 subgoal):
 1. poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
have "poincare_distance (of_complex u') (of_complex v') =
              arcosh (((1 - ?u\<^sup>2) * (1 - ?v\<^sup>2) + 2 * ?uv\<^sup>2) / ((1 - ?u\<^sup>2) * (1 - ?v\<^sup>2)))" (is "_ = arcosh ?r2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_distance (of_complex u') (of_complex v') = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. poincare_distance (of_complex u') (of_complex v') = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
using poincare_distance_formula[OF assms(1-2)]
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1
poincare_distance (of_complex u') (of_complex v') = poincare_distance_formula (to_complex (of_complex u')) (to_complex (of_complex v'))

goal (1 subgoal):
 1. poincare_distance (of_complex u') (of_complex v') = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
by (subst add_divide_distrib) simp
[PROOF STATE]
proof (state)
this:
poincare_distance (of_complex u') (of_complex v') = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poincare_distance (of_complex u') (of_complex v') = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
have "arcosh ?r1 = arcosh ?r2 \<longleftrightarrow> ?Q u' v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
assume "arcosh ?r1 = arcosh ?r2"
[PROOF STATE]
proof (state)
this:
arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "?r1 = ?r2"
[PROOF STATE]
proof (prove)
using this:
arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
proof (subst (asm) arcosh_eq_iff)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 1 \<le> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
 2. 1 \<le> ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
 3. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
show "?r1 \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
have "(1 - ?u\<^sup>2) * (1 - ?v\<^sup>2) \<le> (1 + ?u\<^sup>2) * (1 + ?v\<^sup>2) + 4 * ?u * ?v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) \<le> (1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v'
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) \<le> (1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v'

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

goal (1 subgoal):
 1. 1 \<le> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
(1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) \<le> (1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v'
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. 1 \<le> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 \<le> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (2 subgoals):
 1. 1 \<le> ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
 2. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 \<le> ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
 2. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
show "?r2 \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. 1 \<le> ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "(1 + ?u\<^sup>2) * (1 + ?v\<^sup>2) + 4 * ?u * ?v = (1 - ?u\<^sup>2) * (1 - ?v\<^sup>2) + 2 * ?uv\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. (1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v' = (1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. (1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v' = (1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v' = (1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "(cmod (u' - v'))\<^sup>2 = (cmod u' + cmod v')\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v' = (1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2

goal (1 subgoal):
 1. (cmod (u' - v'))\<^sup>2 = (cmod u' + cmod v')\<^sup>2
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(cmod (u' - v'))\<^sup>2 = (cmod u' + cmod v')\<^sup>2

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence *: "Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0"
[PROOF STATE]
proof (prove)
using this:
(cmod (u' - v'))\<^sup>2 = (cmod u' + cmod v')\<^sup>2

goal (1 subgoal):
 1. Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0
[PROOF STEP]
using \<open>is_real u'\<close>
[PROOF STATE]
proof (prove)
using this:
(cmod (u' - v'))\<^sup>2 = (cmod u' + cmod v')\<^sup>2
is_real u'

goal (1 subgoal):
 1. Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0
[PROOF STEP]
unfolding cmod_power2 cmod_def
[PROOF STATE]
proof (prove)
using this:
(sqrt ((Re (u' - v'))\<^sup>2 + (Im (u' - v'))\<^sup>2))\<^sup>2 = (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2) + sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2
is_real u'

goal (1 subgoal):
 1. Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0
[PROOF STEP]
by (simp add: field_simps) (simp add: power2_eq_square field_simps)
[PROOF STATE]
proof (state)
this:
Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = \<bar>Re v'\<bar>"
[PROOF STATE]
proof (prove)
using this:
Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0

goal (1 subgoal):
 1. sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = \<bar>Re v'\<bar>
[PROOF STEP]
using \<open>Re u' \<noteq> 0\<close> \<open>v' \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0
Re u' \<noteq> 0
v' \<noteq> 0

goal (1 subgoal):
 1. sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = \<bar>Re v'\<bar>
[PROOF STEP]
by (smt complex_neq_0 mult.commute mult_cancel_right mult_minus_left real_sqrt_gt_0_iff)
[PROOF STATE]
proof (state)
this:
sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = \<bar>Re v'\<bar>

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "Im v' = 0"
[PROOF STATE]
proof (prove)
using this:
sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = \<bar>Re v'\<bar>

goal (1 subgoal):
 1. is_real v'
[PROOF STEP]
by (smt Im_eq_0 norm_complex_def)
[PROOF STATE]
proof (state)
this:
is_real v'

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_real v'

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "Re u' * Re v' = - \<bar>Re u'\<bar> * \<bar>Re v'\<bar>"
[PROOF STATE]
proof (prove)
using this:
is_real v'

goal (1 subgoal):
 1. Re u' * Re v' = - \<bar>Re u'\<bar> * \<bar>Re v'\<bar>
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
is_real v'
Re u' * Re v' + \<bar>Re u'\<bar> * sqrt ((Im v')\<^sup>2 + (Re v')\<^sup>2) = 0

goal (1 subgoal):
 1. Re u' * Re v' = - \<bar>Re u'\<bar> * \<bar>Re v'\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Re u' * Re v' = - \<bar>Re u'\<bar> * \<bar>Re v'\<bar>

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "Re u' * Re v' < 0"
[PROOF STATE]
proof (prove)
using this:
Re u' * Re v' = - \<bar>Re u'\<bar> * \<bar>Re v'\<bar>

goal (1 subgoal):
 1. Re u' * Re v' < 0
[PROOF STEP]
using \<open>Re u' \<noteq> 0\<close> \<open>v' \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
Re u' * Re v' = - \<bar>Re u'\<bar> * \<bar>Re v'\<bar>
Re u' \<noteq> 0
v' \<noteq> 0

goal (1 subgoal):
 1. Re u' * Re v' < 0
[PROOF STEP]
by (simp add: \<open>is_real v'\<close> complex_eq_if_Re_eq)
[PROOF STATE]
proof (state)
this:
Re u' * Re v' < 0

goal (2 subgoals):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) \<Longrightarrow> is_real v' \<and> Re u' * Re v' < 0
 2. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
is_real v'
Re u' * Re v' < 0
[PROOF STEP]
show "?Q u' v'"
[PROOF STATE]
proof (prove)
using this:
is_real v'
Re u' * Re v' < 0

goal (1 subgoal):
 1. is_real v' \<and> Re u' * Re v' < 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_real v' \<and> Re u' * Re v' < 0

goal (1 subgoal):
 1. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
assume "?Q u' v'"
[PROOF STATE]
proof (state)
this:
is_real v' \<and> Re u' * Re v' < 0

goal (1 subgoal):
 1. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
hence "is_real v'" "Re u' * Re v' < 0"
[PROOF STATE]
proof (prove)
using this:
is_real v' \<and> Re u' * Re v' < 0

goal (1 subgoal):
 1. is_real v' &&& Re u' * Re v' < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_real v'
Re u' * Re v' < 0

goal (1 subgoal):
 1. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
have "?r1 = ?r2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
proof (cases "Re u' > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
 2. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < Re u'

goal (2 subgoals):
 1. 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
 2. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
hence "Re v' < 0"
[PROOF STATE]
proof (prove)
using this:
0 < Re u'

goal (1 subgoal):
 1. Re v' < 0
[PROOF STEP]
using \<open>Re u' * Re v' < 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < Re u'
Re u' * Re v' < 0

goal (1 subgoal):
 1. Re v' < 0
[PROOF STEP]
by (smt zero_le_mult_iff)
[PROOF STATE]
proof (state)
this:
Re v' < 0

goal (2 subgoals):
 1. 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
 2. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using disc \<open>is_real u'\<close> \<open>is_real v'\<close>
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1
is_real u'
is_real v'

goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using \<open>Re u' > 0\<close> \<open>Re v' < 0\<close>
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1
is_real u'
is_real v'
0 < Re u'
Re v' < 0

goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
unfolding cmod_power2 cmod_def
[PROOF STATE]
proof (prove)
using this:
(sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2 < 1
(sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2 < 1
is_real u'
is_real v'
0 < Re u'
Re v' < 0

goal (1 subgoal):
 1. ((1 + (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 + (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2) + 4 * sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2) * sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2)) / ((1 - (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 - (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2)) = ((1 - (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 - (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2) + 2 * (sqrt ((Re (u' - v'))\<^sup>2 + (Im (u' - v'))\<^sup>2))\<^sup>2) / ((1 - (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 - (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2))
[PROOF STEP]
by simp (simp add: power2_eq_square field_simps)
[PROOF STATE]
proof (state)
this:
((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < Re u'

goal (1 subgoal):
 1. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
hence "Re u' < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < Re u'

goal (1 subgoal):
 1. Re u' < 0
[PROOF STEP]
using \<open>Re u' \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < Re u'
Re u' \<noteq> 0

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

goal (1 subgoal):
 1. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
hence "Re v' > 0"
[PROOF STATE]
proof (prove)
using this:
Re u' < 0

goal (1 subgoal):
 1. 0 < Re v'
[PROOF STEP]
using \<open>Re u' * Re v' < 0\<close>
[PROOF STATE]
proof (prove)
using this:
Re u' < 0
Re u' * Re v' < 0

goal (1 subgoal):
 1. 0 < Re v'
[PROOF STEP]
by (smt zero_le_mult_iff)
[PROOF STATE]
proof (state)
this:
0 < Re v'

goal (1 subgoal):
 1. \<not> 0 < Re u' \<Longrightarrow> ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using disc \<open>is_real u'\<close> \<open>is_real v'\<close>
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1
is_real u'
is_real v'

goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using \<open>Re u' < 0\<close> \<open>Re v' > 0\<close>
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1
is_real u'
is_real v'
Re u' < 0
0 < Re v'

goal (1 subgoal):
 1. ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
unfolding cmod_power2 cmod_def
[PROOF STATE]
proof (prove)
using this:
(sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2 < 1
(sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2 < 1
is_real u'
is_real v'
Re u' < 0
0 < Re v'

goal (1 subgoal):
 1. ((1 + (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 + (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2) + 4 * sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2) * sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2)) / ((1 - (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 - (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2)) = ((1 - (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 - (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2) + 2 * (sqrt ((Re (u' - v'))\<^sup>2 + (Im (u' - v'))\<^sup>2))\<^sup>2) / ((1 - (sqrt ((Re u')\<^sup>2 + (Im u')\<^sup>2))\<^sup>2) * (1 - (sqrt ((Re v')\<^sup>2 + (Im v')\<^sup>2))\<^sup>2))
[PROOF STEP]
by simp (simp add: power2_eq_square field_simps)
[PROOF STATE]
proof (state)
this:
((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

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

goal (1 subgoal):
 1. is_real v' \<and> Re u' * Re v' < 0 \<Longrightarrow> arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
thus "arcosh ?r1 = arcosh ?r2"
[PROOF STATE]
proof (prove)
using this:
((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)) = ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))) = (is_real v' \<and> Re u' * Re v' < 0)

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
poincare_distance (of_complex u') (of_complex v') = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
(arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
poincare_distance (of_complex u') (of_complex v') = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
(arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))) = arcosh (((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2) + 2 * (cmod (u' - v'))\<^sup>2) / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))) = (is_real v' \<and> Re u' * Re v' < 0)

goal (1 subgoal):
 1. (poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(poincare_distance (of_complex u') 0\<^sub>h + poincare_distance 0\<^sub>h (of_complex v') = poincare_distance (of_complex u') (of_complex v')) = (is_real v' \<and> Re u' * Re v' < 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma generate_valid_topology_as_set:
  "generate_valid_topology M G = delete_edges G (\<Union>m \<in> set M. (\<Union> (c_offending_flows m G)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate_valid_topology M G = delete_edges G (\<Union>m\<in>set M. \<Union> (c_offending_flows m G))
[PROOF STEP]
apply(induction M arbitrary: G)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>G. generate_valid_topology [] G = delete_edges G (\<Union>m\<in>set []. \<Union> (c_offending_flows m G))
 2. \<And>a M G. (\<And>G. generate_valid_topology M G = delete_edges G (\<Union>m\<in>set M. \<Union> (c_offending_flows m G))) \<Longrightarrow> generate_valid_topology (a # M) G = delete_edges G (\<Union>m\<in>set (a # M). \<Union> (c_offending_flows m G))
[PROOF STEP]
apply(simp_all add: delete_edges_simp2 generate_valid_topology_nodes)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a M G. (\<And>G. generate_valid_topology M G = \<lparr>nodes = nodes G, edges = edges G - (\<Union>m\<in>set M. \<Union> (c_offending_flows m G))\<rparr>) \<Longrightarrow> edges G - (\<Union>m\<in>set M. \<Union> (c_offending_flows m G)) - \<Union> (c_offending_flows a G) = edges G - (\<Union> (c_offending_flows a G) \<union> (\<Union>x\<in>set M. \<Union> (c_offending_flows x G)))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma fst3_snd3_trd3: "abc = (fst3 abc, snd3 abc, trd3 abc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abc = (fst3 abc, snd3 abc, trd3 abc)
[PROOF STEP]
unfolding fst3_def snd3_def trd3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abc = (fst abc, (fst \<circ> snd) abc, (snd \<circ> snd) abc)
[PROOF STEP]
by auto


[STATEMENT]
lemma octo_of_real_mult [simp]: "octo_of_real (x * y) = octo_of_real x * octo_of_real y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_real (x * y) = octo_of_real x * octo_of_real y
[PROOF STEP]
using octo_of_real_def
[PROOF STATE]
proof (prove)
using this:
octo_of_real ?r = ?r *\<^sub>R 1

goal (1 subgoal):
 1. octo_of_real (x * y) = octo_of_real x * octo_of_real y
[PROOF STEP]
by (metis scaleR_conv_octo_of_real scaleR_scaleR)


[STATEMENT]
lemma unicoherentD:
  assumes "unicoherent U" "connected S" "connected T" "U = S \<union> T" "closedin (top_of_set U) S" "closedin (top_of_set U) T"
  shows "connected (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (S \<inter> T)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unicoherent U
connected S
connected T
U = S \<union> T
closedin (top_of_set U) S
closedin (top_of_set U) T

goal (1 subgoal):
 1. connected (S \<inter> T)
[PROOF STEP]
unfolding unicoherent_def
[PROOF STATE]
proof (prove)
using this:
\<forall>S T. connected S \<and> connected T \<and> S \<union> T = U \<and> closedin (top_of_set U) S \<and> closedin (top_of_set U) T \<longrightarrow> connected (S \<inter> T)
connected S
connected T
U = S \<union> T
closedin (top_of_set U) S
closedin (top_of_set U) T

goal (1 subgoal):
 1. connected (S \<inter> T)
[PROOF STEP]
by blast


[STATEMENT]
lemma floor_nat_add_id: "0 \<le> (r :: real) \<Longrightarrow> r < 1 \<Longrightarrow> floor (real (n::nat) + r) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> r; r < 1\<rbrakk> \<Longrightarrow> \<lfloor>real n + r\<rfloor> = int n
[PROOF STEP]
by linarith


[STATEMENT]
lemma eventually_nonneg_divide' [eventually_nonzero_simps]:
  assumes "eventually_nonneg F (\<lambda>x. -f x)" "eventually_nonneg F (\<lambda>x. - g x)"
  shows   "eventually_nonneg F (\<lambda>x. f x / g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x / g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
eventually_nonneg F (\<lambda>x. - f x)
eventually_nonneg F (\<lambda>x. - g x)

goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x / g x)
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. (0::'b) \<le> - f x
\<forall>\<^sub>F x in F. (0::'b) \<le> - g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (0::'b) \<le> f x / g x
[PROOF STEP]
by eventually_elim (auto intro: divide_nonpos_nonpos)


[STATEMENT]
lemma set_homI [intro]:
  assumes "A \<subseteq> U"
  and "B \<subseteq> U"
  and "f : A\<rightarrow>B"
  and "f \<in> extensional A"
  shows "\<lparr>set_dom=A, set_func=f, set_cod=B\<rparr> \<in> hom (set_cat U) A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>set_dom = A, set_func = f, set_cod = B\<rparr> \<in> Hom\<^bsub>set_cat U\<^esub> A B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> U
B \<subseteq> U
f \<in> A \<rightarrow> B
f \<in> extensional A

goal (1 subgoal):
 1. \<lparr>set_dom = A, set_func = f, set_cod = B\<rparr> \<in> Hom\<^bsub>set_cat U\<^esub> A B
[PROOF STEP]
by (simp add: set_cat_def hom_def set_arrow_def)


[STATEMENT]
lemma fls_X_power_times_conv_shift:
  "fls_X ^ n * f = fls_shift (-int n) f" "f * fls_X ^ n = fls_shift (-int n) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_X ^ n * f = fls_shift (- int n) f &&& f * fls_X ^ n = fls_shift (- int n) f
[PROOF STEP]
using fls_times_both_shifted_simp[of "-int n" 1 0 f]
        fls_times_both_shifted_simp[of 0 f "-int n" 1]
[PROOF STATE]
proof (prove)
using this:
fls_X_intpow (int n) * fls_shift 0 f = fls_shift (- int n + 0) (1 * f)
fls_shift 0 f * fls_X_intpow (int n) = fls_shift (0 + - int n) (f * 1)

goal (1 subgoal):
 1. fls_X ^ n * f = fls_shift (- int n) f &&& f * fls_X ^ n = fls_shift (- int n) f
[PROOF STEP]
by    (simp_all add: fls_X_power_conv_shift_1)


[STATEMENT]
lemma "((if a then b else c) = d) = ((a \<longrightarrow> (b = d)) \<and> (\<not> a \<longrightarrow> (c = d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if a then b else c) = d) = ((a \<longrightarrow> b = d) \<and> (\<not> a \<longrightarrow> c = d))
[PROOF STEP]
nitpick [expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if a then b else c) = d) = ((a \<longrightarrow> b = d) \<and> (\<not> a \<longrightarrow> c = d))
[PROOF STEP]
by auto


[STATEMENT]
lemma gcd_add1 [simp]: "gcd (m + n) n = gcd m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (m + n) n = gcd m n
[PROOF STEP]
by (rule gcdI [symmetric]) (simp_all add: dvd_add_left_iff)


[STATEMENT]
theorem sup_state_Cons2:
  "(G \<turnstile> (xt, a) <=s (y#yt, b)) =
   (\<exists>x xt'. xt=x#xt' \<and> (G \<turnstile> x \<preceq> y) \<and> (G \<turnstile> (xt',a) <=s (yt,b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<turnstile> (xt, a) <=s (y # yt, b) = (\<exists>x xt'. xt = x # xt' \<and> G \<turnstile> x \<preceq> y \<and> G \<turnstile> (xt', a) <=s (yt, b))
[PROOF STEP]
by (auto simp add: sup_state_def stk_convert lesub_def Product.le_def sup_loc_Cons2)


[STATEMENT]
lemma prime_factors_characterization_nat:
  "S = {p. 0 < f (p::nat)} \<Longrightarrow>
    finite S \<Longrightarrow> \<forall>p\<in>S. prime p \<Longrightarrow> n = (\<Prod>p\<in>S. p ^ f p) \<Longrightarrow> prime_factors n = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S = {p. 0 < f p}; finite S; \<forall>p\<in>S. prime p; n = (\<Prod>p\<in>S. p ^ f p)\<rbrakk> \<Longrightarrow> prime_factors n = S
[PROOF STEP]
by (rule prime_factorization_unique_nat [THEN conjunct1, symmetric])


[STATEMENT]
lemma ceiling_numeral_power [simp]: "\<lceil>numeral x ^ n\<rceil> = numeral x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>numeral x ^ n\<rceil> = numeral x ^ n
[PROOF STEP]
by (metis ceiling_of_int of_int_numeral of_int_power)


[STATEMENT]
lemma min_0R [simp]: "min n 0 = 0" for n :: V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min n 0 = 0
[PROOF STEP]
by (simp add: min_absorb2)


[STATEMENT]
lemma ereal_uminus_complement:
  fixes S :: "ereal set"
  shows "uminus ` (- S) = - uminus ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uminus ` (- S) = - uminus ` S
[PROOF STEP]
by (auto intro!: bij_image_Compl_eq surjI[of _ uminus] simp: bij_betw_def)


[STATEMENT]
lemma (in information_space) entropy_le_card_not_0:
  assumes X: "simple_distributed M X f"
  shows "\<H>(X) \<le> log b (card (X ` space M \<inter> {x. f x \<noteq> 0}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
let ?X = "count_space (X`space M)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
have "\<H>(X) \<le> log b (measure ?X {x \<in> space ?X. f x \<noteq> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) \<le> log b \<P>(x in count_space (X ` space M). f x \<noteq> 0)
[PROOF STEP]
by (rule entropy_le[OF simple_distributed[OF X]])
       (insert X, auto simp: simple_distributed_finite[OF X] subset_eq integrable_count_space emeasure_count_space)
[PROOF STATE]
proof (state)
this:
\<H>(X) \<le> log b \<P>(x in count_space (X ` space M). f x \<noteq> 0)

goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<H>(X) \<le> log b \<P>(x in count_space (X ` space M). f x \<noteq> 0)

goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
have "measure ?X {x \<in> space ?X. f x \<noteq> 0} = card (X ` space M \<inter> {x. f x \<noteq> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<P>(x in count_space (X ` space M). f x \<noteq> 0) = real (card (X ` space M \<inter> {x. f x \<noteq> 0}))
[PROOF STEP]
by (simp_all add: simple_distributed_finite[OF X] subset_eq emeasure_count_space measure_def Int_def)
[PROOF STATE]
proof (state)
this:
\<P>(x in count_space (X ` space M). f x \<noteq> 0) = real (card (X ` space M \<inter> {x. f x \<noteq> 0}))

goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))

goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<H>(X) \<le> log b (real (card (X ` space M \<inter> {x. f x \<noteq> 0})))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_union_is_rbt: "\<lbrakk> is_rbt lt; is_rbt rt \<rbrakk> \<Longrightarrow> is_rbt (rbt_union lt rt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_rbt lt; is_rbt rt\<rbrakk> \<Longrightarrow> is_rbt (rbt_union lt rt)
[PROOF STEP]
by(simp add: rbt_union_def)


[STATEMENT]
lemma moebius_pt_moebius_similarity [simp]:
  assumes "a \<noteq> 0"
  shows "moebius_pt (moebius_similarity a b) z = (of_complex a) *\<^sub>h z +\<^sub>h (of_complex b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_similarity a b) z = of_complex a *\<^sub>h z +\<^sub>h of_complex b
[PROOF STEP]
unfolding moebius_similarity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (mk_moebius a b 0 1) z = of_complex a *\<^sub>h z +\<^sub>h of_complex b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. moebius_pt (mk_moebius a b 0 1) z = of_complex a *\<^sub>h z +\<^sub>h of_complex b
[PROOF STEP]
using mult_inf_right[of "of_complex a"]
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
of_complex a \<noteq> 0\<^sub>h \<Longrightarrow> of_complex a *\<^sub>h \<infinity>\<^sub>h = \<infinity>\<^sub>h

goal (1 subgoal):
 1. moebius_pt (mk_moebius a b 0 1) z = of_complex a *\<^sub>h z +\<^sub>h of_complex b
[PROOF STEP]
by (subst moebius_pt_bilinear, auto)


[STATEMENT]
lemma sin_zero_abs_cos_one: "sin x = 0 \<Longrightarrow> \<bar>cos x\<bar> = (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin x = 0 \<Longrightarrow> \<bar>cos x\<bar> = 1
[PROOF STEP]
using sin_zero_norm_cos_one
[PROOF STATE]
proof (prove)
using this:
sin ?x = (0::?'a) \<Longrightarrow> norm (cos ?x) = 1

goal (1 subgoal):
 1. sin x = 0 \<Longrightarrow> \<bar>cos x\<bar> = 1
[PROOF STEP]
by fastforce


[STATEMENT]
lemma gen_igbg_impl_rel_eext_def:
  "\<langle>Rm,Racc\<rangle>gen_igbg_impl_rel_eext = { (
  \<lparr> igbgi_num_acc = num_acci, igbgi_acc = acci, \<dots>=mi \<rparr>,
  \<lparr> igbg_num_acc = num_acc, igbg_acc = acc, \<dots>=m \<rparr>)
  | num_acci acci mi num_acc acc m.
    (num_acci,num_acc)\<in>nat_rel
  \<and> (acci,acc)\<in>Racc
  \<and> (mi,m)\<in>Rm
  }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>Rm, Racc\<rangle>gen_igbg_impl_rel_eext = {(\<lparr>igbgi_num_acc = num_acci, igbgi_acc = acci, \<dots> = mi\<rparr>, \<lparr>igbg_num_acc = num_acc, igbg_acc = acc, \<dots> = m\<rparr>) |num_acci acci mi num_acc acc m. (num_acci, num_acc) \<in> nat_rel \<and> (acci, acc) \<in> Racc \<and> (mi, m) \<in> Rm}
[PROOF STEP]
unfolding gen_igbg_impl_rel_eext_def_internal relAPP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(\<lparr>igbgi_num_acc = num_acci, igbgi_acc = acci, \<dots> = mi\<rparr>, \<lparr>igbg_num_acc = num_acc, igbg_acc = acc, \<dots> = m\<rparr>) |num_acci acci mi num_acc acc m. (num_acci, num_acc) \<in> nat_rel \<and> (acci, acc) \<in> Racc \<and> (mi, m) \<in> Rm} = {(\<lparr>igbgi_num_acc = num_acci, igbgi_acc = acci, \<dots> = mi\<rparr>, \<lparr>igbg_num_acc = num_acc, igbg_acc = acc, \<dots> = m\<rparr>) |num_acci acci mi num_acc acc m. (num_acci, num_acc) \<in> nat_rel \<and> (acci, acc) \<in> Racc \<and> (mi, m) \<in> Rm}
[PROOF STEP]
by simp


[STATEMENT]
lemma det_Gauss_Jordan_in_ij_det_P:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}" and i j::"'n"
shows "(fst (Gauss_Jordan_in_ij_det_P A i j)) * det A  = det (snd (Gauss_Jordan_in_ij_det_P A i j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_in_ij_det_P A i j) * det A = det (snd (Gauss_Jordan_in_ij_det_P A i j))
[PROOF STEP]
unfolding Gauss_Jordan_in_ij_det_P_def Let_def fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i = (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) then (1::'a) / A $ i $ j else - (1::'a) / A $ (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) $ j) * det A = det (Gauss_Jordan_in_ij A i j)
[PROOF STEP]
using det_Gauss_Jordan_in_ij_1[of A j i]
[PROOF STATE]
proof (prove)
using this:
(LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) = i \<Longrightarrow> det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A

goal (1 subgoal):
 1. (if i = (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) then (1::'a) / A $ i $ j else - (1::'a) / A $ (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) $ j) * det A = det (Gauss_Jordan_in_ij A i j)
[PROOF STEP]
using det_Gauss_Jordan_in_ij_2[of A j i]
[PROOF STATE]
proof (prove)
using this:
(LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) = i \<Longrightarrow> det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
(LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) \<noteq> i \<Longrightarrow> det (Gauss_Jordan_in_ij A i j) = - (1::'a) / A $ (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) $ j * det A

goal (1 subgoal):
 1. (if i = (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) then (1::'a) / A $ i $ j else - (1::'a) / A $ (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) $ j) * det A = det (Gauss_Jordan_in_ij A i j)
[PROOF STEP]
by auto


[STATEMENT]
lemma ord_cong:
  assumes "[k1 = k2] (mod n)"
  shows   "ord n k1 = ord n k2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord n k1 = ord n k2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord n k1 = ord n k2
[PROOF STEP]
have "ord n (k1 mod n) = ord n (k2 mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord n (k1 mod n) = ord n (k2 mod n)
[PROOF STEP]
by (simp only: assms[unfolded cong_def])
[PROOF STATE]
proof (state)
this:
ord n (k1 mod n) = ord n (k2 mod n)

goal (1 subgoal):
 1. ord n k1 = ord n k2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ord n (k1 mod n) = ord n (k2 mod n)

goal (1 subgoal):
 1. ord n k1 = ord n k2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ord n k1 = ord n k2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_cutoff_fps_const: "fps_cutoff n (fps_const c) = (if n = 0 then 0 else fps_const c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_cutoff n (fps_const c) = (if n = 0 then 0 else fps_const c)
[PROOF STEP]
by (simp add: fps_eq_iff)


[STATEMENT]
lemma VUnion_vempty_conv_left: "0 = \<Union>\<^sub>\<circ>A \<longleftrightarrow> (\<forall>x\<in>\<^sub>\<circ>A. x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 = \<Union>\<^sub>\<circ> A) = (\<forall>x\<in>elts A. x = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma less_sum_to_sum_list: "(\<Sum>x < n. f x) = (\<Sum>x\<leftarrow>[0..< n]. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<n} = sum_list (map f [0..<n])
[PROOF STEP]
by (simp add: atLeast_upt sum_list_distinct_conv_sum_set)


[STATEMENT]
lemma iall_triv[simp]: "(\<box> t I. P) = ((\<exists>t. t \<in> I) \<longrightarrow> P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<box> t I. P) = ((\<exists>t. t \<in> I) \<longrightarrow> P)
[PROOF STEP]
by (simp add: iAll_def)


[STATEMENT]
lemma countable_as_injective_image:
  assumes "countable A" "infinite A"
  obtains f :: "nat \<Rightarrow> 'a" where "A = range f" "inj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>A = range f; inj f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis bij_betw_def bij_betw_from_nat_into [OF assms])


[STATEMENT]
lemma ptensor_mat_add:
  assumes "m1 \<in> carrier_mat d1 d1"
    and "m2 \<in> carrier_mat d1 d1"
    and "m3 \<in> carrier_mat d2 d2"
  shows "ptensor_mat (m1 + m2) m3 = ptensor_mat m1 m3 + ptensor_mat m2 m3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ptensor_mat (m1 + m2) m3 = ptensor_mat m1 m3 + ptensor_mat m2 m3
[PROOF STEP]
unfolding ptensor_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat dims0 vars1' (m1 + m2) m3 = tensor_mat dims0 vars1' m1 m3 + tensor_mat dims0 vars1' m2 m3
[PROOF STEP]
apply (rule partial_state.tensor_mat_add1)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. m1 \<in> carrier_mat (partial_state.d1 dims0 vars1') (partial_state.d1 dims0 vars1')
 2. m2 \<in> carrier_mat (partial_state.d1 dims0 vars1') (partial_state.d1 dims0 vars1')
 3. m3 \<in> carrier_mat (partial_state.d2 dims0 vars1') (partial_state.d2 dims0 vars1')
[PROOF STEP]
unfolding partial_state.d1_def partial_state.d2_def
    partial_state.dims1_def partial_state.dims2_def nths_vars1'
    nths_vars2'
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. m1 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
 2. m2 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
 3. m3 \<in> carrier_mat (prod_list dims2) (prod_list dims2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat d1 d1
m2 \<in> carrier_mat d1 d1
m3 \<in> carrier_mat d2 d2

goal (3 subgoals):
 1. m1 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
 2. m2 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
 3. m3 \<in> carrier_mat (prod_list dims2) (prod_list dims2)
[PROOF STEP]
unfolding d1_def d2_def
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
m2 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
m3 \<in> carrier_mat (prod_list dims2) (prod_list dims2)

goal (3 subgoals):
 1. m1 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
 2. m2 \<in> carrier_mat (prod_list dims1) (prod_list dims1)
 3. m3 \<in> carrier_mat (prod_list dims2) (prod_list dims2)
[PROOF STEP]
by auto


[STATEMENT]
lemma log_le_zero_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> log a x \<le> 0 \<longleftrightarrow> x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (log a x \<le> 0) = (x \<le> 1)
[PROOF STEP]
using log_le_cancel_iff[of a x 1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < x; 0 < 1\<rbrakk> \<Longrightarrow> (log a x \<le> log a 1) = (x \<le> 1)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (log a x \<le> 0) = (x \<le> 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma size_Diff2_less: "x\<in># M \<Longrightarrow> y\<in># M \<Longrightarrow> size (M - {#x#} - {#y#}) < size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in># M; y \<in># M\<rbrakk> \<Longrightarrow> size (M - {#x#} - {#y#}) < size M
[PROOF STEP]
by (metis less_imp_diff_less size_Diff1_less size_Diff_subset_Int)


[STATEMENT]
lemma lattice_of_of_int: assumes G: "set F \<subseteq> carrier_vec n"
  and "f \<in> vec_module.lattice_of n F"
shows "map_vec rat_of_int f \<in> vec_module.lattice_of n (map (map_vec of_int) F)"
  (is "?f \<in> vec_module.lattice_of _ ?F")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
let ?sl = "abelian_monoid.sumlist (module_vec TYPE('a::semiring_1) n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
note d = vec_module.lattice_of_def
[PROOF STATE]
proof (state)
this:
vec_module.lattice_of ?n ?fs = range (\<lambda>c. abelian_monoid.sumlist (module_vec TYPE(?'a) ?n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v ?fs ! i) [0..<length ?fs]))

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
note dim = vec_module.sumlist_dim
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> set ?xs \<Longrightarrow> x \<in> carrier_vec ?n) \<Longrightarrow> dim_vec (abelian_monoid.sumlist (module_vec TYPE(?'a) ?n) ?xs) = ?n

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
note sumlist_vec_index = vec_module.sumlist_vec_index
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>x. x \<in> set ?xs \<Longrightarrow> x \<in> carrier_vec ?n; ?i < ?n\<rbrakk> \<Longrightarrow> abelian_monoid.sumlist (module_vec TYPE(?'a) ?n) ?xs $ ?i = (\<Sum>x\<leftarrow>?xs. x $ ?i)

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
from G
[PROOF STATE]
proof (chain)
picking this:
set F \<subseteq> carrier_vec n
[PROOF STEP]
have Gi: "\<And> i. i < length F \<Longrightarrow> F ! i \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set F \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<And>i. i < length F \<Longrightarrow> F ! i \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i1 < length F \<Longrightarrow> F ! ?i1 \<in> carrier_vec n

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
from Gi
[PROOF STATE]
proof (chain)
picking this:
?i1 < length F \<Longrightarrow> F ! ?i1 \<in> carrier_vec n
[PROOF STEP]
have Gid: "\<And> i. i < length F \<Longrightarrow> dim_vec (F ! i) = n"
[PROOF STATE]
proof (prove)
using this:
?i1 < length F \<Longrightarrow> F ! ?i1 \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>i. i < length F \<Longrightarrow> dim_vec (F ! i) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i1 < length F \<Longrightarrow> dim_vec (F ! ?i1) = n

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
from assms(2)[unfolded d]
[PROOF STATE]
proof (chain)
picking this:
f \<in> range (\<lambda>c. abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F]))
[PROOF STEP]
obtain c where
    ffc: "f = ?sl (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F])" (is "_ = ?g")
[PROOF STATE]
proof (prove)
using this:
f \<in> range (\<lambda>c. abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F]))

goal (1 subgoal):
 1. (\<And>c. f = abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F]) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F])

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
have "?f = ?sl (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v ?F ! i) [0..<length ?F])" (is "_ = ?gg")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])
[PROOF STEP]
have d1[simp]: "dim_vec ?g = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F])) = n
[PROOF STEP]
by (subst dim, auto simp: Gi)
[PROOF STATE]
proof (state)
this:
dim_vec (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F])) = n

goal (1 subgoal):
 1. of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])
[PROOF STEP]
have d2[simp]: "dim_vec ?gg = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])) = n
[PROOF STEP]
unfolding length_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F])) = n
[PROOF STEP]
by (subst vec_module.sumlist_dim, auto simp: Gi G)
[PROOF STATE]
proof (state)
this:
dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])) = n

goal (1 subgoal):
 1. of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])
[PROOF STEP]
unfolding ffc length_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_hom.vec_hom (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F])) = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F])
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F])) \<Longrightarrow> of_int_hom.vec_hom (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F])) $ i = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F]) $ i
 2. dim_vec (of_int_hom.vec_hom (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v F ! i) [0..<length F]))) = dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F]))
[PROOF STEP]
apply (insert d1 d2, auto)[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. c i \<cdot>\<^sub>v F ! i) [0..<length F])) = n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F])) = n\<rbrakk> \<Longrightarrow> rat_of_int (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. c i \<cdot>\<^sub>v F ! i) [0..<length F]) $ i) = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F]) $ i
[PROOF STEP]
apply (subst (1 2) sumlist_vec_index, auto simp: o_def Gi G)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. c i \<cdot>\<^sub>v F ! i) [0..<length F])) = n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F])) = n\<rbrakk> \<Longrightarrow> rat_of_int (\<Sum>x\<leftarrow>[0..<length F]. (c x \<cdot>\<^sub>v F ! x) $ i) = (\<Sum>x\<leftarrow>[0..<length F]. (rat_of_int (c x) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! x) $ i)
[PROOF STEP]
apply (unfold of_int_hom.hom_sum_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. c i \<cdot>\<^sub>v F ! i) [0..<length F])) = n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F])) = n\<rbrakk> \<Longrightarrow> sum_list (map rat_of_int (map (\<lambda>x. (c x \<cdot>\<^sub>v F ! x) $ i) [0..<length F])) = (\<Sum>x\<leftarrow>[0..<length F]. (rat_of_int (c x) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! x) $ i)
[PROOF STEP]
apply (intro arg_cong[of _ _ sum_list] map_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(int) n) (map (\<lambda>i. c i \<cdot>\<^sub>v F ! i) [0..<length F])) = n; dim_vec (abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length F])) = n\<rbrakk> \<Longrightarrow> map rat_of_int (map (\<lambda>x. (c x \<cdot>\<^sub>v F ! x) $ i) [0..<length F]) = map (\<lambda>x. (rat_of_int (c x) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! x) $ i) [0..<length F]
[PROOF STEP]
by (auto simp: G Gi, (subst index_smult_vec, simp add: Gid)+,
         subst index_map_vec, auto simp: Gid)
[PROOF STATE]
proof (state)
this:
of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
thus "?f \<in> vec_module.lattice_of n ?F"
[PROOF STATE]
proof (prove)
using this:
of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)
[PROOF STEP]
unfolding d
[PROOF STATE]
proof (prove)
using this:
of_int_hom.vec_hom f = abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)])

goal (1 subgoal):
 1. of_int_hom.vec_hom f \<in> range (\<lambda>c. abelian_monoid.sumlist (module_vec TYPE(rat) n) (map (\<lambda>i. rat_of_int (c i) \<cdot>\<^sub>v map of_int_hom.vec_hom F ! i) [0..<length (map of_int_hom.vec_hom F)]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_int_hom.vec_hom f \<in> vec_module.lattice_of n (map of_int_hom.vec_hom F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fvi_Suc: "x \<in> fvi (Suc b) \<phi> \<longleftrightarrow> Suc x \<in> fvi b \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> fvi (Suc b) \<phi>) = (Suc x \<in> fvi b \<phi>)
[PROOF STEP]
using fvi_plus[where c=1]
[PROOF STATE]
proof (prove)
using this:
(?x \<in> fvi (?b + 1) ?\<phi>) = (?x + 1 \<in> fvi ?b ?\<phi>)

goal (1 subgoal):
 1. (x \<in> fvi (Suc b) \<phi>) = (Suc x \<in> fvi b \<phi>)
[PROOF STEP]
by simp


[STATEMENT]
lemma adj_cblinfun_compose[simp]:
  fixes B::\<open>'a::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'b::chilbert_space\<close>
    and A::\<open>'b \<Rightarrow>\<^sub>C\<^sub>L 'c::complex_inner\<close>
  shows "(A o\<^sub>C\<^sub>L B)* =  (B*) o\<^sub>C\<^sub>L (A*)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A o\<^sub>C\<^sub>L B)* = B* o\<^sub>C\<^sub>L A*
[PROOF STEP]
proof transfer
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. \<lbrakk>bounded_clinear A; bounded_clinear B\<rbrakk> \<Longrightarrow> (A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>
[PROOF STEP]
fix  A :: \<open>'b \<Rightarrow> 'c\<close> and B :: \<open>'a \<Rightarrow> 'b\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. \<lbrakk>bounded_clinear A; bounded_clinear B\<rbrakk> \<Longrightarrow> (A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>
[PROOF STEP]
assume \<open>bounded_clinear A\<close> and \<open>bounded_clinear B\<close>
[PROOF STATE]
proof (state)
this:
bounded_clinear A
bounded_clinear B

goal (1 subgoal):
 1. \<And>A B. \<lbrakk>bounded_clinear A; bounded_clinear B\<rbrakk> \<Longrightarrow> (A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>
[PROOF STEP]
hence \<open>bounded_clinear (A \<circ> B)\<close>
[PROOF STATE]
proof (prove)
using this:
bounded_clinear A
bounded_clinear B

goal (1 subgoal):
 1. bounded_clinear (A \<circ> B)
[PROOF STEP]
by (simp add: comp_bounded_clinear)
[PROOF STATE]
proof (state)
this:
bounded_clinear (A \<circ> B)

goal (1 subgoal):
 1. \<And>A B. \<lbrakk>bounded_clinear A; bounded_clinear B\<rbrakk> \<Longrightarrow> (A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>
[PROOF STEP]
have \<open>((A \<circ> B) u \<bullet>\<^sub>C v) = (u \<bullet>\<^sub>C (B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>) v)\<close>
    for u v
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<circ> B) u \<bullet>\<^sub>C v = u \<bullet>\<^sub>C (B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>) v
[PROOF STEP]
by (metis (no_types, lifting) cadjoint_univ_prop \<open>bounded_clinear A\<close> \<open>bounded_clinear B\<close> cinner_commute' comp_def)
[PROOF STATE]
proof (state)
this:
(A \<circ> B) ?u \<bullet>\<^sub>C ?v = ?u \<bullet>\<^sub>C (B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>) ?v

goal (1 subgoal):
 1. \<And>A B. \<lbrakk>bounded_clinear A; bounded_clinear B\<rbrakk> \<Longrightarrow> (A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>
[PROOF STEP]
thus \<open>(A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>\<close>
[PROOF STATE]
proof (prove)
using this:
(A \<circ> B) ?u \<bullet>\<^sub>C ?v = ?u \<bullet>\<^sub>C (B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>) ?v

goal (1 subgoal):
 1. (A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>
[PROOF STEP]
using \<open>bounded_clinear (A \<circ> B)\<close>
[PROOF STATE]
proof (prove)
using this:
(A \<circ> B) ?u \<bullet>\<^sub>C ?v = ?u \<bullet>\<^sub>C (B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>) ?v
bounded_clinear (A \<circ> B)

goal (1 subgoal):
 1. (A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>
[PROOF STEP]
by (metis cadjoint_eqI cinner_commute')
[PROOF STATE]
proof (state)
this:
(A \<circ> B)\<^sup>\<dagger> = B\<^sup>\<dagger> \<circ> A\<^sup>\<dagger>

goal:
No subgoals!
[PROOF STEP]
qed