[STATEMENT]
lemma jumpF_neg_has_sgnx:
  assumes "jumpF f F < 0"
  shows "(f has_sgnx -1) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_sgnx - 1) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_sgnx - 1) F
[PROOF STEP]
have "filterlim f at_bot F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_bot F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
jumpF f F < 0

goal (1 subgoal):
 1. filterlim f at_bot F
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
(if filterlim f at_top F then 1 / 2 else if filterlim f at_bot F then - 1 / 2 else 0) < 0

goal (1 subgoal):
 1. filterlim f at_bot F
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
filterlim f at_bot F

goal (1 subgoal):
 1. (f has_sgnx - 1) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_bot F
[PROOF STEP]
have "eventually (\<lambda>x. f x<0) F"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_bot F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < 0
[PROOF STEP]
using filterlim_at_bot_dense[of f F]
[PROOF STATE]
proof (prove)
using this:
filterlim f at_bot F
filterlim f at_bot F = (\<forall>Z. \<forall>\<^sub>F x in F. f x < Z)

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

goal (1 subgoal):
 1. (f has_sgnx - 1) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x < 0

goal (1 subgoal):
 1. (f has_sgnx - 1) F
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. sgn (f x) = - 1
[PROOF STEP]
apply (elim eventually_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f x < 0 \<Longrightarrow> sgn (f x) = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f has_sgnx - 1) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suntil_smap: "(P suntil Q) (smap f s) \<longleftrightarrow> ((\<lambda>x. P (smap f x)) suntil (\<lambda>x. Q (smap f x))) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P suntil Q) (smap f s) = ((\<lambda>x. P (smap f x)) suntil (\<lambda>x. Q (smap f x))) s
[PROOF STEP]
by (rule suntil_inv) simp


[STATEMENT]
lemma PosOrdeq_trans:
  assumes "v1 :\<sqsubseteq>val v2" "v2 :\<sqsubseteq>val v3"
  shows "v1 :\<sqsubseteq>val v3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v1 :\<sqsubseteq>val v3
[PROOF STEP]
using assms PosOrd_ordering
[PROOF STATE]
proof (prove)
using this:
v1 :\<sqsubseteq>val v2
v2 :\<sqsubseteq>val v3
ordering PosOrd_ex_eq PosOrd_ex

goal (1 subgoal):
 1. v1 :\<sqsubseteq>val v3
[PROOF STEP]
unfolding ordering_def
[PROOF STATE]
proof (prove)
using this:
v1 :\<sqsubseteq>val v2
v2 :\<sqsubseteq>val v3
partial_preordering PosOrd_ex_eq \<and> ordering_axioms PosOrd_ex_eq PosOrd_ex

goal (1 subgoal):
 1. v1 :\<sqsubseteq>val v3
[PROOF STEP]
by (metis partial_preordering.trans)


[STATEMENT]
lemma (in product_prob_space) emeasure_PiM_emb:
  "J \<subseteq> I \<Longrightarrow> finite J \<Longrightarrow> (\<And>i. i \<in> J \<Longrightarrow> X i \<in> sets (M i)) \<Longrightarrow>
    emeasure (Pi\<^sub>M I M) (emb I J (Pi\<^sub>E J X)) = (\<Prod> i\<in>J. emeasure (M i) (X i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>J \<subseteq> I; finite J; \<And>i. i \<in> J \<Longrightarrow> X i \<in> events i\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M I M) (emb I J (Pi\<^sub>E J X)) = (\<Prod>i\<in>J. emeasure (M i) (X i))
[PROOF STEP]
by (subst emeasure_PiM_emb') (auto intro!: emeasure_PiM)


[STATEMENT]
lemma floor_divide_upper:
  fixes q :: "'a::floor_ceiling"
  shows "q > 0 \<Longrightarrow> p < (of_int \<lfloor>p / q\<rfloor> + 1) * q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < q \<Longrightarrow> p < (of_int \<lfloor>p / q\<rfloor> + (1::'a)) * q
[PROOF STEP]
by (meson floor_eq_iff pos_divide_less_eq)


[STATEMENT]
lemma mirror_elem_le_conv: "
  \<lbrakk> finite I; a \<in> I; b \<in> I \<rbrakk> \<Longrightarrow>
  (mirror_elem b I \<le> mirror_elem a I) = (a \<le> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; a \<in> I; b \<in> I\<rbrakk> \<Longrightarrow> (mirror_elem b I \<le> mirror_elem a I) = (a \<le> b)
[PROOF STEP]
apply (unfold mirror_elem_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; a \<in> I; b \<in> I\<rbrakk> \<Longrightarrow> (nat_mirror b (iMin I) (Max I) \<le> nat_mirror a (iMin I) (Max I)) = (a \<le> b)
[PROOF STEP]
apply (rule nat_mirror_le_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; a \<in> I; b \<in> I\<rbrakk> \<Longrightarrow> a \<le> iMin I + Max I
[PROOF STEP]
apply (simp add: trans_le_add2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma plus_eq_zero_2: "t = 0" if "s + t = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t = (0::'a)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
s + t = (0::'a)

goal (1 subgoal):
 1. t = (0::'a)
[PROOF STEP]
by (simp only: add_commute[of s t] plus_eq_zero)


[STATEMENT]
lemma spaceN_diff [simp]:
  assumes "x \<in> space\<^sub>N N" "y \<in> space\<^sub>N N"
  shows "x - y \<in> space\<^sub>N N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - y \<in> space\<^sub>N N
[PROOF STEP]
using spaceN_add[OF assms(1) spaceN_cmult[OF assms(2), of "-1"]]
[PROOF STATE]
proof (prove)
using this:
x + - 1 *\<^sub>R y \<in> space\<^sub>N N

goal (1 subgoal):
 1. x - y \<in> space\<^sub>N N
[PROOF STEP]
by auto


[STATEMENT]
lemma cosh_dist:
  assumes "u \<in> unit_disc" and "v \<in> unit_disc"
  shows "cosh_dist u v = poincare_distance_formula' (to_complex u) (to_complex v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cosh_dist u v = poincare_distance_formula' (to_complex u) (to_complex v)
[PROOF STEP]
using poincare_distance_formula[OF assms] poincare_distance_formula'_ge_1[OF assms]
[PROOF STATE]
proof (prove)
using this:
poincare_distance u v = poincare_distance_formula (to_complex u) (to_complex v)
1 \<le> poincare_distance_formula' (to_complex u) (to_complex v)

goal (1 subgoal):
 1. cosh_dist u v = poincare_distance_formula' (to_complex u) (to_complex v)
[PROOF STEP]
by simp


[STATEMENT]
lemma Pair_prs [quot_preserve]:
  assumes q1: "Quotient3 R1 Abs1 Rep1"
  assumes q2: "Quotient3 R2 Abs2 Rep2"
  shows "(Rep1 ---> Rep2 ---> (map_prod Abs1 Abs2)) Pair = Pair"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Rep1 ---> Rep2 ---> map_prod Abs1 Abs2) Pair = Pair
[PROOF STEP]
apply(simp add: fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. Abs1 (Rep1 x) = x) \<and> (\<forall>x. Abs2 (Rep2 x) = x)
[PROOF STEP]
apply(simp add: Quotient3_abs_rep[OF q1] Quotient3_abs_rep[OF q2])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma summable_inv_Q:
  fixes Q :: "'a :: banach \<Rightarrow>\<^sub>L 'a"
  assumes onorm_le: "norm (id_blinfun - Q) < 1"
  shows "summable (\<lambda>n. (id_blinfun - Q)^^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable ((^^) (id_blinfun - Q))
[PROOF STEP]
using onorm_le norm_blinfun_compose
[PROOF STATE]
proof (prove)
using this:
norm (id_blinfun - Q) < 1
norm (?f o\<^sub>L ?g) \<le> norm ?f * norm ?g

goal (1 subgoal):
 1. summable ((^^) (id_blinfun - Q))
[PROOF STEP]
by (force intro!: summable_ratio_test)


[STATEMENT]
lemma (in group) hom_group_mul_rev:
  assumes "(\<lambda>(x,y). x \<otimes> y) \<in> hom (subgroup_generated G A \<times>\<times> subgroup_generated G B) G"
          (is "?h \<in> hom ?P G")
   and "x \<in> carrier G" "y \<in> carrier G" "x \<in> A" "y \<in> B"
 shows "x \<otimes> y = y \<otimes> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
interpret P: group_hom ?P G ?h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom (subgroup_generated G A \<times>\<times> subgroup_generated G B) G (\<lambda>(x, y). x \<otimes> y)
[PROOF STEP]
by (simp add: assms DirProd_group group_hom.intro group_hom_axioms.intro is_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
have xy: "(x,y) \<in> carrier ?P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> carrier (subgroup_generated G A \<times>\<times> subgroup_generated G B)
[PROOF STEP]
by (auto simp: assms carrier_subgroup_generated generate.incl)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> carrier (subgroup_generated G A \<times>\<times> subgroup_generated G B)

goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
have "x \<otimes> (x \<otimes> (y \<otimes> y)) = x \<otimes> (y \<otimes> (x \<otimes> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<otimes> (x \<otimes> (y \<otimes> y)) = x \<otimes> (y \<otimes> (x \<otimes> y))
[PROOF STEP]
using P.hom_mult [OF xy xy]
[PROOF STATE]
proof (prove)
using this:
(case (x, y) \<otimes>\<^bsub>subgroup_generated G A \<times>\<times> subgroup_generated G B\<^esub> (x, y) of (x, y) \<Rightarrow> x \<otimes> y) = (case (x, y) of (x, y) \<Rightarrow> x \<otimes> y) \<otimes> (case (x, y) of (x, y) \<Rightarrow> x \<otimes> y)

goal (1 subgoal):
 1. x \<otimes> (x \<otimes> (y \<otimes> y)) = x \<otimes> (y \<otimes> (x \<otimes> y))
[PROOF STEP]
by (simp add: m_assoc assms)
[PROOF STATE]
proof (state)
this:
x \<otimes> (x \<otimes> (y \<otimes> y)) = x \<otimes> (y \<otimes> (x \<otimes> y))

goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<otimes> (x \<otimes> (y \<otimes> y)) = x \<otimes> (y \<otimes> (x \<otimes> y))
[PROOF STEP]
have "x \<otimes> (y \<otimes> y) = y \<otimes> (x \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
x \<otimes> (x \<otimes> (y \<otimes> y)) = x \<otimes> (y \<otimes> (x \<otimes> y))

goal (1 subgoal):
 1. x \<otimes> (y \<otimes> y) = y \<otimes> (x \<otimes> y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<otimes> (x \<otimes> (y \<otimes> y)) = x \<otimes> (y \<otimes> (x \<otimes> y))
(\<lambda>(x, y). x \<otimes> y) \<in> hom (subgroup_generated G A \<times>\<times> subgroup_generated G B) G
x \<in> carrier G
y \<in> carrier G
x \<in> A
y \<in> B

goal (1 subgoal):
 1. x \<otimes> (y \<otimes> y) = y \<otimes> (x \<otimes> y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<otimes> (y \<otimes> y) = y \<otimes> (x \<otimes> y)

goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<otimes> (y \<otimes> y) = y \<otimes> (x \<otimes> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<otimes> (y \<otimes> y) = y \<otimes> (x \<otimes> y)

goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
by (simp add: assms flip: m_assoc)
[PROOF STATE]
proof (state)
this:
x \<otimes> y = y \<otimes> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_le_replicate_mset_subset_eq: "n \<le> count M x \<longleftrightarrow> replicate_mset n x \<subseteq># M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n \<le> count M x) = (replicate_mset n x \<subseteq># M)
[PROOF STEP]
by (auto simp add: mset_subset_eqI) (metis count_replicate_mset subseteq_mset_def)


[STATEMENT]
lemma fin_make_untimed_nth_length:
  assumes "z i = [a]"
  shows
  "fin_make_untimed (inf_truncate z i) !
     (length (fin_make_untimed (inf_truncate z i)) - Suc 0)
    = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_make_untimed (inf_truncate z i) ! (length (fin_make_untimed (inf_truncate z i)) - Suc 0) = a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fin_make_untimed (inf_truncate z i) ! (length (fin_make_untimed (inf_truncate z i)) - Suc 0) = a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
z i = [a]
[PROOF STEP]
have sg1:"last (fin_make_untimed (inf_truncate z i)) = a"
[PROOF STATE]
proof (prove)
using this:
z i = [a]

goal (1 subgoal):
 1. last (fin_make_untimed (inf_truncate z i)) = a
[PROOF STEP]
by (simp add: last_fin_make_untimed_inf_truncate)
[PROOF STATE]
proof (state)
this:
last (fin_make_untimed (inf_truncate z i)) = a

goal (1 subgoal):
 1. fin_make_untimed (inf_truncate z i) ! (length (fin_make_untimed (inf_truncate z i)) - Suc 0) = a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
z i = [a]
[PROOF STEP]
have sg2:"concat (inf_truncate z i) \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
z i = [a]

goal (1 subgoal):
 1. concat (inf_truncate z i) \<noteq> []
[PROOF STEP]
by (rule concat_inf_truncate_nonempty_a)
[PROOF STATE]
proof (state)
this:
concat (inf_truncate z i) \<noteq> []

goal (1 subgoal):
 1. fin_make_untimed (inf_truncate z i) ! (length (fin_make_untimed (inf_truncate z i)) - Suc 0) = a
[PROOF STEP]
from assms and sg1 and sg2
[PROOF STATE]
proof (chain)
picking this:
z i = [a]
last (fin_make_untimed (inf_truncate z i)) = a
concat (inf_truncate z i) \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z i = [a]
last (fin_make_untimed (inf_truncate z i)) = a
concat (inf_truncate z i) \<noteq> []

goal (1 subgoal):
 1. fin_make_untimed (inf_truncate z i) ! (length (fin_make_untimed (inf_truncate z i)) - Suc 0) = a
[PROOF STEP]
by (simp add: fin_make_untimed_def last_nth_length)
[PROOF STATE]
proof (state)
this:
fin_make_untimed (inf_truncate z i) ! (length (fin_make_untimed (inf_truncate z i)) - Suc 0) = a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_monoid) m_lcomm:
  "\<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow>
   x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
assume xyz: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
y \<in> carrier G
z \<in> carrier G

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
from xyz
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
z \<in> carrier G
[PROOF STEP]
have "x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
z \<in> carrier G

goal (1 subgoal):
 1. x \<otimes> (y \<otimes> z) = x \<otimes> y \<otimes> z
[PROOF STEP]
by (simp add: m_assoc)
[PROOF STATE]
proof (state)
this:
x \<otimes> (y \<otimes> z) = x \<otimes> y \<otimes> z

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<otimes> (y \<otimes> z) = x \<otimes> y \<otimes> z

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
from xyz
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
z \<in> carrier G
[PROOF STEP]
have "... = (y \<otimes> x) \<otimes> z"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
z \<in> carrier G

goal (1 subgoal):
 1. x \<otimes> y \<otimes> z = y \<otimes> x \<otimes> z
[PROOF STEP]
by (simp add: m_comm)
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<otimes> z = y \<otimes> x \<otimes> z

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<otimes> z = y \<otimes> x \<otimes> z

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
from xyz
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
z \<in> carrier G
[PROOF STEP]
have "... = y \<otimes> (x \<otimes> z)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
z \<in> carrier G

goal (1 subgoal):
 1. y \<otimes> x \<otimes> z = y \<otimes> (x \<otimes> z)
[PROOF STEP]
by (simp add: m_assoc)
[PROOF STATE]
proof (state)
this:
y \<otimes> x \<otimes> z = y \<otimes> (x \<otimes> z)

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)

goal (1 subgoal):
 1. x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_linorder_matrix_2:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  assumes "\<forall>i j k . f (i,j) = f (i,k)"
    shows "matrix_bounded_idempotent_semiring.vector f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_bounded_idempotent_semiring.vector f
[PROOF STEP]
proof (rule ext, rule prod_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x a b. (f \<odot> mtop) (a, b) = f (a, b)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x a b. (f \<odot> mtop) (a, b) = f (a, b)
[PROOF STEP]
have "(f \<odot> mtop) (i,j) = (\<Squnion>\<^sub>k f (i,k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<odot> mtop) (i, j) = sup_monoid.sum (\<lambda>k. f (i, k)) {k. True}
[PROOF STEP]
by (simp add: comp_top_linorder_matrix)
[PROOF STATE]
proof (state)
this:
(f \<odot> mtop) (i, j) = sup_monoid.sum (\<lambda>k. f (i, k)) {k. True}

goal (1 subgoal):
 1. \<And>x a b. (f \<odot> mtop) (a, b) = f (a, b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<odot> mtop) (i, j) = sup_monoid.sum (\<lambda>k. f (i, k)) {k. True}

goal (1 subgoal):
 1. \<And>x a b. (f \<odot> mtop) (a, b) = f (a, b)
[PROOF STEP]
have "... = f (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>k. f (i, k)) {k. True} = f (i, j)
[PROOF STEP]
by (metis assms linorder_finite_sup_selective)
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>k. f (i, k)) {k. True} = f (i, j)

goal (1 subgoal):
 1. \<And>x a b. (f \<odot> mtop) (a, b) = f (a, b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<odot> mtop) (i, j) = f (i, j)
[PROOF STEP]
show "(f \<odot> mtop) (i,j) = f (i,j)"
[PROOF STATE]
proof (prove)
using this:
(f \<odot> mtop) (i, j) = f (i, j)

goal (1 subgoal):
 1. (f \<odot> mtop) (i, j) = f (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<odot> mtop) (i, j) = f (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scaleR_minus1_left [simp]: "scaleR (-1) x = - x"
  for x :: "'a::real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 *\<^sub>R x = - x
[PROOF STEP]
using scaleR_minus_left [of 1 x]
[PROOF STATE]
proof (prove)
using this:
- 1 *\<^sub>R x = - (1 *\<^sub>R x)

goal (1 subgoal):
 1. - 1 *\<^sub>R x = - x
[PROOF STEP]
by simp


[STATEMENT]
lemma smult_inj[simp]: assumes "(a::'a::idom) \<noteq> 0" shows "inj (smult a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (Polynomial.smult a)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj (Polynomial.smult a)
[PROOF STEP]
interpret map_poly_inj_zero_hom "(*) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_inj_zero_hom ((*) a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. map_poly_inj_zero_hom ((*) a)
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj (Polynomial.smult a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (Polynomial.smult a)
[PROOF STEP]
unfolding smult_as_map_poly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (map_poly ((*) a))
[PROOF STEP]
by (rule inj_f)
[PROOF STATE]
proof (state)
this:
inj (Polynomial.smult a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fmdom_empty_fmempty_iff[simp]: \<open>fmdom m = {||} \<longleftrightarrow> m = fmempty\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fmdom m = {||}) = (m = fmempty)
[PROOF STEP]
by (metis fmdom_empty fmdrop_fset_fmdom fmdrop_fset_null)


[STATEMENT]
theorem derivation_sound:
  assumes "resolution_deriv Cs Cs'"
  assumes "eval\<^sub>c\<^sub>s F G Cs"
  shows"eval\<^sub>c\<^sub>s F G Cs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval\<^sub>c\<^sub>s F G Cs'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
resolution_deriv Cs Cs'
eval\<^sub>c\<^sub>s F G Cs

goal (1 subgoal):
 1. eval\<^sub>c\<^sub>s F G Cs'
[PROOF STEP]
unfolding resolution_deriv_def
[PROOF STATE]
proof (prove)
using this:
resolution_step\<^sup>*\<^sup>* Cs Cs'
eval\<^sub>c\<^sub>s F G Cs

goal (1 subgoal):
 1. eval\<^sub>c\<^sub>s F G Cs'
[PROOF STEP]
proof (induction rule: rtranclp.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. eval\<^sub>c\<^sub>s F G a \<Longrightarrow> eval\<^sub>c\<^sub>s F G a
 2. \<And>a b c. \<lbrakk>resolution_step\<^sup>*\<^sup>* a b; eval\<^sub>c\<^sub>s F G a \<Longrightarrow> eval\<^sub>c\<^sub>s F G b; resolution_step b c; eval\<^sub>c\<^sub>s F G a\<rbrakk> \<Longrightarrow> eval\<^sub>c\<^sub>s F G c
[PROOF STEP]
case rtrancl_refl
[PROOF STATE]
proof (state)
this:
eval\<^sub>c\<^sub>s F G a_

goal (2 subgoals):
 1. \<And>a. eval\<^sub>c\<^sub>s F G a \<Longrightarrow> eval\<^sub>c\<^sub>s F G a
 2. \<And>a b c. \<lbrakk>resolution_step\<^sup>*\<^sup>* a b; eval\<^sub>c\<^sub>s F G a \<Longrightarrow> eval\<^sub>c\<^sub>s F G b; resolution_step b c; eval\<^sub>c\<^sub>s F G a\<rbrakk> \<Longrightarrow> eval\<^sub>c\<^sub>s F G c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eval\<^sub>c\<^sub>s F G a_
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
eval\<^sub>c\<^sub>s F G a_

goal (1 subgoal):
 1. eval\<^sub>c\<^sub>s F G a_
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eval\<^sub>c\<^sub>s F G a_

goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>resolution_step\<^sup>*\<^sup>* a b; eval\<^sub>c\<^sub>s F G a \<Longrightarrow> eval\<^sub>c\<^sub>s F G b; resolution_step b c; eval\<^sub>c\<^sub>s F G a\<rbrakk> \<Longrightarrow> eval\<^sub>c\<^sub>s F G c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>resolution_step\<^sup>*\<^sup>* a b; eval\<^sub>c\<^sub>s F G a \<Longrightarrow> eval\<^sub>c\<^sub>s F G b; resolution_step b c; eval\<^sub>c\<^sub>s F G a\<rbrakk> \<Longrightarrow> eval\<^sub>c\<^sub>s F G c
[PROOF STEP]
case (rtrancl_into_rtrancl Cs\<^sub>1 Cs\<^sub>2 Cs\<^sub>3)
[PROOF STATE]
proof (state)
this:
resolution_step\<^sup>*\<^sup>* Cs\<^sub>1 Cs\<^sub>2
resolution_step Cs\<^sub>2 Cs\<^sub>3
eval\<^sub>c\<^sub>s F G Cs\<^sub>1 \<Longrightarrow> eval\<^sub>c\<^sub>s F G Cs\<^sub>2
eval\<^sub>c\<^sub>s F G Cs\<^sub>1

goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>resolution_step\<^sup>*\<^sup>* a b; eval\<^sub>c\<^sub>s F G a \<Longrightarrow> eval\<^sub>c\<^sub>s F G b; resolution_step b c; eval\<^sub>c\<^sub>s F G a\<rbrakk> \<Longrightarrow> eval\<^sub>c\<^sub>s F G c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
resolution_step\<^sup>*\<^sup>* Cs\<^sub>1 Cs\<^sub>2
resolution_step Cs\<^sub>2 Cs\<^sub>3
eval\<^sub>c\<^sub>s F G Cs\<^sub>1 \<Longrightarrow> eval\<^sub>c\<^sub>s F G Cs\<^sub>2
eval\<^sub>c\<^sub>s F G Cs\<^sub>1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
resolution_step\<^sup>*\<^sup>* Cs\<^sub>1 Cs\<^sub>2
resolution_step Cs\<^sub>2 Cs\<^sub>3
eval\<^sub>c\<^sub>s F G Cs\<^sub>1 \<Longrightarrow> eval\<^sub>c\<^sub>s F G Cs\<^sub>2
eval\<^sub>c\<^sub>s F G Cs\<^sub>1

goal (1 subgoal):
 1. eval\<^sub>c\<^sub>s F G Cs\<^sub>3
[PROOF STEP]
using step_sound
[PROOF STATE]
proof (prove)
using this:
resolution_step\<^sup>*\<^sup>* Cs\<^sub>1 Cs\<^sub>2
resolution_step Cs\<^sub>2 Cs\<^sub>3
eval\<^sub>c\<^sub>s F G Cs\<^sub>1 \<Longrightarrow> eval\<^sub>c\<^sub>s F G Cs\<^sub>2
eval\<^sub>c\<^sub>s F G Cs\<^sub>1
\<lbrakk>resolution_step ?Cs ?Cs'; eval\<^sub>c\<^sub>s ?F ?G ?Cs\<rbrakk> \<Longrightarrow> eval\<^sub>c\<^sub>s ?F ?G ?Cs'

goal (1 subgoal):
 1. eval\<^sub>c\<^sub>s F G Cs\<^sub>3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eval\<^sub>c\<^sub>s F G Cs\<^sub>3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma natUnion_elem: "x \<in> f n \<Longrightarrow> x \<in> natUnion f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> f n \<Longrightarrow> x \<in> natUnion f
[PROOF STEP]
using natUnion_def
[PROOF STATE]
proof (prove)
using this:
natUnion ?f = \<Union> {?f n |n. True}

goal (1 subgoal):
 1. x \<in> f n \<Longrightarrow> x \<in> natUnion f
[PROOF STEP]
by fastforce


[STATEMENT]
theorem Par_Sbis[simp]:
assumes "properL cl" and "properL dl" "SbisL cl dl"
shows "Par cl \<approx>s Par dl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Par cl \<approx>s Par dl
[PROOF STEP]
using assms thetaSPar_Sbis
[PROOF STATE]
proof (prove)
using this:
properL cl
properL dl
SbisL cl dl
thetaSPar \<subseteq> Sbis

goal (1 subgoal):
 1. Par cl \<approx>s Par dl
[PROOF STEP]
unfolding thetaSPar_def
[PROOF STATE]
proof (prove)
using this:
properL cl
properL dl
SbisL cl dl
{(Par cl, Par dl) |cl dl. properL cl \<and> properL dl \<and> SbisL cl dl} \<subseteq> Sbis

goal (1 subgoal):
 1. Par cl \<approx>s Par dl
[PROOF STEP]
by blast


[STATEMENT]
lemma length_mmult_fa[simp]: "length (mmult_fa l m n AS BS) = l * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (mmult_fa l m n AS BS) = l * n
[PROOF STEP]
by (auto simp: mmult_fa_def length_concat o_def sum_list_distinct_conv_sum_set)


[STATEMENT]
lemma uniformly_convergent_imp_convergent:
  "uniformly_convergent_on X f \<Longrightarrow> x \<in> X \<Longrightarrow> convergent (\<lambda>n. f n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>uniformly_convergent_on X f; x \<in> X\<rbrakk> \<Longrightarrow> convergent (\<lambda>n. f n x)
[PROOF STEP]
unfolding uniformly_convergent_on_def convergent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>l. uniform_limit X f l sequentially; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>L. (\<lambda>n. f n x) \<longlonglongrightarrow> L
[PROOF STEP]
by (auto dest: tendsto_uniform_limitI)


[STATEMENT]
lemma has_derivative_transform_within_open:
  assumes "(f has_derivative f') (at x within t)"
    and "open s"
    and "x \<in> s"
    and "\<And>x. x\<in>s \<Longrightarrow> f x = g x"
  shows "(g has_derivative f') (at x within t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative f') (at x within t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x within t)
open s
x \<in> s
?x \<in> s \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. (g has_derivative f') (at x within t)
[PROOF STEP]
unfolding has_derivative_within
[PROOF STATE]
proof (prove)
using this:
bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within t)
open s
x \<in> s
?x \<in> s \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (g y - (g x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within t)
[PROOF STEP]
by (force simp add: intro: Lim_transform_within_open)


[STATEMENT]
lemma "A \<subset> B \<Longrightarrow> (\<forall>a \<in> A. a \<in> B) \<and> (\<exists>b \<in> B. b \<notin> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subset> B \<Longrightarrow> (\<forall>a\<in>A. a \<in> B) \<and> (\<exists>b\<in>B. b \<notin> A)
[PROOF STEP]
nitpick [card = 1-5, expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subset> B \<Longrightarrow> (\<forall>a\<in>A. a \<in> B) \<and> (\<exists>b\<in>B. b \<notin> A)
[PROOF STEP]
by auto


[STATEMENT]
lemma reduce_column_preserves2:
  assumes H: "H \<in> carrier_mat m n"
  and PK_H: "(P,K) = reduce_column div_op H"
  and m: "0 < m" and i: "i\<in>{0,1}" and im: "i<m" and j: "j<n"
shows "K $$ (i,j) = H $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K $$ (i, j) = H $$ (i, j)
[PROOF STEP]
using reduce_column_preserves[OF H PK_H m i im]
[PROOF STATE]
proof (prove)
using this:
Matrix.row K i = Matrix.row H i

goal (1 subgoal):
 1. K $$ (i, j) = H $$ (i, j)
[PROOF STEP]
by (metis H Matrix.row_def j carrier_matD(2) dim_vec index_vec)


[STATEMENT]
lemma (in module) finite_in_span:
  fixes S v
  assumes fin: "finite S" and h2: "S\<subseteq>carrier M" and h3: "v\<in>span S"
  shows "\<exists>a. (a\<in>S\<rightarrow>carrier R) \<and> (lincomb a S=v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. a \<in> S \<rightarrow> carrier R \<and> lincomb a S = v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. a \<in> S \<rightarrow> carrier R \<and> lincomb a S = v
[PROOF STEP]
from fin h2
[PROOF STATE]
proof (chain)
picking this:
finite S
S \<subseteq> carrier M
[PROOF STEP]
have fin_span: "span S = {lincomb a S |a. a \<in> S \<rightarrow> carrier R}"
[PROOF STATE]
proof (prove)
using this:
finite S
S \<subseteq> carrier M

goal (1 subgoal):
 1. span S = {lincomb a S |a. a \<in> S \<rightarrow> carrier R}
[PROOF STEP]
by (rule finite_span)
[PROOF STATE]
proof (state)
this:
span S = {lincomb a S |a. a \<in> S \<rightarrow> carrier R}

goal (1 subgoal):
 1. \<exists>a. a \<in> S \<rightarrow> carrier R \<and> lincomb a S = v
[PROOF STEP]
from h3 fin_span
[PROOF STATE]
proof (chain)
picking this:
v \<in> span S
span S = {lincomb a S |a. a \<in> S \<rightarrow> carrier R}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<in> span S
span S = {lincomb a S |a. a \<in> S \<rightarrow> carrier R}

goal (1 subgoal):
 1. \<exists>a. a \<in> S \<rightarrow> carrier R \<and> lincomb a S = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a. a \<in> S \<rightarrow> carrier R \<and> lincomb a S = v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_divide_subdegree:
  fixes   f g :: "'a::division_ring fps"
  assumes "f \<noteq> 0" "g \<noteq> 0" "subdegree g \<le> subdegree f"
  shows   "subdegree (f / g) = subdegree f - subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (f / g) = subdegree f - subdegree g
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subdegree (f / g) \<le> subdegree f - subdegree g
 2. subdegree f - subdegree g \<le> subdegree (f / g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> 0
g \<noteq> 0
subdegree g \<le> subdegree f
[PROOF STEP]
have 1: "(f div g) $ (subdegree f - subdegree g) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0
g \<noteq> 0
subdegree g \<le> subdegree f

goal (1 subgoal):
 1. (f / g) $ (subdegree f - subdegree g) \<noteq> (0::'a)
[PROOF STEP]
using fps_divide_nth_base[of g f]
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0
g \<noteq> 0
subdegree g \<le> subdegree f
subdegree g \<le> subdegree f \<Longrightarrow> (f / g) $ (subdegree f - subdegree g) = f $ subdegree f * inverse (g $ subdegree g)

goal (1 subgoal):
 1. (f / g) $ (subdegree f - subdegree g) \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f / g) $ (subdegree f - subdegree g) \<noteq> (0::'a)

goal (2 subgoals):
 1. subdegree (f / g) \<le> subdegree f - subdegree g
 2. subdegree f - subdegree g \<le> subdegree (f / g)
[PROOF STEP]
thus "subdegree (f / g) \<le> subdegree f - subdegree g"
[PROOF STATE]
proof (prove)
using this:
(f / g) $ (subdegree f - subdegree g) \<noteq> (0::'a)

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

goal (1 subgoal):
 1. subdegree f - subdegree g \<le> subdegree (f / g)
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
(f / g) $ (subdegree f - subdegree g) \<noteq> (0::'a)
[PROOF STEP]
have "f / g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
(f / g) $ (subdegree f - subdegree g) \<noteq> (0::'a)

goal (1 subgoal):
 1. f / g \<noteq> 0
[PROOF STEP]
by (auto intro: fps_nonzeroI)
[PROOF STATE]
proof (state)
this:
f / g \<noteq> 0

goal (1 subgoal):
 1. subdegree f - subdegree g \<le> subdegree (f / g)
[PROOF STEP]
thus "subdegree f - subdegree g \<le> subdegree (f / g)"
[PROOF STATE]
proof (prove)
using this:
f / g \<noteq> 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma two_step_zero [simp]: "two_step 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_step 0 = 0
[PROOF STEP]
by (simp add: two_step_def)


[STATEMENT]
lemma sumlist_snoc:
  assumes "set xs \<subseteq> carrier G" and "x \<in> carrier G"
  shows "sumlist (xs @ [x]) = sumlist xs \<oplus> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumlist (xs @ [x]) = sumlist xs \<oplus> x
[PROOF STEP]
by (subst sumlist_append, insert assms, auto)


[STATEMENT]
lemma lcoset_conv_set: "(a::'g::group_add) \<in> b +o A \<Longrightarrow> -b + a \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> b +o A \<Longrightarrow> - b + a \<in> A
[PROOF STEP]
by (auto simp add: elt_set_plus_def)


[STATEMENT]
lemma zip_upt_self_aux: "zip [0..<length xs] xs = map (\<lambda>i. (i, xs ! i)) [0..<length xs]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip [0..<length xs] xs = map (\<lambda>i. (i, xs ! i)) [0..<length xs]
[PROOF STEP]
by (auto intro!: nth_equalityI)


[STATEMENT]
lemma Example2'n_map_of_simps[simp]:
  "i < n \<Longrightarrow>
    map_of (map (\<lambda>i. ((p, i), g i)) [0..<n])
       (p, i) = Some (g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> map_of (map (\<lambda>i. ((p, i), g i)) [0..<n]) (p, i) = Some (g i)
[PROOF STEP]
apply (rule map_of_is_SomeI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i < n \<Longrightarrow> distinct (map fst (map (\<lambda>i. ((p, i), g i)) [0..<n]))
 2. i < n \<Longrightarrow> ((p, i), g i) \<in> set (map (\<lambda>i. ((p, i), g i)) [0..<n])
[PROOF STEP]
apply (clarsimp simp: distinct_map o_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i < n \<Longrightarrow> inj_on (Pair p) {0..<n}
 2. i < n \<Longrightarrow> ((p, i), g i) \<in> set (map (\<lambda>i. ((p, i), g i)) [0..<n])
[PROOF STEP]
apply (meson inj_onI prod.inject)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> ((p, i), g i) \<in> set (map (\<lambda>i. ((p, i), g i)) [0..<n])
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integrable_zero[simp, intro]: "integrable M (\<lambda>x. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. 0::'b)
[PROOF STEP]
by (metis has_bochner_integral_zero integrable.simps)


[STATEMENT]
lemma help_rtrancl_Range:
 "\<lbrakk> a \<noteq> b; (a,b) \<in> R ^* \<rbrakk> \<Longrightarrow> b \<in> Range R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> b; (a, b) \<in> R\<^sup>*\<rbrakk> \<Longrightarrow> b \<in> Range R
[PROOF STEP]
apply (erule rtranclE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<noteq> b; a = b\<rbrakk> \<Longrightarrow> b \<in> Range R
 2. \<And>y. \<lbrakk>a \<noteq> b; (a, y) \<in> R\<^sup>*; (y, b) \<in> R\<rbrakk> \<Longrightarrow> b \<in> Range R
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma primitive_part_normalize:
  fixes f :: "'a :: {semiring_gcd,idom_divide,normalization_semidom_multiplicative} poly"
  shows "primitive_part (normalize f) = normalize (primitive_part f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
proof (cases "f = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f = 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
 2. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f = 0

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
 2. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f = 0

goal (1 subgoal):
 1. primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
primitive_part (normalize f) = normalize (primitive_part f)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<noteq> 0

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
have "normalize (content (normalize (primitive_part f))) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (content (normalize (primitive_part f))) = (1::'a)
[PROOF STEP]
using content_primitive_part[OF False] content_dvd content_const
          content_dvd_contentI dvd_normalize_iff is_unit_content_iff
[PROOF STATE]
proof (prove)
using this:
content (primitive_part f) = (1::'a)
[:content ?p:] dvd ?p
content [:?c:] = normalize ?c
?p dvd ?q \<Longrightarrow> content ?p dvd content ?q
(?a dvd normalize ?b) = (?a dvd ?b)
is_unit (content ?p) = (content ?p = (1::?'a))

goal (1 subgoal):
 1. normalize (content (normalize (primitive_part f))) = (1::'a)
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
normalize (content (normalize (primitive_part f))) = (1::'a)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
normalize (content (normalize (primitive_part f))) = (1::'a)
[PROOF STEP]
have "content (normalize (primitive_part f)) = 1"
[PROOF STATE]
proof (prove)
using this:
normalize (content (normalize (primitive_part f))) = (1::'a)

goal (1 subgoal):
 1. content (normalize (primitive_part f)) = (1::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
content (normalize (primitive_part f)) = (1::'a)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
content (normalize (primitive_part f)) = (1::'a)
[PROOF STEP]
have "content (normalize f) = 1 * content f"
[PROOF STATE]
proof (prove)
using this:
content (normalize (primitive_part f)) = (1::'a)

goal (1 subgoal):
 1. content (normalize f) = (1::'a) * content f
[PROOF STEP]
by (metis (no_types) content_smult mult.commute normalize_content
    smult_content_normalize_primitive_part)
[PROOF STATE]
proof (state)
this:
content (normalize f) = (1::'a) * content f

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
content (normalize f) = (1::'a) * content f
[PROOF STEP]
have "content f = content (normalize f)"
[PROOF STATE]
proof (prove)
using this:
content (normalize f) = (1::'a) * content f

goal (1 subgoal):
 1. content f = content (normalize f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
content f = content (normalize f)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
content f = content (normalize f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
content f = content (normalize f)

goal (1 subgoal):
 1. primitive_part (normalize f) = normalize (primitive_part f)
[PROOF STEP]
unfolding smult_content_normalize_primitive_part[of f,symmetric]
[PROOF STATE]
proof (prove)
using this:
content f = content (smult (content f) (normalize (primitive_part f)))

goal (1 subgoal):
 1. primitive_part (smult (content f) (normalize (primitive_part f))) = normalize (primitive_part f)
[PROOF STEP]
by (metis (no_types) False content_times_primitive_part mult.commute mult_cancel_left
                                   mult_smult_right smult_content_normalize_primitive_part)
[PROOF STATE]
proof (state)
this:
primitive_part (normalize f) = normalize (primitive_part f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma select_index_div_2:
  fixes n i j::"nat"
  assumes "i < 2^(n+1)" and "j<n"
  shows "select_index n j (i div 2) = select_index (n+1) j i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select_index n j (i div 2) = select_index (n + 1) j i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. select_index n j (i div 2) = select_index (n + 1) j i
[PROOF STEP]
have "2^(n-Suc j) \<le> i div 2 mod 2^(n-j) \<Longrightarrow> 2^(n-j) \<le> i mod 2^(n+1-j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
define a::nat where a0:"a = i div 2 mod 2^(n-j)"
[PROOF STATE]
proof (state)
this:
a = i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
assume "2^(n-Suc j) \<le> a"
[PROOF STATE]
proof (state)
this:
2 ^ (n - Suc j) \<le> a

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ (n - Suc j) \<le> a
[PROOF STEP]
have "2*a + i mod 2 \<ge> 2^(n-(Suc j)+1)"
[PROOF STATE]
proof (prove)
using this:
2 ^ (n - Suc j) \<le> a

goal (1 subgoal):
 1. 2 ^ (n - Suc j + 1) \<le> 2 * a + i mod 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (n - Suc j + 1) \<le> 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ (n - Suc j + 1) \<le> 2 * a + i mod 2
[PROOF STEP]
have f0:"2*a + i mod 2 \<ge> 2^(n-j)"
[PROOF STATE]
proof (prove)
using this:
2 ^ (n - Suc j + 1) \<le> 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> 2 * a + i mod 2
[PROOF STEP]
by (metis Suc_diff_Suc Suc_eq_plus1 assms(2))
[PROOF STATE]
proof (state)
this:
2 ^ (n - j) \<le> 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
have "a < 2^(n-j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < 2 ^ (n - j)
[PROOF STEP]
using a0
[PROOF STATE]
proof (prove)
using this:
a = i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. a < 2 ^ (n - j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a < 2 ^ (n - j)

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < 2 ^ (n - j)
[PROOF STEP]
have "2*a + i mod 2 < 2*2^(n-j)"
[PROOF STATE]
proof (prove)
using this:
a < 2 ^ (n - j)

goal (1 subgoal):
 1. 2 * a + i mod 2 < 2 * 2 ^ (n - j)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
2 * a + i mod 2 < 2 * 2 ^ (n - j)

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * a + i mod 2 < 2 * 2 ^ (n - j)
[PROOF STEP]
have "2*a + i mod 2 < 2^(n-j+1)"
[PROOF STATE]
proof (prove)
using this:
2 * a + i mod 2 < 2 * 2 ^ (n - j)

goal (1 subgoal):
 1. 2 * a + i mod 2 < 2 ^ (n - j + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * a + i mod 2 < 2 ^ (n - j + 1)

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * a + i mod 2 < 2 ^ (n - j + 1)
[PROOF STEP]
have f1:"2*a + i mod 2 < 2^(n+1-j)"
[PROOF STATE]
proof (prove)
using this:
2 * a + i mod 2 < 2 ^ (n - j + 1)

goal (1 subgoal):
 1. 2 * a + i mod 2 < 2 ^ (n + 1 - j)
[PROOF STEP]
by (metis Nat.add_diff_assoc2 Suc_leD Suc_leI assms(2))
[PROOF STATE]
proof (state)
this:
2 * a + i mod 2 < 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
have "i = 2*(a + 2^(n-j)*(i div 2 div 2^(n-j))) + i mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2
[PROOF STEP]
using a0
[PROOF STATE]
proof (prove)
using this:
a = i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2
[PROOF STEP]
have "i = 2*a + i mod 2 + 2^(n-j+1)*(i div 2 div 2^(n-j))"
[PROOF STATE]
proof (prove)
using this:
i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2

goal (1 subgoal):
 1. i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
have "i = 2*a + i mod 2 + 2^(n+1-j)*(i div 2 div 2^(n-j))"
[PROOF STATE]
proof (prove)
using this:
i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
by (metis Nat.add_diff_assoc2 Suc_leD Suc_leI assms(2))
[PROOF STATE]
proof (state)
this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
have "i mod 2^(n+1-j) = 2*a + i mod 2"
[PROOF STATE]
proof (prove)
using this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))
2 * a + i mod 2 < 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
[PROOF STEP]
by (metis mod_if mod_mult_self2)
[PROOF STATE]
proof (state)
this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
[PROOF STEP]
show "2^(n-j) \<le> i mod 2^(n+1-j)"
[PROOF STATE]
proof (prove)
using this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
using f0
[PROOF STATE]
proof (prove)
using this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
2 ^ (n - j) \<le> 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. select_index n j (i div 2) = select_index (n + 1) j i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. select_index n j (i div 2) = select_index (n + 1) j i
[PROOF STEP]
have "2^(n-j) \<le> i mod 2^(n+1-j) \<Longrightarrow> 2^(n-Suc j) \<le> i div 2 mod 2^(n-j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
define a::nat where a0:"a = i div 2 mod 2^(n-j)"
[PROOF STATE]
proof (state)
this:
a = i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
assume a1:"2^(n-j) \<le> i mod 2^(n+1-j)"
[PROOF STATE]
proof (state)
this:
2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
have f0:"2^(n-j) = 2^(n-Suc j+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ (n - j) = (2::'a) ^ (n - Suc j + 1)
[PROOF STEP]
by (metis Suc_diff_Suc Suc_eq_plus1 assms(2))
[PROOF STATE]
proof (state)
this:
(2::?'a1) ^ (n - j) = (2::?'a1) ^ (n - Suc j + 1)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
have "a < 2^(n-j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < 2 ^ (n - j)
[PROOF STEP]
using a0
[PROOF STATE]
proof (prove)
using this:
a = i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. a < 2 ^ (n - j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a < 2 ^ (n - j)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < 2 ^ (n - j)
[PROOF STEP]
have "2*a + i mod 2 < 2*2^(n-j)"
[PROOF STATE]
proof (prove)
using this:
a < 2 ^ (n - j)

goal (1 subgoal):
 1. 2 * a + i mod 2 < 2 * 2 ^ (n - j)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
2 * a + i mod 2 < 2 * 2 ^ (n - j)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * a + i mod 2 < 2 * 2 ^ (n - j)
[PROOF STEP]
have "2*a + i mod 2 < 2^(n-j+1)"
[PROOF STATE]
proof (prove)
using this:
2 * a + i mod 2 < 2 * 2 ^ (n - j)

goal (1 subgoal):
 1. 2 * a + i mod 2 < 2 ^ (n - j + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * a + i mod 2 < 2 ^ (n - j + 1)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * a + i mod 2 < 2 ^ (n - j + 1)
[PROOF STEP]
have f1:"2*a + i mod 2 < 2^(n+1-j)"
[PROOF STATE]
proof (prove)
using this:
2 * a + i mod 2 < 2 ^ (n - j + 1)

goal (1 subgoal):
 1. 2 * a + i mod 2 < 2 ^ (n + 1 - j)
[PROOF STEP]
by (metis Nat.add_diff_assoc2 Suc_leD Suc_leI assms(2))
[PROOF STATE]
proof (state)
this:
2 * a + i mod 2 < 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
have "i = 2*(a + 2^(n-j)*(i div 2 div 2^(n-j))) + i mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2
[PROOF STEP]
using a0
[PROOF STATE]
proof (prove)
using this:
a = i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2
[PROOF STEP]
have "i = 2*a + i mod 2 + 2^(n-j+1)*(i div 2 div 2^(n-j))"
[PROOF STATE]
proof (prove)
using this:
i = 2 * (a + 2 ^ (n - j) * (i div 2 div 2 ^ (n - j))) + i mod 2

goal (1 subgoal):
 1. i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
have "i = 2*a + i mod 2 + 2^(n+1-j)*(i div 2 div 2^(n-j))"
[PROOF STATE]
proof (prove)
using this:
i = 2 * a + i mod 2 + 2 ^ (n - j + 1) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
by (metis Nat.add_diff_assoc2 Suc_leD Suc_leI assms(2))
[PROOF STATE]
proof (state)
this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))
[PROOF STEP]
have "i mod 2^(n+1-j) = 2*a + i mod 2"
[PROOF STATE]
proof (prove)
using this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))

goal (1 subgoal):
 1. i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
i = 2 * a + i mod 2 + 2 ^ (n + 1 - j) * (i div 2 div 2 ^ (n - j))
2 * a + i mod 2 < 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
[PROOF STEP]
by (metis mod_if mod_mult_self2)
[PROOF STATE]
proof (state)
this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
[PROOF STEP]
have "2*a + i mod 2 \<ge> 2^(n-j)"
[PROOF STATE]
proof (prove)
using this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> 2 * a + i mod 2
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
i mod 2 ^ (n + 1 - j) = 2 * a + i mod 2
2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> 2 * a + i mod 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (n - j) \<le> 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ (n - j) \<le> 2 * a + i mod 2
[PROOF STEP]
have "(2*a + i mod 2) div 2 \<ge> (2^(n-j)) div 2"
[PROOF STATE]
proof (prove)
using this:
2 ^ (n - j) \<le> 2 * a + i mod 2

goal (1 subgoal):
 1. 2 ^ (n - j) div 2 \<le> (2 * a + i mod 2) div 2
[PROOF STEP]
using div_le_mono
[PROOF STATE]
proof (prove)
using this:
2 ^ (n - j) \<le> 2 * a + i mod 2
?m \<le> ?n \<Longrightarrow> ?m div ?k \<le> ?n div ?k

goal (1 subgoal):
 1. 2 ^ (n - j) div 2 \<le> (2 * a + i mod 2) div 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
2 ^ (n - j) div 2 \<le> (2 * a + i mod 2) div 2

goal (1 subgoal):
 1. 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ (n - j) div 2 \<le> (2 * a + i mod 2) div 2
[PROOF STEP]
show "2^(n-Suc j) \<le> a"
[PROOF STATE]
proof (prove)
using this:
2 ^ (n - j) div 2 \<le> (2 * a + i mod 2) div 2

goal (1 subgoal):
 1. 2 ^ (n - Suc j) \<le> a
[PROOF STEP]
by (simp add: f0)
[PROOF STATE]
proof (state)
this:
2 ^ (n - Suc j) \<le> a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. select_index n j (i div 2) = select_index (n + 1) j i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)

goal (1 subgoal):
 1. select_index n j (i div 2) = select_index (n + 1) j i
[PROOF STEP]
using select_index_def assms
[PROOF STATE]
proof (prove)
using this:
2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j) \<Longrightarrow> 2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j)
2 ^ (n - j) \<le> i mod 2 ^ (n + 1 - j) \<Longrightarrow> 2 ^ (n - Suc j) \<le> i div 2 mod 2 ^ (n - j)
select_index ?n ?i ?j \<equiv> ?i \<le> ?n - 1 \<and> ?j \<le> 2 ^ ?n - 1 \<and> 2 ^ (?n - 1 - ?i) \<le> ?j mod 2 ^ (?n - ?i)
i < 2 ^ (n + 1)
j < n

goal (1 subgoal):
 1. select_index n j (i div 2) = select_index (n + 1) j i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
select_index n j (i div 2) = select_index (n + 1) j i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remove_proper_prefixes_code[code] :
  "remove_proper_prefixes (set xs) = set (filter (\<lambda>x . (\<forall> y \<in> set xs . is_prefix x y \<longrightarrow> x = y)) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remove_proper_prefixes (set xs) = set (filter (\<lambda>x. \<forall>y\<in>set xs. is_prefix x y \<longrightarrow> x = y) xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. remove_proper_prefixes (set xs) = set (filter (\<lambda>x. \<forall>y\<in>set xs. is_prefix x y \<longrightarrow> x = y) xs)
[PROOF STEP]
have *: "remove_proper_prefixes (set xs) = Set.filter (\<lambda> zs . \<nexists>ys . ys \<noteq> [] \<and> zs @ ys \<in> (set xs)) (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remove_proper_prefixes (set xs) = Set.filter (\<lambda>zs. \<nexists>ys. ys \<noteq> [] \<and> zs @ ys \<in> set xs) (set xs)
[PROOF STEP]
unfolding remove_proper_prefixes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> set xs. \<nexists>x'. x' \<noteq> [] \<and> x @ x' \<in> set xs} = Set.filter (\<lambda>zs. \<nexists>ys. ys \<noteq> [] \<and> zs @ ys \<in> set xs) (set xs)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
remove_proper_prefixes (set xs) = Set.filter (\<lambda>zs. \<nexists>ys. ys \<noteq> [] \<and> zs @ ys \<in> set xs) (set xs)

goal (1 subgoal):
 1. remove_proper_prefixes (set xs) = set (filter (\<lambda>x. \<forall>y\<in>set xs. is_prefix x y \<longrightarrow> x = y) xs)
[PROOF STEP]
have "\<And> zs . (\<nexists>ys . ys \<noteq> [] \<and> zs @ ys \<in> (set xs)) = (\<forall> ys \<in> set xs . is_prefix zs ys \<longrightarrow> zs = ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>zs. (\<nexists>ys. ys \<noteq> [] \<and> zs @ ys \<in> set xs) = (\<forall>ys\<in>set xs. is_prefix zs ys \<longrightarrow> zs = ys)
[PROOF STEP]
unfolding is_prefix_prefix
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>zs. (\<nexists>ys. ys \<noteq> [] \<and> zs @ ys \<in> set xs) = (\<forall>ys\<in>set xs. (\<exists>xs'. ys = zs @ xs') \<longrightarrow> zs = ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<nexists>ys. ys \<noteq> [] \<and> ?zs @ ys \<in> set xs) = (\<forall>ys\<in>set xs. is_prefix ?zs ys \<longrightarrow> ?zs = ys)

goal (1 subgoal):
 1. remove_proper_prefixes (set xs) = set (filter (\<lambda>x. \<forall>y\<in>set xs. is_prefix x y \<longrightarrow> x = y) xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<nexists>ys. ys \<noteq> [] \<and> ?zs @ ys \<in> set xs) = (\<forall>ys\<in>set xs. is_prefix ?zs ys \<longrightarrow> ?zs = ys)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<nexists>ys. ys \<noteq> [] \<and> ?zs @ ys \<in> set xs) = (\<forall>ys\<in>set xs. is_prefix ?zs ys \<longrightarrow> ?zs = ys)

goal (1 subgoal):
 1. remove_proper_prefixes (set xs) = set (filter (\<lambda>x. \<forall>y\<in>set xs. is_prefix x y \<longrightarrow> x = y) xs)
[PROOF STEP]
unfolding * filter_set
[PROOF STATE]
proof (prove)
using this:
(\<nexists>ys. ys \<noteq> [] \<and> ?zs @ ys \<in> set xs) = (\<forall>ys\<in>set xs. is_prefix ?zs ys \<longrightarrow> ?zs = ys)

goal (1 subgoal):
 1. set (filter (\<lambda>zs. \<nexists>ys. ys \<noteq> [] \<and> zs @ ys \<in> set xs) xs) = set (filter (\<lambda>x. \<forall>y\<in>set xs. is_prefix x y \<longrightarrow> x = y) xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
remove_proper_prefixes (set xs) = set (filter (\<lambda>x. \<forall>y\<in>set xs. is_prefix x y \<longrightarrow> x = y) xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma differentiable_at_splitD:
  "f differentiable at_left x"
  "f differentiable at_right x"
  if "f differentiable (at x)"
  for x::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f differentiable at_left x &&& f differentiable at_right x
[PROOF STEP]
using that[unfolded vector_derivative_works has_vector_derivative_at_split]
[PROOF STATE]
proof (prove)
using this:
(f has_vector_derivative vector_derivative f (at x)) (at_left x) \<and> (f has_vector_derivative vector_derivative f (at x)) (at_right x)

goal (1 subgoal):
 1. f differentiable at_left x &&& f differentiable at_right x
[PROOF STEP]
by auto


[STATEMENT]
lemma space_PiF_singleton_eq_product:
  assumes "finite I"
  shows "space (PiF {I} M) = (\<Pi>' i\<in>I. space (M i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (Pi\<^sub>F {I} M) = (\<Pi>' i\<in>I. space (M i))
[PROOF STEP]
by (auto simp: product_def space_PiF assms)


[STATEMENT]
lemma set_image[simp]:
  "\<lbrakk> distinct R; distinct xs; sorted R; sorted xs \<rbrakk>
     \<Longrightarrow> set (image R xs) = set R `` set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct R; distinct xs; sorted R; sorted xs\<rbrakk> \<Longrightarrow> set (List_local.image R xs) = set R `` set xs
[PROOF STEP]
by (induct R xs rule: image.induct) (auto iff: less_eq_prod_def)


[STATEMENT]
lemma left_right_unique[transfer_rule]: "left_unique R" "right_unique R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_unique R &&& right_unique R
[PROOF STEP]
using bi_unique
[PROOF STATE]
proof (prove)
using this:
bi_unique R

goal (1 subgoal):
 1. left_unique R &&& right_unique R
[PROOF STEP]
unfolding bi_unique_def left_unique_def right_unique_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x y z. R x y \<longrightarrow> R x z \<longrightarrow> y = z) \<and> (\<forall>x y z. R x z \<longrightarrow> R y z \<longrightarrow> x = y)

goal (1 subgoal):
 1. \<forall>x y z. R x z \<longrightarrow> R y z \<longrightarrow> x = y &&& \<forall>x y z. R x y \<longrightarrow> R x z \<longrightarrow> y = z
[PROOF STEP]
by auto


[STATEMENT]
lemma triangle_vertices_distinct1:
  assumes wf: "uwellformed G"
  assumes tri: "triangle_in_graph x y z G"
  shows "x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x \<noteq> y \<Longrightarrow> False
[PROOF STEP]
assume a: "\<not> x \<noteq> y"
[PROOF STATE]
proof (state)
this:
\<not> x \<noteq> y

goal (1 subgoal):
 1. \<not> x \<noteq> y \<Longrightarrow> False
[PROOF STEP]
have "card {x, y} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x, y} = 2
[PROOF STEP]
using tri wf triangle_in_graph_def
[PROOF STATE]
proof (prove)
using this:
triangle_in_graph x y z G
uwellformed G
triangle_in_graph ?x ?y ?z ?G \<equiv> {?x, ?y} \<in> uedges ?G \<and> {?y, ?z} \<in> uedges ?G \<and> {?x, ?z} \<in> uedges ?G

goal (1 subgoal):
 1. card {x, y} = 2
[PROOF STEP]
using uwellformed_def
[PROOF STATE]
proof (prove)
using this:
triangle_in_graph x y z G
uwellformed G
triangle_in_graph ?x ?y ?z ?G \<equiv> {?x, ?y} \<in> uedges ?G \<and> {?y, ?z} \<in> uedges ?G \<and> {?x, ?z} \<in> uedges ?G
uwellformed ?G \<equiv> \<forall>e\<in>uedges ?G. card e = 2 \<and> (\<forall>u\<in>e. u \<in> uverts ?G)

goal (1 subgoal):
 1. card {x, y} = 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card {x, y} = 2

goal (1 subgoal):
 1. \<not> x \<noteq> y \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
card {x, y} = 2

goal (1 subgoal):
 1. False
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
card {x, y} = 2
\<not> x \<noteq> y

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eSuc_minus_1 [simp]: "((n::eint)+ 1) - 1 = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n + 1 - 1 = n
[PROOF STEP]
using eSuc_minus_eSuc[of n 0]
[PROOF STATE]
proof (prove)
using this:
n + 1 - (0 + 1) = n - 0

goal (1 subgoal):
 1. n + 1 - 1 = n
[PROOF STEP]
by auto


[STATEMENT]
lemma lattice_of_append_cons:
  assumes fs: "set fs \<subseteq> carrier_vec n"   and v: "v \<in> carrier_vec n"
  shows "lattice_of (v # fs) = lattice_of (fs @ [v])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (v # fs) = lattice_of (fs @ [v])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice_of (v # fs) = lattice_of (fs @ [v])
[PROOF STEP]
have v_fs: "set (v # fs) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (v # fs) \<subseteq> carrier_vec n
[PROOF STEP]
using fs v
[PROOF STATE]
proof (prove)
using this:
set fs \<subseteq> carrier_vec n
v \<in> carrier_vec n

goal (1 subgoal):
 1. set (v # fs) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (v # fs) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lattice_of (v # fs) = lattice_of (fs @ [v])
[PROOF STEP]
hence fs_v: "set (fs @ [v]) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set (v # fs) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. set (fs @ [v]) \<subseteq> carrier_vec n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (fs @ [v]) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lattice_of (v # fs) = lattice_of (fs @ [v])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (v # fs) = lattice_of (fs @ [v])
[PROOF STEP]
unfolding lattice_of_altdef_lincomb[OF v_fs] lattice_of_altdef_lincomb[OF fs_v]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>f. lincomb (of_int \<circ> f) (set (v # fs)) = y} = {y. \<exists>f. lincomb (of_int \<circ> f) (set (fs @ [v])) = y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lattice_of (v # fs) = lattice_of (fs @ [v])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SK_disjS_disjK:
 "SK\<cdot>(disjS\<cdot>xs\<cdot>ys) = disjK\<cdot>(SK\<cdot>xs)\<cdot>(SK\<cdot>ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SK\<cdot>(disjS\<cdot>xs\<cdot>ys) = disjK\<cdot>(SK\<cdot>xs)\<cdot>(SK\<cdot>ys)
[PROOF STEP]
by (simp add: cfun_eq_iff disjS_def disjK_def SK_lappend_distrib)


[STATEMENT]
lemma summable_on_finite_union_disjoint:
  fixes f :: "'a \<Rightarrow> 'b::topological_comm_monoid_add"
  assumes finite: \<open>finite A\<close>
  assumes conv: \<open>\<And>a. a \<in> A \<Longrightarrow> f summable_on (B a)\<close>
  assumes disj: \<open>\<And>a a'. a\<in>A \<Longrightarrow> a'\<in>A \<Longrightarrow> a\<noteq>a' \<Longrightarrow> B a \<inter> B a' = {}\<close>
  shows \<open>f summable_on (\<Union>a\<in>A. B a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f summable_on \<Union> (B ` A)
[PROOF STEP]
using finite conv disj
[PROOF STATE]
proof (prove)
using this:
finite A
?a \<in> A \<Longrightarrow> f summable_on B ?a
\<lbrakk>?a \<in> A; ?a' \<in> A; ?a \<noteq> ?a'\<rbrakk> \<Longrightarrow> B ?a \<inter> B ?a' = {}

goal (1 subgoal):
 1. f summable_on \<Union> (B ` A)
[PROOF STEP]
apply induction
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>a. a \<in> {} \<Longrightarrow> f summable_on B a; \<And>a a'. \<lbrakk>a \<in> {}; a' \<in> {}; a \<noteq> a'\<rbrakk> \<Longrightarrow> B a \<inter> B a' = {}\<rbrakk> \<Longrightarrow> f summable_on \<Union> (B ` {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>a. a \<in> F \<Longrightarrow> f summable_on B a; \<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> B a \<inter> B a' = {}\<rbrakk> \<Longrightarrow> f summable_on \<Union> (B ` F); \<And>a. a \<in> insert x F \<Longrightarrow> f summable_on B a; \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> B a \<inter> B a' = {}\<rbrakk> \<Longrightarrow> f summable_on \<Union> (B ` insert x F)
[PROOF STEP]
by (auto intro!: summable_on_Un_disjoint)


[STATEMENT]
lemma path_component_of:
  "path_component_of X x y \<longleftrightarrow> (\<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T)"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_of X x y = (\<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_component_of X x y \<Longrightarrow> \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T
 2. \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T \<Longrightarrow> path_component_of X x y
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
path_component_of X x y

goal (2 subgoals):
 1. path_component_of X x y \<Longrightarrow> \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T
 2. \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T \<Longrightarrow> path_component_of X x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_component_of X x y
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
path_component_of X x y

goal (1 subgoal):
 1. \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T
[PROOF STEP]
by (metis atLeastAtMost_iff image_eqI order_refl path_component_of_def path_connectedin_path_image zero_le_one)
[PROOF STATE]
proof (state)
this:
\<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T

goal (1 subgoal):
 1. \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T \<Longrightarrow> path_component_of X x y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T \<Longrightarrow> path_component_of X x y
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T

goal (1 subgoal):
 1. \<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T \<Longrightarrow> path_component_of X x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T

goal (1 subgoal):
 1. path_component_of X x y
[PROOF STEP]
by (metis path_component_of_def path_connectedin)
[PROOF STATE]
proof (state)
this:
path_component_of X x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_cvec_z1_zero_iff:
  assumes "(z1, z2) \<noteq> vec_zero"
  shows "(z1, z2) \<approx>\<^sub>v 0\<^sub>v \<longleftrightarrow> z1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((z1, z2) \<approx>\<^sub>v 0\<^sub>v) = (z1 = 0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(z1, z2) \<noteq> vec_zero

goal (1 subgoal):
 1. ((z1, z2) \<approx>\<^sub>v 0\<^sub>v) = (z1 = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma positive_decomp_cmod_le:
  fixes A::"complex Matrix.mat"
  assumes "A\<in> carrier_mat n n"
  and "C\<in> carrier_mat n n"
  and "0 < n"
and "Complex_Matrix.positive A"
and "unitary_diag A B U"
and "\<And>i. i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))) \<le> M"
shows "cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "dim_row B = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B = n
[PROOF STEP]
using assms unitary_diag_carrier(1)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
C \<in> carrier_mat n n
0 < n
Complex_Matrix.positive A
unitary_diag A B U
?i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?i))) \<le> M
\<lbrakk>?A \<in> carrier_mat ?n ?n; unitary_diag ?A ?B ?U\<rbrakk> \<Longrightarrow> ?B \<in> carrier_mat ?n ?n

goal (1 subgoal):
 1. dim_row B = n
[PROOF STEP]
by (metis carrier_matD(1))
[PROOF STATE]
proof (state)
this:
dim_row B = n

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "hermitian A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
using assms positive_is_hermitian
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
C \<in> carrier_mat n n
0 < n
Complex_Matrix.positive A
unitary_diag A B U
?i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?i))) \<le> M
Complex_Matrix.positive ?A \<Longrightarrow> hermitian ?A

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

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
hence "cmod (Complex_Matrix.trace (C * A)) =
    cmod (\<Sum> i = 0 ..< n. B$$(i,i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))"
[PROOF STATE]
proof (prove)
using this:
hermitian A

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) = cmod (\<Sum>i = 0..<n. B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))
[PROOF STEP]
using assms unitary_diag_trace_mult_sum
[PROOF STATE]
proof (prove)
using this:
hermitian A
A \<in> carrier_mat n n
C \<in> carrier_mat n n
0 < n
Complex_Matrix.positive A
unitary_diag A B U
?i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?i))) \<le> M
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?C \<in> carrier_mat ?n ?n; hermitian ?A; unitary_diag ?A ?B ?U; 0 < ?n\<rbrakk> \<Longrightarrow> Complex_Matrix.trace (?C * ?A) = (\<Sum>i = 0..<?n. ?B $$ (i, i) * Complex_Matrix.trace (?C * rank_1_proj (Matrix.col ?U i)))

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) = cmod (\<Sum>i = 0..<n. B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (Complex_Matrix.trace (C * A)) = cmod (\<Sum>i = 0..<n. B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (Complex_Matrix.trace (C * A)) = cmod (\<Sum>i = 0..<n. B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "... \<le> (\<Sum> i = 0 ..< n.
    cmod (B$$(i,i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (\<Sum>i = 0..<n. B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))) \<le> (\<Sum>i = 0..<n. cmod (B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))
[PROOF STEP]
by (simp add: sum_norm_le)
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>i = 0..<n. B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))) \<le> (\<Sum>i = 0..<n. cmod (B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>i = 0..<n. B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))) \<le> (\<Sum>i = 0..<n. cmod (B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "... = (\<Sum> i = 0 ..< n.
    Re (B$$(i,i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. cmod (B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) = (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))
[PROOF STEP]
proof (rule sum.cong, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n} \<Longrightarrow> cmod (B $$ (x, x) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x))) = Re (B $$ (x, x)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x)))
[PROOF STEP]
show "\<And>x. x \<in> {0..<n} \<Longrightarrow>
         cmod (B $$ (x, x) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x))) =
          Re (B $$ (x, x)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n} \<Longrightarrow> cmod (B $$ (x, x) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x))) = Re (B $$ (x, x)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x)))
[PROOF STEP]
using cmod_mult_pos positive_unitary_diag_pos assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?b \<Longrightarrow> cmod (?b * ?z) = Re ?b * cmod ?z
\<lbrakk>?A \<in> carrier_mat ?n ?n; Complex_Matrix.positive ?A; unitary_diag ?A ?B ?U; ?j < ?n\<rbrakk> \<Longrightarrow> 0 \<le> ?B $$ (?j, ?j)
A \<in> carrier_mat n n
C \<in> carrier_mat n n
0 < n
Complex_Matrix.positive A
unitary_diag A B U
?i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?i))) \<le> M

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n} \<Longrightarrow> cmod (B $$ (x, x) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x))) = Re (B $$ (x, x)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U x)))
[PROOF STEP]
by (metis atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
?x \<in> {0..<n} \<Longrightarrow> cmod (B $$ (?x, ?x) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?x))) = Re (B $$ (?x, ?x)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?x)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. cmod (B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) = (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. cmod (B $$ (i, i) * Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) = (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i))))

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "... \<le> (\<Sum> i = 0 ..< n. Re (B$$(i,i)) * M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)
[PROOF STEP]
have "\<And>i. i < n \<Longrightarrow> 0 \<le> Re (B$$(i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> 0 \<le> Re (B $$ (i, i))
[PROOF STEP]
using assms positive_unitary_diag_pos
      less_eq_complex_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
C \<in> carrier_mat n n
0 < n
Complex_Matrix.positive A
unitary_diag A B U
?i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?i))) \<le> M
\<lbrakk>?A \<in> carrier_mat ?n ?n; Complex_Matrix.positive ?A; unitary_diag ?A ?B ?U; ?j < ?n\<rbrakk> \<Longrightarrow> 0 \<le> ?B $$ (?j, ?j)
(?x \<le> ?y) = (Re ?x \<le> Re ?y \<and> Im ?x = Im ?y)

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> 0 \<le> Re (B $$ (i, i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i < n \<Longrightarrow> 0 \<le> Re (B $$ (?i, ?i))

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?i < n \<Longrightarrow> 0 \<le> Re (B $$ (?i, ?i))

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i < n \<Longrightarrow> 0 \<le> Re (B $$ (?i, ?i))
A \<in> carrier_mat n n
C \<in> carrier_mat n n
0 < n
Complex_Matrix.positive A
unitary_diag A B U
?i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?i))) \<le> M

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)
[PROOF STEP]
by (meson atLeastLessThan_iff mult_left_mono sum_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. Re (B $$ (i, i)) * cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U i)))) \<le> (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M)

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "... = (\<Sum> i = 0 ..< n. Re (B$$(i,i))) * M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Re (B $$ (i, i)) * M) = (\<Sum>i = 0..<n. Re (B $$ (i, i))) * M
[PROOF STEP]
by (simp add: sum_distrib_right)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. Re (B $$ (i, i)) * M) = (\<Sum>i = 0..<n. Re (B $$ (i, i))) * M

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. Re (B $$ (i, i)) * M) = (\<Sum>i = 0..<n. Re (B $$ (i, i))) * M

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "... = Re (\<Sum> i = 0 ..< n. B$$(i,i)) * M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Re (B $$ (i, i))) * M = Re (\<Sum>i = 0..<n. B $$ (i, i)) * M
[PROOF STEP]
by (metis Re_sum)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. Re (B $$ (i, i))) * M = Re (\<Sum>i = 0..<n. B $$ (i, i)) * M

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. Re (B $$ (i, i))) * M = Re (\<Sum>i = 0..<n. B $$ (i, i)) * M

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
have "... = Re (Complex_Matrix.trace B) * M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (\<Sum>i = 0..<n. B $$ (i, i)) * M = Re (Complex_Matrix.trace B) * M
[PROOF STEP]
unfolding Complex_Matrix.trace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (\<Sum>i = 0..<n. B $$ (i, i)) * M = Re (\<Sum>i = 0..<dim_row B. B $$ (i, i)) * M
[PROOF STEP]
using \<open>dim_row B = n\<close>
[PROOF STATE]
proof (prove)
using this:
dim_row B = n

goal (1 subgoal):
 1. Re (\<Sum>i = 0..<n. B $$ (i, i)) * M = Re (\<Sum>i = 0..<dim_row B. B $$ (i, i)) * M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Re (\<Sum>i = 0..<n. B $$ (i, i)) * M = Re (Complex_Matrix.trace B) * M

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace B) * M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace B) * M

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
using assms unitarily_equiv_trace[of A]
[PROOF STATE]
proof (prove)
using this:
cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace B) * M
A \<in> carrier_mat n n
C \<in> carrier_mat n n
0 < n
Complex_Matrix.positive A
unitary_diag A B U
?i < n \<Longrightarrow> cmod (Complex_Matrix.trace (C * rank_1_proj (Matrix.col U ?i))) \<le> M
\<lbrakk>A \<in> carrier_mat ?n ?n; unitarily_equiv A ?B ?U\<rbrakk> \<Longrightarrow> Complex_Matrix.trace A = Complex_Matrix.trace ?B

goal (1 subgoal):
 1. cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M
[PROOF STEP]
by (metis unitary_diag_imp_unitarily_equiv)
[PROOF STATE]
proof (state)
this:
cmod (Complex_Matrix.trace (C * A)) \<le> Re (Complex_Matrix.trace A) * M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_zero_set:
  assumes "\<forall>x \<in> s. f x = 0" "finite s" "finite t"
  shows "sum f (s \<union> t) = sum f t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f (s \<union> t) = sum f t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s. f x = (0::'b)
finite s
finite t

goal (1 subgoal):
 1. sum f (s \<union> t) = sum f t
[PROOF STEP]
by (simp add: IntE sum.union_inter_neutral sup_commute)


[STATEMENT]
lemma scalar_prod_right_unit[simp]: assumes i: "i < n"
  shows "(v :: 'a :: semiring_1 vec) \<bullet> unit_vec n i = v $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<bullet> unit_vec n i = v $ i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<bullet> unit_vec n i = v $ i
[PROOF STEP]
let ?f = "\<lambda> k. v $ k * unit_vec n i $ k"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<bullet> unit_vec n i = v $ i
[PROOF STEP]
have id: "(\<Sum>k\<in>{0..<n}. ?f k) = v $ i * unit_vec n i $ i + (\<Sum>k\<in>{0..<n} - {i}. ?f k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..<n. v $ k * unit_vec n i $ k) = v $ i * unit_vec n i $ i + (\<Sum>k\<in>{0..<n} - {i}. v $ k * unit_vec n i $ k)
[PROOF STEP]
by (rule sum.remove, insert i, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..<n. v $ k * unit_vec n i $ k) = v $ i * unit_vec n i $ i + (\<Sum>k\<in>{0..<n} - {i}. v $ k * unit_vec n i $ k)

goal (1 subgoal):
 1. v \<bullet> unit_vec n i = v $ i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..<n. v $ k * unit_vec n i $ k) = v $ i * unit_vec n i $ i + (\<Sum>k\<in>{0..<n} - {i}. v $ k * unit_vec n i $ k)

goal (1 subgoal):
 1. v \<bullet> unit_vec n i = v $ i
[PROOF STEP]
have "(\<Sum>k\<in>{0..<n} - {i}. ?f k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>{0..<n} - {i}. v $ k * unit_vec n i $ k) = (0::'a)
[PROOF STEP]
by (rule sum.neutral, insert i, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{0..<n} - {i}. v $ k * unit_vec n i $ k) = (0::'a)

goal (1 subgoal):
 1. v \<bullet> unit_vec n i = v $ i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = 0..<n. v $ k * unit_vec n i $ k) = v $ i * unit_vec n i $ i + (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 0..<n. v $ k * unit_vec n i $ k) = v $ i * unit_vec n i $ i + (0::'a)

goal (1 subgoal):
 1. v \<bullet> unit_vec n i = v $ i
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 0..<n. v $ k * unit_vec n i $ k) = v $ i * unit_vec n i $ i + (0::'a)

goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_vec (unit_vec n i). v $ ia * unit_vec n i $ ia) = v $ i
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 0..<n. v $ k * unit_vec n i $ k) = v $ i * unit_vec n i $ i + (0::'a)
i < n

goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_vec (unit_vec n i). v $ ia * unit_vec n i $ ia) = v $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<bullet> unit_vec n i = v $ i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subdegree_minus_commute [simp]:
  "subdegree (f-(g::('a::group_add) fps)) = subdegree (g - f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
proof (-, cases "g-f=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g - f = 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
 2. g - f \<noteq> 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
g - f = 0

goal (2 subgoals):
 1. g - f = 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
 2. g - f \<noteq> 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
have "\<And>n. (f - g) $ n = -((g - f) $ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (f - g) $ n = - ((g - f) $ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f - g) $ ?n = - ((g - f) $ ?n)

goal (2 subgoals):
 1. g - f = 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
 2. g - f \<noteq> 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
g - f = 0
(f - g) $ ?n = - ((g - f) $ ?n)
[PROOF STEP]
have "f - g = 0"
[PROOF STATE]
proof (prove)
using this:
g - f = 0
(f - g) $ ?n = - ((g - f) $ ?n)

goal (1 subgoal):
 1. f - g = 0
[PROOF STEP]
by (intro fps_ext) simp
[PROOF STATE]
proof (state)
this:
f - g = 0

goal (2 subgoals):
 1. g - f = 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
 2. g - f \<noteq> 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
g - f = 0
f - g = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g - f = 0
f - g = 0

goal (1 subgoal):
 1. subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subdegree (f - g) = subdegree (g - f)

goal (1 subgoal):
 1. g - f \<noteq> 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g - f \<noteq> 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
g - f \<noteq> 0

goal (1 subgoal):
 1. g - f \<noteq> 0 \<Longrightarrow> subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
using nth_subdegree_nonzero[OF False]
[PROOF STATE]
proof (prove)
using this:
(g - f) $ subdegree (g - f) \<noteq> (0::'a)

goal (1 subgoal):
 1. subdegree (f - g) = subdegree (g - f)
[PROOF STEP]
by (fastforce intro: subdegreeI)
[PROOF STATE]
proof (state)
this:
subdegree (f - g) = subdegree (g - f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma keys_RBT_Impl_diag:
  "RBT_Impl.keys (RBT_Impl_diag t) = map (\<lambda>k. (k, k)) (RBT_Impl.keys t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RBT_Impl.keys (RBT_Impl_diag t) = map (\<lambda>k. (k, k)) (RBT_Impl.keys t)
[PROOF STEP]
by(simp add: RBT_Impl.keys_def entries_RBT_Impl_diag split_beta)


[STATEMENT]
theorem stutter_equiv_suffixes_right:
  assumes "\<sigma> \<approx> \<tau>"
  obtains n where "\<sigma>[m..] \<approx> \<tau>[n..]" and "\<forall>j<n. \<exists>k<m. \<sigma>[k..] \<approx> \<tau>[j..]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<lbrakk>\<sigma> [m..] \<approx> \<tau> [n..]; \<forall>j<n. \<exists>k<m. \<sigma> [k..] \<approx> \<tau> [j..]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n. \<lbrakk>\<sigma> [m..] \<approx> \<tau> [n..]; \<forall>j<n. \<exists>k<m. \<sigma> [k..] \<approx> \<tau> [j..]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<sigma> \<approx> \<tau>
[PROOF STEP]
have "\<tau> \<approx> \<sigma>"
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<approx> \<tau>

goal (1 subgoal):
 1. \<tau> \<approx> \<sigma>
[PROOF STEP]
by (rule stutter_equiv_sym)
[PROOF STATE]
proof (state)
this:
\<tau> \<approx> \<sigma>

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>\<sigma> [m..] \<approx> \<tau> [n..]; \<forall>j<n. \<exists>k<m. \<sigma> [k..] \<approx> \<tau> [j..]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<tau> \<approx> \<sigma>
[PROOF STEP]
obtain n where "\<tau>[n..] \<approx> \<sigma>[m..]" "\<forall>j<n. \<exists>k<m. \<tau>[j..] \<approx> \<sigma>[k..]"
[PROOF STATE]
proof (prove)
using this:
\<tau> \<approx> \<sigma>

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>\<tau> [n..] \<approx> \<sigma> [m..]; \<forall>j<n. \<exists>k<m. \<tau> [j..] \<approx> \<sigma> [k..]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule stutter_equiv_suffixes_left)
[PROOF STATE]
proof (state)
this:
\<tau> [n..] \<approx> \<sigma> [m..]
\<forall>j<n. \<exists>k<m. \<tau> [j..] \<approx> \<sigma> [k..]

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>\<sigma> [m..] \<approx> \<tau> [n..]; \<forall>j<n. \<exists>k<m. \<sigma> [k..] \<approx> \<tau> [j..]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<sigma> [m..] \<approx> \<tau> [?n..]; \<forall>j<?n. \<exists>k<m. \<sigma> [k..] \<approx> \<tau> [j..]\<rbrakk> \<Longrightarrow> thesis
\<tau> [n..] \<approx> \<sigma> [m..]
\<forall>j<n. \<exists>k<m. \<tau> [j..] \<approx> \<sigma> [k..]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<sigma> [m..] \<approx> \<tau> [?n..]; \<forall>j<?n. \<exists>k<m. \<sigma> [k..] \<approx> \<tau> [j..]\<rbrakk> \<Longrightarrow> thesis
\<tau> [n..] \<approx> \<sigma> [m..]
\<forall>j<n. \<exists>k<m. \<tau> [j..] \<approx> \<sigma> [k..]

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (blast dest: stutter_equiv_sym)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed