[STATEMENT]
theorem has_integral_Beta_real:
  assumes a: "a > 0" and b: "b > (0 :: real)"
  shows "((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
define B where "B = integral {0..1} (\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1))"
[PROOF STATE]
proof (state)
this:
B = integral {0..1} (\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1))

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
have [simp]: "B \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> B
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> integral {0..1} (\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1))
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b

goal (1 subgoal):
 1. 0 \<le> integral {0..1} (\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1))
[PROOF STEP]
by (intro integral_nonneg integrable_Beta') auto
[PROOF STATE]
proof (state)
this:
0 \<le> B

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[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 (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[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 (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[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 (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[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 (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+t. \<integral>\<^sup>+u. ennreal (indicator ({0..}\<times>{0..}) (t,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. \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>lborel \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong)
       (auto simp: indicator_def divide_ennreal ennreal_mult' [symmetric] exp_add)
[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. \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>lborel \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[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. \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>lborel \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+t. \<integral>\<^sup>+u. ennreal (indicator ({0..}\<times>{t..}) (t,u) * t powr (a - 1) *
                              (u - t) powr (b - 1) / exp u) \<partial>lborel \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>lborel \<partial>lborel = \<integral>\<^sup>+ t. \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {t..}) (t, u) * t powr (a - 1) * (u - t) powr (b - 1) / exp u) \<partial>lborel \<partial>lborel
[PROOF STEP]
proof (rule nn_integral_cong, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (x, u) * x powr (a - 1) * u powr (b - 1) / exp (x + u)) \<partial>lborel = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {x..}) (x, u) * x powr (a - 1) * (u - x) powr (b - 1) / exp u) \<partial>lborel
[PROOF STEP]
case (1 t)
[PROOF STATE]
proof (state)
this:
t \<in> space lborel

goal (1 subgoal):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (x, u) * x powr (a - 1) * u powr (b - 1) / exp (x + u)) \<partial>lborel = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {x..}) (x, u) * x powr (a - 1) * (u - x) powr (b - 1) / exp u) \<partial>lborel
[PROOF STEP]
have "(\<integral>\<^sup>+u. ennreal (indicator ({0..}\<times>{0..}) (t,u) * t powr (a - 1) *
                              u powr (b - 1) / exp (t + u)) \<partial>distr lborel borel ((+) (-t))) =
               (\<integral>\<^sup>+u. ennreal (indicator ({0..}\<times>{t..}) (t,u) * t powr (a - 1) *
                              (u - t) powr (b - 1) / exp u) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>distr lborel borel ((+) (- t)) = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {t..}) (t, u) * t powr (a - 1) * (u - t) powr (b - 1) / exp u) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_distr) (auto intro!: nn_integral_cong simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>distr lborel borel ((+) (- t)) = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {t..}) (t, u) * t powr (a - 1) * (u - t) powr (b - 1) / exp u) \<partial>lborel

goal (1 subgoal):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (x, u) * x powr (a - 1) * u powr (b - 1) / exp (x + u)) \<partial>lborel = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {x..}) (x, u) * x powr (a - 1) * (u - x) powr (b - 1) / exp u) \<partial>lborel
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>distr lborel borel ((+) (- t)) = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {t..}) (t, u) * t powr (a - 1) * (u - t) powr (b - 1) / exp u) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>lborel = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {t..}) (t, u) * t powr (a - 1) * (u - t) powr (b - 1) / exp u) \<partial>lborel
[PROOF STEP]
by (subst (asm) lborel_distr_plus)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {0..}) (t, u) * t powr (a - 1) * u powr (b - 1) / exp (t + u)) \<partial>lborel = \<integral>\<^sup>+ u. ennreal (indicat_real ({0..} \<times> {t..}) (t, u) * t powr (a - 1) * (u - t) powr (b - 1) / exp u) \<partial>lborel

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+u. ennreal B * ennreal (indicator {0..} u / exp u * u powr (a + b - 1)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ u. \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) \<partial>lborel = \<integral>\<^sup>+ u. ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1)) \<partial>lborel
[PROOF STEP]
proof (intro nn_integral_cong, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..x} t * t powr (a - 1) * (x - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} x / exp x) = ennreal B * ennreal (indicat_real {0..} x / exp x * x powr (a + b - 1))
[PROOF STEP]
case (1 u)
[PROOF STATE]
proof (state)
this:
u \<in> space lborel

goal (1 subgoal):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..x} t * t powr (a - 1) * (x - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} x / exp x) = ennreal B * ennreal (indicat_real {0..} x / exp x * x powr (a + b - 1))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
proof (cases "u > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
 2. \<not> 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < u

goal (2 subgoals):
 1. 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
 2. \<not> 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
have "(\<integral>\<^sup>+t. ennreal (indicator {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel) =
              (\<integral>\<^sup>+t. ennreal (indicator {0..1} t * (u * t) powr (a - 1) * (u - u * t) powr (b - 1))
                \<partial>distr lborel borel ((*) (1 / u)))" (is "_ = nn_integral _ ?f")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel = \<integral>\<^sup>+ t. ennreal (indicat_real {0..1} t * (u * t) powr (a - 1) * (u - u * t) powr (b - 1)) \<partial>distr lborel borel ((*) (1 / u))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel = \<integral>\<^sup>+ t. ennreal (indicat_real {0..1} t * (u * t) powr (a - 1) * (u - u * t) powr (b - 1)) \<partial>distr lborel borel ((*) (1 / u))
[PROOF STEP]
by (subst nn_integral_distr) (auto simp: indicator_def field_simps intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel = \<integral>\<^sup>+ t. ennreal (indicat_real {0..1} t * (u * t) powr (a - 1) * (u - u * t) powr (b - 1)) \<partial>distr lborel borel ((*) (1 / u))

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

goal (2 subgoals):
 1. 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
 2. \<not> 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
have "distr lborel borel ((*) (1 / u)) = density lborel (\<lambda>_. u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr lborel borel ((*) (1 / u)) = density lborel (\<lambda>x. ennreal u)
[PROOF STEP]
using \<open>u > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. distr lborel borel ((*) (1 / u)) = density lborel (\<lambda>x. ennreal u)
[PROOF STEP]
by (subst lborel_distr_mult) auto
[PROOF STATE]
proof (state)
this:
distr lborel borel ((*) (1 / u)) = density lborel (\<lambda>x. ennreal u)

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

goal (2 subgoals):
 1. 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
 2. \<not> 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
have "nn_integral \<dots> ?f = (\<integral>\<^sup>+x. ennreal (indicator {0..1} x * (u * (u * x) powr (a - 1) *
                                              (u * (1 - x)) powr (b - 1))) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (indicat_real {0..1} t * (u * t) powr (a - 1) * (u - u * t) powr (b - 1)) \<partial>density lborel (\<lambda>x. ennreal u) = \<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * (u * (u * x) powr (a - 1) * (u * (1 - x)) powr (b - 1))) \<partial>lborel
[PROOF STEP]
using \<open>u > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (indicat_real {0..1} t * (u * t) powr (a - 1) * (u - u * t) powr (b - 1)) \<partial>density lborel (\<lambda>x. ennreal u) = \<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * (u * (u * x) powr (a - 1) * (u * (1 - x)) powr (b - 1))) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_density) (auto simp: ennreal_mult' [symmetric] algebra_simps)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..1} t * (u * t) powr (a - 1) * (u - u * t) powr (b - 1)) \<partial>density lborel (\<lambda>x. ennreal u) = \<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * (u * (u * x) powr (a - 1) * (u * (1 - x)) powr (b - 1))) \<partial>lborel

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

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

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * (u * (u * x) powr (a - 1) * (u * (1 - x)) powr (b - 1))) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (u powr (a + b - 1)) * ennreal (indicat_real {0..1} x * x powr (a - 1) * (1 - x) powr (b - 1)) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong)
           (auto simp: indicator_def powr_mult powr_add powr_diff mult_ac ennreal_mult' [symmetric])
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * (u * (u * x) powr (a - 1) * (u * (1 - x)) powr (b - 1))) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (u powr (a + b - 1)) * ennreal (indicat_real {0..1} x * x powr (a - 1) * (1 - x) powr (b - 1)) \<partial>lborel

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

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

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

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

goal (1 subgoal):
 1. ((\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1)) has_integral integral {0..1} (\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1))) {0..1}
[PROOF STEP]
by (intro integrable_integral integrable_Beta')
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1)) has_integral integral {0..1} (\<lambda>x. x powr (a - 1) * (1 - x) powr (b - 1))) {0..1}

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

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * x powr (a - 1) * (1 - x) powr (b - 1)) \<partial>lborel = ennreal B
[PROOF STEP]
by (simp add: mult_ac B_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * x powr (a - 1) * (1 - x) powr (b - 1)) \<partial>lborel = ennreal B

goal (2 subgoals):
 1. 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
 2. \<not> 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel = ennreal (u powr (a + b - 1)) * ennreal B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel = ennreal (u powr (a + b - 1)) * ennreal B

goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
using \<open>u > 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel = ennreal (u powr (a + b - 1)) * ennreal B
0 < u

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

goal (1 subgoal):
 1. \<not> 0 < u \<Longrightarrow> \<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. ennreal (indicat_real {0..u} t * t powr (a - 1) * (u - t) powr (b - 1)) \<partial>lborel * ennreal (indicat_real {0<..} u / exp u) = ennreal B * ennreal (indicat_real {0..} u / exp u * u powr (a + b - 1))

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

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

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

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

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

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
have "\<dots> = ennreal (B * Gamma (a + b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal B * ennreal (Gamma (a + b)) = ennreal (B * Gamma (a + b))
[PROOF STEP]
by (subst (1 2) mult.commute, intro ennreal_mult' [symmetric]) (use a b in auto)
[PROOF STATE]
proof (state)
this:
ennreal B * ennreal (Gamma (a + b)) = ennreal (B * Gamma (a + b))

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ennreal (Gamma a * Gamma b) = ennreal (B * Gamma (a + b))
[PROOF STEP]
have "B = Beta a b"
[PROOF STATE]
proof (prove)
using this:
ennreal (Gamma a * Gamma b) = ennreal (B * Gamma (a + b))

goal (1 subgoal):
 1. B = Beta a b
[PROOF STEP]
using a b Gamma_real_pos[of "a + b"]
[PROOF STATE]
proof (prove)
using this:
ennreal (Gamma a * Gamma b) = ennreal (B * Gamma (a + b))
0 < a
0 < b
0 < a + b \<Longrightarrow> 0 < Gamma (a + b)

goal (1 subgoal):
 1. B = Beta a b
[PROOF STEP]
by (subst (asm) ennreal_inj) (auto simp: field_simps Beta_def Gamma_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
B = Beta a b

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B = Beta a b

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
have "(\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) integrable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) integrable_on {0..1}
[PROOF STEP]
by (intro integrable_Beta' a b)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) integrable_on {0..1}

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B = Beta a b
(\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) integrable_on {0..1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
B = Beta a b
(\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) integrable_on {0..1}

goal (1 subgoal):
 1. ((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}
[PROOF STEP]
by (simp add: has_integral_iff B_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1)) has_integral Beta a b) {0..1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma two_pow_sub:
  "0 < m \<Longrightarrow> (2::nat)^m - 2^(m - 1) = 2^(m - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> 2 ^ m - 2 ^ (m - 1) = 2 ^ (m - 1)
[PROOF STEP]
by (induct m) auto


[STATEMENT]
lemma quot_of_fract_inverse:
  "quot_of_fract (inverse x) =
     (let (a,b) = quot_of_fract x; d = unit_factor a
      in  if d = 0 then (0, 1) else (b div d, a div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_of_fract (inverse x) = (let (a, b) = quot_of_fract x; d = unit_factor a in if d = (0::'a) then (0::'a, 1::'a) else (b div d, a div d))
[PROOF STEP]
proof (transfer, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. fractrel x x \<Longrightarrow> normalize_quot (if fst x = (0::'a) then (0::'a, 1::'a) else (snd x, fst x)) = (let (a, b) = normalize_quot x; d = unit_factor a in if d = (0::'a) then (0::'a, 1::'a) else (b div d, a div d))
[PROOF STEP]
case (1 x)
[PROOF STATE]
proof (state)
this:
fractrel x x

goal (1 subgoal):
 1. \<And>x. fractrel x x \<Longrightarrow> normalize_quot (if fst x = (0::'a) then (0::'a, 1::'a) else (snd x, fst x)) = (let (a, b) = normalize_quot x; d = unit_factor a in if d = (0::'a) then (0::'a, 1::'a) else (b div d, a div d))
[PROOF STEP]
from normalize_quot_swap[of "fst x" "snd x"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>fst x \<noteq> (0::'a); snd x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> normalize_quot (snd x, fst x) = (snd (normalize_quot (fst x, snd x)) div unit_factor (fst (normalize_quot (fst x, snd x))), fst (normalize_quot (fst x, snd x)) div unit_factor (fst (normalize_quot (fst x, snd x))))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>fst x \<noteq> (0::'a); snd x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> normalize_quot (snd x, fst x) = (snd (normalize_quot (fst x, snd x)) div unit_factor (fst (normalize_quot (fst x, snd x))), fst (normalize_quot (fst x, snd x)) div unit_factor (fst (normalize_quot (fst x, snd x))))

goal (1 subgoal):
 1. normalize_quot (if fst x = (0::'a) then (0::'a, 1::'a) else (snd x, fst x)) = (let (a, b) = normalize_quot x; d = unit_factor a in if d = (0::'a) then (0::'a, 1::'a) else (b div d, a div d))
[PROOF STEP]
by (auto simp: Let_def case_prod_unfold)
[PROOF STATE]
proof (state)
this:
normalize_quot (if fst x = (0::'a) then (0::'a, 1::'a) else (snd x, fst x)) = (let (a, b) = normalize_quot x; d = unit_factor a in if d = (0::'a) then (0::'a, 1::'a) else (b div d, a div d))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem inverse_unique:
  "\<lbrakk> u \<cdot> v' = \<one>; v \<cdot> u = \<one>; u \<in> M;  v \<in> M; v' \<in> M \<rbrakk> \<Longrightarrow> v = v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<cdot> v' = \<one>; v \<cdot> u = \<one>; u \<in> M; v \<in> M; v' \<in> M\<rbrakk> \<Longrightarrow> v = v'
[PROOF STEP]
by (metis associative left_unit right_unit)


[STATEMENT]
lemma opp_Point: "opp (Point x y) = Point x (\<ominus> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. opp (Point x y) = Point x (\<ominus> y)
[PROOF STEP]
by (simp add: opp_def)


[STATEMENT]
lemma (in information_space) entropy_le_card:
  assumes X: "simple_distributed M X f"
  shows "\<H>(X) \<le> log b (real (card (X ` space M)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M)))
[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)))
[PROOF STEP]
have "\<H>(X) \<le> log b (measure ?X (space ?X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) \<le> log b (Sigma_Algebra.measure (count_space (X ` space M)) (space (count_space (X ` space M))))
[PROOF STEP]
by (rule entropy_le_space[OF simple_distributed[OF X]])
       (insert X, auto simp: simple_distributed_finite[OF X] subset_eq integrable_count_space emeasure_count_space finite_measure_count_space)
[PROOF STATE]
proof (state)
this:
\<H>(X) \<le> log b (Sigma_Algebra.measure (count_space (X ` space M)) (space (count_space (X ` space M))))

goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<H>(X) \<le> log b (Sigma_Algebra.measure (count_space (X ` space M)) (space (count_space (X ` space M))))

goal (1 subgoal):
 1. \<H>(X) \<le> log b (real (card (X ` space M)))
[PROOF STEP]
have "measure ?X (space ?X) = card (X ` space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (count_space (X ` space M)) (space (count_space (X ` space M))) = real (card (X ` space M))
[PROOF STEP]
by (simp_all add: simple_distributed_finite[OF X] subset_eq emeasure_count_space measure_def)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure (count_space (X ` space M)) (space (count_space (X ` space M))) = real (card (X ` space M))

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma combine_union_sets_set_eq:
  assumes "\<forall>xs \<in> Y. \<forall>ys \<in> Y. xs = ys \<or> set xs \<inter> set ys = {}"
      and "\<forall>ys \<in> X. \<exists>U \<in> Y. \<exists>V \<in> Y. U@V = ys"
    shows "\<Union>(set ` (X \<union> {x. x \<in> Y \<and> set x \<inter> \<Union>(set ` X) = {}})) = \<Union>(set ` Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set ` (X \<union> {x \<in> Y. set x \<inter> \<Union> (set ` X) = {}})) = \<Union> (set ` Y)
[PROOF STEP]
using combine_union_sets_set_sub1[OF assms] combine_union_sets_set_sub2[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<Union> (set ` Y) \<subseteq> \<Union> (set ` (X \<union> {x \<in> Y. set x \<inter> \<Union> (set ` X) = {}}))
\<Union> (set ` (X \<union> {x \<in> Y. set x \<inter> \<Union> (set ` X) = {}})) \<subseteq> \<Union> (set ` Y)

goal (1 subgoal):
 1. \<Union> (set ` (X \<union> {x \<in> Y. set x \<inter> \<Union> (set ` X) = {}})) = \<Union> (set ` Y)
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_fmap_ran: "finite (ran (F::(('a::finite) -~> 'b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (ran F)
[PROOF STEP]
unfolding ran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {b. \<exists>a. F a = Some b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {b. \<exists>a. F a = Some b}
[PROOF STEP]
from finite_dom_fmap finite_imageI
[PROOF STATE]
proof (chain)
picking this:
finite (dom ?F)
finite ?F \<Longrightarrow> finite (?h ` ?F)
[PROOF STEP]
have "finite ((\<lambda>x. the (F x)) ` (dom F))"
[PROOF STATE]
proof (prove)
using this:
finite (dom ?F)
finite ?F \<Longrightarrow> finite (?h ` ?F)

goal (1 subgoal):
 1. finite ((\<lambda>x. the (F x)) ` dom F)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>x. the (F x)) ` dom F)

goal (1 subgoal):
 1. finite {b. \<exists>a. F a = Some b}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>x. the (F x)) ` dom F)

goal (1 subgoal):
 1. finite {b. \<exists>a. F a = Some b}
[PROOF STEP]
have "{b. \<exists>a. F a = Some b} = (\<lambda>x. the (F x)) ` (dom F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. \<exists>a. F a = Some b} = (\<lambda>x. the (F x)) ` dom F
[PROOF STEP]
unfolding image_def dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. \<exists>a. F a = Some b} = {y. \<exists>x\<in>{a. F a \<noteq> None}. y = the (F x)}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{b. \<exists>a. F a = Some b} = (\<lambda>x. the (F x)) ` dom F

goal (1 subgoal):
 1. finite {b. \<exists>a. F a = Some b}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite ((\<lambda>x. the (F x)) ` dom F)
{b. \<exists>a. F a = Some b} = (\<lambda>x. the (F x)) ` dom F
[PROOF STEP]
show "finite {b. \<exists>a. F a = Some b}"
[PROOF STATE]
proof (prove)
using this:
finite ((\<lambda>x. the (F x)) ` dom F)
{b. \<exists>a. F a = Some b} = (\<lambda>x. the (F x)) ` dom F

goal (1 subgoal):
 1. finite {b. \<exists>a. F a = Some b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {b. \<exists>a. F a = Some b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_red_minus:
  assumes "is_red F (p - q)"
  shows "is_red F p \<or> is_red F q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_red F p \<or> is_red F q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_red F p \<or> is_red F q
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_red F (p - q)
[PROOF STEP]
have "is_red F (p + (- q))"
[PROOF STATE]
proof (prove)
using this:
is_red F (p - q)

goal (1 subgoal):
 1. is_red F (p + - q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_red F (p + - q)

goal (1 subgoal):
 1. is_red F p \<or> is_red F q
[PROOF STEP]
hence "is_red F p \<or> is_red F (- q)"
[PROOF STATE]
proof (prove)
using this:
is_red F (p + - q)

goal (1 subgoal):
 1. is_red F p \<or> is_red F (- q)
[PROOF STEP]
by (rule is_red_plus)
[PROOF STATE]
proof (state)
this:
is_red F p \<or> is_red F (- q)

goal (1 subgoal):
 1. is_red F p \<or> is_red F q
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_red F p \<or> is_red F (- q)

goal (1 subgoal):
 1. is_red F p \<or> is_red F q
[PROOF STEP]
by (simp only: is_red_uminus)
[PROOF STATE]
proof (state)
this:
is_red F p \<or> is_red F q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_dual_rev_iff: "dual_rlex.sorted ws \<longleftrightarrow> rlex.sorted (rev ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (\<lambda>x y. y \<le>lex x) ws = sorted_wrt (\<le>lex) (rev ws)
[PROOF STEP]
unfolding rlex.sorted_rev_iff_nth_mono dual_rlex.sorted_iff_nth_mono
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i j. i \<le> j \<longrightarrow> j < \<^bold>|ws\<^bold>| \<longrightarrow> ws ! j \<le>lex ws ! i) = (\<forall>i j. i \<le> j \<longrightarrow> j < \<^bold>|ws\<^bold>| \<longrightarrow> ws ! j \<le>lex ws ! i)
[PROOF STEP]
by blast


[STATEMENT]
lemma Stirling_2_2: "Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Stirling (Suc (Suc 0)) (Suc (Suc 0)) = 2 ^ Suc 0 - 1
 2. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. Stirling (Suc (Suc 0)) (Suc (Suc 0)) = 2 ^ Suc 0 - 1
 2. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stirling (Suc (Suc 0)) (Suc (Suc 0)) = 2 ^ Suc 0 - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Stirling (Suc (Suc 0)) (Suc (Suc 0)) = 2 ^ Suc 0 - 1

goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1

goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have "Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) =
      2 * Stirling (Suc (Suc n)) (Suc (Suc 0)) + Stirling (Suc (Suc n)) (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 * Stirling (Suc (Suc n)) (Suc (Suc 0)) + Stirling (Suc (Suc n)) (Suc 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 * Stirling (Suc (Suc n)) (Suc (Suc 0)) + Stirling (Suc (Suc n)) (Suc 0)

goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 * Stirling (Suc (Suc n)) (Suc (Suc 0)) + Stirling (Suc (Suc n)) (Suc 0)

goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have "\<dots> = 2 * (2 ^ Suc n - 1) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Stirling (Suc (Suc n)) (Suc (Suc 0)) + Stirling (Suc (Suc n)) (Suc 0) = 2 * (2 ^ Suc n - 1) + 1
[PROOF STEP]
by (simp only: Suc Stirling_1)
[PROOF STATE]
proof (state)
this:
2 * Stirling (Suc (Suc n)) (Suc (Suc 0)) + Stirling (Suc (Suc n)) (Suc 0) = 2 * (2 ^ Suc n - 1) + 1

goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * Stirling (Suc (Suc n)) (Suc (Suc 0)) + Stirling (Suc (Suc n)) (Suc 0) = 2 * (2 ^ Suc n - 1) + 1

goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have "\<dots> = 2 ^ Suc (Suc n) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
have "(2::nat) ^ Suc n - 1 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ Suc n - 1
[PROOF STEP]
by (induct n) simp_all
[PROOF STATE]
proof (state)
this:
0 < 2 ^ Suc n - 1

goal (1 subgoal):
 1. 2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 2 ^ Suc n - 1
[PROOF STEP]
have "2 * ((2::nat) ^ Suc n - 1) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < 2 ^ Suc n - 1

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

goal (1 subgoal):
 1. 2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 2 * (2 ^ Suc n - 1)
[PROOF STEP]
have "2 \<le> 2 * ((2::nat) ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
0 < 2 * (2 ^ Suc n - 1)

goal (1 subgoal):
 1. 2 \<le> 2 * 2 ^ Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 \<le> 2 * 2 ^ Suc n

goal (1 subgoal):
 1. 2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
with add_diff_assoc2 [of 2 "2 * 2 ^ Suc n" 1]
[PROOF STATE]
proof (chain)
picking this:
2 \<le> 2 * 2 ^ Suc n \<Longrightarrow> 2 * 2 ^ Suc n - 2 + 1 = 2 * 2 ^ Suc n + 1 - 2
2 \<le> 2 * 2 ^ Suc n
[PROOF STEP]
have "2 * 2 ^ Suc n - 2 + (1::nat) = 2 * 2 ^ Suc n + 1 - 2"
[PROOF STATE]
proof (prove)
using this:
2 \<le> 2 * 2 ^ Suc n \<Longrightarrow> 2 * 2 ^ Suc n - 2 + 1 = 2 * 2 ^ Suc n + 1 - 2
2 \<le> 2 * 2 ^ Suc n

goal (1 subgoal):
 1. 2 * 2 ^ Suc n - 2 + 1 = 2 * 2 ^ Suc n + 1 - 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 * 2 ^ Suc n - 2 + 1 = 2 * 2 ^ Suc n + 1 - 2

goal (1 subgoal):
 1. 2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * 2 ^ Suc n - 2 + 1 = 2 * 2 ^ Suc n + 1 - 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * 2 ^ Suc n - 2 + 1 = 2 * 2 ^ Suc n + 1 - 2

goal (1 subgoal):
 1. 2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
by (simp add: nat_distrib)
[PROOF STATE]
proof (state)
this:
2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 * (2 ^ Suc n - 1) + 1 = 2 ^ Suc (Suc n) - 1

goal (1 subgoal):
 1. \<And>n. Stirling (Suc (Suc n)) (Suc (Suc 0)) = 2 ^ Suc n - 1 \<Longrightarrow> Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1

goal (1 subgoal):
 1. Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Stirling (Suc (Suc (Suc n))) (Suc (Suc 0)) = 2 ^ Suc (Suc n) - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_filter_greater_subset_drop:
  assumes "sorted xs" and "i < length xs"
  shows   "{#x \<in># mset xs. x > xs ! i#} \<subseteq># mset (drop (Suc i) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset ((<) (xs ! i)) (mset xs) \<subseteq># mset (drop (Suc i) xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted xs
i < length xs

goal (1 subgoal):
 1. filter_mset ((<) (xs ! i)) (mset xs) \<subseteq># mset (drop (Suc i) xs)
[PROOF STEP]
proof (induction xs arbitrary: i rule: list.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>sorted []; i < length []\<rbrakk> \<Longrightarrow> filter_mset ((<) ([] ! i)) (mset []) \<subseteq># mset (drop (Suc i) [])
 2. \<And>x1 x2 i. \<lbrakk>\<And>i. \<lbrakk>sorted x2; i < length x2\<rbrakk> \<Longrightarrow> filter_mset ((<) (x2 ! i)) (mset x2) \<subseteq># mset (drop (Suc i) x2); sorted (x1 # x2); i < length (x1 # x2)\<rbrakk> \<Longrightarrow> filter_mset ((<) ((x1 # x2) ! i)) (mset (x1 # x2)) \<subseteq># mset (drop (Suc i) (x1 # x2))
[PROOF STEP]
case (Cons x xs i)
[PROOF STATE]
proof (state)
this:
\<lbrakk>sorted xs; ?i < length xs\<rbrakk> \<Longrightarrow> filter_mset ((<) (xs ! ?i)) (mset xs) \<subseteq># mset (drop (Suc ?i) xs)
sorted (x # xs)
i < length (x # xs)

goal (2 subgoals):
 1. \<And>i. \<lbrakk>sorted []; i < length []\<rbrakk> \<Longrightarrow> filter_mset ((<) ([] ! i)) (mset []) \<subseteq># mset (drop (Suc i) [])
 2. \<And>x1 x2 i. \<lbrakk>\<And>i. \<lbrakk>sorted x2; i < length x2\<rbrakk> \<Longrightarrow> filter_mset ((<) (x2 ! i)) (mset x2) \<subseteq># mset (drop (Suc i) x2); sorted (x1 # x2); i < length (x1 # x2)\<rbrakk> \<Longrightarrow> filter_mset ((<) ((x1 # x2) ! i)) (mset (x1 # x2)) \<subseteq># mset (drop (Suc i) (x1 # x2))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
proof (cases i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
 2. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
 2. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = 0

goal (1 subgoal):
 1. filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
by (auto simp: sorted_append filter_mset_is_empty_iff)
[PROOF STATE]
proof (state)
this:
filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
case (Suc i')
[PROOF STATE]
proof (state)
this:
i = Suc i'

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
have "{#y \<in># mset (x # xs). y > (x # xs) ! i#} \<subseteq># {#y \<in># mset xs. y > xs ! i'#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># filter_mset ((<) (xs ! i')) (mset xs)
[PROOF STEP]
using Suc Cons.prems
[PROOF STATE]
proof (prove)
using this:
i = Suc i'
sorted (x # xs)
i < length (x # xs)

goal (1 subgoal):
 1. filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># filter_mset ((<) (xs ! i')) (mset xs)
[PROOF STEP]
by (auto simp: set_conv_nth)
[PROOF STATE]
proof (state)
this:
filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># filter_mset ((<) (xs ! i')) (mset xs)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># filter_mset ((<) (xs ! i')) (mset xs)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
have "\<dots> \<subseteq># mset (drop (Suc i') xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset ((<) (xs ! i')) (mset xs) \<subseteq># mset (drop (Suc i') xs)
[PROOF STEP]
using Cons.prems Suc
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
i < length (x # xs)
i = Suc i'

goal (1 subgoal):
 1. filter_mset ((<) (xs ! i')) (mset xs) \<subseteq># mset (drop (Suc i') xs)
[PROOF STEP]
by (intro Cons.IH) (auto)
[PROOF STATE]
proof (state)
this:
filter_mset ((<) (xs ! i')) (mset xs) \<subseteq># mset (drop (Suc i') xs)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_mset ((<) (xs ! i')) (mset xs) \<subseteq># mset (drop (Suc i') xs)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
have "\<dots> = mset (drop (Suc i) (x # xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (drop (Suc i') xs) = mset (drop (Suc i) (x # xs))
[PROOF STEP]
by (simp add: Suc)
[PROOF STATE]
proof (state)
this:
mset (drop (Suc i') xs) = mset (drop (Suc i) (x # xs))

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))

goal (1 subgoal):
 1. filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
filter_mset ((<) ((x # xs) ! i)) (mset (x # xs)) \<subseteq># mset (drop (Suc i) (x # xs))

goal (1 subgoal):
 1. \<And>i. \<lbrakk>sorted []; i < length []\<rbrakk> \<Longrightarrow> filter_mset ((<) ([] ! i)) (mset []) \<subseteq># mset (drop (Suc i) [])
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in finite_group) element_ord_generates_cyclic:
  assumes "a \<in> carrier G" "ord a = order G"
  shows "cyclic_group G a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_And_Cyclic_Groups.cyclic_group G a
[PROOF STEP]
proof (unfold_locales)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<in> carrier G
 2. carrier G = generate G {a}
[PROOF STEP]
show "a \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier G
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G

goal (1 subgoal):
 1. a \<in> carrier G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<in> carrier G

goal (1 subgoal):
 1. carrier G = generate G {a}
[PROOF STEP]
show "carrier G = generate G {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier G = generate G {a}
[PROOF STEP]
using assms bigger_subgroup_is_group[OF generate_is_subgroup]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G
ord a = order G
\<lbrakk>?H1 \<subseteq> carrier G; order G \<le> card (generate G ?H1)\<rbrakk> \<Longrightarrow> generate G ?H1 = carrier G

goal (1 subgoal):
 1. carrier G = generate G {a}
[PROOF STEP]
by (metis empty_subsetI fin generate_pow_card insert_subset ord_le_group_order)
[PROOF STATE]
proof (state)
this:
carrier G = generate G {a}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_poly_cutoff: "coeff (poly_cutoff n p) k = (if k < n then coeff p k else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (poly_cutoff n p) k = (if k < n then coeff p k else (0::'a))
[PROOF STEP]
unfolding poly_cutoff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (Abs_poly (\<lambda>k. if k < n then coeff p k else (0::'a))) k = (if k < n then coeff p k else (0::'a))
[PROOF STEP]
by (subst poly.Abs_poly_inverse) (auto simp: MOST_nat intro: exI[of _ n])


[STATEMENT]
lemma option_quotient [quot_thm]:
  assumes "Quotient3 R Abs Rep"
  shows "Quotient3 (rel_option R) (map_option Abs) (map_option Rep)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quotient3 (rel_option R) (map_option Abs) (map_option Rep)
[PROOF STEP]
apply (rule Quotient3I)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a. map_option Abs (map_option Rep a) = a
 2. \<And>a. rel_option R (map_option Rep a) (map_option Rep a)
 3. \<And>r s. rel_option R r s = (rel_option R r r \<and> rel_option R s s \<and> map_option Abs r = map_option Abs s)
[PROOF STEP]
apply (simp_all add: option.map_comp comp_def option.map_id[unfolded id_def] option.rel_eq rel_option_map1 rel_option_map2 Quotient3_abs_rep [OF assms] Quotient3_rel_rep [OF assms])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r s. rel_option R r s = (rel_option R r r \<and> rel_option R s s \<and> map_option Abs r = map_option Abs s)
[PROOF STEP]
using Quotient3_rel [OF assms]
[PROOF STATE]
proof (prove)
using this:
(R ?r ?r \<and> R ?s ?s \<and> Abs ?r = Abs ?s) = R ?r ?s

goal (1 subgoal):
 1. \<And>r s. rel_option R r s = (rel_option R r r \<and> rel_option R s s \<and> map_option Abs r = map_option Abs s)
[PROOF STEP]
apply (simp add: rel_option_iff split: option.split)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma floor_le_zero [simp]: "\<lfloor>x\<rfloor> \<le> 0 \<longleftrightarrow> x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> \<le> 0) = (x < (1::'a))
[PROOF STEP]
by (simp add: floor_le_iff)


[STATEMENT]
lemma frontier_cbox:
  fixes a b :: "'a::euclidean_space"
  shows "frontier (cbox a b) = cbox a b - box a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (cbox a b) = cbox a b - box a b
[PROOF STEP]
unfolding frontier_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cbox a b) - interior (cbox a b) = cbox a b - box a b
[PROOF STEP]
unfolding interior_cbox and closure_closed[OF closed_cbox]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox a b - box a b = cbox a b - box a b
[PROOF STEP]
..


[STATEMENT]
lemma "finite T \<Longrightarrow> S \<subseteq> T \<Longrightarrow> card S < Suc (card T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite T; S \<subseteq> T\<rbrakk> \<Longrightarrow> card S < Suc (card T)
[PROOF STEP]
by (simp add: card_mono le_imp_less_Suc)


[STATEMENT]
lemma sum_list_geq_tl:
  fixes l::"'a::{comm_monoid_add, ordered_ab_semigroup_add_imp_le} list"
  assumes  "l\<noteq>[]"
  and "\<forall>j < length l. 0 \<le> l!j"
shows "sum_list (tl l) \<le> sum_list l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (tl l) \<le> sum_list l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l \<noteq> []
\<forall>j<length l. (0::'a) \<le> l ! j

goal (1 subgoal):
 1. sum_list (tl l) \<le> sum_list l
[PROOF STEP]
proof (induct l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; \<forall>j<length []. (0::'a) \<le> [] ! j\<rbrakk> \<Longrightarrow> sum_list (tl []) \<le> sum_list []
 2. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
[] \<noteq> []
\<forall>j<length []. (0::'a) \<le> [] ! j

goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; \<forall>j<length []. (0::'a) \<le> [] ! j\<rbrakk> \<Longrightarrow> sum_list (tl []) \<le> sum_list []
 2. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[] \<noteq> []
\<forall>j<length []. (0::'a) \<le> [] ! j
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
[] \<noteq> []
\<forall>j<length []. (0::'a) \<le> [] ! j

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

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
case (Cons a l)
[PROOF STATE]
proof (state)
this:
\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l
a # l \<noteq> []
\<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
hence "0 \<le> a"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l
a # l \<noteq> []
\<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j

goal (1 subgoal):
 1. (0::'a) \<le> a
[PROOF STEP]
by (metis length_greater_0_conv nth_Cons_0)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> a

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
have "sum_list (tl (a#l)) = sum_list l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (tl (a # l)) = sum_list l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (tl (a # l)) = sum_list l

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (tl (a # l)) = sum_list l

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
have "... \<le> a + sum_list l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list l \<le> a + sum_list l
[PROOF STEP]
using \<open>0 \<le> a\<close>
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> a

goal (1 subgoal):
 1. sum_list l \<le> a + sum_list l
[PROOF STEP]
by (metis add_0 add_le_cancel_right)
[PROOF STATE]
proof (state)
this:
sum_list l \<le> a + sum_list l

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list l \<le> a + sum_list l

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
have "... = sum_list (a#l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + sum_list l = sum_list (a # l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a + sum_list l = sum_list (a # l)

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; \<forall>j<length l. (0::'a) \<le> l ! j\<rbrakk> \<Longrightarrow> sum_list (tl l) \<le> sum_list l; a # l \<noteq> []; \<forall>j<length (a # l). (0::'a) \<le> (a # l) ! j\<rbrakk> \<Longrightarrow> sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum_list (tl (a # l)) \<le> sum_list (a # l)

goal (1 subgoal):
 1. sum_list (tl (a # l)) \<le> sum_list (a # l)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_list (tl (a # l)) \<le> sum_list (a # l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_co_segment:
    "closed_segment a b \<subseteq> open_segment c d \<longleftrightarrow>
     a \<in> open_segment c d \<and> b \<in> open_segment c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (closed_segment a b \<subseteq> open_segment c d) = (a \<in> open_segment c d \<and> b \<in> open_segment c d)
[PROOF STEP]
using closed_segment_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> ?S; ?y \<in> ?S; convex ?S\<rbrakk> \<Longrightarrow> closed_segment ?x ?y \<subseteq> ?S

goal (1 subgoal):
 1. (closed_segment a b \<subseteq> open_segment c d) = (a \<in> open_segment c d \<and> b \<in> open_segment c d)
[PROOF STEP]
by blast


[STATEMENT]
lemma wfP_iff_no_inf_chain: "wfP (\<lambda>x y. p y x) \<longleftrightarrow> (\<nexists>f. inf_chain f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP (\<lambda>x y. p y x) = (\<not> Ex local.inf_chain)
[PROOF STEP]
unfolding wfP_def wf_iff_no_infinite_down_chain inf_chain_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>f. \<forall>i. (f (Suc i), f i) \<in> {(x, y). p y x}) = (\<nexists>f. \<forall>i. p (f i) (f (Suc i)))
[PROOF STEP]
by simp


[STATEMENT]
lemma le_TC_Ord: "\<lbrakk>\<beta> \<sqsubseteq> \<alpha>; Ord \<alpha>\<rbrakk> \<Longrightarrow> Ord \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<beta> \<sqsubseteq> \<alpha>; Ord \<alpha>\<rbrakk> \<Longrightarrow> Ord \<beta>
[PROOF STEP]
by (metis Ord_def Ord_in_Ord Transset_TC_eq le_TC_def less_TC_def)


[STATEMENT]
lemma s_mul_ext_mono:
  assumes "ns \<subseteq> ns'" "s \<subseteq> s'" shows "s_mul_ext ns s \<subseteq> s_mul_ext ns' s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s_mul_ext ns s \<subseteq> s_mul_ext ns' s'
[PROOF STEP]
unfolding s_mul_ext_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse> \<subseteq> (mult2_alt_s (ns'\<inverse>) (s'\<inverse>))\<inverse>
[PROOF STEP]
using assms mono_mult2_alt[of "ns\<inverse>" "ns'\<inverse>" "s\<inverse>" "s'\<inverse>"]
[PROOF STATE]
proof (prove)
using this:
ns \<subseteq> ns'
s \<subseteq> s'
\<lbrakk>ns\<inverse> \<subseteq> ns'\<inverse>; s\<inverse> \<subseteq> s'\<inverse>\<rbrakk> \<Longrightarrow> mult2_alt ?b (ns\<inverse>) (s\<inverse>) \<subseteq> mult2_alt ?b (ns'\<inverse>) (s'\<inverse>)

goal (1 subgoal):
 1. (mult2_alt_s (ns\<inverse>) (s\<inverse>))\<inverse> \<subseteq> (mult2_alt_s (ns'\<inverse>) (s'\<inverse>))\<inverse>
[PROOF STEP]
by simp


[STATEMENT]
lemma word_roti_add: "word_roti (m + n) w = word_roti m (word_roti n w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_roti (m + n) w = word_roti m (word_roti n w)
[PROOF STEP]
by (rule bit_word_eqI)
    (simp add: bit_word_roti_iff nat_less_iff mod_simps ac_simps)


[STATEMENT]
lemma ordered_nsets_3_eq:
  fixes A :: "'a::linorder set"
  shows "nsets A 3 = {{x,y,z} | x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x<y \<and> y<z}"
     (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A]\<^bsup>3\<^esup> = {{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. [A]\<^bsup>3\<^esup> \<subseteq> {{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z}
 2. {{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z} \<subseteq> [A]\<^bsup>3\<^esup>
[PROOF STEP]
show "nsets A 3 \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A]\<^bsup>3\<^esup> \<subseteq> {{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z}
[PROOF STEP]
apply (clarsimp simp add: nsets_def card_Suc_eq eval_nat_numeral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b ba bb. \<lbrakk>\<forall>x y. x < y \<longrightarrow> (\<forall>z. z \<in> A \<longrightarrow> y \<in> A \<longrightarrow> x \<in> A \<longrightarrow> {b, ba, bb} = {x, y, z} \<longrightarrow> \<not> y < z); b \<noteq> ba; b \<noteq> bb; b \<in> A; ba \<in> A; bb \<in> A\<rbrakk> \<Longrightarrow> ba = bb
[PROOF STEP]
by (metis insert_commute linorder_cases)
[PROOF STATE]
proof (state)
this:
[A]\<^bsup>3\<^esup> \<subseteq> {{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z}

goal (1 subgoal):
 1. {{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z} \<subseteq> [A]\<^bsup>3\<^esup>
[PROOF STEP]
show "?rhs \<subseteq> nsets A 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z} \<subseteq> [A]\<^bsup>3\<^esup>
[PROOF STEP]
apply (clarsimp simp add: nsets_def card_Suc_eq eval_nat_numeral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y z. \<lbrakk>xa \<in> A; y \<in> A; z \<in> A; xa < y; y < z\<rbrakk> \<Longrightarrow> \<exists>b B. {xa, y, z} = insert b B \<and> b \<notin> B \<and> (\<exists>b Ba. B = insert b Ba \<and> b \<notin> Ba \<and> (\<exists>b. Ba = {b}))
[PROOF STEP]
by (metis empty_iff insert_iff not_less_iff_gr_or_eq)
[PROOF STATE]
proof (state)
this:
{{x, y, z} |x y z. x \<in> A \<and> y \<in> A \<and> z \<in> A \<and> x < y \<and> y < z} \<subseteq> [A]\<^bsup>3\<^esup>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_pick:"\<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Suc(card(A-{pick(A)})) = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Suc (card (A - {pick A})) = card A
[PROOF STEP]
by (drule card_Suc_Diff1,auto dest!:pick_is_element simp:ex_in_conv)


[STATEMENT]
lemma sq_norm_vec_vCons[simp]: "\<parallel>vCons a v\<parallel>\<^sup>2 = \<parallel>a\<parallel>\<^sup>2 + \<parallel>v\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>vCons a v\<parallel>\<^sup>2 = sq_norm_conjugate a + \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
by (simp add: sq_norm_vec_def)


[STATEMENT]
lemma map_graph_selectors[simp]:
  "vertices (map_graph f G) = f `` (vertices G)"
  "edges (map_graph f G) = on_triple f `` (edges G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vertices (map_graph f G) = f `` vertices G &&& edges (map_graph f G) = on_triple f `` edges G
[PROOF STEP]
unfolding map_graph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vertices (LG (on_triple f `` edges G) (f `` vertices G)) = f `` vertices G &&& edges (LG (on_triple f `` edges G) (f `` vertices G)) = on_triple f `` edges G
[PROOF STEP]
by auto


[STATEMENT]
lemma trancl_rtrancl_trancl: "\<lbrakk>(x, y) \<in> r\<^sup>+; (y, z) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> (x, z) \<in> r\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> r\<^sup>+; (y, z) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> (x, z) \<in> r\<^sup>+
[PROOF STEP]
by (auto dest: tranclD rtrancl_trans rtrancl_into_trancl2)


[STATEMENT]
lemma proj_mult_vec [term_simps]: "proj_poly k (p ** q) = (proj_poly k p) * (proj_poly k q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k (p ** q) = proj_poly k p * proj_poly k q
[PROOF STEP]
unfolding mult_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k (lift_poly_fun_2 (*) p q) = proj_poly k p * proj_poly k q
[PROOF STEP]
by (rule proj_lift_poly_fun_2_homogenous, simp)


[STATEMENT]
lemma lemma_incseq_diff_inverse_ub:
  assumes "incseq s"
  and "(\<lambda>n. of_rat (s n)) \<longlonglongrightarrow> x"
shows "of_rat(s n - 1/of_nat(Suc n)) < (x::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_rat (s n - 1 / rat_of_nat (Suc n)) < x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_rat (s n - 1 / rat_of_nat (Suc n)) < x
[PROOF STEP]
have "real_of_rat (s n - 1 / rat_of_nat (Suc n)) < real_of_rat (s n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_rat (s n - 1 / rat_of_nat (Suc n)) < real_of_rat (s n)
[PROOF STEP]
by (simp add: of_rat_diff)
[PROOF STATE]
proof (state)
this:
real_of_rat (s n - 1 / rat_of_nat (Suc n)) < real_of_rat (s n)

goal (1 subgoal):
 1. real_of_rat (s n - 1 / rat_of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_rat (s n - 1 / rat_of_nat (Suc n)) < real_of_rat (s n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_rat (s n - 1 / rat_of_nat (Suc n)) < real_of_rat (s n)

goal (1 subgoal):
 1. real_of_rat (s n - 1 / rat_of_nat (Suc n)) < x
[PROOF STEP]
by (meson assms incseq_rat_le_real linorder_not_less order_trans)
[PROOF STATE]
proof (state)
this:
real_of_rat (s n - 1 / rat_of_nat (Suc n)) < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vcard_vdiff[simp]: "vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A
[PROOF STEP]
have ABB: "vdisjnt (A -\<^sub>\<circ> B) (A \<inter>\<^sub>\<circ> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vdisjnt (A -\<^sub>\<circ> B) (A \<inter>\<^sub>\<circ> B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vdisjnt (A -\<^sub>\<circ> B) (A \<inter>\<^sub>\<circ> B)

goal (1 subgoal):
 1. vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A
[PROOF STEP]
have "A -\<^sub>\<circ> B \<union>\<^sub>\<circ> A \<inter>\<^sub>\<circ> B = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A -\<^sub>\<circ> B \<union>\<^sub>\<circ> A \<inter>\<^sub>\<circ> B = A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A -\<^sub>\<circ> B \<union>\<^sub>\<circ> A \<inter>\<^sub>\<circ> B = A

goal (1 subgoal):
 1. vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A
[PROOF STEP]
from vcard_vunion[OF ABB, unfolded this]
[PROOF STATE]
proof (chain)
picking this:
vcard A = vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vcard A = vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B)

goal (1 subgoal):
 1. vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
vcard (A -\<^sub>\<circ> B) \<oplus> vcard (A \<inter>\<^sub>\<circ> B) = vcard A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_map_image:
  assumes "is_map M"
  shows "is_map ((\<lambda>(a, b). (a, f a b)) ` M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_map ((\<lambda>(a, b). (a, f a b)) ` M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_map M

goal (1 subgoal):
 1. is_map ((\<lambda>(a, b). (a, f a b)) ` M)
[PROOF STEP]
unfolding is_map_def
[PROOF STATE]
proof (prove)
using this:
\<forall>(a\<^sub>1, b\<^sub>1)\<in>M. \<forall>(a\<^sub>2, b\<^sub>2)\<in>M. a\<^sub>1 = a\<^sub>2 \<longrightarrow> b\<^sub>1 = b\<^sub>2

goal (1 subgoal):
 1. \<forall>(a\<^sub>1, b\<^sub>1)\<in>(\<lambda>(a, b). (a, f a b)) ` M. \<forall>(a\<^sub>2, b\<^sub>2)\<in>(\<lambda>(a, b). (a, f a b)) ` M. a\<^sub>1 = a\<^sub>2 \<longrightarrow> b\<^sub>1 = b\<^sub>2
[PROOF STEP]
by auto


[STATEMENT]
lemma map_poly_homo_polypow:
  "map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n"
  if [simp]: "\<And>x y. f (x + y) = f x + f y" "\<And>x. f x = 0 \<longleftrightarrow> x = 0" "\<And>x y. f (x * y) = f x * f y"
    "f 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n
[PROOF STEP]
proof(induction n rule: nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>m<n. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m \<Longrightarrow> map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:
\<forall>m<n. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m

goal (1 subgoal):
 1. \<And>n. \<forall>m<n. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m \<Longrightarrow> map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<n. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>m<n. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m

goal (1 subgoal):
 1. map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n
[PROOF STEP]
apply (cases n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>m<n. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m; n = 0\<rbrakk> \<Longrightarrow> map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n
 2. \<And>nat. \<lbrakk>\<forall>m<n. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m; n = Suc nat\<rbrakk> \<Longrightarrow> map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n
[PROOF STEP]
apply (auto simp: map_poly_homo_polyadd map_poly_homo_polymul)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<forall>m<Suc nat. map_poly f (p1 ^\<^sub>p m) = map_poly f p1 ^\<^sub>p m; n = Suc nat\<rbrakk> \<Longrightarrow> map_poly f (let q = p1 ^\<^sub>p Suc nat div 2; d = q *\<^sub>p q in if odd nat then d else p1 *\<^sub>p d) = (let q = map_poly f p1 ^\<^sub>p Suc nat div 2; d = q *\<^sub>p q in if odd nat then d else map_poly f p1 *\<^sub>p d)
[PROOF STEP]
by (smt Suc_less_eq div2_less_self even_Suc odd_Suc_div_two map_poly_homo_polymul that)
[PROOF STATE]
proof (state)
this:
map_poly f (p1 ^\<^sub>p n) = map_poly f p1 ^\<^sub>p n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_totatives_iff: "k \<in> totatives n \<longleftrightarrow> k > 0 \<and> k \<le> n \<and> coprime k n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k \<in> totatives n) = (0 < k \<and> k \<le> n \<and> coprime k n)
[PROOF STEP]
by (simp add: totatives_def)


[STATEMENT]
theorem riesz_frechet_representation_cblinfun_existence:
  \<comment> \<open>Theorem 3.4 in @{cite conway2013course}\<close>
  fixes f::\<open>'a::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L complex\<close>
  shows \<open>\<exists>t. \<forall>x.  f *\<^sub>V x = (t \<bullet>\<^sub>C x)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t. \<forall>x. f *\<^sub>V x = t \<bullet>\<^sub>C x
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. bounded_clinear f \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
by (rule riesz_frechet_representation_existence)


[STATEMENT]
lemma squarefree_part_pos [simp]: "\<Prod>(squarefree_part n) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<Prod>(squarefree_part n)
[PROOF STEP]
using prime_gt_0_nat
[PROOF STATE]
proof (prove)
using this:
prime ?p \<Longrightarrow> 0 < ?p

goal (1 subgoal):
 1. 0 < \<Prod>(squarefree_part n)
[PROOF STEP]
unfolding squarefree_part_def
[PROOF STATE]
proof (prove)
using this:
prime ?p \<Longrightarrow> 0 < ?p

goal (1 subgoal):
 1. 0 < \<Prod>{p. p \<in># prime_factorization n \<and> odd (multiplicity p n)}
[PROOF STEP]
by auto


[STATEMENT]
lemma boundedFlipNegQuantifier : "(\<not>(\<forall>x\<in>A. \<not> P x)) = (\<exists>x\<in>A. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (\<forall>x\<in>A. \<not> P x)) = (\<exists>x\<in>A. P x)
[PROOF STEP]
by blast


[STATEMENT]
lemma (in module) lincomb_smult:
  fixes A c
  assumes h2: "A\<subseteq>carrier M"  and h3: "a\<in>A\<rightarrow>carrier R" and h4: "c\<in>carrier R"
  shows "lincomb (\<lambda>w. c\<otimes>\<^bsub>R\<^esub> a w) A = c\<odot>\<^bsub>M\<^esub> (lincomb a A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>w. c \<otimes> a w) A = c \<odot>\<^bsub>M\<^esub> lincomb a A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier M
a \<in> A \<rightarrow> carrier R
c \<in> carrier R

goal (1 subgoal):
 1. lincomb (\<lambda>w. c \<otimes> a w) A = c \<odot>\<^bsub>M\<^esub> lincomb a A
[PROOF STEP]
by (auto cong: finsum_cong2
        simp add: lincomb_def finsum_Un_disjoint finsum_smult ring_subset_carrier disj_if smult_assoc1 coeff_in_ring)


[STATEMENT]
lemma size_filter_neg: "size {#a \<in># A . P a #} = size A - size {# a \<in># A . \<not> P a #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset P A) = size A - size {#a \<in># A. \<not> P a#}
[PROOF STEP]
using size_filter_mset_lesseq size_union union_filter_mset_complement
[PROOF STATE]
proof (prove)
using this:
size (filter_mset ?f ?M) \<le> size ?M
size (?M + ?N) = size ?M + size ?N
\<forall>x. ?P x = (\<not> ?Q x) \<Longrightarrow> filter_mset ?P ?M + filter_mset ?Q ?M = ?M

goal (1 subgoal):
 1. size (filter_mset P A) = size A - size {#a \<in># A. \<not> P a#}
[PROOF STEP]
by (metis ordered_cancel_comm_monoid_diff_class.le_imp_diff_is_add)


[STATEMENT]
lemma convex_closure_inter_two:
  fixes S T :: "'n::euclidean_space set"
  assumes "convex S"
    and "convex T"
  assumes "rel_interior S \<inter> rel_interior T \<noteq> {}"
  shows "closure (S \<inter> T) = closure S \<inter> closure T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (S \<inter> T) = closure S \<inter> closure T
[PROOF STEP]
using convex_closure_inter[of "{S,T}"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>S\<in>{S, T}. convex S; \<Inter> {rel_interior Sa |Sa. Sa \<in> {S, T}} \<noteq> {}\<rbrakk> \<Longrightarrow> closure (\<Inter> {S, T}) = \<Inter> {closure Sa |Sa. Sa \<in> {S, T}}
convex S
convex T
rel_interior S \<inter> rel_interior T \<noteq> {}

goal (1 subgoal):
 1. closure (S \<inter> T) = closure S \<inter> closure T
[PROOF STEP]
by auto


[STATEMENT]
lemma r2p_inter_hom_var: "R \<subseteq> Id \<Longrightarrow> S \<subseteq> Id \<Longrightarrow> r2p (R ; S) = (r2p R) \<sqinter> (r2p S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R \<subseteq> Id; S \<subseteq> Id\<rbrakk> \<Longrightarrow> r2p (R ; S) = r2p R \<sqinter> r2p S
[PROOF STEP]
by (simp add: r2s2p r2s_inter_hom_var s2p_inter_hom)


[STATEMENT]
lemma uniformly_continuous_on_diff[continuous_intros]:
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
  assumes "uniformly_continuous_on s f"
    and "uniformly_continuous_on s g"
  shows "uniformly_continuous_on s (\<lambda>x. f x - g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on s (\<lambda>x. f x - g x)
[PROOF STEP]
using assms uniformly_continuous_on_add [of s f "- g"]
[PROOF STATE]
proof (prove)
using this:
uniformly_continuous_on s f
uniformly_continuous_on s g
\<lbrakk>uniformly_continuous_on s f; uniformly_continuous_on s (- g)\<rbrakk> \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. f x + (- g) x)

goal (1 subgoal):
 1. uniformly_continuous_on s (\<lambda>x. f x - g x)
[PROOF STEP]
by (simp add: fun_Compl_def uniformly_continuous_on_minus)