[STATEMENT]
lemma pr_comp2_2': "\<lbrakk> pr_conv_2_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1' \<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda> x y. f (g x y) (h x y)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y)) \<in> PrimRec1'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y)) \<in> PrimRec1'
[PROOF STEP]
assume "pr_conv_2_to_1 f \<in> PrimRec1'"
  and "pr_conv_2_to_1 g \<in> PrimRec1'" (is "?g1 \<in> PrimRec1'")
  and "pr_conv_2_to_1 h \<in> PrimRec1'" (is "?h1 \<in> PrimRec1'")
[PROOF STATE]
proof (state)
this:
pr_conv_2_to_1 f \<in> PrimRec1'
pr_conv_2_to_1 g \<in> PrimRec1'
pr_conv_2_to_1 h \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y)) \<in> PrimRec1'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pr_conv_2_to_1 f \<in> PrimRec1'
pr_conv_2_to_1 g \<in> PrimRec1'
pr_conv_2_to_1 h \<in> PrimRec1'
[PROOF STEP]
have "(\<lambda> x. f (?g1 x) (?h1 x)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
pr_conv_2_to_1 f \<in> PrimRec1'
pr_conv_2_to_1 g \<in> PrimRec1'
pr_conv_2_to_1 h \<in> PrimRec1'

goal (1 subgoal):
 1. (\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x)) \<in> PrimRec1'
[PROOF STEP]
by (rule pr_comp2_1')
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x)) \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y)) \<in> PrimRec1'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x)) \<in> PrimRec1'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x)) \<in> PrimRec1'

goal (1 subgoal):
 1. pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y)) \<in> PrimRec1'
[PROOF STEP]
by (simp add: pr_conv_2_to_1_def)
[PROOF STATE]
proof (state)
this:
pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y)) \<in> PrimRec1'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image2_eqI: "\<lbrakk>b = f x; c = g x; x \<in> A\<rbrakk> \<Longrightarrow> (b, c) \<in> image2 A f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b = f x; c = g x; x \<in> A\<rbrakk> \<Longrightarrow> (b, c) \<in> image2 A f g
[PROOF STEP]
unfolding image2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b = f x; c = g x; x \<in> A\<rbrakk> \<Longrightarrow> (b, c) \<in> {(f a, g a) |a. a \<in> A}
[PROOF STEP]
by auto


[STATEMENT]
lemma "ipv4addr_of_dotdecimal (192,168,42,8) \<in> (ipset_from_cidr (ipv4addr_of_dotdecimal (192,168,0,0)) 16)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipv4addr_of_dotdecimal (192, 168, 42, 8) \<in> ipset_from_cidr (ipv4addr_of_dotdecimal (192, 168, 0, 0)) 16
[PROOF STEP]
by (simp add: ipv4addr_of_nat_def ipset_from_cidr_def ipv4addr_of_dotdecimal.simps
      ipset_from_netmask_def mask_eq_exp_minus_1 word_le_def)


[STATEMENT]
lemma map_last_prefixes [simp]:
  shows "map last (tl (prefixes p)) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map last (tl (prefixes p)) = p
[PROOF STEP]
unfolding list_eq_iff_nth_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map last (tl (prefixes p))) = length p \<and> (\<forall>i<length (map last (tl (prefixes p))). map last (tl (prefixes p)) ! i = p ! i)
[PROOF STEP]
using last_prefixes
[PROOF STATE]
proof (prove)
using this:
?i < length ?p \<Longrightarrow> last (tl (prefixes ?p) ! ?i) = ?p ! ?i

goal (1 subgoal):
 1. length (map last (tl (prefixes p))) = length p \<and> (\<forall>i<length (map last (tl (prefixes p))). map last (tl (prefixes p)) ! i = p ! i)
[PROOF STEP]
by auto


[STATEMENT]
lemma euler_approx_aux_Suc:
  "euler_approx_aux (Suc m) = 1 + Suc m * euler_approx_aux m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_approx_aux (Suc m) = 1 + Suc m * euler_approx_aux m
[PROOF STEP]
unfolding euler_approx_aux_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>Suc m. \<Prod>{k + 1..Suc m}) = 1 + Suc m * (\<Sum>k\<le>m. \<Prod>{k + 1..m})
[PROOF STEP]
by (subst sum_distrib_left) (simp add: atLeastAtMostSuc_conv mult.commute)


[STATEMENT]
lemma truncate_down_log2_eqI:
  assumes "\<lfloor>log 2 \<bar>x\<bar>\<rfloor> = \<lfloor>log 2 \<bar>y\<bar>\<rfloor>"
  assumes "\<lfloor>x * 2 powr (p - \<lfloor>log 2 \<bar>x\<bar>\<rfloor>)\<rfloor> = \<lfloor>y * 2 powr (p - \<lfloor>log 2 \<bar>x\<bar>\<rfloor>)\<rfloor>"
  shows "truncate_down p x = truncate_down p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. truncate_down p x = truncate_down p y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lfloor>log 2 \<bar>x\<bar>\<rfloor> = \<lfloor>log 2 \<bar>y\<bar>\<rfloor>
\<lfloor>x * 2 powr real_of_int (int p - \<lfloor>log 2 \<bar>x\<bar>\<rfloor>)\<rfloor> = \<lfloor>y * 2 powr real_of_int (int p - \<lfloor>log 2 \<bar>x\<bar>\<rfloor>)\<rfloor>

goal (1 subgoal):
 1. truncate_down p x = truncate_down p y
[PROOF STEP]
by (auto simp: truncate_down_def round_down_def)


[STATEMENT]
theorem derived_alt_group_const:
  assumes "n \<ge> 5" shows "derived (alt_group n) (carrier (alt_group n)) = carrier (alt_group n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. derived (alt_group n) (carrier (alt_group n)) = carrier (alt_group n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. derived (alt_group n) (carrier (alt_group n)) \<subseteq> carrier (alt_group n)
 2. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
show "derived (alt_group n) (carrier (alt_group n)) \<subseteq> carrier (alt_group n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. derived (alt_group n) (carrier (alt_group n)) \<subseteq> carrier (alt_group n)
[PROOF STEP]
using group.derived_in_carrier[OF alt_group_is_group]
[PROOF STATE]
proof (prove)
using this:
?H \<subseteq> carrier (alt_group ?n1) \<Longrightarrow> derived (alt_group ?n1) ?H \<subseteq> carrier (alt_group ?n1)

goal (1 subgoal):
 1. derived (alt_group n) (carrier (alt_group n)) \<subseteq> carrier (alt_group n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
derived (alt_group n) (carrier (alt_group n)) \<subseteq> carrier (alt_group n)

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
assume "p \<in> three_cycles n"
[PROOF STATE]
proof (state)
this:
p \<in> three_cycles n

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "p \<in> derived (alt_group n) (carrier (alt_group n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
obtain cs where cs: "p = cycle_of_list cs" "cycle cs" "length cs = 3" "set cs \<subseteq> {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>cs. \<lbrakk>p = cycle_of_list cs; cycle cs; length cs = 3; set cs \<subseteq> {1..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>p \<in> three_cycles n\<close>
[PROOF STATE]
proof (prove)
using this:
p \<in> three_cycles n

goal (1 subgoal):
 1. (\<And>cs. \<lbrakk>p = cycle_of_list cs; cycle cs; length cs = 3; set cs \<subseteq> {1..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = cycle_of_list cs
cycle cs
length cs = 3
set cs \<subseteq> {1..n}

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = cycle_of_list cs
cycle cs
length cs = 3
set cs \<subseteq> {1..n}
[PROOF STEP]
obtain a b c where cs_def: "cs = [ a, b, c ]"
[PROOF STATE]
proof (prove)
using this:
p = cycle_of_list cs
cycle cs
length cs = 3
set cs \<subseteq> {1..n}

goal (1 subgoal):
 1. (\<And>a b c. cs = [a, b, c] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using stupid_lemma[OF cs(3)]
[PROOF STATE]
proof (prove)
using this:
p = cycle_of_list cs
cycle cs
length cs = 3
set cs \<subseteq> {1..n}
cs = [cs ! 0, cs ! 1, cs ! 2]

goal (1 subgoal):
 1. (\<And>a b c. cs = [a, b, c] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cs = [a, b, c]

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "card (set cs) = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set cs) = 3
[PROOF STEP]
using cs(2-3)
[PROOF STATE]
proof (prove)
using this:
cycle cs
length cs = 3

goal (1 subgoal):
 1. card (set cs) = 3
[PROOF STEP]
by (simp add: distinct_card)
[PROOF STATE]
proof (state)
this:
card (set cs) = 3

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "set cs \<noteq> {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set cs \<noteq> {1..n}
[PROOF STEP]
using assms cs(3)
[PROOF STATE]
proof (prove)
using this:
5 \<le> n
length cs = 3

goal (1 subgoal):
 1. set cs \<noteq> {1..n}
[PROOF STEP]
unfolding sym[OF distinct_card[OF cs(2)]]
[PROOF STATE]
proof (prove)
using this:
5 \<le> n
card (set cs) = 3

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

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set cs \<noteq> {1..n}
[PROOF STEP]
obtain d where d: "d \<notin> set cs" "d \<in> {1..n}"
[PROOF STATE]
proof (prove)
using this:
set cs \<noteq> {1..n}

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>d \<notin> set cs; d \<in> {1..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using cs(4)
[PROOF STATE]
proof (prove)
using this:
set cs \<noteq> {1..n}
set cs \<subseteq> {1..n}

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>d \<notin> set cs; d \<in> {1..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d \<notin> set cs
d \<in> {1..n}

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
hence "cycle (d # cs)" and "length (d # cs) = 4" and "card {1..n} = n"
[PROOF STATE]
proof (prove)
using this:
d \<notin> set cs
d \<in> {1..n}

goal (1 subgoal):
 1. cycle (d # cs) &&& length (d # cs) = 4 &&& card {1..n} = n
[PROOF STEP]
using cs(2-3)
[PROOF STATE]
proof (prove)
using this:
d \<notin> set cs
d \<in> {1..n}
cycle cs
length cs = 3

goal (1 subgoal):
 1. cycle (d # cs) &&& length (d # cs) = 4 &&& card {1..n} = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cycle (d # cs)
length (d # cs) = 4
card {1..n} = n

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
hence "set (d # cs) \<noteq> {1..n}"
[PROOF STATE]
proof (prove)
using this:
cycle (d # cs)
length (d # cs) = 4
card {1..n} = n

goal (1 subgoal):
 1. set (d # cs) \<noteq> {1..n}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cycle (d # cs)
length (d # cs) = 4
card {1..n} = n
5 \<le> n

goal (1 subgoal):
 1. set (d # cs) \<noteq> {1..n}
[PROOF STEP]
unfolding sym[OF distinct_card[OF \<open>cycle (d # cs)\<close>]]
[PROOF STATE]
proof (prove)
using this:
cycle (d # cs)
card (set (d # cs)) = 4
card {1..n} = n
5 \<le> n

goal (1 subgoal):
 1. set (d # cs) \<noteq> {1..n}
[PROOF STEP]
by (metis Suc_n_not_le_n eval_nat_numeral(3))
[PROOF STATE]
proof (state)
this:
set (d # cs) \<noteq> {1..n}

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (d # cs) \<noteq> {1..n}
[PROOF STEP]
obtain e where e: "e \<notin> set (d # cs)" "e \<in> {1..n}"
[PROOF STATE]
proof (prove)
using this:
set (d # cs) \<noteq> {1..n}

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>e \<notin> set (d # cs); e \<in> {1..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using d cs(4)
[PROOF STATE]
proof (prove)
using this:
set (d # cs) \<noteq> {1..n}
d \<notin> set cs
d \<in> {1..n}
set cs \<subseteq> {1..n}

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>e \<notin> set (d # cs); e \<in> {1..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis insert_subset list.simps(15) subsetI subset_antisym)
[PROOF STATE]
proof (state)
this:
e \<notin> set (d # cs)
e \<in> {1..n}

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
define q where "q = (Fun.swap d e id) \<circ> (Fun.swap b c id)"
[PROOF STATE]
proof (state)
this:
q = id \<circ> Transposition.transpose d e \<circ> (id \<circ> Transposition.transpose b c)

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
hence "bij q"
[PROOF STATE]
proof (prove)
using this:
q = id \<circ> Transposition.transpose d e \<circ> (id \<circ> Transposition.transpose b c)

goal (1 subgoal):
 1. bij q
[PROOF STEP]
by (simp add: bij_comp)
[PROOF STATE]
proof (state)
this:
bij q

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij q

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "q b = c" and "q c = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q b = c &&& q c = b
[PROOF STEP]
using d(1) e(1)
[PROOF STATE]
proof (prove)
using this:
d \<notin> set cs
e \<notin> set (d # cs)

goal (1 subgoal):
 1. q b = c &&& q c = b
[PROOF STEP]
unfolding q_def cs_def
[PROOF STATE]
proof (prove)
using this:
d \<notin> set [a, b, c]
e \<notin> set [d, a, b, c]

goal (1 subgoal):
 1. (id \<circ> Transposition.transpose d e \<circ> (id \<circ> Transposition.transpose b c)) b = c &&& (id \<circ> Transposition.transpose d e \<circ> (id \<circ> Transposition.transpose b c)) c = b
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
q b = c
q c = b

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
q b = c
q c = b

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "q a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q a = a
[PROOF STEP]
using d(1) e(1) cs(2)
[PROOF STATE]
proof (prove)
using this:
d \<notin> set cs
e \<notin> set (d # cs)
cycle cs

goal (1 subgoal):
 1. q a = a
[PROOF STEP]
unfolding q_def cs_def
[PROOF STATE]
proof (prove)
using this:
d \<notin> set [a, b, c]
e \<notin> set [d, a, b, c]
cycle [a, b, c]

goal (1 subgoal):
 1. (id \<circ> Transposition.transpose d e \<circ> (id \<circ> Transposition.transpose b c)) a = a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q a = a

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij q
q b = c
q c = b
q a = a
[PROOF STEP]
have "q \<circ> p \<circ> (inv' q) = cycle_of_list [ a, c, b ]"
[PROOF STATE]
proof (prove)
using this:
bij q
q b = c
q c = b
q a = a

goal (1 subgoal):
 1. q \<circ> p \<circ> inv' q = cycle_of_list [a, c, b]
[PROOF STEP]
using conjugation_of_cycle[OF cs(2), of q]
[PROOF STATE]
proof (prove)
using this:
bij q
q b = c
q c = b
q a = a
bij q \<Longrightarrow> q \<circ> cycle_of_list cs \<circ> inv' q = cycle_of_list (map q cs)

goal (1 subgoal):
 1. q \<circ> p \<circ> inv' q = cycle_of_list [a, c, b]
[PROOF STEP]
unfolding sym[OF cs(1)]
[PROOF STATE]
proof (prove)
using this:
bij q
q b = c
q c = b
q a = a
bij q \<Longrightarrow> q \<circ> p \<circ> inv' q = cycle_of_list (map q cs)

goal (1 subgoal):
 1. q \<circ> p \<circ> inv' q = cycle_of_list [a, c, b]
[PROOF STEP]
unfolding cs_def
[PROOF STATE]
proof (prove)
using this:
bij q
q b = c
q c = b
q a = a
bij q \<Longrightarrow> q \<circ> p \<circ> inv' q = cycle_of_list (map q [a, b, c])

goal (1 subgoal):
 1. q \<circ> p \<circ> inv' q = cycle_of_list [a, c, b]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q \<circ> p \<circ> inv' q = cycle_of_list [a, c, b]

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
q \<circ> p \<circ> inv' q = cycle_of_list [a, c, b]

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have " ... = p \<circ> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cycle_of_list [a, c, b] = p \<circ> p
[PROOF STEP]
using cs(2)
[PROOF STATE]
proof (prove)
using this:
cycle cs

goal (1 subgoal):
 1. cycle_of_list [a, c, b] = p \<circ> p
[PROOF STEP]
unfolding cs(1) cs_def
[PROOF STATE]
proof (prove)
using this:
cycle [a, b, c]

goal (1 subgoal):
 1. cycle_of_list [a, c, b] = cycle_of_list [a, b, c] \<circ> cycle_of_list [a, b, c]
[PROOF STEP]
by (simp add: comp_swap swap_commute transpose_comp_triple)
[PROOF STATE]
proof (state)
this:
cycle_of_list [a, c, b] = p \<circ> p

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
q \<circ> p \<circ> inv' q = p \<circ> p
[PROOF STEP]
have "q \<circ> p \<circ> (inv' q) = p \<circ> p"
[PROOF STATE]
proof (prove)
using this:
q \<circ> p \<circ> inv' q = p \<circ> p

goal (1 subgoal):
 1. q \<circ> p \<circ> inv' q = p \<circ> p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
q \<circ> p \<circ> inv' q = p \<circ> p

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
q \<circ> p \<circ> inv' q = p \<circ> p

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "bij p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij p
[PROOF STEP]
unfolding cs(1) cs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij (cycle_of_list [a, b, c])
[PROOF STEP]
by (simp add: bij_comp)
[PROOF STATE]
proof (state)
this:
bij p

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
q \<circ> p \<circ> inv' q = p \<circ> p
bij p
[PROOF STEP]
have p: "q \<circ> p \<circ> (inv' q) \<circ> (inv' p) = p"
[PROOF STATE]
proof (prove)
using this:
q \<circ> p \<circ> inv' q = p \<circ> p
bij p

goal (1 subgoal):
 1. q \<circ> p \<circ> inv' q \<circ> inv' p = p
[PROOF STEP]
by (simp add: bijection.intro bijection.inv_comp_right comp_assoc)
[PROOF STATE]
proof (state)
this:
q \<circ> p \<circ> inv' q \<circ> inv' p = p

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "swapidseq (Suc (Suc 0)) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swapidseq (Suc (Suc 0)) q
[PROOF STEP]
using comp_Suc[OF comp_Suc[OF id], of b c d e] e(1) cs(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>b \<noteq> c; d \<noteq> e\<rbrakk> \<Longrightarrow> swapidseq (Suc (Suc 0)) (Transposition.transpose d e \<circ> (Transposition.transpose b c \<circ> id))
e \<notin> set (d # cs)
cycle cs

goal (1 subgoal):
 1. swapidseq (Suc (Suc 0)) q
[PROOF STEP]
unfolding q_def cs_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>b \<noteq> c; d \<noteq> e\<rbrakk> \<Longrightarrow> swapidseq (Suc (Suc 0)) (Transposition.transpose d e \<circ> (Transposition.transpose b c \<circ> id))
e \<notin> set [d, a, b, c]
cycle [a, b, c]

goal (1 subgoal):
 1. swapidseq (Suc (Suc 0)) (id \<circ> Transposition.transpose d e \<circ> (id \<circ> Transposition.transpose b c))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
swapidseq (Suc (Suc 0)) q

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
hence "evenperm q"
[PROOF STATE]
proof (prove)
using this:
swapidseq (Suc (Suc 0)) q

goal (1 subgoal):
 1. evenperm q
[PROOF STEP]
using even_Suc_Suc_iff evenperm_unique
[PROOF STATE]
proof (prove)
using this:
swapidseq (Suc (Suc 0)) q
even (Suc (Suc ?n)) = even ?n
\<lbrakk>swapidseq ?n ?p; even ?n = ?b\<rbrakk> \<Longrightarrow> evenperm ?p = ?b

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

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
evenperm q

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "q permutes { d, e, b, c }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q permutes {d, e, b, c}
[PROOF STEP]
unfolding q_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id \<circ> Transposition.transpose d e \<circ> (id \<circ> Transposition.transpose b c) permutes {d, e, b, c}
[PROOF STEP]
by (simp add: permutes_compose permutes_swap_id)
[PROOF STATE]
proof (state)
this:
q permutes {d, e, b, c}

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
hence "q permutes {1..n}"
[PROOF STATE]
proof (prove)
using this:
q permutes {d, e, b, c}

goal (1 subgoal):
 1. q permutes {1..n}
[PROOF STEP]
using cs(4) d(2) e(2) permutes_subset
[PROOF STATE]
proof (prove)
using this:
q permutes {d, e, b, c}
set cs \<subseteq> {1..n}
d \<in> {1..n}
e \<in> {1..n}
\<lbrakk>?p permutes ?S; ?S \<subseteq> ?T\<rbrakk> \<Longrightarrow> ?p permutes ?T

goal (1 subgoal):
 1. q permutes {1..n}
[PROOF STEP]
unfolding cs_def
[PROOF STATE]
proof (prove)
using this:
q permutes {d, e, b, c}
set [a, b, c] \<subseteq> {1..n}
d \<in> {1..n}
e \<in> {1..n}
\<lbrakk>?p permutes ?S; ?S \<subseteq> ?T\<rbrakk> \<Longrightarrow> ?p permutes ?T

goal (1 subgoal):
 1. q permutes {1..n}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
q permutes {1..n}

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
evenperm q
q permutes {1..n}
[PROOF STEP]
have "q \<in> carrier (alt_group n)"
[PROOF STATE]
proof (prove)
using this:
evenperm q
q permutes {1..n}

goal (1 subgoal):
 1. q \<in> carrier (alt_group n)
[PROOF STEP]
unfolding alt_group_carrier
[PROOF STATE]
proof (prove)
using this:
evenperm q
q permutes {1..n}

goal (1 subgoal):
 1. q permutes {1..n} \<and> evenperm q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q \<in> carrier (alt_group n)

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
q \<in> carrier (alt_group n)

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "p \<in> carrier (alt_group n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> carrier (alt_group n)
[PROOF STEP]
using \<open>p \<in> three_cycles n\<close> three_cycles_incl
[PROOF STATE]
proof (prove)
using this:
p \<in> three_cycles n
three_cycles ?n \<subseteq> carrier (alt_group ?n)

goal (1 subgoal):
 1. p \<in> carrier (alt_group n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<in> carrier (alt_group n)

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
q \<in> carrier (alt_group n)
p \<in> carrier (alt_group n)
[PROOF STEP]
have "p \<in> derived_set (alt_group n) (carrier (alt_group n))"
[PROOF STATE]
proof (prove)
using this:
q \<in> carrier (alt_group n)
p \<in> carrier (alt_group n)

goal (1 subgoal):
 1. p \<in> derived_set (alt_group n) (carrier (alt_group n))
[PROOF STEP]
using p alt_group_inv_equality
[PROOF STATE]
proof (prove)
using this:
q \<in> carrier (alt_group n)
p \<in> carrier (alt_group n)
q \<circ> p \<circ> inv' q \<circ> inv' p = p
?p \<in> carrier (alt_group ?n) \<Longrightarrow> inv\<^bsub>alt_group ?n\<^esub> ?p = inv' ?p

goal (1 subgoal):
 1. p \<in> derived_set (alt_group n) (carrier (alt_group n))
[PROOF STEP]
unfolding alt_group_mult
[PROOF STATE]
proof (prove)
using this:
q \<in> carrier (alt_group n)
p \<in> carrier (alt_group n)
q \<circ> p \<circ> inv' q \<circ> inv' p = p
?p \<in> carrier (alt_group ?n) \<Longrightarrow> inv\<^bsub>alt_group ?n\<^esub> ?p = inv' ?p

goal (1 subgoal):
 1. p \<in> (\<Union>h1\<in>carrier (alt_group n). \<Union>h2\<in>carrier (alt_group n). {h1 \<circ> h2 \<circ> inv\<^bsub>alt_group n\<^esub> h1 \<circ> inv\<^bsub>alt_group n\<^esub> h2})
[PROOF STEP]
by (metis (no_types, lifting) UN_iff singletonI)
[PROOF STATE]
proof (state)
this:
p \<in> derived_set (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
thus "p \<in> derived (alt_group n) (carrier (alt_group n))"
[PROOF STATE]
proof (prove)
using this:
p \<in> derived_set (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. p \<in> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
unfolding derived_def
[PROOF STATE]
proof (prove)
using this:
p \<in> derived_set (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. p \<in> generate (alt_group n) (derived_set (alt_group n) (carrier (alt_group n)))
[PROOF STEP]
by (rule incl)
[PROOF STATE]
proof (state)
this:
p \<in> derived (alt_group n) (carrier (alt_group n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<in> derived (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?p2 \<in> three_cycles n \<Longrightarrow> ?p2 \<in> derived (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
note aux_lemma = this
[PROOF STATE]
proof (state)
this:
?p2 \<in> three_cycles n \<Longrightarrow> ?p2 \<in> derived (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
interpret A: group "alt_group n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (alt_group n)
[PROOF STEP]
using alt_group_is_group
[PROOF STATE]
proof (prove)
using this:
Group.group (alt_group ?n)

goal (1 subgoal):
 1. Group.group (alt_group n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
have "generate (alt_group n) (three_cycles n) \<subseteq> derived (alt_group n) (carrier (alt_group n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate (alt_group n) (three_cycles n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
using A.generate_subgroup_incl[OF _ A.derived_is_subgroup] aux_lemma
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?K \<subseteq> derived (alt_group n) ?H1; ?H1 \<subseteq> carrier (alt_group n)\<rbrakk> \<Longrightarrow> generate (alt_group n) ?K \<subseteq> derived (alt_group n) ?H1
?p2 \<in> three_cycles n \<Longrightarrow> ?p2 \<in> derived (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. generate (alt_group n) (three_cycles n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
by (meson subsetI)
[PROOF STATE]
proof (state)
this:
generate (alt_group n) (three_cycles n) \<subseteq> derived (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
thus "carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))"
[PROOF STATE]
proof (prove)
using this:
generate (alt_group n) (three_cycles n) \<subseteq> derived (alt_group n) (carrier (alt_group n))

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
using alt_group_carrier_as_three_cycles
[PROOF STATE]
proof (prove)
using this:
generate (alt_group n) (three_cycles n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
carrier (alt_group ?n) = generate (alt_group ?n) (three_cycles ?n)

goal (1 subgoal):
 1. carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
carrier (alt_group n) \<subseteq> derived (alt_group n) (carrier (alt_group n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma close_mono: "\<phi> \<le> \<psi> \<Longrightarrow> close \<phi> \<le> close \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> \<le> \<psi> \<Longrightarrow> close \<phi> \<le> close \<psi>
[PROOF STEP]
using states_mono[of \<phi> \<psi>] actions_mono[of \<phi> \<psi>]
[PROOF STATE]
proof (prove)
using this:
\<phi> \<le> \<psi> \<Longrightarrow> states \<phi> \<subseteq> states \<psi>
\<phi> \<le> \<psi> \<Longrightarrow> actions \<phi> \<le> actions \<psi>

goal (1 subgoal):
 1. \<phi> \<le> \<psi> \<Longrightarrow> close \<phi> \<le> close \<psi>
[PROOF STEP]
unfolding close_def
[PROOF STATE]
proof (prove)
using this:
\<phi> \<le> \<psi> \<Longrightarrow> states \<phi> \<subseteq> states \<psi>
\<phi> \<le> \<psi> \<Longrightarrow> actions \<phi> \<le> actions \<psi>

goal (1 subgoal):
 1. \<phi> \<le> \<psi> \<Longrightarrow> map_actions (\<lambda>s A. {a \<in> A. set_pmf a \<subseteq> states \<phi>}) \<phi> \<le> map_actions (\<lambda>s A. {a \<in> A. set_pmf a \<subseteq> states \<psi>}) \<psi>
[PROOF STEP]
by (intro le_mdpcI) (auto simp: le_fun_def)


[STATEMENT]
lemma length_sum_set_Suc_eqpoll: "length_sum_set (Suc r) n \<approx> Sigma {..n} (\<lambda>i. length_sum_set r (n-i))" (is "?L \<approx> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length_sum_set (Suc r) n \<approx> (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
unfolding eqpoll_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. bij_betw f (length_sum_set (Suc r) n) (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw ?f (length_sum_set (Suc r) n) (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
let ?f = "(\<lambda>l. (hd l, tl l))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw ?f (length_sum_set (Suc r) n) (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
show "bij_betw ?f ?L ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>l. (hd l, tl l)) (length_sum_set (Suc r) n) (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
proof (intro bij_betw_imageI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on (\<lambda>l. (hd l, tl l)) (length_sum_set (Suc r) n)
 2. (\<lambda>l. (hd l, tl l)) ` length_sum_set (Suc r) n = (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
show "inj_on ?f ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>l. (hd l, tl l)) (length_sum_set (Suc r) n)
[PROOF STEP]
by (force simp: inj_on_def length_sum_set_def intro: list.expand)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>l. (hd l, tl l)) (length_sum_set (Suc r) n)

goal (1 subgoal):
 1. (\<lambda>l. (hd l, tl l)) ` length_sum_set (Suc r) n = (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
show "?f ` ?L = ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>l. (hd l, tl l)) ` length_sum_set (Suc r) n = (SIGMA i:{..n}. length_sum_set r (n - i))
[PROOF STEP]
by (force simp: length_sum_set_def length_Suc_conv)
[PROOF STATE]
proof (state)
this:
(\<lambda>l. (hd l, tl l)) ` length_sum_set (Suc r) n = (SIGMA i:{..n}. length_sum_set r (n - i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>l. (hd l, tl l)) (length_sum_set (Suc r) n) (SIGMA i:{..n}. length_sum_set r (n - i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VPow_vinsert:
  "VPow (vinsert a A) = VPow A \<union>\<^sub>\<circ> ((\<lambda>x\<in>\<^sub>\<circ>VPow A. vinsert a x) `\<^sub>\<circ> VPow A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VPow (vinsert a A) = VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
proof(intro vsubset_antisym vsubsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> VPow (vinsert a A) \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
 2. \<And>x. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (vinsert a A)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> VPow (vinsert a A) \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
 2. \<And>x. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (vinsert a A)
[PROOF STEP]
assume "x \<in>\<^sub>\<circ> VPow (vinsert a A)"
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> VPow (vinsert a A)

goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> VPow (vinsert a A) \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
 2. \<And>x. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (vinsert a A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in>\<^sub>\<circ> VPow (vinsert a A)
[PROOF STEP]
have "x \<subseteq>\<^sub>\<circ> vinsert a A"
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> VPow (vinsert a A)

goal (1 subgoal):
 1. x \<subseteq>\<^sub>\<circ> vinsert a A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<subseteq>\<^sub>\<circ> vinsert a A

goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> VPow (vinsert a A) \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
 2. \<And>x. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (vinsert a A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<subseteq>\<^sub>\<circ> vinsert a A
[PROOF STEP]
consider "x \<subseteq>\<^sub>\<circ> A" | "a \<in>\<^sub>\<circ> x"
[PROOF STATE]
proof (prove)
using this:
x \<subseteq>\<^sub>\<circ> vinsert a A

goal (1 subgoal):
 1. \<lbrakk>x \<subseteq>\<^sub>\<circ> A \<Longrightarrow> thesis; a \<in>\<^sub>\<circ> x \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<subseteq>\<^sub>\<circ> A \<Longrightarrow> ?thesis; a \<in>\<^sub>\<circ> x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> VPow (vinsert a A) \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
 2. \<And>x. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (vinsert a A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<subseteq>\<^sub>\<circ> A \<Longrightarrow> ?thesis; a \<in>\<^sub>\<circ> x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> (\<lambda>x\<in>\<^sub>\<circ>VPow A. vinsert a x) `\<^sub>\<circ> VPow A"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<subseteq>\<^sub>\<circ> A \<Longrightarrow> ?thesis; a \<in>\<^sub>\<circ> x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<subseteq>\<^sub>\<circ> A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
 2. a \<in>\<^sub>\<circ> x \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
x \<subseteq>\<^sub>\<circ> A

goal (2 subgoals):
 1. x \<subseteq>\<^sub>\<circ> A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
 2. a \<in>\<^sub>\<circ> x \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<subseteq>\<^sub>\<circ> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<subseteq>\<^sub>\<circ> A

goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> x \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> x \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
a \<in>\<^sub>\<circ> x

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> x \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
define x' where "x' = x -\<^sub>\<circ> set {a}"
[PROOF STATE]
proof (state)
this:
x' = x -\<^sub>\<circ> set {a}

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> x \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
with 2
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> x
x' = x -\<^sub>\<circ> set {a}
[PROOF STEP]
have "x = vinsert a x'" and "a \<notin>\<^sub>\<circ> x'"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> x
x' = x -\<^sub>\<circ> set {a}

goal (1 subgoal):
 1. x = vinsert a x' &&& a \<notin>\<^sub>\<circ> x'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = vinsert a x'
a \<notin>\<^sub>\<circ> x'

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> x \<Longrightarrow> x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
with \<open>x \<subseteq>\<^sub>\<circ> vinsert a A\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<subseteq>\<^sub>\<circ> vinsert a A
x = vinsert a x'
a \<notin>\<^sub>\<circ> x'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<subseteq>\<^sub>\<circ> vinsert a A
x = vinsert a x'
a \<notin>\<^sub>\<circ> x'

goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A
[PROOF STEP]
unfolding vimage_def
[PROOF STATE]
proof (prove)
using this:
x \<subseteq>\<^sub>\<circ> vinsert a A
x = vinsert a x'
a \<notin>\<^sub>\<circ> x'

goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> (\<lambda>\<langle>r, A\<rangle>\<in>\<^sub>\<circ>set {\<langle>VLambda (VPow A) (vinsert a), VPow A\<rangle>}. \<R>\<^sub>\<circ> (r \<restriction>\<^sup>l\<^sub>\<circ> A))\<lparr>\<langle>VLambda (VPow A) (vinsert a), VPow A\<rangle>\<rparr>
[PROOF STEP]
by (fastforce simp: vsubset_vinsert vlrestriction_VLambda)
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> VPow A \<union>\<^sub>\<circ> VLambda (VPow A) (vinsert a) `\<^sub>\<circ> VPow A \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (vinsert a A)
[PROOF STEP]
qed (elim vunionE, auto)


[STATEMENT]
lemma l2norm_le: "(l2norm S f \<le> l2norm S g \<longleftrightarrow> l2product S f f \<le> l2product S g g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l2norm S f \<le> l2norm S g) = (l2product S f f \<le> l2product S g g)
[PROOF STEP]
by (simp add: l2norm_def)


[STATEMENT]
lemma IS_RIGHT_TOTAL_alt: "IS_RIGHT_TOTAL R \<longleftrightarrow> (\<forall>x. \<exists>y. (y,x)\<in>R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IS_RIGHT_TOTAL R = (\<forall>x. \<exists>y. (y, x) \<in> R)
[PROOF STEP]
by (auto simp: IS_RIGHT_TOTAL_def)


[STATEMENT]
lemma in_degree_eq_card_arc_blocks: "in_degree G v = card (arc_to_block ` (in_arcs G v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. in_degree G v = card (arc_to_block ` in_arcs G v)
[PROOF STEP]
apply (simp add: in_degree_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (in_arcs G v) = card (arc_to_block ` in_arcs G v)
[PROOF STEP]
using no_multi_arcs arc_to_block_is_inj_in_arcs
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?e1.0 \<in> arcs G; ?e2.0 \<in> arcs G; arc_to_ends G ?e1.0 = arc_to_ends G ?e2.0\<rbrakk> \<Longrightarrow> ?e1.0 = ?e2.0
inj_on arc_to_block (in_arcs G ?v)

goal (1 subgoal):
 1. card (in_arcs G v) = card (arc_to_block ` in_arcs G v)
[PROOF STEP]
by (simp add: card_image)


[STATEMENT]
lemma N_col_mset_point_set_img: "j < \<b> \<Longrightarrow>
    vec_mset (col N j) = image_mset (\<lambda> x. if (x \<in> (\<B>s ! j)) then 1 else 0) (mset_set \<V>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < \<b> \<Longrightarrow> vec_mset (col N j) = {#if x \<in> \<B>s ! j then 1 else 0. x \<in># mset_set \<V>#}
[PROOF STEP]
using vec_mset_img_map N_col_list_map points_indexing
[PROOF STATE]
proof (prove)
using this:
image_mset ?f (mset ?xs) = vec_mset (map_vec ?f (vec_of_list ?xs))
?j < \<b> \<Longrightarrow> col N ?j = map_vec (\<lambda>x. if x \<in> \<B>s ! ?j then 1 else 0) (vec_of_list \<V>s)
\<V>s \<in> permutations_of_set \<V>

goal (1 subgoal):
 1. j < \<b> \<Longrightarrow> vec_mset (col N j) = {#if x \<in> \<B>s ! j then 1 else 0. x \<in># mset_set \<V>#}
[PROOF STEP]
by (metis (no_types, lifting) finite_sets permutations_of_multisetD permutations_of_set_altdef)


[STATEMENT]
lemma fcard_fminus_fsingleton_if:
  "fcard (A |-| {|x|}) = (if x |\<in>| A then fcard A - 1 else fcard A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fcard (A |-| {|x|}) = (if x |\<in>| A then fcard A - 1 else fcard A)
[PROOF STEP]
by transfer (rule card_Diff_singleton_if)


[STATEMENT]
lemma degree_poly_y_x:
  fixes p :: "'a :: comm_ring_1 poly poly"
  assumes "p \<noteq> 0"
  shows "degree (poly_y_x p) = Max { degree (coeff p i) | i. i \<le> degree p }"
    (is "_ = ?d p")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}
[PROOF STEP]
proof(induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<noteq> 0 \<Longrightarrow> degree (poly_y_x 0) = Max {degree (coeff 0 i) |i. i \<le> degree 0}
 2. \<And>a p. \<lbrakk>a \<noteq> 0 \<or> p \<noteq> 0; p \<noteq> 0 \<Longrightarrow> degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}; pCons a p \<noteq> 0\<rbrakk> \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
interpret rhm: map_poly_comm_ring_hom coeff_lift
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_comm_ring_hom (\<lambda>a. [:a:])
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<noteq> 0 \<Longrightarrow> degree (poly_y_x 0) = Max {degree (coeff 0 i) |i. i \<le> degree 0}
 2. \<And>a p. \<lbrakk>a \<noteq> 0 \<or> p \<noteq> 0; p \<noteq> 0 \<Longrightarrow> degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}; pCons a p \<noteq> 0\<rbrakk> \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
let ?f = "\<lambda>p i j. monom (monom (coeff (coeff p i) j) i) j"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<noteq> 0 \<Longrightarrow> degree (poly_y_x 0) = Max {degree (coeff 0 i) |i. i \<le> degree 0}
 2. \<And>a p. \<lbrakk>a \<noteq> 0 \<or> p \<noteq> 0; p \<noteq> 0 \<Longrightarrow> degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}; pCons a p \<noteq> 0\<rbrakk> \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
case (pCons a p)
[PROOF STATE]
proof (state)
this:
a \<noteq> 0 \<or> p \<noteq> 0
p \<noteq> 0 \<Longrightarrow> degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}
pCons a p \<noteq> 0

goal (2 subgoals):
 1. 0 \<noteq> 0 \<Longrightarrow> degree (poly_y_x 0) = Max {degree (coeff 0 i) |i. i \<le> degree 0}
 2. \<And>a p. \<lbrakk>a \<noteq> 0 \<or> p \<noteq> 0; p \<noteq> 0 \<Longrightarrow> degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}; pCons a p \<noteq> 0\<rbrakk> \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
proof(cases "p=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x [:a:]) = Max {degree (coeff [:a:] i) |i. i \<le> degree [:a:]}
[PROOF STEP]
unfolding poly_y_x_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x 0)) = Max {degree (coeff [:a:] i) |i. i \<le> degree [:a:]}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
note IH = pCons(2)[OF False]
[PROOF STATE]
proof (state)
this:
degree (poly_y_x p) = Max {degree (coeff p i) |i. i \<le> degree p}

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
let ?a = "poly_lift a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
let ?p = "map_poly (pCons 0) (poly_y_x p)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
proof(cases rule:linorder_cases[of "degree ?a" "degree ?p"])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. degree (poly_lift a) < degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 3. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
degree (poly_lift a) < degree (map_poly (pCons (0::'a)) (poly_y_x p))

goal (3 subgoals):
 1. degree (poly_lift a) < degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 3. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
have dle: "degree a \<le> degree (poly_y_x p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree a \<le> degree (poly_y_x p)
[PROOF STEP]
apply(rule le_trans[OF less_imp_le[OF less[simplified]]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x p) \<le> degree (poly_y_x p)
[PROOF STEP]
using degree_map_poly_le
[PROOF STATE]
proof (prove)
using this:
degree (map_poly ?f ?p) \<le> degree ?p

goal (1 subgoal):
 1. degree (poly_y_x p) \<le> degree (poly_y_x p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree a \<le> degree (poly_y_x p)

goal (3 subgoals):
 1. degree (poly_lift a) < degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 3. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding poly_y_x_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding degree_add_eq_right[OF less]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding Max_degree_coeff_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) = max (degree a) (Max {degree (coeff p x) |x. x \<le> degree p})
[PROOF STEP]
unfolding IH[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) = max (degree a) (degree (poly_y_x p))
[PROOF STEP]
unfolding max_absorb2[OF dle]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) = degree (poly_y_x p)
[PROOF STEP]
apply (rule degree_map_poly)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pCons (0::'a) (lead_coeff (poly_y_x p)) = 0) = (poly_y_x p = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}

goal (2 subgoals):
 1. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
case equal
[PROOF STATE]
proof (state)
this:
degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p))

goal (2 subgoals):
 1. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
have dega: "degree ?a = degree a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a) = degree a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_lift a) = degree a

goal (2 subgoals):
 1. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
have degp: "degree (poly_y_x p) = degree a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x p) = degree a
[PROOF STEP]
using equal[unfolded dega]
[PROOF STATE]
proof (prove)
using this:
degree a = degree (map_poly (pCons (0::'a)) (poly_y_x p))

goal (1 subgoal):
 1. degree (poly_y_x p) = degree a
[PROOF STEP]
using degree_map_poly[of "pCons 0" "poly_y_x p"]
[PROOF STATE]
proof (prove)
using this:
degree a = degree (map_poly (pCons (0::'a)) (poly_y_x p))
(pCons (0::'a) (lead_coeff (poly_y_x p)) = 0) = (poly_y_x p = 0) \<Longrightarrow> degree (map_poly (pCons (0::'a)) (poly_y_x p)) = degree (poly_y_x p)

goal (1 subgoal):
 1. degree (poly_y_x p) = degree a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_y_x p) = degree a

goal (2 subgoals):
 1. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
have *: "degree (?a + ?p) = degree a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
proof(cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
 2. a \<noteq> 0 \<Longrightarrow> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
 2. a \<noteq> 0 \<Longrightarrow> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
using equal
[PROOF STATE]
proof (prove)
using this:
degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p))

goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
using this:
degree (poly_lift 0) = degree (map_poly (pCons (0::'a)) (poly_y_x p))

goal (1 subgoal):
 1. degree (poly_lift 0 + map_poly (pCons (0::'a)) (poly_y_x p)) = degree 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a
[PROOF STEP]
apply(rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) \<le> degree a
 2. degree a \<le> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p))
[PROOF STEP]
apply(rule degree_add_le, simp, fold equal, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree a \<le> degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p))
[PROOF STEP]
apply(rule le_degree)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) (degree a) \<noteq> 0
[PROOF STEP]
unfolding coeff_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (poly_lift a) (degree a) + coeff (map_poly (pCons (0::'a)) (poly_y_x p)) (degree a) \<noteq> 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. coeff (poly_lift a) (degree a) + coeff (map_poly (pCons (0::'a)) (poly_y_x p)) (degree a) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = degree a

goal (2 subgoals):
 1. degree (poly_lift a) = degree (map_poly (pCons (0::'a)) (poly_y_x p)) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
 2. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding poly_y_x_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree a = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding Max_degree_coeff_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree a = max (degree a) (Max {degree (coeff p x) |x. x \<le> degree p})
[PROOF STEP]
unfolding IH[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree a = max (degree a) (degree (poly_y_x p))
[PROOF STEP]
unfolding degp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree a = max (degree a) (degree a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}

goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
case greater
[PROOF STATE]
proof (state)
this:
degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a)

goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
have dge: "degree a \<ge> degree (poly_y_x p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x p) \<le> degree a
[PROOF STEP]
apply(rule le_trans[OF _ less_imp_le[OF greater[simplified]]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x p) \<le> degree (poly_y_x p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (poly_y_x p) \<le> degree a

goal (1 subgoal):
 1. degree (map_poly (pCons (0::'a)) (poly_y_x p)) < degree (poly_lift a) \<Longrightarrow> degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding poly_y_x_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a + map_poly (pCons (0::'a)) (poly_y_x p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding degree_add_eq_left[OF greater]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}
[PROOF STEP]
unfolding Max_degree_coeff_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a) = max (degree a) (Max {degree (coeff p x) |x. x \<le> degree p})
[PROOF STEP]
unfolding IH[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a) = max (degree a) (degree (poly_y_x p))
[PROOF STEP]
unfolding max_absorb1[OF dge]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_lift a) = degree a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree (poly_y_x (pCons a p)) = Max {degree (coeff (pCons a p) i) |i. i \<le> degree (pCons a p)}

goal (1 subgoal):
 1. 0 \<noteq> 0 \<Longrightarrow> degree (poly_y_x 0) = Max {degree (coeff 0 i) |i. i \<le> degree 0}
[PROOF STEP]
qed auto


[STATEMENT]
lemma keys_add_eq: "keys (a + b) = keys a \<union> keys b - {x \<in> keys a \<inter> keys b. lookup a x + lookup b x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (a + b) = keys a \<union> keys b - {x \<in> keys a \<inter> keys b. lookup a x + lookup b x = (0::'b)}
[PROOF STEP]
by (auto simp: in_keys_iff lookup_add add_eq_0_iff)


[STATEMENT]
lemma poly_eval_prod: "poly_eval a (prod f I) = (\<Prod>i\<in>I. poly_eval a (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_eval a (prod f I) = (\<Prod>i\<in>I. poly_eval a (f i))
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (simp_all add: poly_eval_times)


[STATEMENT]
lemma sup_sup_union: "a \<in> supremum A \<Longrightarrow> b \<in> supremum (B \<union> {a}) \<Longrightarrow> b \<in> supremum (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> supremum A; b \<in> supremum (B \<union> {a})\<rbrakk> \<Longrightarrow> b \<in> supremum (A \<union> B)
[PROOF STEP]
apply (simp add: supremum_def upper_bound_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x\<in>A. x \<le> a) \<and> (\<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> a \<le> x); a \<le> b \<and> (\<forall>x\<in>B. x \<le> b) \<and> (\<forall>x. a \<le> x \<and> (\<forall>xa\<in>B. xa \<le> x) \<longrightarrow> b \<le> x)\<rbrakk> \<Longrightarrow> \<forall>x\<in>A \<union> B. x \<le> b
[PROOF STEP]
by auto


[STATEMENT]
lemma compute_real_of_float[code]:
  "real_of_float (Float m e) = (if e \<ge> 0 then m * 2 ^ nat e else m / power_int 2 (-e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (Float m e) = (if 0 \<le> e then real_of_int m * 2 ^ nat e else real_of_int m / real_of_int (Optimize_Integer.power_int 2 (- e)))
[PROOF STEP]
unfolding power_int_def[symmetric, of 2 e]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (Float m e) = (if 0 \<le> e then real_of_int m * 2 ^ nat e else real_of_int m / real_of_int (Optimize_Integer.power_int 2 (- e)))
[PROOF STEP]
using compute_real_of_float power_int_def
[PROOF STATE]
proof (prove)
using this:
real_of_float (Float ?m ?e) = (if 0 \<le> ?e then real_of_int ?m * 2 ^ nat ?e else real_of_int ?m / 2 ^ nat (- ?e))
Optimize_Integer.power_int ?a ?b = ?a ^ nat ?b

goal (1 subgoal):
 1. real_of_float (Float m e) = (if 0 \<le> e then real_of_int m * 2 ^ nat e else real_of_int m / real_of_int (Optimize_Integer.power_int 2 (- e)))
[PROOF STEP]
by auto


[STATEMENT]
lemma isCont_Im: "isCont f a \<Longrightarrow> isCont (\<lambda>x. Im (f x)) a"
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f a \<Longrightarrow> isCont (\<lambda>x. Im (f x)) a
[PROOF STEP]
by (simp add: isCont_def LIM_Im)


[STATEMENT]
lemma iMODb_inext: "
  \<lbrakk> t \<in> [r, mod m, c]; t < r + m * c \<rbrakk> \<Longrightarrow>
  inext t [r, mod m, c] = t + m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> [ r, mod m, c ]; t < r + m * c\<rbrakk> \<Longrightarrow> inext t [ r, mod m, c ] = t + m
[PROOF STEP]
by (clarsimp simp add: inext_def iMODb_cut_greater iT_iff iT_Min iT_not_empty mod_eq_imp_diff_mod_0)


[STATEMENT]
lemma frontier_Int_closed:
  assumes "closed S" "closed T"
  shows "frontier(S \<inter> T) = (frontier S \<inter> T) \<union> (S \<inter> frontier T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (S \<inter> T) = frontier S \<inter> T \<union> S \<inter> frontier T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. frontier (S \<inter> T) = frontier S \<inter> T \<union> S \<inter> frontier T
[PROOF STEP]
have "closure (S \<inter> T) = T \<inter> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (S \<inter> T) = T \<inter> S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
closed S
closed T

goal (1 subgoal):
 1. closure (S \<inter> T) = T \<inter> S
[PROOF STEP]
by (simp add: Int_commute closed_Int)
[PROOF STATE]
proof (state)
this:
closure (S \<inter> T) = T \<inter> S

goal (1 subgoal):
 1. frontier (S \<inter> T) = frontier S \<inter> T \<union> S \<inter> frontier T
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
closure (S \<inter> T) = T \<inter> S

goal (1 subgoal):
 1. frontier (S \<inter> T) = frontier S \<inter> T \<union> S \<inter> frontier T
[PROOF STEP]
have "T \<inter> (closure S \<inter> closure (- S)) = frontier S \<inter> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<inter> (closure S \<inter> closure (- S)) = frontier S \<inter> T
[PROOF STEP]
by (simp add: Int_commute frontier_closures)
[PROOF STATE]
proof (state)
this:
T \<inter> (closure S \<inter> closure (- S)) = frontier S \<inter> T

goal (1 subgoal):
 1. frontier (S \<inter> T) = frontier S \<inter> T \<union> S \<inter> frontier T
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
closure (S \<inter> T) = T \<inter> S
T \<inter> (closure S \<inter> closure (- S)) = frontier S \<inter> T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closure (S \<inter> T) = T \<inter> S
T \<inter> (closure S \<inter> closure (- S)) = frontier S \<inter> T

goal (1 subgoal):
 1. frontier (S \<inter> T) = frontier S \<inter> T \<union> S \<inter> frontier T
[PROOF STEP]
by (simp add: Int_Un_distrib Int_assoc Int_left_commute assms frontier_closures)
[PROOF STATE]
proof (state)
this:
frontier (S \<inter> T) = frontier S \<inter> T \<union> S \<inter> frontier T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subdegree_diff_ge [simp]:
  assumes "f \<noteq> (g :: 'a :: group_add fps)"
  shows   "subdegree (f - g) \<ge> min (subdegree f) (subdegree g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> g
[PROOF STEP]
have "f = - (- g) \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
f \<noteq> g

goal (1 subgoal):
 1. f = - (- g) \<Longrightarrow> False
[PROOF STEP]
using expand_fps_eq
[PROOF STATE]
proof (prove)
using this:
f \<noteq> g
(?p = ?q) = (\<forall>n. ?p $ n = ?q $ n)

goal (1 subgoal):
 1. f = - (- g) \<Longrightarrow> False
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f = - (- g) \<Longrightarrow> False

goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
hence "f \<noteq> - (- g)"
[PROOF STATE]
proof (prove)
using this:
f = - (- g) \<Longrightarrow> False

goal (1 subgoal):
 1. f \<noteq> - (- g)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
f \<noteq> - (- g)

goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f \<noteq> - (- g)

goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
have "f + - g = f - g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f + - g = f - g
[PROOF STEP]
by (simp add: fps_ext)
[PROOF STATE]
proof (state)
this:
f + - g = f - g

goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> - (- g)
f + - g = f - g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<noteq> - (- g)
f + - g = f - g

goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
using subdegree_add_ge[of f "-g"]
[PROOF STATE]
proof (prove)
using this:
f \<noteq> - (- g)
f + - g = f - g
f \<noteq> - (- g) \<Longrightarrow> min (subdegree f) (subdegree (- g)) \<le> subdegree (f + - g)

goal (1 subgoal):
 1. min (subdegree f) (subdegree g) \<le> subdegree (f - g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
min (subdegree f) (subdegree g) \<le> subdegree (f - g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Z_carrier: shows "Z \<in> carrier_mat 2 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Z \<in> carrier_mat 2 2
[PROOF STEP]
unfolding Z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat 2 2 (\<lambda>(i, j). if i \<noteq> j then 0 else if i = 0 then 1 else - 1) \<in> carrier_mat 2 2
[PROOF STEP]
by simp


[STATEMENT]
lemma tendsto_fst [tendsto_intros]:
  assumes "(f \<longlongrightarrow> a) F"
  shows "((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
assume "open S" and "fst a \<in> S"
[PROOF STATE]
proof (state)
this:
open S
fst a \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open S
fst a \<in> S
[PROOF STEP]
have "open (fst -` S)" and "a \<in> fst -` S"
[PROOF STATE]
proof (prove)
using this:
open S
fst a \<in> S

goal (1 subgoal):
 1. open (fst -` S) &&& a \<in> fst -` S
[PROOF STEP]
by (simp_all add: open_vimage_fst)
[PROOF STATE]
proof (state)
this:
open (fst -` S)
a \<in> fst -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> a) F
open (fst -` S)
a \<in> fst -` S
[PROOF STEP]
have "eventually (\<lambda>x. f x \<in> fst -` S) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
open (fst -` S)
a \<in> fst -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<in> fst -` S
[PROOF STEP]
by (rule topological_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S
[PROOF STEP]
show "eventually (\<lambda>x. fst (f x) \<in> S) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. fst (f x) \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_list:
  assumes "finite (set ` XS)"
  assumes "\<And>xs. xs \<in> XS \<Longrightarrow> distinct xs"
  shows "finite XS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite XS
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite XS
[PROOF STEP]
have "XS \<subseteq> {xs | xs. set xs \<in> set ` XS \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. XS \<subseteq> {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (set ` XS)
?xs \<in> XS \<Longrightarrow> distinct ?xs

goal (1 subgoal):
 1. XS \<subseteq> {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
XS \<subseteq> {xs |xs. set xs \<in> set ` XS \<and> distinct xs}

goal (1 subgoal):
 1. finite XS
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
XS \<subseteq> {xs |xs. set xs \<in> set ` XS \<and> distinct xs}

goal (1 subgoal):
 1. finite XS
[PROOF STEP]
have 1: "{xs |xs. set xs \<in> set ` XS \<and> distinct xs} = \<Union>{{xs | xs. set xs = A \<and> distinct xs} | A. A \<in> set ` XS}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs |xs. set xs \<in> set ` XS \<and> distinct xs} = \<Union> {{xs |xs. set xs = A \<and> distinct xs} |A. A \<in> set ` XS}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{xs |xs. set xs \<in> set ` XS \<and> distinct xs} = \<Union> {{xs |xs. set xs = A \<and> distinct xs} |A. A \<in> set ` XS}

goal (1 subgoal):
 1. finite XS
[PROOF STEP]
have "finite {xs |xs. set xs \<in> set ` XS \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
[PROOF STEP]
using finite_set2[OF _ finite_set] distinct_card  assms(1)
[PROOF STATE]
proof (prove)
using this:
card (set ?xs1) = ?n \<Longrightarrow> finite {xs. set xs = set ?xs1 \<and> distinct xs}
distinct ?xs \<Longrightarrow> card (set ?xs) = length ?xs
finite (set ` XS)

goal (1 subgoal):
 1. finite {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
[PROOF STEP]
unfolding 1
[PROOF STATE]
proof (prove)
using this:
card (set ?xs1) = ?n \<Longrightarrow> finite {xs. set xs = set ?xs1 \<and> distinct xs}
distinct ?xs \<Longrightarrow> card (set ?xs) = length ?xs
finite (set ` XS)

goal (1 subgoal):
 1. finite (\<Union> {{xs |xs. set xs = A \<and> distinct xs} |A. A \<in> set ` XS})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
finite {xs |xs. set xs \<in> set ` XS \<and> distinct xs}

goal (1 subgoal):
 1. finite XS
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
XS \<subseteq> {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
finite {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
XS \<subseteq> {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
finite {xs |xs. set xs \<in> set ` XS \<and> distinct xs}

goal (1 subgoal):
 1. finite XS
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
XS \<subseteq> {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
finite {xs |xs. set xs \<in> set ` XS \<and> distinct xs}
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_removeAt:
  assumes "i < length ls"
  shows "length (removeAt i ls) = length ls - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (removeAt i ls) = length ls - 1
[PROOF STEP]
unfolding removeAt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (take i ls @ drop (i + 1) ls) = length ls - 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < length ls

goal (1 subgoal):
 1. length (take i ls @ drop (i + 1) ls) = length ls - 1
[PROOF STEP]
by auto


[STATEMENT]
lemma integrable_bfun_prob_space [simp]:
  "integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t) :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t))
[PROOF STEP]
obtain b where "\<forall>t. \<bar>f (F t)\<bar> \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<forall>t. \<bar>apply_bfun f (F t)\<bar> \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis norm_le_norm_bfun real_norm_def)
[PROOF STATE]
proof (state)
this:
\<forall>t. \<bar>apply_bfun f (F t)\<bar> \<le> b

goal (1 subgoal):
 1. integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t))
[PROOF STEP]
hence "(\<integral>\<^sup>+ x. ennreal \<bar>f (F x)\<bar> \<partial>P) \<le> b"
[PROOF STATE]
proof (prove)
using this:
\<forall>t. \<bar>apply_bfun f (F t)\<bar> \<le> b

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>apply_bfun f (F x)\<bar> \<partial>measure_pmf P \<le> ennreal b
[PROOF STEP]
using nn_integral_mono ennreal_leI
[PROOF STATE]
proof (prove)
using this:
\<forall>t. \<bar>apply_bfun f (F t)\<bar> \<le> b
(\<And>x. x \<in> space ?M \<Longrightarrow> ?u x \<le> ?v x) \<Longrightarrow> integral\<^sup>N ?M ?u \<le> integral\<^sup>N ?M ?v
?x \<le> ?y \<Longrightarrow> ennreal ?x \<le> ennreal ?y

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>apply_bfun f (F x)\<bar> \<partial>measure_pmf P \<le> ennreal b
[PROOF STEP]
by (auto intro: measure_pmf.nn_integral_le_const)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>apply_bfun f (F x)\<bar> \<partial>measure_pmf P \<le> ennreal b

goal (1 subgoal):
 1. integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal \<bar>apply_bfun f (F x)\<bar> \<partial>measure_pmf P \<le> ennreal b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal \<bar>apply_bfun f (F x)\<bar> \<partial>measure_pmf P \<le> ennreal b

goal (1 subgoal):
 1. integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t))
[PROOF STEP]
using ennreal_less_top le_less_trans
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal \<bar>apply_bfun f (F x)\<bar> \<partial>measure_pmf P \<le> ennreal b
ennreal ?x < \<top>
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t))
[PROOF STEP]
by (fastforce simp: integrable_iff_bounded)
[PROOF STATE]
proof (state)
this:
integrable (measure_pmf P) (\<lambda>t. apply_bfun f (F t))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_to_iarray_cofactorM[code_unfold]:
  "matrix_to_iarray (cofactorM A) = cofactorM_iarrays (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (cofactorM A) = cofactorM_iarrays (matrix_to_iarray A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_to_iarray (cofactorM A) = cofactorM_iarrays (matrix_to_iarray A)
[PROOF STEP]
have n_rw: "nrows_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ from_nat x $ from_nat i)
    [0..<CARD('b)])) [0..<CARD('b)])) = CARD('b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('b)])) = CARD('b)
[PROOF STEP]
unfolding nrows_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('b)])) = CARD('b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nrows_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('b)])) = CARD('b)

goal (1 subgoal):
 1. matrix_to_iarray (cofactorM A) = cofactorM_iarrays (matrix_to_iarray A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (cofactorM A) = cofactorM_iarrays (matrix_to_iarray A)
[PROOF STEP]
unfolding cofactorM_iarrays_def tabulate2_def cofactorM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (\<chi>i. vec_lambda (cofactor A i)) = IArray.of_fun (\<lambda>i. IArray.of_fun (cofactor_iarrays (matrix_to_iarray A) i) (nrows_iarray (matrix_to_iarray A))) (nrows_iarray (matrix_to_iarray A))
[PROOF STEP]
by (auto simp add: n_rw matrix_to_iarray_cofactor
        matrix_to_iarray_def o_def vec_to_iarray_def to_nat_from_nat_id)
[PROOF STATE]
proof (state)
this:
matrix_to_iarray (cofactorM A) = cofactorM_iarrays (matrix_to_iarray A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma squarefree_part_uminus [simp]:
  assumes "x \<noteq> 0"
  shows   "squarefree_part (-x :: 'a :: {factorial_semiring, comm_ring_1}) = -squarefree_part x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
have "-(squarefree_part x * square_part x ^ 2) = -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (squarefree_part x * (square_part x)\<^sup>2) = - x
[PROOF STEP]
by (subst squarefree_decompose [symmetric]) auto
[PROOF STATE]
proof (state)
this:
- (squarefree_part x * (square_part x)\<^sup>2) = - x

goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (squarefree_part x * (square_part x)\<^sup>2) = - x

goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
have "\<dots> = squarefree_part (-x) * square_part (-x) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x = squarefree_part (- x) * (square_part (- x))\<^sup>2
[PROOF STEP]
by (rule squarefree_decompose)
[PROOF STATE]
proof (state)
this:
- x = squarefree_part (- x) * (square_part (- x))\<^sup>2

goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- (squarefree_part x * (square_part x)\<^sup>2) = squarefree_part (- x) * (square_part (- x))\<^sup>2
[PROOF STEP]
have "(- squarefree_part x) * square_part x ^ 2 =
                  squarefree_part (-x) * square_part x ^ 2"
[PROOF STATE]
proof (prove)
using this:
- (squarefree_part x * (square_part x)\<^sup>2) = squarefree_part (- x) * (square_part (- x))\<^sup>2

goal (1 subgoal):
 1. - squarefree_part x * (square_part x)\<^sup>2 = squarefree_part (- x) * (square_part x)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- squarefree_part x * (square_part x)\<^sup>2 = squarefree_part (- x) * (square_part x)\<^sup>2

goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- squarefree_part x * (square_part x)\<^sup>2 = squarefree_part (- x) * (square_part x)\<^sup>2

goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
- squarefree_part x * (square_part x)\<^sup>2 = squarefree_part (- x) * (square_part x)\<^sup>2
x \<noteq> (0::'a)

goal (1 subgoal):
 1. squarefree_part (- x) = - squarefree_part x
[PROOF STEP]
by (subst (asm) mult_right_cancel) auto
[PROOF STATE]
proof (state)
this:
squarefree_part (- x) = - squarefree_part x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem (in group_action) orbit_partition:
  "partition E (orbits G E \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Congruence.partition E (orbits G E \<phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Congruence.partition E (orbits G E \<phi>)
[PROOF STEP]
have "equivalence \<lparr> carrier = E, eq = \<lambda>x. \<lambda>y. y \<in> orbit G \<phi> x \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalence \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>
[PROOF STEP]
unfolding equivalence_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<in> carrier \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr> \<longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> x) \<and> (\<forall>x y. x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y \<longrightarrow> x \<in> carrier \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr> \<longrightarrow> y .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> x) \<and> (\<forall>x y z. x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y \<longrightarrow> y .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> z \<longrightarrow> x \<in> carrier \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr> \<longrightarrow> z \<in> carrier \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr> \<longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> z)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<in> E \<longrightarrow> x \<in> orbit G \<phi> x) \<and> (\<forall>x y. y \<in> orbit G \<phi> x \<longrightarrow> x \<in> E \<longrightarrow> y \<in> E \<longrightarrow> x \<in> orbit G \<phi> y) \<and> (\<forall>x y. y \<in> orbit G \<phi> x \<longrightarrow> (\<forall>z. z \<in> orbit G \<phi> y \<longrightarrow> x \<in> E \<longrightarrow> y \<in> E \<longrightarrow> z \<in> E \<longrightarrow> z \<in> orbit G \<phi> x))
[PROOF STEP]
using orbit_refl orbit_sym orbit_trans
[PROOF STATE]
proof (prove)
using this:
?x \<in> E \<Longrightarrow> ?x \<in> orbit G \<phi> ?x
\<lbrakk>?x \<in> E; ?y \<in> E; ?y \<in> orbit G \<phi> ?x\<rbrakk> \<Longrightarrow> ?x \<in> orbit G \<phi> ?y
\<lbrakk>?x \<in> E; ?y \<in> E; ?z \<in> E; ?y \<in> orbit G \<phi> ?x; ?z \<in> orbit G \<phi> ?y\<rbrakk> \<Longrightarrow> ?z \<in> orbit G \<phi> ?x

goal (1 subgoal):
 1. (\<forall>x. x \<in> E \<longrightarrow> x \<in> orbit G \<phi> x) \<and> (\<forall>x y. y \<in> orbit G \<phi> x \<longrightarrow> x \<in> E \<longrightarrow> y \<in> E \<longrightarrow> x \<in> orbit G \<phi> y) \<and> (\<forall>x y. y \<in> orbit G \<phi> x \<longrightarrow> (\<forall>z. z \<in> orbit G \<phi> y \<longrightarrow> x \<in> E \<longrightarrow> y \<in> E \<longrightarrow> z \<in> E \<longrightarrow> z \<in> orbit G \<phi> x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
equivalence \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>

goal (1 subgoal):
 1. Congruence.partition E (orbits G E \<phi>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
equivalence \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>

goal (1 subgoal):
 1. Congruence.partition E (orbits G E \<phi>)
[PROOF STEP]
using equivalence.partition_from_equivalence orbits_as_classes
[PROOF STATE]
proof (prove)
using this:
equivalence \<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>
equivalence ?S \<Longrightarrow> Congruence.partition (carrier ?S) classes\<^bsub>?S\<^esub>
classes\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> = orbits G E \<phi>

goal (1 subgoal):
 1. Congruence.partition E (orbits G E \<phi>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Congruence.partition E (orbits G E \<phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_polynomial_function_iff_sum:
     "real_polynomial_function f \<longleftrightarrow> (\<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x^i))"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_polynomial_function f = (\<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real_polynomial_function f \<Longrightarrow> \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i)
 2. \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i) \<Longrightarrow> real_polynomial_function f
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
real_polynomial_function f

goal (2 subgoals):
 1. real_polynomial_function f \<Longrightarrow> \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i)
 2. \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i) \<Longrightarrow> real_polynomial_function f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function f
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function f

goal (1 subgoal):
 1. \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i)
[PROOF STEP]
by (metis real_polynomial_function_imp_sum)
[PROOF STATE]
proof (state)
this:
\<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i)

goal (1 subgoal):
 1. \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i) \<Longrightarrow> real_polynomial_function f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i) \<Longrightarrow> real_polynomial_function f
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i)

goal (1 subgoal):
 1. \<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i) \<Longrightarrow> real_polynomial_function f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>a n. f = (\<lambda>x. \<Sum>i\<le>n. a i * x ^ i)

goal (1 subgoal):
 1. real_polynomial_function f
[PROOF STEP]
by (auto simp: linear mult const real_polynomial_function_power real_polynomial_function_sum)
[PROOF STATE]
proof (state)
this:
real_polynomial_function f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_imp_msubset_mset_set:
  assumes "A \<subseteq> B" "finite B"
  shows   "mset_set A \<subseteq># mset_set B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
proof (rule mset_subset_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. count (mset_set A) a \<le> count (mset_set B) a
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. count (mset_set A) a \<le> count (mset_set B) a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> B
finite B
[PROOF STEP]
have "finite A"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
finite B

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

goal (1 subgoal):
 1. \<And>a. count (mset_set A) a \<le> count (mset_set B) a
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> B
finite B
finite A
[PROOF STEP]
show "count (mset_set A) x \<le> count (mset_set B) x"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
finite B
finite A

goal (1 subgoal):
 1. count (mset_set A) x \<le> count (mset_set B) x
[PROOF STEP]
by (cases "x \<in> A"; cases "x \<in> B") auto
[PROOF STATE]
proof (state)
this:
count (mset_set A) x \<le> count (mset_set B) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Am34_ub: assumes "bst t"
shows "S34.Am t \<le> (3/2) * log 2 (size1 t) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S34.Am t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S34.Am t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
have "S34.Am t \<le> log (root 3 4) (size1 t) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S34.Am t \<le> log (root 3 4) (real (size1 t)) + 1
[PROOF STEP]
by(rule S34.Am_ub3[OF assms])
[PROOF STATE]
proof (state)
this:
S34.Am t \<le> log (root 3 4) (real (size1 t)) + 1

goal (1 subgoal):
 1. S34.Am t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S34.Am t \<le> log (root 3 4) (real (size1 t)) + 1

goal (1 subgoal):
 1. S34.Am t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
have "\<dots> = (3/2) * log 2 (size1 t) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (root 3 4) (real (size1 t)) + 1 = 3 / 2 * \<phi> t + 1
[PROOF STEP]
by(simp add: log4_log2)
[PROOF STATE]
proof (state)
this:
log (root 3 4) (real (size1 t)) + 1 = 3 / 2 * \<phi> t + 1

goal (1 subgoal):
 1. S34.Am t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S34.Am t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S34.Am t \<le> 3 / 2 * \<phi> t + 1

goal (1 subgoal):
 1. S34.Am t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S34.Am t \<le> 3 / 2 * \<phi> t + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coprime_add_one_right [simp]: "coprime a (a + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a (a + (1::'a))
[PROOF STEP]
using coprime_add_one_left [of a]
[PROOF STATE]
proof (prove)
using this:
coprime (a + (1::'a)) a

goal (1 subgoal):
 1. coprime a (a + (1::'a))
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma card_orbit: "card (tetrahedral.orbit A) = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (tetrahedral.orbit A) = 4
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (tetrahedral.orbit A) = 4
[PROOF STEP]
from card.empty card_insert_if
[PROOF STATE]
proof (chain)
picking this:
card {} = 0
finite ?A \<Longrightarrow> card (insert ?x ?A) = (if ?x \<in> ?A then card ?A else Suc (card ?A))
[PROOF STEP]
have "card vertices = 4"
[PROOF STATE]
proof (prove)
using this:
card {} = 0
finite ?A \<Longrightarrow> card (insert ?x ?A) = (if ?x \<in> ?A then card ?A else Suc (card ?A))

goal (1 subgoal):
 1. card vertices = 4
[PROOF STEP]
unfolding vertices_def
[PROOF STATE]
proof (prove)
using this:
card {} = 0
finite ?A \<Longrightarrow> card (insert ?x ?A) = (if ?x \<in> ?A then card ?A else Suc (card ?A))

goal (1 subgoal):
 1. card {A, B, C, D} = 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card vertices = 4

goal (1 subgoal):
 1. card (tetrahedral.orbit A) = 4
[PROOF STEP]
with orbit_is_transitive
[PROOF STATE]
proof (chain)
picking this:
tetrahedral.orbit A = vertices
card vertices = 4
[PROOF STEP]
show "card (tetrahedral.orbit A) = 4"
[PROOF STATE]
proof (prove)
using this:
tetrahedral.orbit A = vertices
card vertices = 4

goal (1 subgoal):
 1. card (tetrahedral.orbit A) = 4
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (tetrahedral.orbit A) = 4

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_sqrt_power_even:
  assumes "even n" "x \<ge> 0"
  shows   "sqrt x ^ n = x ^ (n div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt x ^ n = x ^ (n div 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt x ^ n = x ^ (n div 2)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
even n
0 \<le> x
[PROOF STEP]
obtain k where "n = 2*k"
[PROOF STATE]
proof (prove)
using this:
even n
0 \<le> x

goal (1 subgoal):
 1. (\<And>k. n = 2 * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim!: evenE)
[PROOF STATE]
proof (state)
this:
n = 2 * k

goal (1 subgoal):
 1. sqrt x ^ n = x ^ (n div 2)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
even n
0 \<le> x
n = 2 * k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
even n
0 \<le> x
n = 2 * k

goal (1 subgoal):
 1. sqrt x ^ n = x ^ (n div 2)
[PROOF STEP]
by (simp add: power_mult)
[PROOF STATE]
proof (state)
this:
sqrt x ^ n = x ^ (n div 2)

goal:
No subgoals!
[PROOF STEP]
qed