[STATEMENT]
lemma mcont2mcont_ennreal_spmf [THEN mcont2mcont, cont_intro]:
  shows mcont_ennreal_spmf: "mcont lub_spmf (ord_spmf (=)) Sup (\<le>) (\<lambda>p. ennreal (spmf p x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mcont lub_spmf (ord_spmf (=)) Sup (\<le>) (\<lambda>p. ennreal (spmf p x))
[PROOF STEP]
by(rule mcontI mono2mono_ennreal monotone_spmf cont_ennreal_spmf)+


[STATEMENT]
lemma not_lex_eq: "\<not> lex a b \<longleftrightarrow> lex b a \<and> b \<noteq> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> Counterclockwise_2D_Arbitrary.lex a b) = (Counterclockwise_2D_Arbitrary.lex b a \<and> b \<noteq> a)
[PROOF STEP]
by (auto simp: algebra_simps lex_def prod_eq_iff)


[STATEMENT]
lemma Liminf_ereal_mult_left:
  assumes "F \<noteq> bot" "(c::real) \<ge> 0"
    shows "Liminf F (\<lambda>n. ereal c * f n) = ereal c * Liminf F f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Liminf F (\<lambda>n. ereal c * f n) = ereal c * Liminf F f
[PROOF STEP]
using Liminf_ereal_mult_right[OF assms]
[PROOF STATE]
proof (prove)
using this:
Liminf F (\<lambda>n. ?f n * ereal c) = Liminf F ?f * ereal c

goal (1 subgoal):
 1. Liminf F (\<lambda>n. ereal c * f n) = ereal c * Liminf F f
[PROOF STEP]
by (subst (1 2) mult.commute)


[STATEMENT]
lemma Inf_aform:
  assumes "e \<in> UNIV \<rightarrow> {-1 .. 1}"
  shows "Inf_aform X \<le> aform_val e X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_aform X \<le> aform_val e X
[PROOF STEP]
using order_trans[OF abs_ge_minus_self abs_pdevs_val_le_tdev[OF assms]]
[PROOF STATE]
proof (prove)
using this:
- pdevs_val e ?x1 \<le> tdev ?x1

goal (1 subgoal):
 1. Inf_aform X \<le> aform_val e X
[PROOF STEP]
by (auto simp: Inf_aform_def aform_val_def minus_le_iff)


[STATEMENT]
lemma arccos_cos: "0 \<le> x \<Longrightarrow> x \<le> pi \<Longrightarrow> arccos (cos x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> pi\<rbrakk> \<Longrightarrow> arccos (cos x) = x
[PROOF STEP]
by (auto simp: arccos_def intro!: the1_equality cos_total)


[STATEMENT]
lemma d_delta_arctan_upper_34_pos: "diff_delta_arctan_upper_34 x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff_delta_arctan_upper_34 x < 0
[PROOF STEP]
unfolding diff_delta_arctan_upper_34_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 256 / ((5 + 105 * x\<^sup>2 + 315 * x ^ 4 + 231 * x ^ 6)\<^sup>2 * (1 + x\<^sup>2)) < 0
[PROOF STEP]
apply (simp add: divide_simps add_nonneg_eq_0_iff zero_less_mult_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + x\<^sup>2
[PROOF STEP]
using power2_less_0 [of x]
[PROOF STATE]
proof (prove)
using this:
\<not> x\<^sup>2 < 0

goal (1 subgoal):
 1. 0 < 1 + x\<^sup>2
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma monad_zero_hcmod_iff: "(x \<in> monad 0) = (hcmod x \<in> monad 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> monad 0) = (hcmod x \<in> monad 0)
[PROOF STEP]
by (simp add: Infinitesimal_monad_zero_iff [symmetric] Infinitesimal_hcmod_iff)


[STATEMENT]
lemma biimp_size[simp]: "size (F \<^bold>\<leftrightarrow> G) = (2 * (size F + size G)) + 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (F \<^bold>\<leftrightarrow> G) = 2 * (size F + size G) + 3
[PROOF STEP]
by(simp add: biimp_def)


[STATEMENT]
lemma incl_bijective_on_ide:
    shows "bij_betw incl (Collect R.ide) (Collect ide)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw incl (Collect R.ide) (Collect ide)
[PROOF STEP]
using incl_injective_on_ide img_incl_ide bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on incl (Collect R.ide)
incl ` Collect R.ide = Collect ide
bij_betw ?f ?A ?B = (inj_on ?f ?A \<and> ?f ` ?A = ?B)

goal (1 subgoal):
 1. bij_betw incl (Collect R.ide) (Collect ide)
[PROOF STEP]
by blast


[STATEMENT]
lemma equal_MP_oalist [code]: "equal_class.equal (MP_oalist xs) (MP_oalist ys) = (OAlist_eq_ntm xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equal_class.equal (MP_oalist xs) (MP_oalist ys) = OAlist_eq_ntm xs ys
[PROOF STEP]
by (simp add: oa_ntm.oalist_eq_alt equal_eq poly_mapping_eq_iff)


[STATEMENT]
theorem meet_related2 [elim?]: "y \<sqsubseteq> x \<Longrightarrow> x \<sqinter> y = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqsubseteq> x \<Longrightarrow> x \<sqinter> y = y
[PROOF STEP]
by (drule meet_related) (simp add: meet_commute)


[STATEMENT]
lemma of_rat_Real: "of_rat x = Real (\<lambda>n. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_rat x = Real (\<lambda>n. x)
[PROOF STEP]
proof (induct x)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. 0 < b \<Longrightarrow> of_rat (Fract a b) = Real (\<lambda>n. Fract a b)
[PROOF STEP]
case (Fract a b)
[PROOF STATE]
proof (state)
this:
0 < b

goal (1 subgoal):
 1. \<And>a b. 0 < b \<Longrightarrow> of_rat (Fract a b) = Real (\<lambda>n. Fract a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < b

goal (1 subgoal):
 1. of_rat (Fract a b) = Real (\<lambda>n. Fract a b)
[PROOF STEP]
apply (simp add: Fract_of_int_quotient of_rat_divide)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> of_int a / of_int b = Real (\<lambda>n. rat_of_int a / rat_of_int b)
[PROOF STEP]
apply (simp add: of_int_Real divide_inverse inverse_Real mult_Real)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
of_rat (Fract a b) = Real (\<lambda>n. Fract a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans_inv':
"(\<Sum> l\<in>{..<np'}. fiX (\<lambda> y. f y + x) p l) =
        (\<Sum> l\<in>{..<np'}. fiX f p l) + real np' * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (fiX (\<lambda>y. f y + x) p) {..<np'} = sum (fiX f p) {..<np'} + real np' * x
[PROOF STEP]
apply (induct_tac np')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sum (fiX (\<lambda>y. f y + x) p) {..<0} = sum (fiX f p) {..<0} + real 0 * x
 2. \<And>n. sum (fiX (\<lambda>y. f y + x) p) {..<n} = sum (fiX f p) {..<n} + real n * x \<Longrightarrow> sum (fiX (\<lambda>y. f y + x) p) {..<Suc n} = sum (fiX f p) {..<Suc n} + real (Suc n) * x
[PROOF STEP]
apply (auto simp add: cfni_def  fiX_def of_nat_Suc
       distrib_right lessThan_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_loopfree_last:
  assumes "is_loopfree_inv G (ig_arcs_cnt G)"
  shows "loop_free (mk_graph G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. loop_free (mk_graph G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_loopfree_inv G (ig_arcs_cnt G)

goal (1 subgoal):
 1. loop_free (mk_graph G)
[PROOF STEP]
apply (auto simp: is_loopfree_inv_def loop_free_def mkg_simps in_set_conv_nth symcl_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b i. \<lbrakk>\<forall>j<length (ig_arcs G). fst (ig_arcs G ! j) \<noteq> snd (ig_arcs G ! j); i < length (ig_arcs G); ig_arcs G ! i = (b, b)\<rbrakk> \<Longrightarrow> False
 2. \<And>aa i. \<lbrakk>\<forall>j<length (ig_arcs G). fst (ig_arcs G ! j) \<noteq> snd (ig_arcs G ! j); i < length (ig_arcs G); ig_arcs G ! i = (aa, aa)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (metis fst_eqD snd_eqD)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma measure_UNION:
  assumes measurable: "range A \<subseteq> sets M" "disjoint_family A"
  assumes finite: "emeasure M (\<Union>i. A i) \<noteq> \<infinity>"
  shows "(\<lambda>i. measure M (A i)) sums (measure M (\<Union>i. A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
have "(\<lambda>i. emeasure M (A i)) sums (emeasure M (\<Union>i. A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. emeasure M (A i)) sums emeasure M (\<Union> (range A))
[PROOF STEP]
unfolding suminf_emeasure[OF measurable, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. emeasure M (A i)) sums (\<Sum>i. emeasure M (A i))
[PROOF STEP]
by (simp add: summable_sums)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. emeasure M (A i)) sums emeasure M (\<Union> (range A))

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>i. emeasure M (A i)) sums emeasure M (\<Union> (range A))

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(\<lambda>i. emeasure M (A i)) sums emeasure M (\<Union> (range A))

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
have "emeasure M (A i) \<le> emeasure M (\<Union>i. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (A i) \<le> emeasure M (\<Union> (range A))
[PROOF STEP]
using measurable
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> sets M
disjoint_family A

goal (1 subgoal):
 1. emeasure M (A i) \<le> emeasure M (\<Union> (range A))
[PROOF STEP]
by (auto intro!: emeasure_mono)
[PROOF STATE]
proof (state)
this:
emeasure M (A i) \<le> emeasure M (\<Union> (range A))

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure M (A i) \<le> emeasure M (\<Union> (range A))
[PROOF STEP]
have "emeasure M (A i) = ennreal ((measure M (A i)))"
[PROOF STATE]
proof (prove)
using this:
emeasure M (A i) \<le> emeasure M (\<Union> (range A))

goal (1 subgoal):
 1. emeasure M (A i) = ennreal (Sigma_Algebra.measure M (A i))
[PROOF STEP]
using finite
[PROOF STATE]
proof (prove)
using this:
emeasure M (A i) \<le> emeasure M (\<Union> (range A))
emeasure M (\<Union> (range A)) \<noteq> \<infinity>

goal (1 subgoal):
 1. emeasure M (A i) = ennreal (Sigma_Algebra.measure M (A i))
[PROOF STEP]
by (intro emeasure_eq_ennreal_measure) (auto simp: top_unique)
[PROOF STATE]
proof (state)
this:
emeasure M (A i) = ennreal (Sigma_Algebra.measure M (A i))

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
emeasure M (A ?i2) = ennreal (Sigma_Algebra.measure M (A ?i2))

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. emeasure M (A i)) sums emeasure M (\<Union> (range A))
emeasure M (A ?i2) = ennreal (Sigma_Algebra.measure M (A ?i2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. emeasure M (A i)) sums emeasure M (\<Union> (range A))
emeasure M (A ?i2) = ennreal (Sigma_Algebra.measure M (A ?i2))

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
using finite
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. emeasure M (A i)) sums emeasure M (\<Union> (range A))
emeasure M (A ?i2) = ennreal (Sigma_Algebra.measure M (A ?i2))
emeasure M (\<Union> (range A)) \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))
[PROOF STEP]
by (subst (asm) (2) emeasure_eq_ennreal_measure) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>i. Sigma_Algebra.measure M (A i)) sums Sigma_Algebra.measure M (\<Union> (range A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sameCC_reachable: "E' \<subseteq> E \<Longrightarrow> u\<in>V \<Longrightarrow> v\<in>V \<Longrightarrow> CC E' u = CC E' v \<longleftrightarrow> (u,v) \<in> connected E'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>E' \<subseteq> E; u \<in> V; v \<in> V\<rbrakk> \<Longrightarrow> (CC E' u = CC E' v) = ((u, v) \<in> connected E')
[PROOF STEP]
unfolding CC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>E' \<subseteq> E; u \<in> V; v \<in> V\<rbrakk> \<Longrightarrow> (connected E' `` {u} = connected E' `` {v}) = ((u, v) \<in> connected E')
[PROOF STEP]
using  equiv_class_eq_iff[OF equiv ]
[PROOF STATE]
proof (prove)
using this:
?F1 \<subseteq> E \<Longrightarrow> ((?x, ?y) \<in> connected ?F1) = (connected ?F1 `` {?x} = connected ?F1 `` {?y} \<and> ?x \<in> V \<and> ?y \<in> V)

goal (1 subgoal):
 1. \<lbrakk>E' \<subseteq> E; u \<in> V; v \<in> V\<rbrakk> \<Longrightarrow> (connected E' `` {u} = connected E' `` {v}) = ((u, v) \<in> connected E')
[PROOF STEP]
by auto


[STATEMENT]
lemma disjoint_terminal_Collect:
  assumes "s \<noteq> t"
  assumes "\<And>x x'. S x \<and> T x' \<Longrightarrow> x = x' \<Longrightarrow> s = t"
  shows "{x. S x} \<inter> {x. T x} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. S x} \<inter> {x. T x} = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s \<noteq> t
\<lbrakk>S ?x \<and> T ?x'; ?x = ?x'\<rbrakk> \<Longrightarrow> s = t

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


[STATEMENT]
lemma finite_sumset:
  assumes "finite A" "finite B"  shows "finite (sumset A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (sumset A B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. finite (sumset A B)
[PROOF STEP]
by (auto simp: sumset_eq)


[STATEMENT]
lemma strict_sorted_iff: "sorted_wrt (<) l \<longleftrightarrow> sorted l \<and> distinct l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (<) l = (sorted l \<and> distinct l)
[PROOF STEP]
by (induction l) (auto iff: antisym_conv1)


[STATEMENT]
lemma (in comm_monoid_mult) prod_list_multf:
  "(\<Prod>x\<leftarrow>xs. f x * g x) = prod_list (map f xs) * prod_list (map g xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<leftarrow>xs. f x * g x) = prod_list (map f xs) * prod_list (map g xs)
[PROOF STEP]
by (induct xs) (simp_all add: algebra_simps)


[STATEMENT]
lemma robdd_\<alpha>_invar_greater :
assumes invar_vars: "robdd_invar_vars_greater n b"
    and a_equiv: "\<And>v. v \<ge> n \<Longrightarrow> a1 v = a2 v"
shows  "robdd_\<alpha> b a1 = robdd_\<alpha> b a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. robdd_\<alpha> b a1 = robdd_\<alpha> b a2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater n b
n \<le> ?v \<Longrightarrow> a1 ?v = a2 ?v

goal (1 subgoal):
 1. robdd_\<alpha> b a1 = robdd_\<alpha> b a2
[PROOF STEP]
apply (induct b)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>robdd_invar_vars_greater n (robdd_leaf x); \<And>v. n \<le> v \<Longrightarrow> a1 v = a2 v\<rbrakk> \<Longrightarrow> robdd_\<alpha> (robdd_leaf x) a1 = robdd_\<alpha> (robdd_leaf x) a2
 2. \<And>x1a b1 x3 b2. \<lbrakk>\<lbrakk>robdd_invar_vars_greater n b1; \<And>v. n \<le> v \<Longrightarrow> a1 v = a2 v\<rbrakk> \<Longrightarrow> robdd_\<alpha> b1 a1 = robdd_\<alpha> b1 a2; \<lbrakk>robdd_invar_vars_greater n b2; \<And>v. n \<le> v \<Longrightarrow> a1 v = a2 v\<rbrakk> \<Longrightarrow> robdd_\<alpha> b2 a1 = robdd_\<alpha> b2 a2; robdd_invar_vars_greater n (robdd_var x1a b1 x3 b2); \<And>v. n \<le> v \<Longrightarrow> a1 v = a2 v\<rbrakk> \<Longrightarrow> robdd_\<alpha> (robdd_var x1a b1 x3 b2) a1 = robdd_\<alpha> (robdd_var x1a b1 x3 b2) a2
[PROOF STEP]
apply (simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b1 x3 b2. \<lbrakk>robdd_invar_vars_greater n b1 \<Longrightarrow> robdd_\<alpha> b1 a1 = robdd_\<alpha> b1 a2; robdd_invar_vars_greater n b2 \<Longrightarrow> robdd_\<alpha> b2 a1 = robdd_\<alpha> b2 a2; n \<le> x3 \<and> robdd_invar_vars_greater (Suc x3) b1 \<and> robdd_invar_vars_greater (Suc x3) b2; \<And>v. n \<le> v \<Longrightarrow> a1 v = a2 v\<rbrakk> \<Longrightarrow> (a2 x3 \<longrightarrow> robdd_\<alpha> b1 a1 = robdd_\<alpha> b1 a2) \<and> (\<not> a2 x3 \<longrightarrow> robdd_\<alpha> b2 a1 = robdd_\<alpha> b2 a2)
[PROOF STEP]
apply (metis le_Suc_eq robdd_invar_vars_greater___weaken)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rcis_zero_mod [simp]: "rcis 0 a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis 0 a = 0
[PROOF STEP]
by (simp add: rcis_def)


[STATEMENT]
lemma arctan_conv_pre_arctan:
  assumes "norm x < 1"
  shows   "arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
norm x < 1
[PROOF STEP]
have "norm x * norm x < 1 * 1"
[PROOF STATE]
proof (prove)
using this:
norm x < 1

goal (1 subgoal):
 1. norm x * norm x < 1 * 1
[PROOF STEP]
by (intro mult_strict_mono) auto
[PROOF STATE]
proof (state)
this:
norm x * norm x < 1 * 1

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
hence norm_less: "norm (x ^ 2) < 1"
[PROOF STATE]
proof (prove)
using this:
norm x * norm x < 1 * 1

goal (1 subgoal):
 1. norm (x\<^sup>2) < 1
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
norm (x\<^sup>2) < 1

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
have "(\<lambda>n. arctan_coeffs n * x ^ n) sums arctan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. arctan_coeffs n * x ^ n) sums arctan x
[PROOF STEP]
by (intro arctan_converges assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. arctan_coeffs n * x ^ n) sums arctan x

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. arctan_coeffs n * x ^ n) sums arctan x

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
have "?this \<longleftrightarrow> (\<lambda>n. arctan_coeffs (2 * n + 1) * x ^ (2 * n + 1)) sums arctan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. arctan_coeffs n * x ^ n) sums arctan x = (\<lambda>n. arctan_coeffs (2 * n + 1) * x ^ (2 * n + 1)) sums arctan x
[PROOF STEP]
by (intro sums_mono_reindex [symmetric])
       (auto simp: arctan_coeffs_def strict_mono_def elim!: oddE)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. arctan_coeffs n * x ^ n) sums arctan x = (\<lambda>n. arctan_coeffs (2 * n + 1) * x ^ (2 * n + 1)) sums arctan x

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. arctan_coeffs n * x ^ n) sums arctan x = (\<lambda>n. arctan_coeffs (2 * n + 1) * x ^ (2 * n + 1)) sums arctan x

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
have "(\<lambda>n. arctan_coeffs (2 * n + 1) * x ^ (2 * n + 1)) =
               (\<lambda>n. x * mssnth arctan_series_stream n * (x ^ 2) ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. arctan_coeffs (2 * n + 1) * x ^ (2 * n + 1)) = (\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n)
[PROOF STEP]
by (simp add: fun_eq_iff mssnth_arctan_series_stream
                  power_mult [symmetric] arctan_coeffs_def mult_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. arctan_coeffs (2 * n + 1) * x ^ (2 * n + 1)) = (\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n)

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n) sums arctan x
[PROOF STEP]
have "(\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n) sums arctan x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n) sums arctan x

goal (1 subgoal):
 1. (\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n) sums arctan x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n) sums arctan x

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n) sums arctan x

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
using summable_pre_arctan[OF norm_less] assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. x * mssnth arctan_series_stream n * x\<^sup>2 ^ n) sums arctan x
summable (\<lambda>n. mssnth arctan_series_stream n * x\<^sup>2 ^ n)
norm x < 1

goal (1 subgoal):
 1. arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)
[PROOF STEP]
by (simp add: powser_def sums_iff suminf_mult [symmetric] mult.assoc)
[PROOF STATE]
proof (state)
this:
arctan x = x * powser (msllist_of_msstream arctan_series_stream) (x\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_op_ket:
  fixes a :: \<open>'a::finite\<close> and b :: \<open>'b\<close> and c :: \<open>'c::finite\<close> and d :: \<open>'d\<close>
  shows \<open>tensor_op M N *\<^sub>V (ket (a,c)) = tensor_ell2 (M *\<^sub>V ket a) (N *\<^sub>V ket c)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
define S :: \<open>('a\<times>'c) ell2 set\<close> where "S = ket ` UNIV"
[PROOF STATE]
proof (state)
this:
S = range ket

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
define \<phi> where \<open>\<phi> = (\<lambda>(a,c). tensor_ell2 (M *\<^sub>V ket a) (N *\<^sub>V ket c))\<close>
[PROOF STATE]
proof (state)
this:
\<phi> = (\<lambda>(a, c). (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c)

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
define \<phi>' where \<open>\<phi>' = \<phi> \<circ> inv ket\<close>
[PROOF STATE]
proof (state)
this:
\<phi>' = \<phi> \<circ> inv ket

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
have def: \<open>tensor_op M N = (SOME P. \<forall>a c. P *\<^sub>V (ket (a,c)) = \<phi> (a,c))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<otimes>\<^sub>o N = (SOME P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c))
[PROOF STEP]
unfolding tensor_op_def \<phi>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME P. \<forall>a c. P *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c) = (SOME P. \<forall>a c. P *\<^sub>V ket (a, c) = (case (a, c) of (a, c) \<Rightarrow> (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<otimes>\<^sub>o N = (SOME P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c))

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
have \<open>cindependent S\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindependent S
[PROOF STEP]
using S_def cindependent_ket
[PROOF STATE]
proof (prove)
using this:
S = range ket
cindependent (range ket)

goal (1 subgoal):
 1. cindependent S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cindependent S

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindependent S

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
have \<open>cspan S = UNIV\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan S = UNIV
[PROOF STEP]
using S_def cspan_range_ket_finite
[PROOF STATE]
proof (prove)
using this:
S = range ket
cspan (range ket) = UNIV

goal (1 subgoal):
 1. cspan S = UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cspan S = UNIV

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cindependent S
cspan S = UNIV
[PROOF STEP]
have "cblinfun_extension_exists S \<phi>'"
[PROOF STATE]
proof (prove)
using this:
cindependent S
cspan S = UNIV

goal (1 subgoal):
 1. cblinfun_extension_exists S \<phi>'
[PROOF STEP]
by (rule cblinfun_extension_exists_finite_dim)
[PROOF STATE]
proof (state)
this:
cblinfun_extension_exists S \<phi>'

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cblinfun_extension_exists S \<phi>'
[PROOF STEP]
have "\<exists>P. \<forall>x\<in>S. P *\<^sub>V x = \<phi>' x"
[PROOF STATE]
proof (prove)
using this:
cblinfun_extension_exists S \<phi>'

goal (1 subgoal):
 1. \<exists>P. \<forall>x\<in>S. P *\<^sub>V x = \<phi>' x
[PROOF STEP]
unfolding cblinfun_extension_exists_def
[PROOF STATE]
proof (prove)
using this:
\<exists>B. \<forall>x\<in>S. B *\<^sub>V x = \<phi>' x

goal (1 subgoal):
 1. \<exists>P. \<forall>x\<in>S. P *\<^sub>V x = \<phi>' x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>P. \<forall>x\<in>S. P *\<^sub>V x = \<phi>' x

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>P. \<forall>x\<in>S. P *\<^sub>V x = \<phi>' x
[PROOF STEP]
have ex: \<open>\<exists>P. \<forall>a c. P *\<^sub>V ket (a,c) = \<phi> (a,c)\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>P. \<forall>x\<in>S. P *\<^sub>V x = \<phi>' x

goal (1 subgoal):
 1. \<exists>P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c)
[PROOF STEP]
by (metis S_def \<phi>'_def comp_eq_dest_lhs inj_ket inv_f_f rangeI)
[PROOF STATE]
proof (state)
this:
\<exists>P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c)

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c)
[PROOF STEP]
have \<open>tensor_op M N *\<^sub>V (ket (a,c)) = \<phi> (a,c)\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c)

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = \<phi> (a, c)
[PROOF STEP]
unfolding def
[PROOF STATE]
proof (prove)
using this:
\<exists>P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c)

goal (1 subgoal):
 1. (SOME P. \<forall>a c. P *\<^sub>V ket (a, c) = \<phi> (a, c)) *\<^sub>V ket (a, c) = \<phi> (a, c)
[PROOF STEP]
apply (rule someI2_ex[where P=\<open>\<lambda>P. \<forall>a c. P *\<^sub>V (ket (a,c)) = \<phi> (a,c)\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<forall>a c. x *\<^sub>V ket (a, c) = \<phi> (a, c) \<Longrightarrow> x *\<^sub>V ket (a, c) = \<phi> (a, c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = \<phi> (a, c)

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = \<phi> (a, c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = \<phi> (a, c)

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
unfolding \<phi>_def
[PROOF STATE]
proof (prove)
using this:
(M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (case (a, c) of (a, c) \<Rightarrow> (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c)

goal (1 subgoal):
 1. (M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(M \<otimes>\<^sub>o N) *\<^sub>V ket (a, c) = (M *\<^sub>V ket a) \<otimes>\<^sub>s N *\<^sub>V ket c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_restriction_fun_is_set_restriction: "
  set_restriction (set_restriction_fun P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_restriction (set_restriction_fun P)
[PROOF STEP]
unfolding set_restriction_def set_restriction_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Pa. \<forall>A. {x \<in> A. P x} = {x \<in> A. Pa x}
[PROOF STEP]
by blast


[STATEMENT]
lemma register_pair_apply:
  assumes \<open>compatible F G\<close>
  shows \<open>(F; G) (a \<otimes>\<^sub>u b) = (F a) *\<^sub>u (G b)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F;G) (a \<otimes>\<^sub>u b) = F a *\<^sub>u G b
[PROOF STEP]
apply (rule register_pair_apply)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. register F
 2. register G
 3. \<And>a b. F a *\<^sub>u G b = G b *\<^sub>u F a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compatible F G

goal (3 subgoals):
 1. register F
 2. register G
 3. \<And>a b. F a *\<^sub>u G b = G b *\<^sub>u F a
[PROOF STEP]
unfolding compatible_def
[PROOF STATE]
proof (prove)
using this:
register F \<and> register G \<and> (\<forall>a b. F a *\<^sub>u G b = G b *\<^sub>u F a)

goal (3 subgoals):
 1. register F
 2. register G
 3. \<And>a b. F a *\<^sub>u G b = G b *\<^sub>u F a
[PROOF STEP]
by metis+


[STATEMENT]
lemma upper_asymptotic_density_lim:
  assumes "(\<lambda>n. card(A \<inter> {..<n})/n) \<longlonglongrightarrow> l"
  shows "upper_asymptotic_density A = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density A = l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. upper_asymptotic_density A = l
[PROOF STEP]
have "(\<lambda>n. ereal(card(A \<inter> {..<n})/n)) \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (real (card (A \<inter> {..<n})) / real n)) \<longlonglongrightarrow> ereal l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (card (A \<inter> {..<n})) / real n) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. (\<lambda>n. ereal (real (card (A \<inter> {..<n})) / real n)) \<longlonglongrightarrow> ereal l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (real (card (A \<inter> {..<n})) / real n)) \<longlonglongrightarrow> ereal l

goal (1 subgoal):
 1. upper_asymptotic_density A = l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ereal (real (card (A \<inter> {..<n})) / real n)) \<longlonglongrightarrow> ereal l
[PROOF STEP]
have "limsup (\<lambda>n. card(A \<inter> {..<n})/n) = l"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (real (card (A \<inter> {..<n})) / real n)) \<longlonglongrightarrow> ereal l

goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal l
[PROOF STEP]
using sequentially_bot tendsto_iff_Liminf_eq_Limsup
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (real (card (A \<inter> {..<n})) / real n)) \<longlonglongrightarrow> ereal l
sequentially \<noteq> \<bottom>
?F \<noteq> \<bottom> \<Longrightarrow> (?f \<longlongrightarrow> ?f0.0) ?F = (Liminf ?F ?f = ?f0.0 \<and> Limsup ?F ?f = ?f0.0)

goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal l
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal l

goal (1 subgoal):
 1. upper_asymptotic_density A = l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal l

goal (1 subgoal):
 1. upper_asymptotic_density A = l
[PROOF STEP]
unfolding upper_asymptotic_density_def
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal l

goal (1 subgoal):
 1. real_of_ereal (limsup (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x))) = l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
upper_asymptotic_density A = l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zmod_zminus_eq_conv_pos: "
  0 < (m::int) \<Longrightarrow> (a mod - m = b mod - m) = (a mod m = b mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> (a mod - m = b mod - m) = (a mod m = b mod m)
[PROOF STEP]
apply (simp only: mod_minus_right neg_equal_iff_equal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> (- a mod m = - b mod m) = (a mod m = b mod m)
[PROOF STEP]
apply (simp only: zmod_zminus1_eq_if)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> ((if a mod m = 0 then 0 else m - a mod m) = (if b mod m = 0 then 0 else m - b mod m)) = (a mod m = b mod m)
[PROOF STEP]
apply (split if_split)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> (a mod m = 0 \<longrightarrow> (b mod m = 0 \<longrightarrow> (0 = 0) = (a mod m = b mod m)) \<and> (b mod m \<noteq> 0 \<longrightarrow> (0 = m - b mod m) = (a mod m = b mod m))) \<and> (a mod m \<noteq> 0 \<longrightarrow> (b mod m = 0 \<longrightarrow> (m - a mod m = 0) = (a mod m = b mod m)) \<and> (b mod m \<noteq> 0 \<longrightarrow> (m - a mod m = m - b mod m) = (a mod m = b mod m)))
[PROOF STEP]
apply (safe, simp_all)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>q. \<lbrakk>0 < m; a = m * q; m = b mod m\<rbrakk> \<Longrightarrow> False
 2. \<And>q. \<lbrakk>0 < m; b = m * q; m = a mod m\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (insert pos_mod_bound[of m a] pos_mod_bound[of m b], simp_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cle_add_iff1: "a *\<^sub>C e + c \<le> b *\<^sub>C e + d \<longleftrightarrow> (a - b) *\<^sub>C e + c \<le> d"
  for c d e :: "'a::ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>C e + c \<le> b *\<^sub>C e + d) = ((a - b) *\<^sub>C e + c \<le> d)
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma fds_nth_minus [simp]:
  "fds_nth (f - g) = (\<lambda>n. fds_nth f n - fds_nth g n :: 'a :: {cancel_comm_monoid_add})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f - g) = (\<lambda>n. fds_nth f n - fds_nth g n)
[PROOF STEP]
by (simp add: minus_fds_def fds_nth_fds fun_eq_iff)


[STATEMENT]
lemma le_add_same_cancel1:
  "a + b \<ge> a \<longleftrightarrow> b \<ge> 0" if "a < \<infinity>" "-\<infinity> < a" for a b :: "int extended"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> a + b) = (0 \<le> b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a < \<infinity>
-\<infinity> < a

goal (1 subgoal):
 1. (a \<le> a + b) = (0 \<le> b)
[PROOF STEP]
by (cases a; cases b) (auto simp add: zero_extended_def)


[STATEMENT]
lemma Cauchy_vec_nth:
  "Cauchy (\<lambda>n. X n) \<Longrightarrow> Cauchy (\<lambda>n. X n $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy X \<Longrightarrow> Cauchy (\<lambda>n. X n $ i)
[PROOF STEP]
unfolding Cauchy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < e \<Longrightarrow> \<forall>e>0. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m $ i) (X n $ i) < e
[PROOF STEP]
by (fast intro: le_less_trans [OF dist_vec_nth_le])


[STATEMENT]
lemma count_image_mset:
  \<open>count (image_mset f A) x = (\<Sum>y\<in>f -` {x} \<inter> set_mset A. count A y)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A)
[PROOF STEP]
proof (induction A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. count (image_mset f {#}) x = sum (count {#}) (f -` {x} \<inter> set_mset {#})
 2. \<And>xa A. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A) \<Longrightarrow> count (image_mset f (add_mset xa A)) x = sum (count (add_mset xa A)) (f -` {x} \<inter> set_mset (add_mset xa A))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. count (image_mset f {#}) x = sum (count {#}) (f -` {x} \<inter> set_mset {#})
 2. \<And>xa A. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A) \<Longrightarrow> count (image_mset f (add_mset xa A)) x = sum (count (add_mset xa A)) (f -` {x} \<inter> set_mset (add_mset xa A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (image_mset f {#}) x = sum (count {#}) (f -` {x} \<inter> set_mset {#})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count (image_mset f {#}) x = sum (count {#}) (f -` {x} \<inter> set_mset {#})

goal (1 subgoal):
 1. \<And>xa A. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A) \<Longrightarrow> count (image_mset f (add_mset xa A)) x = sum (count (add_mset xa A)) (f -` {x} \<inter> set_mset (add_mset xa A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa A. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A) \<Longrightarrow> count (image_mset f (add_mset xa A)) x = sum (count (add_mset xa A)) (f -` {x} \<inter> set_mset (add_mset xa A))
[PROOF STEP]
case (add x A)
[PROOF STATE]
proof (state)
this:
count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A)

goal (1 subgoal):
 1. \<And>xa A. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A) \<Longrightarrow> count (image_mset f (add_mset xa A)) x = sum (count (add_mset xa A)) (f -` {x} \<inter> set_mset (add_mset xa A))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A)

goal (1 subgoal):
 1. \<And>xa A. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A) \<Longrightarrow> count (image_mset f (add_mset xa A)) x = sum (count (add_mset xa A)) (f -` {x} \<inter> set_mset (add_mset xa A))
[PROOF STEP]
have *: "(if x = y then Suc n else n) = n + (if x = y then 1 else 0)" for n y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x = y then Suc n else n) = n + (if x = y then 1 else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if x = ?y then Suc ?n else ?n) = ?n + (if x = ?y then 1 else 0)

goal (1 subgoal):
 1. \<And>xa A. count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A) \<Longrightarrow> count (image_mset f (add_mset xa A)) x = sum (count (add_mset xa A)) (f -` {x} \<inter> set_mset (add_mset xa A))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A)
(if x = ?y then Suc ?n else ?n) = ?n + (if x = ?y then 1 else 0)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
count (image_mset f A) x = sum (count A) (f -` {x} \<inter> set_mset A)
(if x = ?y then Suc ?n else ?n) = ?n + (if x = ?y then 1 else 0)

goal (1 subgoal):
 1. count (image_mset f (add_mset x A)) x = sum (count (add_mset x A)) (f -` {x} \<inter> set_mset (add_mset x A))
[PROOF STEP]
by (auto simp: sum.distrib intro!: sum.mono_neutral_left)
[PROOF STATE]
proof (state)
this:
count (image_mset f (add_mset x A)) x = sum (count (add_mset x A)) (f -` {x} \<inter> set_mset (add_mset x A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cf_cn_cov_comp_ObjMap_vrange:
  assumes "\<GG> : \<BB> \<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<R>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
interpret L: is_functor \<alpha> \<open>op_cat \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_cat \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
interpret R: is_functor \<alpha> \<AA> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
by
      (
        rule smcf_cn_cov_comp_ObjMap_vrange
          [
            OF
              L.cf_is_semifunctor[unfolded slicing_commute[symmetric]]
              R.cf_is_semifunctor,
            unfolded slicing_commute slicing_simps
          ]
      )
[PROOF STATE]
proof (state)
this:
\<R>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inner_ge_zero [simp]: "0 \<le> real_of (inner x x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real_of (inner x x)
[PROOF STEP]
by (auto simp add: inner_vec_def real_sum sum_nonneg)


[STATEMENT]
lemma isOK_forallM_index_aux [simp]:
  "isOK (forallM_index_aux P n xs) = (\<forall>i < length xs. isOK (P (xs ! i) (i + n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isOK (forallM_index_aux P n xs) = (\<forall>i<length xs. isOK (P (xs ! i) (i + n)))
[PROOF STEP]
proof (induct xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. isOK (forallM_index_aux P n []) = (\<forall>i<length []. isOK (P ([] ! i) (i + n)))
 2. \<And>a xs n. (\<And>n. isOK (forallM_index_aux P n xs) = (\<forall>i<length xs. isOK (P (xs ! i) (i + n)))) \<Longrightarrow> isOK (forallM_index_aux P n (a # xs)) = (\<forall>i<length (a # xs). isOK (P ((a # xs) ! i) (i + n)))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
isOK (forallM_index_aux P ?n xs) = (\<forall>i<length xs. isOK (P (xs ! i) (i + ?n)))

goal (2 subgoals):
 1. \<And>n. isOK (forallM_index_aux P n []) = (\<forall>i<length []. isOK (P ([] ! i) (i + n)))
 2. \<And>a xs n. (\<And>n. isOK (forallM_index_aux P n xs) = (\<forall>i<length xs. isOK (P (xs ! i) (i + n)))) \<Longrightarrow> isOK (forallM_index_aux P n (a # xs)) = (\<forall>i<length (a # xs). isOK (P ((a # xs) ! i) (i + n)))
[PROOF STEP]
have "(\<forall>i < length (x # xs). isOK (P ((x # xs) ! i) (i + n))) \<longleftrightarrow>
    (isOK (P x n) \<and> (\<forall>i < length xs. isOK (P (xs ! i) (i + Suc n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n))) = (isOK (P x n) \<and> (\<forall>i<length xs. isOK (P (xs ! i) (i + Suc n))))
[PROOF STEP]
by (auto, case_tac i) (simp_all)
[PROOF STATE]
proof (state)
this:
(\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n))) = (isOK (P x n) \<and> (\<forall>i<length xs. isOK (P (xs ! i) (i + Suc n))))

goal (2 subgoals):
 1. \<And>n. isOK (forallM_index_aux P n []) = (\<forall>i<length []. isOK (P ([] ! i) (i + n)))
 2. \<And>a xs n. (\<And>n. isOK (forallM_index_aux P n xs) = (\<forall>i<length xs. isOK (P (xs ! i) (i + n)))) \<Longrightarrow> isOK (forallM_index_aux P n (a # xs)) = (\<forall>i<length (a # xs). isOK (P ((a # xs) ! i) (i + n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n))) = (isOK (P x n) \<and> (\<forall>i<length xs. isOK (P (xs ! i) (i + Suc n))))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n))) = (isOK (P x n) \<and> (\<forall>i<length xs. isOK (P (xs ! i) (i + Suc n))))

goal (1 subgoal):
 1. isOK (forallM_index_aux P n (x # xs)) = (\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n)))
[PROOF STEP]
unfolding Cons [of "Suc n", symmetric]
[PROOF STATE]
proof (prove)
using this:
(\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n))) = (isOK (P x n) \<and> isOK (forallM_index_aux P (Suc n) xs))

goal (1 subgoal):
 1. isOK (forallM_index_aux P n (x # xs)) = (\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
isOK (forallM_index_aux P n (x # xs)) = (\<forall>i<length (x # xs). isOK (P ((x # xs) ! i) (i + n)))

goal (1 subgoal):
 1. \<And>n. isOK (forallM_index_aux P n []) = (\<forall>i<length []. isOK (P ([] ! i) (i + n)))
[PROOF STEP]
qed auto


[STATEMENT]
lemma perfect_injective_eq_homeomorphic_map:
   "perfect_map X Y f \<and> inj_on f (topspace X) \<longleftrightarrow> homeomorphic_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (perfect_map X Y f \<and> inj_on f (topspace X)) = homeomorphic_map X Y f
[PROOF STEP]
by (simp add: homeomorphic_eq_injective_perfect_map)


[STATEMENT]
lemma degree_monom_eq: "a \<noteq> 0 \<Longrightarrow> degree (monom a n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> degree (monom a n) = n
[PROOF STEP]
by (metis coeff_monom leading_coeff_0_iff)


[STATEMENT]
lemma iso_map_dual:
  fixes f :: "'a::order_with_dual \<Rightarrow> 'b::order_with_dual"
  shows "mono f \<Longrightarrow> mono (\<partial>\<^sub>F f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> mono (\<partial>\<^sub>F f)
[PROOF STEP]
by (simp add: ord_pres_dual ord_pres_mono)


[STATEMENT]
lemma same_floor:
assumes "real_of_int a \<le> x" "real_of_int a \<le> y"
  "x < a+1" "y < a+1"
shows "floor x = floor y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = \<lfloor>y\<rfloor>
[PROOF STEP]
using assms floor_unique
[PROOF STATE]
proof (prove)
using this:
real_of_int a \<le> x
real_of_int a \<le> y
x < real_of_int (a + 1)
y < real_of_int (a + 1)
\<lbrakk>real_of_int ?a \<le> ?x; ?x < real_of_int (?a + 1)\<rbrakk> \<Longrightarrow> \<lfloor>?x\<rfloor> = ?a

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = \<lfloor>y\<rfloor>
[PROOF STEP]
by presburger


[STATEMENT]
lemma fps_const_add_right: "f + fps_const (c::'a::monoid_add) =
    Abs_fps (\<lambda>n. if n = 0 then f$0 + c else f$n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f + fps_const c = Abs_fps (\<lambda>n. if n = 0 then f $ 0 + c else f $ n)
[PROOF STEP]
by (simp add: fps_ext)


[STATEMENT]
lemma set_indets_pp: "set (indets_pp p) = indets (Poly_Mapping.map_key PP p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (indets_pp p) = indets (Poly_Mapping.map_key PP p)
[PROOF STEP]
by (simp add: indets_pp_def indets_def keys_pp_to_list_def keys_pp.rep_eq punit.set_keys_to_list
        keys_map_key_PP)


[STATEMENT]
lemma cross7_minus_left [simp]: "(-x) \<times>\<^sub>7 y = - (x \<times>\<^sub>7 y)"
and cross7_minus_right [simp]: "x \<times>\<^sub>7 -y = - (x \<times>\<^sub>7 y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x) \<times>\<^sub>7 y = - (x \<times>\<^sub>7 y) &&& x \<times>\<^sub>7 - y = - (x \<times>\<^sub>7 y)
[PROOF STEP]
by (simp_all add: cross7_simps)