[STATEMENT]
lemma onorm_set_proptys:
  fixes A :: "('a::real_normed_algebra_1)^'n^'m"
  shows "bounded (range (\<lambda>x. (\<parallel>A *v x\<parallel>) / (\<parallel>x\<parallel>)))"
    and "bdd_above (range (\<lambda>x. (\<parallel>A *v x\<parallel>) / (\<parallel>x\<parallel>)))"
    and "(range (\<lambda>x. (\<parallel>A *v x\<parallel>) / (\<parallel>x\<parallel>))) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range (\<lambda>x. \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>)) &&& bdd_above (range (\<lambda>x. \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>)) &&& range (\<lambda>x. \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>) \<noteq> {}
[PROOF STEP]
unfolding bounded_def bdd_above_def image_def dist_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x e. \<forall>y\<in>{y. \<exists>x\<in>UNIV. y = \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>}. \<bar>x - y\<bar> \<le> e &&& \<exists>M. \<forall>x\<in>{y. \<exists>x\<in>UNIV. y = \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>}. x \<le> M &&& {y. \<exists>x\<in>UNIV. y = \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>} \<noteq> {}
[PROOF STEP]
apply(rule_tac x=0 in exI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<exists>e. \<forall>y\<in>{y. \<exists>x\<in>UNIV. y = \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>}. \<bar>0 - y\<bar> \<le> e
 2. \<exists>M. \<forall>x\<in>{y. \<exists>x\<in>UNIV. y = \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>}. x \<le> M
 3. {y. \<exists>x\<in>UNIV. y = \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>} \<noteq> {}
[PROOF STEP]
by (rule_tac x="\<parallel>(\<chi> i j. \<parallel>A $ i $ j\<parallel>) *v 1\<parallel>" in exI, clarsimp,
      subst mult_norm_matrix_sgn_eq[symmetric], clarsimp,
      rule_tac x="sgn _" in norm_matrix_bound, simp add: norm_sgn)+ force


[STATEMENT]
lemma hom_gauss_jordan_single[simp]: "gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
let ?nr = "dim_row A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
let ?nc = "dim_col A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
have 0: "0\<^sub>m ?nr 0 \<in> carrier_mat ?nr 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m (dim_row A) 0 \<in> carrier_mat (dim_row A) 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>m (dim_row A) 0 \<in> carrier_mat (dim_row A) 0

goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
have dim: "dim_row (mat\<^sub>h A) = ?nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat\<^sub>h A) = dim_row A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row (mat\<^sub>h A) = dim_row A

goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
have hom0: "mat\<^sub>h (0\<^sub>m ?nr 0) = 0\<^sub>m ?nr 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat\<^sub>h (0\<^sub>m (dim_row A) 0) = 0\<^sub>m (dim_row A) 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat\<^sub>h (0\<^sub>m (dim_row A) 0) = 0\<^sub>m (dim_row A) 0

goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
have A: "A \<in> carrier_mat ?nr ?nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
from hom_gauss_jordan[OF A 0] A
[PROOF STATE]
proof (chain)
picking this:
gauss_jordan (mat\<^sub>h A) (mat\<^sub>h (0\<^sub>m (dim_row A) 0)) = map_prod mat\<^sub>h mat\<^sub>h (gauss_jordan A (0\<^sub>m (dim_row A) 0))
A \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gauss_jordan (mat\<^sub>h A) (mat\<^sub>h (0\<^sub>m (dim_row A) 0)) = map_prod mat\<^sub>h mat\<^sub>h (gauss_jordan A (0\<^sub>m (dim_row A) 0))
A \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)
[PROOF STEP]
unfolding gauss_jordan_single_def dim hom0
[PROOF STATE]
proof (prove)
using this:
gauss_jordan (mat\<^sub>h A) (0\<^sub>m (dim_row A) 0) = map_prod mat\<^sub>h mat\<^sub>h (gauss_jordan A (0\<^sub>m (dim_row A) 0))
A \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. fst (gauss_jordan (mat\<^sub>h A) (0\<^sub>m (dim_row A) 0)) = mat\<^sub>h (fst (gauss_jordan A (0\<^sub>m (dim_row A) 0)))
[PROOF STEP]
by (metis fst_map_prod)
[PROOF STATE]
proof (state)
this:
gauss_jordan_single (mat\<^sub>h A) = mat\<^sub>h (gauss_jordan_single A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonces_MPair [simp]: "nonces (MPair X Y) = nonces X \<union> nonces Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonces (MPair X Y) = nonces X \<union> nonces Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nonces (MPair X Y) = nonces X \<union> nonces Y
[PROOF STEP]
have "\<And>U V. \<lbrakk>X = Abs_Msg (msgrel `` {U}); Y = Abs_Msg (msgrel `` {V})\<rbrakk>
             \<Longrightarrow> nonces (MPair X Y) = nonces X \<union> nonces Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U V. \<lbrakk>X = Abs_Msg (msgrel `` {U}); Y = Abs_Msg (msgrel `` {V})\<rbrakk> \<Longrightarrow> nonces (MPair X Y) = nonces X \<union> nonces Y
[PROOF STEP]
by (simp add: nonces_def MPair
        UN_equiv_class [OF equiv_msgrel nonces_congruent])
[PROOF STATE]
proof (state)
this:
\<lbrakk>X = Abs_Msg (msgrel `` {?U}); Y = Abs_Msg (msgrel `` {?V})\<rbrakk> \<Longrightarrow> nonces (MPair X Y) = nonces X \<union> nonces Y

goal (1 subgoal):
 1. nonces (MPair X Y) = nonces X \<union> nonces Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>X = Abs_Msg (msgrel `` {?U}); Y = Abs_Msg (msgrel `` {?V})\<rbrakk> \<Longrightarrow> nonces (MPair X Y) = nonces X \<union> nonces Y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>X = Abs_Msg (msgrel `` {?U}); Y = Abs_Msg (msgrel `` {?V})\<rbrakk> \<Longrightarrow> nonces (MPair X Y) = nonces X \<union> nonces Y

goal (1 subgoal):
 1. nonces (MPair X Y) = nonces X \<union> nonces Y
[PROOF STEP]
by (meson eq_Abs_Msg)
[PROOF STATE]
proof (state)
this:
nonces (MPair X Y) = nonces X \<union> nonces Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ker_is_submodule: "submodule R ker M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LinearCombinations.submodule R ker M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LinearCombinations.submodule R ker M
[PROOF STEP]
have 0: "mod_hom R M N f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_hom R M N f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
mod_hom R M N f

goal (1 subgoal):
 1. LinearCombinations.submodule R ker M
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
mod_hom R M N f
[PROOF STEP]
have 1: "module R M"
[PROOF STATE]
proof (prove)
using this:
mod_hom R M N f

goal (1 subgoal):
 1. module R M
[PROOF STEP]
by (unfold mod_hom_def, auto)
[PROOF STATE]
proof (state)
this:
module R M

goal (1 subgoal):
 1. LinearCombinations.submodule R ker M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LinearCombinations.submodule R ker M
[PROOF STEP]
by  (rule submodule.intro, auto simp add: ker_def, rule 1)
[PROOF STATE]
proof (state)
this:
LinearCombinations.submodule R ker M

goal:
No subgoals!
[PROOF STEP]
(*rmult_0*)
[PROOF STATE]
proof (state)
this:
LinearCombinations.submodule R ker M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma full_chain_lnth_rel:
  "full_chain R xs \<Longrightarrow> enat (Suc j) < llength xs \<Longrightarrow> R (lnth xs j) (lnth xs (Suc j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>full_chain R xs; enat (Suc j) < llength xs\<rbrakk> \<Longrightarrow> R (lnth xs j) (lnth xs (Suc j))
[PROOF STEP]
by (fact chain_lnth_rel[OF full_chain_imp_chain])


[STATEMENT]
lemma strict_part_mono_lt:
  "\<lbrakk> x < f 0; strict_part_mono {.. n :: nat} f \<rbrakk> \<Longrightarrow> \<forall>m \<le> n. x < f m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < f 0; strict_part_mono {..n} f\<rbrakk> \<Longrightarrow> \<forall>m\<le>n. x < f m
[PROOF STEP]
by (auto simp add: strict_part_mono_def Ball_def intro: order.strict_trans)


[STATEMENT]
lemma filter_diff_zmset[simp]: "filter_zmset P (M - N) = filter_zmset P M - filter_zmset P N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_zmset P (M - N) = filter_zmset P M - filter_zmset P N
[PROOF STEP]
by (rule zmultiset_eqI) simp


[STATEMENT]
lemma length_insort: "length (insort xs) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (insort xs) = length xs
[PROOF STEP]
apply(induction xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (insort []) = length []
 2. \<And>a xs. length (insort xs) = length xs \<Longrightarrow> length (insort (a # xs)) = length (a # xs)
[PROOF STEP]
apply (auto simp: length_insort1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma primes_omega_power [simp]: "n > 0 \<Longrightarrow> primes_omega (x ^ n) = primes_omega x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> primes_omega (x ^ n) = primes_omega x
[PROOF STEP]
by (simp add: primes_omega_def prime_factors_power)


[STATEMENT]
lemma signed_take_bit_Suc:
  \<open>signed_take_bit (Suc n) a = a mod 2 + 2 * signed_take_bit n (a div 2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit (Suc n) a = a mod (2::'a) + (2::'a) * signed_take_bit n (a div (2::'a))
[PROOF STEP]
by (simp add: bit_eq_iff bit_sum_mult_2_cases bit_simps bit_0 possible_bit_less_imp flip: bit_Suc min_Suc_Suc)


[STATEMENT]
lemma less_ncols: "(n < ncols A) = (\<exists>j i. n <= i & (Rep_matrix A j i) \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n < ncols A) = (\<exists>j i. n \<le> i \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (n < ncols A) = (\<exists>j i. n \<le> i \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
have a: "!! (a::nat) b. (a < b) = (~(b <= a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. (a < b) = (\<not> b \<le> a)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
(?a < ?b) = (\<not> ?b \<le> ?a)

goal (1 subgoal):
 1. (n < ncols A) = (\<exists>j i. n \<le> i \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n < ncols A) = (\<exists>j i. n \<le> i \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
by (simp add: a ncols_le)
[PROOF STATE]
proof (state)
this:
(n < ncols A) = (\<exists>j i. n \<le> i \<and> Rep_matrix A j i \<noteq> (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Group) funeq_LeastTr1:"\<lbrakk>\<forall>l\<le> n. G \<guillemotright> f l; \<forall>l \<le> n. G \<guillemotright> g l;
  (l :: nat) < (LEAST k. (NfuncPair_neq_at f g k)) \<rbrakk> \<Longrightarrow> f l = g l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; l < (LEAST k. NfuncPair_neq_at f g k)\<rbrakk> \<Longrightarrow> f l = g l
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; l < (LEAST k. NfuncPair_neq_at f g k); f l \<noteq> g l\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule  LeastTr0 [of "l" "NfuncPair_neq_at f g"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; l < (LEAST k. NfuncPair_neq_at f g k); f l \<noteq> g l; \<not> NfuncPair_neq_at f g l\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add:NfuncPair_neq_at_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma frontier_ball [simp]:
  fixes a :: "'a::real_normed_vector"
  shows "0 < e \<Longrightarrow> frontier (ball a e) = sphere a e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e \<Longrightarrow> frontier (ball a e) = sphere a e
[PROOF STEP]
by (force simp: frontier_def)


[STATEMENT]
lemma complex_inner_1 [simp]: "inner 1 x = Re x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner 1 x = Re x
[PROOF STEP]
unfolding inner_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re 1 * Re x + Im 1 * Im x = Re x
[PROOF STEP]
by simp


[STATEMENT]
lemma set_lebesgue_integral_zero [simp]: "set_lebesgue_integral M A (\<lambda>x. 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x:A|M. (0::'a) = (0::'a)
[PROOF STEP]
by (auto simp: set_lebesgue_integral_def)


[STATEMENT]
lemma stopping_time_le_const: "stopping_time F T \<Longrightarrow> s \<le> t \<Longrightarrow> Measurable.pred (F t) (\<lambda>\<omega>. T \<omega> \<le> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>stopping_time F T; s \<le> t\<rbrakk> \<Longrightarrow> Measurable.pred (F t) (\<lambda>\<omega>. T \<omega> \<le> s)
[PROOF STEP]
using stopping_timeD[of F T] sets_F_mono[of _ t]
[PROOF STATE]
proof (prove)
using this:
stopping_time F T \<Longrightarrow> Measurable.pred (F ?t) (\<lambda>x. T x \<le> ?t)
?i \<le> t \<Longrightarrow> sets (F ?i) \<subseteq> sets (F t)

goal (1 subgoal):
 1. \<lbrakk>stopping_time F T; s \<le> t\<rbrakk> \<Longrightarrow> Measurable.pred (F t) (\<lambda>\<omega>. T \<omega> \<le> s)
[PROOF STEP]
by (auto simp: pred_def space_F)


[STATEMENT]
lemma qbs_morphism_pair_swap':
  "(\<lambda>(x,y). (y,x)) \<in> (X::'a quasi_borel) \<Otimes>\<^sub>Q (Y::'b quasi_borel) \<rightarrow>\<^sub>Q Y \<Otimes>\<^sub>Q X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). (y, x)) \<in> X \<Otimes>\<^sub>Q Y \<rightarrow>\<^sub>Q Y \<Otimes>\<^sub>Q X
[PROOF STEP]
by(auto intro!: qbs_morphismI simp: pair_qbs_Mx_def split_beta' comp_def)


[STATEMENT]
lemma nall_tuples_rec_fo_nmlz: "xs \<in> nall_tuples_rec AD 0 (length xs) \<longleftrightarrow> fo_nmlz AD xs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> nall_tuples_rec AD 0 (length xs)) = (fo_nmlz AD xs = xs)
[PROOF STEP]
using nall_tuples_rec_fo_nmlz_rec_sound[of 0 0 xs AD "length xs"]
    nall_tuples_rec_fo_nmlz_rec_complete[of 0 AD xs]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> 0; xs \<in> nall_tuples_rec AD 0 (length xs)\<rbrakk> \<Longrightarrow> fo_nmlz_rec 0 (id_map 0) AD xs = xs
fo_nmlz_rec 0 (id_map 0) AD xs = xs \<Longrightarrow> xs \<in> nall_tuples_rec AD 0 (length xs)

goal (1 subgoal):
 1. (xs \<in> nall_tuples_rec AD 0 (length xs)) = (fo_nmlz AD xs = xs)
[PROOF STEP]
by (auto simp: fo_nmlz_def id_map_def)


[STATEMENT]
lemma LeftDerivationLadder_implies_LeftDerivation_at_index:
  assumes "LeftDerivationLadder \<alpha> D L \<gamma>"
  assumes "index < length L"
  shows "LeftDerivation \<alpha> (take (ladder_n L index) D) (ladder_\<gamma> \<alpha> D L index)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LeftDerivation \<alpha> (take (ladder_n L index) D) (ladder_\<gamma> \<alpha> D L index)
[PROOF STEP]
using LeftDerivationLadder_def LeftDerivation_take_derive assms(1) ladder_\<gamma>_def
[PROOF STATE]
proof (prove)
using this:
LeftDerivationLadder ?a ?D ?L ?b = (LeftDerivation ?a ?D ?b \<and> is_ladder ?D ?L \<and> LeftDerivationFix ?a (ladder_i ?L 0) (take (ladder_n ?L 0) ?D) (ladder_j ?L 0) (ladder_\<gamma> ?a ?D ?L 0) \<and> LeftDerivationIntros ?a ?D ?L)
LeftDerivation ?a ?D ?b \<Longrightarrow> LeftDerivation ?a (take ?n ?D) (Derive ?a (take ?n ?D))
LeftDerivationLadder \<alpha> D L \<gamma>
ladder_\<gamma> ?a ?D ?L ?index = Derive ?a (take (ladder_n ?L ?index) ?D)

goal (1 subgoal):
 1. LeftDerivation \<alpha> (take (ladder_n L index) D) (ladder_\<gamma> \<alpha> D L index)
[PROOF STEP]
by auto


[STATEMENT]
lemma smult_neg : "r \<in> R \<Longrightarrow> m \<in> M \<Longrightarrow> r \<cdot> (- m) = - (r \<cdot> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<in> R; m \<in> M\<rbrakk> \<Longrightarrow> r \<cdot> - m = - (r \<cdot> m)
[PROOF STEP]
using neg_eq_neg1_smult one_closed R_scalars.neg_closed smult_assoc[of r "- 1"]
        smult_closed
[PROOF STATE]
proof (prove)
using this:
?m \<in> M \<Longrightarrow> - (1::'r) \<cdot> ?m = - ?m
(1::'r) \<in> R
?g \<in> R \<Longrightarrow> - ?g \<in> R
\<lbrakk>r \<in> R; - (1::'r) \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> r \<cdot> - (1::'r) \<cdot> ?m = (r * - (1::'r)) \<cdot> ?m
\<lbrakk>?r \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> ?r \<cdot> ?m \<in> M

goal (1 subgoal):
 1. \<lbrakk>r \<in> R; m \<in> M\<rbrakk> \<Longrightarrow> r \<cdot> - m = - (r \<cdot> m)
[PROOF STEP]
by    force


[STATEMENT]
lemma fds_abs_convergent_zero_iff:
  fixes f :: "'a :: {nat_power_field, real_normed_field, banach, second_countable_topology} fds"
  assumes "completely_multiplicative_function (fds_nth f)"
  assumes "fds_abs_converges f s"
  shows   "eval_fds f s = 0 \<longleftrightarrow> (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
let ?g = "\<lambda>p. if prime p then inverse (1 - fds_nth f p / nat_power p s) else 1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
have lim: "(\<lambda>n. \<Prod>p\<le>n. ?g p) \<longlonglongrightarrow> eval_fds f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
by (intro fds_euler_product_LIMSEQ' assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>p\<le>n. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) \<longlonglongrightarrow> eval_fds f s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
have conv: "convergent_prod ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod (\<lambda>p. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a))
[PROOF STEP]
by (intro abs_convergent_prod_imp_convergent_prod fds_abs_convergent_euler_product' assms)
[PROOF STATE]
proof (state)
this:
convergent_prod (\<lambda>p. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a))

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
convergent_prod (\<lambda>p. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a))

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
assume "eval_fds f s = 0"
[PROOF STATE]
proof (state)
this:
eval_fds f s = (0::'a)

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
from convergent_prod_to_zero_iff[OF conv] and this and lim
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Prod>i\<le>n. if prime i then inverse ((1::'a) - fds_nth f i / nat_power i s) else (1::'a)) \<longlonglongrightarrow> (0::'a) = (\<exists>i. (if prime i then inverse ((1::'a) - fds_nth f i / nat_power i s) else (1::'a)) = (0::'a))
eval_fds f s = (0::'a)
(\<lambda>n. \<Prod>p\<le>n. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
have "\<exists>p. prime p \<and> fds_nth f p = nat_power p s"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>i\<le>n. if prime i then inverse ((1::'a) - fds_nth f i / nat_power i s) else (1::'a)) \<longlonglongrightarrow> (0::'a) = (\<exists>i. (if prime i then inverse ((1::'a) - fds_nth f i / nat_power i s) else (1::'a)) = (0::'a))
eval_fds f s = (0::'a)
(\<lambda>n. \<Prod>p\<le>n. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) \<longlonglongrightarrow> eval_fds f s

goal (1 subgoal):
 1. \<exists>p. prime p \<and> fds_nth f p = nat_power p s
[PROOF STEP]
by (auto split: if_splits)
[PROOF STATE]
proof (state)
this:
\<exists>p. prime p \<and> fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
eval_fds f s = (0::'a) \<Longrightarrow> \<exists>p. prime p \<and> fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
eval_fds f s = (0::'a) \<Longrightarrow> \<exists>p. prime p \<and> fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
eval_fds f s = (0::'a) \<Longrightarrow> \<exists>p. prime p \<and> fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
assume "\<exists>p. prime p \<and> fds_nth f p = nat_power p s"
[PROOF STATE]
proof (state)
this:
\<exists>p. prime p \<and> fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>p. prime p \<and> fds_nth f p = nat_power p s
[PROOF STEP]
obtain p where "prime p" "fds_nth f p = nat_power p s"
[PROOF STATE]
proof (prove)
using this:
\<exists>p. prime p \<and> fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; fds_nth f p = nat_power p s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prime p
fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prime p
fds_nth f p = nat_power p s

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
prime p
fds_nth f p = nat_power p s
[PROOF STEP]
have "nat_power p s \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
prime p
fds_nth f p = nat_power p s

goal (1 subgoal):
 1. nat_power p s \<noteq> (0::'a)
[PROOF STEP]
by (intro nat_power_nonzero) (auto simp: prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
nat_power p s \<noteq> (0::'a)

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prime p
fds_nth f p = nat_power p s
nat_power p s \<noteq> (0::'a)
[PROOF STEP]
have "(\<lambda>n. \<Prod>p\<le>n. ?g p) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
prime p
fds_nth f p = nat_power p s
nat_power p s \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using convergent_prod_to_zero_iff[OF conv]
[PROOF STATE]
proof (prove)
using this:
prime p
fds_nth f p = nat_power p s
nat_power p s \<noteq> (0::'a)
(\<lambda>n. \<Prod>i\<le>n. if prime i then inverse ((1::'a) - fds_nth f i / nat_power i s) else (1::'a)) \<longlonglongrightarrow> (0::'a) = (\<exists>i. (if prime i then inverse ((1::'a) - fds_nth f i / nat_power i s) else (1::'a)) = (0::'a))

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by (auto intro!: exI[of _ p] split: if_splits)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>p\<le>n. if prime p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) \<longlonglongrightarrow> (0::'a)

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
from tendsto_unique[OF _ lim this]
[PROOF STATE]
proof (chain)
picking this:
sequentially \<noteq> bot \<Longrightarrow> eval_fds f s = (0::'a)
[PROOF STEP]
have "eval_fds f s = 0"
[PROOF STATE]
proof (prove)
using this:
sequentially \<noteq> bot \<Longrightarrow> eval_fds f s = (0::'a)

goal (1 subgoal):
 1. eval_fds f s = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_fds f s = (0::'a)

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<exists>p. prime p \<and> fds_nth f p = nat_power p s \<Longrightarrow> eval_fds f s = (0::'a)

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
eval_fds f s = (0::'a) \<Longrightarrow> \<exists>p. prime p \<and> fds_nth f p = nat_power p s
\<exists>p. prime p \<and> fds_nth f p = nat_power p s \<Longrightarrow> eval_fds f s = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eval_fds f s = (0::'a) \<Longrightarrow> \<exists>p. prime p \<and> fds_nth f p = nat_power p s
\<exists>p. prime p \<and> fds_nth f p = nat_power p s \<Longrightarrow> eval_fds f s = (0::'a)

goal (1 subgoal):
 1. (eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(eval_fds f s = (0::'a)) = (\<exists>p. prime p \<and> fds_nth f p = nat_power p s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r01_to_r01_r01_3over4:
 "r01_to_r01_r01 (3/4) = (1/2,1/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_to_r01_r01 (3 / 4) = (1 / 2, 1 / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r01_to_r01_r01 (3 / 4) = (1 / 2, 1 / 2)
[PROOF STEP]
have h0:"r01_binary_expansion' (3/4) 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) 0 = 1
[PROOF STEP]
by (simp add: r01_binary_expansion'_def)
[PROOF STATE]
proof (state)
this:
r01_binary_expansion' (3 / 4) 0 = 1

goal (1 subgoal):
 1. r01_to_r01_r01 (3 / 4) = (1 / 2, 1 / 2)
[PROOF STEP]
have h1:"r01_binary_expansion' (3/4) 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) 1 = 1
[PROOF STEP]
by (simp add: r01_binary_expansion'_def Let_def of_rat_divide)
[PROOF STATE]
proof (state)
this:
r01_binary_expansion' (3 / 4) 1 = 1

goal (1 subgoal):
 1. r01_to_r01_r01 (3 / 4) = (1 / 2, 1 / 2)
[PROOF STEP]
have hn:"\<And>n. n>1\<Longrightarrow> r01_binary_expansion' (3/4) n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 1 < n \<Longrightarrow> r01_binary_expansion' (3 / 4) n = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 1 < n \<Longrightarrow> r01_binary_expansion' (3 / 4) n = 0
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 1 < n \<Longrightarrow> r01_binary_expansion' (3 / 4) n = 0
[PROOF STEP]
assume h:"1 < n"
[PROOF STATE]
proof (state)
this:
1 < n

goal (1 subgoal):
 1. \<And>n. 1 < n \<Longrightarrow> r01_binary_expansion' (3 / 4) n = 0
[PROOF STEP]
show "r01_binary_expansion' (3 / 4) n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) n = 0
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) n \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "r01_binary_expansion' (3 / 4) n \<noteq> 0"
[PROOF STATE]
proof (state)
this:
r01_binary_expansion' (3 / 4) n \<noteq> 0

goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) n \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "3/4 < (\<Sum>i=0..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
have "(\<Sum>i=0..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i)) = real (r01_binary_expansion' (3/4) 0) * (1/2)^(Suc 0) + (\<Sum>i=(Suc 0)..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (\<Sum>i = Suc 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
by(rule sum.atLeast_Suc_atMost) (simp add: h)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (\<Sum>i = Suc 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (\<Sum>i = Suc 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
have "... = real (r01_binary_expansion' (3/4) 0) * (1/2)^(Suc 0) + (real (r01_binary_expansion' (3/4) 1) * (1/2)^(Suc 1) + (\<Sum>i=(Suc (Suc 0))..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (\<Sum>i = Suc 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i))
[PROOF STEP]
using sum.atLeast_Suc_atMost[OF order.strict_implies_order[OF h],of "\<lambda>i. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i)"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 1..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc 1..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (\<Sum>i = Suc 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (\<Sum>i = Suc 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i))

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (\<Sum>i = Suc 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i))

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
have "... = 3/4 + (\<Sum>i=2..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)) = 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
using h0 h1
[PROOF STATE]
proof (prove)
using this:
r01_binary_expansion' (3 / 4) 0 = 1
r01_binary_expansion' (3 / 4) 1 = 1

goal (1 subgoal):
 1. real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)) = 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
by(simp add: numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)) = 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (r01_binary_expansion' (3 / 4) 0) * (1 / 2) ^ Suc 0 + (real (r01_binary_expansion' (3 / 4) 1) * (1 / 2) ^ Suc 1 + (\<Sum>i = Suc (Suc 0)..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)) = 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
have "... > 3/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
have "(\<Sum>i=2..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i)) = (\<Sum>i=2..n-1. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i)) + real (r01_binary_expansion' (3/4) n) * (1/2)^Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = (\<Sum>i = 2..n - 1. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) + real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n
[PROOF STEP]
by (metis (no_types, lifting) h One_nat_def Suc_pred less_2_cases_iff less_imp_add_positive order_less_irrefl plus_1_eq_Suc sum.cl_ivl_Suc zero_less_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = (\<Sum>i = 2..n - 1. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) + real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n

goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
hence "real (r01_binary_expansion' (3/4) n) * (1/2)^Suc n \<le> (\<Sum>i=2..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = (\<Sum>i = 2..n - 1. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) + real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n

goal (1 subgoal):
 1. real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n \<le> (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
using ordered_comm_monoid_add_class.sum_nonneg[of "{2..n-1}" "\<lambda>i. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i)"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) = (\<Sum>i = 2..n - 1. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) + real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n
(\<And>x. x \<in> {2..n - 1} \<Longrightarrow> 0 \<le> real (r01_binary_expansion' (3 / 4) x) * (1 / 2) ^ Suc x) \<Longrightarrow> 0 \<le> (\<Sum>i = 2..n - 1. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n \<le> (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n \<le> (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n \<le> (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
have "0 < real (r01_binary_expansion' (3/4) n) * (1/2)^Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n
[PROOF STEP]
using \<open>r01_binary_expansion' (3 / 4) n \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
r01_binary_expansion' (3 / 4) n \<noteq> 0

goal (1 subgoal):
 1. 0 < real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n

goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n \<le> (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
0 < real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n
[PROOF STEP]
have "0 < (\<Sum>i=2..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i))"
[PROOF STATE]
proof (prove)
using this:
real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n \<le> (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
0 < real (r01_binary_expansion' (3 / 4) n) * (1 / 2) ^ Suc n

goal (1 subgoal):
 1. 0 < (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
3 / 4 < 3 / 4 + (\<Sum>i = 2..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
show "3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)"
[PROOF STATE]
proof (prove)
using this:
3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. 3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) n \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)

goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) n \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "(\<Sum>i=0..n. real (r01_binary_expansion' (3/4) i) * (1/2)^(Suc i)) \<le> 3/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) \<le> 3 / 4
[PROOF STEP]
using r01_binary_expansion_lr_r_ur[of "3/4" n] r01_binary_expression_eq_lr[of "3/4" n]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 3 / 4; 3 / 4 < 1\<rbrakk> \<Longrightarrow> snd (snd (r01_binary_expansion'' (3 / 4) n)) \<le> 3 / 4 \<and> 3 / 4 < fst (snd (r01_binary_expansion'' (3 / 4) n))
snd (snd (r01_binary_expansion'' (3 / 4) n)) = r01_binary_expression (3 / 4) n

goal (1 subgoal):
 1. (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) \<le> 3 / 4
[PROOF STEP]
by(simp add: r01_binary_expression_def r01_binary_sum_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) \<le> 3 / 4

goal (1 subgoal):
 1. r01_binary_expansion' (3 / 4) n \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
(\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) \<le> 3 / 4
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
3 / 4 < (\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i)
(\<Sum>i = 0..n. real (r01_binary_expansion' (3 / 4) i) * (1 / 2) ^ Suc i) \<le> 3 / 4

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
r01_binary_expansion' (3 / 4) n = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 < ?n \<Longrightarrow> r01_binary_expansion' (3 / 4) ?n = 0

goal (1 subgoal):
 1. r01_to_r01_r01 (3 / 4) = (1 / 2, 1 / 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_to_r01_r01 (3 / 4) = (1 / 2, 1 / 2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, 1 / 2)
 2. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
have "fst (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n)
[PROOF STEP]
by(simp add: r01_to_r01_r01_def r01_to_r01_r01_fst_def')
[PROOF STATE]
proof (state)
this:
fst (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n)

goal (2 subgoals):
 1. fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, 1 / 2)
 2. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fst (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n)

goal (2 subgoals):
 1. fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, 1 / 2)
 2. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
have "... = 1/2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n))
[PROOF STEP]
using suminf_split_head[of "\<lambda>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n"] binary_expression_summable[of "\<lambda>n. r01_binary_expansion' (3/4) (2*n)"] real01_binary_expansion'_0or1[of "3/4"] h0
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n) \<Longrightarrow> (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n) - real (r01_binary_expansion' (3 / 4) (2 * 0)) * (1 / 2) ^ Suc 0
(\<And>n. r01_binary_expansion' (3 / 4) (2 * n) \<in> {0, 1}) \<Longrightarrow> summable (\<lambda>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n)
r01_binary_expansion' (3 / 4) ?n \<in> {0, 1}
r01_binary_expansion' (3 / 4) 0 = 1

goal (1 subgoal):
 1. (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n))

goal (2 subgoals):
 1. fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, 1 / 2)
 2. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n))

goal (2 subgoals):
 1. fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, 1 / 2)
 2. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
have "... = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
have "\<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n) = 0
[PROOF STEP]
using hn
[PROOF STATE]
proof (prove)
using this:
1 < ?n \<Longrightarrow> r01_binary_expansion' (3 / 4) ?n = 0

goal (1 subgoal):
 1. \<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n) = 0

goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
hence "(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n) = 0

goal (1 subgoal):
 1. (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 0

goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 0

goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2

goal (2 subgoals):
 1. fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, 1 / 2)
 2. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fst (r01_to_r01_r01 (3 / 4)) = 1 / 2
[PROOF STEP]
show "fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, 1 / 2)"
[PROOF STATE]
proof (prove)
using this:
fst (r01_to_r01_r01 (3 / 4)) = 1 / 2

goal (1 subgoal):
 1. fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, (1::'a) / (2::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst (r01_to_r01_r01 (3 / 4)) = fst (1 / 2, (1::?'a1) / (2::?'a1))

goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
have "snd (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n)
[PROOF STEP]
by(simp add: r01_to_r01_r01_def r01_to_r01_r01_snd_def')
[PROOF STATE]
proof (state)
this:
snd (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
snd (r01_to_r01_r01 (3 / 4)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
have "... = 1/2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n))
[PROOF STEP]
using suminf_split_head[of "\<lambda>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n"] binary_expression_summable[of "\<lambda>n. r01_binary_expansion' (3/4) (2*n + 1)"] real01_binary_expansion'_0or1[of "3/4"] h1
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n) \<Longrightarrow> (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n) - real (r01_binary_expansion' (3 / 4) (2 * 0 + 1)) * (1 / 2) ^ Suc 0
(\<And>n. r01_binary_expansion' (3 / 4) (2 * n + 1) \<in> {0, 1}) \<Longrightarrow> summable (\<lambda>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n)
r01_binary_expansion' (3 / 4) ?n \<in> {0, 1}
r01_binary_expansion' (3 / 4) 1 = 1

goal (1 subgoal):
 1. (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n))

goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * n + 1)) * (1 / 2) ^ Suc n) = 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n))

goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
have "... = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
have "\<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n) = 0
[PROOF STEP]
using hn
[PROOF STATE]
proof (prove)
using this:
1 < ?n \<Longrightarrow> r01_binary_expansion' (3 / 4) ?n = 0

goal (1 subgoal):
 1. \<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n) = 0

goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
hence "(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n) = 0

goal (1 subgoal):
 1. (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 0

goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 0

goal (1 subgoal):
 1. 1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 / 2 + (\<Sum>n. real (r01_binary_expansion' (3 / 4) (2 * Suc n + 1)) * (1 / 2) ^ Suc (Suc n)) = 1 / 2

goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
snd (r01_to_r01_r01 (3 / 4)) = 1 / 2
[PROOF STEP]
show "snd (r01_to_r01_r01 (3 / 4)) = snd (1 / 2, 1 / 2)"
[PROOF STATE]
proof (prove)
using this:
snd (r01_to_r01_r01 (3 / 4)) = 1 / 2

goal (1 subgoal):
 1. snd (r01_to_r01_r01 (3 / 4)) = snd ((1::'a) / (2::'a), 1 / 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
snd (r01_to_r01_r01 (3 / 4)) = snd ((1::?'a1) / (2::?'a1), 1 / 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
r01_to_r01_r01 (3 / 4) = (1 / 2, 1 / 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adds_pp_alt: "t adds\<^sub>p v \<longleftrightarrow> (\<exists>u. v = t \<oplus> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t adds\<^sub>p v) = (\<exists>u. v = t \<oplus> u)
[PROOF STEP]
by (meson adds_ppE adds_ppI)


[STATEMENT]
lemma eq_order_le:
  "\<lbrakk> x=y; order r \<rbrakk> \<Longrightarrow> x <=_r y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = y; order r\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y
[PROOF STEP]
apply (unfold Semilat.order_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = y; (\<forall>x. x \<sqsubseteq>\<^bsub>r\<^esub> x) \<and> (\<forall>x y. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> x \<longrightarrow> x = y) \<and> (\<forall>x y z. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z)\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hnorm_scaleR: "\<And>x::'a::real_normed_vector star. hnorm (a *\<^sub>R x) = \<bar>star_of a\<bar> * hnorm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. hnorm (a *\<^sub>R x) = \<bar>hypreal_of_real a\<bar> * hnorm x
[PROOF STEP]
by transfer (rule norm_scaleR)


[STATEMENT]
lemma first_less: "rank_invar (t # bq) \<Longrightarrow> \<forall>t' \<in> set bq. rank t < rank t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'
[PROOF STEP]
apply(induct bq arbitrary: t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t. rank_invar [t] \<Longrightarrow> \<forall>t'\<in>set []. rank t < rank t'
 2. \<And>a bq t. \<lbrakk>\<And>t. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'; rank_invar (t # a # bq)\<rbrakk> \<Longrightarrow> \<forall>t'\<in>set (a # bq). rank t < rank t'
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a bq t. \<lbrakk>\<And>t. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'; rank_invar (t # a # bq)\<rbrakk> \<Longrightarrow> \<forall>t'\<in>set (a # bq). rank t < rank t'
[PROOF STEP]
apply (metis List.set_simps(2) insert_iff not_le_imp_less
    not_less_iff_gr_or_eq order_less_le_trans rank_invar.simps(3)
    rank_invar_cons_down)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Qp_funs_add:
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f \<in> (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<rightarrow> carrier Q\<^sub>p"
  assumes "g \<in> (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<rightarrow> carrier Q\<^sub>p"
  shows "(f \<oplus>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> g) x = f x \<oplus>\<^bsub>Q\<^sub>p\<^esub> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<oplus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<oplus> g x
[PROOF STEP]
using assms function_ring_def[of "carrier (Q\<^sub>p\<^bsup>n\<^esup>)" "Q\<^sub>p"]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
g \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p = \<lparr>carrier = carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow>\<^sub>E carrier Q\<^sub>p, monoid.mult = function_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, one = function_one (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, zero = function_zero (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, add = function_add (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, smult = function_scalar_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<rparr>

goal (1 subgoal):
 1. (f \<oplus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<oplus> g x
[PROOF STEP]
unfolding function_add_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
g \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p = \<lparr>carrier = carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow>\<^sub>E carrier Q\<^sub>p, monoid.mult = function_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, one = function_one (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, zero = function_zero (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, add = \<lambda>f g. \<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<oplus> g x, smult = function_scalar_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<rparr>

goal (1 subgoal):
 1. (f \<oplus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<oplus> g x
[PROOF STEP]
by (metis (mono_tags, lifting) restrict_apply' ring_record_simps(12))


[STATEMENT]
lemma sum_upto_ln_stirling_weak_bigo: "(\<lambda>x. sum_upto ln x - x * ln x + x) \<in> O(ln)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
let ?f = "\<lambda>x. x * ln x - x + ln (2 * pi * x) / 2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
have "ln (fact n) - (n * ln n - n + ln (2 * pi * n) / 2) \<in> {0..1/(12*n)}" if "n > 0" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (fact n) - (real n * ln (real n) - real n + ln (2 * pi * real n) / 2) \<in> {0..1 / real (12 * n)}
[PROOF STEP]
using ln_fact_bounds[OF that]
[PROOF STATE]
proof (prove)
using this:
ln (2 * pi * real n) / 2 + real n * ln (real n) - real n \<le> ln (fact n)
ln (fact n) \<le> ln (2 * pi * real n) / 2 + real n * ln (real n) - real n + 1 / (12 * real n)

goal (1 subgoal):
 1. ln (fact n) - (real n * ln (real n) - real n + ln (2 * pi * real n) / 2) \<in> {0..1 / real (12 * n)}
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
0 < ?n \<Longrightarrow> ln (fact ?n) - (real ?n * ln (real ?n) - real ?n + ln (2 * pi * real ?n) / 2) \<in> {0..1 / real (12 * ?n)}

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
hence "(\<lambda>n. ln (fact n) - ?f n) \<in> O(\<lambda>n. 1 / real n)"
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> ln (fact ?n) - (real ?n * ln (real ?n) - real ?n + ln (2 * pi * real ?n) / 2) \<in> {0..1 / real (12 * ?n)}

goal (1 subgoal):
 1. (\<lambda>n. ln (fact n) - (real n * ln (real n) - real n + ln (2 * pi * real n) / 2)) \<in> O(\<lambda>n. 1 / real n)
[PROOF STEP]
by (intro bigoI[of _ "1/12"] eventually_mono[OF eventually_gt_at_top[of 0]]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (fact n) - (real n * ln (real n) - real n + ln (2 * pi * real n) / 2)) \<in> O(\<lambda>n. 1 / real n)

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
hence "(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - ?f (nat \<lfloor>x\<rfloor>)) \<in> O(\<lambda>x. 1 / real (nat \<lfloor>x\<rfloor>))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ln (fact n) - (real n * ln (real n) - real n + ln (2 * pi * real n) / 2)) \<in> O(\<lambda>n. 1 / real n)

goal (1 subgoal):
 1. (\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2)) \<in> O(\<lambda>x. 1 / real (nat \<lfloor>x\<rfloor>))
[PROOF STEP]
by (rule landau_o.big.compose)
       (intro filterlim_compose[OF filterlim_nat_sequentially] filterlim_floor_sequentially)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2)) \<in> O(\<lambda>x. 1 / real (nat \<lfloor>x\<rfloor>))

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2)) \<in> O(\<lambda>x. 1 / real (nat \<lfloor>x\<rfloor>))

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
have "(\<lambda>x. 1 / real (nat \<lfloor>x\<rfloor>)) \<in> O(\<lambda>x::real. ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 1 / real (nat \<lfloor>x\<rfloor>)) \<in> O(ln)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. 1 / real (nat \<lfloor>x\<rfloor>)) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2)) \<in> O(ln)
[PROOF STEP]
have "(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - ?f (nat \<lfloor>x\<rfloor>) + (?f (nat \<lfloor>x\<rfloor>) - ?f x)) \<in> O(\<lambda>x. ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2)) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2) + (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2 - (x * ln x - x + ln (2 * pi * x) / 2))) \<in> O(ln)
[PROOF STEP]
by (rule sum_in_bigo) real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2) + (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2 - (x * ln x - x + ln (2 * pi * x) / 2))) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
hence "(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - ?f x) \<in> O(\<lambda>x. ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2) + (real (nat \<lfloor>x\<rfloor>) * ln (real (nat \<lfloor>x\<rfloor>)) - real (nat \<lfloor>x\<rfloor>) + ln (2 * pi * real (nat \<lfloor>x\<rfloor>)) / 2 - (x * ln x - x + ln (2 * pi * x) / 2))) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (x * ln x - x + ln (2 * pi * x) / 2)) \<in> O(ln)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (x * ln x - x + ln (2 * pi * x) / 2)) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
hence "(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - ?f x + ln (2 * pi * x) / 2) \<in> O(\<lambda>x. ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (x * ln x - x + ln (2 * pi * x) / 2)) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (x * ln x - x + ln (2 * pi * x) / 2) + ln (2 * pi * x) / 2) \<in> O(ln)
[PROOF STEP]
by (rule sum_in_bigo) real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (x * ln x - x + ln (2 * pi * x) / 2) + ln (2 * pi * x) / 2) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ln (fact (nat \<lfloor>x\<rfloor>)) - (x * ln x - x + ln (2 * pi * x) / 2) + ln (2 * pi * x) / 2) \<in> O(ln)

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)
[PROOF STEP]
by (simp add: sum_upto_ln_conv_ln_fact algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. sum_upto (\<lambda>x. ln (real x)) x - x * ln x + x) \<in> O(ln)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma restrict_space_eq_vimage_algebra:
  "\<Omega> \<subseteq> space M \<Longrightarrow> sets (restrict_space M \<Omega>) = sets (vimage_algebra \<Omega> (\<lambda>x. x) M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Omega> \<subseteq> space M \<Longrightarrow> sets (restrict_space M \<Omega>) = sets (vimage_algebra \<Omega> (\<lambda>x. x) M)
[PROOF STEP]
unfolding restrict_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Omega> \<subseteq> space M \<Longrightarrow> sets (measure_of (\<Omega> \<inter> space M) (sets.restricted_space M \<Omega>) (emeasure M)) = sets (vimage_algebra \<Omega> (\<lambda>x. x) M)
[PROOF STEP]
apply (subst sets_measure_of)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Omega> \<subseteq> space M \<Longrightarrow> sets.restricted_space M \<Omega> \<subseteq> Pow (\<Omega> \<inter> space M)
 2. \<Omega> \<subseteq> space M \<Longrightarrow> sigma_sets (\<Omega> \<inter> space M) (sets.restricted_space M \<Omega>) = sets (vimage_algebra \<Omega> (\<lambda>x. x) M)
[PROOF STEP]
apply (auto simp add: image_subset_iff dest: sets.sets_into_space) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Omega> \<subseteq> space M \<Longrightarrow> sigma_sets (\<Omega> \<inter> space M) (sets.restricted_space M \<Omega>) = sets (vimage_algebra \<Omega> (\<lambda>x. x) M)
[PROOF STEP]
apply (auto simp add: sets_vimage_algebra intro!: arg_cong2[where f=sigma_sets])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_nat_bounded: "finite S \<Longrightarrow> \<exists>k. S \<subseteq> {..<k}"
  for S :: "nat set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> \<exists>k. S \<subseteq> {..<k}
[PROOF STEP]
by (simp add: finite_nat_iff_bounded)


[STATEMENT]
lemma fill_offs_enum_index [rule_format]:
 "index_less index key \<Longrightarrow>
  \<forall>x \<in> set xs. key x \<in> {mi..ma} \<Longrightarrow>
  i < n \<Longrightarrow>
  0 < offs_num n xs index key mi ma i \<Longrightarrow>
  j \<in> {offs (enum xs index key n mi ma) 0 ! i..<
    offs_next (offs (enum xs index key n mi ma) 0) (length xs)
      xs index key mi ma i} \<Longrightarrow>
  fill xs (offs (enum xs index key n mi ma) 0) index key (length xs)
    mi ma ! j = Some x \<Longrightarrow>
    index key x n mi ma = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>index_less index key; \<forall>x\<in>set xs. key x \<in> {mi..ma}; i < n; 0 < offs_num n xs index key mi ma i; j \<in> {offs (enum xs index key n mi ma) 0 ! i..<offs_next (offs (enum xs index key n mi ma) 0) (length xs) xs index key mi ma i}; fill xs (offs (enum xs index key n mi ma) 0) index key (length xs) mi ma ! j = Some x\<rbrakk> \<Longrightarrow> index key x n mi ma = i
[PROOF STEP]
by (insert fill_index [of index key xs mi ma "offs (enum xs index key n mi ma) 0"
 "length xs" i j x], insert offs_enum_pred [of index key xs mi ma n 0],
 simp add: offs_length enum_length)


[STATEMENT]
lemma P2_inv_g_rewrite:
  assumes "s < order \<G>"
  shows "(inv \<^bold>g) [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have power_commute_rewrite: "\<^bold>g [^] (((order \<G> - s) + u1') mod order \<G>) =  \<^bold>g [^] (u1' + (order \<G> - s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] (u1' + (order \<G> - s))
[PROOF STEP]
using add.commute pow_generator_mod
[PROOF STATE]
proof (prove)
using this:
?a + ?b = ?b + ?a
\<^bold>g [^] (?k mod order \<G>) = \<^bold>g [^] ?k

goal (1 subgoal):
 1. \<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] (u1' + (order \<G> - s))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] (u1' + (order \<G> - s))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have "(order \<G> - s + u1') mod order \<G> = (int (order \<G>) - int s + int u1') mod order \<G>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int ((order \<G> - s + u1') mod order \<G>) = (int (order \<G>) - int s + int u1') mod int (order \<G>)
[PROOF STEP]
by (metis of_nat_add of_nat_diff order.strict_implies_order zmod_int assms(1))
[PROOF STATE]
proof (state)
this:
int ((order \<G> - s + u1') mod order \<G>) = (int (order \<G>) - int s + int u1') mod int (order \<G>)

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int ((order \<G> - s + u1') mod order \<G>) = (int (order \<G>) - int s + int u1') mod int (order \<G>)

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have "... = (- int s + int u1') mod order \<G>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int (order \<G>) - int s + int u1') mod int (order \<G>) = (- int s + int u1') mod int (order \<G>)
[PROOF STEP]
by (metis (full_types) add.commute minus_mod_self1 mod_add_right_eq)
[PROOF STATE]
proof (state)
this:
(int (order \<G>) - int s + int u1') mod int (order \<G>) = (- int s + int u1') mod int (order \<G>)

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
int ((order \<G> - s + u1') mod order \<G>) = (int (order \<G>) - int s + int u1') mod int (order \<G>)
(int (order \<G>) - int s + int u1') mod int (order \<G>) = (- int s + int u1') mod int (order \<G>)
[PROOF STEP]
have "(order \<G> - s + u1') mod order \<G> = (- int s mod (order \<G>) + int u1' mod (order \<G>)) mod order \<G>"
[PROOF STATE]
proof (prove)
using this:
int ((order \<G> - s + u1') mod order \<G>) = (int (order \<G>) - int s + int u1') mod int (order \<G>)
(int (order \<G>) - int s + int u1') mod int (order \<G>) = (- int s + int u1') mod int (order \<G>)

goal (1 subgoal):
 1. int ((order \<G> - s + u1') mod order \<G>) = (- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
int ((order \<G> - s + u1') mod order \<G>) = (- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>)

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
hence "\<^bold>g [^] (((order \<G> - s) + u1') mod order \<G>)
              = \<^bold>g [^] ((- int s mod (order \<G>) + int u1' mod (order \<G>)) mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
int ((order \<G> - s + u1') mod order \<G>) = (- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>)

goal (1 subgoal):
 1. \<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))
[PROOF STEP]
by (metis int_pow_int)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
hence "\<^bold>g [^] (u1' + (order \<G> - s))
              = \<^bold>g [^] ((- int s mod (order \<G>) + int u1' mod (order \<G>)) mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))

goal (1 subgoal):
 1. \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))
[PROOF STEP]
using power_commute_rewrite
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))
\<^bold>g [^] ((order \<G> - s + u1') mod order \<G>) = \<^bold>g [^] (u1' + (order \<G> - s))

goal (1 subgoal):
 1. \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have "...
              = \<^bold>g [^] (- int s mod (order \<G>) + int u1' mod (order \<G>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>)) = \<^bold>g [^] (- int s mod int (order \<G>) + int u1' mod int (order \<G>))
[PROOF STEP]
using pow_generator_mod_int
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (?k mod int (order \<G>)) = \<^bold>g [^] ?k

goal (1 subgoal):
 1. \<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>)) = \<^bold>g [^] (- int s mod int (order \<G>) + int u1' mod int (order \<G>))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>)) = \<^bold>g [^] (- int s mod int (order \<G>) + int u1' mod int (order \<G>))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] ((- int s mod int (order \<G>) + int u1' mod int (order \<G>)) mod int (order \<G>)) = \<^bold>g [^] (- int s mod int (order \<G>) + int u1' mod int (order \<G>))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have "... = \<^bold>g [^] (- int s mod (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod (order \<G>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] (- int s mod int (order \<G>) + int u1' mod int (order \<G>)) = \<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>))
[PROOF STEP]
by (simp add: int_pow_mult)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (- int s mod int (order \<G>) + int u1' mod int (order \<G>)) = \<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (- int s mod int (order \<G>) + int u1' mod int (order \<G>)) = \<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>))

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have "... = \<^bold>g [^] (- int s) \<otimes> \<^bold>g [^] (int u1')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>)) = \<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1'
[PROOF STEP]
using pow_generator_mod_int
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (?k mod int (order \<G>)) = \<^bold>g [^] ?k

goal (1 subgoal):
 1. \<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>)) = \<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>)) = \<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1'

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>))
\<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>)) = \<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1'
[PROOF STEP]
have "inv (\<^bold>g [^] (u1' + (order \<G> - s))) = inv (\<^bold>g [^] (- int s) \<otimes> \<^bold>g [^] (int u1'))"
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>))
\<^bold>g [^] (- int s mod int (order \<G>)) \<otimes> \<^bold>g [^] (int u1' mod int (order \<G>)) = \<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1'

goal (1 subgoal):
 1. inv (\<^bold>g [^] (u1' + (order \<G> - s))) = inv (\<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inv (\<^bold>g [^] (u1' + (order \<G> - s))) = inv (\<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1')

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
hence "inv (\<^bold>g [^] ((u1' + (order \<G> - s)) mod (order \<G>)) ) = inv (\<^bold>g [^] (- int s)) \<otimes> inv (\<^bold>g [^] (int u1'))"
[PROOF STATE]
proof (prove)
using this:
inv (\<^bold>g [^] (u1' + (order \<G> - s))) = inv (\<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1')

goal (1 subgoal):
 1. inv (\<^bold>g [^] ((u1' + (order \<G> - s)) mod order \<G>)) = inv (\<^bold>g [^] - int s) \<otimes> inv (\<^bold>g [^] int u1')
[PROOF STEP]
using pow_generator_mod
[PROOF STATE]
proof (prove)
using this:
inv (\<^bold>g [^] (u1' + (order \<G> - s))) = inv (\<^bold>g [^] - int s \<otimes> \<^bold>g [^] int u1')
\<^bold>g [^] (?k mod order \<G>) = \<^bold>g [^] ?k

goal (1 subgoal):
 1. inv (\<^bold>g [^] ((u1' + (order \<G> - s)) mod order \<G>)) = inv (\<^bold>g [^] - int s) \<otimes> inv (\<^bold>g [^] int u1')
[PROOF STEP]
by (simp add: inverse_split)
[PROOF STATE]
proof (state)
this:
inv (\<^bold>g [^] ((u1' + (order \<G> - s)) mod order \<G>)) = inv (\<^bold>g [^] - int s) \<otimes> inv (\<^bold>g [^] int u1')

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv (\<^bold>g [^] ((u1' + (order \<G> - s)) mod order \<G>)) = inv (\<^bold>g [^] - int s) \<otimes> inv (\<^bold>g [^] int u1')

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have "... = \<^bold>g [^] (int s) \<otimes> inv (\<^bold>g [^] (int u1'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (\<^bold>g [^] - int s) \<otimes> inv (\<^bold>g [^] int u1') = \<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1')
[PROOF STEP]
by (simp add: int_pow_neg)
[PROOF STATE]
proof (state)
this:
inv (\<^bold>g [^] - int s) \<otimes> inv (\<^bold>g [^] int u1') = \<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1')

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv (\<^bold>g [^] - int s) \<otimes> inv (\<^bold>g [^] int u1') = \<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1')

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
have "... = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1') = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
by (simp add: int_pow_int)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1') = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inv (\<^bold>g [^] ((u1' + (order \<G> - s)) mod order \<G>)) = \<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1')
\<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1') = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv (\<^bold>g [^] ((u1' + (order \<G> - s)) mod order \<G>)) = \<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1')
\<^bold>g [^] int s \<otimes> inv (\<^bold>g [^] int u1') = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')

goal (1 subgoal):
 1. inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')
[PROOF STEP]
by (simp add: inverse_pow_pow pow_generator_mod )
[PROOF STATE]
proof (state)
this:
inv \<^bold>g [^] (u1' + (order \<G> - s)) = \<^bold>g [^] s \<otimes> inv (\<^bold>g [^] u1')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding_wrt_barbs) indRelLSTPO_impl_SRel_and_TRel_reflect_barbs:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  assumes reflection: "rel_reflects_barbs (indRelLSTPO SRel TRel) (STCalWB SWB TWB)"
  shows "rel_reflects_barbs SRel SWB"
    and "rel_reflects_barbs TRel TWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB) &&& rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)
 2. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
show "rel_reflects_barbs SRel SWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)
[PROOF STEP]
using reflection rel_with_source_impl_SRel_reflects_barbs[where
                        Rel="indRelLSTPO SRel TRel" and SRel="SRel"]
[PROOF STATE]
proof (prove)
using this:
rel_reflects_binary_pred (indRelLSTPO SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB))
rel_reflects_binary_pred (indRelLSTPO SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB)) \<and> (\<forall>S1 S2. (S1, S2) \<in> SRel \<longrightarrow> SourceTerm S1 \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> SourceTerm S2) \<Longrightarrow> rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)

goal (1 subgoal):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)
[PROOF STEP]
by (simp add: indRelLSTPO.source)
[PROOF STATE]
proof (state)
this:
rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)

goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
show "rel_reflects_barbs TRel TWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
using reflection rel_with_target_impl_TRel_reflects_barbs[where
                        Rel="indRelLSTPO SRel TRel" and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
rel_reflects_binary_pred (indRelLSTPO SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB))
rel_reflects_binary_pred (indRelLSTPO SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB)) \<and> (\<forall>T1 T2. (T1, T2) \<in> TRel \<longrightarrow> TargetTerm T1 \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> TargetTerm T2) \<Longrightarrow> rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)

goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
by (simp add: indRelLSTPO.target)
[PROOF STATE]
proof (state)
this:
rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma N_of_norm_space [simp]:
  "space\<^sub>N N_of_norm = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space\<^sub>N N_of_norm = UNIV
[PROOF STEP]
unfolding space\<^sub>N_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. eNorm N_of_norm f < \<infinity>} = UNIV
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. eNorm N_of_norm x < \<top>
[PROOF STEP]
unfolding N_of_norm(1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ennreal (norm x) < \<top>
[PROOF STEP]
by auto


[STATEMENT]
lemma ordinal_plus_minus2 [simp]: "x \<le> y \<Longrightarrow> x + (y - x) = (y::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x + (y - x) = y
[PROOF STEP]
apply (subgoal_tac "\<forall>z. y < x + z \<longrightarrow> x + (y - x) = y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<le> y; \<forall>z. y < x + z \<longrightarrow> x + (y - x) = y\<rbrakk> \<Longrightarrow> x + (y - x) = y
 2. x \<le> y \<Longrightarrow> \<forall>z. y < x + z \<longrightarrow> x + (y - x) = y
[PROOF STEP]
apply (drule_tac x="oSuc y" in spec, erule mp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<le> y \<Longrightarrow> y < x + oSuc y
 2. x \<le> y \<Longrightarrow> \<forall>z. y < x + z \<longrightarrow> x + (y - x) = y
[PROOF STEP]
apply (rule order_less_le_trans[OF less_oSuc], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> \<forall>z. y < x + z \<longrightarrow> x + (y - x) = y
[PROOF STEP]
apply (rule allI, rule_tac a=z in oLimit_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>z. x \<le> y \<Longrightarrow> y < x + 0 \<longrightarrow> x + (y - x) = y
 2. \<And>z xa. \<lbrakk>x \<le> y; y < x + xa \<longrightarrow> x + (y - x) = y\<rbrakk> \<Longrightarrow> y < x + oSuc xa \<longrightarrow> x + (y - x) = y
 3. \<And>z f. \<lbrakk>x \<le> y; OrdinalInduct.strict_mono f; \<forall>n. y < x + f n \<longrightarrow> x + (y - x) = y\<rbrakk> \<Longrightarrow> y < x + oLimit f \<longrightarrow> x + (y - x) = y
[PROOF STEP]
apply (simp add: linorder_not_less[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>z xa. \<lbrakk>x \<le> y; y < x + xa \<longrightarrow> x + (y - x) = y\<rbrakk> \<Longrightarrow> y < x + oSuc xa \<longrightarrow> x + (y - x) = y
 2. \<And>z f. \<lbrakk>x \<le> y; OrdinalInduct.strict_mono f; \<forall>n. y < x + f n \<longrightarrow> x + (y - x) = y\<rbrakk> \<Longrightarrow> y < x + oLimit f \<longrightarrow> x + (y - x) = y
[PROOF STEP]
apply (clarsimp simp add: less_oSuc_eq_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z f. \<lbrakk>x \<le> y; OrdinalInduct.strict_mono f; \<forall>n. y < x + f n \<longrightarrow> x + (y - x) = y\<rbrakk> \<Longrightarrow> y < x + oLimit f \<longrightarrow> x + (y - x) = y
[PROOF STEP]
apply (clarsimp, drule less_oLimitD, clarsimp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma row_not_zero_iff_pivot_fun:
  assumes "pivot_fun A f (dim_col A)" and "i < dim_row (A::'a::zero_neq_one mat)"
  shows "(row A i \<noteq> 0\<^sub>v (dim_col A)) \<longleftrightarrow> (f i < dim_col A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row A i \<noteq> 0\<^sub>v (dim_col A)) = (f i < dim_col A)
[PROOF STEP]
proof (simp only: row_eq_zero_iff_pivot_fun[OF assms])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f i \<noteq> dim_col A) = (f i < dim_col A)
[PROOF STEP]
have "f i \<le> dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f i \<le> dim_col A
[PROOF STEP]
by (rule pivot_funD[where ?f = f], rule refl, fact+)
[PROOF STATE]
proof (state)
this:
f i \<le> dim_col A

goal (1 subgoal):
 1. (f i \<noteq> dim_col A) = (f i < dim_col A)
[PROOF STEP]
thus "(f i \<noteq> dim_col A) = (f i < dim_col A)"
[PROOF STATE]
proof (prove)
using this:
f i \<le> dim_col A

goal (1 subgoal):
 1. (f i \<noteq> dim_col A) = (f i < dim_col A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f i \<noteq> dim_col A) = (f i < dim_col A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equalmodstrick1: "pdifference a b mod p = 0 \<Longrightarrow> a mod p = b mod p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdifference a b mod p = 0 \<Longrightarrow> a mod p = b mod p
[PROOF STEP]
using mod_eq_dvd_iff_nat [of a b p] mod_eq_dvd_iff_nat [of b a p]
[PROOF STATE]
proof (prove)
using this:
a \<le> b \<Longrightarrow> (b mod p = a mod p) = (p dvd b - a)
b \<le> a \<Longrightarrow> (a mod p = b mod p) = (p dvd a - b)

goal (1 subgoal):
 1. pdifference a b mod p = 0 \<Longrightarrow> a mod p = b mod p
[PROOF STEP]
by (cases "a < b") auto


[STATEMENT]
lemma lattice_of_swap: assumes fs: "set fs \<subseteq> carrier_vec n"
  and ij: "i < length fs" "j < length fs" "i \<noteq> j"
  and gs: "gs = fs[ i := fs ! j, j := fs ! i]"
shows "lattice_of gs = lattice_of fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of gs = lattice_of fs
[PROOF STEP]
using assms mset_swap
[PROOF STATE]
proof (prove)
using this:
set fs \<subseteq> carrier_vec n
i < length fs
j < length fs
i \<noteq> j
gs = fs[i := fs ! j, j := fs ! i]
\<lbrakk>?i < length ?ls; ?j < length ?ls\<rbrakk> \<Longrightarrow> mset (?ls[?j := ?ls ! ?i, ?i := ?ls ! ?j]) = mset ?ls

goal (1 subgoal):
 1. lattice_of gs = lattice_of fs
[PROOF STEP]
by (intro lattice_of_eq_set) auto


[STATEMENT]
lemma fine_sum_list_eq_diff:
  fixes f :: "real \<Rightarrow> real"
  shows "fine \<delta> (a, b) D \<Longrightarrow> (\<Sum>(u, x, v)\<leftarrow>D. f v - f u) = f b - f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fine \<delta> (a, b) D \<Longrightarrow> (\<Sum>(u, x, v)\<leftarrow>D. f v - f u) = f b - f a
[PROOF STEP]
by (induct set: fine) simp_all


[STATEMENT]
lemma a0[arith]: "a>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
have "1/(c - 1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / (c - 1)
[PROOF STEP]
using ac
[PROOF STATE]
proof (prove)
using this:
1 / (c - 1) \<le> a

goal (1 subgoal):
 1. 0 < 1 / (c - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 / (c - 1)

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < 1 / (c - 1)

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
by (metis ac dual_order.strict_trans1)
[PROOF STATE]
proof (state)
this:
0 < a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem If_Sbis[simp]:
assumes "compatTst tst" and "c1 \<approx>s d1" and "c2 \<approx>s d2"
shows "If tst c1 c2 \<approx>s If tst d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. if tst then c1 else c2 \<approx>s if tst then d1 else d2
[PROOF STEP]
using assms thetaIf_Sbis
[PROOF STATE]
proof (prove)
using this:
compatTst tst
c1 \<approx>s d1
c2 \<approx>s d2
thetaIf \<subseteq> Sbis

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

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


[STATEMENT]
lemma min_union_assoc[simp]:
  "(A \<union>\<^sub>m B) \<union>\<^sub>m C = A \<union>\<^sub>m (B \<union>\<^sub>m C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<union>\<^sub>m B) \<union>\<^sub>m C = A \<union>\<^sub>m B \<union>\<^sub>m C
[PROOF STEP]
unfolding min_union_def[of A B] min_union_def[of B C]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_set (A \<union> B) \<union>\<^sub>m C = A \<union>\<^sub>m min_set (B \<union> C)
[PROOF STEP]
by simp (simp add: min_union_def sup_assoc)


[STATEMENT]
lemma fold_map_idx_nth: "j < length xs \<Longrightarrow>
  snd (fold_map_idx f i y xs) ! j = snd (f (i + j) (fst (fold_map_idx f i y (take j xs))) (xs ! j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < length xs \<Longrightarrow> snd (fold_map_idx f i y xs) ! j = snd (f (i + j) (fst (fold_map_idx f i y (take j xs))) (xs ! j))
[PROOF STEP]
by (induct xs arbitrary: i j y) (simp_all add: split_beta nth_Cons' take_Cons')


[STATEMENT]
lemma guest_key2_disj2[simp]:
"\<lbrakk> hotel s; (k\<^sub>1,k) \<in> cards s g\<^sub>1; (k\<^sub>2,k) \<in> cards s g\<^sub>2 \<rbrakk> \<Longrightarrow> g\<^sub>1=g\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>hotel s; (k\<^sub>1, k) \<in> cards s g\<^sub>1; (k\<^sub>2, k) \<in> cards s g\<^sub>2\<rbrakk> \<Longrightarrow> g\<^sub>1 = g\<^sub>2
[PROOF STEP]
apply (induct s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>hotel []; (k\<^sub>1, k) \<in> cards [] g\<^sub>1; (k\<^sub>2, k) \<in> cards [] g\<^sub>2\<rbrakk> \<Longrightarrow> g\<^sub>1 = g\<^sub>2
 2. \<And>a s. \<lbrakk>\<lbrakk>hotel s; (k\<^sub>1, k) \<in> cards s g\<^sub>1; (k\<^sub>2, k) \<in> cards s g\<^sub>2\<rbrakk> \<Longrightarrow> g\<^sub>1 = g\<^sub>2; hotel (a # s); (k\<^sub>1, k) \<in> cards (a # s) g\<^sub>1; (k\<^sub>2, k) \<in> cards (a # s) g\<^sub>2\<rbrakk> \<Longrightarrow> g\<^sub>1 = g\<^sub>2
[PROOF STEP]
apply(auto split:event.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma DeMoivre2_ext: "\<And>a r n. (hrcis r a) pow n = hrcis (r pow n) (hypreal_of_hypnat n * a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a r n. hrcis r a pow n = hrcis (r pow n) (hypreal_of_hypnat n * a)
[PROOF STEP]
by transfer (rule DeMoivre2)