[STATEMENT]
lemma scalar_prod_vCons[simp]:
  "vCons a v \<bullet> vCons b w = a * b + v \<bullet> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vCons a v \<bullet> vCons b w = a * b + v \<bullet> w
[PROOF STEP]
apply (unfold scalar_prod_def atLeast0_lessThan_Suc_eq_insert_0 dim_vec_vCons)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>insert 0 (Suc ` {0..<dim_vec w}). vCons a v $ i * vCons b w $ i) = a * b + (\<Sum>i = 0..<dim_vec w. v $ i * w $ i)
[PROOF STEP]
apply (subst sum.insert)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (Suc ` {0..<dim_vec w})
 2. 0 \<notin> Suc ` {0..<dim_vec w}
 3. vCons a v $ 0 * vCons b w $ 0 + (\<Sum>i\<in>Suc ` {0..<dim_vec w}. vCons a v $ i * vCons b w $ i) = a * b + (\<Sum>i = 0..<dim_vec w. v $ i * w $ i)
[PROOF STEP]
apply (simp,simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vCons a v $ 0 * vCons b w $ 0 + (\<Sum>i\<in>Suc ` {0..<dim_vec w}. vCons a v $ i * vCons b w $ i) = a * b + (\<Sum>i = 0..<dim_vec w. v $ i * w $ i)
[PROOF STEP]
apply (subst sum.reindex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on Suc {0..<dim_vec w}
 2. vCons a v $ 0 * vCons b w $ 0 + sum ((\<lambda>i. vCons a v $ i * vCons b w $ i) \<circ> Suc) {0..<dim_vec w} = a * b + (\<Sum>i = 0..<dim_vec w. v $ i * w $ i)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vCons a v $ 0 * vCons b w $ 0 + sum ((\<lambda>i. vCons a v $ i * vCons b w $ i) \<circ> Suc) {0..<dim_vec w} = a * b + (\<Sum>i = 0..<dim_vec w. v $ i * w $ i)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma powr_less_inverse_iff':
  fixes x y z::real
  assumes "x>0" "y>0" "z>0"
  shows "z< x powr y \<longleftrightarrow> z powr (inverse y) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z < x powr y) = (z powr inverse y < x)
[PROOF STEP]
using powr_less_inverse_iff[symmetric,of _ "inverse y"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?x; 0 < inverse y; 0 < ?z\<rbrakk> \<Longrightarrow> (?x < ?z powr inverse (inverse y)) = (?x powr inverse y < ?z)
0 < x
0 < y
0 < z

goal (1 subgoal):
 1. (z < x powr y) = (z powr inverse y < x)
[PROOF STEP]
by auto


[STATEMENT]
lemma fact_binomial:
  assumes "k \<le> n"
  shows "fact k * of_nat (n choose k) = (fact n / fact (n - k) :: 'a::field_char_0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact k * of_nat (n choose k) = fact n / fact (n - k)
[PROOF STEP]
unfolding binomial_fact [OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact k * (fact n / (fact k * fact (n - k))) = fact n / fact (n - k)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma conc_partitions_elim:
  assumes "x \<in> A \<cdot> B"
  shows "\<exists>(u, v) \<in> Partitions x. u \<in> A \<and> v \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>(u, v)\<in>Partitions x. u \<in> A \<and> v \<in> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<cdot> B

goal (1 subgoal):
 1. \<exists>(u, v)\<in>Partitions x. u \<in> A \<and> v \<in> B
[PROOF STEP]
unfolding conc_def Partitions_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {xs @ ys |xs ys. xs \<in> A \<and> ys \<in> B}

goal (1 subgoal):
 1. \<exists>(u, v)\<in>{(x\<^sub>p, x\<^sub>s). x\<^sub>p @ x\<^sub>s = x}. u \<in> A \<and> v \<in> B
[PROOF STEP]
by auto


[STATEMENT]
lemma odd_square_cong_4_nat: "odd (x::nat) \<Longrightarrow> [x ^ 2 = 1] (mod 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd x \<Longrightarrow> [x\<^sup>2 = 1] (mod 4)
[PROOF STEP]
using odd_square_cong_4_int[of "int x"]
[PROOF STATE]
proof (prove)
using this:
odd (int x) \<Longrightarrow> [(int x)\<^sup>2 = 1] (mod 4)

goal (1 subgoal):
 1. odd x \<Longrightarrow> [x\<^sup>2 = 1] (mod 4)
[PROOF STEP]
by (auto simp flip: cong_int_iff)


[STATEMENT]
lemma zhmset_pos_neg_partition: "M = zhmset_of (hmset_pos M) - zhmset_of (hmset_neg M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = zhmset_of (hmset_pos M) - zhmset_of (hmset_neg M)
[PROOF STEP]
by (cases M, simp add: ZHMSet_diff[symmetric], rule mset_pos_neg_partition)


[STATEMENT]
theorem set_vebt_mint[vebt_simps]: "invar_vebt t n \<Longrightarrow> vebt_mint t = Some x \<longleftrightarrow> min_in_set (set_vebt t) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n \<Longrightarrow> (vebt_mint t = Some x) = min_in_set (set_vebt t) x
[PROOF STEP]
by (metis VEBT_internal.mint_corr VEBT_internal.mint_sound VEBT_internal.set_vebt_set_vebt'_valid)


[STATEMENT]
lemma short_exact_sequenceD:
  assumes "short_exact_sequence A B C f g" shows "exact_seq ([A,B,C], [f,g]) \<and> f \<in> epi B A \<and> g \<in> mon C B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exact_seq ([A, B, C], [f, g]) \<and> f \<in> epi B A \<and> g \<in> mon C B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
short_exact_sequence A B C f g

goal (1 subgoal):
 1. exact_seq ([A, B, C], [f, g]) \<and> f \<in> epi B A \<and> g \<in> mon C B
[PROOF STEP]
apply (auto simp: short_exact_sequence_def group_hom_def group_hom_axioms_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>T1 T2 e1 e2. \<lbrakk>Group.group T2; Group.group C; e2 \<in> hom T2 C; Group.group B; g \<in> hom C B; kernel C B g = e2 ` carrier T2; Group.group A; f \<in> hom B A; kernel B A f = g ` carrier C; Group.group T1; e1 \<in> hom A T1; kernel A T1 e1 = f ` carrier B; trivial_group T1; trivial_group T2\<rbrakk> \<Longrightarrow> f \<in> epi B A
 2. \<And>T1 T2 e1 e2. \<lbrakk>Group.group T2; Group.group C; e2 \<in> hom T2 C; Group.group B; g \<in> hom C B; kernel C B g = e2 ` carrier T2; Group.group A; f \<in> hom B A; kernel B A f = g ` carrier C; Group.group T1; e1 \<in> hom A T1; kernel A T1 e1 = f ` carrier B; trivial_group T1; trivial_group T2\<rbrakk> \<Longrightarrow> g \<in> mon C B
[PROOF STEP]
apply (simp add: epi_iff_subset group_hom.intro group_hom.kernel_to_trivial_group group_hom_axioms.intro)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T1 T2 e1 e2. \<lbrakk>Group.group T2; Group.group C; e2 \<in> hom T2 C; Group.group B; g \<in> hom C B; kernel C B g = e2 ` carrier T2; Group.group A; f \<in> hom B A; kernel B A f = g ` carrier C; Group.group T1; e1 \<in> hom A T1; kernel A T1 e1 = f ` carrier B; trivial_group T1; trivial_group T2\<rbrakk> \<Longrightarrow> g \<in> mon C B
[PROOF STEP]
by (metis (no_types, lifting) group_hom.inj_iff_trivial_ker group_hom.intro group_hom_axioms.intro
      hom_one image_empty image_insert mem_Collect_eq mon_def trivial_group_def)


[STATEMENT]
lemma complex_mod_triangle_ineq2: "cmod (b + a) - cmod b \<le> cmod a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (b + a) - cmod b \<le> cmod a
[PROOF STEP]
by (rule ord_le_eq_trans [OF norm_triangle_ineq2]) simp


[STATEMENT]
lemma floor_log_eq_if:
  "\<lfloor>log b x\<rfloor> = \<lfloor>log b y\<rfloor>" if "x div b = y div b" "b > 1" "x > 0" "x div b \<ge> 1"
    for b x y :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>log (real b) (real x)\<rfloor> = \<lfloor>log (real b) (real y)\<rfloor>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lfloor>log (real b) (real x)\<rfloor> = \<lfloor>log (real b) (real y)\<rfloor>
[PROOF STEP]
have "y > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x div b = y div b
1 < b
0 < x
1 \<le> x div b

goal (1 subgoal):
 1. 0 < y
[PROOF STEP]
by (auto intro: ccontr)
[PROOF STATE]
proof (state)
this:
0 < y

goal (1 subgoal):
 1. \<lfloor>log (real b) (real x)\<rfloor> = \<lfloor>log (real b) (real y)\<rfloor>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < y

goal (1 subgoal):
 1. \<lfloor>log (real b) (real x)\<rfloor> = \<lfloor>log (real b) (real y)\<rfloor>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < y
x div b = y div b
1 < b
0 < x
1 \<le> x div b

goal (1 subgoal):
 1. \<lfloor>log (real b) (real x)\<rfloor> = \<lfloor>log (real b) (real y)\<rfloor>
[PROOF STEP]
by (simp add: floor_log_div)
[PROOF STATE]
proof (state)
this:
\<lfloor>log (real b) (real x)\<rfloor> = \<lfloor>log (real b) (real y)\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bivar_fun_mem: "\<lbrakk> f \<in> A \<rightarrow> (B \<rightarrow> C); a \<in> A; b \<in> B \<rbrakk> \<Longrightarrow> f a b \<in> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B \<rightarrow> C; a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> f a b \<in> C
[PROOF STEP]
apply (frule funcset_mem[of "f" "A" "B \<rightarrow> C"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B \<rightarrow> C; a \<in> A; b \<in> B; f a \<in> B \<rightarrow> C\<rbrakk> \<Longrightarrow> f a b \<in> C
[PROOF STEP]
apply (rule funcset_mem[of "f a" "B" "C"], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma del_edge_undirected_degree_minus'[simp]: "finite (edges g) \<Longrightarrow> (v,e,v') \<in> edges g
    \<Longrightarrow> (v',e,v) \<in> edges g \<Longrightarrow> degree v' (del_unEdge v e v' g) =degree v' g- (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v' (del_unEdge v e v' g) = degree v' g - 1
[PROOF STEP]
by (metis del_edge_undirected_degree_minus delete_edge_sym)


[STATEMENT]
lemma Cauchy_theorem_flat:
  assumes f: "continuous_on (convex hull {a,b,c}) f"
      and c: "c - a = k *\<^sub>R (b - a)"
    shows "contour_integral (linepath a b) f +
           contour_integral (linepath b c) f +
           contour_integral (linepath c a) f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
proof (cases "0 \<le> k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
 2. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> k

goal (2 subgoals):
 1. 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
 2. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
continuous_on (convex hull {a, b, c}) f
c - a = k *\<^sub>R (b - a)
0 \<le> k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on (convex hull {a, b, c}) f
c - a = k *\<^sub>R (b - a)
0 \<le> k

goal (1 subgoal):
 1. contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
by (blast intro: Cauchy_theorem_flat_lemma)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0

goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> k

goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
have "continuous_on (closed_segment a b) f" "continuous_on (closed_segment b c) f" "continuous_on (closed_segment c a) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closed_segment a b) f &&& continuous_on (closed_segment b c) f &&& continuous_on (closed_segment c a) f
[PROOF STEP]
using f continuous_on_subset segments_subset_convex_hull
[PROOF STATE]
proof (prove)
using this:
continuous_on (convex hull {a, b, c}) f
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f
closed_segment ?a ?b \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?a ?c \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?b ?c \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?b ?a \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?c ?a \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?c ?b \<subseteq> convex hull {?a, ?b, ?c}

goal (1 subgoal):
 1. continuous_on (closed_segment a b) f &&& continuous_on (closed_segment b c) f &&& continuous_on (closed_segment c a) f
[PROOF STEP]
by metis+
[PROOF STATE]
proof (state)
this:
continuous_on (closed_segment a b) f
continuous_on (closed_segment b c) f
continuous_on (closed_segment c a) f

goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on (closed_segment a b) f
continuous_on (closed_segment b c) f
continuous_on (closed_segment c a) f

goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
have "contour_integral (linepath b a) f + contour_integral (linepath a c) f +
                 contour_integral (linepath c b) f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath b a) f + contour_integral (linepath a c) f + contour_integral (linepath c b) f = 0
[PROOF STEP]
proof (rule Cauchy_theorem_flat_lemma [of b a c f "1-k"])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. continuous_on (convex hull {b, a, c}) f
 2. c - b = (1 - k) *\<^sub>R (a - b)
 3. 0 \<le> 1 - k
[PROOF STEP]
show "continuous_on (convex hull {b, a, c}) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (convex hull {b, a, c}) f
[PROOF STEP]
by (simp add: f insert_commute)
[PROOF STATE]
proof (state)
this:
continuous_on (convex hull {b, a, c}) f

goal (2 subgoals):
 1. c - b = (1 - k) *\<^sub>R (a - b)
 2. 0 \<le> 1 - k
[PROOF STEP]
show "c - b = (1 - k) *\<^sub>R (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c - b = (1 - k) *\<^sub>R (a - b)
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
c - a = k *\<^sub>R (b - a)

goal (1 subgoal):
 1. c - b = (1 - k) *\<^sub>R (a - b)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
c - b = (1 - k) *\<^sub>R (a - b)

goal (1 subgoal):
 1. 0 \<le> 1 - k
[PROOF STEP]
qed (use False in auto)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath b a) f + contour_integral (linepath a c) f + contour_integral (linepath c b) f = 0

goal (1 subgoal):
 1. \<not> 0 \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on (closed_segment a b) f
continuous_on (closed_segment b c) f
continuous_on (closed_segment c a) f
contour_integral (linepath b a) f + contour_integral (linepath a c) f + contour_integral (linepath c b) f = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on (closed_segment a b) f
continuous_on (closed_segment b c) f
continuous_on (closed_segment c a) f
contour_integral (linepath b a) f + contour_integral (linepath a c) f + contour_integral (linepath c b) f = 0

goal (1 subgoal):
 1. contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
by (metis (no_types, lifting) contour_integral_reverse_linepath eq_neg_iff_add_eq_0 minus_add_cancel)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_dcharacters [simp]: "card (dcharacters n) = totient n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (dcharacters n) = totient n
[PROOF STEP]
using bij_betw_same_card [OF bij_betw_dcharacters_characters] card_characters
[PROOF STATE]
proof (prove)
using this:
card (dcharacters n) = card (characters G)
card (characters G) = order G

goal (1 subgoal):
 1. card (dcharacters n) = totient n
[PROOF STEP]
by simp


[STATEMENT]
lemma bij_invfun:"\<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B\<rbrakk> \<Longrightarrow>
                              bij_to (invfun A B f) B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B\<rbrakk> \<Longrightarrow> bij_to (f\<inverse>\<^bsub>B,A\<^esub>) B A
[PROOF STEP]
apply (simp add:bij_to_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; surj_to f A B \<and> inj_on f A\<rbrakk> \<Longrightarrow> surj_to (f\<inverse>\<^bsub>B,A\<^esub>) B A \<and> inj_on (f\<inverse>\<^bsub>B,A\<^esub>) B
[PROOF STEP]
apply (simp add:invfun_inj invfun_surj)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma complex_cnj_inverse [simp]: "cnj (inverse x) = inverse (cnj x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (inverse x) = inverse (cnj x)
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma prod_list_zero_iff:
  "prod_list xs = 0 \<longleftrightarrow> (0 :: 'a :: {semiring_no_zero_divisors, semiring_1}) \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (prod_list xs = (0::'a)) = ((0::'a) \<in> set xs)
[PROOF STEP]
by (induction xs) simp_all


[STATEMENT]
lemma to_fun_mult:
  assumes "g \<in> carrier P"
  assumes "f \<in> carrier P"
  assumes "x \<in> carrier R"
  shows "to_fun (f \<otimes>\<^bsub>P\<^esub> g) x = (to_fun f x) \<otimes> (to_fun g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (f \<otimes>\<^bsub>P\<^esub> g) x = to_fun f x \<otimes> to_fun g x
[PROOF STEP]
using assms to_fun_eval[of ] eval_ring_hom[of x]
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier P
f \<in> carrier P
x \<in> carrier R
\<lbrakk>?f \<in> carrier P; ?x \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun ?f ?x = eval R R (\<lambda>x. x) ?x ?f
x \<in> carrier R \<Longrightarrow> eval R R (\<lambda>x. x) x \<in> ring_hom P R

goal (1 subgoal):
 1. to_fun (f \<otimes>\<^bsub>P\<^esub> g) x = to_fun f x \<otimes> to_fun g x
[PROOF STEP]
by (simp add: ring_hom_mult)


[STATEMENT]
lemma equal_vector7:
  fixes  x::"real^7" and  y::"real^7"
 assumes "x = vector[x1,x2,x3,x4,x5,x6,x7] " and "y= vector [y1,y2,y3,y4,y5,y6,y7]"
and "x = y"
shows "x$1 = y$1 \<and> x$2 = y$2 \<and> x$3 = y$3 \<and> x$4 = y$4 \<and> x$5 = y$5 \<and> x$6 = y$6 \<and>  x$7 = y$7    "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x $ 1 = y $ 1 \<and> x $ 2 = y $ 2 \<and> x $ 3 = y $ 3 \<and> x $ 4 = y $ 4 \<and> x $ 5 = y $ 5 \<and> x $ 6 = y $ 6 \<and> x $ 7 = y $ 7
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = vector [x1, x2, x3, x4, x5, x6, x7]
y = vector [y1, y2, y3, y4, y5, y6, y7]
x = y

goal (1 subgoal):
 1. x $ 1 = y $ 1 \<and> x $ 2 = y $ 2 \<and> x $ 3 = y $ 3 \<and> x $ 4 = y $ 4 \<and> x $ 5 = y $ 5 \<and> x $ 6 = y $ 6 \<and> x $ 7 = y $ 7
[PROOF STEP]
by blast


[STATEMENT]
lemma DirProds_finite_comm_group_iff:
  assumes "finite I"
  shows "finite_comm_group (DirProds G I) \<longleftrightarrow> (\<forall>i\<in>I. finite_comm_group (G i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (DirProds G I) = (\<forall>i\<in>I. finite_comm_group (G i))
[PROOF STEP]
using DirProds_finite_group_iff[OF assms] DirProds_comm_group_iff
[PROOF STATE]
proof (prove)
using this:
finite_group (DirProds ?G I) = (\<forall>i\<in>I. finite_group (?G i))
comm_group (DirProds ?G ?I) = (\<forall>i\<in>?I. comm_group (?G i))

goal (1 subgoal):
 1. finite_comm_group (DirProds G I) = (\<forall>i\<in>I. finite_comm_group (G i))
[PROOF STEP]
unfolding finite_comm_group_def
[PROOF STATE]
proof (prove)
using this:
finite_group (DirProds ?G I) = (\<forall>i\<in>I. finite_group (?G i))
comm_group (DirProds ?G ?I) = (\<forall>i\<in>?I. comm_group (?G i))

goal (1 subgoal):
 1. (finite_group (DirProds G I) \<and> comm_group (DirProds G I)) = (\<forall>i\<in>I. finite_group (G i) \<and> comm_group (G i))
[PROOF STEP]
by fast


[STATEMENT]
lemma infinite_atMost_int: "infinite {..(n::int)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {..n}
[PROOF STEP]
apply (rule_tac f="\<lambda>x. n - x" in inj_on_infinite_image_iff[THEN iffD1, rule_format])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on ((-) n) {..n}
 2. infinite ((-) n ` {..n})
[PROOF STEP]
apply (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite ((-) n ` {..n})
[PROOF STEP]
apply (rule_tac t="((-) n ` {..n})" and s="{0..}" in subst)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {0..} = (-) n ` {..n}
 2. infinite {0..}
[PROOF STEP]
apply (simp add: set_eq_iff image_iff Bex_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {0..}
[PROOF STEP]
apply (rule infinite_atLeast_int)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma closed_segment_translation:
    "closed_segment (c + a) (c + b) = image (\<lambda>x. c + x) (closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment (c + a) (c + b) = (+) c ` closed_segment a b
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> closed_segment (c + a) (c + b) \<Longrightarrow> x \<in> (+) c ` closed_segment a b
 2. \<And>x xa. xa \<in> closed_segment a b \<Longrightarrow> c + xa \<in> closed_segment (c + a) (c + b)
[PROOF STEP]
apply (rule_tac x="x-c" in image_eqI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (c + a) (c + b) \<Longrightarrow> x = c + (x - c)
 2. \<And>x. x \<in> closed_segment (c + a) (c + b) \<Longrightarrow> x - c \<in> closed_segment a b
 3. \<And>x xa. xa \<in> closed_segment a b \<Longrightarrow> c + xa \<in> closed_segment (c + a) (c + b)
[PROOF STEP]
apply (auto simp: in_segment algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_power2_cnj: "norm q ^ 2 = Ree (q * cnj q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm q)\<^sup>2 = Ree (q * Octonions.cnj q)
[PROOF STEP]
by (simp add: octo_mult_components norm_octo_def power2_eq_square)


[STATEMENT]
theorem join_fun: "f \<squnion> g = (\<lambda>x. f x \<squnion> g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<squnion> g = (\<lambda>x. f x \<squnion> g x)
[PROOF STEP]
by (rule join_equality) (rule is_sup_fun)


[STATEMENT]
lemma solves_in_cone:
  assumes "t \<in> T"
  assumes init: "x t0 = x0"
  assumes cont: "continuous_on (closed_segment t0 t) x"
  assumes solves: "(x has_vderiv_on (\<lambda>s. f s (x s))) (open_segment t0 t)"
  shows "x t \<in> cball x0 (B * abs (t - t0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x t \<in> cball x0 (B * \<bar>t - t0\<bar>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t \<in> T
x t0 = x0
continuous_on {t0--t} x
(x has_vderiv_on (\<lambda>s. f s (x s))) {t0<--<t}

goal (1 subgoal):
 1. x t \<in> cball x0 (B * \<bar>t - t0\<bar>)
[PROOF STEP]
by (rule in_bounds_derivativeI)


[STATEMENT]
lemma Suc_double_half: "Suc (2 * n) div 2 = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (2 * n) div 2 = n
[PROOF STEP]
by simp


[STATEMENT]
lemma union_less_term_eq [simp]: "(\<Union>v\<in>{v. v < w}. term_eq t v) = term_less t w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (term_eq t ` {v. v \<sqsubset> w}) = term_less t w
[PROOF STEP]
apply (simp add: term_eq_def term_less_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>{v. v \<sqsubset> w}. {s. t s = x}) = {s. t s \<sqsubset> w}
[PROOF STEP]
by auto


[STATEMENT]
lemma image_mset_sum:
  assumes "finite F"
  shows
    "image_mset h (\<Sum>x \<in> F. f x) = (\<Sum>x \<in> F. image_mset h (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset h (sum f F) = (\<Sum>x\<in>F. image_mset h (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite F

goal (1 subgoal):
 1. image_mset h (sum f F) = (\<Sum>x\<in>F. image_mset h (f x))
[PROOF STEP]
by (induction F rule:finite_induct, simp, simp)


[STATEMENT]
lemma triangle_num_Suc: "triangle_num (Suc n) = triangle_num n + Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. triangle_num (Suc n) = triangle_num n + Suc n
[PROOF STEP]
by (simp add: triangle_num_altdef)


[STATEMENT]
theorem (in Group) lcs_eq:"\<lbrakk>G \<guillemotright> H; a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow>
           ((\<rho> a) \<cdot> b \<in> H) = (a \<diamondsuit> H = b \<diamondsuit> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow> (\<rho> a \<cdot> b \<in> H) = (a \<diamondsuit> H = b \<diamondsuit> H)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; \<rho> a \<cdot> b \<in> H\<rbrakk> \<Longrightarrow> a \<diamondsuit> H = b \<diamondsuit> H
 2. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; a \<diamondsuit> H = b \<diamondsuit> H\<rbrakk> \<Longrightarrow> \<rho> a \<cdot> b \<in> H
[PROOF STEP]
apply ((rule equalityI),
        (rule lcsTr7 [of "H" "a" "b"], assumption+),
        (frule lcs_tool1 [of "H" "a" "b"], assumption+),
        (rule lcsTr7 [of "H" "b" "a"], assumption+))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; a \<diamondsuit> H = b \<diamondsuit> H\<rbrakk> \<Longrightarrow> \<rho> a \<cdot> b \<in> H
[PROOF STEP]
apply (subst lcs_mem_ldiv[THEN sym, of "H" "b" "a"], assumption+,
       simp add:a_in_lcs[of "H" "b"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_on_arcosh' [continuous_intros]:
  fixes f :: "real \<Rightarrow> real"
  assumes "continuous_on A f" "\<And>x. x \<in> A \<Longrightarrow> f x \<ge> 1"
  shows   "continuous_on A (\<lambda>x. arcosh (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A (\<lambda>x. arcosh (f x))
[PROOF STEP]
by (rule continuous_on_compose2[OF continuous_on_arcosh assms(1) order.refl])
     (use assms(2) in auto)


[STATEMENT]
lemma ln_Gamma_stirling_real:
  assumes "x > (0 :: real)" "m > (0::nat)"
  shows   "ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 +
              (\<Sum>k = 1..<m. bernoulli (Suc k) / (of_nat k * of_nat (Suc k) * x ^ k)) -
              stirling_integral m x / of_nat m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < x
0 < m
[PROOF STEP]
have "complex_of_real (ln_Gamma x) = ln_Gamma (complex_of_real x)"
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. complex_of_real (ln_Gamma x) = ln_Gamma (complex_of_real x)
[PROOF STEP]
by (simp add: ln_Gamma_complex_of_real)
[PROOF STATE]
proof (state)
this:
complex_of_real (ln_Gamma x) = ln_Gamma (complex_of_real x)

goal (1 subgoal):
 1. ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (ln_Gamma x) = ln_Gamma (complex_of_real x)

goal (1 subgoal):
 1. ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m
[PROOF STEP]
have "ln_Gamma (complex_of_real x) = complex_of_real (
                (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 +
                (\<Sum>k = 1..<m. bernoulli (Suc k) / (of_nat k * of_nat (Suc k) * x ^ k)) -
                stirling_integral m x / of_nat m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln_Gamma (complex_of_real x) = complex_of_real ((x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. ln_Gamma (complex_of_real x) = complex_of_real ((x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m)
[PROOF STEP]
by (subst ln_Gamma_stirling_complex[of _ m])
       (simp_all add: Ln_of_real stirling_integral_complex_of_real)
[PROOF STATE]
proof (state)
this:
ln_Gamma (complex_of_real x) = complex_of_real ((x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m)

goal (1 subgoal):
 1. ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
complex_of_real (ln_Gamma x) = complex_of_real ((x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
complex_of_real (ln_Gamma x) = complex_of_real ((x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m)

goal (1 subgoal):
 1. ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m
[PROOF STEP]
by (subst (asm) of_real_eq_iff)
[PROOF STATE]
proof (state)
this:
ln_Gamma x = (x - 1 / 2) * ln x - x + ln (2 * pi) / 2 + (\<Sum>k = 1..<m. bernoulli (Suc k) / (real k * real (Suc k) * x ^ k)) - stirling_integral m x / real m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_INF_uminus_eq:
  fixes f :: "'a \<Rightarrow> ereal"
  shows "(INF x\<in>S. - f x) = - (SUP x\<in>S. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF x\<in>S. - f x) = - Sup (f ` S)
[PROOF STEP]
using ereal_Inf_uminus_image_eq [of "f ` S"]
[PROOF STATE]
proof (prove)
using this:
Inf (uminus ` f ` S) = - Sup (f ` S)

goal (1 subgoal):
 1. (INF x\<in>S. - f x) = - Sup (f ` S)
[PROOF STEP]
by (simp add: image_comp)


[STATEMENT]
lemma divisor_set_one: shows "divisor_set 1 ={1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_set 1 = {1}
[PROOF STEP]
using divisor_set  divisor_def
[PROOF STATE]
proof (prove)
using this:
divisor_set ?m = {n. n divisor ?m}
?n divisor ?m \<equiv> 1 \<le> ?n \<and> ?n \<le> ?m \<and> ?n dvd ?m

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


[STATEMENT]
lemma supremum_subset_less_eq:
  assumes "finite S" and "R \<subseteq> S"
  shows "less_eq (supremum R) (supremum S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. less_eq (supremum R) (supremum S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S
R \<subseteq> S

goal (1 subgoal):
 1. less_eq (supremum R) (supremum S)
[PROOF STEP]
proof (induct arbitrary: R)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>R. R \<subseteq> {} \<Longrightarrow> less_eq (supremum R) (supremum {})
 2. \<And>x F R. \<lbrakk>finite F; x \<notin> F; \<And>R. R \<subseteq> F \<Longrightarrow> less_eq (supremum R) (supremum F); R \<subseteq> insert x F\<rbrakk> \<Longrightarrow> less_eq (supremum R) (supremum (insert x F))
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
?R \<subseteq> F \<Longrightarrow> less_eq (supremum ?R) (supremum F)
R \<subseteq> insert x F

goal (2 subgoals):
 1. \<And>R. R \<subseteq> {} \<Longrightarrow> less_eq (supremum R) (supremum {})
 2. \<And>x F R. \<lbrakk>finite F; x \<notin> F; \<And>R. R \<subseteq> F \<Longrightarrow> less_eq (supremum R) (supremum F); R \<subseteq> insert x F\<rbrakk> \<Longrightarrow> less_eq (supremum R) (supremum (insert x F))
[PROOF STEP]
from insert(1, 2, 4) insert(3)[of "R - {x}"]
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
R \<subseteq> insert x F
R - {x} \<subseteq> F \<Longrightarrow> less_eq (supremum (R - {x})) (supremum F)
[PROOF STEP]
have "less_eq (supremum (R - {x})) (f x (supremum F))"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
R \<subseteq> insert x F
R - {x} \<subseteq> F \<Longrightarrow> less_eq (supremum (R - {x})) (supremum F)

goal (1 subgoal):
 1. less_eq (supremum (R - {x})) (f x (supremum F))
[PROOF STEP]
by (metis Diff_subset_conv insert_is_Un local.trans sup_r)
[PROOF STATE]
proof (state)
this:
less_eq (supremum (R - {x})) (f x (supremum F))

goal (2 subgoals):
 1. \<And>R. R \<subseteq> {} \<Longrightarrow> less_eq (supremum R) (supremum {})
 2. \<And>x F R. \<lbrakk>finite F; x \<notin> F; \<And>R. R \<subseteq> F \<Longrightarrow> less_eq (supremum R) (supremum F); R \<subseteq> insert x F\<rbrakk> \<Longrightarrow> less_eq (supremum R) (supremum (insert x F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
less_eq (supremum (R - {x})) (f x (supremum F))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
less_eq (supremum (R - {x})) (f x (supremum F))

goal (1 subgoal):
 1. less_eq (supremum R) (supremum (insert x F))
[PROOF STEP]
using insert(1, 2, 4)
[PROOF STATE]
proof (prove)
using this:
less_eq (supremum (R - {x})) (f x (supremum F))
finite F
x \<notin> F
R \<subseteq> insert x F

goal (1 subgoal):
 1. less_eq (supremum R) (supremum (insert x F))
[PROOF STEP]
by auto (metis Diff_empty Diff_insert0 cl.fold_rec finite.insertI finite_subset sup_l upper_bound)
[PROOF STATE]
proof (state)
this:
less_eq (supremum R) (supremum (insert x F))

goal (1 subgoal):
 1. \<And>R. R \<subseteq> {} \<Longrightarrow> less_eq (supremum R) (supremum {})
[PROOF STEP]
qed (auto)


[STATEMENT]
lemma continuous_at_within_divide[continuous_intros]:
  fixes f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_field"
  assumes "continuous (at a within s) f" "continuous (at a within s) g"
    and "g a \<noteq> 0"
  shows "continuous (at a within s) (\<lambda>x. (f x) / (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at a within s) (\<lambda>x. f x / g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous (at a within s) f
continuous (at a within s) g
g a \<noteq> (0::'b)

goal (1 subgoal):
 1. continuous (at a within s) (\<lambda>x. f x / g x)
[PROOF STEP]
unfolding continuous_within
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f a) (at a within s)
(g \<longlongrightarrow> g a) (at a within s)
g a \<noteq> (0::'b)

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> f a / g a) (at a within s)
[PROOF STEP]
by (rule tendsto_divide)


[STATEMENT]
lemma is_complement_edge_iff: "e \<subseteq> V \<Longrightarrow> e \<in> complement_edges \<longleftrightarrow> e \<notin> E \<and> card e = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<subseteq> V \<Longrightarrow> (e \<in> complement_edges) = (e \<notin> E \<and> card e = 2)
[PROOF STEP]
unfolding complement_edges_def all_edges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<subseteq> V \<Longrightarrow> (e \<in> {e. e \<subseteq> V \<and> card e = 2} - E) = (e \<notin> E \<and> card e = 2)
[PROOF STEP]
by auto


[STATEMENT]
lemma ln_ln_nonneg:
  assumes x: "x \<ge> (3 :: real)"
  shows   "ln (ln x) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> ln (ln x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> ln (ln x)
[PROOF STEP]
have "exp 1 \<le> (3::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 1 \<le> 3
[PROOF STEP]
by (rule  exp_le)
[PROOF STATE]
proof (state)
this:
exp 1 \<le> 3

goal (1 subgoal):
 1. 0 \<le> ln (ln x)
[PROOF STEP]
hence "ln (exp 1) \<le> ln (3 :: real)"
[PROOF STATE]
proof (prove)
using this:
exp 1 \<le> 3

goal (1 subgoal):
 1. ln (exp 1) \<le> ln 3
[PROOF STEP]
by (subst ln_le_cancel_iff) simp_all
[PROOF STATE]
proof (state)
this:
ln (exp 1) \<le> ln 3

goal (1 subgoal):
 1. 0 \<le> ln (ln x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (exp 1) \<le> ln 3

goal (1 subgoal):
 1. 0 \<le> ln (ln x)
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
3 \<le> x
[PROOF STEP]
have "\<dots> \<le> ln x"
[PROOF STATE]
proof (prove)
using this:
3 \<le> x

goal (1 subgoal):
 1. ln 3 \<le> ln x
[PROOF STEP]
by (subst ln_le_cancel_iff) simp_all
[PROOF STATE]
proof (state)
this:
ln 3 \<le> ln x

goal (1 subgoal):
 1. 0 \<le> ln (ln x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (exp 1) \<le> ln x
[PROOF STEP]
have "ln 1 \<le> ln (ln x)"
[PROOF STATE]
proof (prove)
using this:
ln (exp 1) \<le> ln x

goal (1 subgoal):
 1. ln 1 \<le> ln (ln x)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
ln (exp 1) \<le> ln x
3 \<le> x

goal (1 subgoal):
 1. ln 1 \<le> ln (ln x)
[PROOF STEP]
by (subst ln_le_cancel_iff) simp_all
[PROOF STATE]
proof (state)
this:
ln 1 \<le> ln (ln x)

goal (1 subgoal):
 1. 0 \<le> ln (ln x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ln 1 \<le> ln (ln x)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_1_over_n [tendsto_intros]: "((\<lambda>n. 1 / of_nat n) \<longlongrightarrow> (0::'a::real_normed_field)) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1::'a) / of_nat n) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
proof (subst lim_sequentially, intro allI impI exI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r n. \<lbrakk>0 < r; ?no2 r \<le> n\<rbrakk> \<Longrightarrow> dist ((1::'a) / of_nat n) (0::'a) < r
[PROOF STEP]
fix e::real and n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r n. \<lbrakk>0 < r; ?no2 r \<le> n\<rbrakk> \<Longrightarrow> dist ((1::'a) / of_nat n) (0::'a) < r
[PROOF STEP]
assume e: "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>0 < r; ?no2 r \<le> n\<rbrakk> \<Longrightarrow> dist ((1::'a) / of_nat n) (0::'a) < r
[PROOF STEP]
have "inverse e < of_nat (nat \<lceil>inverse e + 1\<rceil>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse e < real (nat \<lceil>inverse e + 1\<rceil>)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
inverse e < real (nat \<lceil>inverse e + 1\<rceil>)

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>0 < r; ?no2 r \<le> n\<rbrakk> \<Longrightarrow> dist ((1::'a) / of_nat n) (0::'a) < r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse e < real (nat \<lceil>inverse e + 1\<rceil>)

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>0 < r; ?no2 r \<le> n\<rbrakk> \<Longrightarrow> dist ((1::'a) / of_nat n) (0::'a) < r
[PROOF STEP]
assume "n \<ge> nat \<lceil>inverse e + 1\<rceil>"
[PROOF STATE]
proof (state)
this:
nat \<lceil>inverse e + 1\<rceil> \<le> n

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>0 < r; ?no2 r \<le> n\<rbrakk> \<Longrightarrow> dist ((1::'a) / of_nat n) (0::'a) < r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> inverse e < real n
[PROOF STEP]
show "dist (1 / of_nat n :: 'a) 0 < e"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> inverse e < real n

goal (1 subgoal):
 1. dist ((1::'a) / of_nat n) (0::'a) < e
[PROOF STEP]
using e
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> inverse e < real n
0 < e

goal (1 subgoal):
 1. dist ((1::'a) / of_nat n) (0::'a) < e
[PROOF STEP]
by (simp add: field_split_simps norm_divide)
[PROOF STATE]
proof (state)
this:
dist ((1::'a) / of_nat n) (0::'a) < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_prod_le:
  fixes c :: "'a::linordered_field"
  assumes "c > 0"
  shows "c * x \<le> 0 \<equiv> x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * x \<le> (0::'a) \<equiv> x \<le> (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c * x \<le> (0::'a) \<equiv> x \<le> (0::'a)
[PROOF STEP]
have "c * x \<le> 0 \<longleftrightarrow> 0 / c \<ge> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c * x \<le> (0::'a)) = (x \<le> (0::'a) / c)
[PROOF STEP]
by (simp only: pos_le_divide_eq[OF \<open>c > 0\<close>] algebra_simps)
[PROOF STATE]
proof (state)
this:
(c * x \<le> (0::'a)) = (x \<le> (0::'a) / c)

goal (1 subgoal):
 1. c * x \<le> (0::'a) \<equiv> x \<le> (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(c * x \<le> (0::'a)) = (x \<le> (0::'a) / c)

goal (1 subgoal):
 1. c * x \<le> (0::'a) \<equiv> x \<le> (0::'a)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> 0 \<ge> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> (0::'a) / c) = (x \<le> (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<le> (0::'a) / c) = (x \<le> (0::'a))

goal (1 subgoal):
 1. c * x \<le> (0::'a) \<equiv> x \<le> (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(c * x \<le> (0::'a)) = (x \<le> (0::'a))
[PROOF STEP]
show "PROP ?thesis"
[PROOF STATE]
proof (prove)
using this:
(c * x \<le> (0::'a)) = (x \<le> (0::'a))

goal (1 subgoal):
 1. c * x \<le> (0::'a) \<equiv> x \<le> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c * x \<le> (0::'a) \<equiv> x \<le> (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex1_6: "\<bar>integral {0 .. 1} (\<lambda>x. 1 / (1 + x*x::real)) - pi/4\<bar> \<le> 1 / 10^6"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>integral {0..1} (\<lambda>x. 1 / (1 + x * x)) - pi / 4\<bar> \<le> 1 / 10 ^ 6
[PROOF STEP]
by (rule abs_minus_leI) (tactic \<open>integral_bnds_tac 1 30 5 6 25 "" [] @{context} 1\<close>)


[STATEMENT]
lemma dvd_nat_bounds:
 fixes n p :: nat
 assumes "p > 0" "n dvd p"
 shows "n > 0 \<and> n \<le> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<and> n \<le> p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < p
n dvd p

goal (1 subgoal):
 1. 0 < n \<and> n \<le> p
[PROOF STEP]
by (simp add: dvd_pos_nat dvd_imp_le)


[STATEMENT]
lemma expands_to_sgn_neg:
  assumes "trimmed_neg F" "(f expands_to F) basis" "basis_wf basis"
          "length basis = expansion_level TYPE('a :: multiseries)"
  shows   "((\<lambda>x. sgn (f x)) expands_to (const_expansion (-1) :: 'a)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sgn (f x)) expands_to const_expansion (- 1)) basis
[PROOF STEP]
proof (rule expands_to_cong[OF expands_to_const])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. - 1 = sgn (f x)
[PROOF STEP]
from trimmed_imp_eventually_sgn[of basis F] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>basis_wf basis; is_expansion F basis; trimmed F\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. sgn (eval F x) = sgn (fst (dominant_term F))
trimmed_neg F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)
[PROOF STEP]
have "eventually (\<lambda>x. sgn (eval F x) = -1) at_top"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>basis_wf basis; is_expansion F basis; trimmed F\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. sgn (eval F x) = sgn (fst (dominant_term F))
trimmed_neg F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. sgn (eval F x) = - 1
[PROOF STEP]
by (simp add: expands_to.simps trimmed_neg_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = - 1

goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. - 1 = sgn (f x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = - 1

goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. - 1 = sgn (f x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
trimmed_neg F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)
[PROOF STEP]
have "eventually (\<lambda>x. eval F x = f x) at_top"
[PROOF STATE]
proof (prove)
using this:
trimmed_neg F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. eval F x = f x
[PROOF STEP]
by (simp add: expands_to.simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. eval F x = f x

goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. - 1 = sgn (f x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = - 1
\<forall>\<^sub>F x in at_top. eval F x = f x
[PROOF STEP]
show "eventually (\<lambda>x. -1 = sgn (f x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = - 1
\<forall>\<^sub>F x in at_top. eval F x = f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. - 1 = sgn (f x)
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. - 1 = sgn (f x)

goal (2 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
lemma rbl_word_plus: "rev (to_bl (x + y)) = rbl_plus False (rev (to_bl x)) (rev (to_bl y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (to_bl (x + y)) = rbl_plus False (rev (to_bl x)) (rev (to_bl y))
[PROOF STEP]
by (simp add: rbl_plus_def to_bl_plus_carry zip_rev)


[STATEMENT]
lemma proots_ball_plane_eq:
  defines "q1\<equiv>[:\<i>,-1:]" and "q2\<equiv>[:\<i>,1:]"
  assumes "p\<noteq>0"
  shows "proots_count p (ball 0 1) = proots_count (fcompose p q1 q2) {x. 0 < Im x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p (ball 0 1) = proots_count (fcompose p q1 q2) {x. 0 < Im x}
[PROOF STEP]
unfolding q1_def q2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p (ball 0 1) = proots_count (fcompose p [:\<i>, - 1:] [:\<i>, 1:]) {x. 0 < Im x}
[PROOF STEP]
proof (rule proots_fcompose_bij_eq[OF _ \<open>p\<noteq>0\<close>])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. bij_betw (\<lambda>x. poly [:\<i>, - 1:] x / poly [:\<i>, 1:] x) {x. 0 < Im x} (ball 0 1)
 2. \<forall>x\<in>{x. 0 < Im x}. poly [:\<i>, 1:] x \<noteq> 0
 3. max (degree [:\<i>, - 1:]) (degree [:\<i>, 1:]) \<le> 1
 4. \<forall>c. [:\<i>, - 1:] \<noteq> smult c [:\<i>, 1:]
 5. infinite UNIV
[PROOF STEP]
show "\<forall>x\<in>{x. 0 < Im x}. poly [:\<i>, 1:] x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{x. 0 < Im x}. poly [:\<i>, 1:] x \<noteq> 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 < Im x \<longrightarrow> \<i> + x \<noteq> 0
[PROOF STEP]
by (metis add_less_same_cancel2 imaginary_unit.simps(2) not_one_less_zero
          plus_complex.simps(2) zero_complex.simps(2))
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{x. 0 < Im x}. poly [:\<i>, 1:] x \<noteq> 0

goal (4 subgoals):
 1. bij_betw (\<lambda>x. poly [:\<i>, - 1:] x / poly [:\<i>, 1:] x) {x. 0 < Im x} (ball 0 1)
 2. max (degree [:\<i>, - 1:]) (degree [:\<i>, 1:]) \<le> 1
 3. \<forall>c. [:\<i>, - 1:] \<noteq> smult c [:\<i>, 1:]
 4. infinite UNIV
[PROOF STEP]
show "infinite (UNIV::complex set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
by (simp add: infinite_UNIV_char_0)
[PROOF STATE]
proof (state)
this:
infinite UNIV

goal (3 subgoals):
 1. bij_betw (\<lambda>x. poly [:\<i>, - 1:] x / poly [:\<i>, 1:] x) {x. 0 < Im x} (ball 0 1)
 2. max (degree [:\<i>, - 1:]) (degree [:\<i>, 1:]) \<le> 1
 3. \<forall>c. [:\<i>, - 1:] \<noteq> smult c [:\<i>, 1:]
[PROOF STEP]
qed (use bij_betw_plane_ball in auto)


[STATEMENT]
lemma Zp_Units_ord_zero:
  assumes "a \<in> Units Z\<^sub>p"
  shows "ord_Zp a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_Zp a = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord_Zp a = 0
[PROOF STEP]
have "inv\<^bsub>Z\<^sub>p\<^esub> a \<in> nonzero Z\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>Z\<^sub>p\<^esub> a \<in> nonzero Z\<^sub>p
[PROOF STEP]
apply(rule Zp.nonzero_memI, rule Zp.Units_inv_closed, rule assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>Z\<^sub>p\<^esub> a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
using assms Zp.Units_inverse in_Units_imp_not_zero
[PROOF STATE]
proof (prove)
using this:
a \<in> Units Z\<^sub>p
?u \<in> Units Z\<^sub>p \<Longrightarrow> inv\<^bsub>Z\<^sub>p\<^esub> ?u \<in> Units Z\<^sub>p
?a \<in> Units Z\<^sub>p \<Longrightarrow> ?a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. inv\<^bsub>Z\<^sub>p\<^esub> a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv\<^bsub>Z\<^sub>p\<^esub> a \<in> nonzero Z\<^sub>p

goal (1 subgoal):
 1. ord_Zp a = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv\<^bsub>Z\<^sub>p\<^esub> a \<in> nonzero Z\<^sub>p
[PROOF STEP]
have "ord_Zp (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv \<^bsub>Z\<^sub>p\<^esub> a) = ord_Zp a + ord_Zp (inv \<^bsub>Z\<^sub>p\<^esub> a)"
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>Z\<^sub>p\<^esub> a \<in> nonzero Z\<^sub>p

goal (1 subgoal):
 1. ord_Zp (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> a) = ord_Zp a + ord_Zp (inv\<^bsub>Z\<^sub>p\<^esub> a)
[PROOF STEP]
using assms ord_Zp_mult Zp.Units_nonzero zero_not_one
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>Z\<^sub>p\<^esub> a \<in> nonzero Z\<^sub>p
a \<in> Units Z\<^sub>p
\<lbrakk>?x \<in> nonzero Z\<^sub>p; ?y \<in> nonzero Z\<^sub>p\<rbrakk> \<Longrightarrow> ord_Zp (?x \<otimes>\<^bsub>Z\<^sub>p\<^esub> ?y) = ord_Zp ?x + ord_Zp ?y
\<lbrakk>?u \<in> Units Z\<^sub>p; \<one>\<^bsub>Z\<^sub>p\<^esub> \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub>\<rbrakk> \<Longrightarrow> ?u \<in> nonzero Z\<^sub>p
\<zero> \<noteq> \<one>

goal (1 subgoal):
 1. ord_Zp (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> a) = ord_Zp a + ord_Zp (inv\<^bsub>Z\<^sub>p\<^esub> a)
[PROOF STEP]
by (metis Zp.zero_not_one)
[PROOF STATE]
proof (state)
this:
ord_Zp (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> a) = ord_Zp a + ord_Zp (inv\<^bsub>Z\<^sub>p\<^esub> a)

goal (1 subgoal):
 1. ord_Zp a = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord_Zp (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> a) = ord_Zp a + ord_Zp (inv\<^bsub>Z\<^sub>p\<^esub> a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ord_Zp (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> a) = ord_Zp a + ord_Zp (inv\<^bsub>Z\<^sub>p\<^esub> a)

goal (1 subgoal):
 1. ord_Zp a = 0
[PROOF STEP]
by (smt Zp.Units_closed Zp.Units_r_inv Zp.integral_iff Zp.nonzero_closed \<open>inv\<^bsub>Z\<^sub>p\<^esub> a \<in> nonzero Z\<^sub>p\<close> assms ord_Zp_one ord_pos)
[PROOF STATE]
proof (state)
this:
ord_Zp a = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_fixpoint_property:
  fixes S :: "'a::topological_space set"
    and T :: "'b::topological_space set"
  assumes "S homeomorphic T"
  shows "(\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)) \<longleftrightarrow>
         (\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y))"
         (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)) = (\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)) = (\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y))
[PROOF STEP]
obtain r i where r:
      "\<forall>x\<in>S. i (r x) = x" "r ` S = T" "continuous_on S r"
      "\<forall>y\<in>T. r (i y) = y" "i ` T = S" "continuous_on T i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i r. \<lbrakk>\<forall>x\<in>S. i (r x) = x; r ` S = T; continuous_on S r; \<forall>y\<in>T. r (i y) = y; i ` T = S; continuous_on T i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S homeomorphic T

goal (1 subgoal):
 1. (\<And>i r. \<lbrakk>\<forall>x\<in>S. i (r x) = x; r ` S = T; continuous_on S r; \<forall>y\<in>T. r (i y) = y; i ` T = S; continuous_on T i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding homeomorphic_def homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f g. (\<forall>x\<in>S. g (f x) = x) \<and> f ` S = T \<and> continuous_on S f \<and> (\<forall>y\<in>T. f (g y) = y) \<and> g ` T = S \<and> continuous_on T g

goal (1 subgoal):
 1. (\<And>i r. \<lbrakk>\<forall>x\<in>S. i (r x) = x; r ` S = T; continuous_on S r; \<forall>y\<in>T. r (i y) = y; i ` T = S; continuous_on T i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. i (r x) = x
r ` S = T
continuous_on S r
\<forall>y\<in>T. r (i y) = y
i ` T = S
continuous_on T i

goal (1 subgoal):
 1. (\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)) = (\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)) = (\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x) \<Longrightarrow> \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y)
 2. \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y) \<Longrightarrow> \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)

goal (2 subgoals):
 1. \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x) \<Longrightarrow> \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y)
 2. \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y) \<Longrightarrow> \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>S. i (r x) = x
r ` S = T
continuous_on S r
\<forall>y\<in>T. r (i y) = y
i ` T = S
continuous_on T i
\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. i (r x) = x
r ` S = T
continuous_on S r
\<forall>y\<in>T. r (i y) = y
i ` T = S
continuous_on T i
\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)

goal (1 subgoal):
 1. \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y)
[PROOF STEP]
by (metis invertible_fixpoint_property[of T i S r] order_refl)
[PROOF STATE]
proof (state)
this:
\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y)

goal (1 subgoal):
 1. \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y) \<Longrightarrow> \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y) \<Longrightarrow> \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y)

goal (1 subgoal):
 1. \<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y) \<Longrightarrow> \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>S. i (r x) = x
r ` S = T
continuous_on S r
\<forall>y\<in>T. r (i y) = y
i ` T = S
continuous_on T i
\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. i (r x) = x
r ` S = T
continuous_on S r
\<forall>y\<in>T. r (i y) = y
i ` T = S
continuous_on T i
\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y)

goal (1 subgoal):
 1. \<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)
[PROOF STEP]
by (metis invertible_fixpoint_property[of S r T i] order_refl)
[PROOF STATE]
proof (state)
this:
\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>f. continuous_on S f \<and> f ` S \<subseteq> S \<longrightarrow> (\<exists>x\<in>S. f x = x)) = (\<forall>g. continuous_on T g \<and> g ` T \<subseteq> T \<longrightarrow> (\<exists>y\<in>T. g y = y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infsum_reindex_bij_betw:
  assumes "bij_betw g A B"
  shows   "infsum (\<lambda>x. f (g x)) A = infsum f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B
[PROOF STEP]
have \<open>infsum (\<lambda>x. f (g x)) A = infsum f (g ` A)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f (g ` A)
[PROOF STEP]
by (metis (mono_tags, lifting) assms bij_betw_imp_inj_on infsum_cong infsum_reindex o_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f (g ` A)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f (g ` A)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B
[PROOF STEP]
have \<open>\<dots> = infsum f B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f (g ` A) = infsum f B
[PROOF STEP]
using assms bij_betw_imp_surj_on
[PROOF STATE]
proof (prove)
using this:
bij_betw g A B
bij_betw ?f ?A ?B \<Longrightarrow> ?f ` ?A = ?B

goal (1 subgoal):
 1. infsum f (g ` A) = infsum f B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
infsum f (g ` A) = infsum f B

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. f (g x)) = infsum f B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma xyz_eq: "{#x, y, z#} = poly_roots [:-1/6, -1/2, -1, 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
have "image_mset f (mset_set {..<3}) = poly_roots Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (mset_set {..<3}) = poly_roots Q
[PROOF STEP]
using mset_x_eq_poly_roots_Q
[PROOF STATE]
proof (prove)
using this:
image_mset f (mset_set {..<3}) = poly_roots Q

goal (1 subgoal):
 1. image_mset f (mset_set {..<3}) = poly_roots Q
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
image_mset f (mset_set {..<3}) = poly_roots Q

goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
image_mset f (mset_set {..<3}) = poly_roots Q

goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
have "image_mset f (mset_set {..<3}) = {#x, y, z#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (mset_set {..<3}) = {#x, y, z#}
[PROOF STEP]
by (simp add: numeral_3_eq_3 lessThan_Suc f_def Multiset.union_ac)
[PROOF STATE]
proof (state)
this:
image_mset f (mset_set {..<3}) = {#x, y, z#}

goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
image_mset f (mset_set {..<3}) = {#x, y, z#}

goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
have "Q = [:-1/6, -1/2, -1, 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q = [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
by (simp add: Q_altdef atMost_nat_numeral Polynomial.monom_altdef
                  power3_eq_cube power2_eq_square)
[PROOF STATE]
proof (state)
this:
Q = [:- 1 / 6, - 1 / 2, - 1, 1:]

goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]

goal (1 subgoal):
 1. {#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{#x, y, z#} = poly_roots [:- 1 / 6, - 1 / 2, - 1, 1:]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inversions_between_permute2:
  assumes "\<pi> permutes {..<length ys}"
  shows   "inversions_between xs (permute_list \<pi> ys) =
             map_prod id (inv \<pi>) ` inversions_between xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inversions_between xs (permute_list \<pi> ys) = map_prod id (inv \<pi>) ` inversions_between xs ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inversions_between xs (permute_list \<pi> ys) = map_prod id (inv \<pi>) ` inversions_between xs ys
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<pi> permutes {..<length ys}
[PROOF STEP]
have [simp]: "\<pi> i < length ys" if "i < length ys" "\<pi> permutes {..<length ys}" for i \<pi>
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length ys}

goal (1 subgoal):
 1. \<pi> i < length ys
[PROOF STEP]
using permutes_in_image[OF that(2)] that
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length ys}
(\<pi> ?x \<in> {..<length ys}) = (?x \<in> {..<length ys})
i < length ys
\<pi> permutes {..<length ys}

goal (1 subgoal):
 1. \<pi> i < length ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < length ys; ?\<pi> permutes {..<length ys}\<rbrakk> \<Longrightarrow> ?\<pi> ?i < length ys

goal (1 subgoal):
 1. inversions_between xs (permute_list \<pi> ys) = map_prod id (inv \<pi>) ` inversions_between xs ys
[PROOF STEP]
have *: "inv \<pi> permutes {..<length ys}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv \<pi> permutes {..<length ys}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length ys}

goal (1 subgoal):
 1. inv \<pi> permutes {..<length ys}
[PROOF STEP]
by (rule permutes_inv)
[PROOF STATE]
proof (state)
this:
inv \<pi> permutes {..<length ys}

goal (1 subgoal):
 1. inversions_between xs (permute_list \<pi> ys) = map_prod id (inv \<pi>) ` inversions_between xs ys
[PROOF STEP]
from assms *
[PROOF STATE]
proof (chain)
picking this:
\<pi> permutes {..<length ys}
inv \<pi> permutes {..<length ys}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length ys}
inv \<pi> permutes {..<length ys}

goal (1 subgoal):
 1. inversions_between xs (permute_list \<pi> ys) = map_prod id (inv \<pi>) ` inversions_between xs ys
[PROOF STEP]
unfolding inversions_between_def map_prod_def
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length ys}
inv \<pi> permutes {..<length ys}

goal (1 subgoal):
 1. {(i, j). (i, j) \<in> {..<length xs} \<times> {..<length (permute_list \<pi> ys)} \<and> permute_list \<pi> ys ! j < xs ! i} = (\<lambda>(x, y). (id x, inv \<pi> y)) ` {(i, j). (i, j) \<in> {..<length xs} \<times> {..<length ys} \<and> ys ! j < xs ! i}
[PROOF STEP]
by (force simp: image_iff permute_list_nth permutes_inverses intro: exI[of _ "\<pi> i" for i])
[PROOF STATE]
proof (state)
this:
inversions_between xs (permute_list \<pi> ys) = map_prod id (inv \<pi>) ` inversions_between xs ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wp_under_wlp_DC:
  assumes wp_u_a:  "wp_under_wlp a"
      and wp_u_b:  "wp_under_wlp b"
  shows "wp_under_wlp (a \<Sqinter> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp_under_wlp (a \<Sqinter> b)
[PROOF STEP]
proof(rule wp_under_wlpI, unfold wp_eval, rule le_funI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. unitary P \<Longrightarrow> min (wp a P x) (wp b P x) \<le> min (wlp a P x) (wlp b P x)
[PROOF STEP]
fix Q::"'a \<Rightarrow> real" and s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. unitary P \<Longrightarrow> min (wp a P x) (wp b P x) \<le> min (wlp a P x) (wlp b P x)
[PROOF STEP]
assume uQ: "unitary Q"
[PROOF STATE]
proof (state)
this:
unitary Q

goal (1 subgoal):
 1. \<And>P x. unitary P \<Longrightarrow> min (wp a P x) (wp b P x) \<le> min (wlp a P x) (wlp b P x)
[PROOF STEP]
from wp_u_a uQ
[PROOF STATE]
proof (chain)
picking this:
wp_under_wlp a
unitary Q
[PROOF STEP]
have "wp a Q s \<le> wlp a Q s"
[PROOF STATE]
proof (prove)
using this:
wp_under_wlp a
unitary Q

goal (1 subgoal):
 1. wp a Q s \<le> wlp a Q s
[PROOF STEP]
by(blast)
[PROOF STATE]
proof (state)
this:
wp a Q s \<le> wlp a Q s

goal (1 subgoal):
 1. \<And>P x. unitary P \<Longrightarrow> min (wp a P x) (wp b P x) \<le> min (wlp a P x) (wlp b P x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wp a Q s \<le> wlp a Q s

goal (1 subgoal):
 1. \<And>P x. unitary P \<Longrightarrow> min (wp a P x) (wp b P x) \<le> min (wlp a P x) (wlp b P x)
[PROOF STEP]
from wp_u_b uQ
[PROOF STATE]
proof (chain)
picking this:
wp_under_wlp b
unitary Q
[PROOF STEP]
have "wp b Q s \<le> wlp b Q s"
[PROOF STATE]
proof (prove)
using this:
wp_under_wlp b
unitary Q

goal (1 subgoal):
 1. wp b Q s \<le> wlp b Q s
[PROOF STEP]
by(blast)
[PROOF STATE]
proof (state)
this:
wp b Q s \<le> wlp b Q s

goal (1 subgoal):
 1. \<And>P x. unitary P \<Longrightarrow> min (wp a P x) (wp b P x) \<le> min (wlp a P x) (wlp b P x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wp a Q s \<le> wlp a Q s
wp b Q s \<le> wlp b Q s
[PROOF STEP]
show "min (wp a Q s) (wp b Q s) \<le> min (wlp a Q s) (wlp b Q s)"
[PROOF STATE]
proof (prove)
using this:
wp a Q s \<le> wlp a Q s
wp b Q s \<le> wlp b Q s

goal (1 subgoal):
 1. min (wp a Q s) (wp b Q s) \<le> min (wlp a Q s) (wlp b Q s)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
min (wp a Q s) (wp b Q s) \<le> min (wlp a Q s) (wlp b Q s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Plus_neg_card: "card (I \<oplus>- k) = card (I \<down>\<ge> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (I \<oplus>- k) = card (I \<down>\<ge> k)
[PROOF STEP]
apply (simp add: iT_Plus_neg_image_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>n. n - k) ` I \<down>\<ge> k) = card (I \<down>\<ge> k)
[PROOF STEP]
apply (rule card_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>n. n - k) (I \<down>\<ge> k)
[PROOF STEP]
apply (subst cut_ge_Int_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>n. n - k) (I \<inter> {k..})
[PROOF STEP]
apply (rule subset_inj_on[OF _ Int_lower2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>n. n - k) {k..}
[PROOF STEP]
apply (rule sub_left_inj_on)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pm_of_poly_times: "pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x (q::_::ring_1 poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x q
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pm_of_poly x (0 * q) = pm_of_poly x 0 * pm_of_poly x q
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'b) \<or> p \<noteq> 0; pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x q\<rbrakk> \<Longrightarrow> pm_of_poly x (pCons a p * q) = pm_of_poly x (pCons a p) * pm_of_poly x q
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. pm_of_poly x (0 * q) = pm_of_poly x 0 * pm_of_poly x q
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'b) \<or> p \<noteq> 0; pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x q\<rbrakk> \<Longrightarrow> pm_of_poly x (pCons a p * q) = pm_of_poly x (pCons a p) * pm_of_poly x q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pm_of_poly x (0 * q) = pm_of_poly x 0 * pm_of_poly x q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pm_of_poly x (0 * q) = pm_of_poly x 0 * pm_of_poly x q

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'b) \<or> p \<noteq> 0; pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x q\<rbrakk> \<Longrightarrow> pm_of_poly x (pCons a p * q) = pm_of_poly x (pCons a p) * pm_of_poly x q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'b) \<or> p \<noteq> 0; pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x q\<rbrakk> \<Longrightarrow> pm_of_poly x (pCons a p * q) = pm_of_poly x (pCons a p) * pm_of_poly x q
[PROOF STEP]
case (pCons a p)
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'b) \<or> p \<noteq> 0
pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x q

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'b) \<or> p \<noteq> 0; pm_of_poly x (p * q) = pm_of_poly x p * pm_of_poly x q\<rbrakk> \<Longrightarrow> pm_of_poly x (pCons a p * q) = pm_of_poly x (pCons a p) * pm_of_poly x q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pm_of_poly x (pCons a p * q) = pm_of_poly x (pCons a p) * pm_of_poly x q
[PROOF STEP]
by (simp add: pm_of_poly_plus pm_of_poly_pCons map_scale_eq_times pCons(2) algebra_simps
             flip: times_monomial_left)
[PROOF STATE]
proof (state)
this:
pm_of_poly x (pCons a p * q) = pm_of_poly x (pCons a p) * pm_of_poly x q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dirichlet_prod_const_left [simp]:
  assumes "n > 0"
  shows   "dirichlet_prod (\<lambda>n. if n = Suc 0 then c else 0) g n = c * g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n
[PROOF STEP]
have "dirichlet_prod (\<lambda>n. if n = Suc 0 then c else 0) g n =
          (\<Sum>d | d dvd n. (if d = 1 then c * g n else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = (\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a))
[PROOF STEP]
unfolding dirichlet_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. (if d = Suc 0 then c else (0::'a)) * g (n div d)) = (\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. (if d = Suc 0 then c else (0::'a)) * g (n div d)) = (\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a))
[PROOF STEP]
by (intro sum.cong refl) (auto elim!: dvdE split: if_splits)
[PROOF STATE]
proof (state)
this:
dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = (\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a))

goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = (\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a))

goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n
[PROOF STEP]
have "\<dots> = c * g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a)) = c * g n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a)) = c * g n
[PROOF STEP]
by (subst sum.delta) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. if d = 1 then c * g n else (0::'a)) = c * g n

goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n

goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dirichlet_prod (\<lambda>n. if n = Suc 0 then c else (0::'a)) g n = c * g n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_finsets: "finite N \<Longrightarrow> card (finsets N k) = card N choose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite N \<Longrightarrow> card (finsets N k) = card N choose k
[PROOF STEP]
by (simp add: finsets_def n_subsets)


[STATEMENT]
lemma remainderexp: "((a mod (n::nat))^i) mod n = (a^i) mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a mod n) ^ i mod n = a ^ i mod n
[PROOF STEP]
by (rule power_mod)


[STATEMENT]
lemma "\<bar>x\<bar> \<le> 1 \<longrightarrow> \<bar>64 * x^7 - 112 * x^5 + 56 * x^3 - 7 * x\<bar> \<le> (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> 1 \<longrightarrow> \<bar>64 * x ^ 7 - 112 * x ^ 5 + 56 * x ^ 3 - 7 * x\<bar> \<le> 1
[PROOF STEP]
by sos


[STATEMENT]
lemma numeral_7_eq_7: "7 = Suc(Suc( Suc(Suc( Suc (Suc (Suc 0))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 7 = Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))
[PROOF STEP]
by (simp add: eval_nat_numeral)


[STATEMENT]
lemma coeff_mult_0: "poly.coeff (p * q) 0 = poly.coeff p 0 * poly.coeff q 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p * q) 0 = coeff p 0 * coeff q 0
[PROOF STEP]
by (simp add: coeff_mult)


[STATEMENT]
lemma fract_mult:
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "b \<in> nonzero Q\<^sub>p"
  assumes "c \<in> carrier Q\<^sub>p"
  assumes "d \<in> nonzero Q\<^sub>p"
  shows  "(a \<div> b) \<otimes> (c \<div> d) = ((a \<otimes> c)\<div> (b \<otimes> d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<div> b) \<otimes> (c \<div> d) = (a \<otimes> c \<div> b \<otimes> d)
[PROOF STEP]
using Q\<^sub>p_def assms(1) assms(2) assms(3) assms(4)
[PROOF STATE]
proof (prove)
using this:
Q\<^sub>p \<equiv> Frac Z\<^sub>p
a \<in> carrier Q\<^sub>p
b \<in> nonzero Q\<^sub>p
c \<in> carrier Q\<^sub>p
d \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. (a \<div> b) \<otimes> (c \<div> d) = (a \<otimes> c \<div> b \<otimes> d)
[PROOF STEP]
by (simp add: fract_mult)


[STATEMENT]
lemma interval_upperbound[simp]:
  "\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i \<Longrightarrow>
    interval_upperbound (cbox a b) = (b::'a::euclidean_space)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> interval_upperbound (cbox a b) = b
[PROOF STEP]
unfolding interval_upperbound_def euclidean_representation_sum cbox_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> \<forall>i\<in>Basis. (SUP x\<in>{x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i}. x \<bullet> i) = b \<bullet> i
[PROOF STEP]
by (safe intro!: cSup_eq) auto


[STATEMENT]
lemma shiftl_power:
  "(shiftl1 ^^ x) (y::'a::len word) = 2 ^ x * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (shiftl1 ^^ x) y = 2 ^ x * y
[PROOF STEP]
by (induction x) (simp_all add: shiftl1_def)


[STATEMENT]
lemma rotation_pi_2_x_axis [simp]:
  shows "moebius_circline (moebius_rotation (pi/2)) x_axis = y_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (moebius_rotation (pi / 2)) x_axis = y_axis
[PROOF STEP]
unfolding moebius_rotation_def moebius_similarity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (mk_moebius (cis (pi / 2)) 0 0 1) x_axis = y_axis
[PROOF STEP]
by (transfer, transfer, simp add: mat_adj_def mat_cnj_def, rule_tac x="-1" in exI, simp)


[STATEMENT]
lemma invariance_of_domain_gen:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "open S" "continuous_on S f" "inj_on f S" "DIM('b) \<le> DIM('a)"
    shows "open(f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` S)
[PROOF STEP]
using invariance_of_domain_subspaces [of UNIV S UNIV f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>openin (top_of_set UNIV) S; subspace UNIV; subspace UNIV; dim UNIV \<le> dim UNIV; continuous_on S f; f ` S \<subseteq> UNIV; inj_on f S\<rbrakk> \<Longrightarrow> openin (top_of_set UNIV) (f ` S)
open S
continuous_on S f
inj_on f S
DIM('b) \<le> DIM('a)

goal (1 subgoal):
 1. open (f ` S)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in group) subgroup_card_dvd_group_ord:
  assumes "subgroup H G"
  shows "card H dvd order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H dvd order G
[PROOF STEP]
using Coset.group.lagrange[of G H] assms group_axioms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Group.group G; subgroup H G\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
subgroup H G
Group.group G

goal (1 subgoal):
 1. card H dvd order G
[PROOF STEP]
by (metis dvd_triv_right)


[STATEMENT]
lemma equiv_sym: "equiv V R \<Longrightarrow> (x,y)\<in>R \<Longrightarrow> (y,x)\<in>R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>equiv V R; (x, y) \<in> R\<rbrakk> \<Longrightarrow> (y, x) \<in> R
[PROOF STEP]
by (metis equiv_def symD)


[STATEMENT]
lemma convex_hull_in_cone:
  "convex_hull C \<subseteq> cone C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_hull C \<subseteq> cone C
[PROOF STEP]
unfolding convex_hull_def cone_def convex_lincomb_def finite_cone_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>Ws c. finite Ws \<and> Ws \<subseteq> C \<and> nonneg_lincomb c Ws x \<and> sum c Ws = (1::'a)} \<subseteq> {x. \<exists>Ws. finite Ws \<and> Ws \<subseteq> C \<and> x \<in> {b. \<exists>c. nonneg_lincomb c (if finite Ws then Ws else {}) b}}
[PROOF STEP]
by auto


[STATEMENT]
lemma has_vector_derivative_part_circlepath [derivative_intros]:
    "((part_circlepath z r s t) has_vector_derivative
      (\<i> * r * (of_real t - of_real s) * exp(\<i> * linepath s t x)))
     (at x within X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (part_circlepath z r s t has_vector_derivative \<i> * complex_of_real r * (complex_of_real t - complex_of_real s) * exp (\<i> * complex_of_real (linepath s t x))) (at x within X)
[PROOF STEP]
unfolding part_circlepath_def linepath_def scaleR_conv_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. z + complex_of_real r * exp (\<i> * complex_of_real (of_real (1 - x) * s + of_real x * t))) has_vector_derivative \<i> * complex_of_real r * (complex_of_real t - complex_of_real s) * exp (\<i> * complex_of_real (of_real (1 - x) * s + of_real x * t))) (at x within X)
[PROOF STEP]
by (rule has_vector_derivative_real_field derivative_eq_intros | simp)+


[STATEMENT]
lemma filtered_prop: "X \<noteq> {} \<Longrightarrow> (\<forall>x \<in> X. \<forall>y \<in> X. \<exists>z \<in> X. z \<le> x \<and> z \<le> y) \<Longrightarrow> filtered X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; \<forall>x\<in>X. \<forall>y\<in>X. \<exists>z\<in>X. z \<le> x \<and> z \<le> y\<rbrakk> \<Longrightarrow> filtered X
[PROOF STEP]
unfolding filtered_to_directed
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; \<forall>x\<in>X. \<forall>y\<in>X. \<exists>z\<in>X. z \<le> x \<and> z \<le> y\<rbrakk> \<Longrightarrow> directed (\<partial> ` X)
[PROOF STEP]
by (rule directed_prop, blast, metis (full_types) image_iff ord_dual)


[STATEMENT]
lemma distinct_take_cols_id:
  assumes "distinct inds"
  shows "distinct (cols (take_cols (1\<^sub>m n) inds) :: 'a vec list)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (cols (take_cols (1\<^sub>m n) inds))
[PROOF STEP]
unfolding take_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (cols (mat_of_cols (dim_row (1\<^sub>m n)) (map ((!) (cols (1\<^sub>m n))) (filter (\<lambda>y. y < dim_col (1\<^sub>m n)) inds))))
[PROOF STEP]
apply (subst cols_mat_of_cols)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set (map ((!) (cols (1\<^sub>m n))) (filter (\<lambda>y. y < dim_col (1\<^sub>m n)) inds)) \<subseteq> carrier_vec (dim_row (1\<^sub>m n))
 2. distinct (map ((!) (cols (1\<^sub>m n))) (filter (\<lambda>y. y < dim_col (1\<^sub>m n)) inds))
[PROOF STEP]
apply (auto intro!:  distinct_map_nth simp add: distinct_cols_id)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
using assms distinct_filter
[PROOF STATE]
proof (prove)
using this:
distinct inds
distinct ?xs \<Longrightarrow> distinct (filter ?P ?xs)

goal (1 subgoal):
 1. distinct (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
by blast


[STATEMENT]
lemma tank_inv_arith1:
  assumes "0 \<le> (\<tau>::real)" and "c\<^sub>o < c\<^sub>i" and b: "hmin \<le> y\<^sub>0" and g: "\<tau> \<le> (hmax - y\<^sub>0) / (c\<^sub>i - c\<^sub>o)"
  shows "hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0" and "(c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 \<le> hmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 &&& (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 \<le> hmax
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0
 2. (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 \<le> hmax
[PROOF STEP]
have "(c\<^sub>i - c\<^sub>o) \<cdot> \<tau> \<le> (hmax - y\<^sub>0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> \<le> hmax - y\<^sub>0
[PROOF STEP]
using g assms(2,3)
[PROOF STATE]
proof (prove)
using this:
\<tau> \<le> (hmax - y\<^sub>0) / (c\<^sub>i - c\<^sub>o)
c\<^sub>o < c\<^sub>i
hmin \<le> y\<^sub>0

goal (1 subgoal):
 1. (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> \<le> hmax - y\<^sub>0
[PROOF STEP]
by (metis diff_gt_0_iff_gt mult.commute pos_le_divide_eq)
[PROOF STATE]
proof (state)
this:
(c\<^sub>i - c\<^sub>o) \<cdot> \<tau> \<le> hmax - y\<^sub>0

goal (2 subgoals):
 1. hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0
 2. (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 \<le> hmax
[PROOF STEP]
thus "(c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 \<le> hmax"
[PROOF STATE]
proof (prove)
using this:
(c\<^sub>i - c\<^sub>o) \<cdot> \<tau> \<le> hmax - y\<^sub>0

goal (1 subgoal):
 1. (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 \<le> hmax
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0 \<le> hmax

goal (1 subgoal):
 1. hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0
[PROOF STEP]
show "hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0
[PROOF STEP]
using b assms(1,2)
[PROOF STATE]
proof (prove)
using this:
hmin \<le> y\<^sub>0
0 \<le> \<tau>
c\<^sub>o < c\<^sub>i

goal (1 subgoal):
 1. hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0
[PROOF STEP]
by (metis add.commute add_increasing2 diff_ge_0_iff_ge
        less_eq_real_def mult_nonneg_nonneg)
[PROOF STATE]
proof (state)
this:
hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y\<^sub>0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma numeral_4_eq_4: "4 = Suc( Suc (Suc (Suc 0)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 = Suc (Suc (Suc (Suc 0)))
[PROOF STEP]
by (simp add: eval_nat_numeral)


[STATEMENT]
lemma mset_subset_eq_mono_add: "(A::'a multiset) \<subseteq># B \<Longrightarrow> C \<subseteq># D \<Longrightarrow> A + C \<subseteq># B + D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq># B; C \<subseteq># D\<rbrakk> \<Longrightarrow> A + C \<subseteq># B + D
[PROOF STEP]
by (fact subset_mset.add_mono)


[STATEMENT]
lemma card_UNIV_length_enum:
  "card (UNIV :: 'a set) = length enum"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV = length enum
[PROOF STEP]
by (simp add: UNIV_enum distinct_card enum_distinct)


[STATEMENT]
lemma ket_1_dim:
  shows "dim_vec ket_1 = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec ket_1 = 2
[PROOF STEP]
unfolding ket_1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (unit_vec 2 1) = 2
[PROOF STEP]
by simp


[STATEMENT]
lemma mems_le_finite_i:
  fixes s :: "nat set" and k :: nat
  shows "(\<forall> x. x \<in> s \<longrightarrow> x \<le> k) \<Longrightarrow> finite s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
assume P: "(\<forall> x. x \<in> s \<longrightarrow> x \<le> k)"
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<in> s \<longrightarrow> x \<le> k

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
let ?f = "id :: nat \<Rightarrow> nat"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
let ?S = "{i. i \<le> k}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
have "s \<subseteq> ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<subseteq> {i. i \<le> k}
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<in> s \<longrightarrow> x \<le> k

goal (1 subgoal):
 1. s \<subseteq> {i. i \<le> k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s \<subseteq> {i. i \<le> k}

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
s \<subseteq> {i. i \<le> k}

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
have "?f ` ?S = ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id ` {i. i \<le> k} = {i. i \<le> k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
id ` {i. i \<le> k} = {i. i \<le> k}

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
id ` {i. i \<le> k} = {i. i \<le> k}

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
have "finite ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i \<le> k}
[PROOF STEP]
using nat_seg_image_imp_finite
[PROOF STATE]
proof (prove)
using this:
?A = ?f ` {i. i < ?n} \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {i. i \<le> k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {i. i \<le> k}

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {i. i \<le> k}

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
have "finite s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite s
[PROOF STEP]
using calculation finite_subset
[PROOF STATE]
proof (prove)
using this:
s \<subseteq> {i. i \<le> k}
id ` {i. i \<le> k} = {i. i \<le> k}
finite {i. i \<le> k}
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite s

goal (1 subgoal):
 1. \<forall>x. x \<in> s \<longrightarrow> x \<le> k \<Longrightarrow> finite s
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
s \<subseteq> {i. i \<le> k}
id ` {i. i \<le> k} = {i. i \<le> k}
finite {i. i \<le> k}
finite s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s \<subseteq> {i. i \<le> k}
id ` {i. i \<le> k} = {i. i \<le> k}
finite {i. i \<le> k}
finite s

goal (1 subgoal):
 1. finite s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_log_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> a powr (log a x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a \<noteq> 1; 0 < x\<rbrakk> \<Longrightarrow> a powr log a x = x
[PROOF STEP]
by (simp add: powr_def log_def)


[STATEMENT]
lemma deformation_retract_imp_homotopy_equivalent_space:
   "\<lbrakk>homotopic_with (\<lambda>x. True) X X r id; retraction_maps X Y r id\<rbrakk>
    \<Longrightarrow> X homotopy_equivalent_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>homotopic_with (\<lambda>x. True) X X r id; retraction_maps X Y r id\<rbrakk> \<Longrightarrow> X homotopy_equivalent_space Y
[PROOF STEP]
using deformation_retraction_imp_homotopy_equivalent_space
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>homotopic_with (\<lambda>x. True) ?X ?X (?s \<circ> ?r) id; retraction_maps ?X ?Y ?r ?s\<rbrakk> \<Longrightarrow> ?X homotopy_equivalent_space ?Y

goal (1 subgoal):
 1. \<lbrakk>homotopic_with (\<lambda>x. True) X X r id; retraction_maps X Y r id\<rbrakk> \<Longrightarrow> X homotopy_equivalent_space Y
[PROOF STEP]
by force


[STATEMENT]
lemma (in monoid) nat_pow_Suc2:
  "x \<in> carrier G \<Longrightarrow> x [^] (Suc n) = x \<otimes> (x [^] n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> x [^] Suc n = x \<otimes> x [^] n
[PROOF STEP]
using nat_pow_mult[of x 1 n] Suc_eq_plus1[of n]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G \<Longrightarrow> x [^] 1 \<otimes> x [^] n = x [^] (1 + n)
Suc n = n + 1

goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> x [^] Suc n = x \<otimes> x [^] n
[PROOF STEP]
by (metis One_nat_def Suc_eq_plus1_left l_one nat.rec(1) nat_pow_Suc nat_pow_def)


[STATEMENT]
lemma icard_Diff_singleton: "x \<in> A \<Longrightarrow> icard (A - {x}) = icard A - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> icard (A - {x}) = icard A - 1
[PROOF STEP]
apply (rule eSuc_inject[THEN iffD1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> eSuc (icard (A - {x})) = eSuc (icard A - 1)
[PROOF STEP]
apply (frule in_imp_not_empty, drule icard_not_empty_iff[THEN iffD2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; 0 < icard A\<rbrakk> \<Longrightarrow> eSuc (icard (A - {x})) = eSuc (icard A - 1)
[PROOF STEP]
apply (simp add: icard_Suc_Diff1 eSuc_pred_enat one_eSuc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma filtermap_at_minus: "filtermap (\<lambda>x. - x) (at a) = at (- a)"
  for a :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap uminus (at a) = at (- a)
[PROOF STEP]
by (simp add: filter_eq_iff eventually_filtermap eventually_at_filter filtermap_nhds_minus[symmetric])


[STATEMENT]
lemma neighbourhood_base_of_mono:
   "\<lbrakk>neighbourhood_base_of P X; \<And>S. P S \<Longrightarrow> Q S\<rbrakk> \<Longrightarrow> neighbourhood_base_of Q X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>neighbourhood_base_of P X; \<And>S. P S \<Longrightarrow> Q S\<rbrakk> \<Longrightarrow> neighbourhood_base_of Q X
[PROOF STEP]
unfolding neighbourhood_base_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>topspace X. neighbourhood_base_at x P X; \<And>S. P S \<Longrightarrow> Q S\<rbrakk> \<Longrightarrow> \<forall>x\<in>topspace X. neighbourhood_base_at x Q X
[PROOF STEP]
using neighbourhood_base_at_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>neighbourhood_base_at ?x ?P ?X; \<And>S. \<lbrakk>?P S; ?x \<in> S\<rbrakk> \<Longrightarrow> ?Q S\<rbrakk> \<Longrightarrow> neighbourhood_base_at ?x ?Q ?X

goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>topspace X. neighbourhood_base_at x P X; \<And>S. P S \<Longrightarrow> Q S\<rbrakk> \<Longrightarrow> \<forall>x\<in>topspace X. neighbourhood_base_at x Q X
[PROOF STEP]
by force


[STATEMENT]
lemma addfunsetI :
  "\<lbrakk> supp f \<subseteq> A; range f \<subseteq> M; \<forall>x\<in>A. \<forall>y\<in>A. f (x+y) = f x + f y \<rbrakk>
        \<Longrightarrow> f \<in> addfunset A M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>supp f \<subseteq> A; range f \<subseteq> M; \<forall>x\<in>A. \<forall>y\<in>A. f (x + y) = f x + f y\<rbrakk> \<Longrightarrow> f \<in> addfunset A M
[PROOF STEP]
unfolding addfunset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>supp f \<subseteq> A; range f \<subseteq> M; \<forall>x\<in>A. \<forall>y\<in>A. f (x + y) = f x + f y\<rbrakk> \<Longrightarrow> f \<in> {f. supp f \<subseteq> A \<and> range f \<subseteq> M \<and> (\<forall>x\<in>A. \<forall>y\<in>A. f (x + y) = f x + f y)}
[PROOF STEP]
by fast


[STATEMENT]
theorem fps_nth_bernoulli'_fps [simp]:
  "fps_nth bernoulli'_fps n = of_real (bernoulli' n) / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli'_fps $ n = of_real (bernoulli' n) / fact n
[PROOF STEP]
by (simp add: bernoulli'_fps_altdef)


[STATEMENT]
lemma det_sq_matrix_eq: "Square_Matrix.det (from_vec A) = det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (from_vec A) = det A
[PROOF STEP]
unfolding Square_Matrix.det.rep_eq Determinants.det_def from_vec.rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p | p permutes UNIV. of_int (sign p) * (\<Prod>i\<in>UNIV. A $ i $ p i)) = (\<Sum>p | p permutes UNIV. of_int (sign p) * (\<Prod>i\<in>UNIV. A $ i $ p i))
[PROOF STEP]
..


[STATEMENT]
lemma abs_if':
  fixes a :: "'a :: {abs_if,ordered_ab_group_add}"
  shows "\<bar>a\<bar> = (if a \<le> 0 then - a else a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a\<bar> = (if a \<le> (0::'a) then - a else a)
[PROOF STEP]
by (simp add: abs_if dual_order.order_iff_strict)


[STATEMENT]
lemma min_int_poly_of_nat [simp]:
  "min_int_poly (of_nat n :: 'a :: {field_char_0, field_gcd}) = [:-of_nat n, 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_int_poly (of_nat n) = [:- int n, 1:]
[PROOF STEP]
using min_int_poly_of_int[of "int n"]
[PROOF STATE]
proof (prove)
using this:
min_int_poly (of_int (int n)) = [:- of_int (int n), 1:]

goal (1 subgoal):
 1. min_int_poly (of_nat n) = [:- int n, 1:]
[PROOF STEP]
by (simp del: min_int_poly_of_int)


[STATEMENT]
lemma prime_factors_of_prime: fixes p :: nat assumes "prime p" shows "prime_factors p = {p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors p = {p}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. prime_factors p = {p}
[PROOF STEP]
by (fact prime_prime_factors)


[STATEMENT]
lemma inverse_pow_minus: assumes "x \<noteq> (0 :: 'a :: field)"
  and "i \<le> n"
  shows "inverse x ^ n * x ^ i = inverse x ^ (n - i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse x ^ n * x ^ i = inverse x ^ (n - i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)
i \<le> n

goal (1 subgoal):
 1. inverse x ^ n * x ^ i = inverse x ^ (n - i)
[PROOF STEP]
by (simp add: field_class.field_divide_inverse power_diff power_inverse)


[STATEMENT]
lemma dist_less_eq_nth_equal: "dist f g < inverse (2 ^ i) \<longleftrightarrow> (\<forall>j \<le> i. f $ j = g $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dist f g < inverse (2 ^ i)) = (\<forall>j\<le>i. f $ j = g $ j)
[PROOF STEP]
using dist_less_imp_nth_equal nth_equal_imp_dist_less
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dist ?f ?g < inverse (2 ^ ?i); ?j \<le> ?i\<rbrakk> \<Longrightarrow> ?f $ ?j = ?g $ ?j
(\<And>j. j \<le> ?i \<Longrightarrow> ?f $ j = ?g $ j) \<Longrightarrow> dist ?f ?g < inverse (2 ^ ?i)

goal (1 subgoal):
 1. (dist f g < inverse (2 ^ i)) = (\<forall>j\<le>i. f $ j = g $ j)
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_exp [tendsto_intros]: "(f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. exp (f x)) \<longlongrightarrow> exp a) F"
  for f:: "_ \<Rightarrow>'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. exp (f x)) \<longlongrightarrow> exp a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_exp])