[STATEMENT]
lemma affine_dependent_explicit_finite:
  fixes S :: "'a::real_vector set"
  assumes "finite S"
  shows "affine_dependent S \<longleftrightarrow>
    (\<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> sum (\<lambda>v. u v *\<^sub>R v) S = 0)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_dependent S = (\<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. affine_dependent S \<Longrightarrow> \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
 2. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
have *: "\<And>vt u v. (if vt then u v else 0) *\<^sub>R v = (if vt then (u v) *\<^sub>R v else 0::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>vt u v. (if vt then u v else 0) *\<^sub>R v = (if vt then u v *\<^sub>R v else (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if ?vt then ?u ?v else 0) *\<^sub>R ?v = (if ?vt then ?u ?v *\<^sub>R ?v else (0::'a))

goal (2 subgoals):
 1. affine_dependent S \<Longrightarrow> \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
 2. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
affine_dependent S

goal (2 subgoals):
 1. affine_dependent S \<Longrightarrow> \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
 2. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine_dependent S
[PROOF STEP]
obtain t u v where
    "finite t" "t \<subseteq> S" "sum u t = 0" "v\<in>t" "u v \<noteq> 0"  "(\<Sum>v\<in>t. u v *\<^sub>R v) = 0"
[PROOF STATE]
proof (prove)
using this:
affine_dependent S

goal (1 subgoal):
 1. (\<And>t u v. \<lbrakk>finite t; t \<subseteq> S; sum u t = 0; v \<in> t; u v \<noteq> 0; (\<Sum>v\<in>t. u v *\<^sub>R v) = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding affine_dependent_explicit
[PROOF STATE]
proof (prove)
using this:
\<exists>Sa u. finite Sa \<and> Sa \<subseteq> S \<and> sum u Sa = 0 \<and> (\<exists>v\<in>Sa. u v \<noteq> 0) \<and> (\<Sum>v\<in>Sa. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. (\<And>t u v. \<lbrakk>finite t; t \<subseteq> S; sum u t = 0; v \<in> t; u v \<noteq> 0; (\<Sum>v\<in>t. u v *\<^sub>R v) = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite t
t \<subseteq> S
sum u t = 0
v \<in> t
u v \<noteq> 0
(\<Sum>v\<in>t. u v *\<^sub>R v) = (0::'a)

goal (2 subgoals):
 1. affine_dependent S \<Longrightarrow> \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
 2. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite t
t \<subseteq> S
sum u t = 0
v \<in> t
u v \<noteq> 0
(\<Sum>v\<in>t. u v *\<^sub>R v) = (0::'a)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
finite t
t \<subseteq> S
sum u t = 0
v \<in> t
u v \<noteq> 0
(\<Sum>v\<in>t. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
[PROOF STEP]
apply (rule_tac x="\<lambda>x. if x\<in>t then u x else 0" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite t; t \<subseteq> S; sum u t = 0; v \<in> t; u v \<noteq> 0; (\<Sum>v\<in>t. u v *\<^sub>R v) = (0::'a)\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>S. if x \<in> t then u x else 0) = 0 \<and> (\<exists>v\<in>S. (if v \<in> t then u v else 0) \<noteq> 0) \<and> (\<Sum>v\<in>S. (if v \<in> t then u v else 0) *\<^sub>R v) = (0::'a)
[PROOF STEP]
apply (auto simp: * sum.inter_restrict[OF assms, symmetric] Int_absorb1[OF \<open>t\<subseteq>S\<close>])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
[PROOF STEP]
obtain u v where "sum u S = 0"  "v\<in>S" "u v \<noteq> 0" "(\<Sum>v\<in>S. u v *\<^sub>R v) = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>sum u S = 0; v \<in> S; u v \<noteq> 0; (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum u S = 0
v \<in> S
u v \<noteq> 0
(\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a) \<Longrightarrow> affine_dependent S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum u S = 0
v \<in> S
u v \<noteq> 0
(\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
sum u S = 0
v \<in> S
u v \<noteq> 0
(\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. affine_dependent S
[PROOF STEP]
unfolding affine_dependent_explicit
[PROOF STATE]
proof (prove)
using this:
sum u S = 0
v \<in> S
u v \<noteq> 0
(\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. \<exists>Sa u. finite Sa \<and> Sa \<subseteq> S \<and> sum u Sa = 0 \<and> (\<exists>v\<in>Sa. u v \<noteq> 0) \<and> (\<Sum>v\<in>Sa. u v *\<^sub>R v) = (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sum u S = 0
v \<in> S
u v \<noteq> 0
(\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a)
finite S

goal (1 subgoal):
 1. \<exists>Sa u. finite Sa \<and> Sa \<subseteq> S \<and> sum u Sa = 0 \<and> (\<exists>v\<in>Sa. u v \<noteq> 0) \<and> (\<Sum>v\<in>Sa. u v *\<^sub>R v) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine_dependent S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_wp_PC:
  "\<lbrakk> maximal (wp a); maximal (wp b) \<rbrakk> \<Longrightarrow> maximal (wp (a \<^bsub>P\<^esub>\<oplus> b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>maximal (wp a); maximal (wp b)\<rbrakk> \<Longrightarrow> maximal (wp (a \<^bsub>P\<^esub>\<oplus> b))
[PROOF STEP]
by(rule maximalI, simp add:maximalD field_simps wp_eval)


[STATEMENT]
lemma free_basis_dec_morph: "u \<in> \<langle>G\<rangle>\<^sub>F \<Longrightarrow> v \<in> \<langle>G\<rangle>\<^sub>F \<Longrightarrow>
    Dec (\<BB>\<^sub>F G) (u \<cdot> v) = (Dec (\<BB>\<^sub>F G) u) \<cdot> (Dec (\<BB>\<^sub>F G) v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<in> \<langle>G\<rangle>\<^sub>F; v \<in> \<langle>G\<rangle>\<^sub>F\<rbrakk> \<Longrightarrow> Dec \<BB>\<^sub>F G u \<cdot> v = (Dec \<BB>\<^sub>F G u) \<cdot> (Dec \<BB>\<^sub>F G v)
[PROOF STEP]
using code.code_dec_morph[OF free_basis_code, of u G v, symmetric,
        unfolded  basis_gen_hull_free[of G]]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>u \<in> \<langle>G\<rangle>\<^sub>F; v \<in> \<langle>G\<rangle>\<^sub>F\<rbrakk> \<Longrightarrow> Dec \<BB>\<^sub>F G u \<cdot> v = (Dec \<BB>\<^sub>F G u) \<cdot> (Dec \<BB>\<^sub>F G v)

goal (1 subgoal):
 1. \<lbrakk>u \<in> \<langle>G\<rangle>\<^sub>F; v \<in> \<langle>G\<rangle>\<^sub>F\<rbrakk> \<Longrightarrow> Dec \<BB>\<^sub>F G u \<cdot> v = (Dec \<BB>\<^sub>F G u) \<cdot> (Dec \<BB>\<^sub>F G v)
[PROOF STEP]
.


[STATEMENT]
lemma (in abelian_group) a_l_repr_independence:
  assumes y: "y \<in> x <+ H" and x: "x \<in> carrier G" and sb: "subgroup H (add_monoid G)"
  shows "x <+ H = y <+ H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x <+ H = y <+ H
[PROOF STEP]
apply (rule group.l_repr_independence [OF a_group,
    folded a_l_coset_def, simplified monoid_record_simps])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. y \<in> x <+ H
 2. x \<in> carrier G
 3. subgroup H (add_monoid G)
[PROOF STEP]
apply (rule y)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> carrier G
 2. subgroup H (add_monoid G)
[PROOF STEP]
apply (rule x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H (add_monoid G)
[PROOF STEP]
apply (rule sb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_v: "cfg \<in> valid_cfg \<Longrightarrow> enn2real (v cfg) = \<P>(\<omega> in T cfg. (HLD S1 suntil HLD S2) (state cfg ## \<omega>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cfg \<in> valid_cfg \<Longrightarrow> enn2real (v cfg) = T.prob cfg {\<omega> \<in> space (T cfg). (HLD S1 suntil HLD S2) (state cfg ## \<omega>)}
[PROOF STEP]
by (auto simp add: v_def T.emeasure_eq_measure)


[STATEMENT]
lemma integrable_count_space_nat_iff:
  fixes f :: "nat \<Rightarrow> _::{banach,second_countable_topology}"
  shows "integrable (count_space UNIV) f \<longleftrightarrow> summable (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (count_space UNIV) f = summable (\<lambda>x. norm (f x))
[PROOF STEP]
by (auto simp add: integrable_iff_bounded nn_integral_count_space_nat ennreal_suminf_neq_top
           intro:  summable_suminf_not_top)


[STATEMENT]
lemma ereal_ennreal_cases:
  obtains b where "0 \<le> a" "a = enn2ereal b" | "a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>b. \<lbrakk>0 \<le> a; a = enn2ereal b\<rbrakk> \<Longrightarrow> thesis; a < 0 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using e2ennreal'_inverse[of a, symmetric]
[PROOF STATE]
proof (prove)
using this:
a \<in> {x. 0 \<le> x} \<Longrightarrow> a = enn2ereal (e2ennreal' a)

goal (1 subgoal):
 1. \<lbrakk>\<And>b. \<lbrakk>0 \<le> a; a = enn2ereal b\<rbrakk> \<Longrightarrow> thesis; a < 0 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (cases "0 \<le> a") (auto intro: enn2ereal_nonneg)


[STATEMENT]
lemma continuous_on_real_root [continuous_intros]:
  "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. root n (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. root n (f x))
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s) \<Longrightarrow> \<forall>x\<in>s. ((\<lambda>x. root n (f x)) \<longlongrightarrow> root n (f x)) (at x within s)
[PROOF STEP]
by (auto intro: tendsto_real_root)


[STATEMENT]
lemma map_const_spmf_of_set:
  "\<lbrakk> finite A; A \<noteq> {} \<rbrakk> \<Longrightarrow> map_spmf (\<lambda>_. c) (spmf_of_set A) = return_spmf c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> map_spmf (\<lambda>_. c) (spmf_of_set A) = return_spmf c
[PROOF STEP]
by(simp add: map_spmf_conv_bind_spmf bind_spmf_const)


[STATEMENT]
lemma finsum_permutations_compose_right: assumes q: "q permutes S"
  and *: "f \<in> {p. p permutes S} \<rightarrow> carrier R"
  shows "finsum R f {p. p permutes S} = finsum R (\<lambda>p. f(p \<circ> q)) {p. p permutes S}"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
let ?S = "{p. p permutes S}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
let ?inv = "Hilbert_Choice.inv"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
have th0: "?rhs = finsum R (f \<circ> (\<lambda>p. p \<circ> q)) ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q)) = finsum R (f \<circ> (\<lambda>p. p \<circ> q)) {p. p permutes S}
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
(\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q)) = finsum R (f \<circ> (\<lambda>p. p \<circ> q)) {p. p permutes S}

goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
have th1: "inj_on (\<lambda>p. p \<circ> q) ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>p. p \<circ> q) {p. p permutes S}
[PROOF STEP]
proof (auto simp add: inj_on_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x permutes S; y permutes S; x \<circ> q = y \<circ> q\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix p r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x permutes S; y permutes S; x \<circ> q = y \<circ> q\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "p permutes S"
      and r: "r permutes S"
      and rp: "p \<circ> q = r \<circ> q"
[PROOF STATE]
proof (state)
this:
p permutes S
r permutes S
p \<circ> q = r \<circ> q

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x permutes S; y permutes S; x \<circ> q = y \<circ> q\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p permutes S
r permutes S
p \<circ> q = r \<circ> q
[PROOF STEP]
have "p \<circ> (q \<circ> ?inv q) = r \<circ> (q \<circ> ?inv q)"
[PROOF STATE]
proof (prove)
using this:
p permutes S
r permutes S
p \<circ> q = r \<circ> q

goal (1 subgoal):
 1. p \<circ> (q \<circ> inv q) = r \<circ> (q \<circ> inv q)
[PROOF STEP]
by (simp add: o_assoc)
[PROOF STATE]
proof (state)
this:
p \<circ> (q \<circ> inv q) = r \<circ> (q \<circ> inv q)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x permutes S; y permutes S; x \<circ> q = y \<circ> q\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with permutes_surj[OF q, unfolded surj_iff]
[PROOF STATE]
proof (chain)
picking this:
q \<circ> inv q = id
p \<circ> (q \<circ> inv q) = r \<circ> (q \<circ> inv q)
[PROOF STEP]
show "p = r"
[PROOF STATE]
proof (prove)
using this:
q \<circ> inv q = id
p \<circ> (q \<circ> inv q) = r \<circ> (q \<circ> inv q)

goal (1 subgoal):
 1. p = r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>p. p \<circ> q) {p. p permutes S}

goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
have th3: "(\<lambda>p. p \<circ> q) ` ?S = ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. p \<circ> q) ` {p. p permutes S} = {p. p permutes S}
[PROOF STEP]
using image_compose_permutations_right[OF q]
[PROOF STATE]
proof (prove)
using this:
{p \<circ> q |p. p permutes S} = {p. p permutes S}

goal (1 subgoal):
 1. (\<lambda>p. p \<circ> q) ` {p. p permutes S} = {p. p permutes S}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>p. p \<circ> q) ` {p. p permutes S} = {p. p permutes S}

goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
from finsum_reindex[OF _ th1, of f]
[PROOF STATE]
proof (chain)
picking this:
f \<in> (\<lambda>p. p \<circ> q) ` {p. p permutes S} \<rightarrow> carrier R \<Longrightarrow> finsum R f ((\<lambda>p. p \<circ> q) ` {p. p permutes S}) = (\<Oplus>x\<in>{p. p permutes S}. f (x \<circ> q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> (\<lambda>p. p \<circ> q) ` {p. p permutes S} \<rightarrow> carrier R \<Longrightarrow> finsum R f ((\<lambda>p. p \<circ> q) ` {p. p permutes S}) = (\<Oplus>x\<in>{p. p permutes S}. f (x \<circ> q))

goal (1 subgoal):
 1. finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))
[PROOF STEP]
unfolding th0 th1 th3
[PROOF STATE]
proof (prove)
using this:
f \<in> {p. p permutes S} \<rightarrow> carrier R \<Longrightarrow> finsum R f {p. p permutes S} = finsum R (f \<circ> (\<lambda>x. x \<circ> q)) {x. x permutes S}

goal (1 subgoal):
 1. finsum R f {p. p permutes S} = finsum R (f \<circ> (\<lambda>p. p \<circ> q)) {p. p permutes S}
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
f \<in> {p. p permutes S} \<rightarrow> carrier R \<Longrightarrow> finsum R f {p. p permutes S} = finsum R (f \<circ> (\<lambda>x. x \<circ> q)) {x. x permutes S}
f \<in> {p. p permutes S} \<rightarrow> carrier R

goal (1 subgoal):
 1. finsum R f {p. p permutes S} = finsum R (f \<circ> (\<lambda>p. p \<circ> q)) {p. p permutes S}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finsum R f {p. p permutes S} = (\<Oplus>p\<in>{p. p permutes S}. f (p \<circ> q))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ints_prod:
  assumes "\<And>a. a \<in> A \<Longrightarrow> f a \<in> \<int>"
  shows "prod f A \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f A \<in> \<int>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> A \<Longrightarrow> f ?a \<in> \<int>

goal (1 subgoal):
 1. prod f A \<in> \<int>
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma B_inverse[simp]: "mat_mul (B b) (B_inv b) = ID"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mul (B b) (B_inv b) = ID
[PROOF STEP]
using B.simps ID_def
[PROOF STATE]
proof (prove)
using this:
B ?b = mat (int ?b) (- 1) 1 0
ID = mat 1 0 0 1

goal (1 subgoal):
 1. mat_mul (B b) (B_inv b) = ID
[PROOF STEP]
by auto


[STATEMENT]
lemma rejects_subset: "\<lbrakk>rejects \<F> S M; N \<subseteq> M\<rbrakk> \<Longrightarrow> rejects \<F> S N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rejects \<F> S M; N \<subseteq> M\<rbrakk> \<Longrightarrow> rejects \<F> S N
[PROOF STEP]
by (fastforce simp add: rejects_def comparables_def)


[STATEMENT]
lemma lfp_trans_lemma2:
  fixes v::"'s trans"
  assumes mono: "\<And>t u. \<lbrakk> le_trans t u; \<And>P. sound P \<Longrightarrow> sound (t P);
                         \<And>P. sound P \<Longrightarrow> sound (u P) \<rbrakk> \<Longrightarrow> le_trans (T t) (T u)"
      and nT:   "\<And>t P. \<lbrakk> \<And>Q. sound Q \<Longrightarrow> sound (t Q); sound P \<rbrakk> \<Longrightarrow> sound (T t P)"
      and fv:   "le_trans (T v) v"
      and sv:   "\<And>P. sound P \<Longrightarrow> sound (v P)"
  shows "le_trans (T (lfp_trans T)) (lfp_trans T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. le_trans (T (lfp_trans T)) (lfp_trans T)
[PROOF STEP]
proof(rule lfp_trans_greatest[where T=T and v=v], simp_all add:assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans (T (lfp_trans T)) t
[PROOF STEP]
fix t::"'s trans" and P::"'s expect"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans (T (lfp_trans T)) t
[PROOF STEP]
assume ft: "le_trans (T t) t" and st: "\<And>P. sound P \<Longrightarrow> sound (t P)"
[PROOF STATE]
proof (state)
this:
le_trans (T t) t
sound ?P \<Longrightarrow> sound (t ?P)

goal (1 subgoal):
 1. \<And>t. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans (T (lfp_trans T)) t
[PROOF STEP]
hence "le_trans (lfp_trans T) t"
[PROOF STATE]
proof (prove)
using this:
le_trans (T t) t
sound ?P \<Longrightarrow> sound (t ?P)

goal (1 subgoal):
 1. le_trans (lfp_trans T) t
[PROOF STEP]
by(auto intro!:lfp_trans_lowerbound)
[PROOF STATE]
proof (state)
this:
le_trans (lfp_trans T) t

goal (1 subgoal):
 1. \<And>t. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans (T (lfp_trans T)) t
[PROOF STEP]
with ft st
[PROOF STATE]
proof (chain)
picking this:
le_trans (T t) t
sound ?P \<Longrightarrow> sound (t ?P)
le_trans (lfp_trans T) t
[PROOF STEP]
have "le_trans (T (lfp_trans T)) (T t)"
[PROOF STATE]
proof (prove)
using this:
le_trans (T t) t
sound ?P \<Longrightarrow> sound (t ?P)
le_trans (lfp_trans T) t

goal (1 subgoal):
 1. le_trans (T (lfp_trans T)) (T t)
[PROOF STEP]
by(iprover intro:mono lfp_trans_sound fv sv)
[PROOF STATE]
proof (state)
this:
le_trans (T (lfp_trans T)) (T t)

goal (1 subgoal):
 1. \<And>t. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans (T (lfp_trans T)) t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
le_trans (T (lfp_trans T)) (T t)

goal (1 subgoal):
 1. \<And>t. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans (T (lfp_trans T)) t
[PROOF STEP]
note ft
[PROOF STATE]
proof (state)
this:
le_trans (T t) t

goal (1 subgoal):
 1. \<And>t. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans (T (lfp_trans T)) t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
le_trans (T (lfp_trans T)) t
[PROOF STEP]
show "le_trans (T (lfp_trans T)) t"
[PROOF STATE]
proof (prove)
using this:
le_trans (T (lfp_trans T)) t

goal (1 subgoal):
 1. le_trans (T (lfp_trans T)) t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
le_trans (T (lfp_trans T)) t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stopping_time_min:
  "stopping_time F T \<Longrightarrow> stopping_time F S \<Longrightarrow> stopping_time F (\<lambda>x. min (T x) (S x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>stopping_time F T; stopping_time F S\<rbrakk> \<Longrightarrow> stopping_time F (\<lambda>x. min (T x) (S x))
[PROOF STEP]
by (auto simp: stopping_time_def min_le_iff_disj intro!: pred_intros_logic)


[STATEMENT]
lemma fun_pair_eq_subst: "pair d \<cdot> \<delta> = pair d' \<cdot> \<theta> \<longleftrightarrow> d \<cdot>\<^sub>p \<delta> = d' \<cdot>\<^sub>p \<theta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pair d \<cdot> \<delta> = pair d' \<cdot> \<theta>) = (d \<cdot>\<^sub>p \<delta> = d' \<cdot>\<^sub>p \<theta>)
[PROOF STEP]
by (metis fun_pair_subst fun_pair_eq[of "d \<cdot>\<^sub>p \<delta>" "d' \<cdot>\<^sub>p \<theta>"])


[STATEMENT]
lemma powser_sums_zero_iff [simp]: "(\<lambda>n. a n * 0^n) sums x \<longleftrightarrow> a 0 = x"
  for a :: "nat \<Rightarrow> 'a::real_normed_div_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a n * (0::'a) ^ n) sums x = (a 0 = x)
[PROOF STEP]
using powser_sums_zero sums_unique2
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ?a n * (0::?'a) ^ n) sums ?a 0
\<lbrakk>?f sums ?a; ?f sums ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. (\<lambda>n. a n * (0::'a) ^ n) sums x = (a 0 = x)
[PROOF STEP]
by blast


[STATEMENT]
lemma smallo_powr_nonneg:
  fixes f :: "'a \<Rightarrow> real"
  assumes "f \<in> o[F](g)" "p > 0" "eventually (\<lambda>x. f x \<ge> 0) F" "eventually (\<lambda>x. g x \<ge> 0) F"
  shows   "(\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. 0 \<le> f x
[PROOF STEP]
have "(\<lambda>x. f x powr p) \<in> \<Theta>[F](\<lambda>x. \<bar>f x\<bar> powr p)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 \<le> f x

goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> \<Theta>[F](\<lambda>x. \<bar>f x\<bar> powr p)
[PROOF STEP]
by (intro bigthetaI_cong) (auto elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x powr p) \<in> \<Theta>[F](\<lambda>x. \<bar>f x\<bar> powr p)

goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x powr p) \<in> \<Theta>[F](\<lambda>x. \<bar>f x\<bar> powr p)

goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
have "(\<lambda>x. \<bar>f x\<bar> powr p) \<in> o[F](\<lambda>x. \<bar>g x\<bar> powr p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<bar>f x\<bar> powr p) \<in> o[F](\<lambda>x. \<bar>g x\<bar> powr p)
[PROOF STEP]
by (intro smallo_powr) fact+
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>f x\<bar> powr p) \<in> o[F](\<lambda>x. \<bar>g x\<bar> powr p)

goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>f x\<bar> powr p) \<in> o[F](\<lambda>x. \<bar>g x\<bar> powr p)

goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
from assms(4)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. 0 \<le> g x
[PROOF STEP]
have "(\<lambda>x. \<bar>g x\<bar> powr p) \<in> \<Theta>[F](\<lambda>x. g x powr p)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 \<le> g x

goal (1 subgoal):
 1. (\<lambda>x. \<bar>g x\<bar> powr p) \<in> \<Theta>[F](\<lambda>x. g x powr p)
[PROOF STEP]
by (intro bigthetaI_cong) (auto elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>g x\<bar> powr p) \<in> \<Theta>[F](\<lambda>x. g x powr p)

goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)

goal (1 subgoal):
 1. (\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x powr p) \<in> o[F](\<lambda>x. g x powr p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma loops_disjoint: "all_edges S \<inter> {{v} | v. v \<in> S} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges S \<inter> {{v} |v. v \<in> S} = {}
[PROOF STEP]
unfolding all_edges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {e. e \<subseteq> S \<and> card e = 2} \<inter> {{v} |v. v \<in> S} = {}
[PROOF STEP]
using card_2_iff
[PROOF STATE]
proof (prove)
using this:
(card ?S = 2) = (\<exists>x y. ?S = {x, y} \<and> x \<noteq> y)

goal (1 subgoal):
 1. {e. e \<subseteq> S \<and> card e = 2} \<inter> {{v} |v. v \<in> S} = {}
[PROOF STEP]
by fastforce


[STATEMENT]
theorem n_subset_enum_distinct_elem:
  "distinct xs \<Longrightarrow> ys \<in> set (n_subset_enum xs n) \<Longrightarrow> distinct ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; ys \<in> set (n_subset_enum xs n)\<rbrakk> \<Longrightarrow> distinct ys
[PROOF STEP]
by(cases "length xs < n") (auto simp: filter_bool_list_distinct)


[STATEMENT]
lemma non_zero_mult_invertible_non_zero:
  fixes M :: "real^'n^'n"
  assumes "v \<noteq> 0" and "invertible M"
  shows "v v* M \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v v* M \<noteq> 0
[PROOF STEP]
using \<open>v \<noteq> 0\<close> and \<open>invertible M\<close> and times_invertible_eq_zero
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0
invertible M
\<lbrakk>invertible ?A; ?x v* ?A = 0\<rbrakk> \<Longrightarrow> ?x = 0

goal (1 subgoal):
 1. v v* M \<noteq> 0
[PROOF STEP]
by auto


[STATEMENT]
lemma sublinear_wp_repeat:
  "\<lbrakk> sublinear (wp p); healthy (wp p) \<rbrakk> \<Longrightarrow> sublinear (wp (repeat n p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sublinear (wp p); healthy (wp p)\<rbrakk> \<Longrightarrow> sublinear (wp (repeat n p))
[PROOF STEP]
by(induct n, simp_all add:sublinear_wp_Seq sublinear_wp_Skip healthy_wp_repeat)


[STATEMENT]
lemma surj_map_sum: "surj (map_sum f g)" if "surj f" "surj g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj (map_sum f g)
[PROOF STEP]
apply(safe; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> range (map_sum f g)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> range (map_sum f g)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
surj f
surj g

goal (1 subgoal):
 1. x \<in> range (map_sum f g)
[PROOF STEP]
by(cases x)(auto 4 3 intro: image_eqI[where x="Inl _"] image_eqI[where x="Inr _"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma summable_comparison_test_bigo:
  fixes f :: "nat \<Rightarrow> real"
  assumes "summable (\<lambda>n. norm (g n))" "f \<in> O(g)"
  shows   "summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable f
[PROOF STEP]
from \<open>f \<in> O(g)\<close>
[PROOF STATE]
proof (chain)
picking this:
f \<in> O(g)
[PROOF STEP]
obtain C where C: "eventually (\<lambda>x. norm (f x) \<le> C * norm (g x)) at_top"
[PROOF STATE]
proof (prove)
using this:
f \<in> O(g)

goal (1 subgoal):
 1. (\<And>C. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> C * norm (g x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: landau_o.bigE)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> C * norm (g x)

goal (1 subgoal):
 1. summable f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> C * norm (g x)

goal (1 subgoal):
 1. summable f
[PROOF STEP]
by (rule summable_comparison_test_ev) (insert assms, auto intro: summable_mult)
[PROOF STATE]
proof (state)
this:
summable f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multiplicity_geI:
  assumes "p ^ n dvd x"
  shows   "multiplicity p x \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> multiplicity p x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<le> multiplicity p x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p ^ n dvd x
[PROOF STEP]
have "n \<le> Max {n. p ^ n dvd x}"
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd x

goal (1 subgoal):
 1. n \<le> Max {n. p ^ n dvd x}
[PROOF STEP]
by (intro Max_ge finite_divisor_powers xp) simp_all
[PROOF STATE]
proof (state)
this:
n \<le> Max {n. p ^ n dvd x}

goal (1 subgoal):
 1. n \<le> multiplicity p x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> Max {n. p ^ n dvd x}

goal (1 subgoal):
 1. n \<le> multiplicity p x
[PROOF STEP]
by (subst multiplicity_eq_Max)
[PROOF STATE]
proof (state)
this:
n \<le> multiplicity p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_prefix_length_correct: "
  i < inf_prefix_length xs ys \<Longrightarrow> xs ! i = ys ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < inf_prefix_length xs ys \<Longrightarrow> xs ! i = ys ! i
[PROOF STEP]
apply (frule order_less_le_trans[OF _ inf_prefix_length_leL])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < inf_prefix_length xs ys; i < length xs\<rbrakk> \<Longrightarrow> xs ! i = ys ! i
[PROOF STEP]
apply (frule order_less_le_trans[OF _ inf_prefix_length_leR])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < inf_prefix_length xs ys; i < length xs; i < length ys\<rbrakk> \<Longrightarrow> xs ! i = ys ! i
[PROOF STEP]
apply (unfold inf_prefix_length_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < equal_pair_count (zip xs ys); i < length xs; i < length ys\<rbrakk> \<Longrightarrow> xs ! i = ys ! i
[PROOF STEP]
apply (drule equal_pair_count_correct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; i < length ys; equal_pair (zip xs ys ! i)\<rbrakk> \<Longrightarrow> xs ! i = ys ! i
[PROOF STEP]
apply (simp add: equal_pair_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma invertible_mat_one[simp]: "invertible_mat (1\<^sub>m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat (1\<^sub>m n)
[PROOF STEP]
unfolding invertible_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat (1\<^sub>m n) \<and> (\<exists>B. inverts_mat (1\<^sub>m n) B \<and> inverts_mat B (1\<^sub>m n))
[PROOF STEP]
using inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
inverts_mat ?A ?B \<equiv> ?A * ?B = 1\<^sub>m (dim_row ?A)

goal (1 subgoal):
 1. square_mat (1\<^sub>m n) \<and> (\<exists>B. inverts_mat (1\<^sub>m n) B \<and> inverts_mat B (1\<^sub>m n))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sums_divide: "f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)
[PROOF STEP]
by (rule bounded_linear.sums [OF bounded_linear_divide])


[STATEMENT]
lemma meet_aboveI:
  fixes x y z :: "'a :: Finite_Meet_cpo"
  shows "z \<sqsubseteq> x \<Longrightarrow> z \<sqsubseteq> y \<Longrightarrow> z \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
by (simp add: meet_above_iff)


[STATEMENT]
lemma has_laplaceI:
  assumes "((\<lambda>t. exp (t *\<^sub>R - s) * f t) has_integral L) {0..}"
  shows "(f has_laplace L) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_laplace L) s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. exp (t *\<^sub>R - s) * f t) has_integral L) {0..}

goal (1 subgoal):
 1. (f has_laplace L) s
[PROOF STEP]
by (auto simp: has_laplace_def)


[STATEMENT]
lemma sgn_in_spaceD: \<open>\<psi> \<in> space_as_set A\<close> if \<open>sgn \<psi> \<in> space_as_set A\<close> and \<open>\<psi> \<noteq> 0\<close>
  for \<psi> :: \<open>_ :: complex_normed_vector\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> \<in> space_as_set A
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
sgn \<psi> \<in> space_as_set A
\<psi> \<noteq> (0::'b)

goal (1 subgoal):
 1. \<psi> \<in> space_as_set A
[PROOF STEP]
apply (transfer fixing: \<psi>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>closed_csubspace A; sgn \<psi> \<in> A; \<psi> \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> \<psi> \<in> A
[PROOF STEP]
by (metis closed_csubspace.subspace complex_vector.subspace_scale divideC_field_simps(1) scaleR_eq_0_iff scaleR_scaleC sgn_div_norm sgn_zero_iff)


[STATEMENT]
lemma inner_Basis_scale:
  "b1 \<in> S \<Longrightarrow> inner_Basis (c *\<^sub>R b1) v = c * inner_Basis b1 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b1 \<in> S \<Longrightarrow> local.inner_Basis (c *\<^sub>R b1) v = c * local.inner_Basis b1 v
[PROOF STEP]
by (auto simp: std_dual_def restrict0_def algebra_simps representation_add representation_scale
      B inner_Basis_def sum.distrib sum_distrib_left)


[STATEMENT]
lemma vrat_inverses_law_multiplication:
  assumes "x \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>" and "x \<noteq> 0\<^sub>\<rat>"
  shows "x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>
[PROOF STEP]
have "x' \<noteq> 0 \<Longrightarrow> x' * inverse x' = 1" for x' :: rat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' \<noteq> 0 \<Longrightarrow> x' * inverse x' = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' \<noteq> 0 \<Longrightarrow> ?x' * inverse ?x' = 1

goal (1 subgoal):
 1. x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>

goal (1 subgoal):
 1. x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x *\<^sub>\<rat> x\<inverse>\<^sub>\<rat> = 1\<^sub>\<rat>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma observable_path_prefix :
  assumes "observable M"
  and     "path M (io || tr) q"
  and     "length io = length tr"
  and     "path M (ioP || trP) q"
  and     "length ioP = length trP"
  and     "prefix ioP io"
shows "trP = take (length ioP) tr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
have ioP_def : "ioP = take (length ioP) io"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ioP = take (length ioP) io
[PROOF STEP]
using assms(6)
[PROOF STATE]
proof (prove)
using this:
prefix ioP io

goal (1 subgoal):
 1. ioP = take (length ioP) io
[PROOF STEP]
by (metis append_eq_conv_conj prefixE)
[PROOF STATE]
proof (state)
this:
ioP = take (length ioP) io

goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ioP = take (length ioP) io
[PROOF STEP]
have "take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr"
[PROOF STATE]
proof (prove)
using this:
ioP = take (length ioP) io

goal (1 subgoal):
 1. take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr
[PROOF STEP]
using take_zip
[PROOF STATE]
proof (prove)
using this:
ioP = take (length ioP) io
take ?n (?xs || ?ys) = take ?n ?xs || take ?n ?ys

goal (1 subgoal):
 1. take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr

goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr

goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
have "path M (take (length ioP) (io || tr)) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M (take (length ioP) (io || tr)) q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
observable M
path M (io || tr) q
length io = length tr
path M (ioP || trP) q
length ioP = length trP
prefix ioP io

goal (1 subgoal):
 1. path M (take (length ioP) (io || tr)) q
[PROOF STEP]
by (metis FSM.path_append_elim append_take_drop_id)
[PROOF STATE]
proof (state)
this:
path M (take (length ioP) (io || tr)) q

goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr
path M (take (length ioP) (io || tr)) q
[PROOF STEP]
have "path M (take (length ioP) io || take (length ioP) tr) q
                    \<and> length (take (length ioP) io) = length (take (length ioP) tr)"
[PROOF STATE]
proof (prove)
using this:
take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr
path M (take (length ioP) (io || tr)) q

goal (1 subgoal):
 1. path M (take (length ioP) io || take (length ioP) tr) q \<and> length (take (length ioP) io) = length (take (length ioP) tr)
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
take (length ioP) (io || tr) = take (length ioP) io || take (length ioP) tr
path M (take (length ioP) (io || tr)) q
length io = length tr

goal (1 subgoal):
 1. path M (take (length ioP) io || take (length ioP) tr) q \<and> length (take (length ioP) io) = length (take (length ioP) tr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
path M (take (length ioP) io || take (length ioP) tr) q \<and> length (take (length ioP) io) = length (take (length ioP) tr)

goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path M (take (length ioP) io || take (length ioP) tr) q \<and> length (take (length ioP) io) = length (take (length ioP) tr)
[PROOF STEP]
have "path M (ioP || take (length ioP) tr) q \<and> length ioP = length (take (length ioP) tr)"
[PROOF STATE]
proof (prove)
using this:
path M (take (length ioP) io || take (length ioP) tr) q \<and> length (take (length ioP) io) = length (take (length ioP) tr)

goal (1 subgoal):
 1. path M (ioP || take (length ioP) tr) q \<and> length ioP = length (take (length ioP) tr)
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
path M (take (length ioP) io || take (length ioP) tr) q \<and> length (take (length ioP) io) = length (take (length ioP) tr)
length io = length tr

goal (1 subgoal):
 1. path M (ioP || take (length ioP) tr) q \<and> length ioP = length (take (length ioP) tr)
[PROOF STEP]
using ioP_def
[PROOF STATE]
proof (prove)
using this:
path M (take (length ioP) io || take (length ioP) tr) q \<and> length (take (length ioP) io) = length (take (length ioP) tr)
length io = length tr
ioP = take (length ioP) io

goal (1 subgoal):
 1. path M (ioP || take (length ioP) tr) q \<and> length ioP = length (take (length ioP) tr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
path M (ioP || take (length ioP) tr) q \<and> length ioP = length (take (length ioP) tr)

goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path M (ioP || take (length ioP) tr) q \<and> length ioP = length (take (length ioP) tr)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path M (ioP || take (length ioP) tr) q \<and> length ioP = length (take (length ioP) tr)

goal (1 subgoal):
 1. trP = take (length ioP) tr
[PROOF STEP]
by (meson assms(1) assms(4) assms(5) language_state observable_path_unique)
[PROOF STATE]
proof (state)
this:
trP = take (length ioP) tr

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma col124__nos:
  assumes "Col P Q B"
  shows "\<not> P Q OS A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> P Q OS A B
[PROOF STEP]
using assms one_side_not_col124
[PROOF STATE]
proof (prove)
using this:
Col P Q B
?A ?B OS ?X ?Y \<Longrightarrow> \<not> Col ?A ?B ?Y

goal (1 subgoal):
 1. \<not> P Q OS A B
[PROOF STEP]
by blast


[STATEMENT]
lemma add_diff_inverse_ennreal:
  fixes x y :: ennreal shows "x \<le> y \<Longrightarrow> x + (y - x) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x + (y - x) = y
[PROOF STEP]
by (cases x) (simp_all add: top_unique add_diff_eq_ennreal)


[STATEMENT]
lemma bounded_uminus [simp]:
  fixes X :: "'a::real_normed_vector set"
  shows "bounded (uminus ` X) \<longleftrightarrow> bounded X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (uminus ` X) = bounded X
[PROOF STEP]
by (auto simp: bounded_def dist_norm; rule_tac x="-x" in exI; force simp: add.commute norm_minus_commute)


[STATEMENT]
lemma avl_insert: "avl t \<Longrightarrow>
  avl(insert x t) \<and>
  height(insert x t) = height t + (if incr t (insert x t) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. avl t \<Longrightarrow> avl (AVL_Bal_Set.insert x t) \<and> height (AVL_Bal_Set.insert x t) = height t + (if incr t (AVL_Bal_Set.insert x t) then 1 else 0)
[PROOF STEP]
apply(induction x t rule: insert.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Bal_Set.insert x \<langle>\<rangle>) \<and> height (AVL_Bal_Set.insert x \<langle>\<rangle>) = height \<langle>\<rangle> + (if incr \<langle>\<rangle> (AVL_Bal_Set.insert x \<langle>\<rangle>) then 1 else 0)
 2. \<And>x l a b r. \<lbrakk>\<lbrakk>cmp x a = LT; avl l\<rbrakk> \<Longrightarrow> avl (AVL_Bal_Set.insert x l) \<and> height (AVL_Bal_Set.insert x l) = height l + (if incr l (AVL_Bal_Set.insert x l) then 1 else 0); \<lbrakk>cmp x a = GT; avl r\<rbrakk> \<Longrightarrow> avl (AVL_Bal_Set.insert x r) \<and> height (AVL_Bal_Set.insert x r) = height r + (if incr r (AVL_Bal_Set.insert x r) then 1 else 0); avl \<langle>l, (a, b), r\<rangle>\<rbrakk> \<Longrightarrow> avl (AVL_Bal_Set.insert x \<langle>l, (a, b), r\<rangle>) \<and> height (AVL_Bal_Set.insert x \<langle>l, (a, b), r\<rangle>) = height \<langle>l, (a, b), r\<rangle> + (if incr \<langle>l, (a, b), r\<rangle> (AVL_Bal_Set.insert x \<langle>l, (a, b), r\<rangle>) then 1 else 0)
[PROOF STEP]
apply(auto split!: splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma distr_return:
  assumes "f \<in> measurable M N" and "x \<in> space M"
  shows "distr (return M x) N f = return N (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr (return M x) N f = return N (f x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> M \<rightarrow>\<^sub>M N
x \<in> space M

goal (1 subgoal):
 1. distr (return M x) N f = return N (f x)
[PROOF STEP]
by (intro measure_eqI) (simp_all add: indicator_def emeasure_distr)


[STATEMENT]
lemma differentiable_on_inverse: "f differentiable_on S \<Longrightarrow> 0 \<notin> f ` S \<Longrightarrow> (\<lambda>x. inverse (f x)) differentiable_on S"
  for f::"_\<Rightarrow>_::real_normed_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f differentiable_on S; (0::'d) \<notin> f ` S\<rbrakk> \<Longrightarrow> (\<lambda>x. inverse (f x)) differentiable_on S
[PROOF STEP]
by (auto simp: differentiable_on_def intro!: differentiable_inverse)


[STATEMENT]
lemma fset_choice:
  assumes a: "\<forall>x. x |\<in>| A \<longrightarrow> (\<exists>y. P x y)"
  shows "\<exists>f. \<forall>x. x |\<in>| A \<longrightarrow> P x (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. \<forall>x. x |\<in>| A \<longrightarrow> P x (f x)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x |\<in>| A \<longrightarrow> (\<exists>y. P x y)

goal (1 subgoal):
 1. \<exists>f. \<forall>x. x |\<in>| A \<longrightarrow> P x (f x)
[PROOF STEP]
apply(descending)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A P. (\<And>x. List.member A x \<Longrightarrow> Ex (P x)) \<Longrightarrow> \<exists>f. \<forall>x. List.member A x \<longrightarrow> P x (f x)
[PROOF STEP]
using finite_set_choice
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; \<forall>x\<in>?A. \<exists>y. ?P x y\<rbrakk> \<Longrightarrow> \<exists>f. \<forall>x\<in>?A. ?P x (f x)

goal (1 subgoal):
 1. \<And>A P. (\<And>x. List.member A x \<Longrightarrow> Ex (P x)) \<Longrightarrow> \<exists>f. \<forall>x. List.member A x \<longrightarrow> P x (f x)
[PROOF STEP]
by (auto simp add: Ball_def)


[STATEMENT]
lemma indep_set_alt: "indep_set S \<longleftrightarrow> \<not>(\<exists>S' \<subseteq> S. dep_set S')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_set S = (\<not> (\<exists>S'\<subseteq>S. dep_set S'))
[PROOF STEP]
using no_dep_in_indep indep_set_alt_intro
[PROOF STATE]
proof (prove)
using this:
indep_set ?S \<Longrightarrow> \<not> (\<exists>T\<subseteq>?S. dep_set T)
\<not> (\<exists>T\<subseteq>?S. dep_set T) \<Longrightarrow> indep_set ?S

goal (1 subgoal):
 1. indep_set S = (\<not> (\<exists>S'\<subseteq>S. dep_set S'))
[PROOF STEP]
by blast


[STATEMENT]
lemma sinvar_mono_I_proofrule_simple:
  "\<lbrakk> (\<forall> G nP. sinvar G nP = (\<forall> (e1, e2) \<in> edges G. P e1 e2 nP) ) \<rbrakk> \<Longrightarrow> sinvar_mono"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>G nP. sinvar G nP = (\<forall>(e1, e2)\<in>edges G. P e1 e2 nP) \<Longrightarrow> sinvar_mono
[PROOF STEP]
apply(simp add: sinvar_mono_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>G nP. sinvar G nP = (\<forall>x\<in>edges G. case x of (e1, e2) \<Rightarrow> P e1 e2 nP) \<Longrightarrow> \<forall>nP N E'. (\<exists>E. wf_graph \<lparr>nodes = N, edges = E\<rparr> \<and> E' \<subseteq> E \<and> (\<forall>x\<in>E. case x of (e1, e2) \<Rightarrow> P e1 e2 nP)) \<longrightarrow> (\<forall>x\<in>E'. case x of (e1, e2) \<Rightarrow> P e1 e2 nP)
[PROOF STEP]
apply(clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nP N E' a b E. \<lbrakk>\<forall>G nP. sinvar G nP = (\<forall>(e1, e2)\<in>edges G. P e1 e2 nP); (a, b) \<in> E'; wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E; \<forall>(e1, e2)\<in>E. P e1 e2 nP\<rbrakk> \<Longrightarrow> P a b nP
[PROOF STEP]
apply(fast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma diagonal_to_Smith_PQ_JNF_canceled_both:
  "{0..<int n} \<noteq> {} \<Longrightarrow> {0..<int m} \<noteq> {} \<Longrightarrow> 1 < m \<Longrightarrow> 1 < n \<Longrightarrow>
  isDiagonal_mat A \<Longrightarrow> is_bezout_ext bezout \<Longrightarrow> A \<in> carrier_mat m n \<Longrightarrow>
  (P, S, Q) = diagonal_to_Smith_PQ_JNF A bezout \<Longrightarrow> S = P * A * Q \<and>
  invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S
  \<and> P \<in> carrier_mat m m \<and> S \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{0..<int n} \<noteq> {}; {0..<int m} \<noteq> {}; 1 < m; 1 < n; isDiagonal_mat A; is_bezout_ext bezout; A \<in> carrier_mat m n; (P, S, Q) = diagonal_to_Smith_PQ_JNF A bezout\<rbrakk> \<Longrightarrow> S = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S \<and> P \<in> carrier_mat m m \<and> S \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
using diagonal_to_Smith_PQ_JNF_canceled_first[cancel_type_definition]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{0..<int ?n} \<noteq> {}; {0..<int ?m} \<noteq> {}; 1 < ?m; 1 < ?n; isDiagonal_mat ?A; is_bezout_ext ?bezout; ?A \<in> carrier_mat ?m ?n; (?P, ?S, ?Q) = diagonal_to_Smith_PQ_JNF ?A ?bezout\<rbrakk> \<Longrightarrow> ?S = ?P * ?A * ?Q \<and> invertible_mat ?P \<and> invertible_mat ?Q \<and> Smith_normal_form_mat ?S \<and> ?P \<in> carrier_mat ?m ?m \<and> ?S \<in> carrier_mat ?m ?n \<and> ?Q \<in> carrier_mat ?n ?n

goal (1 subgoal):
 1. \<lbrakk>{0..<int n} \<noteq> {}; {0..<int m} \<noteq> {}; 1 < m; 1 < n; isDiagonal_mat A; is_bezout_ext bezout; A \<in> carrier_mat m n; (P, S, Q) = diagonal_to_Smith_PQ_JNF A bezout\<rbrakk> \<Longrightarrow> S = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S \<and> P \<in> carrier_mat m m \<and> S \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
by blast


[STATEMENT]
lemma list_card_smaller_contains_eq_elemens:
  assumes "length qs = n" and "card (set qs) < n"
  shows "\<exists> i < length qs. \<exists> j < length qs. i < j \<and> qs ! i = qs ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i<length qs. \<exists>j<length qs. i < j \<and> qs ! i = qs ! j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length qs = n
card (set qs) < n

goal (1 subgoal):
 1. \<exists>i<length qs. \<exists>j<length qs. i < j \<and> qs ! i = qs ! j
[PROOF STEP]
by auto (metis distinct_card distinct_conv_nth linorder_neqE_nat)


[STATEMENT]
lemma singleton_set_is:
  assumes "\<forall>x \<in> M. x = y" "M \<noteq> {}"
  shows "M = {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = {y}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>M. x = y
M \<noteq> {}

goal (1 subgoal):
 1. M = {y}
[PROOF STEP]
by auto


[STATEMENT]
lemma FOREACH_rule_map_eq:
    assumes "finite (dom g)"
    assumes "X Map.empty = s"
    assumes "X g = t"
    assumes "\<And> h k v. h \<subseteq>\<^sub>m g \<Longrightarrow> g k = Some v \<Longrightarrow> k \<notin> dom h \<Longrightarrow>
      f (k, v) (X h) \<le> SPEC (HOL.eq (X (h (k \<mapsto> v))))"
    shows "FOREACH (map_to_set g) f s \<le> SPEC (HOL.eq t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FOREACH (map_to_set g) f s \<le> SPEC ((=) t)
[PROOF STEP]
by (rule FOREACH_rule_map[where I = "HOL.eq \<circ> X"]) (use assms in auto)


[STATEMENT]
lemma "\<And>s. (\<forall>l. I (l(x:=0)) s) = (\<forall>l. l x = 0 \<longrightarrow> I l s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. (\<forall>l. I (l(x := 0::'c)) s) = (\<forall>l. l x = (0::'c) \<longrightarrow> I l s)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s l. \<lbrakk>\<forall>l. I (l(x := 0::'c)) s; l x = (0::'c)\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
by (metis fun_upd_triv)


[STATEMENT]
lemma mult_inv_character: "\<chi> k * inv_character \<chi> k = principal_char G k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> k * inv_character \<chi> k = principal_char G k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<chi> k * inv_character \<chi> k = principal_char G k
[PROOF STEP]
have "\<chi> k * inv_character \<chi> k = of_real (norm (\<chi> k) ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> k * inv_character \<chi> k = complex_of_real ((cmod (\<chi> k))\<^sup>2)
[PROOF STEP]
by (subst complex_norm_square) (simp add: inv_character_def)
[PROOF STATE]
proof (state)
this:
\<chi> k * inv_character \<chi> k = complex_of_real ((cmod (\<chi> k))\<^sup>2)

goal (1 subgoal):
 1. \<chi> k * inv_character \<chi> k = principal_char G k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<chi> k * inv_character \<chi> k = complex_of_real ((cmod (\<chi> k))\<^sup>2)

goal (1 subgoal):
 1. \<chi> k * inv_character \<chi> k = principal_char G k
[PROOF STEP]
have "\<dots> = principal_char G k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real ((cmod (\<chi> k))\<^sup>2) = principal_char G k
[PROOF STEP]
by (simp add: principal_char_def norm_char)
[PROOF STATE]
proof (state)
this:
complex_of_real ((cmod (\<chi> k))\<^sup>2) = principal_char G k

goal (1 subgoal):
 1. \<chi> k * inv_character \<chi> k = principal_char G k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<chi> k * inv_character \<chi> k = principal_char G k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<chi> k * inv_character \<chi> k = principal_char G k

goal (1 subgoal):
 1. \<chi> k * inv_character \<chi> k = principal_char G k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<chi> k * inv_character \<chi> k = principal_char G k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_upper_solution:
  fixes w w'::"real \<Rightarrow> real"
  assumes sol: "(y solves_ode f) T X"
  assumes w': "(w has_vderiv_on w') T"
    and upper: "\<And>t. t \<in> T \<Longrightarrow> t > t0 \<Longrightarrow> f t (w t) < w' t"
    and iv: "y t0 \<le> w t0" "y t0 = w t0 \<Longrightarrow> f t0 (y t0) < w' t0"
  assumes t: "t0 < t" "t0 \<in> T" "t \<in> T" "is_interval T"
  shows "y t < w t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
note solves_odeD(1)[OF sol]
[PROOF STATE]
proof (state)
this:
(y has_vderiv_on (\<lambda>t. f t (y t))) T

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(y has_vderiv_on (\<lambda>t. f t (y t))) T

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
note w'
[PROOF STATE]
proof (state)
this:
(w has_vderiv_on w') T

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(w has_vderiv_on w') T

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
have "f t (y t) - f t (y t) < w' t - f t (w t)" if "t \<in> T" "t > t0" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f t (y t) - f t (y t) < w' t - f t (w t)
[PROOF STEP]
using upper(1)[OF that]
[PROOF STATE]
proof (prove)
using this:
f t (w t) < w' t

goal (1 subgoal):
 1. f t (y t) - f t (y t) < w' t - f t (w t)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
\<lbrakk>?t \<in> T; t0 < ?t\<rbrakk> \<Longrightarrow> f ?t (y ?t) - f ?t (y ?t) < w' ?t - f ?t (w ?t)

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?t \<in> T; t0 < ?t\<rbrakk> \<Longrightarrow> f ?t (y ?t) - f ?t (y ?t) < w' ?t - f ?t (w ?t)

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
note iv
[PROOF STATE]
proof (state)
this:
y t0 \<le> w t0
y t0 = w t0 \<Longrightarrow> f t0 (y t0) < w' t0

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y t0 \<le> w t0
y t0 = w t0 \<Longrightarrow> f t0 (y t0) < w' t0

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
note t
[PROOF STATE]
proof (state)
this:
t0 < t
t0 \<in> T
t \<in> T
is_interval T

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(y has_vderiv_on (\<lambda>t. f t (y t))) T
(w has_vderiv_on w') T
\<lbrakk>?t \<in> T; t0 < ?t\<rbrakk> \<Longrightarrow> f ?t (y ?t) - f ?t (y ?t) < w' ?t - f ?t (w ?t)
y t0 \<le> w t0
y t0 = w t0 \<Longrightarrow> f t0 (y t0) < w' t0
t0 < t
t0 \<in> T
t \<in> T
is_interval T
[PROOF STEP]
show "y t < w t"
[PROOF STATE]
proof (prove)
using this:
(y has_vderiv_on (\<lambda>t. f t (y t))) T
(w has_vderiv_on w') T
\<lbrakk>?t \<in> T; t0 < ?t\<rbrakk> \<Longrightarrow> f ?t (y ?t) - f ?t (y ?t) < w' ?t - f ?t (w ?t)
y t0 \<le> w t0
y t0 = w t0 \<Longrightarrow> f t0 (y t0) < w' t0
t0 < t
t0 \<in> T
t \<in> T
is_interval T

goal (1 subgoal):
 1. y t < w t
[PROOF STEP]
by (rule has_derivatives_less_lemma)
[PROOF STATE]
proof (state)
this:
y t < w t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_of_mul_contains_zero:
  "0 \<in> set_of (A * B)"
  if "0 \<in> set_of A \<or> 0 \<in> set_of B"
  for A :: "'a::linordered_idom interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<in>\<^sub>i A * B
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<in>\<^sub>i A \<or> (0::'a) \<in>\<^sub>i B

goal (1 subgoal):
 1. (0::'a) \<in>\<^sub>i A * B
[PROOF STEP]
by (auto simp: set_of_eq lower_times upper_times algebra_simps mult_le_0_iff
      mult_bounds_enclose_zero1 mult_bounds_enclose_zero2)


[STATEMENT]
lemma (in prob_space) exponential_distributed_Min:
  assumes finI: "finite I"
  assumes A: "I \<noteq> {}"
  assumes l: "\<And>i. i \<in> I \<Longrightarrow> 0 < l i"
  assumes expX: "\<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (exponential_density (l i))"
  assumes ind: "indep_vars (\<lambda>i. borel) X I"
  shows "distributed M lborel (\<lambda>x. Min ((\<lambda>i. X i x)`I)) (exponential_density (\<Sum>i\<in>I. l i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. MIN i\<in>I. X i x) (\<lambda>x. ennreal (exponential_density (sum l I) x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
I \<noteq> {}
?i12 \<in> I \<Longrightarrow> 0 < l ?i12
?i12 \<in> I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X I

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. MIN i\<in>I. X i x) (\<lambda>x. ennreal (exponential_density (sum l I) x))
[PROOF STEP]
proof (induct rule: finite_ne_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<And>i. i \<in> {x} \<Longrightarrow> 0 < l i; \<And>i. i \<in> {x} \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X {x}\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>{x}. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l {x}) xa))
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> 0 < l i; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>F. X i x) (\<lambda>x. ennreal (exponential_density (sum l F) x)); \<And>i. i \<in> insert x F \<Longrightarrow> 0 < l i; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l (insert x F)) xa))
[PROOF STEP]
case (singleton i)
[PROOF STATE]
proof (state)
this:
?i12 \<in> {i} \<Longrightarrow> 0 < l ?i12
?i12 \<in> {i} \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X {i}

goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<And>i. i \<in> {x} \<Longrightarrow> 0 < l i; \<And>i. i \<in> {x} \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X {x}\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>{x}. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l {x}) xa))
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> 0 < l i; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>F. X i x) (\<lambda>x. ennreal (exponential_density (sum l F) x)); \<And>i. i \<in> insert x F \<Longrightarrow> 0 < l i; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l (insert x F)) xa))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i12 \<in> {i} \<Longrightarrow> 0 < l ?i12
?i12 \<in> {i} \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X {i}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i12 \<in> {i} \<Longrightarrow> 0 < l ?i12
?i12 \<in> {i} \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X {i}

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. MIN i\<in>{i}. X i x) (\<lambda>x. ennreal (exponential_density (sum l {i}) x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distributed M lborel (\<lambda>x. MIN i\<in>{i}. X i x) (\<lambda>x. ennreal (exponential_density (sum l {i}) x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> 0 < l i; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>F. X i x) (\<lambda>x. ennreal (exponential_density (sum l F) x)); \<And>i. i \<in> insert x F \<Longrightarrow> 0 < l i; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l (insert x F)) xa))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> 0 < l i; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>F. X i x) (\<lambda>x. ennreal (exponential_density (sum l F) x)); \<And>i. i \<in> insert x F \<Longrightarrow> 0 < l i; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l (insert x F)) xa))
[PROOF STEP]
case (insert i I)
[PROOF STATE]
proof (state)
this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>\<And>i. i \<in> I \<Longrightarrow> 0 < l i; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>I. X i x) (\<lambda>x. ennreal (exponential_density (sum l I) x))
?i12 \<in> insert i I \<Longrightarrow> 0 < l ?i12
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X (insert i I)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> 0 < l i; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>F. X i x) (\<lambda>x. ennreal (exponential_density (sum l F) x)); \<And>i. i \<in> insert x F \<Longrightarrow> 0 < l i; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l (insert x F)) xa))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>\<And>i. i \<in> I \<Longrightarrow> 0 < l i; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>I. X i x) (\<lambda>x. ennreal (exponential_density (sum l I) x))
?i12 \<in> insert i I \<Longrightarrow> 0 < l ?i12
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X (insert i I)
[PROOF STEP]
have "distributed M lborel (\<lambda>x. min (X i x) (Min ((\<lambda>i. X i x)`I))) (exponential_density (l i + (\<Sum>i\<in>I. l i)))"
[PROOF STATE]
proof (prove)
using this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>\<And>i. i \<in> I \<Longrightarrow> 0 < l i; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>I. X i x) (\<lambda>x. ennreal (exponential_density (sum l I) x))
?i12 \<in> insert i I \<Longrightarrow> 0 < l ?i12
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X (insert i I)

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. min (X i x) (MIN i\<in>I. X i x)) (\<lambda>x. ennreal (exponential_density (l i + sum l I) x))
[PROOF STEP]
by (intro exponential_distributed_min indep_vars_Min insert)
         (auto intro: indep_vars_subset sum_pos)
[PROOF STATE]
proof (state)
this:
distributed M lborel (\<lambda>x. min (X i x) (MIN i\<in>I. X i x)) (\<lambda>x. ennreal (exponential_density (l i + sum l I) x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> 0 < l i; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>F. X i x) (\<lambda>x. ennreal (exponential_density (sum l F) x)); \<And>i. i \<in> insert x F \<Longrightarrow> 0 < l i; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. MIN i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (exponential_density (sum l (insert x F)) xa))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distributed M lborel (\<lambda>x. min (X i x) (MIN i\<in>I. X i x)) (\<lambda>x. ennreal (exponential_density (l i + sum l I) x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distributed M lborel (\<lambda>x. min (X i x) (MIN i\<in>I. X i x)) (\<lambda>x. ennreal (exponential_density (l i + sum l I) x))

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. MIN i\<in>insert i I. X i x) (\<lambda>x. ennreal (exponential_density (sum l (insert i I)) x))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
distributed M lborel (\<lambda>x. min (X i x) (MIN i\<in>I. X i x)) (\<lambda>x. ennreal (exponential_density (l i + sum l I) x))
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>\<And>i. i \<in> I \<Longrightarrow> 0 < l i; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (exponential_density (l i) x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. MIN i\<in>I. X i x) (\<lambda>x. ennreal (exponential_density (sum l I) x))
?i12 \<in> insert i I \<Longrightarrow> 0 < l ?i12
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (exponential_density (l ?i12) x))
indep_vars (\<lambda>i. borel) X (insert i I)

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. MIN i\<in>insert i I. X i x) (\<lambda>x. ennreal (exponential_density (sum l (insert i I)) x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distributed M lborel (\<lambda>x. MIN i\<in>insert i I. X i x) (\<lambda>x. ennreal (exponential_density (sum l (insert i I)) x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_2[simp]:
"sum f {..< 2} = f 0 + f (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<2} = f 0 + f (Suc 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {..<2} = f 0 + f (Suc 0)
[PROOF STEP]
have "{..< 2} = {0, Suc 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<2} = {0, Suc 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..<2} = {0, Suc 0}

goal (1 subgoal):
 1. sum f {..<2} = f 0 + f (Suc 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{..<2} = {0, Suc 0}

goal (1 subgoal):
 1. sum f {..<2} = f 0 + f (Suc 0)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
sum f {..<2} = f 0 + f (Suc 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_monomial_If:
  \<open>lookup (monomial v k) = (\<lambda>k'. if k = k' then v else 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monomial v k) = (\<lambda>k'. if k = k' then v else (0::'b))
[PROOF STEP]
by (intro ext) (auto simp: lookup_single_not_eq)


[STATEMENT]
lemma  repeatAmountOfQuantifiers_helper_eval :
  assumes  "\<And>xs F. eval F xs = eval (step F) xs"
  shows  "eval F xs = eval (repeatAmountOfQuantifiers_helper step n F) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F xs = eval (repeatAmountOfQuantifiers_helper step n F) xs
[PROOF STEP]
apply(induction n arbitrary : F)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>F. eval F xs = eval (repeatAmountOfQuantifiers_helper step 0 F) xs
 2. \<And>n F. (\<And>F. eval F xs = eval (repeatAmountOfQuantifiers_helper step n F) xs) \<Longrightarrow> eval F xs = eval (repeatAmountOfQuantifiers_helper step (Suc n) F) xs
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n F. (\<And>F. eval F xs = eval (repeatAmountOfQuantifiers_helper step n F) xs) \<Longrightarrow> eval F xs = eval (step F) xs
[PROOF STEP]
subgoal for n F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>F. eval F xs = eval (repeatAmountOfQuantifiers_helper step n F) xs) \<Longrightarrow> eval F xs = eval (step F) xs
[PROOF STEP]
using assms[of F xs]
[PROOF STATE]
proof (prove)
using this:
eval F xs = eval (step F) xs

goal (1 subgoal):
 1. (\<And>F. eval F xs = eval (repeatAmountOfQuantifiers_helper step n F) xs) \<Longrightarrow> eval F xs = eval (step F) xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arctan_ms_aux_inf:
  assumes "\<exists>e>0. ms_aux_hd_exp xs = Some e" "fst (dominant_term_ms_aux xs) > 0" "trimmed_ms_aux xs"
          "basis_wf basis" "is_expansion_aux xs f basis"
  shows   "is_expansion_aux (minus_ms_aux (const_ms_aux (pi / 2))
             (arctan_ms_aux (inverse_ms_aux xs))) (\<lambda>x. arctan (f x)) basis"
    (is "is_expansion_aux ?xs' _ _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion_aux (minus_ms_aux (const_ms_aux (pi / 2)) (arctan_ms_aux (inverse_ms_aux xs))) (\<lambda>x. arctan (f x)) basis
[PROOF STEP]
proof (rule is_expansion_aux_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_expansion_aux (minus_ms_aux (const_ms_aux (pi / 2)) (arctan_ms_aux (inverse_ms_aux xs))) ?f basis
 2. \<forall>\<^sub>F x in at_top. ?f x = arctan (f x)
[PROOF STEP]
from \<open>trimmed_ms_aux xs\<close>
[PROOF STATE]
proof (chain)
picking this:
trimmed_ms_aux xs
[PROOF STEP]
have [simp]: "xs \<noteq> MSLNil"
[PROOF STATE]
proof (prove)
using this:
trimmed_ms_aux xs

goal (1 subgoal):
 1. xs \<noteq> MSLNil
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<noteq> MSLNil

goal (2 subgoals):
 1. is_expansion_aux (minus_ms_aux (const_ms_aux (pi / 2)) (arctan_ms_aux (inverse_ms_aux xs))) ?f basis
 2. \<forall>\<^sub>F x in at_top. ?f x = arctan (f x)
[PROOF STEP]
thus "is_expansion_aux ?xs' (\<lambda>x. pi / 2 - arctan (inverse (f x))) basis"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> MSLNil

goal (1 subgoal):
 1. is_expansion_aux (minus_ms_aux (const_ms_aux (pi / 2)) (arctan_ms_aux (inverse_ms_aux xs))) (\<lambda>x. pi / 2 - arctan (inverse (f x))) basis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> MSLNil
\<exists>e>0. ms_aux_hd_exp xs = Some e
0 < fst (dominant_term_ms_aux xs)
trimmed_ms_aux xs
basis_wf basis
is_expansion_aux xs f basis

goal (1 subgoal):
 1. is_expansion_aux (minus_ms_aux (const_ms_aux (pi / 2)) (arctan_ms_aux (inverse_ms_aux xs))) (\<lambda>x. pi / 2 - arctan (inverse (f x))) basis
[PROOF STEP]
by (intro minus_ms_aux arctan_ms_aux_0 inverse_ms_aux const_ms_aux)
       (auto simp: hd_exp_inverse is_expansion_aux_expansion_level)
[PROOF STATE]
proof (state)
this:
is_expansion_aux (minus_ms_aux (const_ms_aux (pi / 2)) (arctan_ms_aux (inverse_ms_aux xs))) (\<lambda>x. pi / 2 - arctan (inverse (f x))) basis

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. pi / 2 - arctan (inverse (f x)) = arctan (f x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. pi / 2 - arctan (inverse (f x)) = arctan (f x)
[PROOF STEP]
from assms(2-5)
[PROOF STATE]
proof (chain)
picking this:
0 < fst (dominant_term_ms_aux xs)
trimmed_ms_aux xs
basis_wf basis
is_expansion_aux xs f basis
[PROOF STEP]
have "eventually (\<lambda>x. f x > 0) at_top"
[PROOF STATE]
proof (prove)
using this:
0 < fst (dominant_term_ms_aux xs)
trimmed_ms_aux xs
basis_wf basis
is_expansion_aux xs f basis

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
by (intro eval_pos_if_dominant_term_pos') simp_all
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. pi / 2 - arctan (inverse (f x)) = arctan (f x)
[PROOF STEP]
thus "eventually (\<lambda>x. ((\<lambda>x. pi/2 - arctan (inverse (f x)))) x = arctan (f x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. pi / 2 - arctan (inverse (f x)) = arctan (f x)
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. pi / 2 - arctan (inverse (f x)) = arctan (f x)
[PROOF STEP]
by eventually_elim (subst arctan_inverse_pos, simp_all)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. pi / 2 - arctan (inverse (f x)) = arctan (f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in is_cf_adjunction) op_cf_adj_components:
  shows "op_cf_adj \<Phi>\<lparr>AdjLeft\<rparr> = op_cf \<GG>"
    and "op_cf_adj \<Phi>\<lparr>AdjRight\<rparr> = op_cf \<FF>"
    and "op_cf_adj \<Phi>\<lparr>AdjNT\<rparr> = inv_ntcf (bnt_flip (op_cat \<CC>) \<DD> (\<Phi>\<lparr>AdjNT\<rparr>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf_adj \<Phi>\<lparr>AdjLeft\<rparr> = op_cf \<GG> &&& op_cf_adj \<Phi>\<lparr>AdjRight\<rparr> = op_cf \<FF> &&& op_cf_adj \<Phi>\<lparr>AdjNT\<rparr> = op_cf_adj_nt \<CC> \<DD> (\<Phi>\<lparr>AdjNT\<rparr>)
[PROOF STEP]
unfolding op_cf_adj_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf (\<Phi>\<lparr>AdjRight\<rparr>) = op_cf \<GG> &&& op_cf (\<Phi>\<lparr>AdjLeft\<rparr>) = op_cf \<FF> &&& op_cf_adj_nt (\<Phi>\<lparr>AdjLeft\<rparr>\<lparr>HomDom\<rparr>) (\<Phi>\<lparr>AdjLeft\<rparr>\<lparr>HomCod\<rparr>) (\<Phi>\<lparr>AdjNT\<rparr>) = op_cf_adj_nt \<CC> \<DD> (\<Phi>\<lparr>AdjNT\<rparr>)
[PROOF STEP]
by (simp_all add: cat_cs_simps adj_cs_simps)


[STATEMENT]
lemma loop_semantics:
  "\<kappa> (\<lambda>x . y * x \<squnion> z) = \<mu> (\<lambda>x . y * x \<squnion> z) \<squnion> (\<nu> (\<lambda>x . y * x \<squnion> z) \<sqinter> L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = \<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L
[PROOF STEP]
using apx.least_fixpoint_char loop_apx_least_fixpoint
[PROOF STATE]
proof (prove)
using this:
order.is_least_fixpoint (\<sqsubseteq>) ?f ?x = (order.has_least_fixpoint (\<sqsubseteq>) ?f \<and> ?x = \<kappa> ?f)
order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. ?y * x \<squnion> ?z) (\<mu> (\<lambda>x. ?y * x \<squnion> ?z) \<squnion> \<nu> (\<lambda>x. ?y * x \<squnion> ?z) \<sqinter> L)

goal (1 subgoal):
 1. \<kappa> (\<lambda>x. y * x \<squnion> z) = \<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L
[PROOF STEP]
by auto


[STATEMENT]
theorem (in sigma_finite_measure) Radon_Nikodym:
  assumes ac: "absolutely_continuous M N" assumes sets_eq: "sets N = sets M"
  shows "\<exists>f \<in> borel_measurable M. density M f = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
from Ex_finite_integrable_function
[PROOF STATE]
proof (chain)
picking this:
\<exists>h\<in>borel_measurable M. integral\<^sup>N M h \<noteq> \<infinity> \<and> (\<forall>x\<in>space M. 0 < h x \<and> h x < \<infinity>)
[PROOF STEP]
obtain h where finite: "integral\<^sup>N M h \<noteq> \<infinity>" and
    borel: "h \<in> borel_measurable M" and
    nn: "\<And>x. 0 \<le> h x" and
    pos: "\<And>x. x \<in> space M \<Longrightarrow> 0 < h x" and
    "\<And>x. x \<in> space M \<Longrightarrow> h x < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<exists>h\<in>borel_measurable M. integral\<^sup>N M h \<noteq> \<infinity> \<and> (\<forall>x\<in>space M. 0 < h x \<and> h x < \<infinity>)

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>integral\<^sup>N M h \<noteq> \<infinity>; h \<in> borel_measurable M; \<And>x. 0 \<le> h x; \<And>x. x \<in> space M \<Longrightarrow> 0 < h x; \<And>x. x \<in> space M \<Longrightarrow> h x < \<infinity>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M h \<noteq> \<infinity>
h \<in> borel_measurable M
0 \<le> h ?x
?x \<in> space M \<Longrightarrow> 0 < h ?x
?x \<in> space M \<Longrightarrow> h ?x < \<infinity>

goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
let ?T = "\<lambda>A. (\<integral>\<^sup>+x. h x * indicator A x \<partial>M)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
let ?MT = "density M h"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
from borel finite nn
[PROOF STATE]
proof (chain)
picking this:
h \<in> borel_measurable M
integral\<^sup>N M h \<noteq> \<infinity>
0 \<le> h ?x
[PROOF STEP]
interpret T: finite_measure ?MT
[PROOF STATE]
proof (prove)
using this:
h \<in> borel_measurable M
integral\<^sup>N M h \<noteq> \<infinity>
0 \<le> h ?x

goal (1 subgoal):
 1. finite_measure (density M h)
[PROOF STEP]
by (auto intro!: finite_measureI cong: nn_integral_cong simp: emeasure_density)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
have "absolutely_continuous ?MT N" "sets N = sets ?MT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. absolutely_continuous (density M h) N &&& sets N = sets (density M h)
[PROOF STEP]
proof (unfold absolutely_continuous_def, safe)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> null_sets (density M h) \<Longrightarrow> x \<in> null_sets N
 2. \<And>x. x \<in> sets N \<Longrightarrow> x \<in> sets (density M h)
 3. \<And>x. x \<in> sets (density M h) \<Longrightarrow> x \<in> sets N
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> null_sets (density M h) \<Longrightarrow> x \<in> null_sets N
 2. \<And>x. x \<in> sets N \<Longrightarrow> x \<in> sets (density M h)
 3. \<And>x. x \<in> sets (density M h) \<Longrightarrow> x \<in> sets N
[PROOF STEP]
assume "A \<in> null_sets ?MT"
[PROOF STATE]
proof (state)
this:
A \<in> null_sets (density M h)

goal (3 subgoals):
 1. \<And>x. x \<in> null_sets (density M h) \<Longrightarrow> x \<in> null_sets N
 2. \<And>x. x \<in> sets N \<Longrightarrow> x \<in> sets (density M h)
 3. \<And>x. x \<in> sets (density M h) \<Longrightarrow> x \<in> sets N
[PROOF STEP]
with borel
[PROOF STATE]
proof (chain)
picking this:
h \<in> borel_measurable M
A \<in> null_sets (density M h)
[PROOF STEP]
have "A \<in> sets M" "AE x in M. x \<in> A \<longrightarrow> h x \<le> 0"
[PROOF STATE]
proof (prove)
using this:
h \<in> borel_measurable M
A \<in> null_sets (density M h)

goal (1 subgoal):
 1. A \<in> sets M &&& AE x\<in>A in M. h x \<le> 0
[PROOF STEP]
by (auto simp add: null_sets_density_iff)
[PROOF STATE]
proof (state)
this:
A \<in> sets M
AE x\<in>A in M. h x \<le> 0

goal (3 subgoals):
 1. \<And>x. x \<in> null_sets (density M h) \<Longrightarrow> x \<in> null_sets N
 2. \<And>x. x \<in> sets N \<Longrightarrow> x \<in> sets (density M h)
 3. \<And>x. x \<in> sets (density M h) \<Longrightarrow> x \<in> sets N
[PROOF STEP]
with pos sets.sets_into_space
[PROOF STATE]
proof (chain)
picking this:
?x \<in> space M \<Longrightarrow> 0 < h ?x
?x \<in> sets ?M \<Longrightarrow> ?x \<subseteq> space ?M
A \<in> sets M
AE x\<in>A in M. h x \<le> 0
[PROOF STEP]
have "AE x in M. x \<notin> A"
[PROOF STATE]
proof (prove)
using this:
?x \<in> space M \<Longrightarrow> 0 < h ?x
?x \<in> sets ?M \<Longrightarrow> ?x \<subseteq> space ?M
A \<in> sets M
AE x\<in>A in M. h x \<le> 0

goal (1 subgoal):
 1. AE x in M. x \<notin> A
[PROOF STEP]
by (elim eventually_mono) (auto simp: not_le[symmetric])
[PROOF STATE]
proof (state)
this:
AE x in M. x \<notin> A

goal (3 subgoals):
 1. \<And>x. x \<in> null_sets (density M h) \<Longrightarrow> x \<in> null_sets N
 2. \<And>x. x \<in> sets N \<Longrightarrow> x \<in> sets (density M h)
 3. \<And>x. x \<in> sets (density M h) \<Longrightarrow> x \<in> sets N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. x \<notin> A
[PROOF STEP]
have "A \<in> null_sets M"
[PROOF STATE]
proof (prove)
using this:
AE x in M. x \<notin> A

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
using \<open>A \<in> sets M\<close>
[PROOF STATE]
proof (prove)
using this:
AE x in M. x \<notin> A
A \<in> sets M

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
by (simp add: AE_iff_null_sets)
[PROOF STATE]
proof (state)
this:
A \<in> null_sets M

goal (3 subgoals):
 1. \<And>x. x \<in> null_sets (density M h) \<Longrightarrow> x \<in> null_sets N
 2. \<And>x. x \<in> sets N \<Longrightarrow> x \<in> sets (density M h)
 3. \<And>x. x \<in> sets (density M h) \<Longrightarrow> x \<in> sets N
[PROOF STEP]
with ac
[PROOF STATE]
proof (chain)
picking this:
absolutely_continuous M N
A \<in> null_sets M
[PROOF STEP]
show "A \<in> null_sets N"
[PROOF STATE]
proof (prove)
using this:
absolutely_continuous M N
A \<in> null_sets M

goal (1 subgoal):
 1. A \<in> null_sets N
[PROOF STEP]
by (auto simp: absolutely_continuous_def)
[PROOF STATE]
proof (state)
this:
A \<in> null_sets N

goal (2 subgoals):
 1. \<And>x. x \<in> sets N \<Longrightarrow> x \<in> sets (density M h)
 2. \<And>x. x \<in> sets (density M h) \<Longrightarrow> x \<in> sets N
[PROOF STEP]
qed (auto simp add: sets_eq)
[PROOF STATE]
proof (state)
this:
absolutely_continuous (density M h) N
sets N = sets (density M h)

goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
from T.Radon_Nikodym_finite_measure_infinite[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>f\<in>borel_measurable (density M h). density (density M h) f = N
[PROOF STEP]
obtain f where f_borel: "f \<in> borel_measurable M" "density ?MT f = N"
[PROOF STATE]
proof (prove)
using this:
\<exists>f\<in>borel_measurable (density M h). density (density M h) f = N

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> borel_measurable M; density (density M h) f = N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M
density (density M h) f = N

goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
with nn borel
[PROOF STATE]
proof (chain)
picking this:
0 \<le> h ?x
h \<in> borel_measurable M
f \<in> borel_measurable M
density (density M h) f = N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> h ?x
h \<in> borel_measurable M
f \<in> borel_measurable M
density (density M h) f = N

goal (1 subgoal):
 1. \<exists>f\<in>borel_measurable M. density M f = N
[PROOF STEP]
by (auto intro!: bexI[of _ "\<lambda>x. h x * f x"] simp: density_density_eq)
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>borel_measurable M. density M f = N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma similarity_eye [simp]:
  shows "similarity eye M = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similarity eye M = M
[PROOF STEP]
unfolding similarity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_inv eye *\<^sub>m\<^sub>m M *\<^sub>m\<^sub>m eye = M
[PROOF STEP]
using mat_eye_l mat_eye_r
[PROOF STATE]
proof (prove)
using this:
eye *\<^sub>m\<^sub>m ?A = ?A
?A *\<^sub>m\<^sub>m eye = ?A

goal (1 subgoal):
 1. mat_inv eye *\<^sub>m\<^sub>m M *\<^sub>m\<^sub>m eye = M
[PROOF STEP]
by auto


[STATEMENT]
lemma length_prefix [simp]: "length (prefix f n) = Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (prefix f n) = Suc n
[PROOF STEP]
unfolding prefix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (\<lambda>x. the (f x)) [0..<Suc n]) = Suc n
[PROOF STEP]
by simp


[STATEMENT]
lemma from_nat_into_inject[simp]:
  "A \<noteq> {} \<Longrightarrow> countable A \<Longrightarrow> B \<noteq> {} \<Longrightarrow> countable B \<Longrightarrow> from_nat_into A = from_nat_into B \<longleftrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; countable A; B \<noteq> {}; countable B\<rbrakk> \<Longrightarrow> (from_nat_into A = from_nat_into B) = (A = B)
[PROOF STEP]
by (metis range_from_nat_into)