[STATEMENT]
lemma extended_Gromov_distance_PInf_boundary [simp]:
  assumes "x \<in> Gromov_boundary"
  shows "extended_Gromov_distance x y = \<infinity>" "extended_Gromov_distance y x = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extended_Gromov_distance x y = \<infinity> &&& extended_Gromov_distance y x = \<infinity>
[PROOF STEP]
unfolding extended_Gromov_distance_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x \<in> Gromov_boundary \<or> y \<in> Gromov_boundary then \<infinity> else ereal (dist (inv to_Gromov_completion x) (inv to_Gromov_completion y))) = \<infinity> &&& (if y \<in> Gromov_boundary \<or> x \<in> Gromov_boundary then \<infinity> else ereal (dist (inv to_Gromov_completion y) (inv to_Gromov_completion x))) = \<infinity>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> Gromov_boundary

goal (1 subgoal):
 1. (if x \<in> Gromov_boundary \<or> y \<in> Gromov_boundary then \<infinity> else ereal (dist (inv to_Gromov_completion x) (inv to_Gromov_completion y))) = \<infinity> &&& (if y \<in> Gromov_boundary \<or> x \<in> Gromov_boundary then \<infinity> else ereal (dist (inv to_Gromov_completion y) (inv to_Gromov_completion x))) = \<infinity>
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Group) sol_eq_r:"\<lbrakk>a \<in> carrier G; b \<in> carrier G; x \<in> carrier G;
       x \<cdot> a = b \<rbrakk> \<Longrightarrow>  x = b \<cdot> (\<rho> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; b \<in> carrier G; x \<in> carrier G; x \<cdot> a = b\<rbrakk> \<Longrightarrow> x = b \<cdot> \<rho> a
[PROOF STEP]
apply (frule mult_closed[of "x" "a"], assumption+,
       frule i_closed[of "a"],
       frule r_mult_eqn[of "x \<cdot> a" "b" "\<rho> a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; b \<in> carrier G; x \<in> carrier G; x \<cdot> a = b; x \<cdot> a \<in> carrier G; \<rho> a \<in> carrier G; x \<cdot> a \<cdot> \<rho> a = b \<cdot> \<rho> a\<rbrakk> \<Longrightarrow> x = b \<cdot> \<rho> a
[PROOF STEP]
apply (thin_tac "x \<cdot> a = b",
       simp add:tassoc,
       simp add:r_i r_unit)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma xor_2p_to_bl:
  fixes x::"'a::len word"
  shows "to_bl (x XOR 2^n) =
  (if n < LENGTH('a)
   then take (LENGTH('a)-Suc n) (to_bl x) @ (\<not>rev (to_bl x)!n) # drop (LENGTH('a)-n) (to_bl x)
   else to_bl x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (x XOR 2 ^ n) = (if n < LENGTH('a) then take (LENGTH('a) - Suc n) (to_bl x) @ (\<not> rev (to_bl x) ! n) # drop (LENGTH('a) - n) (to_bl x) else to_bl x)
[PROOF STEP]
apply (auto simp add: to_bl_eq_rev take_map drop_map take_rev drop_rev bit_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < LENGTH('a) \<Longrightarrow> map (bit (x XOR 2 ^ n)) (rev [0..<LENGTH('a)]) = map (bit x) (rev [Suc n..<LENGTH('a)]) @ (\<not> rev (map (bit x) (rev [0..<LENGTH('a)])) ! n) # map (bit x) (rev [0..<n])
[PROOF STEP]
apply (rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n < LENGTH('a) \<Longrightarrow> length (map (bit (x XOR 2 ^ n)) (rev [0..<LENGTH('a)])) = length (map (bit x) (rev [Suc n..<LENGTH('a)]) @ (\<not> rev (map (bit x) (rev [0..<LENGTH('a)])) ! n) # map (bit x) (rev [0..<n]))
 2. \<And>i. \<lbrakk>n < LENGTH('a); i < length (map (bit (x XOR 2 ^ n)) (rev [0..<LENGTH('a)]))\<rbrakk> \<Longrightarrow> map (bit (x XOR 2 ^ n)) (rev [0..<LENGTH('a)]) ! i = (map (bit x) (rev [Suc n..<LENGTH('a)]) @ (\<not> rev (map (bit x) (rev [0..<LENGTH('a)])) ! n) # map (bit x) (rev [0..<n])) ! i
[PROOF STEP]
apply (auto simp add: bit_simps rev_nth nth_append Suc_diff_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "\<bar>x - z\<bar> \<le> e \<and> \<bar>y - z\<bar> \<le> e \<and> 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1 \<longrightarrow> \<bar>(u * x + v * y) - z\<bar> \<le> (e::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x - z\<bar> \<le> e \<and> \<bar>y - z\<bar> \<le> e \<and> 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1 \<longrightarrow> \<bar>u * x + v * y - z\<bar> \<le> e
[PROOF STEP]
by (sos "((((A<0 * R<1) + (((A<=3 * (A<=6 * R<1)) * (R<1 * [1]^2)) + ((A<=1 * (A<=5 * R<1)) * (R<1 * [1]^2))))) & ((((A<0 * A<1) * R<1) + (((A<=3 * (A<=5 * (A<0 * R<1))) * (R<1 * [1]^2)) + ((A<=1 * (A<=4 * (A<0 * R<1))) * (R<1 * [1]^2))))))")


[STATEMENT]
lemma param_HashMap[param]: "(HashMap, HashMap) \<in>
    \<langle>\<langle>\<langle>Rk,Rv\<rangle>prod_rel\<rangle>list_rel\<rangle>array_rel \<rightarrow> nat_rel \<rightarrow> \<langle>Rk,Rv\<rangle>ahm_map_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HashMap, HashMap) \<in> \<langle>\<langle>Rk \<times>\<^sub>r Rv\<rangle>list_rel\<rangle>array_rel \<rightarrow> nat_rel \<rightarrow> \<langle>Rk, Rv\<rangle>ahm_map_rel
[PROOF STEP]
unfolding ahm_map_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HashMap, HashMap) \<in> \<langle>\<langle>Rk \<times>\<^sub>r Rv\<rangle>list_rel\<rangle>array_rel \<rightarrow> nat_rel \<rightarrow> {uu_. \<exists>a a' n n'. uu_ = (HashMap a n, HashMap a' n) \<and> (a, a') \<in> \<langle>\<langle>Rk \<times>\<^sub>r Rv\<rangle>list_rel\<rangle>array_rel \<and> (n, n') \<in> nat_rel}
[PROOF STEP]
by force


[STATEMENT]
lemma Bseq_add:
  fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
  assumes "Bseq f"
  shows "Bseq (\<lambda>x. f x + c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Bseq f
[PROOF STEP]
obtain K where K: "\<And>x. norm (f x) \<le> K"
[PROOF STATE]
proof (prove)
using this:
Bseq f

goal (1 subgoal):
 1. (\<And>K. (\<And>x. norm (f x) \<le> K) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Bseq_def
[PROOF STATE]
proof (prove)
using this:
\<exists>K>0. \<forall>n. norm (f n) \<le> K

goal (1 subgoal):
 1. (\<And>K. (\<And>x. norm (f x) \<le> K) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (f ?x) \<le> K

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
norm (f ?x) \<le> K

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
fix x :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
have "norm (f x + c) \<le> norm (f x) + norm c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x + c) \<le> norm (f x) + norm c
[PROOF STEP]
by (rule norm_triangle_ineq)
[PROOF STATE]
proof (state)
this:
norm (f x + c) \<le> norm (f x) + norm c

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f x + c) \<le> norm (f x) + norm c

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
have "norm (f x) \<le> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) \<le> K
[PROOF STEP]
by (rule K)
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> K

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> x + norm c \<le> y + norm c) \<Longrightarrow> norm (f x + c) \<le> K + norm c
[PROOF STEP]
have "norm (f x + c) \<le> K + norm c"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x + norm c \<le> y + norm c) \<Longrightarrow> norm (f x + c) \<le> K + norm c

goal (1 subgoal):
 1. norm (f x + c) \<le> K + norm c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (f x + c) \<le> K + norm c

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
norm (f ?x2 + c) \<le> K + norm c

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (f ?x2 + c) \<le> K + norm c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (f ?x2 + c) \<le> K + norm c

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c)
[PROOF STEP]
by (rule BseqI')
[PROOF STATE]
proof (state)
this:
Bseq (\<lambda>x. f x + c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder) set_iterator_rev_linord_foldri_correct :
assumes dist_xs: "distinct xs"
assumes sorted_xs: "sorted xs"
shows "set_iterator_rev_linord (foldri xs) (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_rev_linord (foldri xs) (set xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs
sorted xs

goal (1 subgoal):
 1. set_iterator_rev_linord (foldri xs) (set xs)
[PROOF STEP]
by (rule_tac set_iterator_rev_linord_I[of "rev xs"]) (simp_all add: foldri_def)


[STATEMENT]
lemma iIN_cut_ge: "
  [n\<dots>,d] \<down>\<ge> t = (
    if t < n then [n\<dots>,d] else
    if t \<le> n+d then [t\<dots>,n+d-t]
    else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [n\<dots>,d] \<down>\<ge> t = (if t < n then [n\<dots>,d] else if t \<le> n + d then [t\<dots>,n + d - t] else {})
[PROOF STEP]
by (force simp: i_cut_mem_iff iT_iff)


[STATEMENT]
lemma substBinp_empBinp[simp]:
"(empBinp %%[Y / y]_ys) = empBinp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. empBinp %%[Y / y]_ys = empBinp
[PROOF STEP]
unfolding substBinp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. empBinp %%[idEnv [y \<leftarrow> Y]_ys] = empBinp
[PROOF STEP]
by simp


[STATEMENT]
lemma Im_eq_0 [simp]: "Im (\<chi> k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (\<chi> k) = 0
[PROOF STEP]
using real[of k]
[PROOF STATE]
proof (prove)
using this:
\<chi> k \<in> \<real>

goal (1 subgoal):
 1. Im (\<chi> k) = 0
[PROOF STEP]
by (auto elim!: Reals_cases)


[STATEMENT]
lemma ipathI[intro?]: "\<lbrakk>\<And>i. (r i, r (Suc i)) \<in> E\<rbrakk> \<Longrightarrow> ipath E r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. (r i, r (Suc i)) \<in> E) \<Longrightarrow> ipath E r
[PROOF STEP]
unfolding ipath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. (r i, r (Suc i)) \<in> E) \<Longrightarrow> \<forall>i. (r i, r (Suc i)) \<in> E
[PROOF STEP]
by auto


[STATEMENT]
lemma inc_matrix_point_not_in_block_zero: "i < length Vs \<Longrightarrow> j < length Bs \<Longrightarrow> Vs ! i \<notin> Bs ! j \<Longrightarrow>
    (inc_mat_of Vs Bs) $$ (i, j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length Vs; j < length Bs; Vs ! i \<notin> Bs ! j\<rbrakk> \<Longrightarrow> inc_mat_of Vs Bs $$ (i, j) = (0::'b)
[PROOF STEP]
by(simp add: inc_mat_of_def)


[STATEMENT]
lemma Limsup_const:
  assumes ntriv: "\<not> trivial_limit F"
  shows "Limsup F (\<lambda>x. c) = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F (\<lambda>x. c) = c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Limsup F (\<lambda>x. c) = c
[PROOF STEP]
have *: "\<And>P. Ex P \<longleftrightarrow> P \<noteq> (\<lambda>x. False)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. Ex P = (P \<noteq> (\<lambda>x. False))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Ex ?P = (?P \<noteq> (\<lambda>x. False))

goal (1 subgoal):
 1. Limsup F (\<lambda>x. c) = c
[PROOF STEP]
have "\<And>P. eventually P F \<Longrightarrow> (SUP x \<in> {x. P x}. c) = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. eventually P F \<Longrightarrow> (SUP x\<in>{x. P x}. c) = c
[PROOF STEP]
using ntriv
[PROOF STATE]
proof (prove)
using this:
F \<noteq> bot

goal (1 subgoal):
 1. \<And>P. eventually P F \<Longrightarrow> (SUP x\<in>{x. P x}. c) = c
[PROOF STEP]
by (intro SUP_const) (auto simp: eventually_False *)
[PROOF STATE]
proof (state)
this:
eventually ?P1 F \<Longrightarrow> (SUP x\<in>{x. ?P1 x}. c) = c

goal (1 subgoal):
 1. Limsup F (\<lambda>x. c) = c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eventually ?P1 F \<Longrightarrow> (SUP x\<in>{x. ?P1 x}. c) = c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eventually ?P1 F \<Longrightarrow> (SUP x\<in>{x. ?P1 x}. c) = c

goal (1 subgoal):
 1. Limsup F (\<lambda>x. c) = c
[PROOF STEP]
apply (auto simp add: Limsup_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. eventually P F \<Longrightarrow> (SUP x\<in>{x. P x}. c) = c) \<Longrightarrow> (INF x\<in>{P. eventually P F}. c) = c
[PROOF STEP]
apply (rule INF_const)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. eventually P F \<Longrightarrow> (SUP x\<in>{x. P x}. c) = c) \<Longrightarrow> {P. eventually P F} \<noteq> {}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. eventually P F \<Longrightarrow> (SUP x\<in>{x. P x}. c) = c) \<Longrightarrow> \<exists>x. eventually x F
[PROOF STEP]
using eventually_True
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in ?F. True

goal (1 subgoal):
 1. (\<And>P. eventually P F \<Longrightarrow> (SUP x\<in>{x. P x}. c) = c) \<Longrightarrow> \<exists>x. eventually x F
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Limsup F (\<lambda>x. c) = c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma factorization_m_degree: assumes "factorization_m f (c,fs)"
  and 0: "Mp f \<noteq> 0"
  shows "degree_m f = sum_mset (image_mset degree_m fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
note a = assms[unfolded factorization_m_def split]
[PROOF STATE]
proof (state)
this:
f =m Polynomial.smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
Mp f \<noteq> 0

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
hence deg: "degree_m f = degree_m (smult c (prod_mset fs))"
    and fs: "\<And> f. f \<in># fs \<Longrightarrow> monic (Mp f)"
[PROOF STATE]
proof (prove)
using this:
f =m Polynomial.smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
Mp f \<noteq> 0

goal (1 subgoal):
 1. degree_m f = degree_m (Polynomial.smult c (\<Prod>\<^sub># fs)) &&& (\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree_m f = degree_m (Polynomial.smult c (\<Prod>\<^sub># fs))
?f \<in># fs \<Longrightarrow> monic (Mp ?f)

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
define gs where "gs \<equiv> Mp (prod_mset fs)"
[PROOF STATE]
proof (state)
this:
gs \<equiv> Mp (\<Prod>\<^sub># fs)

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
from monic_Mp_prod_mset[OF fs]
[PROOF STATE]
proof (chain)
picking this:
(\<And>f. f \<in># ?fs \<Longrightarrow> f \<in># fs) \<Longrightarrow> monic (Mp (\<Prod>\<^sub># ?fs))
[PROOF STEP]
have mon_gs: "monic gs"
[PROOF STATE]
proof (prove)
using this:
(\<And>f. f \<in># ?fs \<Longrightarrow> f \<in># fs) \<Longrightarrow> monic (Mp (\<Prod>\<^sub># ?fs))

goal (1 subgoal):
 1. monic gs
[PROOF STEP]
unfolding gs_def
[PROOF STATE]
proof (prove)
using this:
(\<And>f. f \<in># ?fs \<Longrightarrow> f \<in># fs) \<Longrightarrow> monic (Mp (\<Prod>\<^sub># ?fs))

goal (1 subgoal):
 1. monic (Mp (\<Prod>\<^sub># fs))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
monic gs

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
have d:"degree (Mp (Polynomial.smult c gs)) = degree gs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree gs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree gs
[PROOF STEP]
have f1: "0 \<noteq> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<noteq> c
[PROOF STEP]
by (metis "0" Mp_0 a(1) smult_eq_0_iff)
[PROOF STATE]
proof (state)
this:
0 \<noteq> c

goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree gs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<noteq> c
[PROOF STEP]
have "M c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<noteq> c

goal (1 subgoal):
 1. M c \<noteq> 0
[PROOF STEP]
by (metis (no_types) "0" assms(1) factorization_m_lead_coeff leading_coeff_0_iff)
[PROOF STATE]
proof (state)
this:
M c \<noteq> 0

goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree gs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M c \<noteq> 0
[PROOF STEP]
show "degree (Mp (Polynomial.smult c gs)) = degree gs"
[PROOF STATE]
proof (prove)
using this:
M c \<noteq> 0

goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree gs
[PROOF STEP]
unfolding monic_degree_m[OF mon_gs,symmetric]
[PROOF STATE]
proof (prove)
using this:
M c \<noteq> 0

goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree_m gs
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
M c \<noteq> 0
0 \<noteq> c

goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree_m gs
[PROOF STEP]
by (metis coeff_smult degree_m_eq degree_smult_eq m1 mon_gs monic_degree_m mult_cancel_left1 poly_mod.M_def)
[PROOF STATE]
proof (state)
this:
degree_m (Polynomial.smult c gs) = degree gs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree_m (Polynomial.smult c gs) = degree gs

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
note deg
[PROOF STATE]
proof (state)
this:
degree_m f = degree_m (Polynomial.smult c (\<Prod>\<^sub># fs))

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree_m f = degree_m (Polynomial.smult c (\<Prod>\<^sub># fs))

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
have "degree_m (smult c (prod_mset fs)) = degree_m (smult c gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (Polynomial.smult c (\<Prod>\<^sub># fs)) = degree_m (Polynomial.smult c gs)
[PROOF STEP]
unfolding gs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (Polynomial.smult c (\<Prod>\<^sub># fs)) = degree_m (Polynomial.smult c (Mp (\<Prod>\<^sub># fs)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree_m (Polynomial.smult c (\<Prod>\<^sub># fs)) = degree_m (Polynomial.smult c gs)

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree_m (Polynomial.smult c (\<Prod>\<^sub># fs)) = degree_m (Polynomial.smult c gs)

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
have "\<dots> = degree gs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree gs
[PROOF STEP]
using d
[PROOF STATE]
proof (prove)
using this:
degree_m (Polynomial.smult c gs) = degree gs

goal (1 subgoal):
 1. degree_m (Polynomial.smult c gs) = degree gs
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree_m (Polynomial.smult c gs) = degree gs

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree_m (Polynomial.smult c gs) = degree gs

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
have "\<dots> = sum_mset (image_mset degree_m fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree gs = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
unfolding gs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
using fs
[PROOF STATE]
proof (prove)
using this:
?f \<in># fs \<Longrightarrow> monic (Mp ?f)

goal (1 subgoal):
 1. degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
proof (induct fs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
case (add f fs)
[PROOF STATE]
proof (state)
this:
(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs)
?f \<in># add_mset f fs \<Longrightarrow> monic (Mp ?f)

goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
have mon: "monic (Mp f)" "monic (Mp (prod_mset fs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (Mp f) &&& monic (Mp (\<Prod>\<^sub># fs))
[PROOF STEP]
using monic_Mp_prod_mset[of fs]
      add(2)
[PROOF STATE]
proof (prove)
using this:
(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> monic (Mp (\<Prod>\<^sub># fs))
?f \<in># add_mset f fs \<Longrightarrow> monic (Mp ?f)

goal (1 subgoal):
 1. monic (Mp f) &&& monic (Mp (\<Prod>\<^sub># fs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
monic (Mp f)
monic (Mp (\<Prod>\<^sub># fs))

goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
have "degree (Mp (prod_mset (add_mset f fs))) = degree (Mp (Mp f * Mp (prod_mset fs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (\<Prod>\<^sub># (add_mset f fs)) = degree_m (Mp f * Mp (\<Prod>\<^sub># fs))
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
degree_m (\<Prod>\<^sub># (add_mset f fs)) = degree_m (Mp f * Mp (\<Prod>\<^sub># fs))

goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree_m (\<Prod>\<^sub># (add_mset f fs)) = degree_m (Mp f * Mp (\<Prod>\<^sub># fs))

goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
have "\<dots> = degree (Mp f) + degree (Mp (prod_mset fs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (Mp f * Mp (\<Prod>\<^sub># fs)) = degree_m f + degree_m (\<Prod>\<^sub># fs)
[PROOF STEP]
by (rule degree_Mp_mult_monic[OF mon])
[PROOF STATE]
proof (state)
this:
degree_m (Mp f * Mp (\<Prod>\<^sub># fs)) = degree_m f + degree_m (\<Prod>\<^sub># fs)

goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree_m (Mp f * Mp (\<Prod>\<^sub># fs)) = degree_m f + degree_m (\<Prod>\<^sub># fs)

goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
have "degree (Mp (prod_mset fs)) = sum_mset (image_mset degree_m fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
by (rule add(1), insert add(2), auto)
[PROOF STATE]
proof (state)
this:
degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs)

goal (2 subgoals):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
 2. \<And>x fs. \<lbrakk>(\<And>f. f \<in># fs \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># fs) = \<Sum>\<^sub># (image_mset degree_m fs); \<And>f. f \<in># add_mset x fs \<Longrightarrow> monic (Mp f)\<rbrakk> \<Longrightarrow> degree_m (\<Prod>\<^sub># (add_mset x fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset x fs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree_m (\<Prod>\<^sub># (add_mset f fs)) = degree_m f + \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
degree_m (\<Prod>\<^sub># (add_mset f fs)) = degree_m f + \<Sum>\<^sub># (image_mset degree_m fs)

goal (1 subgoal):
 1. degree_m (\<Prod>\<^sub># (add_mset f fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset f fs))
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
degree_m (\<Prod>\<^sub># (add_mset f fs)) = \<Sum>\<^sub># (image_mset degree_m (add_mset f fs))

goal (1 subgoal):
 1. (\<And>f. f \<in># {#} \<Longrightarrow> monic (Mp f)) \<Longrightarrow> degree_m (\<Prod>\<^sub># {#}) = \<Sum>\<^sub># (image_mset degree_m {#})
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
degree gs = \<Sum>\<^sub># (image_mset degree_m fs)

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)

goal (1 subgoal):
 1. degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree_m f = \<Sum>\<^sub># (image_mset degree_m fs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_minus_countable:
  fixes S A :: "real set"
  assumes "countable A" "S \<noteq> {}" "open S"
  shows "\<exists>x\<in>S. x \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
obtain x where "x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>S \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
obtain e where "0 < e" "{y. dist y x < e} \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; {y. dist y x < e} \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>open S\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> S
open S

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; {y. dist y x < e} \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: open_dist subset_eq)
[PROOF STATE]
proof (state)
this:
0 < e
{y. dist y x < e} \<subseteq> S

goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < e
{y. dist y x < e} \<subseteq> S

goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
have "{y. dist y x < e} = {x - e <..< x + e}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. dist y x < e} = {x - e<..<x + e}
[PROOF STEP]
by (auto simp: dist_real_def)
[PROOF STATE]
proof (state)
this:
{y. dist y x < e} = {x - e<..<x + e}

goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < e
{y. dist y x < e} \<subseteq> S
{y. dist y x < e} = {x - e<..<x + e}
[PROOF STEP]
have "uncountable (S - A)"
[PROOF STATE]
proof (prove)
using this:
0 < e
{y. dist y x < e} \<subseteq> S
{y. dist y x < e} = {x - e<..<x + e}

goal (1 subgoal):
 1. uncountable (S - A)
[PROOF STEP]
using uncountable_open_interval[of "x - e" "x + e"] \<open>countable A\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e
{y. dist y x < e} \<subseteq> S
{y. dist y x < e} = {x - e<..<x + e}
uncountable {x - e<..<x + e} = (x - e < x + e)
countable A

goal (1 subgoal):
 1. uncountable (S - A)
[PROOF STEP]
by (intro uncountable_minus_countable) (auto dest: countable_subset)
[PROOF STATE]
proof (state)
this:
uncountable (S - A)

goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
uncountable (S - A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uncountable (S - A)

goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
unfolding uncountable_def
[PROOF STATE]
proof (prove)
using this:
S - A \<noteq> {} \<and> (\<nexists>f. range f = S - A)

goal (1 subgoal):
 1. \<exists>x\<in>S. x \<notin> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>S. x \<notin> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_countable_complex:
  fixes f :: \<open>'a \<Rightarrow> complex\<close>
  assumes \<open>f summable_on A\<close>
  shows \<open>countable {x\<in>A. f x \<noteq> 0}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable {x \<in> A. f x \<noteq> 0}
[PROOF STEP]
using abs_summable_countable assms summable_on_iff_abs_summable_on_complex
[PROOF STATE]
proof (prove)
using this:
?f abs_summable_on ?A \<Longrightarrow> countable {x \<in> ?A. ?f x \<noteq> (0::?'b)}
f summable_on A
(?f summable_on ?A) = (?f abs_summable_on ?A)

goal (1 subgoal):
 1. countable {x \<in> A. f x \<noteq> 0}
[PROOF STEP]
by blast


[STATEMENT]
lemma edge_density_eq0:
  assumes "all_edges_between A B = {}" and "X \<subseteq> A" "Y \<subseteq> B"
  shows "edge_density X Y  = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge_density X Y = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. edge_density X Y = 0
[PROOF STEP]
have "all_edges_between X Y = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between X Y = {}
[PROOF STEP]
by (metis all_edges_between_mono1 all_edges_between_mono2 assms subset_empty)
[PROOF STATE]
proof (state)
this:
all_edges_between X Y = {}

goal (1 subgoal):
 1. edge_density X Y = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
all_edges_between X Y = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
all_edges_between X Y = {}

goal (1 subgoal):
 1. edge_density X Y = 0
[PROOF STEP]
by (auto simp: edge_density_def)
[PROOF STATE]
proof (state)
this:
edge_density X Y = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_left_isotone:
  "x \<le> y \<Longrightarrow> x * z \<le> y * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x * z \<le> y * z
[PROOF STEP]
using mult_right_dist_sup sup_right_divisibility
[PROOF STATE]
proof (prove)
using this:
(?x \<squnion> ?y) * ?z = ?x * ?z \<squnion> ?y * ?z
(?x \<le> ?y) = (\<exists>z. z \<squnion> ?x = ?y)

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x * z \<le> y * z
[PROOF STEP]
by auto


[STATEMENT]
lemma min_height_size1_if_incomplete:
  "\<not> complete t \<Longrightarrow> 2 ^ min_height t < size1 t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> complete t \<Longrightarrow> 2 ^ min_height t < size1 t
[PROOF STEP]
proof(induction t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> complete \<langle>\<rangle> \<Longrightarrow> 2 ^ min_height \<langle>\<rangle> < size1 \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
case Leaf
[PROOF STATE]
proof (state)
this:
\<not> complete \<langle>\<rangle>

goal (2 subgoals):
 1. \<not> complete \<langle>\<rangle> \<Longrightarrow> 2 ^ min_height \<langle>\<rangle> < size1 \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<not> complete \<langle>\<rangle>

goal (1 subgoal):
 1. 2 ^ min_height \<langle>\<rangle> < size1 \<langle>\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ min_height \<langle>\<rangle> < size1 \<langle>\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
case (Node l x r)
[PROOF STATE]
proof (state)
this:
\<not> complete l \<Longrightarrow> 2 ^ min_height l < size1 l
\<not> complete r \<Longrightarrow> 2 ^ min_height r < size1 r
\<not> complete \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have 1: ?case if h: "min_height l < min_height r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
using h min_height_size1[of l] min_height_size1[of r] power_strict_increasing[OF h, of "2::nat"]
[PROOF STATE]
proof (prove)
using this:
min_height l < min_height r
2 ^ min_height l \<le> size1 l
2 ^ min_height r \<le> size1 r
1 < 2 \<Longrightarrow> 2 ^ min_height l < 2 ^ min_height r

goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
by(auto simp: max_def simp del: power_strict_increasing_iff)
[PROOF STATE]
proof (state)
this:
min_height l < min_height r \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have 2: ?case if h: "min_height l > min_height r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
using h min_height_size1[of l] min_height_size1[of r] power_strict_increasing[OF h, of "2::nat"]
[PROOF STATE]
proof (prove)
using this:
min_height r < min_height l
2 ^ min_height l \<le> size1 l
2 ^ min_height r \<le> size1 r
1 < 2 \<Longrightarrow> 2 ^ min_height r < 2 ^ min_height l

goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
by(auto simp: max_def simp del: power_strict_increasing_iff)
[PROOF STATE]
proof (state)
this:
min_height r < min_height l \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have 3: ?case if h: "min_height l = min_height r" and c: "\<not> complete l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
using h min_height_size1[of r] Node.IH(1)[OF c]
[PROOF STATE]
proof (prove)
using this:
min_height l = min_height r
2 ^ min_height r \<le> size1 r
2 ^ min_height l < size1 l

goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
by(simp add: complete_iff_min_height)
[PROOF STATE]
proof (state)
this:
\<lbrakk>min_height l = min_height r; \<not> complete l\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have 4: ?case if h: "min_height l = min_height r" and c: "\<not> complete r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
using h min_height_size1[of l] Node.IH(2)[OF c]
[PROOF STATE]
proof (prove)
using this:
min_height l = min_height r
2 ^ min_height l \<le> size1 l
2 ^ min_height r < size1 r

goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
by(simp add: complete_iff_min_height)
[PROOF STATE]
proof (state)
this:
\<lbrakk>min_height l = min_height r; \<not> complete r\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<not> complete t1 \<Longrightarrow> 2 ^ min_height t1 < size1 t1; \<not> complete t2 \<Longrightarrow> 2 ^ min_height t2 < size1 t2; \<not> complete \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> < size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
from 1 2 3 4 Node.prems
[PROOF STATE]
proof (chain)
picking this:
min_height l < min_height r \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
min_height r < min_height l \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
\<lbrakk>min_height l = min_height r; \<not> complete l\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
\<lbrakk>min_height l = min_height r; \<not> complete r\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
\<not> complete \<langle>l, x, r\<rangle>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
min_height l < min_height r \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
min_height r < min_height l \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
\<lbrakk>min_height l = min_height r; \<not> complete l\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
\<lbrakk>min_height l = min_height r; \<not> complete r\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
\<not> complete \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>
[PROOF STEP]
by (fastforce simp: complete_iff_min_height[THEN iffD1])
[PROOF STATE]
proof (state)
this:
2 ^ min_height \<langle>l, x, r\<rangle> < size1 \<langle>l, x, r\<rangle>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem LT22: "\<turnstile> (F \<leadsto> (G \<or> H)) \<longrightarrow> \<box>\<not>G \<longrightarrow> (F \<leadsto> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (F \<leadsto> G \<or> H) \<longrightarrow> \<box>\<not> G \<longrightarrow> F \<leadsto> H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> (F \<leadsto> G \<or> H) \<longrightarrow> \<box>\<not> G \<longrightarrow> F \<leadsto> H
[PROOF STEP]
have "\<turnstile> \<box>\<not>G \<longrightarrow> (G \<leadsto> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>\<not> G \<longrightarrow> G \<leadsto> H
[PROOF STEP]
unfolding leadsto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>\<not> G \<longrightarrow> \<box>(G \<longrightarrow> \<diamond>H)
[PROOF STEP]
by (rule STL4) auto
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>\<not> G \<longrightarrow> G \<leadsto> H

goal (1 subgoal):
 1. \<turnstile> (F \<leadsto> G \<or> H) \<longrightarrow> \<box>\<not> G \<longrightarrow> F \<leadsto> H
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>\<not> G \<longrightarrow> G \<leadsto> H

goal (1 subgoal):
 1. \<turnstile> (F \<leadsto> G \<or> H) \<longrightarrow> \<box>\<not> G \<longrightarrow> F \<leadsto> H
[PROOF STEP]
by (force elim: LT20[unlift_rule])
[PROOF STATE]
proof (state)
this:
\<turnstile> (F \<leadsto> G \<or> H) \<longrightarrow> \<box>\<not> G \<longrightarrow> F \<leadsto> H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power_up_nonneg_iff[simp]:
  "power_up prec b n \<ge> 0 \<longleftrightarrow> even n \<or> b \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> power_up prec b n) = (even n \<or> 0 \<le> b)
[PROOF STEP]
proof (induction n arbitrary: b rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x b. (\<And>y b. y < x \<Longrightarrow> (0 \<le> power_up prec b y) = (even y \<or> 0 \<le> b)) \<Longrightarrow> (0 \<le> power_up prec b x) = (even x \<or> 0 \<le> b)
[PROOF STEP]
case (less x)
[PROOF STATE]
proof (state)
this:
?y < x \<Longrightarrow> (0 \<le> power_up prec ?b ?y) = (even ?y \<or> 0 \<le> ?b)

goal (1 subgoal):
 1. \<And>x b. (\<And>y b. y < x \<Longrightarrow> (0 \<le> power_up prec b y) = (even y \<or> 0 \<le> b)) \<Longrightarrow> (0 \<le> power_up prec b x) = (even x \<or> 0 \<le> b)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> power_up prec b x) = (even x \<or> 0 \<le> b)
[PROOF STEP]
using less(1)[of "x - 1" b] power_up_simp[of _ _ "x - 1"]
[PROOF STATE]
proof (prove)
using this:
x - 1 < x \<Longrightarrow> (0 \<le> power_up prec b (x - 1)) = (even (x - 1) \<or> 0 \<le> b)
power_up ?p ?x (Suc (x - 1)) = (if odd (x - 1) then truncate_up ?p ((power_up ?p ?x (Suc (x - 1) div 2))\<^sup>2) else truncate_up ?p (?x * power_up ?p ?x (x - 1)))

goal (1 subgoal):
 1. (0 \<le> power_up prec b x) = (even x \<or> 0 \<le> b)
[PROOF STEP]
by (cases x) (auto simp: algebra_split_simps zero_le_mult_iff)
[PROOF STATE]
proof (state)
this:
(0 \<le> power_up prec b x) = (even x \<or> 0 \<le> b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma atms_of_union_mset[simp]: "atms_of (A \<union># B) = atms_of A \<union> atms_of B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atms_of (A \<union># B) = atms_of A \<union> atms_of B
[PROOF STEP]
unfolding atms_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atm_of ` set_mset (A \<union># B) = atm_of ` set_mset A \<union> atm_of ` set_mset B
[PROOF STEP]
by auto


[STATEMENT]
lemma pth_6:
  fixes x :: "'a::real_normed_vector"
  shows "scaleR c (x + y) \<equiv> scaleR c x + scaleR c y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c *\<^sub>R (x + y) \<equiv> c *\<^sub>R x + c *\<^sub>R y
[PROOF STEP]
by (simp add: scaleR_right_distrib)


[STATEMENT]
lemma program_equalityI:
     "[| Init F = Init G; Acts F = Acts G; AllowedActs F = AllowedActs G |]
      ==> F = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Init F = Init G; Acts F = Acts G; AllowedActs F = AllowedActs G\<rbrakk> \<Longrightarrow> F = G
[PROOF STEP]
apply (rule_tac t = F in surjective_mk_program [THEN subst])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Init F = Init G; Acts F = Acts G; AllowedActs F = AllowedActs G\<rbrakk> \<Longrightarrow> mk_program (Init F, Acts F, AllowedActs F) = G
[PROOF STEP]
apply (rule_tac t = G in surjective_mk_program [THEN subst], simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma transpose_uminus[simp]: "transpose (- A) = - transpose A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.transpose (- A) = - Square_Matrix.transpose A
[PROOF STEP]
by transfer (simp add: fun_eq_iff)


[STATEMENT]
lemma summable_of_complex_iff:
  "summable (\<lambda>x. of_complex (f x) :: 'a :: {complex_normed_algebra_1,complex_inner}) \<longleftrightarrow> summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>x. of_complex (f x)) = summable f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>x. of_complex (f x)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
assume *: "summable (\<lambda>x. of_complex (f x) :: 'a)"
[PROOF STATE]
proof (state)
this:
summable (\<lambda>x. of_complex (f x))

goal (2 subgoals):
 1. summable (\<lambda>x. of_complex (f x)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
have "bounded_clinear (cinner (1::'a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear (cinner (1::'a))
[PROOF STEP]
by (rule bounded_clinear_cinner_right)
[PROOF STATE]
proof (state)
this:
bounded_clinear (cinner (1::'a))

goal (2 subgoals):
 1. summable (\<lambda>x. of_complex (f x)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_clinear (cinner (1::'a))
[PROOF STEP]
interpret bounded_linear "\<lambda>x::'a. cinner 1 x"
[PROOF STATE]
proof (prove)
using this:
bounded_clinear (cinner (1::'a))

goal (1 subgoal):
 1. bounded_linear (cinner (1::'a))
[PROOF STEP]
by (rule bounded_clinear.bounded_linear)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>x. of_complex (f x)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
from summable [OF *]
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. cinner (1::'a) (of_complex (f n)))
[PROOF STEP]
show "summable f"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. cinner (1::'a) (of_complex (f n)))

goal (1 subgoal):
 1. summable f
[PROOF STEP]
apply (subst (asm) cinner_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. cnj (cinner (of_complex (f n)) (1::'a))) \<Longrightarrow> summable f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable f

goal (1 subgoal):
 1. summable f \<Longrightarrow> summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable f \<Longrightarrow> summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
assume sum: "summable f"
[PROOF STATE]
proof (state)
this:
summable f

goal (1 subgoal):
 1. summable f \<Longrightarrow> summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
thus "summable (\<lambda>x. of_complex (f x) :: 'a)"
[PROOF STATE]
proof (prove)
using this:
summable f

goal (1 subgoal):
 1. summable (\<lambda>x. of_complex (f x))
[PROOF STEP]
by (rule summable_of_complex)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>x. of_complex (f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma swap_inverse: "swap\<^sub>C \<odot> swap\<^sub>C = 1\<^sub>C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swap\<^sub>C \<odot> swap\<^sub>C = 1\<^sub>C
[PROOF STEP]
unfolding swap\<^sub>C_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_converter swap_sum swap_sum id id 1\<^sub>C \<odot> map_converter swap_sum swap_sum id id 1\<^sub>C = 1\<^sub>C
[PROOF STEP]
apply(simp add: comp_converter_map1_out comp_converter_map_converter2 comp_converter_id_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_converter swap_sum swap_sum swap_sum swap_sum 1\<^sub>C = 1\<^sub>C
[PROOF STEP]
apply(subst map_converter_id_move_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_converter id id (swap_sum \<circ> swap_sum) (swap_sum \<circ> swap_sum) 1\<^sub>C = 1\<^sub>C
[PROOF STEP]
apply(simp add: o_def id_def[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ccsubspace_leI_unit:
  fixes A B :: \<open>_ :: complex_normed_vector ccsubspace\<close>
  assumes "\<And>\<psi>. norm \<psi> = 1 \<Longrightarrow> \<psi> \<in> space_as_set A \<Longrightarrow> \<psi> \<in> space_as_set B"
  shows "A \<le> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<le> B
[PROOF STEP]
proof (rule ccsubspace_leI, rule subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> space_as_set A \<Longrightarrow> x \<in> space_as_set B
[PROOF STEP]
fix \<psi>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> space_as_set A \<Longrightarrow> x \<in> space_as_set B
[PROOF STEP]
assume \<psi>A: \<open>\<psi> \<in> space_as_set A\<close>
[PROOF STATE]
proof (state)
this:
\<psi> \<in> space_as_set A

goal (1 subgoal):
 1. \<And>x. x \<in> space_as_set A \<Longrightarrow> x \<in> space_as_set B
[PROOF STEP]
show \<open>\<psi> \<in> space_as_set B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> \<in> space_as_set B
[PROOF STEP]
apply (cases \<open>\<psi> = 0\<close>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<psi> = (0::'c) \<Longrightarrow> \<psi> \<in> space_as_set B
 2. \<psi> \<noteq> (0::'c) \<Longrightarrow> \<psi> \<in> space_as_set B
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> \<noteq> (0::'c) \<Longrightarrow> \<psi> \<in> space_as_set B
[PROOF STEP]
using assms[of \<open>sgn \<psi>\<close>] \<psi>A sgn_in_spaceD sgn_in_spaceI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>norm (sgn \<psi>) = 1; sgn \<psi> \<in> space_as_set A\<rbrakk> \<Longrightarrow> sgn \<psi> \<in> space_as_set B
\<psi> \<in> space_as_set A
\<lbrakk>sgn ?\<psi> \<in> space_as_set ?A; ?\<psi> \<noteq> (0::?'b)\<rbrakk> \<Longrightarrow> ?\<psi> \<in> space_as_set ?A
?\<psi> \<in> space_as_set ?A \<Longrightarrow> sgn ?\<psi> \<in> space_as_set ?A

goal (1 subgoal):
 1. \<psi> \<noteq> (0::'c) \<Longrightarrow> \<psi> \<in> space_as_set B
[PROOF STEP]
by (auto simp: norm_sgn)
[PROOF STATE]
proof (state)
this:
\<psi> \<in> space_as_set B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in information_space) conditional_entropy_nonneg:
  assumes X: "simple_function M X" and Y: "simple_function M Y" shows "0 \<le> \<H>(X | Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<H>(X | Y)
[PROOF STEP]
using conditional_mutual_information_eq_conditional_entropy[OF X Y] conditional_mutual_information_nonneg[OF X X Y]
[PROOF STATE]
proof (prove)
using this:
\<I>( X ; X | Y ) = \<H>(X | Y)
0 \<le> \<I>( X ; X | Y )

goal (1 subgoal):
 1. 0 \<le> \<H>(X | Y)
[PROOF STEP]
by simp


[STATEMENT]
lemma square_rat_code[code abstract]: "quotient_of (square_rat x) = (case quotient_of x of (n,d)
  \<Rightarrow> (n * n, d * d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_of (square_rat x) = (case quotient_of x of (n, d) \<Rightarrow> (n * n, d * d))
[PROOF STEP]
using quotient_of_square[of x]
[PROOF STATE]
proof (prove)
using this:
quotient_of x = (?a, ?b) \<Longrightarrow> quotient_of (x * x) = (?a * ?a, ?b * ?b)

goal (1 subgoal):
 1. quotient_of (square_rat x) = (case quotient_of x of (n, d) \<Rightarrow> (n * n, d * d))
[PROOF STEP]
unfolding square_rat_def
[PROOF STATE]
proof (prove)
using this:
quotient_of x = (?a, ?b) \<Longrightarrow> quotient_of (x * x) = (?a * ?a, ?b * ?b)

goal (1 subgoal):
 1. quotient_of (x * x) = (case quotient_of x of (n, d) \<Rightarrow> (n * n, d * d))
[PROOF STEP]
by (cases "quotient_of x", auto)


[STATEMENT]
lemma (in Module) submodule_whole:"submodule R M (carrier M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. submodule R M (carrier M)
[PROOF STEP]
apply (simp add:submodule_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M +> carrier M \<and> (\<forall>a m. a \<in> carrier R \<and> m \<in> carrier M \<longrightarrow> a \<cdot>\<^sub>s m \<in> carrier M)
[PROOF STEP]
apply (simp add:asubg_whole)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a m. a \<in> carrier R \<and> m \<in> carrier M \<longrightarrow> a \<cdot>\<^sub>s m \<in> carrier M
[PROOF STEP]
apply ((rule allI)+, rule impI, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>a \<in> carrier R; m \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s m \<in> carrier M
[PROOF STEP]
apply (simp add:sc_mem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prv_scnj_imp:
  assumes "\<chi> \<in> fmla" and "F \<subseteq> fmla" "finite F"
    and "\<phi> \<in> F" and "prv (imp \<phi> \<chi>)"
  shows "prv (imp (scnj F) \<chi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (scnj F) \<chi>)
[PROOF STEP]
unfolding scnj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (lcnj (asList F)) \<chi>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<chi> \<in> fmla
F \<subseteq> fmla
finite F
\<phi> \<in> F
prv (imp \<phi> \<chi>)

goal (1 subgoal):
 1. prv (imp (lcnj (asList F)) \<chi>)
[PROOF STEP]
by (intro prv_lcnj_imp) auto


[STATEMENT]
lemma sum_2_elems:
  assumes "I = {a,b}"
    and "a\<noteq> b"
  shows "(\<Sum>a\<in>I. f a) = f a + f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
have "(\<Sum>a\<in>I. f a) = (\<Sum>a\<in>(insert a {b}). f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f I = sum f {a, b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I = {a, b}
a \<noteq> b

goal (1 subgoal):
 1. sum f I = sum f {a, b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f I = sum f {a, b}

goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f I = sum f {a, b}

goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
have "... = f a + (\<Sum>a\<in>{b}. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {a, b} = f a + sum f {b}
[PROOF STEP]
proof (rule sum.insert)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {b}
 2. a \<notin> {b}
[PROOF STEP]
show "finite {b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {b}

goal (1 subgoal):
 1. a \<notin> {b}
[PROOF STEP]
show "a\<notin> {b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> {b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I = {a, b}
a \<noteq> b

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum f {a, b} = f a + sum f {b}

goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {a, b} = f a + sum f {b}

goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
have "... = f a + f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a + sum f {b} = f a + f b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f a + sum f {b} = f a + f b

goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f I = f a + f b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f I = f a + f b

goal (1 subgoal):
 1. sum f I = f a + f b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f I = f a + f b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma acyclic_5b_5d:
  "acyclic_5b x \<longleftrightarrow> acyclic_5d x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acyclic_5b x = acyclic_5d x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. acyclic_5b x = acyclic_5d x
[PROOF STEP]
have "acyclic_5b x \<longleftrightarrow> (\<forall>y . y \<le> x \<longrightarrow> (y\<^sup>+ \<squnion> 1) \<sqinter> (x \<sqinter> -y)\<^sup>+ \<le> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acyclic_5b x = (\<forall>y\<le>x. coreflexive ((y\<^sup>+ \<squnion> (1::'a)) \<sqinter> (x \<sqinter> - y)\<^sup>+))
[PROOF STEP]
by (simp add: acyclic_5b_def star_left_unfold_equal sup_commute)
[PROOF STATE]
proof (state)
this:
acyclic_5b x = (\<forall>y\<le>x. coreflexive ((y\<^sup>+ \<squnion> (1::'a)) \<sqinter> (x \<sqinter> - y)\<^sup>+))

goal (1 subgoal):
 1. acyclic_5b x = acyclic_5d x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
acyclic_5b x = (\<forall>y\<le>x. coreflexive ((y\<^sup>+ \<squnion> (1::'a)) \<sqinter> (x \<sqinter> - y)\<^sup>+))

goal (1 subgoal):
 1. acyclic_5b x = acyclic_5d x
[PROOF STEP]
have "... \<longleftrightarrow> acyclic_5d x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y\<le>x. coreflexive ((y\<^sup>+ \<squnion> (1::'a)) \<sqinter> (x \<sqinter> - y)\<^sup>+)) = acyclic_5d x
[PROOF STEP]
by (simp add: inf_sup_distrib2 acyclic_5d_def)
[PROOF STATE]
proof (state)
this:
(\<forall>y\<le>x. coreflexive ((y\<^sup>+ \<squnion> (1::'a)) \<sqinter> (x \<sqinter> - y)\<^sup>+)) = acyclic_5d x

goal (1 subgoal):
 1. acyclic_5b x = acyclic_5d x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
acyclic_5b x = acyclic_5d x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
acyclic_5b x = acyclic_5d x

goal (1 subgoal):
 1. acyclic_5b x = acyclic_5d x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
acyclic_5b x = acyclic_5d x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transfer_Ifun: "f \<equiv> star_n F \<Longrightarrow> x \<equiv> star_n X \<Longrightarrow> f \<star> x \<equiv> star_n (\<lambda>n. F n (X n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<equiv> star_n F; x \<equiv> star_n X\<rbrakk> \<Longrightarrow> f \<star> x \<equiv> star_n (\<lambda>n. F n (X n))
[PROOF STEP]
by (simp only: Ifun_star_n)


[STATEMENT]
lemma unique_poincare_line:
  assumes in_disc: "u \<noteq> v" "u \<in> unit_disc" "v \<in> unit_disc"
  assumes on_l: "u \<in> circline_set l" "v \<in> circline_set l" "is_poincare_line l"
  shows "l = poincare_line u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = poincare_line u v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc
u \<in> circline_set l
v \<in> circline_set l
is_poincare_line l

goal (1 subgoal):
 1. l = poincare_line u v
[PROOF STEP]
using unique_is_poincare_line[of u v l "poincare_line u v"]
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc
u \<in> circline_set l
v \<in> circline_set l
is_poincare_line l
\<lbrakk>u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; is_poincare_line l; is_poincare_line (poincare_line u v); {u, v} \<subseteq> circline_set l \<inter> circline_set (poincare_line u v)\<rbrakk> \<Longrightarrow> l = poincare_line u v

goal (1 subgoal):
 1. l = poincare_line u v
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc
u \<in> Collect (on_circline l)
v \<in> Collect (on_circline l)
is_poincare_line l
\<lbrakk>u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; is_poincare_line l; is_poincare_line (poincare_line u v); {u, v} \<subseteq> Collect (on_circline l) \<inter> Collect (on_circline (poincare_line u v))\<rbrakk> \<Longrightarrow> l = poincare_line u v

goal (1 subgoal):
 1. l = poincare_line u v
[PROOF STEP]
by auto


[STATEMENT]
lemma (in comm_ring_hom) similar_mat_hom:
  "similar_mat A B \<Longrightarrow> similar_mat (mat\<^sub>h A) (mat\<^sub>h B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat A B \<Longrightarrow> similar_mat (mat\<^sub>h A) (mat\<^sub>h B)
[PROOF STEP]
using similar_mat_wit_hom[of A B C D for C D]
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B ?C2 ?D2 \<Longrightarrow> similar_mat_wit (mat\<^sub>h A) (mat\<^sub>h B) (mat\<^sub>h ?C2) (mat\<^sub>h ?D2)

goal (1 subgoal):
 1. similar_mat A B \<Longrightarrow> similar_mat (mat\<^sub>h A) (mat\<^sub>h B)
[PROOF STEP]
by (smt similar_mat_def)


[STATEMENT]
lemma prime_elem_imp_irreducible:
  assumes "prime_elem p"
  shows   "irreducible p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible p
[PROOF STEP]
proof (rule irreducibleI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
 3. \<And>a b. p = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
 3. \<And>a b. p = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
assume p_eq: "p = a * b"
[PROOF STATE]
proof (state)
this:
p = a * b

goal (3 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
 3. \<And>a b. p = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
prime_elem p
p = a * b
[PROOF STEP]
have nz: "a \<noteq> 0" "b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
prime_elem p
p = a * b

goal (1 subgoal):
 1. a \<noteq> (0::'a) &&& b \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)
b \<noteq> (0::'a)

goal (3 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
 3. \<And>a b. p = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
from p_eq
[PROOF STATE]
proof (chain)
picking this:
p = a * b
[PROOF STEP]
have "p dvd a * b"
[PROOF STATE]
proof (prove)
using this:
p = a * b

goal (1 subgoal):
 1. p dvd a * b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p dvd a * b

goal (3 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
 3. \<And>a b. p = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
with \<open>prime_elem p\<close>
[PROOF STATE]
proof (chain)
picking this:
prime_elem p
p dvd a * b
[PROOF STEP]
have "p dvd a \<or> p dvd b"
[PROOF STATE]
proof (prove)
using this:
prime_elem p
p dvd a * b

goal (1 subgoal):
 1. p dvd a \<or> p dvd b
[PROOF STEP]
by (rule prime_elem_dvd_multD)
[PROOF STATE]
proof (state)
this:
p dvd a \<or> p dvd b

goal (3 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
 3. \<And>a b. p = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
with \<open>p = a * b\<close>
[PROOF STATE]
proof (chain)
picking this:
p = a * b
p dvd a \<or> p dvd b
[PROOF STEP]
have "a * b dvd 1 * b \<or> a * b dvd a * 1"
[PROOF STATE]
proof (prove)
using this:
p = a * b
p dvd a \<or> p dvd b

goal (1 subgoal):
 1. a * b dvd (1::'a) * b \<or> a * b dvd a * (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * b dvd (1::'a) * b \<or> a * b dvd a * (1::'a)

goal (3 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
 3. \<And>a b. p = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
thus "a dvd 1 \<or> b dvd 1"
[PROOF STATE]
proof (prove)
using this:
a * b dvd (1::'a) * b \<or> a * b dvd a * (1::'a)

goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
by (simp only: dvd_times_left_cancel_iff[OF nz(1)] dvd_times_right_cancel_iff[OF nz(2)])
[PROOF STATE]
proof (state)
this:
is_unit a \<or> is_unit b

goal (2 subgoals):
 1. p \<noteq> (0::'a)
 2. \<not> is_unit p
[PROOF STEP]
qed (insert assms, simp_all add: prime_elem_def)


[STATEMENT]
lemma index_list_indices:
"k < n \<Longrightarrow> (index_list n)!k = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < n \<Longrightarrow> index_list n ! k = k
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. k < 0 \<Longrightarrow> index_list 0 ! k = k
 2. \<And>n. \<lbrakk>k < n \<Longrightarrow> index_list n ! k = k; k < Suc n\<rbrakk> \<Longrightarrow> index_list (Suc n) ! k = k
[PROOF STEP]
apply (simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>k < n \<Longrightarrow> index_list n ! k = k; k < Suc n\<rbrakk> \<Longrightarrow> index_list (Suc n) ! k = k
[PROOF STEP]
by (simp add: index_list_length nth_append)


[STATEMENT]
lemma divide_right_iff:
  assumes "eventually (\<lambda>x. h x \<noteq> 0) F"
  shows   "(\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x) \<longleftrightarrow> f \<in> L F (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)) = (f \<in> L F g)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x) \<Longrightarrow> f \<in> L F g
 2. f \<in> L F g \<Longrightarrow> (\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)
[PROOF STEP]
assume "(\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)"
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)

goal (2 subgoals):
 1. (\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x) \<Longrightarrow> f \<in> L F g
 2. f \<in> L F g \<Longrightarrow> (\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)
[PROOF STEP]
from mult_right[OF this, of h] assms
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f x / h x * h x) \<in> L F (\<lambda>x. g x / h x * h x)
\<forall>\<^sub>F x in F. h x \<noteq> (0::'b)
[PROOF STEP]
show "f \<in> L F (g)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x / h x * h x) \<in> L F (\<lambda>x. g x / h x * h x)
\<forall>\<^sub>F x in F. h x \<noteq> (0::'b)

goal (1 subgoal):
 1. f \<in> L F g
[PROOF STEP]
by (subst (asm) cong_ex[of _ f F _ g]) (auto elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
f \<in> L F g

goal (1 subgoal):
 1. f \<in> L F g \<Longrightarrow> (\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)
[PROOF STEP]
qed (simp add: divide_right assms)


[STATEMENT]
lemma flowD_outside:
  assumes g: "flow \<Delta> g"
  shows "e \<notin> \<^bold>E \<Longrightarrow> g e = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<notin> \<^bold>E \<Longrightarrow> g e = 0
[PROOF STEP]
using flowD_capacity[OF g, of e] capacity_outside[of e]
[PROOF STATE]
proof (prove)
using this:
g e \<le> capacity \<Delta> e
e \<notin> \<^bold>E \<Longrightarrow> capacity \<Delta> e = 0

goal (1 subgoal):
 1. e \<notin> \<^bold>E \<Longrightarrow> g e = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma weakly_preferred_by_men_refl:
  assumes "match \<mu>"
  shows "weakly_preferred_by_men \<mu> \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weakly_preferred_by_men \<mu> \<mu>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
match \<mu>

goal (1 subgoal):
 1. weakly_preferred_by_men \<mu> \<mu>
[PROOF STEP]
unfolding weakly_preferred_by_men_def m_weakly_prefers_def
[PROOF STATE]
proof (prove)
using this:
match \<mu>

goal (1 subgoal):
 1. \<forall>m. \<forall>w\<in>{w. (m, w) \<in> \<mu>}. \<exists>w'\<in>{w. (m, w) \<in> \<mu>}. w' \<in> {w' \<in> Field (Pm m). \<forall>w\<in>{w. (m, w) \<in> \<mu>}. (w, w') \<in> Pm m}
[PROOF STEP]
by clarsimp (meson Pm_pref m_weakly_prefers_Pm match_Field(1) preorder_on_def refl_onD)


[STATEMENT]
lemma to_Zp_poly_monom:
  assumes "a \<in> \<O>\<^sub>p"
  shows "to_Zp_poly (monom (UP Q\<^sub>p) a n) = monom (UP Z\<^sub>p) (to_Zp a) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_Zp_poly (monom (UP Q\<^sub>p) a n) = monom (UP Z\<^sub>p) (to_Zp a) n
[PROOF STEP]
unfolding to_Zp_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>na. to_Zp (monom (UP Q\<^sub>p) a n na)) = monom (UP Z\<^sub>p) (to_Zp a) n
[PROOF STEP]
apply(rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. to_Zp (monom (UP Q\<^sub>p) a n na) = monom (UP Z\<^sub>p) (to_Zp a) n na
[PROOF STEP]
using assms cfs_monom[of a n] Zp.cfs_monom[of "to_Zp a" n]
[PROOF STATE]
proof (prove)
using this:
a \<in> \<O>\<^sub>p
a \<in> carrier Q\<^sub>p \<Longrightarrow> monom (UP Q\<^sub>p) a n ?n = (if n = ?n then a else \<zero>)
to_Zp a \<in> carrier Z\<^sub>p \<Longrightarrow> monom (UP Z\<^sub>p) (to_Zp a) n ?n = (if n = ?n then to_Zp a else \<zero>\<^bsub>Z\<^sub>p\<^esub>)

goal (1 subgoal):
 1. \<And>na. to_Zp (monom (UP Q\<^sub>p) a n na) = monom (UP Z\<^sub>p) (to_Zp a) n na
[PROOF STEP]
by (simp add: to_Zp_closed to_Zp_zero val_ring_memE(2))


[STATEMENT]
lemma remdups_adj_length_ge1[simp]: "xs \<noteq> [] \<Longrightarrow> length (remdups_adj xs) \<ge> Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> Suc 0 \<le> length (remdups_adj xs)
[PROOF STEP]
by (induct xs rule: remdups_adj.induct, simp_all)


[STATEMENT]
lemma lemma_2_5_14: "(b l\<rightarrow> c) * (a l\<rightarrow> b) \<le> a l\<rightarrow> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> c) * (a l\<rightarrow> b) \<le> a l\<rightarrow> c
[PROOF STEP]
apply (simp add: left_residual [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> c) * (a l\<rightarrow> b) * a \<le> c
[PROOF STEP]
apply (simp add: mult.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> c) * ((a l\<rightarrow> b) * a) \<le> c
[PROOF STEP]
apply (subst left_impl_times)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> c) * ((b l\<rightarrow> a) * b) \<le> c
[PROOF STEP]
apply (subst mult.assoc [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> c) * (b l\<rightarrow> a) * b \<le> c
[PROOF STEP]
apply (subst left_residual)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> c) * (b l\<rightarrow> a) \<le> b l\<rightarrow> c
[PROOF STEP]
by (rule dual_algebra.H)


[STATEMENT]
lemma star_unfold_left: "star A = A @@ star A \<union> {[]}" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star A = A @@ star A \<union> {[]}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. star A \<subseteq> A @@ star A \<union> {[]}
 2. A @@ star A \<union> {[]} \<subseteq> star A
[PROOF STEP]
show "?L \<subseteq> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star A \<subseteq> A @@ star A \<union> {[]}
[PROOF STEP]
by (rule, erule star_induct) auto
[PROOF STATE]
proof (state)
this:
star A \<subseteq> A @@ star A \<union> {[]}

goal (1 subgoal):
 1. A @@ star A \<union> {[]} \<subseteq> star A
[PROOF STEP]
qed auto


[STATEMENT]
lemma disjuncts: "(\<exists>q\<in> set (disjuncts p). Ifm bs q) = Ifm bs p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>q\<in>set (disjuncts p). Ifm bs q) = Ifm bs p
[PROOF STEP]
by (induct p rule: disjuncts.induct) auto


[STATEMENT]
lemma (in comm_semiring_1) poly_divides_exp: "m \<le> n \<Longrightarrow> (p %^ m) divides (p %^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> p %^ m divides p %^ n
[PROOF STEP]
by (auto simp: le_iff_add divides_def poly_exp_add fun_eq_iff)


[STATEMENT]
lemma mpoly_of_poly_pCons [simp]:
  fixes p :: "'a :: semiring_1 poly"
  shows "mpoly_of_poly i (pCons c p) = Const c + Var i * mpoly_of_poly i p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpoly_of_poly i (pCons c p) = Const c + Var i * mpoly_of_poly i p
[PROOF STEP]
proof (rule mpoly_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>mon. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
fix mon :: "nat \<Rightarrow>\<^sub>0 nat"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>mon. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
define moni :: "nat \<Rightarrow>\<^sub>0 nat" where "moni = Poly_Mapping.single i 1"
[PROOF STATE]
proof (state)
this:
moni = Poly_Mapping.single i 1

goal (1 subgoal):
 1. \<And>mon. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
have "coeff (Var i * mpoly_of_poly i p) mon =
          (\<Sum>l. (1 when l = moni) * (\<Sum>q. coeff (mpoly_of_poly i p) q when mon = moni + q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (\<Sum>l. ((1::'a) when l = moni) * (\<Sum>q. MPoly_Type.coeff (mpoly_of_poly i p) q when mon = moni + q))
[PROOF STEP]
unfolding coeff_mpoly_times prod_fun_def coeff_Var moni_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>l. ((1::'a) when l = Poly_Mapping.single i 1) * (\<Sum>q. MPoly_Type.coeff (mpoly_of_poly i p) q when mon = l + q)) = (\<Sum>l. ((1::'a) when l = Poly_Mapping.single i 1) * (\<Sum>q. MPoly_Type.coeff (mpoly_of_poly i p) q when mon = Poly_Mapping.single i 1 + q))
[PROOF STEP]
by (rule Sum_any.cong) (auto simp: when_def)
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (\<Sum>l. ((1::'a) when l = moni) * (\<Sum>q. MPoly_Type.coeff (mpoly_of_poly i p) q when mon = moni + q))

goal (1 subgoal):
 1. \<And>mon. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (\<Sum>l. ((1::'a) when l = moni) * (\<Sum>q. MPoly_Type.coeff (mpoly_of_poly i p) q when mon = moni + q))

goal (1 subgoal):
 1. \<And>mon. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
have "\<dots> = (\<Sum>a. coeff (mpoly_of_poly i p) a when mon = moni + a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>l. ((1::'a) when l = moni) * (\<Sum>q. MPoly_Type.coeff (mpoly_of_poly i p) q when mon = moni + q)) = (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when mon = moni + a)
[PROOF STEP]
by (subst Sum_any_left_distrib [symmetric]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>l. ((1::'a) when l = moni) * (\<Sum>q. MPoly_Type.coeff (mpoly_of_poly i p) q when mon = moni + q)) = (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when mon = moni + a)

goal (1 subgoal):
 1. \<And>mon. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when mon = moni + a)
[PROOF STEP]
have eq: "coeff (Var i * mpoly_of_poly i p) mon = \<dots>"
[PROOF STATE]
proof (prove)
using this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when mon = moni + a)

goal (1 subgoal):
 1. MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when mon = moni + a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when mon = moni + a)

goal (1 subgoal):
 1. \<And>mon. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
show "coeff (mpoly_of_poly i (pCons c p)) mon = coeff (Const c + Var i * mpoly_of_poly i p) mon"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
proof (cases "keys mon \<subseteq> {i}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
 2. \<not> keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> keys mon \<subseteq> {i}

goal (2 subgoals):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
 2. \<not> keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
hence [simp]: "mon \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> keys mon \<subseteq> {i}

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

goal (2 subgoals):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
 2. \<not> keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
obtain j where j: "j \<in> keys mon" "j \<noteq> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j \<in> keys mon; j \<noteq> i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> keys mon \<subseteq> {i}

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j \<in> keys mon; j \<noteq> i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j \<in> keys mon
j \<noteq> i

goal (2 subgoals):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
 2. \<not> keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
have "coeff (mpoly_of_poly i p) mon' = 0" if mon_eq: "mon = moni + mon'" for mon'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
have "Poly_Mapping.lookup mon j \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup mon j \<noteq> 0
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j \<in> keys mon
j \<noteq> i

goal (1 subgoal):
 1. lookup mon j \<noteq> 0
[PROOF STEP]
by (meson lookup_eq_zero_in_keys_contradict)
[PROOF STATE]
proof (state)
this:
lookup mon j \<noteq> 0

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup mon j \<noteq> 0

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
have "Poly_Mapping.lookup mon j = Poly_Mapping.lookup mon' j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup mon j = lookup mon' j
[PROOF STEP]
unfolding mon_eq moni_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (Poly_Mapping.single i 1 + mon') j = lookup mon' j
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j \<in> keys mon
j \<noteq> i

goal (1 subgoal):
 1. lookup (Poly_Mapping.single i 1 + mon') j = lookup mon' j
[PROOF STEP]
by (simp add: lookup_add lookup_single)
[PROOF STATE]
proof (state)
this:
lookup mon j = lookup mon' j

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lookup mon' j \<noteq> 0
[PROOF STEP]
have "j \<in> keys mon'"
[PROOF STATE]
proof (prove)
using this:
lookup mon' j \<noteq> 0

goal (1 subgoal):
 1. j \<in> keys mon'
[PROOF STEP]
by (meson lookup_not_eq_zero_eq_in_keys)
[PROOF STATE]
proof (state)
this:
j \<in> keys mon'

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
with j
[PROOF STATE]
proof (chain)
picking this:
j \<in> keys mon
j \<noteq> i
j \<in> keys mon'
[PROOF STEP]
have "\<not>keys mon' \<subseteq> {i}"
[PROOF STATE]
proof (prove)
using this:
j \<in> keys mon
j \<noteq> i
j \<in> keys mon'

goal (1 subgoal):
 1. \<not> keys mon' \<subseteq> {i}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> keys mon' \<subseteq> {i}

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> keys mon' \<subseteq> {i}

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (mpoly_of_poly i p) mon' = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mon = moni + ?mon' \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i p) ?mon' = (0::'a)

goal (2 subgoals):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
 2. \<not> keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
hence "coeff (Var i * mpoly_of_poly i p) mon = 0"
[PROOF STATE]
proof (prove)
using this:
mon = moni + ?mon' \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i p) ?mon' = (0::'a)

goal (1 subgoal):
 1. MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (0::'a)
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
using this:
mon = moni + ?mon' \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i p) ?mon' = (0::'a)

goal (1 subgoal):
 1. (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when mon = moni + a) = (0::'a)
[PROOF STEP]
by (intro Sum_any_zeroI) (auto simp: when_def)
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (0::'a)

goal (2 subgoals):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
 2. \<not> keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (0::'a)

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (0::'a)
\<not> keys mon \<subseteq> {i}

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
by (simp add: mpoly_coeff_Const)
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon

goal (1 subgoal):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
keys mon \<subseteq> {i}

goal (1 subgoal):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
define n where "n = Poly_Mapping.lookup mon i"
[PROOF STATE]
proof (state)
this:
n = lookup mon i

goal (1 subgoal):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
have mon_eq: "mon = Poly_Mapping.single i n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mon = Poly_Mapping.single i n
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
keys mon \<subseteq> {i}

goal (1 subgoal):
 1. mon = Poly_Mapping.single i n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
keys mon \<subseteq> {i}

goal (1 subgoal):
 1. mon = Poly_Mapping.single i (lookup mon i)
[PROOF STEP]
by (metis Diff_eq_empty_iff add_cancel_right_left keys_empty_iff remove_key_keys remove_key_sum)
[PROOF STATE]
proof (state)
this:
mon = Poly_Mapping.single i n

goal (1 subgoal):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
have eq': "mon = moni + mon' \<longleftrightarrow> n > 0 \<and> mon' = Poly_Mapping.single i (n - 1)" for mon'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mon = moni + mon') = (0 < n \<and> mon' = Poly_Mapping.single i (n - 1))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mon = moni + mon' \<Longrightarrow> 0 < n
 2. mon = moni + mon' \<Longrightarrow> mon' = Poly_Mapping.single i (n - 1)
 3. \<lbrakk>0 < n; mon' = Poly_Mapping.single i (n - 1)\<rbrakk> \<Longrightarrow> mon = moni + Poly_Mapping.single i (n - 1)
[PROOF STEP]
assume eq: "mon = moni + mon'"
[PROOF STATE]
proof (state)
this:
mon = moni + mon'

goal (3 subgoals):
 1. mon = moni + mon' \<Longrightarrow> 0 < n
 2. mon = moni + mon' \<Longrightarrow> mon' = Poly_Mapping.single i (n - 1)
 3. \<lbrakk>0 < n; mon' = Poly_Mapping.single i (n - 1)\<rbrakk> \<Longrightarrow> mon = moni + Poly_Mapping.single i (n - 1)
[PROOF STEP]
thus "n > 0" "mon' = Poly_Mapping.single i (n - 1)"
[PROOF STATE]
proof (prove)
using this:
mon = moni + mon'

goal (1 subgoal):
 1. 0 < n &&& mon' = Poly_Mapping.single i (n - 1)
[PROOF STEP]
unfolding moni_def mon_eq
[PROOF STATE]
proof (prove)
using this:
Poly_Mapping.single i n = Poly_Mapping.single i 1 + mon'

goal (1 subgoal):
 1. 0 < n &&& mon' = Poly_Mapping.single i (n - 1)
[PROOF STEP]
using gr0I
[PROOF STATE]
proof (prove)
using this:
Poly_Mapping.single i n = Poly_Mapping.single i 1 + mon'
(?n = 0 \<Longrightarrow> False) \<Longrightarrow> 0 < ?n

goal (1 subgoal):
 1. 0 < n &&& mon' = Poly_Mapping.single i (n - 1)
[PROOF STEP]
by (force simp: single_diff)+
[PROOF STATE]
proof (state)
this:
0 < n
mon' = Poly_Mapping.single i (n - 1)

goal (1 subgoal):
 1. \<lbrakk>0 < n; mon' = Poly_Mapping.single i (n - 1)\<rbrakk> \<Longrightarrow> mon = moni + Poly_Mapping.single i (n - 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>0 < n; mon' = Poly_Mapping.single i (n - 1)\<rbrakk> \<Longrightarrow> mon = moni + Poly_Mapping.single i (n - 1)
[PROOF STEP]
assume "n > 0" "mon' = Poly_Mapping.single i (n - 1)"
[PROOF STATE]
proof (state)
this:
0 < n
mon' = Poly_Mapping.single i (n - 1)

goal (1 subgoal):
 1. \<lbrakk>0 < n; mon' = Poly_Mapping.single i (n - 1)\<rbrakk> \<Longrightarrow> mon = moni + Poly_Mapping.single i (n - 1)
[PROOF STEP]
thus "mon = moni + Poly_Mapping.single i (n - 1)"
[PROOF STATE]
proof (prove)
using this:
0 < n
mon' = Poly_Mapping.single i (n - 1)

goal (1 subgoal):
 1. mon = moni + Poly_Mapping.single i (n - 1)
[PROOF STEP]
unfolding mon_eq moni_def
[PROOF STATE]
proof (prove)
using this:
0 < n
mon' = Poly_Mapping.single i (n - 1)

goal (1 subgoal):
 1. Poly_Mapping.single i n = Poly_Mapping.single i 1 + Poly_Mapping.single i (n - 1)
[PROOF STEP]
by (subst single_add [symmetric]) auto
[PROOF STATE]
proof (state)
this:
mon = moni + Poly_Mapping.single i (n - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(mon = moni + ?mon') = (0 < n \<and> ?mon' = Poly_Mapping.single i (n - 1))

goal (1 subgoal):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
have "coeff (Var i * mpoly_of_poly i p) mon = (poly.coeff p (n - 1) when (n > 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (poly.coeff p (n - 1) when 0 < n)
[PROOF STEP]
unfolding eq eq'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a. MPoly_Type.coeff (mpoly_of_poly i p) a when 0 < n \<and> a = Poly_Mapping.single i (n - 1)) = (poly.coeff p (n - 1) when 0 < n)
[PROOF STEP]
by (auto simp: when_def)
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (poly.coeff p (n - 1) when 0 < n)

goal (1 subgoal):
 1. keys mon \<subseteq> {i} \<Longrightarrow> MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
MPoly_Type.coeff (Var i * mpoly_of_poly i p) mon = (poly.coeff p (n - 1) when 0 < n)

goal (1 subgoal):
 1. MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon
[PROOF STEP]
by (auto simp: mon_eq when_def mpoly_coeff_Const coeff_pCons split: nat.splits)
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff (mpoly_of_poly i (pCons c p)) mon = MPoly_Type.coeff (Const c + Var i * mpoly_of_poly i p) mon

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_degree: "poly_vs.dim {x. degree x \<le> n} = n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_vs.dim {x. degree x \<le> n} = n + 1
[PROOF STEP]
using poly_vs.dim_eq_card_independent[OF monom_independent]
[PROOF STATE]
proof (prove)
using this:
poly_vs.dim {monom (1::?'a) x |x. x \<le> ?p1} = card {monom (1::?'a) x |x. x \<le> ?p1}

goal (1 subgoal):
 1. poly_vs.dim {x. degree x \<le> n} = n + 1
[PROOF STEP]
by (auto simp: monom_span[symmetric] card_image image_Collect[symmetric]
      inj_on_def monom_eq_iff')


[STATEMENT]
lemma prv_cnj_imp_scnj2:
  "\<phi> \<in> fmla \<Longrightarrow> \<psi> \<in> fmla \<Longrightarrow> prv (imp (cnj \<phi> \<psi>) (scnj {\<phi>,\<psi>}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; \<psi> \<in> fmla\<rbrakk> \<Longrightarrow> prv (imp (cnj \<phi> \<psi>) (scnj {\<phi>, \<psi>}))
[PROOF STEP]
using prv_imp_cnjL prv_imp_cnjR prv_imp_scnj
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla\<rbrakk> \<Longrightarrow> prv (imp (cnj ?\<phi> ?\<chi>) ?\<phi>)
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla\<rbrakk> \<Longrightarrow> prv (imp (cnj ?\<phi> ?\<chi>) ?\<chi>)
\<lbrakk>?\<chi> \<in> fmla; ?F \<subseteq> fmla; finite ?F; \<And>\<phi>. \<phi> \<in> ?F \<Longrightarrow> prv (imp ?\<chi> \<phi>)\<rbrakk> \<Longrightarrow> prv (imp ?\<chi> (scnj ?F))

goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; \<psi> \<in> fmla\<rbrakk> \<Longrightarrow> prv (imp (cnj \<phi> \<psi>) (scnj {\<phi>, \<psi>}))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma closed_mono:
  assumes BB':  "B \<subseteq> B'"
      and TBwp: "T \<inter> (B \<union> wp act M) \<in> C"
      and B'C:  "B' \<in> C"
      and TC:   "T \<in> C"
      and latt: "lattice C"
  shows "T \<inter> (B' \<union> wp act M) \<in> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<inter> (B' \<union> wp act M) \<in> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T \<inter> (B' \<union> wp act M) \<in> C
[PROOF STEP]
from TBwp
[PROOF STATE]
proof (chain)
picking this:
T \<inter> (B \<union> wp act M) \<in> C
[PROOF STEP]
have "(T\<inter>B) \<union> (T \<inter> wp act M) \<in> C"
[PROOF STATE]
proof (prove)
using this:
T \<inter> (B \<union> wp act M) \<in> C

goal (1 subgoal):
 1. T \<inter> B \<union> T \<inter> wp act M \<in> C
[PROOF STEP]
by (simp add: Int_Un_distrib)
[PROOF STATE]
proof (state)
this:
T \<inter> B \<union> T \<inter> wp act M \<in> C

goal (1 subgoal):
 1. T \<inter> (B' \<union> wp act M) \<in> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T \<inter> B \<union> T \<inter> wp act M \<in> C
[PROOF STEP]
have TBBC: "(T\<inter>B') \<union> ((T\<inter>B) \<union> (T \<inter> wp act M)) \<in> C"
[PROOF STATE]
proof (prove)
using this:
T \<inter> B \<union> T \<inter> wp act M \<in> C

goal (1 subgoal):
 1. T \<inter> B' \<union> (T \<inter> B \<union> T \<inter> wp act M) \<in> C
[PROOF STEP]
by (blast intro: Int_in_lattice Un_in_lattice TC B'C latt)
[PROOF STATE]
proof (state)
this:
T \<inter> B' \<union> (T \<inter> B \<union> T \<inter> wp act M) \<in> C

goal (1 subgoal):
 1. T \<inter> (B' \<union> wp act M) \<in> C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<inter> (B' \<union> wp act M) \<in> C
[PROOF STEP]
by (rule eqelem_imp_iff [THEN iffD1, OF _ TBBC],
        blast intro: BB' [THEN subsetD])
[PROOF STATE]
proof (state)
this:
T \<inter> (B' \<union> wp act M) \<in> C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma perp_up_at_end:
  assumes "a \<in> hyp2" and "b \<in> hyp2" and "proj2_incident b l"
  shows "B\<^sub>\<real> (cart2_pt (perp_foot a l)) (cart2_pt a) (cart2_pt (perp_up a l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
 2. \<not> ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
assume "proj2_incident a l"
[PROOF STATE]
proof (state)
this:
proj2_incident a l

goal (2 subgoals):
 1. ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
 2. \<not> ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
with \<open>a \<in> hyp2\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<in> hyp2
proj2_incident a l
[PROOF STEP]
have "perp_foot a l = a"
[PROOF STATE]
proof (prove)
using this:
a \<in> hyp2
proj2_incident a l

goal (1 subgoal):
 1. perp_foot a l = a
[PROOF STEP]
by (rule hyp2_incident_perp_foot_same_point)
[PROOF STATE]
proof (state)
this:
perp_foot a l = a

goal (2 subgoals):
 1. ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
 2. \<not> ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
thus "B\<^sub>\<real> (cart2_pt (perp_foot a l)) (cart2_pt a) (cart2_pt (perp_up a l))"
[PROOF STATE]
proof (prove)
using this:
perp_foot a l = a

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
by (simp add: real_euclid.th3_1 real_euclid.th3_2)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)

goal (1 subgoal):
 1. \<not> proj2_incident a l \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> proj2_incident a l \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
assume "\<not> proj2_incident a l"
[PROOF STATE]
proof (state)
this:
\<not> proj2_incident a l

goal (1 subgoal):
 1. \<not> proj2_incident a l \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l
\<not> proj2_incident a l
[PROOF STEP]
show "B\<^sub>\<real> (cart2_pt (perp_foot a l)) (cart2_pt a) (cart2_pt (perp_up a l))"
[PROOF STATE]
proof (prove)
using this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l
\<not> proj2_incident a l

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
by (rule perp_up_non_degenerate_in_S_at_end)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_pcompose_linear:
  "coeff (pcompose p [:0, a :: 'a :: comm_semiring_1:]) i = a ^ i * coeff p i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0::'a, a:]) i = a ^ i * coeff p i
[PROOF STEP]
by (induction p arbitrary: i) (auto simp: pcompose_pCons coeff_pCons mult_ac split: nat.splits)


[STATEMENT]
lemma (in padic_integers) residue_of_sum':
 "(a \<oplus> b) k = ((a k) + (b k)) mod p^k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<oplus> b) k = (a k + b k) mod p ^ k
[PROOF STEP]
using residue_add residue_of_sum
[PROOF STATE]
proof (prove)
using this:
?x \<oplus>\<^bsub>residue_ring (p ^ ?k)\<^esub> ?y = (?x + ?y) mod p ^ ?k
(?a \<oplus> ?b) ?k = ?a ?k \<oplus>\<^bsub>residue_ring (p ^ ?k)\<^esub> ?b ?k

goal (1 subgoal):
 1. (a \<oplus> b) k = (a k + b k) mod p ^ k
[PROOF STEP]
by auto