[STATEMENT]
lemma 860:
  fixes b r and q::int
  defines "m \<equiv> b * q - q * q - 1"
  shows "(q * \<alpha> b r - (int b * \<alpha> b r -  \<alpha> b (Suc r))) mod m = (q ^ r) mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
proof(cases "r=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r = 0 \<Longrightarrow> (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
 2. r \<noteq> 0 \<Longrightarrow> (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r = 0

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
 2. r \<noteq> 0 \<Longrightarrow> (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r = 0

goal (1 subgoal):
 1. (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r \<noteq> 0

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
using alpha_n[of b "r-1"] 86[of q b "r-1"] m_def
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
\<alpha> b (Suc (Suc (r - 1))) = int b * \<alpha> b (Suc (r - 1)) - \<alpha> b (r - 1)
(q * \<alpha> b (r - 1 + 1) - \<alpha> b (r - 1)) mod (int b * q - q * q - 1) = q ^ (r - 1 + 1) mod (int b * q - q * q - 1)
m \<equiv> int b * q - q * q - 1

goal (1 subgoal):
 1. (q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = q ^ r mod m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem If_WbisT[simp]:
assumes "compatTst tst" and "c1 \<approx>wT d1" and "c2 \<approx>wT d2"
shows "If tst c1 c2 \<approx>wT If tst d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. if tst then c1 else c2 \<approx>wT if tst then d1 else d2
[PROOF STEP]
using assms thetaIfWT_WbisT
[PROOF STATE]
proof (prove)
using this:
compatTst tst
c1 \<approx>wT d1
c2 \<approx>wT d2
thetaIfWT \<subseteq> WbisT

goal (1 subgoal):
 1. if tst then c1 else c2 \<approx>wT if tst then d1 else d2
[PROOF STEP]
unfolding thetaIfWT_def
[PROOF STATE]
proof (prove)
using this:
compatTst tst
c1 \<approx>wT d1
c2 \<approx>wT d2
{(if tst then c1 else c2, if tst then d1 else d2) |tst c1 c2 d1 d2. compatTst tst \<and> c1 \<approx>wT d1 \<and> c2 \<approx>wT d2} \<subseteq> WbisT

goal (1 subgoal):
 1. if tst then c1 else c2 \<approx>wT if tst then d1 else d2
[PROOF STEP]
by blast


[STATEMENT]
lemma "x - (-y) = x + (y::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - - y = x + y
[PROOF STEP]
by arith


[STATEMENT]
lemma ncols_transpose: "ncols (transpose A) = nrows A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols (Finite_Cartesian_Product.transpose A) = nrows A
[PROOF STEP]
unfolding nrows_def ncols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('b) = CARD('b)
[PROOF STEP]
..


[STATEMENT]
theorem
  assumes a: "a > 0" and b: "b > (0 :: real)"
  shows has_integral_Beta_real':
          "((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}"
    and Beta_conv_nn_integral:
          "Beta a b = (\<integral>\<^sup>+u. ennreal (indicator {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..} &&& ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
define I where
    "I = (\<integral>\<^sup>+u. ennreal (indicator {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel)"
[PROOF STATE]
proof (state)
this:
I = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "Gamma (a + b) > 0" "Beta a b > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Gamma (a + b) &&& 0 < Beta a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b

goal (1 subgoal):
 1. 0 < Gamma (a + b) &&& 0 < Beta a b
[PROOF STEP]
by (simp_all add: add_pos_pos Beta_def)
[PROOF STATE]
proof (state)
this:
0 < Gamma (a + b)
0 < Beta a b

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
from a b
[PROOF STATE]
proof (chain)
picking this:
0 < a
0 < b
[PROOF STEP]
have "ennreal (Gamma a * Gamma b) =
    (\<integral>\<^sup>+ t. ennreal (indicator {0..} t * t powr (a - 1) / exp t) \<partial>lborel) *
    (\<integral>\<^sup>+ t. ennreal (indicator {0..} t * t powr (b - 1) / exp t) \<partial>lborel)"
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b

goal (1 subgoal):
 1. ennreal (Gamma a * Gamma b) = \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) \<partial>lborel * \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (b - 1) / exp t) \<partial>lborel
[PROOF STEP]
by (subst ennreal_mult') (simp_all add: Gamma_conv_nn_integral_real)
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b) = \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) \<partial>lborel * \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (b - 1) / exp t) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b) = \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) \<partial>lborel * \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (b - 1) / exp t) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+t. \<integral>\<^sup>+u. ennreal (indicator {0..} t * t powr (a - 1) / exp t) *
                            ennreal (indicator {0..} u * u powr (b - 1) / exp u) \<partial>lborel \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) \<partial>lborel * \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (b - 1) / exp t) \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) * ennreal (indicat_real {0..} u * u powr (b - 1) / exp u) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (simp add: nn_integral_cmult nn_integral_multc)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) \<partial>lborel * \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (b - 1) / exp t) \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) * ennreal (indicat_real {0..} u * u powr (b - 1) / exp u) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) \<partial>lborel * \<integral>\<^sup>+ t. ennreal (indicat_real {0..} t * t powr (b - 1) / exp t) \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) * ennreal (indicat_real {0..} u * u powr (b - 1) / exp u) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+t. indicator {0<..} t * (\<integral>\<^sup>+u. indicator {0..} u * t powr (a - 1) * u powr (b - 1)
                            / exp (t + u) \<partial>lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) * ennreal (indicat_real {0..} u * u powr (b - 1) / exp u) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong_AE AE_I[of _ _ "{0}"])
       (auto simp: indicator_def divide_ennreal ennreal_mult' [symmetric] exp_add mult_ac)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) * ennreal (indicat_real {0..} u * u powr (b - 1) / exp u) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real {0..} t * t powr (a - 1) / exp t) * ennreal (indicat_real {0..} u * u powr (b - 1) / exp u) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+t. indicator {0<..} t * (\<integral>\<^sup>+u. indicator {0..} u * t powr (a - 1) * u powr (b - 1)
                            / exp (t + u)
                    \<partial>(density (distr lborel borel ((*) t)) (\<lambda>x. ennreal \<bar>t\<bar>))) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>density (distr lborel borel ((*) t)) (\<lambda>x. ennreal \<bar>t\<bar>) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong mult_indicator_cong, subst lborel_distr_mult' [symmetric]) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>density (distr lborel borel ((*) t)) (\<lambda>x. ennreal \<bar>t\<bar>) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>density (distr lborel borel ((*) t)) (\<lambda>x. ennreal \<bar>t\<bar>) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(t::real). indicator {0<..} t * (\<integral>\<^sup>+u.
                     indicator {0..} (u * t) * t powr a *
                     (u * t) powr (b - 1) / exp (t + t * u) \<partial>lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>density (distr lborel borel ((*) t)) (\<lambda>x. ennreal \<bar>t\<bar>) \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} (x * t) * t powr a * (x * t) powr (b - 1) / exp (t + t * x)) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong mult_indicator_cong)
       (auto simp: nn_integral_density nn_integral_distr algebra_simps powr_diff
             simp flip: ennreal_mult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>density (distr lborel borel ((*) t)) (\<lambda>x. ennreal \<bar>t\<bar>) \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} (x * t) * t powr a * (x * t) powr (b - 1) / exp (t + t * x)) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} x * t powr (a - 1) * x powr (b - 1) / exp (t + x)) \<partial>density (distr lborel borel ((*) t)) (\<lambda>x. ennreal \<bar>t\<bar>) \<partial>lborel = \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} (x * t) * t powr a * (x * t) powr (b - 1) / exp (t + t * x)) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(t::real). \<integral>\<^sup>+u. indicator ({0<..}\<times>{0..}) (t, u) *
                     t powr a * (u * t) powr (b - 1) / exp (t * (u + 1)) \<partial>lborel \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} (x * t) * t powr a * (x * t) powr (b - 1) / exp (t + t * x)) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr a * (x * t) powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (subst nn_integral_cmult [symmetric], simp, intro nn_integral_cong)
       (auto simp: indicator_def zero_le_mult_iff algebra_simps)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} (x * t) * t powr a * (x * t) powr (b - 1) / exp (t + t * x)) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr a * (x * t) powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. indicator {0<..} t * \<integral>\<^sup>+ x. ennreal (indicat_real {0..} (x * t) * t powr a * (x * t) powr (b - 1) / exp (t + t * x)) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr a * (x * t) powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(t::real). \<integral>\<^sup>+u. indicator ({0<..}\<times>{0..}) (t, u) *
                     t powr (a + b - 1) * u powr (b - 1) / exp (t * (u + 1)) \<partial>lborel \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr a * (x * t) powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr (a + b - 1) * x powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong) (auto simp: powr_add powr_diff indicator_def powr_mult field_simps)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr a * (x * t) powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr (a + b - 1) * x powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr a * (x * t) powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr (a + b - 1) * x powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(u::real). \<integral>\<^sup>+t. indicator ({0<..}\<times>{0..}) (t, u) *
                     t powr (a + b - 1) * u powr (b - 1) / exp (t * (u + 1)) \<partial>lborel \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr (a + b - 1) * x powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (x, u) * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (rule lborel_pair.Fubini') auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr (a + b - 1) * x powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (x, u) * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (t, x) * t powr (a + b - 1) * x powr (b - 1) / exp (t * (x + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (x, u) * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(u::real). indicator {0..} u * (\<integral>\<^sup>+t. indicator {0<..} t *
                     t powr (a + b - 1) * u powr (b - 1) / exp (t * (u + 1)) \<partial>lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (x, u) * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong mult_indicator_cong) (auto simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (x, u) * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0..}) (x, u) * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(u::real). indicator {0<..} u * (\<integral>\<^sup>+t. indicator {0<..} t *
                     t powr (a + b - 1) * u powr (b - 1) / exp (t * (u + 1)) \<partial>lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. indicator {0..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong_AE AE_I[of _ _ "{0}"]) (auto simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(u::real). indicator {0<..} u * (\<integral>\<^sup>+t. indicator {0<..} t *
                     t powr (a + b - 1) * u powr (b - 1) / exp (t * (u + 1))
                    \<partial>(density (distr lborel borel ((*) (1/(1+u)))) (\<lambda>x. ennreal \<bar>1/(1+u)\<bar>))) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>density (distr lborel borel ((*) (1 / (1 + u)))) (\<lambda>x. ennreal \<bar>1 / (1 + u)\<bar>) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong mult_indicator_cong, subst lborel_distr_mult' [symmetric]) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>density (distr lborel borel ((*) (1 / (1 + u)))) (\<lambda>x. ennreal \<bar>1 / (1 + u)\<bar>) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>density (distr lborel borel ((*) (1 / (1 + u)))) (\<lambda>x. ennreal \<bar>1 / (1 + u)\<bar>) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+(u::real). indicator {0<..} u *
                    (\<integral>\<^sup>+t. ennreal (1 / (u + 1)) * ennreal (indicator {0<..} (t / (u + 1)) *
                     (t / (1+u)) powr (a + b - 1) * u powr (b - 1) / exp t)
                    \<partial>lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>density (distr lborel borel ((*) (1 / (1 + u)))) (\<lambda>x. ennreal \<bar>1 / (1 + u)\<bar>) \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ t. ennreal (1 / (u + 1)) * ennreal (indicat_real {0<..} (t / (u + 1)) * (t / (1 + u)) powr (a + b - 1) * u powr (b - 1) / exp t) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong mult_indicator_cong)
       (auto simp: nn_integral_distr nn_integral_density add_ac)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>density (distr lborel borel ((*) (1 / (1 + u)))) (\<lambda>x. ennreal \<bar>1 / (1 + u)\<bar>) \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ t. ennreal (1 / (u + 1)) * ennreal (indicat_real {0<..} (t / (u + 1)) * (t / (1 + u)) powr (a + b - 1) * u powr (b - 1) / exp t) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) * u powr (b - 1) / exp (x * (u + 1))) \<partial>density (distr lborel borel ((*) (1 / (1 + u)))) (\<lambda>x. ennreal \<bar>1 / (1 + u)\<bar>) \<partial>lborel = \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ t. ennreal (1 / (u + 1)) * ennreal (indicat_real {0<..} (t / (u + 1)) * (t / (1 + u)) powr (a + b - 1) * u powr (b - 1) / exp t) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+u. \<integral>\<^sup>+t. indicator ({0<..}\<times>{0<..}) (u, t) *
                    1/(u+1) * (t / (u+1)) powr (a + b - 1) * u powr (b - 1) / exp t
                    \<partial>lborel \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ t. ennreal (1 / (u + 1)) * ennreal (indicat_real {0<..} (t / (u + 1)) * (t / (1 + u)) powr (a + b - 1) * u powr (b - 1) / exp t) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0<..}) (u, x) * 1 / (u + 1) * (x / (u + 1)) powr (a + b - 1) * u powr (b - 1) / exp x) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (subst nn_integral_cmult [symmetric], simp, intro nn_integral_cong)
       (auto simp: indicator_def field_simps divide_ennreal simp flip: ennreal_mult ennreal_mult')
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ t. ennreal (1 / (u + 1)) * ennreal (indicat_real {0<..} (t / (u + 1)) * (t / (1 + u)) powr (a + b - 1) * u powr (b - 1) / exp t) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0<..}) (u, x) * 1 / (u + 1) * (x / (u + 1)) powr (a + b - 1) * u powr (b - 1) / exp x) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. indicator {0<..} u * \<integral>\<^sup>+ t. ennreal (1 / (u + 1)) * ennreal (indicat_real {0<..} (t / (u + 1)) * (t / (1 + u)) powr (a + b - 1) * u powr (b - 1) / exp t) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0<..}) (u, x) * 1 / (u + 1) * (x / (u + 1)) powr (a + b - 1) * u powr (b - 1) / exp x) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+u. \<integral>\<^sup>+t. ennreal (indicator {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) *
                            ennreal (indicator {0<..} t * t powr (a + b - 1) / exp t)
                    \<partial>lborel \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0<..}) (u, x) * 1 / (u + 1) * (x / (u + 1)) powr (a + b - 1) * u powr (b - 1) / exp x) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ t. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) * ennreal (indicat_real {0<..} t * t powr (a + b - 1) / exp t) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong)
       (auto simp: indicator_def powr_add powr_diff powr_divide powr_minus divide_simps add_ac
             simp flip: ennreal_mult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0<..}) (u, x) * 1 / (u + 1) * (x / (u + 1)) powr (a + b - 1) * u powr (b - 1) / exp x) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ t. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) * ennreal (indicat_real {0<..} t * t powr (a + b - 1) / exp t) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. \<integral>\<^sup>+ x. ennreal (indicat_real ({0<..} \<times> {0<..}) (u, x) * 1 / (u + 1) * (x / (u + 1)) powr (a + b - 1) * u powr (b - 1) / exp x) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ u. \<integral>\<^sup>+ t. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) * ennreal (indicat_real {0<..} t * t powr (a + b - 1) / exp t) \<partial>lborel \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = I * (\<integral>\<^sup>+t. indicator {0<..} t * t powr (a + b - 1) / exp t \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. \<integral>\<^sup>+ t. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) * ennreal (indicat_real {0<..} t * t powr (a + b - 1) / exp t) \<partial>lborel \<partial>lborel = I * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) / exp x) \<partial>lborel
[PROOF STEP]
by (simp add: nn_integral_cmult nn_integral_multc I_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. \<integral>\<^sup>+ t. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) * ennreal (indicat_real {0<..} t * t powr (a + b - 1) / exp t) \<partial>lborel \<partial>lborel = I * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) / exp x) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. \<integral>\<^sup>+ t. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) * ennreal (indicat_real {0<..} t * t powr (a + b - 1) / exp t) \<partial>lborel \<partial>lborel = I * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) / exp x) \<partial>lborel

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "(\<integral>\<^sup>+t. indicator {0<..} t * t powr (a + b - 1) / exp t \<partial>lborel) =
               ennreal (Gamma (a + b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) / exp x) \<partial>lborel = ennreal (Gamma (a + b))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) / exp x) \<partial>lborel = ennreal (Gamma (a + b))
[PROOF STEP]
by (subst Gamma_conv_nn_integral_real)
       (auto intro!: nn_integral_cong_AE[OF AE_I[of _ _ "{0}"]]
             simp: indicator_def split: if_splits split_of_bool_asm)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * x powr (a + b - 1) / exp x) \<partial>lborel = ennreal (Gamma (a + b))

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ennreal (Gamma a * Gamma b) = I * ennreal (Gamma (a + b))
[PROOF STEP]
have "ennreal (Gamma a * Gamma b) = I * ennreal (Gamma (a + b))"
[PROOF STATE]
proof (prove)
using this:
ennreal (Gamma a * Gamma b) = I * ennreal (Gamma (a + b))

goal (1 subgoal):
 1. ennreal (Gamma a * Gamma b) = I * ennreal (Gamma (a + b))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b) = I * ennreal (Gamma (a + b))

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
hence "ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) =
           I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b))"
[PROOF STATE]
proof (prove)
using this:
ennreal (Gamma a * Gamma b) = I * ennreal (Gamma (a + b))

goal (1 subgoal):
 1. ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) = I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) = I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b))

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) = I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b))

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b)) = I
[PROOF STEP]
using \<open>Gamma (a + b) > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < Gamma (a + b)

goal (1 subgoal):
 1. I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b)) = I
[PROOF STEP]
by (intro ennreal_mult_divide_eq) auto
[PROOF STATE]
proof (state)
this:
I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b)) = I

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
I * ennreal (Gamma (a + b)) / ennreal (Gamma (a + b)) = I

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) =
               ennreal (Gamma a * Gamma b / Gamma (a + b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) = ennreal (Gamma a * Gamma b / Gamma (a + b))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b

goal (1 subgoal):
 1. ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) = ennreal (Gamma a * Gamma b / Gamma (a + b))
[PROOF STEP]
by (intro divide_ennreal) auto
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) = ennreal (Gamma a * Gamma b / Gamma (a + b))

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b) / ennreal (Gamma (a + b)) = ennreal (Gamma a * Gamma b / Gamma (a + b))

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
have "\<dots> = ennreal (Beta a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (Gamma a * Gamma b / Gamma (a + b)) = ennreal (Beta a b)
[PROOF STEP]
by (simp add: Beta_def)
[PROOF STATE]
proof (state)
this:
ennreal (Gamma a * Gamma b / Gamma (a + b)) = ennreal (Beta a b)

goal (2 subgoals):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
 2. ennreal (Beta a b) = \<integral>\<^sup>+ u. ennreal (indicat_real {0<..} u * u powr (b - 1) / (1 + u) powr (a + b)) \<partial>lborel
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ennreal (Beta a b) = I
[PROOF STEP]
show *: "ennreal (Beta a b) = I"
[PROOF STATE]
proof (prove)
using this:
ennreal (Beta a b) = I

goal (1 subgoal):
 1. ennreal (Beta a b) = I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ennreal (Beta a b) = I

goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
[PROOF STEP]
define f where "f = (\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b))

goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
[PROOF STEP]
have "((\<lambda>u. indicator {0<..} u * f u) has_integral Beta a b) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. indicat_real {0<..} u * f u) has_integral Beta a b) UNIV
[PROOF STEP]
using * \<open>Beta a b > 0\<close>
[PROOF STATE]
proof (prove)
using this:
ennreal (Beta a b) = I
0 < Beta a b

goal (1 subgoal):
 1. ((\<lambda>u. indicat_real {0<..} u * f u) has_integral Beta a b) UNIV
[PROOF STEP]
by (subst has_integral_iff_nn_integral_lebesgue)
       (auto simp: f_def measurable_completion nn_integral_completion I_def mult_ac)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. indicat_real {0<..} u * f u) has_integral Beta a b) UNIV

goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>u. indicat_real {0<..} u * f u) has_integral Beta a b) UNIV

goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
[PROOF STEP]
have "(\<lambda>u. indicator {0<..} u * f u) = (\<lambda>u. if u \<in> {0<..} then f u else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. indicat_real {0<..} u * f u) = (\<lambda>u. if u \<in> {0<..} then f u else 0)
[PROOF STEP]
by (auto simp: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>u. indicat_real {0<..} u * f u) = (\<lambda>u. if u \<in> {0<..} then f u else 0)

goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>u. indicat_real {0<..} u * f u) = (\<lambda>u. if u \<in> {0<..} then f u else 0)

goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
[PROOF STEP]
have "(\<dots> has_integral Beta a b) UNIV \<longleftrightarrow> (f has_integral Beta a b) {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. if u \<in> {0<..} then f u else 0) has_integral Beta a b) UNIV = (f has_integral Beta a b) {0<..}
[PROOF STEP]
by (rule has_integral_restrict_UNIV)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. if u \<in> {0<..} then f u else 0) has_integral Beta a b) UNIV = (f has_integral Beta a b) {0<..}

goal (1 subgoal):
 1. ((\<lambda>u. u powr (b - 1) / (1 + u) powr (a + b)) has_integral Beta a b) {0<..}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f has_integral Beta a b) {0<..}
[PROOF STEP]
show \<dots>
[PROOF STATE]
proof (prove)
using this:
(f has_integral Beta a b) {0<..}

goal (1 subgoal):
 1. (f has_integral Beta a b) {0<..}
[PROOF STEP]
by (simp add: f_def)
[PROOF STATE]
proof (state)
this:
(f has_integral Beta a b) {0<..}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_linorder_from_keys_restrict':
  assumes fin: "finite A" "A \<subseteq> B"
  shows "linorder_from_keys A \<in> Pi\<^sub>M A (\<lambda>_. borel :: real measure) \<rightarrow>\<^sub>M count_space (Pow (B \<times> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linorder_from_keys A \<in> Pi\<^sub>M A (\<lambda>_. borel) \<rightarrow>\<^sub>M count_space (Pow (B \<times> B))
[PROOF STEP]
apply (rule measurable_count_space_extend)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. linorder_from_keys A \<in> Pi\<^sub>M A (\<lambda>_. borel) \<rightarrow>\<^sub>M count_space ?A
 2. ?A \<subseteq> Pow (B \<times> B)
[PROOF STEP]
apply (rule measurable_linorder_from_keys_restrict[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pow (A \<times> A) \<subseteq> Pow (B \<times> B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> B

goal (1 subgoal):
 1. Pow (A \<times> A) \<subseteq> Pow (B \<times> B)
[PROOF STEP]
by auto


[STATEMENT]
lemma \<alpha>0: "i > 1 \<Longrightarrow> \<alpha> i = 0 \<longleftrightarrow> (i - 1) > k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < i \<Longrightarrow> (\<alpha> i = 0) = (k < i - 1)
[PROOF STEP]
unfolding \<alpha>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < i \<Longrightarrow> (f (i - 1) ^ Suc (\<delta> (i - 2)) = 0) = (k < i - 1)
[PROOF STEP]
using f0[of "i - 1"]
[PROOF STATE]
proof (prove)
using this:
i - 1 \<noteq> 0 \<Longrightarrow> (f (i - 1) = 0) = (k < i - 1)

goal (1 subgoal):
 1. 1 < i \<Longrightarrow> (f (i - 1) ^ Suc (\<delta> (i - 2)) = 0) = (k < i - 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma tendsto_0_le:
  "(f \<longlongrightarrow> 0) F \<Longrightarrow> eventually (\<lambda>x. norm (g x) \<le> norm (f x) * K) F \<Longrightarrow> (g \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> (0::'b)) F; \<forall>\<^sub>F x in F. norm (g x) \<le> norm (f x) * K\<rbrakk> \<Longrightarrow> (g \<longlongrightarrow> (0::'c)) F
[PROOF STEP]
by (simp add: Zfun_imp_Zfun tendsto_Zfun_iff)


[STATEMENT]
lemma tensor_op_adjoint: \<open>(tensor_op a b)* = tensor_op (a*) (b*)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<otimes>\<^sub>o b)* = a* \<otimes>\<^sub>o b*
[PROOF STEP]
apply (rule cinner_ket_adjointI[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. ((a* \<otimes>\<^sub>o b*) *\<^sub>V ket i) \<bullet>\<^sub>C ket j = ket i \<bullet>\<^sub>C ((a \<otimes>\<^sub>o b) *\<^sub>V ket j)
[PROOF STEP]
apply (auto simp flip: tensor_ell2_ket simp: tensor_op_ell2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa ba ab bb. (a* *\<^sub>V ket aa) \<bullet>\<^sub>C ket ab * ((b* *\<^sub>V ket ba) \<bullet>\<^sub>C ket bb) = ket aa \<bullet>\<^sub>C (a *\<^sub>V ket ab) * (ket ba \<bullet>\<^sub>C (b *\<^sub>V ket bb))
[PROOF STEP]
by (simp add: cinner_adj_left)


[STATEMENT]
lemma dim_col_transfer_rule:
  "HMA_M A (A' :: 'a ^ 'nc:: mod_type ^ 'nr:: mod_type) \<Longrightarrow> (=) (dim_col A) (CARD('nc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mod_Type_Connect.HMA_M A A' \<Longrightarrow> dim_col A = CARD('nc)
[PROOF STEP]
unfolding HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Mod_Type_Connect.from_hma\<^sub>m A' \<Longrightarrow> dim_col A = CARD('nc)
[PROOF STEP]
by auto


[STATEMENT]
lemma hsi_method_via_h_framework_lists_completeness :
  fixes M1 :: "('a::linorder,'b::linorder,'c::linorder) fsm"
  fixes M2 :: "('d,'b,'c) fsm"
  assumes "observable M1"
  and     "observable M2"
  and     "minimal M1"
  and     "minimal M2"
  and     "size_r M1 \<le> m"
  and     "size M2 \<le> m"
  and     "inputs M2 = inputs M1"
  and     "outputs M2 = outputs M1"
shows "(L M1 = L M2) \<longleftrightarrow> list_all (passes_test_case M2 (initial M2)) (hsi_method_via_h_framework_lists M1 m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (hsi_method_via_h_framework_lists M1 m)
[PROOF STEP]
using h_framework_static_with_empty_graph_lists_completeness[OF assms, where dist_fun="(\<lambda> k q . get_HSI M1 q)", OF _ get_HSI_finite]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_empty_graph_lists M1 (\<lambda>k. get_HSI M1) m)

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (hsi_method_via_h_framework_lists M1 m)
[PROOF STEP]
using get_HSI_distinguishes[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_empty_graph_lists M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (hsi_method_via_h_framework_lists M1 m)
[PROOF STEP]
unfolding hsi_method_via_h_framework_lists_def h_framework_static_with_empty_graph_lists_def hsi_method_via_h_framework_def
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)))
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)))
[PROOF STEP]
by blast


[STATEMENT]
lemma prod_2_Rel_is_cat_Rel_arr'[cat_Rel_par_set_cs_intros]:
  assumes "S : A \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> B"
    and "T : C \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> D"
    and "A' = A \<times>\<^sub>\<circ> C"
    and "B' = B \<times>\<^sub>\<circ> D"
    and "\<CC>' = cat_Rel \<alpha>"
  shows "S \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l T : A' \<mapsto>\<^bsub>\<CC>'\<^esub> B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l T : A' \<mapsto>\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
S : A \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> B
T : C \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> D

goal (1 subgoal):
 1. S \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l T : A' \<mapsto>\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
unfolding assms(3-5)
[PROOF STATE]
proof (prove)
using this:
S : A \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> B
T : C \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> D

goal (1 subgoal):
 1. S \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l T : A \<times>\<^sub>\<circ> C \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> B \<times>\<^sub>\<circ> D
[PROOF STEP]
by (rule prod_2_Rel_is_cat_Rel_arr)


[STATEMENT]
lemma k_nh_reachable: "u \<in> k_neighborhood w v k \<Longrightarrow> v \<rightarrow>\<^sup>* u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> k_neighborhood w v k \<Longrightarrow> v \<rightarrow>\<^sup>* u
[PROOF STEP]
unfolding k_neighborhood_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> {u \<in> verts G. \<mu> w v u \<le> ereal k} - {v} \<Longrightarrow> v \<rightarrow>\<^sup>* u
[PROOF STEP]
using shortest_path_inf
[PROOF STATE]
proof (prove)
using this:
\<not> ?u \<rightarrow>\<^sup>* ?v \<Longrightarrow> \<mu> ?f ?u ?v = \<infinity>

goal (1 subgoal):
 1. u \<in> {u \<in> verts G. \<mu> w v u \<le> ereal k} - {v} \<Longrightarrow> v \<rightarrow>\<^sup>* u
[PROOF STEP]
by fastforce


[STATEMENT]
lemma bij_betw_function_of:
  assumes "bij_betw enum {0..<card A} A"
  shows "bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
proof (rule bij_betw_byWitness[where f'="sequence_of A enum"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>a\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum a) = a
 2. \<forall>a'\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum a') = a'
 3. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
 4. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
show "\<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. \<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f
[PROOF STEP]
by (auto simp add: function_of_sequence_of)
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f

goal (3 subgoals):
 1. \<forall>a\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum a) = a
 2. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
 3. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
show "\<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. \<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs
[PROOF STEP]
by (auto simp add: sequence_of_function_of)
[PROOF STATE]
proof (state)
this:
\<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs

goal (2 subgoals):
 1. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
 2. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
show "sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
by (simp add: image_sequence_of_inj)
[PROOF STATE]
proof (state)
this:
sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}

goal (1 subgoal):
 1. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
show "function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
by (simp add: image_function_of_distinct)
[PROOF STATE]
proof (state)
this:
function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_bunion_filter: "{# a \<in># A . P a \<or> Q a #} = {# a \<in># A . P a #} \<union># {# a \<in># A . Q a #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#a \<in># A. P a \<or> Q a#} = filter_mset P A \<union># filter_mset Q A
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma ccSUP_sup_distrib: "countable A \<Longrightarrow> sup (SUP a\<in>A. f a) (SUP a\<in>A. g a) = (SUP a\<in>A. sup (f a) (g a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable A \<Longrightarrow> sup (Sup (f ` A)) (Sup (g ` A)) = (SUP a\<in>A. sup (f a) (g a))
[PROOF STEP]
by (rule order.antisym[rotated]) (rule ccSUP_least, auto intro: le_supI1 le_supI2 ccSUP_upper ccSUP_mono)


[STATEMENT]
lemma parts_fset_set (*[simp]*):
  "parts (FS`ls) =  (FS`ls) \<union> (\<Union>l \<in> ls. parts (fset l)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parts (FS ` ls) = FS ` ls \<union> (\<Union>l\<in>ls. parts (fset l))
[PROOF STEP]
apply (rule equalityI, rule subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> parts (FS ` ls) \<Longrightarrow> x \<in> FS ` ls \<union> (\<Union>l\<in>ls. parts (fset l))
 2. FS ` ls \<union> (\<Union>l\<in>ls. parts (fset l)) \<subseteq> parts (FS ` ls)
[PROOF STEP]
apply (erule parts.induct, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x l. \<lbrakk>l \<in> ls; x \<in> parts (fset l)\<rbrakk> \<Longrightarrow> x \<in> parts (FS ` ls)
[PROOF STEP]
by (meson FS_parts image_subset_iff parts_increasing parts_trans)