[STATEMENT]
lemma three_fixed_points:
  assumes "z1 \<noteq> z2" and "z1 \<noteq> z3" and "z2 \<noteq> z3"
  assumes "moebius_pt M z1 = z1" and "moebius_pt M z2 = z2" and "moebius_pt M z3 = z3"
  shows "M = id_moebius"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
moebius_pt M z1 = z1
moebius_pt M z2 = z2
moebius_pt M z3 = z3
[PROOF STEP]
obtain M' where *: "moebius_pt M' z1 = 0\<^sub>h"  "moebius_pt M' z2 = 1\<^sub>h"   "moebius_pt M' z3 = \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
moebius_pt M z1 = z1
moebius_pt M z2 = z2
moebius_pt M z3 = z3

goal (1 subgoal):
 1. (\<And>M'. \<lbrakk>moebius_pt M' z1 = 0\<^sub>h; moebius_pt M' z2 = 1\<^sub>h; moebius_pt M' z3 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_moebius_01inf[of z1 z2 z3]
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
moebius_pt M z1 = z1
moebius_pt M z2 = z2
moebius_pt M z3 = z3
\<lbrakk>z1 \<noteq> z2; z1 \<noteq> z3; z2 \<noteq> z3\<rbrakk> \<Longrightarrow> \<exists>M. moebius_pt M z1 = 0\<^sub>h \<and> moebius_pt M z2 = 1\<^sub>h \<and> moebius_pt M z3 = \<infinity>\<^sub>h

goal (1 subgoal):
 1. (\<And>M'. \<lbrakk>moebius_pt M' z1 = 0\<^sub>h; moebius_pt M' z2 = 1\<^sub>h; moebius_pt M' z3 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt M' z1 = 0\<^sub>h
moebius_pt M' z2 = 1\<^sub>h
moebius_pt M' z3 = \<infinity>\<^sub>h

goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
have **: "moebius_pt (moebius_inv M') 0\<^sub>h = z1"  "moebius_pt (moebius_inv M') 1\<^sub>h = z2" "moebius_pt (moebius_inv M') \<infinity>\<^sub>h = z3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M') 0\<^sub>h = z1 &&& moebius_pt (moebius_inv M') 1\<^sub>h = z2 &&& moebius_pt (moebius_inv M') \<infinity>\<^sub>h = z3
[PROOF STEP]
by (subst *[symmetric], simp)+
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M') 0\<^sub>h = z1
moebius_pt (moebius_inv M') 1\<^sub>h = z2
moebius_pt (moebius_inv M') \<infinity>\<^sub>h = z3

goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
have "M' + M + (-M') = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M' + M + - M' = 0
[PROOF STEP]
unfolding zero_moebius_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M' + M + - M' = id_moebius
[PROOF STEP]
apply (rule three_fixed_points_01inf)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. moebius_pt (M' + M + - M') 0\<^sub>h = 0\<^sub>h
 2. moebius_pt (M' + M + - M') 1\<^sub>h = 1\<^sub>h
 3. moebius_pt (M' + M + - M') \<infinity>\<^sub>h = \<infinity>\<^sub>h
[PROOF STEP]
using * ** assms
[PROOF STATE]
proof (prove)
using this:
moebius_pt M' z1 = 0\<^sub>h
moebius_pt M' z2 = 1\<^sub>h
moebius_pt M' z3 = \<infinity>\<^sub>h
moebius_pt (moebius_inv M') 0\<^sub>h = z1
moebius_pt (moebius_inv M') 1\<^sub>h = z2
moebius_pt (moebius_inv M') \<infinity>\<^sub>h = z3
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
moebius_pt M z1 = z1
moebius_pt M z2 = z2
moebius_pt M z3 = z3

goal (3 subgoals):
 1. moebius_pt (M' + M + - M') 0\<^sub>h = 0\<^sub>h
 2. moebius_pt (M' + M + - M') 1\<^sub>h = 1\<^sub>h
 3. moebius_pt (M' + M + - M') \<infinity>\<^sub>h = \<infinity>\<^sub>h
[PROOF STEP]
by (simp add: moebius_comp[symmetric])+
[PROOF STATE]
proof (state)
this:
M' + M + - M' = 0

goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
M' + M + - M' = 0

goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
by (metis eq_neg_iff_add_eq_0 minus_add_cancel zero_moebius_def)
[PROOF STATE]
proof (state)
this:
M = id_moebius

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compute_higherPowers[code]: "higherPowers n i (Pm_fmap xs) = Pm_fmap (higherPowers\<^sub>f n i xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higherPowers n i (Pm_fmap xs) = Pm_fmap (higherPowers\<^sub>f n i xs)
[PROOF STEP]
by (rule poly_mapping_eqI)
    (auto simp: higherPowers\<^sub>f.rep_eq higherPowers.rep_eq fmlookup_default_def dec_above_def
      split: option.splits)


[STATEMENT]
lemma vcons_eq_iff[simp]: "(xs\<^sub>1 #\<^sub>\<circ> x\<^sub>1 = xs\<^sub>2 #\<^sub>\<circ> x\<^sub>2) \<longleftrightarrow> (xs\<^sub>1 = xs\<^sub>2 \<and> x\<^sub>1 = x\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs\<^sub>1 #\<^sub>\<circ> x\<^sub>1 = xs\<^sub>2 #\<^sub>\<circ> x\<^sub>2) = (xs\<^sub>1 = xs\<^sub>2 \<and> x\<^sub>1 = x\<^sub>2)
[PROOF STEP]
by auto


[STATEMENT]
lemma filterlim_tendsto_pos_mult_at_bot_iff:
  fixes c :: real
  assumes "(f \<longlongrightarrow> c) F" "0 < c"
  shows "(LIM x F. f x * g x :> at_bot) \<longleftrightarrow> filterlim g at_bot F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LIM x F. f x * g x :> at_bot) = filterlim g at_bot F
[PROOF STEP]
using filterlim_tendsto_pos_mult_at_top_iff[OF assms(1,2), of "\<lambda>x. - g x"]
[PROOF STATE]
proof (prove)
using this:
(LIM x F. f x * - g x :> at_top) = (LIM x F. - g x :> at_top)

goal (1 subgoal):
 1. (LIM x F. f x * g x :> at_bot) = filterlim g at_bot F
[PROOF STEP]
unfolding filterlim_uminus_at_bot
[PROOF STATE]
proof (prove)
using this:
(LIM x F. f x * - g x :> at_top) = (LIM x F. - g x :> at_top)

goal (1 subgoal):
 1. (LIM x F. - (f x * g x) :> at_top) = (LIM x F. - g x :> at_top)
[PROOF STEP]
by simp


[STATEMENT]
lemma orbit_not_empty:
  assumes fin:"finite M"
  assumes A:"A \<in> orbits"
  shows "card A > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
A \<in> orbits
[PROOF STEP]
obtain m where "m \<in> M" "A = orbit m"
[PROOF STATE]
proof (prove)
using this:
A \<in> orbits

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m \<in> M; A = orbit m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding orbits_def quotient_def orbit_def
[PROOF STATE]
proof (prove)
using this:
A \<in> (\<Union>x\<in>M. {same_orbit_rel `` {x}})

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m \<in> M; A = same_orbit_rel `` {m}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m \<in> M
A = orbit m

goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
hence "m \<in> A"
[PROOF STATE]
proof (prove)
using this:
m \<in> M
A = orbit m

goal (1 subgoal):
 1. m \<in> A
[PROOF STEP]
by (metis orbit_contains_rep)
[PROOF STATE]
proof (state)
this:
m \<in> A

goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
hence "A \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
m \<in> A

goal (1 subgoal):
 1. A \<noteq> {}
[PROOF STEP]
unfolding orbits_def
[PROOF STATE]
proof (prove)
using this:
m \<in> A

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

goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
from fin A
[PROOF STATE]
proof (chain)
picking this:
finite M
A \<in> orbits
[PROOF STEP]
have "finite A"
[PROOF STATE]
proof (prove)
using this:
finite M
A \<in> orbits

goal (1 subgoal):
 1. finite A
[PROOF STEP]
unfolding orbits_def quotient_def Image_def same_orbit_rel_def
[PROOF STATE]
proof (prove)
using this:
finite M
A \<in> (\<Union>x\<in>M. {{y. \<exists>x\<in>{x}. (x, y) \<in> {p \<in> M \<times> M. \<exists>g\<in>carrier G. \<phi> g (snd p) = fst p}}})

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

goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
finite A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
finite A

goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < card A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lead_coeff_smult: "lead_coeff (smult c p) = c * lead_coeff p"
  for p :: "'a::{comm_semiring_0,semiring_no_zero_divisors} poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff (smult c p) = c * lead_coeff p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lead_coeff (smult c p) = c * lead_coeff p
[PROOF STEP]
have "smult c p = [:c:] * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult c p = [:c:] * p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
smult c p = [:c:] * p

goal (1 subgoal):
 1. lead_coeff (smult c p) = c * lead_coeff p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
smult c p = [:c:] * p

goal (1 subgoal):
 1. lead_coeff (smult c p) = c * lead_coeff p
[PROOF STEP]
have "lead_coeff \<dots> = c * lead_coeff p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff ([:c:] * p) = c * lead_coeff p
[PROOF STEP]
by (subst lead_coeff_mult) simp_all
[PROOF STATE]
proof (state)
this:
lead_coeff ([:c:] * p) = c * lead_coeff p

goal (1 subgoal):
 1. lead_coeff (smult c p) = c * lead_coeff p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lead_coeff (smult c p) = c * lead_coeff p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lead_coeff (smult c p) = c * lead_coeff p

goal (1 subgoal):
 1. lead_coeff (smult c p) = c * lead_coeff p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lead_coeff (smult c p) = c * lead_coeff p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_conj_atom : "evalUni (list_conj_Uni (map AtomUni L)) x = (\<forall>l\<in>set(L). aEvalUni l x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evalUni (list_conj_Uni (map AtomUni L)) x = (\<forall>l\<in>set L. aEvalUni l x)
[PROOF STEP]
unfolding eval_list_conj_Uni
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>l\<in>set (map AtomUni L). evalUni l x) = (\<forall>l\<in>set L. aEvalUni l x)
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_prod_list_eq: assumes "\<And> p. p \<in> set ps \<Longrightarrow> (p :: 'a :: idom poly) \<noteq> 0"
  shows "degree (prod_list ps) = sum_list (map degree ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (prod_list ps) = sum_list (map degree ps)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?p \<in> set ps \<Longrightarrow> ?p \<noteq> 0

goal (1 subgoal):
 1. degree (prod_list ps) = sum_list (map degree ps)
[PROOF STEP]
proof (induct ps)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>p. p \<in> set [] \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> degree (prod_list []) = sum_list (map degree [])
 2. \<And>a ps. \<lbrakk>(\<And>p. p \<in> set ps \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> degree (prod_list ps) = sum_list (map degree ps); \<And>p. p \<in> set (a # ps) \<Longrightarrow> p \<noteq> 0\<rbrakk> \<Longrightarrow> degree (prod_list (a # ps)) = sum_list (map degree (a # ps))
[PROOF STEP]
case (Cons p ps)
[PROOF STATE]
proof (state)
this:
(\<And>p. p \<in> set ps \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> degree (prod_list ps) = sum_list (map degree ps)
?p \<in> set (p # ps) \<Longrightarrow> ?p \<noteq> 0

goal (2 subgoals):
 1. (\<And>p. p \<in> set [] \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> degree (prod_list []) = sum_list (map degree [])
 2. \<And>a ps. \<lbrakk>(\<And>p. p \<in> set ps \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> degree (prod_list ps) = sum_list (map degree ps); \<And>p. p \<in> set (a # ps) \<Longrightarrow> p \<noteq> 0\<rbrakk> \<Longrightarrow> degree (prod_list (a # ps)) = sum_list (map degree (a # ps))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (prod_list (p # ps)) = sum_list (map degree (p # ps))
[PROOF STEP]
unfolding prod_list.Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p * prod_list ps) = sum_list (map degree (p # ps))
[PROOF STEP]
by (subst degree_mult_eq, insert Cons, auto simp: prod_list_zero_iff)
[PROOF STATE]
proof (state)
this:
degree (prod_list (p # ps)) = sum_list (map degree (p # ps))

goal (1 subgoal):
 1. (\<And>p. p \<in> set [] \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> degree (prod_list []) = sum_list (map degree [])
[PROOF STEP]
qed simp


[STATEMENT]
lemma in_pair_Un [simp]: "p \<in>\<^sub>p A \<union> B \<longleftrightarrow> (p \<in>\<^sub>p A \<or> p \<in>\<^sub>p B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<in>\<^sub>p A \<union> B) = (p \<in>\<^sub>p A \<or> p \<in>\<^sub>p B)
[PROOF STEP]
by (metis (mono_tags, lifting) UnE UnI1 UnI2 image_Un in_pair_def)


[STATEMENT]
lemma ht_size_update1:
  assumes size: "ht_size l n"
  assumes i: "i < length l"
  assumes snd: "snd (ls_update k v (l ! i))"
  shows "ht_size (l[i := fst (ls_update k v (l!i))]) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) n
[PROOF STEP]
have "(map length (l[i := fst (ls_update k v (l ! i))]))
    = (map length l)[i := length (fst (ls_update k v (l ! i)))]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map length (l[i := fst (ls_update k v (l ! i))]) = (map length l)[i := length (fst (ls_update k v (l ! i)))]
[PROOF STEP]
by (simp add: map_update)
[PROOF STATE]
proof (state)
this:
map length (l[i := fst (ls_update k v (l ! i))]) = (map length l)[i := length (fst (ls_update k v (l ! i)))]

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map length (l[i := fst (ls_update k v (l ! i))]) = (map length l)[i := length (fst (ls_update k v (l ! i)))]

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) n
[PROOF STEP]
from sum_list_update[of i "map length l", simplified, OF i,
    of "length (fst (ls_update k v (l ! i)))"]
    ls_update_length_snd_True[OF snd]
[PROOF STATE]
proof (chain)
picking this:
sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = sum_list (map length l) + length (fst (ls_update k v (l ! i))) - length (l ! i)
length (fst (ls_update k v (l ! i))) = length (l ! i)
[PROOF STEP]
have
    "sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))])
    = sum_list (map length l)"
[PROOF STATE]
proof (prove)
using this:
sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = sum_list (map length l) + length (fst (ls_update k v (l ! i))) - length (l ! i)
length (fst (ls_update k v (l ! i))) = length (l ! i)

goal (1 subgoal):
 1. sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = sum_list (map length l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = sum_list (map length l)

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (map length (l[i := fst (ls_update k v (l ! i))])) = sum_list (map length l)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map length (l[i := fst (ls_update k v (l ! i))])) = sum_list (map length l)

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sum_list (map length (l[i := fst (ls_update k v (l ! i))])) = sum_list (map length l)
ht_size l n
i < length l
snd (ls_update k v (l ! i))

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) n
[PROOF STEP]
by (simp add: ht_size_def assms)
[PROOF STATE]
proof (state)
this:
ht_size (l[i := fst (ls_update k v (l ! i))]) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma similar_matI: assumes "{A,B,P,Q} \<subseteq> carrier_mat n n" "P * Q = 1\<^sub>m n" "Q * P = 1\<^sub>m n" "A = P * B * Q"
  shows "similar_mat A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat A B
[PROOF STEP]
unfolding similar_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. Ex (similar_mat_wit A B P)
[PROOF STEP]
by (rule exI[of _ P], rule exI[of _ Q], unfold similar_mat_wit_def Let_def, insert assms, auto)


[STATEMENT]
lemma diag_block_mat_commute_comp:
  assumes "length Al = length Bl"
  and "\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)"
  and "\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)"
  and "\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)"
  and "diag_block_mat Al * (diag_block_mat Bl) =
    diag_block_mat Bl * (diag_block_mat Al)"
  and "i < length Al"
shows "Al!i * Bl!i = Bl!i * Al!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
have "diag_block_mat (map2 (*) Al Bl)=diag_block_mat Al * diag_block_mat Bl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (map2 (*) Al Bl) = diag_block_mat Al * diag_block_mat Bl
[PROOF STEP]
using diag_block_mat_mult[of Al] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length Al = length ?Bl; \<forall>i<length Al. dim_col (Al ! i) = dim_row (?Bl ! i)\<rbrakk> \<Longrightarrow> diag_block_mat Al * diag_block_mat ?Bl = diag_block_mat (map2 (*) Al ?Bl)
length Al = length Bl
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)
\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)
\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
i < length Al

goal (1 subgoal):
 1. diag_block_mat (map2 (*) Al Bl) = diag_block_mat Al * diag_block_mat Bl
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat (map2 (*) Al Bl) = diag_block_mat Al * diag_block_mat Bl

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
diag_block_mat (map2 (*) Al Bl) = diag_block_mat Al * diag_block_mat Bl

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
have "... = diag_block_mat Bl * diag_block_mat Al"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length Al = length Bl
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)
\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)
\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
i < length Al

goal (1 subgoal):
 1. diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
have "... = diag_block_mat (map2 (*) Bl Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat Bl * diag_block_mat Al = diag_block_mat (map2 (*) Bl Al)
[PROOF STEP]
using diag_block_mat_mult[of Bl] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length Bl = length ?Bl; \<forall>i<length Bl. dim_col (Bl ! i) = dim_row (?Bl ! i)\<rbrakk> \<Longrightarrow> diag_block_mat Bl * diag_block_mat ?Bl = diag_block_mat (map2 (*) Bl ?Bl)
length Al = length Bl
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)
\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)
\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
i < length Al

goal (1 subgoal):
 1. diag_block_mat Bl * diag_block_mat Al = diag_block_mat (map2 (*) Bl Al)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat Bl * diag_block_mat Al = diag_block_mat (map2 (*) Bl Al)

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)
[PROOF STEP]
have eq: "diag_block_mat (map2 (*) Al Bl) =
    diag_block_mat (map2 (*) Bl Al)"
[PROOF STATE]
proof (prove)
using this:
diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)

goal (1 subgoal):
 1. diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
have "(map2 (*) Al Bl)!i = (map2 (*) Bl Al)!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (*) Al Bl ! i = map2 (*) Bl Al ! i
[PROOF STEP]
proof (rule diag_block_mat_cong_comp)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. length (map2 (*) Al Bl) = length (map2 (*) Bl Al)
 2. \<forall>i<length (map2 (*) Al Bl). dim_row (map2 (*) Al Bl ! i) = dim_row (map2 (*) Bl Al ! i)
 3. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_col (map2 (*) Bl Al ! i)
 4. diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)
 5. i < length (map2 (*) Al Bl)
[PROOF STEP]
show "length (map2 (*) Al Bl) = length (map2 (*) Bl Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map2 (*) Al Bl) = length (map2 (*) Bl Al)
[PROOF STEP]
using map2_length assms
[PROOF STATE]
proof (prove)
using this:
length ?Al = length ?Bl \<Longrightarrow> length (map2 ?f ?Al ?Bl) = length ?Al
length Al = length Bl
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)
\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)
\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
i < length Al

goal (1 subgoal):
 1. length (map2 (*) Al Bl) = length (map2 (*) Bl Al)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
length (map2 (*) Al Bl) = length (map2 (*) Bl Al)

goal (4 subgoals):
 1. \<forall>i<length (map2 (*) Al Bl). dim_row (map2 (*) Al Bl ! i) = dim_row (map2 (*) Bl Al ! i)
 2. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_col (map2 (*) Bl Al ! i)
 3. diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)
 4. i < length (map2 (*) Al Bl)
[PROOF STEP]
show "i < length (map2 (*) Al Bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (map2 (*) Al Bl)
[PROOF STEP]
using map2_length assms
[PROOF STATE]
proof (prove)
using this:
length ?Al = length ?Bl \<Longrightarrow> length (map2 ?f ?Al ?Bl) = length ?Al
length Al = length Bl
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)
\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)
\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
i < length Al

goal (1 subgoal):
 1. i < length (map2 (*) Al Bl)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
i < length (map2 (*) Al Bl)

goal (3 subgoals):
 1. \<forall>i<length (map2 (*) Al Bl). dim_row (map2 (*) Al Bl ! i) = dim_row (map2 (*) Bl Al ! i)
 2. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_col (map2 (*) Bl Al ! i)
 3. diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)
[PROOF STEP]
show "diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)

goal (1 subgoal):
 1. diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
diag_block_mat (map2 (*) Al Bl) = diag_block_mat (map2 (*) Bl Al)

goal (2 subgoals):
 1. \<forall>i<length (map2 (*) Al Bl). dim_row (map2 (*) Al Bl ! i) = dim_row (map2 (*) Bl Al ! i)
 2. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_col (map2 (*) Bl Al ! i)
[PROOF STEP]
show "\<forall>i<length (map2 (*) Al Bl). dim_row (map2 (*) Al Bl ! i) =
      dim_row (map2 (*) Bl Al ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (map2 (*) Al Bl). dim_row (map2 (*) Al Bl ! i) = dim_row (map2 (*) Bl Al ! i)
[PROOF STEP]
by (simp add: assms(3))
[PROOF STATE]
proof (state)
this:
\<forall>i<length (map2 (*) Al Bl). dim_row (map2 (*) Al Bl ! i) = dim_row (map2 (*) Bl Al ! i)

goal (1 subgoal):
 1. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_col (map2 (*) Bl Al ! i)
[PROOF STEP]
show "\<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) =
      dim_col (map2 (*) Bl Al ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_col (map2 (*) Bl Al ! i)
[PROOF STEP]
by (simp add: assms(4))
[PROOF STATE]
proof (state)
this:
\<forall>i<length (map2 (*) Al Bl). dim_col (map2 (*) Al Bl ! i) = dim_col (map2 (*) Bl Al ! i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map2 (*) Al Bl ! i = map2 (*) Bl Al ! i

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
map2 (*) Al Bl ! i = map2 (*) Bl Al ! i

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
have "(map2 (*) Al Bl)!i = Al!i * Bl!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (*) Al Bl ! i = Al ! i * Bl ! i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length Al = length Bl
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)
\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)
\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
i < length Al

goal (1 subgoal):
 1. map2 (*) Al Bl ! i = Al ! i * Bl ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map2 (*) Al Bl ! i = Al ! i * Bl ! i

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
map2 (*) Al Bl ! i = Al ! i * Bl ! i

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
have "(map2 (*) Bl Al)!i = Bl!i * Al!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (*) Bl Al ! i = Bl ! i * Al ! i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length Al = length Bl
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)
\<forall>i<length Al. dim_row (Al ! i) = dim_row (Bl ! i)
\<forall>i<length Al. dim_col (Al ! i) = dim_col (Bl ! i)
diag_block_mat Al * diag_block_mat Bl = diag_block_mat Bl * diag_block_mat Al
i < length Al

goal (1 subgoal):
 1. map2 (*) Bl Al ! i = Bl ! i * Al ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map2 (*) Bl Al ! i = Bl ! i * Al ! i

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
map2 (*) Al Bl ! i = map2 (*) Bl Al ! i
map2 (*) Al Bl ! i = Al ! i * Bl ! i
map2 (*) Bl Al ! i = Bl ! i * Al ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map2 (*) Al Bl ! i = map2 (*) Bl Al ! i
map2 (*) Al Bl ! i = Al ! i * Bl ! i
map2 (*) Bl Al ! i = Bl ! i * Al ! i

goal (1 subgoal):
 1. Al ! i * Bl ! i = Bl ! i * Al ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Al ! i * Bl ! i = Bl ! i * Al ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Krein_Milman_Minkowski:
  fixes S :: "'a::euclidean_space set"
  assumes "compact S" "convex S"
    shows "S = convex hull {x. x extreme_point_of S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = convex hull {x. x extreme_point_of S}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S \<subseteq> convex hull {x. x extreme_point_of S}
 2. convex hull {x. x extreme_point_of S} \<subseteq> S
[PROOF STEP]
show "S \<subseteq> convex hull {x. x extreme_point_of S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> convex hull {x. x extreme_point_of S}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<in> convex hull {x. x extreme_point_of S}
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<in> convex hull {x. x extreme_point_of S}
[PROOF STEP]
assume [simp]: "a \<in> S"
[PROOF STATE]
proof (state)
this:
a \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<in> convex hull {x. x extreme_point_of S}
[PROOF STEP]
have 1: "compact ((+) (- a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact ((+) (- a) ` S)
[PROOF STEP]
by (simp add: \<open>compact S\<close> compact_translation_subtract cong: image_cong_simp)
[PROOF STATE]
proof (state)
this:
compact ((+) (- a) ` S)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<in> convex hull {x. x extreme_point_of S}
[PROOF STEP]
have 2: "convex ((+) (- a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex ((+) (- a) ` S)
[PROOF STEP]
by (simp add: \<open>convex S\<close> compact_translation_subtract)
[PROOF STATE]
proof (state)
this:
convex ((+) (- a) ` S)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<in> convex hull {x. x extreme_point_of S}
[PROOF STEP]
show a_invex: "a \<in> convex hull {x. x extreme_point_of S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> convex hull {x. x extreme_point_of S}
[PROOF STEP]
using Krein_Milman_Minkowski_aux [OF refl 1 2]
            convex_hull_translation [of "-a"]
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<in> (+) (- a) ` S \<Longrightarrow> (0::'a) \<in> convex hull {x. x extreme_point_of (+) (- a) ` S}
convex hull (+) (- a) ` ?S = (+) (- a) ` (convex hull ?S)

goal (1 subgoal):
 1. a \<in> convex hull {x. x extreme_point_of S}
[PROOF STEP]
by (auto simp: extreme_points_of_translation_subtract translation_assoc cong: image_cong_simp)
[PROOF STATE]
proof (state)
this:
a \<in> convex hull {x. x extreme_point_of S}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
S \<subseteq> convex hull {x. x extreme_point_of S}

goal (1 subgoal):
 1. convex hull {x. x extreme_point_of S} \<subseteq> S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex hull {x. x extreme_point_of S} \<subseteq> S
[PROOF STEP]
show "convex hull {x. x extreme_point_of S} \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull {x. x extreme_point_of S} \<subseteq> S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex hull {x. x extreme_point_of S} \<subseteq> S
[PROOF STEP]
have "{a. a extreme_point_of S} \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a. a extreme_point_of S} \<subseteq> S
[PROOF STEP]
using extreme_point_of_def
[PROOF STATE]
proof (prove)
using this:
(?x extreme_point_of ?S) = (?x \<in> ?S \<and> (\<forall>a\<in>?S. \<forall>b\<in>?S. ?x \<notin> open_segment a b))

goal (1 subgoal):
 1. {a. a extreme_point_of S} \<subseteq> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{a. a extreme_point_of S} \<subseteq> S

goal (1 subgoal):
 1. convex hull {x. x extreme_point_of S} \<subseteq> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{a. a extreme_point_of S} \<subseteq> S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{a. a extreme_point_of S} \<subseteq> S

goal (1 subgoal):
 1. convex hull {x. x extreme_point_of S} \<subseteq> S
[PROOF STEP]
by (simp add: \<open>convex S\<close> hull_minimal)
[PROOF STATE]
proof (state)
this:
convex hull {x. x extreme_point_of S} \<subseteq> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convex hull {x. x extreme_point_of S} \<subseteq> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interpClause_resolvants:
  assumes lit_not_zero: "lit \<noteq> 0"
  assumes sorted_and_distinct: "sorted cli" "distinct cli" "sorted clj" "distinct clj"
  assumes resolv_clauses: "lit \<in> set cli" "compl lit \<in> set clj"
  assumes interp: "interpClause a cli" "interpClause a clj"
  shows "interpClause a (merge (remove lit cli) (remove (compl lit) clj))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interpClause a (merge (remove lit cli) (remove (compl lit) clj))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interpClause a (merge (remove lit cli) (remove (compl lit) clj))
[PROOF STEP]
from lit_not_zero resolv_clauses interp sorted_and_distinct
[PROOF STATE]
proof (chain)
picking this:
lit \<noteq> 0
lit \<in> set cli
compl lit \<in> set clj
interpClause a cli
interpClause a clj
sorted cli
distinct cli
sorted clj
distinct clj
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lit \<noteq> 0
lit \<in> set cli
compl lit \<in> set clj
interpClause a cli
interpClause a clj
sorted cli
distinct cli
sorted clj
distinct clj

goal (1 subgoal):
 1. interpClause a (merge (remove lit cli) (remove (compl lit) clj))
[PROOF STEP]
unfolding interpClause_def
[PROOF STATE]
proof (prove)
using this:
lit \<noteq> 0
lit \<in> set cli
compl lit \<in> set clj
Bex (set cli) (interpLit a)
Bex (set clj) (interpLit a)
sorted cli
distinct cli
sorted clj
distinct clj

goal (1 subgoal):
 1. Bex (set (merge (remove lit cli) (remove (compl lit) clj))) (interpLit a)
[PROOF STEP]
using interpClause_resolvants'
[PROOF STATE]
proof (prove)
using this:
lit \<noteq> 0
lit \<in> set cli
compl lit \<in> set clj
Bex (set cli) (interpLit a)
Bex (set clj) (interpLit a)
sorted cli
distinct cli
sorted clj
distinct clj
\<lbrakk>?lit \<noteq> 0; ?lit \<in> ?cli; compl ?lit \<in> ?clj; \<exists>x\<in>?cli. interpLit ?a x; \<exists>x\<in>?clj. interpLit ?a x\<rbrakk> \<Longrightarrow> \<exists>x\<in>?cli - {?lit} \<union> (?clj - {compl ?lit}). interpLit ?a x

goal (1 subgoal):
 1. Bex (set (merge (remove lit cli) (remove (compl lit) clj))) (interpLit a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
interpClause a (merge (remove lit cli) (remove (compl lit) clj))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(if (0::nat) \<le> (x::nat) then 0::nat else x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 \<le> x then 0 else x) = 0
[PROOF STEP]
by normalization


[STATEMENT]
lemma SetMem_SetInsert: "SetMem\<cdot>v\<cdot>(SetInsert\<cdot>x\<cdot>s) = (SetMem\<cdot>v\<cdot>s orelse x =\<^sub>B v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SetMem\<cdot>v\<cdot>(SetInsert\<cdot>x\<cdot>s) = (SetMem\<cdot>v\<cdot>s orelse x =\<^sub>B v)
[PROOF STEP]
by (simp add: SetMem_def SetInsert_def)


[STATEMENT]
lemma hball_succ [simp]: "(\<forall>x \<^bold>\<in> succ k. P x) \<longleftrightarrow> P k \<and> (\<forall>x \<^bold>\<in> k. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HBall (succ k) P = (P k \<and> HBall k P)
[PROOF STEP]
by (auto simp: HBall_def)


[STATEMENT]
lemma indicator_inter_arith: "indicator (A \<inter> B) x = indicator A x * (indicator B x::'a::semiring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator (A \<inter> B) x = indicator A x * indicator B x
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_bool (x \<in> A \<inter> B) = of_bool (x \<in> A) * of_bool (x \<in> B)
[PROOF STEP]
by (auto simp: min_def max_def)


[STATEMENT]
lemma hmsetmset_less[simp]: "hmsetmset M < hmsetmset N \<longleftrightarrow> M < N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (hmsetmset M < hmsetmset N) = (M < N)
[PROOF STEP]
by (cases M, cases N, simp add: less_multiset_ext\<^sub>D\<^sub>M_less less_HMSet_iff_less_multiset_ext\<^sub>D\<^sub>M)


[STATEMENT]
theorem Par_Sbis[simp]:
assumes "c1 \<approx>s d1" and "c2 \<approx>s d2"
shows "Par c1 c2 \<approx>s Par d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 | c2 \<approx>s d1 | d2
[PROOF STEP]
using assms thetaPar_Sbis
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>s d1
c2 \<approx>s d2
thetaPar \<subseteq> Sbis

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

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


[STATEMENT]
lemma Frct_uminus: "-(Frct (a,b)) = Frct (-a,b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Frct (a, b) = Frct (- a, b)
[PROOF STEP]
by simp


[STATEMENT]
lemma is_lub_set: "S <<| \<Union>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S <<| \<Union> S
[PROOF STEP]
unfolding is_lub_def is_ub_def below_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y\<in>S. y \<subseteq> \<Union> S) \<and> (\<forall>u. (\<forall>y\<in>S. y \<subseteq> u) \<longrightarrow> \<Union> S \<subseteq> u)
[PROOF STEP]
by fast


[STATEMENT]
lemma lookup_hd:
  "\<lbrakk> length l > 0; f (l!0) \<rbrakk> \<Longrightarrow> lookup l f = Some (l!0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < length l; f (l ! 0)\<rbrakk> \<Longrightarrow> lookup l f = Some (l ! 0)
[PROOF STEP]
by (induct l) auto


[STATEMENT]
lemma n_add_distl: "(n x \<cdot> n y) + n z = (n x + n z) \<cdot> (n y + n z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. !x \<cdot> !y + !z = (!x + !z) \<cdot> (!y + !z)
[PROOF STEP]
by (simp add: add_commute n_add_distr)


[STATEMENT]
lemma span_singleton: "span {x} = range (\<lambda>k. k *s x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span {x} = range (\<lambda>k. k *s x)
[PROOF STEP]
by (auto simp: span_finite)


[STATEMENT]
lemma int_card_UNION:
  assumes "finite A"
    and "\<forall>k \<in> A. finite k"
  shows "int (card (\<Union>A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter>I)))"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "?rhs = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter>I. 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I))) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter> I. 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I))) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter> I. 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I))) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter> I. 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "\<dots> = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (\<Sum>_\<in>\<Inter>I. (- 1) ^ (card I + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter> I. 1)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. \<Sum>_\<in>\<Inter> I. (- 1) ^ (card I + 1))
[PROOF STEP]
by (subst sum_distrib_left) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter> I. 1)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. \<Sum>_\<in>\<Inter> I. (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter> I. 1)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. \<Sum>_\<in>\<Inter> I. (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "\<dots> = (\<Sum>(I, _)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} Inter. (- 1) ^ (card I + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. \<Sum>_\<in>\<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>(I, uu_)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} \<Inter>. (- 1) ^ (card I + 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>k\<in>A. finite k

goal (1 subgoal):
 1. (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. \<Sum>_\<in>\<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>(I, uu_)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} \<Inter>. (- 1) ^ (card I + 1))
[PROOF STEP]
by (subst sum.Sigma) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. \<Sum>_\<in>\<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>(I, uu_)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} \<Inter>. (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. \<Sum>_\<in>\<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>(I, uu_)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} \<Inter>. (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "\<dots> = (\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter>I}). (- 1) ^ (card I + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(I, uu_)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} \<Inter>. (- 1) ^ (card I + 1)) = (\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1))
[PROOF STEP]
by (rule sum.reindex_cong [where l = "\<lambda>(x, y). (y, x)"]) (auto intro: inj_onI)
[PROOF STATE]
proof (state)
this:
(\<Sum>(I, uu_)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} \<Inter>. (- 1) ^ (card I + 1)) = (\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(I, uu_)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} \<Inter>. (- 1) ^ (card I + 1)) = (\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "\<dots> = (\<Sum>(x, I)\<in>(SIGMA x:\<Union>A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter>I}). (- 1) ^ (card I + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>k\<in>A. finite k

goal (1 subgoal):
 1. (\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1))
[PROOF STEP]
by (auto intro!: sum.mono_neutral_cong_right finite_SigmaI2 intro: finite_subset[where B="\<Union>A"])
[PROOF STATE]
proof (state)
this:
(\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>\<Union>A. (\<Sum>I|I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter>I. (- 1) ^ (card I + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>x\<in>\<Union> A. \<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>k\<in>A. finite k

goal (1 subgoal):
 1. (\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>x\<in>\<Union> A. \<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1))
[PROOF STEP]
by (subst sum.Sigma) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>x\<in>\<Union> A. \<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(x, I)\<in>(SIGMA x:\<Union> A. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}). (- 1) ^ (card I + 1)) = (\<Sum>x\<in>\<Union> A. \<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "\<dots> = (\<Sum>_\<in>\<Union>A. 1)" (is "sum ?lhs _ = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>\<Union> A. \<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>_\<in>\<Union> A. 1)
[PROOF STEP]
proof (rule sum.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
assume x: "x \<in> \<Union>A"
[PROOF STATE]
proof (state)
this:
x \<in> \<Union> A

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
define K where "K = {X \<in> A. x \<in> X}"
[PROOF STATE]
proof (state)
this:
K = {X \<in> A. x \<in> X}

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
with \<open>finite A\<close>
[PROOF STATE]
proof (chain)
picking this:
finite A
K = {X \<in> A. x \<in> X}
[PROOF STEP]
have K: "finite K"
[PROOF STATE]
proof (prove)
using this:
finite A
K = {X \<in> A. x \<in> X}

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

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
let ?I = "\<lambda>i. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "inj_on snd (SIGMA i:{1..card A}. ?I i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on snd (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>k\<in>A. finite k

goal (1 subgoal):
 1. inj_on snd (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})
[PROOF STEP]
by (auto intro!: inj_onI)
[PROOF STATE]
proof (state)
this:
inj_on snd (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on snd (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have [symmetric]: "snd ` (SIGMA i:{1..card A}. ?I i) = {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter>I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd ` (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}) = {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>k\<in>A. finite k

goal (1 subgoal):
 1. snd ` (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}) = {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I}
[PROOF STEP]
by (auto intro!: rev_image_eqI[where x="(card a, a)" for a]
        simp add: card_gt_0_iff[folded Suc_le_eq]
        dest: finite_subset intro: card_mono)
[PROOF STATE]
proof (state)
this:
{I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I} = snd ` (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on snd (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})
{I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I} = snd ` (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})
[PROOF STEP]
have "?lhs x = (\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. ?I i). (- 1) ^ (i + 1))"
[PROOF STATE]
proof (prove)
using this:
inj_on snd (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})
{I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I} = snd ` (SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I})

goal (1 subgoal):
 1. (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}). (- 1) ^ (i + 1))
[PROOF STEP]
by (rule sum.reindex_cong [where l = snd]) fastforce
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}). (- 1) ^ (i + 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}). (- 1) ^ (i + 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "\<dots> = (\<Sum>i=1..card A. (\<Sum>I|I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I. (- 1) ^ (i + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}). (- 1) ^ (i + 1)) = (\<Sum>i = 1..card A. \<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. (- 1) ^ (i + 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>k\<in>A. finite k

goal (1 subgoal):
 1. (\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}). (- 1) ^ (i + 1)) = (\<Sum>i = 1..card A. \<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. (- 1) ^ (i + 1))
[PROOF STEP]
by (subst sum.Sigma) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}). (- 1) ^ (i + 1)) = (\<Sum>i = 1..card A. \<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. (- 1) ^ (i + 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(i, I)\<in>(SIGMA i:{1..card A}. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I}). (- 1) ^ (i + 1)) = (\<Sum>i = 1..card A. \<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. (- 1) ^ (i + 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "\<dots> = (\<Sum>i=1..card A. (- 1) ^ (i + 1) * (\<Sum>I|I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I. 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 1..card A. \<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. (- 1) ^ (i + 1)) = (\<Sum>i = 1..card A. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1))
[PROOF STEP]
by (subst sum_distrib_left) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..card A. \<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. (- 1) ^ (i + 1)) = (\<Sum>i = 1..card A. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..card A. \<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. (- 1) ^ (i + 1)) = (\<Sum>i = 1..card A. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "\<dots> = (\<Sum>i=1..card K. (- 1) ^ (i + 1) * (\<Sum>I|I \<subseteq> K \<and> card I = i. 1))"
      (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 1..card A. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1)) = (\<Sum>i = 1..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1))
[PROOF STEP]
proof (rule sum.mono_neutral_cong_right[rule_format])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite {1..card A}
 2. {1..card K} \<subseteq> {1..card A}
 3. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 4. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
show "finite {1..card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {1..card A}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {1..card A}

goal (3 subgoals):
 1. {1..card K} \<subseteq> {1..card A}
 2. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 3. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
show "{1..card K} \<subseteq> {1..card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1..card K} \<subseteq> {1..card A}
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. {1..card K} \<subseteq> {1..card A}
[PROOF STEP]
by (auto simp add: K_def intro: card_mono)
[PROOF STATE]
proof (state)
this:
{1..card K} \<subseteq> {1..card A}

goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
assume "i \<in> {1..card A} - {1..card K}"
[PROOF STATE]
proof (state)
this:
i \<in> {1..card A} - {1..card K}

goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> {1..card A} - {1..card K}
[PROOF STEP]
have i: "i \<le> card A" "card K < i"
[PROOF STATE]
proof (prove)
using this:
i \<in> {1..card A} - {1..card K}

goal (1 subgoal):
 1. i \<le> card A &&& card K < i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<le> card A
card K < i

goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
have "{I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I} = {I. I \<subseteq> K \<and> card I = i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I} = {I. I \<subseteq> K \<and> card I = i}
[PROOF STEP]
by (auto simp add: K_def)
[PROOF STATE]
proof (state)
this:
{I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I} = {I. I \<subseteq> K \<and> card I = i}

goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I} = {I. I \<subseteq> K \<and> card I = i}

goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
have "\<dots> = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {I. I \<subseteq> K \<and> card I = i} = {}
[PROOF STEP]
using \<open>finite A\<close> i
[PROOF STATE]
proof (prove)
using this:
finite A
i \<le> card A
card K < i

goal (1 subgoal):
 1. {I. I \<subseteq> K \<and> card I = i} = {}
[PROOF STEP]
by (auto simp add: K_def dest: card_mono[rotated 1])
[PROOF STATE]
proof (state)
this:
{I. I \<subseteq> K \<and> card I = i} = {}

goal (2 subgoals):
 1. \<And>i. i \<in> {1..card A} - {1..card K} \<Longrightarrow> (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
 2. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I} = {}
[PROOF STEP]
show "(- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I. 1 :: int) = 0"
[PROOF STATE]
proof (prove)
using this:
{I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I} = {}

goal (1 subgoal):
 1. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0
[PROOF STEP]
by (metis mult_zero_right sum.empty)
[PROOF STATE]
proof (state)
this:
(- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = 0

goal (1 subgoal):
 1. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
have "(\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I. 1) = (\<Sum>I | I \<subseteq> K \<and> card I = i. 1 :: int)"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)
[PROOF STEP]
by (rule sum.cong) (auto simp add: K_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)

goal (1 subgoal):
 1. \<And>xa. xa \<in> {1..card K} \<Longrightarrow> (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = xa \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (xa + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = xa. 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)
[PROOF STEP]
show "(- 1) ^ (i + 1) * ?lhs = (- 1) ^ (i + 1) * ?rhs"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)

goal (1 subgoal):
 1. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1) = (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..card A. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1)) = (\<Sum>i = 1..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..card A. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter> I. 1)) = (\<Sum>i = 1..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1))

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "{I. I \<subseteq> K \<and> card I = 0} = {{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {I. I \<subseteq> K \<and> card I = 0} = {{}}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>k\<in>A. finite k

goal (1 subgoal):
 1. {I. I \<subseteq> K \<and> card I = 0} = {{}}
[PROOF STEP]
by (auto simp add: card_eq_0_iff K_def dest: finite_subset)
[PROOF STATE]
proof (state)
this:
{I. I \<subseteq> K \<and> card I = 0} = {{}}

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{I. I \<subseteq> K \<and> card I = 0} = {{}}
[PROOF STEP]
have "?rhs = (\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1 :: int)) + 1"
[PROOF STATE]
proof (prove)
using this:
{I. I \<subseteq> K \<and> card I = 0} = {{}}

goal (1 subgoal):
 1. (\<Sum>i = 1..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) = (\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) + 1
[PROOF STEP]
by (subst (2) sum.atLeast_Suc_atMost) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) = (\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) = (\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..card K. (- 1) * ((- 1) ^ i * int (card K choose i))) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) + 1 = (\<Sum>i = 0..card K. - 1 * ((- 1) ^ i * int (card K choose i))) + 1
[PROOF STEP]
using K
[PROOF STATE]
proof (prove)
using this:
finite K

goal (1 subgoal):
 1. (\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) + 1 = (\<Sum>i = 0..card K. - 1 * ((- 1) ^ i * int (card K choose i))) + 1
[PROOF STEP]
by (subst n_subsets[symmetric]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) + 1 = (\<Sum>i = 0..card K. - 1 * ((- 1) ^ i * int (card K choose i))) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..card K. (- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> K \<and> card I = i. 1)) + 1 = (\<Sum>i = 0..card K. - 1 * ((- 1) ^ i * int (card K choose i))) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "\<dots> = - (\<Sum>i = 0..card K. (- 1) ^ i * int (card K choose i)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..card K. - 1 * ((- 1) ^ i * int (card K choose i))) + 1 = - (\<Sum>i = 0..card K. (- 1) ^ i * int (card K choose i)) + 1
[PROOF STEP]
by (subst sum_distrib_left[symmetric]) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..card K. - 1 * ((- 1) ^ i * int (card K choose i))) + 1 = - (\<Sum>i = 0..card K. (- 1) ^ i * int (card K choose i)) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..card K. - 1 * ((- 1) ^ i * int (card K choose i))) + 1 = - (\<Sum>i = 0..card K. (- 1) ^ i * int (card K choose i)) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "\<dots> =  - ((-1 + 1) ^ card K) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>i = 0..card K. (- 1) ^ i * int (card K choose i)) + 1 = - ((- 1 + 1) ^ card K) + 1
[PROOF STEP]
by (subst binomial_ring) (simp add: ac_simps atMost_atLeast0)
[PROOF STATE]
proof (state)
this:
- (\<Sum>i = 0..card K. (- 1) ^ i * int (card K choose i)) + 1 = - ((- 1 + 1) ^ card K) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<Sum>i = 0..card K. (- 1) ^ i * int (card K choose i)) + 1 = - ((- 1 + 1) ^ card K) + 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ((- 1 + 1) ^ card K) + 1 = 1
[PROOF STEP]
using x K
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> A
finite K

goal (1 subgoal):
 1. - ((- 1 + 1) ^ card K) + 1 = 1
[PROOF STEP]
by (auto simp add: K_def card_gt_0_iff)
[PROOF STATE]
proof (state)
this:
- ((- 1 + 1) ^ card K) + 1 = 1

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> A \<Longrightarrow> (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
show "?lhs x = 1"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1

goal (1 subgoal):
 1. (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>\<Union> A. \<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>_\<in>\<Union> A. 1)

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>\<Union> A. \<Sum>I | I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter> I. (- 1) ^ (card I + 1)) = (\<Sum>_\<in>\<Union> A. 1)

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
have "\<dots> = int (card (\<Union>A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>_\<in>\<Union> A. 1) = int (card (\<Union> A))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>_\<in>\<Union> A. 1) = int (card (\<Union> A))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I))) = int (card (\<Union> A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I))) = int (card (\<Union> A))

goal (1 subgoal):
 1. int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
int (card (\<Union> A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code]:
  "division_segment (n::natural) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. division_segment n = 1
[PROOF STEP]
by (simp add: natural_eq_iff)


[STATEMENT]
lemma PosOrd_Stars_appendE:
  assumes "Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2)"
  shows "Stars vs1 :\<sqsubset>val Stars vs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stars vs1 :\<sqsubset>val Stars vs2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2)

goal (1 subgoal):
 1. Stars vs1 :\<sqsubset>val Stars vs2
[PROOF STEP]
apply(induct vs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Stars ([] @ vs1) :\<sqsubset>val Stars ([] @ vs2) \<Longrightarrow> Stars vs1 :\<sqsubset>val Stars vs2
 2. \<And>a vs. \<lbrakk>Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2) \<Longrightarrow> Stars vs1 :\<sqsubset>val Stars vs2; Stars ((a # vs) @ vs1) :\<sqsubset>val Stars ((a # vs) @ vs2)\<rbrakk> \<Longrightarrow> Stars vs1 :\<sqsubset>val Stars vs2
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a vs. \<lbrakk>Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2) \<Longrightarrow> Stars vs1 :\<sqsubset>val Stars vs2; Stars ((a # vs) @ vs1) :\<sqsubset>val Stars ((a # vs) @ vs2)\<rbrakk> \<Longrightarrow> Stars vs1 :\<sqsubset>val Stars vs2
[PROOF STEP]
apply(simp add: PosOrd_StarsE2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in normal_set) ordering_mem: "ordering A x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OrdinalVeblen.ordering A x \<in> A
[PROOF STEP]
apply (rule_tac a=x in oLimit_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. OrdinalVeblen.ordering A 0 \<in> A
 2. \<And>x. OrdinalVeblen.ordering A x \<in> A \<Longrightarrow> OrdinalVeblen.ordering A (oSuc x) \<in> A
 3. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n. OrdinalVeblen.ordering A (f n) \<in> A\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering A (oLimit f) \<in> A
[PROOF STEP]
apply (subst ordering_0)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (LEAST z. z \<in> A) \<in> A
 2. \<And>x. OrdinalVeblen.ordering A x \<in> A \<Longrightarrow> OrdinalVeblen.ordering A (oSuc x) \<in> A
 3. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n. OrdinalVeblen.ordering A (f n) \<in> A\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering A (oLimit f) \<in> A
[PROOF STEP]
apply (rule LeastI_ex)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<exists>x. x \<in> A
 2. \<And>x. OrdinalVeblen.ordering A x \<in> A \<Longrightarrow> OrdinalVeblen.ordering A (oSuc x) \<in> A
 3. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n. OrdinalVeblen.ordering A (f n) \<in> A\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering A (oLimit f) \<in> A
[PROOF STEP]
apply (cut_tac unbounded, force)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. OrdinalVeblen.ordering A x \<in> A \<Longrightarrow> OrdinalVeblen.ordering A (oSuc x) \<in> A
 2. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n. OrdinalVeblen.ordering A (f n) \<in> A\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering A (oLimit f) \<in> A
[PROOF STEP]
apply (subst ordering_oSuc)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. OrdinalVeblen.ordering A x \<in> A \<Longrightarrow> (LEAST z. z \<in> A \<and> OrdinalVeblen.ordering A x < z) \<in> A
 2. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n. OrdinalVeblen.ordering A (f n) \<in> A\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering A (oLimit f) \<in> A
[PROOF STEP]
apply (rule mem_next)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n. OrdinalVeblen.ordering A (f n) \<in> A\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering A (oLimit f) \<in> A
[PROOF STEP]
apply (subst ordering_oLimit)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n. OrdinalVeblen.ordering A (f n) \<in> A\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering A (f n)) \<in> A
[PROOF STEP]
apply (erule closed)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma frequently_filtercomapI:
  assumes "filterlim (\<lambda>n. f (g n)) F G"
  assumes "eventually (\<lambda>n. P (g n)) G"
  assumes "G \<noteq> bot"
  shows   "frequently P (filtercomap f F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frequently P (filtercomap f F)
[PROOF STEP]
using frequently_going_toI[of f g F G P UNIV] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>LIM n G. f (g n) :> F; \<forall>\<^sub>F n in G. P (g n); \<forall>\<^sub>F n in G. g n \<in> UNIV; G \<noteq> bot\<rbrakk> \<Longrightarrow> frequently P (f going_to F)
LIM n G. f (g n) :> F
\<forall>\<^sub>F n in G. P (g n)
G \<noteq> bot

goal (1 subgoal):
 1. frequently P (filtercomap f F)
[PROOF STEP]
by (simp add: going_to_def)


[STATEMENT]
lemma prob_space_exponential_density: "0 < l \<Longrightarrow> prob_space (density lborel (exponential_density l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < l \<Longrightarrow> prob_space (density lborel (\<lambda>x. ennreal (exponential_density l x)))
[PROOF STEP]
by (rule prob_space_erlang_density)


[STATEMENT]
lemma fps_deriv_power':
  fixes a :: "'a::comm_semiring_1 fps"
  shows "fps_deriv (a ^ n) = (of_nat n) * fps_deriv a * a ^ (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
have "fps_deriv (a^Suc m) = of_nat (Suc m) * fps_deriv a * a^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (a ^ Suc m) = of_nat (Suc m) * fps_deriv a * a ^ m
[PROOF STEP]
by (induct m) (simp_all add: algebra_simps)
[PROOF STATE]
proof (state)
this:
fps_deriv (a ^ Suc m) = of_nat (Suc m) * fps_deriv a * a ^ m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n = Suc m
fps_deriv (a ^ Suc m) = of_nat (Suc m) * fps_deriv a * a ^ m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc m
fps_deriv (a ^ Suc m) = of_nat (Suc m) * fps_deriv a * a ^ m

goal (1 subgoal):
 1. fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> fps_deriv (a ^ n) = of_nat n * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
qed simp


[STATEMENT]
lemma card_not_singleton: \<open>CARD('a::not_singleton) \<noteq> 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a) \<noteq> 1
[PROOF STEP]
by (simp add: card_1_singleton_iff)


[STATEMENT]
lemma analytically_valid_imp_part_deriv_integrable_on:
  assumes "analytically_valid (s::(real*real) set) (f::(real*real)\<Rightarrow> real) i"
  shows "(partial_vector_derivative f i) integrable_on s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_vector_derivative f i integrable_on s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. partial_vector_derivative f i integrable_on s
[PROOF STEP]
have "integrable lborel (\<lambda>p. partial_vector_derivative f i p * indicator s p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>p. partial_vector_derivative f i p * indicat_real s p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
analytically_valid s f i

goal (1 subgoal):
 1. integrable lborel (\<lambda>p. partial_vector_derivative f i p * indicat_real s p)
[PROOF STEP]
by(simp add:  analytically_valid_def indic_ident)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>p. partial_vector_derivative f i p * indicat_real s p)

goal (1 subgoal):
 1. partial_vector_derivative f i integrable_on s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable lborel (\<lambda>p. partial_vector_derivative f i p * indicat_real s p)
[PROOF STEP]
have "integrable lborel (\<lambda>p::(real*real). if p \<in> s then partial_vector_derivative f i p else 0)"
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>p. partial_vector_derivative f i p * indicat_real s p)

goal (1 subgoal):
 1. integrable lborel (\<lambda>p. if p \<in> s then partial_vector_derivative f i p else 0)
[PROOF STEP]
using indic_ident[of "partial_vector_derivative f i"]
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>p. partial_vector_derivative f i p * indicat_real s p)
(\<lambda>x. partial_vector_derivative f i x * indicat_real ?s x) = (\<lambda>x. if x \<in> ?s then partial_vector_derivative f i x else 0)

goal (1 subgoal):
 1. integrable lborel (\<lambda>p. if p \<in> s then partial_vector_derivative f i p else 0)
[PROOF STEP]
by (simp add: indic_ident)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>p. if p \<in> s then partial_vector_derivative f i p else 0)

goal (1 subgoal):
 1. partial_vector_derivative f i integrable_on s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable lborel (\<lambda>p. if p \<in> s then partial_vector_derivative f i p else 0)
[PROOF STEP]
have "(\<lambda>x. if x \<in> s then partial_vector_derivative f i x else 0) integrable_on UNIV"
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>p. if p \<in> s then partial_vector_derivative f i p else 0)

goal (1 subgoal):
 1. (\<lambda>x. if x \<in> s then partial_vector_derivative f i x else 0) integrable_on UNIV
[PROOF STEP]
using Equivalence_Lebesgue_Henstock_Integration.integrable_on_lborel
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>p. if p \<in> s then partial_vector_derivative f i p else 0)
integrable lborel ?f \<Longrightarrow> ?f integrable_on UNIV

goal (1 subgoal):
 1. (\<lambda>x. if x \<in> s then partial_vector_derivative f i x else 0) integrable_on UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> s then partial_vector_derivative f i x else 0) integrable_on UNIV

goal (1 subgoal):
 1. partial_vector_derivative f i integrable_on s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. if x \<in> s then partial_vector_derivative f i x else 0) integrable_on UNIV
[PROOF STEP]
show "(partial_vector_derivative f i) integrable_on s"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if x \<in> s then partial_vector_derivative f i x else 0) integrable_on UNIV

goal (1 subgoal):
 1. partial_vector_derivative f i integrable_on s
[PROOF STEP]
using integrable_restrict_UNIV
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if x \<in> s then partial_vector_derivative f i x else 0) integrable_on UNIV
((\<lambda>x. if x \<in> ?s then ?f x else (0::?'a)) integrable_on UNIV) = (?f integrable_on ?s)

goal (1 subgoal):
 1. partial_vector_derivative f i integrable_on s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
partial_vector_derivative f i integrable_on s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma outside: "outside S = {x. \<not> bounded(connected_component_set (- S) x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outside S = {x. \<not> bounded (connected_component_set (- S) x)}
[PROOF STEP]
by (auto simp: outside_def) (metis Compl_iff bounded_empty connected_component_eq_empty)


[STATEMENT]
lemma convolution_emeasure:
  assumes "A \<in> sets borel" "finite_measure M" "finite_measure N"
  assumes [simp]: "sets N = sets borel" "sets M = sets borel"
  assumes [simp]: "space M = space N" "space N = space borel"
  shows "emeasure (M \<star> N) A = \<integral>\<^sup>+x. (emeasure N {a. a + x \<in> A}) \<partial>M "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (M \<star> N) A = \<integral>\<^sup>+ x. emeasure N {a. a + x \<in> A} \<partial>M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> sets borel
finite_measure M
finite_measure N
sets N = sets borel
sets M = sets borel
space M = space N
space N = space borel

goal (1 subgoal):
 1. emeasure (M \<star> N) A = \<integral>\<^sup>+ x. emeasure N {a. a + x \<in> A} \<partial>M
[PROOF STEP]
by (auto intro!: nn_integral_cong simp del: nn_integral_indicator simp: nn_integral_convolution
    nn_integral_indicator [symmetric] ac_simps split:split_indicator)


[STATEMENT]
lemma span_Un:
  assumes U: "U \<subseteq> carrier V" and U': "U' \<subseteq> carrier V" and UU': "span U = span U'"
      and W: "W \<subseteq> carrier V" and W': "W' \<subseteq> carrier V" and WW': "span W = span W'"
  shows "span (U \<union> W) = span (U' \<union> W')" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (U \<union> W) = span (U' \<union> W')
[PROOF STEP]
using span_union1[OF assms]
[PROOF STATE]
proof (prove)
using this:
span (U \<union> W) \<subseteq> span (U' \<union> W')

goal (1 subgoal):
 1. span (U \<union> W) = span (U' \<union> W')
[PROOF STEP]
using span_union1[OF U' U UU'[symmetric] W' W WW'[symmetric]]
[PROOF STATE]
proof (prove)
using this:
span (U \<union> W) \<subseteq> span (U' \<union> W')
span (U' \<union> W') \<subseteq> span (U \<union> W)

goal (1 subgoal):
 1. span (U \<union> W) = span (U' \<union> W')
[PROOF STEP]
by auto


[STATEMENT]
lemma aux_4: "x \<prec> y \<Longrightarrow> \<not> dbm_add x z \<prec> dbm_add y z \<Longrightarrow> dbm_add x z = dbm_add y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<prec> y; \<not> x \<otimes> z \<prec> y \<otimes> z\<rbrakk> \<Longrightarrow> x \<otimes> z = y \<otimes> z
[PROOF STEP]
by (cases x y rule: dbm_lt.cases) ((cases z), auto)+


[STATEMENT]
lemma subset_Imagep: "B \<subseteq> r ``` A \<longleftrightarrow> (\<forall>b\<in>B. \<exists>a\<in>A. r a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B \<subseteq> r ``` A) = (\<forall>b\<in>B. \<exists>a\<in>A. r a b)
[PROOF STEP]
by (auto simp: Imagep_def)


[STATEMENT]
lemma of_complex_inverse [simp]:
  "of_complex (inverse x) = inverse (of_complex x :: 'a::{complex_div_algebra,division_ring})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_complex (inverse x) = inverse (of_complex x)
[PROOF STEP]
by (simp add: of_complex_def inverse_scaleC_distrib)


[STATEMENT]
lemma "\<not>(\<exists>x. P x \<and> (Q x \<or> R x)) \<and>
      (\<exists>x. L x \<and> P x) \<and>
      (\<forall>x. \<not> R x \<longrightarrow> M x)
    \<longrightarrow> (\<exists>x. L x \<and> M x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>x. P x \<and> (Q x \<or> R x)) \<and> (\<exists>x. L x \<and> P x) \<and> (\<forall>x. \<not> R x \<longrightarrow> M x) \<longrightarrow> (\<exists>x. L x \<and> M x)
[PROOF STEP]
by blast


[STATEMENT]
lemma integral_combine_division_topdown:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  assumes "f integrable_on S"
    and "\<D> division_of S"
  shows "integral S f = sum (\<lambda>i. integral i f) \<D>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral S f = (\<Sum>i\<in>\<D>. integral i f)
[PROOF STEP]
using assms has_integral_combine_division_topdown
[PROOF STATE]
proof (prove)
using this:
f integrable_on S
\<D> division_of S
\<lbrakk>?f integrable_on ?S; ?\<D> division_of ?K; ?K \<subseteq> ?S\<rbrakk> \<Longrightarrow> (?f has_integral (\<Sum>i\<in>?\<D>. integral i ?f)) ?K

goal (1 subgoal):
 1. integral S f = (\<Sum>i\<in>\<D>. integral i f)
[PROOF STEP]
by blast