[STATEMENT]
lemma differenceset_stabilizer_eq:
  shows "differenceset (stabilizer A) (stabilizer A) = stabilizer A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. differenceset (stabilizer A) (stabilizer A) = stabilizer A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A
 2. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
show "differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
assume "x \<in> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (state)
this:
x \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
obtain a b where "a \<in> stabilizer A" and "b \<in> stabilizer A" and "x = a \<ominus> b"
[PROOF STATE]
proof (prove)
using this:
x \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> stabilizer A; b \<in> stabilizer A; x = a \<ominus> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis minusset.cases sumset.cases)
[PROOF STATE]
proof (state)
this:
a \<in> stabilizer A
b \<in> stabilizer A
x = a \<ominus> b

goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
thus "x \<in> stabilizer A"
[PROOF STATE]
proof (prove)
using this:
a \<in> stabilizer A
b \<in> stabilizer A
x = a \<ominus> b

goal (1 subgoal):
 1. x \<in> stabilizer A
[PROOF STEP]
using stabilizer_is_subgroup subgroup.axioms(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> stabilizer A
b \<in> stabilizer A
x = a \<ominus> b
subgroup (stabilizer ?S) G (\<oplus>) \<zero>
subgroup ?G ?M ?composition ?unit \<Longrightarrow> submonoid ?G ?M ?composition ?unit

goal (1 subgoal):
 1. x \<in> stabilizer A
[PROOF STEP]
by (smt (verit, ccfv_threshold) in_mono invertible stabilizer_subset_group
        subgroup_inverse_iff sub_composition_closed)
[PROOF STATE]
proof (state)
this:
x \<in> stabilizer A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A

goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
show "stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
assume hx: "x \<in> stabilizer A"
[PROOF STATE]
proof (state)
this:
x \<in> stabilizer A

goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> stabilizer A
[PROOF STEP]
have "x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (prove)
using this:
x \<in> stabilizer A

goal (1 subgoal):
 1. x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
show "x \<in> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (prove)
using this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
using hx
[PROOF STATE]
proof (prove)
using this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)
x \<in> stabilizer A

goal (1 subgoal):
 1. x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> differenceset (stabilizer A) (stabilizer A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_less_set_unique:
  assumes "sorted xs"
      and "sorted ys"
      and "set xs = set ys"
    shows "xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted xs
Sorted_Less.sorted ys
set xs = set ys

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
Sorted_Less.sorted xs
[PROOF STEP]
have "distinct xs" and "List.sorted xs"
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted xs

goal (1 subgoal):
 1. distinct xs &&& linorder_class.sorted xs
[PROOF STEP]
by (induct xs) auto
[PROOF STATE]
proof (state)
this:
distinct xs
linorder_class.sorted xs

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
distinct xs
linorder_class.sorted xs

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
Sorted_Less.sorted ys
[PROOF STEP]
have "distinct ys" and "List.sorted ys"
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted ys

goal (1 subgoal):
 1. distinct ys &&& linorder_class.sorted ys
[PROOF STEP]
by (induct ys) auto
[PROOF STATE]
proof (state)
this:
distinct ys
linorder_class.sorted ys

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
distinct xs
linorder_class.sorted xs
distinct ys
linorder_class.sorted ys
[PROOF STEP]
show "xs = ys"
[PROOF STATE]
proof (prove)
using this:
distinct xs
linorder_class.sorted xs
distinct ys
linorder_class.sorted ys

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
distinct xs
linorder_class.sorted xs
distinct ys
linorder_class.sorted ys
set xs = set ys

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
by (auto intro: sorted_distinct_set_unique)
[PROOF STATE]
proof (state)
this:
xs = ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plus_absorb1:
  assumes "f \<in> o[F](g)"
  shows   "L F (\<lambda>x. f x + g x) = L F (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) = L F g
[PROOF STEP]
proof (intro equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
 2. L F g \<subseteq> L F (\<lambda>x. f x + g x)
[PROOF STEP]
from plus_subset1 and assms
[PROOF STATE]
proof (chain)
picking this:
?f \<in> o[?F](?g) \<Longrightarrow> L ?F ?g \<subseteq> L ?F (\<lambda>x. ?f x + ?g x)
f \<in> o[F](g)
[PROOF STEP]
show "L F g \<subseteq> L F (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
using this:
?f \<in> o[?F](?g) \<Longrightarrow> L ?F ?g \<subseteq> L ?F (\<lambda>x. ?f x + ?g x)
f \<in> o[F](g)

goal (1 subgoal):
 1. L F g \<subseteq> L F (\<lambda>x. f x + g x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
L F g \<subseteq> L F (\<lambda>x. f x + g x)

goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
[PROOF STEP]
from landau_o.small.plus_subset1[OF assms] and assms
[PROOF STATE]
proof (chain)
picking this:
o[F](g) \<subseteq> o[F](\<lambda>x. f x + g x)
f \<in> o[F](g)
[PROOF STEP]
have "(\<lambda>x. -f x) \<in> o[F](\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
using this:
o[F](g) \<subseteq> o[F](\<lambda>x. f x + g x)
f \<in> o[F](g)

goal (1 subgoal):
 1. (\<lambda>x. - f x) \<in> o[F](\<lambda>x. f x + g x)
[PROOF STEP]
by (auto simp: landau_o.small.uminus_in_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. - f x) \<in> o[F](\<lambda>x. f x + g x)

goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
[PROOF STEP]
from plus_subset1[OF this]
[PROOF STATE]
proof (chain)
picking this:
L F (\<lambda>x. f x + g x) \<subseteq> L F (\<lambda>x. - f x + (f x + g x))
[PROOF STEP]
show "L F (\<lambda>x. f x + g x) \<subseteq> L F (g)"
[PROOF STATE]
proof (prove)
using this:
L F (\<lambda>x. f x + g x) \<subseteq> L F (\<lambda>x. - f x + (f x + g x))

goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
L F (\<lambda>x. f x + g x) \<subseteq> L F g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_deg_uminus [simp]: "poly_deg (-p) = poly_deg p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (- p) = poly_deg p
[PROOF STEP]
by (simp add: poly_deg_def keys_uminus)


[STATEMENT]
lemma filterlim_at_top_div_const_nat:
  assumes "c > 0"
  shows   "filterlim (\<lambda>x::nat. x div c) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x sequentially. x div c :> sequentially
[PROOF STEP]
unfolding filterlim_at_top
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
fix C :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
have *: "n div c \<ge> C" if "n \<ge> C * c" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<le> n div c
[PROOF STEP]
using assms that
[PROOF STATE]
proof (prove)
using this:
0 < c
C * c \<le> n

goal (1 subgoal):
 1. C \<le> n div c
[PROOF STEP]
by (metis div_le_mono div_mult_self_is_m)
[PROOF STATE]
proof (state)
this:
C * c \<le> ?n \<Longrightarrow> C \<le> ?n div c

goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
have "eventually (\<lambda>n. n \<ge> C * c) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((\<le>) (C * c)) sequentially
[PROOF STEP]
by (rule eventually_ge_at_top)
[PROOF STATE]
proof (state)
this:
eventually ((\<le>) (C * c)) sequentially

goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
thus "eventually (\<lambda>n. n div c \<ge> C) at_top"
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) (C * c)) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. C \<le> n div c
[PROOF STEP]
by eventually_elim (use * in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. C \<le> n div c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wqo_on_lists:
  assumes "wqo_on P A" shows "wqo_on (list_emb P) (lists A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (list_emb P) (lists A)
[PROOF STEP]
using assms and almost_full_on_lists
    and transp_on_list_emb
[PROOF STATE]
proof (prove)
using this:
wqo_on P A
almost_full_on ?P ?A \<Longrightarrow> almost_full_on (list_emb ?P) (lists ?A)
transp_on ?P ?A \<Longrightarrow> transp_on (list_emb ?P) (lists ?A)

goal (1 subgoal):
 1. wqo_on (list_emb P) (lists A)
[PROOF STEP]
by (auto simp: wqo_on_def)


[STATEMENT]
lemma one_le_exp_iff [simp]: "1 \<le> exp x \<longleftrightarrow> 0 \<le> x"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> exp x) = (0 \<le> x)
[PROOF STEP]
using exp_le_cancel_iff [where x = 0 and y = x]
[PROOF STATE]
proof (prove)
using this:
(exp 0 \<le> exp x) = (0 \<le> x)

goal (1 subgoal):
 1. (1 \<le> exp x) = (0 \<le> x)
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_unit_factor_mult_unit_factor:
  fixes f g :: "'a::{comm_monoid_add,mult_zero} fps"
  shows "unit_factor (f * unit_factor g) = unit_factor (f * g)"
  and   "unit_factor (unit_factor f * g) = unit_factor (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g) &&& unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
 2. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
show "unit_factor (f * unit_factor g) = unit_factor (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
proof (cases "f*g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
 2. f * g \<noteq> 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f * g \<noteq> 0

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

goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
using fps_mult_subdegree_ge[of f g] fps_unit_factor_shift[of "subdegree g" "f*g"]
[PROOF STATE]
proof (prove)
using this:
f * g \<noteq> 0
f * g \<noteq> 0 \<Longrightarrow> subdegree f + subdegree g \<le> subdegree (f * g)
subdegree g \<le> subdegree (f * g) \<Longrightarrow> unit_factor (fps_shift (subdegree g) (f * g)) = unit_factor (f * g)

goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
by    (simp add: fps_shift_mult)
[PROOF STATE]
proof (state)
this:
unit_factor (f * unit_factor g) = unit_factor (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
have "f * unit_factor g = fps_shift (subdegree g) (f*g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * unit_factor g = fps_shift (subdegree g) (f * g)
[PROOF STEP]
by (simp add: fps_shift_mult)
[PROOF STATE]
proof (state)
this:
f * unit_factor g = fps_shift (subdegree g) (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f * g = 0
f * unit_factor g = fps_shift (subdegree g) (f * g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f * g = 0
f * unit_factor g = fps_shift (subdegree g) (f * g)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unit_factor (f * unit_factor g) = unit_factor (f * g)

goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
show "unit_factor (unit_factor f * g) = unit_factor (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
proof (cases "f*g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
 2. f * g \<noteq> 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f * g \<noteq> 0

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

goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
using fps_mult_subdegree_ge[of f g] fps_unit_factor_shift[of "subdegree f" "f*g"]
[PROOF STATE]
proof (prove)
using this:
f * g \<noteq> 0
f * g \<noteq> 0 \<Longrightarrow> subdegree f + subdegree g \<le> subdegree (f * g)
subdegree f \<le> subdegree (f * g) \<Longrightarrow> unit_factor (fps_shift (subdegree f) (f * g)) = unit_factor (f * g)

goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
by    (simp add: fps_shift_mult_right_noncomm)
[PROOF STATE]
proof (state)
this:
unit_factor (unit_factor f * g) = unit_factor (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
have "unit_factor f * g = fps_shift (subdegree f) (f*g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor f * g = fps_shift (subdegree f) (f * g)
[PROOF STEP]
by (simp add: fps_shift_mult_right_noncomm)
[PROOF STATE]
proof (state)
this:
unit_factor f * g = fps_shift (subdegree f) (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f * g = 0
unit_factor f * g = fps_shift (subdegree f) (f * g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f * g = 0
unit_factor f * g = fps_shift (subdegree f) (f * g)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unit_factor (unit_factor f * g) = unit_factor (f * g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma div_Ints_mod_0: assumes "rat_of_int a / rat_of_int b \<in> \<int>" "b \<noteq> 0"
  shows "a mod b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
define c where "c = int_of_rat (rat_of_int a / rat_of_int b)"
[PROOF STATE]
proof (state)
this:
c = int_of_rat (rat_of_int a / rat_of_int b)

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
have "rat_of_int a / rat_of_int b = rat_of_int c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int a / rat_of_int b = rat_of_int c
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int a / rat_of_int b = rat_of_int (int_of_rat (rat_of_int a / rat_of_int b))
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
rat_of_int a / rat_of_int b \<in> \<int>

goal (1 subgoal):
 1. rat_of_int a / rat_of_int b = rat_of_int (int_of_rat (rat_of_int a / rat_of_int b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rat_of_int a / rat_of_int b = rat_of_int c

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
hence "rat_of_int a = rat_of_int b * rat_of_int c"
[PROOF STATE]
proof (prove)
using this:
rat_of_int a / rat_of_int b = rat_of_int c

goal (1 subgoal):
 1. rat_of_int a = rat_of_int b * rat_of_int c
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
rat_of_int a / rat_of_int b = rat_of_int c
b \<noteq> 0

goal (1 subgoal):
 1. rat_of_int a = rat_of_int b * rat_of_int c
[PROOF STEP]
by (metis divide_cancel_right nonzero_mult_div_cancel_left of_int_eq_0_iff)
[PROOF STATE]
proof (state)
this:
rat_of_int a = rat_of_int b * rat_of_int c

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
hence a: "a = b * c"
[PROOF STATE]
proof (prove)
using this:
rat_of_int a = rat_of_int b * rat_of_int c

goal (1 subgoal):
 1. a = b * c
[PROOF STEP]
by (simp add: of_int_hom.injectivity)
[PROOF STATE]
proof (state)
this:
a = b * c

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
show "a mod b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
unfolding a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * c mod b = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a mod b = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma C_continuum_ge: "C_continuum \<ge> \<aleph>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega>1 \<le> C_continuum
[PROOF STEP]
by (metis C_continuum_def Ord_\<omega>1 Ord_cardinal Ord_linear2 countable_iff_vcard_less1
            uncountable_Real_set)


[STATEMENT]
lemma bin_rest_numeral_simps [simp]:
  "(\<lambda>k::int. k div 2) 0 = 0"
  "(\<lambda>k::int. k div 2) 1 = 0"
  "(\<lambda>k::int. k div 2) (- 1) = - 1"
  "(\<lambda>k::int. k div 2) Numeral1 = 0"
  "(\<lambda>k::int. k div 2) (numeral (Num.Bit0 w)) = numeral w"
  "(\<lambda>k::int. k div 2) (numeral (Num.Bit1 w)) = numeral w"
  "(\<lambda>k::int. k div 2) (- numeral (Num.Bit0 w)) = - numeral w"
  "(\<lambda>k::int. k div 2) (- numeral (Num.Bit1 w)) = - numeral (w + Num.One)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0 div 2 = 0 &&& 1 div 2 = 0) &&& - 1 div 2 = - 1 &&& Numeral1 div 2 = 0) &&& (numeral (num.Bit0 w) div 2 = numeral w &&& numeral (num.Bit1 w) div 2 = numeral w) &&& - numeral (num.Bit0 w) div 2 = - numeral w &&& - numeral (num.Bit1 w) div 2 = - numeral (w + num.One)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma residue_bernoulli:
  assumes "n \<noteq> 0"
  shows   "residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (2 * pi * real_of_int n * \<i>) =
             1 / (2 * pi * real_of_int n * \<i>) ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
have "residue (\<lambda>z. (1 / z ^ m) / (exp z - 1)) (2 * pi * real_of_int n * \<i>) =
          1 / (2 * pi * real_of_int n * \<i>) ^ m / 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1
[PROOF STEP]
using exp_integer_2pi[of "real_of_int n"] and assms
[PROOF STATE]
proof (prove)
using this:
real_of_int n \<in> \<int> \<Longrightarrow> exp (complex_of_real (2 * real_of_int n * pi) * \<i>) = 1
n \<noteq> 0

goal (1 subgoal):
 1. residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1
[PROOF STEP]
by (rule_tac residue_simple_pole_deriv[where s="-{0}"])
       (auto intro!: holomorphic_intros derivative_eq_intros connected_open_delete_finite
             simp add: mult_ac connected_punctured_universe)
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1

goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1

goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decseq_powrat_inverse_of_nat_ge_one:
      "a \<ge> 1 \<Longrightarrow> decseq (\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat (Suc n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> a \<Longrightarrow> decseq (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc n)))
[PROOF STEP]
unfolding decseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> a \<Longrightarrow> \<forall>m n. m \<le> n \<longrightarrow> a pow\<^sub>\<rat> inverse (rat_of_nat (Suc n)) \<le> a pow\<^sub>\<rat> inverse (rat_of_nat (Suc m))
[PROOF STEP]
by (auto intro: powrat_le_mono)


[STATEMENT]
lemma scount_eq:
  "scount P \<omega> = (if alw (ev P) \<omega> then \<infinity> else enat (card {i. P (sdrop i \<omega>)}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scount P \<omega> = (if alw (ev P) \<omega> then \<infinity> else enat (card {i. P (sdrop i \<omega>)}))
[PROOF STEP]
by (auto simp: scount_infinite_iff scount_eq_card not_alw_iff not_ev_iff)


[STATEMENT]
lemma converse_ordermap_mono_iff:
  assumes "wf r" "total_on A r" "x \<in> A" "y \<in> A" "small A"
  shows "ordermap A r y \<in> elts (ordermap A r x) \<longleftrightarrow> (y, x) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ordermap A r y \<in> elts (ordermap A r x)) = ((y, x) \<in> r)
[PROOF STEP]
by (metis assms converse_ordermap_mono ordermap_mono)


[STATEMENT]
lemma all3_lemma [simp]:
  "rec_eval (rec_all3 f) [x, y1, y2, y3] = (if (\<forall>z \<le> x. 0 < rec_eval f [z, y1, y2, y3]) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_all3 f) [x, y1, y2, y3] = (if \<forall>z\<le>x. 0 < rec_eval f [z, y1, y2, y3] then 1 else 0)
[PROOF STEP]
by (simp add: rec_all3_def)


[STATEMENT]
lemma subset_singleton_conv: "(A \<subseteq> {a}) = (A = {} \<or> A = {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<subseteq> {a}) = (A = {} \<or> A = {a})
[PROOF STEP]
by blast


[STATEMENT]
lemma sums_imp_has_prod_exp:
  assumes "f sums s"
  shows "raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)
[PROOF STEP]
using assms continuous_on_exp [of UNIV "\<lambda>x::'a. x"]
[PROOF STATE]
proof (prove)
using this:
f sums s
continuous_on UNIV (\<lambda>x. x) \<Longrightarrow> continuous_on UNIV exp

goal (1 subgoal):
 1. raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)
[PROOF STEP]
using continuous_on_tendsto_compose [of UNIV exp "(\<lambda>n. sum f {..n})" s]
[PROOF STATE]
proof (prove)
using this:
f sums s
continuous_on UNIV (\<lambda>x. x) \<Longrightarrow> continuous_on UNIV exp
\<lbrakk>continuous_on UNIV exp; ((\<lambda>n. sum f {..n}) \<longlongrightarrow> s) ?F; s \<in> UNIV; \<forall>\<^sub>F x in ?F. sum f {..x} \<in> UNIV\<rbrakk> \<Longrightarrow> ((\<lambda>x. exp (sum f {..x})) \<longlongrightarrow> exp s) ?F

goal (1 subgoal):
 1. raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)
[PROOF STEP]
by (simp add: prod_defs sums_def_le exp_sum)


[STATEMENT]
lemma measure_pmf_single: "measure (measure_pmf M) {x} = pmf M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob M {x} = pmf M x
[PROOF STEP]
using emeasure_pmf_single[of M x]
[PROOF STATE]
proof (prove)
using this:
emeasure (measure_pmf M) {x} = ennreal (pmf M x)

goal (1 subgoal):
 1. measure_pmf.prob M {x} = pmf M x
[PROOF STEP]
by(simp add: measure_pmf.emeasure_eq_measure pmf_nonneg measure_nonneg)


[STATEMENT]
lemma markedElementIsMarkedTrue:
  shows "(m \<in> set (markedElements M)) = ((m, True) \<in> set M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<in> set (markedElements M)) = ((m, True) \<in> set M)
[PROOF STEP]
by (induct M) (auto split: if_split_asm)


[STATEMENT]
lemma prob_T:
  assumes P: "Measurable.pred S P"
  shows "\<P>(\<omega> in T s. P \<omega>) = (\<integral>t. \<P>(\<omega> in T t. P (t ## \<omega>)) \<partial>K s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T.prob s {\<omega> \<in> space (T s). P \<omega>} = measure_pmf.expectation (K s) (\<lambda>t. T.prob t {\<omega> \<in> space (T t). P (t ## \<omega>)})
[PROOF STEP]
using emeasure_Collect_T[OF P, of s]
[PROOF STATE]
proof (prove)
using this:
emeasure (T s) {x \<in> space (T s). P x} = \<integral>\<^sup>+ t. emeasure (T t) {x \<in> space (T t). P (t ## x)} \<partial>measure_pmf (K s)

goal (1 subgoal):
 1. T.prob s {\<omega> \<in> space (T s). P \<omega>} = measure_pmf.expectation (K s) (\<lambda>t. T.prob t {\<omega> \<in> space (T t). P (t ## \<omega>)})
[PROOF STEP]
unfolding T.emeasure_eq_measure
[PROOF STATE]
proof (prove)
using this:
ennreal (T.prob s {x \<in> space (T s). P x}) = \<integral>\<^sup>+ t. ennreal (T.prob t {x \<in> space (T t). P (t ## x)}) \<partial>measure_pmf (K s)

goal (1 subgoal):
 1. T.prob s {\<omega> \<in> space (T s). P \<omega>} = measure_pmf.expectation (K s) (\<lambda>t. T.prob t {\<omega> \<in> space (T t). P (t ## \<omega>)})
[PROOF STEP]
by (subst (asm) nn_integral_eq_integral)
     (auto intro!: measure_pmf.integrable_const_bound[where B=1])


[STATEMENT]
lemma measurable_If_restrict_space_iff:
  "{x\<in>space M. P x} \<in> sets M \<Longrightarrow>
    (\<lambda>x. if P x then f x else g x) \<in> measurable M N \<longleftrightarrow>
    (f \<in> measurable (restrict_space M {x. P x}) N \<and> g \<in> measurable (restrict_space M {x. \<not> P x}) N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> sets M \<Longrightarrow> ((\<lambda>x. if P x then f x else g x) \<in> M \<rightarrow>\<^sub>M N) = (f \<in> restrict_space M {x. P x} \<rightarrow>\<^sub>M N \<and> g \<in> restrict_space M {x. \<not> P x} \<rightarrow>\<^sub>M N)
[PROOF STEP]
by (subst measurable_piecewise_restrict_iff[where C="{{x. P x}, {x. \<not> P x}}"])
     (auto simp: Int_def sets.sets_Collect_neg space_restrict_space conj_commute[of _ "x \<in> space M" for x]
           cong: measurable_cong')


[STATEMENT]
lemma (in sigma_finite_measure) density_unique_iff:
  assumes f: "f \<in> borel_measurable M" and f': "f' \<in> borel_measurable M"
  shows "density M f = density M f' \<longleftrightarrow> (AE x in M. f x = f' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (density M f = density M f') = (AE x in M. f x = f' x)
[PROOF STEP]
using density_unique[OF assms] density_cong[OF f f']
[PROOF STATE]
proof (prove)
using this:
density M f = density M f' \<Longrightarrow> AE x in M. f x = f' x
AE x in M. f x = f' x \<Longrightarrow> density M f = density M f'

goal (1 subgoal):
 1. (density M f = density M f') = (AE x in M. f x = f' x)
[PROOF STEP]
by auto


[STATEMENT]
lemma path_connected_complement_absolute_retract:
  fixes S :: "'a::euclidean_space set"
  assumes "compact S" "AR S" "2 \<le> DIM('a)"
    shows "path_connected(- S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (- S)
[PROOF STEP]
using connected_complement_absolute_retract [OF assms]
[PROOF STATE]
proof (prove)
using this:
connected (- S)

goal (1 subgoal):
 1. path_connected (- S)
[PROOF STEP]
using \<open>compact S\<close> compact_eq_bounded_closed connected_open_path_connected
[PROOF STATE]
proof (prove)
using this:
connected (- S)
compact S
compact ?S = (bounded ?S \<and> closed ?S)
\<lbrakk>open ?S; connected ?S\<rbrakk> \<Longrightarrow> path_connected ?S

goal (1 subgoal):
 1. path_connected (- S)
[PROOF STEP]
by blast


[STATEMENT]
lemma diag_def_poly_closed:
  assumes "i < n"
  shows "diag_def_poly n i \<in> carrier (coord_ring R (n + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_def_poly n i \<in> carrier (R [\<X>\<^bsub>n + n\<^esub>])
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. diag_def_poly n i \<in> carrier (R [\<X>\<^bsub>n + n\<^esub>])
[PROOF STEP]
unfolding diag_def_poly_def  coord_ring_def
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. pvar R i \<ominus>\<^bsub>Pring R {..<n + n}\<^esub> pvar R (i + n) \<in> carrier (Pring R {..<n + n})
[PROOF STEP]
by (metis (no_types, lifting) MP.minus_closed add.assoc add_leD1 coord_ring_def less_add_eq_less local.pvar_closed nat_less_le not_add_less1)


[STATEMENT]
lemma unat_2tp_if:
  "unat (2 ^ n :: ('a :: len) word) = (if n < LENGTH ('a) then 2 ^ n else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (2 ^ n) = (if n < LENGTH('a) then 2 ^ n else 0)
[PROOF STEP]
by (split if_split, simp_all add: power_overflow)


[STATEMENT]
lemma not_is_TNil_conv: "\<not> is_TNil xs \<longleftrightarrow> (\<exists>x xs'. xs = TCons x xs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> is_TNil xs) = (\<exists>x xs'. xs = TCons x xs')
[PROOF STEP]
by(cases xs) simp_all


[STATEMENT]
theorem hta_mem_correct: "hta_mem t H \<longleftrightarrow> t\<in>ta_lang (hta_\<alpha> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hta_mem t H = (t \<in> ta_lang (hta_\<alpha> H))
[PROOF STEP]
using hashedTa.hta_mem'_correct[OF hta_ensure_idx_f_correct, simplified]
[PROOF STATE]
proof (prove)
using this:
hta_mem' ?t (hta_ensure_idx_f H) = (?t \<in> ta_lang (hta_\<alpha> H))

goal (1 subgoal):
 1. hta_mem t H = (t \<in> ta_lang (hta_\<alpha> H))
[PROOF STEP]
apply (unfold hta_mem_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. hta_mem' t (hta_ensure_idx_f H) = (t \<in> ta_lang (hta_\<alpha> H))) \<Longrightarrow> hta_mem' t (hta_ensure_idx_f H) = (t \<in> ta_lang (hta_\<alpha> H))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma compact_imp_fip:
  assumes "compact S"
    and "\<And>T. T \<in> F \<Longrightarrow> closed T"
    and "\<And>F'. finite F' \<Longrightarrow> F' \<subseteq> F \<Longrightarrow> S \<inter> (\<Inter>F') \<noteq> {}"
  shows "S \<inter> (\<Inter>F) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> \<Inter> F \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compact S
?T \<in> F \<Longrightarrow> closed ?T
\<lbrakk>finite ?F'; ?F' \<subseteq> F\<rbrakk> \<Longrightarrow> S \<inter> \<Inter> ?F' \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> F \<noteq> {}
[PROOF STEP]
unfolding compact_fip
[PROOF STATE]
proof (prove)
using this:
\<forall>A. Ball A closed \<longrightarrow> (\<forall>B\<subseteq>A. finite B \<longrightarrow> S \<inter> \<Inter> B \<noteq> {}) \<longrightarrow> S \<inter> \<Inter> A \<noteq> {}
?T \<in> F \<Longrightarrow> closed ?T
\<lbrakk>finite ?F'; ?F' \<subseteq> F\<rbrakk> \<Longrightarrow> S \<inter> \<Inter> ?F' \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> F \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
theorem row_col_match:
 fixes A1 A2 B1 B2 i j
 assumes wf1:"mat (row_length A1) (length A1) A1"
    and wf2:"mat (row_length A2) (length A2) A2"
    and wf3:"mat (row_length B1) (length B1) B1"
    and wf4:"mat (row_length B2) (length B2) B2"
    and matchAA:"length A1 = row_length A2"
    and matchBB:"length B1 = row_length B2"
    and non_Nil:"(A1 \<noteq> [])\<and>(A2 \<noteq> [])\<and>(B1 \<noteq> [])\<and>(B2 \<noteq> [])"
    and i:"i<(row_length A1)*(row_length B1)" and j:"j< (length A2)*(length B2)"
 shows "length (row A1 (i div (row_length B1)))
                 = length (col A2  (j div (length B2)))"
 and "length (row B1 (i mod (row_length B1)))
                 = length (col B2 (j mod (length B2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2)) &&& length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "i div (row_length B1) < row_length  A1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i div row_length B1 < row_length A1
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < row_length A1 * row_length B1

goal (1 subgoal):
 1. i div row_length B1 < row_length A1
[PROOF STEP]
by (metis div_left_ineq)
[PROOF STATE]
proof (state)
this:
i div row_length B1 < row_length A1

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i div row_length B1 < row_length A1
[PROOF STEP]
have 1:"length (row A1 (i div (row_length B1))) = length A1"
[PROOF STATE]
proof (prove)
using this:
i div row_length B1 < row_length A1

goal (1 subgoal):
 1. length (row A1 (i div row_length B1)) = length A1
[PROOF STEP]
unfolding row_def
[PROOF STATE]
proof (prove)
using this:
i div row_length B1 < row_length A1

goal (1 subgoal):
 1. length (map (\<lambda>w. w ! (i div row_length B1)) A1) = length A1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row A1 (i div row_length B1)) = length A1

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "j div (length B2)< length A2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j div length B2 < length A2
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j < length A2 * length B2

goal (1 subgoal):
 1. j div length B2 < length A2
[PROOF STEP]
by (metis div_left_ineq)
[PROOF STATE]
proof (state)
this:
j div length B2 < length A2

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j div length B2 < length A2
[PROOF STEP]
have 2:"length (col A2  (j div (length B2))) = row_length A2"
[PROOF STATE]
proof (prove)
using this:
j div length B2 < length A2

goal (1 subgoal):
 1. length (col A2 (j div length B2)) = row_length A2
[PROOF STEP]
using row_length_constant wf2
[PROOF STATE]
proof (prove)
using this:
j div length B2 < length A2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length A2) (length A2) A2

goal (1 subgoal):
 1. length (col A2 (j div length B2)) = row_length A2
[PROOF STEP]
unfolding col_def
[PROOF STATE]
proof (prove)
using this:
j div length B2 < length A2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length A2) (length A2) A2

goal (1 subgoal):
 1. length (A2 ! (j div length B2)) = row_length A2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (col A2 (j div length B2)) = row_length A2

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
with 1 matchAA
[PROOF STATE]
proof (chain)
picking this:
length (row A1 (i div row_length B1)) = length A1
length A1 = row_length A2
length (col A2 (j div length B2)) = row_length A2
[PROOF STEP]
show "length (row A1 (i div (row_length B1)))=length (col A2  (j div (length B2)))"
[PROOF STATE]
proof (prove)
using this:
length (row A1 (i div row_length B1)) = length A1
length A1 = row_length A2
length (col A2 (j div length B2)) = row_length A2

goal (1 subgoal):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "i mod (row_length B1) < row_length B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i mod row_length B1 < row_length B1
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < row_length A1 * row_length B1

goal (1 subgoal):
 1. i mod row_length B1 < row_length B1
[PROOF STEP]
by (metis less_nat_zero_code mod_less_divisor mult_is_0 neq0_conv)
[PROOF STATE]
proof (state)
this:
i mod row_length B1 < row_length B1

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i mod row_length B1 < row_length B1
[PROOF STEP]
have 2:"length (row B1 (i mod (row_length B1))) = length B1"
[PROOF STATE]
proof (prove)
using this:
i mod row_length B1 < row_length B1

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length B1
[PROOF STEP]
unfolding row_def
[PROOF STATE]
proof (prove)
using this:
i mod row_length B1 < row_length B1

goal (1 subgoal):
 1. length (map (\<lambda>w. w ! (i mod row_length B1)) B1) = length B1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row B1 (i mod row_length B1)) = length B1

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "j mod (length B2) < length B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j mod length B2 < length B2
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j < length A2 * length B2

goal (1 subgoal):
 1. j mod length B2 < length B2
[PROOF STEP]
by (metis less_nat_zero_code mod_less_divisor mult_is_0 neq0_conv)
[PROOF STATE]
proof (state)
this:
j mod length B2 < length B2

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j mod length B2 < length B2
[PROOF STEP]
have "length (col B2 (j mod (length B2))) = row_length B2"
[PROOF STATE]
proof (prove)
using this:
j mod length B2 < length B2

goal (1 subgoal):
 1. length (col B2 (j mod length B2)) = row_length B2
[PROOF STEP]
using row_length_constant wf4
[PROOF STATE]
proof (prove)
using this:
j mod length B2 < length B2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length B2) (length B2) B2

goal (1 subgoal):
 1. length (col B2 (j mod length B2)) = row_length B2
[PROOF STEP]
unfolding col_def
[PROOF STATE]
proof (prove)
using this:
j mod length B2 < length B2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length B2) (length B2) B2

goal (1 subgoal):
 1. length (B2 ! (j mod length B2)) = row_length B2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (col B2 (j mod length B2)) = row_length B2

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
with 2 matchBB
[PROOF STATE]
proof (chain)
picking this:
length (row B1 (i mod row_length B1)) = length B1
length B1 = row_length B2
length (col B2 (j mod length B2)) = row_length B2
[PROOF STEP]
show "length (row B1 (i mod (row_length B1))) = length (col B2 (j mod (length B2)))"
[PROOF STATE]
proof (prove)
using this:
length (row B1 (i mod row_length B1)) = length B1
length B1 = row_length B2
length (col B2 (j mod length B2)) = row_length B2

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lincomb_list_smult:
  "set Vs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda> i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Vs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs
[PROOF STEP]
proof (induction Vs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
case (snoc x Vs)
[PROOF STATE]
proof (state)
this:
set Vs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs
set (Vs @ [x]) \<subseteq> carrier_vec n

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have x: "x \<in> carrier_vec n" and Vs: "set Vs \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier_vec n &&& set Vs \<subseteq> carrier_vec n
[PROOF STEP]
using snoc.prems
[PROOF STATE]
proof (prove)
using this:
set (Vs @ [x]) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. x \<in> carrier_vec n &&& set Vs \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec n
set Vs \<subseteq> carrier_vec n

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "lincomb_list (\<lambda> i. a * c i) (Vs @ [x]) =
        lincomb_list (\<lambda> i. a * c i) Vs + (a * c (length Vs)) \<cdot>\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x
[PROOF STEP]
using x Vs
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n
set Vs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "lincomb_list (\<lambda> i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs
[PROOF STEP]
by(rule snoc.IH[OF Vs])
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "(a * c (length Vs)) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
using smult_smult_assoc x
[PROOF STATE]
proof (prove)
using this:
?a \<cdot>\<^sub>v (?b \<cdot>\<^sub>v ?v) = ?a * ?b \<cdot>\<^sub>v ?v
x \<in> carrier_vec n

goal (1 subgoal):
 1. a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "a \<cdot>\<^sub>v lincomb_list c Vs + \<dots> = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
using smult_add_distrib_vec[of _ n _ a] lincomb_list_carrier[OF Vs] x
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec n; ?w \<in> carrier_vec n\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>v (?v + ?w) = a \<cdot>\<^sub>v ?v + a \<cdot>\<^sub>v ?w
lincomb_list ?c Vs \<in> carrier_vec n
x \<in> carrier_vec n

goal (1 subgoal):
 1. a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])
[PROOF STEP]
using Vs x
[PROOF STATE]
proof (prove)
using this:
set Vs \<subseteq> carrier_vec n
x \<in> carrier_vec n

goal (1 subgoal):
 1. lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])

goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])

goal (1 subgoal):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
[PROOF STEP]
qed simp


[STATEMENT]
lemma bl_shiftl: "to_bl (w << n) = drop n (to_bl w) @ replicate (min (size w) n) False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (w << n) = drop n (to_bl w) @ replicate (min (size w) n) False
[PROOF STEP]
by (simp add: shiftl_bl word_rep_drop word_size)


[STATEMENT]
lemma compact_rel_boundary:
  fixes S :: "'n::euclidean_space set"
  shows "compact S \<Longrightarrow> compact(S - rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact S \<Longrightarrow> compact (S - rel_interior S)
[PROOF STEP]
by (metis bounded_diff closed_rel_boundary closure_eq compact_closure compact_imp_closed)


[STATEMENT]
lemma SA_zero_set_is_semialgebraic:
  assumes "f \<in> carrier (SA n)"
  shows "is_semialgebraic n (SA_zero_set n f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n (SA_zero_set n f)
[PROOF STEP]
using assms semialg_level_set_is_semialg[of f n \<zero>]
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
\<lbrakk>f \<in> carrier (SA n); \<zero> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}

goal (1 subgoal):
 1. is_semialgebraic n (SA_zero_set n f)
[PROOF STEP]
unfolding SA_zero_set_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
\<lbrakk>f \<in> carrier (SA n); \<zero> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}

goal (1 subgoal):
 1. is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}
[PROOF STEP]
by blast


[STATEMENT]
lemma filter_mset_disjunction:
  assumes "\<And>x. x \<in># X \<Longrightarrow> P x \<Longrightarrow> Q x \<Longrightarrow> False"
  shows   "filter_mset (\<lambda>x. P x \<or> Q x) X = filter_mset P X + filter_mset Q X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#x \<in># X. P x \<or> Q x#} = filter_mset P X + filter_mset Q X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in># X; P ?x; Q ?x\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. {#x \<in># X. P x \<or> Q x#} = filter_mset P X + filter_mset Q X
[PROOF STEP]
by (induction X) auto


[STATEMENT]
lemma of_rat_floor [simp]:
  "\<lfloor>of_rat r\<rfloor> = \<lfloor>r\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>of_rat r\<rfloor> = \<lfloor>r\<rfloor>
[PROOF STEP]
by (cases r) (simp add: Fract_of_int_quotient of_rat_divide floor_divide_of_int_eq)


[STATEMENT]
lemma finite_set_in_idem:
  assumes "finite A"
  shows "max a (Max (Set.insert a A)) = Max (Set.insert a A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max a (Max (insert a A)) = Max (insert a A)
[PROOF STEP]
using Max_insert assms max.commute max.left_commute
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert ?x ?A) = max ?x (Max ?A)
finite A
max ?a ?b = max ?b ?a
max ?b (max ?a ?c) = max ?a (max ?b ?c)

goal (1 subgoal):
 1. max a (Max (insert a A)) = Max (insert a A)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma length_append [simp]: "length (xs @ ys) = length xs + length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs @ ys) = length xs + length ys
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma preImage_insert: "preImage f (insert a A) = pre f a Un preImage f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preImage f (insert a A) = pre f a \<union> preImage f A
[PROOF STEP]
by(auto simp add: preImage_def pre_def)


[STATEMENT]
lemma degree_poly_uminus_abs[simp]: "degree (poly_uminus_abs p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_uminus_abs p) = degree p
[PROOF STEP]
unfolding poly_uminus_abs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (abs_int_poly (poly_uminus p)) = degree p
[PROOF STEP]
by auto


[STATEMENT]
lemma wqo_on_UNIV_nat:
  "wqo_on (\<le>) (UNIV :: nat set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (\<le>) UNIV
[PROOF STEP]
unfolding wqo_on_def transp_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. \<forall>z\<in>UNIV. x \<le> y \<and> y \<le> z \<longrightarrow> x \<le> z) \<and> almost_full_on (\<le>) UNIV
[PROOF STEP]
using almost_full_on_UNIV_nat
[PROOF STATE]
proof (prove)
using this:
almost_full_on (\<le>) UNIV

goal (1 subgoal):
 1. (\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. \<forall>z\<in>UNIV. x \<le> y \<and> y \<le> z \<longrightarrow> x \<le> z) \<and> almost_full_on (\<le>) UNIV
[PROOF STEP]
by simp


[STATEMENT]
lemma butlast_rest_bin: "butlast (bin_to_bl n w) = bin_to_bl (n - 1) (w div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast (bin_to_bl n w) = bin_to_bl (n - 1) (w div 2)
[PROOF STEP]
apply (unfold bin_to_bl_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast (bin_to_bl_aux n w []) = bin_to_bl_aux (n - 1) (w div 2) []
[PROOF STEP]
apply (cases n, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> butlast (bin_to_bl_aux n w []) = bin_to_bl_aux (n - 1) (w div 2) []
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> butlast (bin_to_bl_aux nat (w div 2) [odd w]) = bin_to_bl_aux nat (w div 2) []
[PROOF STEP]
apply (auto simp add: bin_to_bl_aux_alt)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem abs_convergent_prod_conv_summable:
  fixes f :: "nat \<Rightarrow> 'a :: real_normed_div_algebra"
  shows "abs_convergent_prod f \<longleftrightarrow> summable (\<lambda>i. norm (f i - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_convergent_prod f = summable (\<lambda>i. norm (f i - (1::'a)))
[PROOF STEP]
by (blast intro: abs_convergent_prod_imp_summable summable_imp_abs_convergent_prod)


[STATEMENT]
lemma sum_flatten1:
  fixes f :: "'a \<Rightarrow> 'a \<Rightarrow> 'b::join_semilattice_zero"
  assumes "finite (A :: 'a set)"
  and "finite (B :: 'a set)"
  shows "\<Sum>{\<Sum>{f x y |y. y \<in> B} |x. x \<in> A} = \<Sum>{f x y |x y. x \<in> A \<and> y \<in> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {\<Sum> {f x y |y. y \<in> B} |x. x \<in> A} = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply (simp add: fset_to_im assms flatten1_im)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f (fst x) (snd x)) ` (A \<times> B)) = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply (subst fset_to_im[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {f (fst x) (snd x) |x. x \<in> A \<times> B} = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma expands_to_imp_eventually_lt:
  assumes "basis_wf basis" "((\<lambda>x. f x - g x) expands_to F) basis" "trimmed_neg F"
  shows   "eventually (\<lambda>x. f x < g x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x < g x
[PROOF STEP]
using expands_to_imp_eventually_neg[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. f x - g x < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x < g x
[PROOF STEP]
by simp


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


[STATEMENT]
lemma real_derivative_chain:
  fixes x :: real
  shows "f differentiable at x \<Longrightarrow> g differentiable at (f x)
    \<Longrightarrow> deriv (g o f) x = deriv g (f x) * deriv f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f differentiable at x; g differentiable at (f x)\<rbrakk> \<Longrightarrow> deriv (g \<circ> f) x = deriv g (f x) * deriv f x
[PROOF STEP]
by (metis DERIV_deriv_iff_real_differentiable DERIV_chain DERIV_imp_deriv)


[STATEMENT]
lemma compact_projset:
  shows "compact ((\<lambda>k. (k)\<^sub>F i) ` K n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact ((\<lambda>k. (k)\<^sub>F i) ` K n)
[PROOF STEP]
using continuous_proj compact
[PROOF STATE]
proof (prove)
using this:
continuous_on ?s (\<lambda>x. (x)\<^sub>F ?i)
compact (K ?n)

goal (1 subgoal):
 1. compact ((\<lambda>k. (k)\<^sub>F i) ` K n)
[PROOF STEP]
by (rule compact_continuous_image)


[STATEMENT]
lemma word_cat_inj: "(word_cat a b::'c::len word) = word_cat c d \<longleftrightarrow> a = c \<and> b = d"
  if "LENGTH('a) + LENGTH('b) \<le> LENGTH('c)"
  for a::"'a::len word" and b::"'b::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (word_cat a b = word_cat c d) = (a = c \<and> b = d)
[PROOF STEP]
using word_of_int_bin_cat_eq_iff [OF that, of b a d c]
[PROOF STATE]
proof (prove)
using this:
(word_of_int (concat_bit LENGTH('b) (uint b) (uint a)) = word_of_int (concat_bit LENGTH('b) (uint d) (uint c))) = (b = d \<and> a = c)

goal (1 subgoal):
 1. (word_cat a b = word_cat c d) = (a = c \<and> b = d)
[PROOF STEP]
by (simp add: word_cat_eq' ac_simps)


[STATEMENT]
lemma abs_summable_on_nat_iff':
  "f abs_summable_on (UNIV :: nat set) \<longleftrightarrow> summable (\<lambda>n. norm (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f abs_summable_on UNIV) = summable (\<lambda>n. norm (f n))
[PROOF STEP]
by (subst abs_summable_on_nat_iff) auto


[STATEMENT]
lemma subFNot: "!!theta. subF theta (FNot A) = FNot (subF theta A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>theta. subF theta (FNot A) = FNot (subF theta A)
[PROOF STEP]
by(induct A) auto


[STATEMENT]
lemma circ_sup_4:
  "(x \<squnion> y)\<^sup>\<circ> = (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y)\<^sup>\<circ> = (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ>
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (x \<squnion> y)\<^sup>\<circ> \<le> (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ>
 2. (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ> \<le> (x \<squnion> y)\<^sup>\<circ>
[PROOF STEP]
apply (metis circ_sup circ_sub_decompose circ_transitive_equal mult_assoc mult_left_isotone)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ> \<le> (x \<squnion> y)\<^sup>\<circ>
[PROOF STEP]
by (metis circ_sup circ_isotone mult_left_isotone star_below_circ)


[STATEMENT]
lemma bifunctor_flip_ArrMap_app:
  assumes "category \<alpha> \<AA>"
    and "category \<alpha> \<BB>"
    and "\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
    and "f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>"
  shows "bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ArrMap\<rparr>\<lparr>f, g\<rparr>\<^sub>\<bullet> = \<FF>\<lparr>ArrMap\<rparr>\<lparr>g, f\<rparr>\<^sub>\<bullet>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>bifunctor_flip \<AA> \<BB> \<FF>\<^esub> g = g \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<FF>\<^esub> f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>bifunctor_flip \<AA> \<BB> \<FF>\<^esub> g = g \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<FF>\<^esub> f
[PROOF STEP]
unfolding bifunctor_flip_components
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. fflip (\<FF>\<lparr>ArrMap\<rparr>) \<lparr>f, g\<rparr>\<^sub>\<bullet> = g \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<FF>\<^esub> f
[PROOF STEP]
by
    (
      cs_concl cs_shallow
        cs_simp: V_cs_simps cat_cs_simps cs_intro: cat_prod_cs_intros
    )


[STATEMENT]
lemma distinct_roots_of_complex_poly: "distinct (roots_of_complex_poly p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (roots_of_complex_poly p)
[PROOF STEP]
unfolding roots_of_complex_poly_def roots_of_complex_rf_polys_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (if p = 0 then [] else concat (map roots_of_complex_rf_poly (polys_rf (yun_polys p))))
[PROOF STEP]
using roots_of_rf_yun_polys_distinct[of roots_of_complex_rf_poly p, OF roots_of_complex_rf_poly]
[PROOF STATE]
proof (prove)
using this:
distinct (concat (map roots_of_complex_rf_poly (polys_rf (yun_polys p))))

goal (1 subgoal):
 1. distinct (if p = 0 then [] else concat (map roots_of_complex_rf_poly (polys_rf (yun_polys p))))
[PROOF STEP]
by auto


[STATEMENT]
lemma integrable_uniform_count_measure_finite:
  fixes g :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  shows "finite A \<Longrightarrow> integrable (uniform_count_measure A) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> integrable (uniform_count_measure A) g
[PROOF STEP]
unfolding uniform_count_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> integrable (point_measure A (\<lambda>x. ennreal (1 / real (card A)))) g
[PROOF STEP]
by (simp add: integrable_point_measure_finite)


[STATEMENT]
lemma residue_simple':
  assumes "open s" "0 \<in> s" "f holomorphic_on s"
  shows   "residue (\<lambda>w. f w / w) 0 = f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>w. f w / w) 0 = f 0
[PROOF STEP]
using residue_simple[of s 0 f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open s; 0 \<in> s; f holomorphic_on s\<rbrakk> \<Longrightarrow> residue (\<lambda>w. f w / (w - 0)) 0 = f 0
open s
0 \<in> s
f holomorphic_on s

goal (1 subgoal):
 1. residue (\<lambda>w. f w / w) 0 = f 0
[PROOF STEP]
by simp


[STATEMENT]
lemma bl2nat_simps[simp]: "bl2nat (Oc # Oc\<up>x) 0 = (2 * 2 ^ x - Suc 0)"
  "bl2nat (Bk\<up>x) n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl2nat (Oc # Oc \<up> x) 0 = 2 * 2 ^ x - Suc 0 &&& bl2nat (Bk \<up> x) n = 0
[PROOF STEP]
by(induct x;force simp: bl2nat.simps bl2nat_double exp_ind)+


[STATEMENT]
lemma i0_ne_infinity [simp]: "0 \<noteq> (\<infinity>::enat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<noteq> \<infinity>
[PROOF STEP]
by (simp add: zero_enat_def)


[STATEMENT]
lemma sset_cycle[simp]:
  assumes "xs \<noteq> []"
  shows "sset (cycle xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sset (cycle xs) = set xs
[PROOF STEP]
proof (intro set_eqI iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> sset (cycle xs) \<Longrightarrow> x \<in> set xs
 2. \<And>x. x \<in> set xs \<Longrightarrow> x \<in> sset (cycle xs)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> sset (cycle xs) \<Longrightarrow> x \<in> set xs
 2. \<And>x. x \<in> set xs \<Longrightarrow> x \<in> sset (cycle xs)
[PROOF STEP]
assume "x \<in> sset (cycle xs)"
[PROOF STATE]
proof (state)
this:
x \<in> sset (cycle xs)

goal (2 subgoals):
 1. \<And>x. x \<in> sset (cycle xs) \<Longrightarrow> x \<in> set xs
 2. \<And>x. x \<in> set xs \<Longrightarrow> x \<in> sset (cycle xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> sset (cycle xs)
[PROOF STEP]
show "x \<in> set xs"
[PROOF STATE]
proof (prove)
using this:
x \<in> sset (cycle xs)

goal (1 subgoal):
 1. x \<in> set xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> sset (cycle xs)
xs \<noteq> []

goal (1 subgoal):
 1. x \<in> set xs
[PROOF STEP]
by (induction "cycle xs" arbitrary: xs rule: sset_induct) (fastforce simp: neq_Nil_conv)+
[PROOF STATE]
proof (state)
this:
x \<in> set xs

goal (1 subgoal):
 1. \<And>x. x \<in> set xs \<Longrightarrow> x \<in> sset (cycle xs)
[PROOF STEP]
qed (metis assms UnI1 cycle_decomp sset_shift)


[STATEMENT]
lemma rat_to_normalized_int_poly_code[code]:
  "rat_to_normalized_int_poly p = (if p = 0 then (1,0) else case rat_to_int_poly p of (s,q)
    \<Rightarrow> let c = content q in (of_int c / of_int s, sdiv_poly q c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_to_normalized_int_poly p = (if p = 0 then (1, 0) else case rat_to_int_poly p of (s, q) \<Rightarrow> let c = content q in (rat_of_int c / rat_of_int s, sdiv_poly q c))
[PROOF STEP]
unfolding Let_def rat_to_normalized_int_poly_def primitive_part_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p = 0 then (1, 0) else case rat_to_int_poly p of (s, q) \<Rightarrow> (rat_of_int (content q) / rat_of_int s, sdiv_poly q (content q))) = (if p = 0 then (1, 0) else case rat_to_int_poly p of (s, q) \<Rightarrow> (rat_of_int (content q) / rat_of_int s, sdiv_poly q (content q)))
[PROOF STEP]
..


[STATEMENT]
lemma pochhammer_product:
  "m \<le> n \<Longrightarrow> pochhammer z n = pochhammer z m * pochhammer (z + of_nat m) (n - m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> pochhammer z n = pochhammer z m * pochhammer (z + of_nat m) (n - m)
[PROOF STEP]
using pochhammer_product'[of z m "n - m"]
[PROOF STATE]
proof (prove)
using this:
pochhammer z (m + (n - m)) = pochhammer z m * pochhammer (z + of_nat m) (n - m)

goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> pochhammer z n = pochhammer z m * pochhammer (z + of_nat m) (n - m)
[PROOF STEP]
by simp


[STATEMENT]
lemma dca_language:
  "(\<And>w. to_stream w \<in> DCA.language \<AA> \<longleftrightarrow> w \<Turnstile>\<^sub>n \<phi>) \<Longrightarrow> DCA.language \<AA> = {w. to_omega w \<Turnstile>\<^sub>n \<phi>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>w. (to_stream w \<in> DCA.language \<AA>) = w \<Turnstile>\<^sub>n \<phi>) \<Longrightarrow> DCA.language \<AA> = {w. to_omega w \<Turnstile>\<^sub>n \<phi>}
[PROOF STEP]
by (metis (mono_tags, lifting) Collect_cong dca.language_def mem_Collect_eq to_stream_to_omega)


[STATEMENT]
lemma find_non0: assumes sel_fun: "det_selection_fun sel_fun"
  and res: "find_non0 l A = Some m"
  shows "A $$ (m,l) \<noteq> 0" "l < m" "m < dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (m, l) \<noteq> (0::'a) &&& l < m &&& m < dim_row A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. A $$ (m, l) \<noteq> (0::'a)
 2. l < m
 3. m < dim_row A
[PROOF STEP]
let ?xs = "filter (\<lambda> (i,Ail). Ail \<noteq> 0) (map (\<lambda> i. (i, A $$ (i,l))) [Suc l..<dim_row A])"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. A $$ (m, l) \<noteq> (0::'a)
 2. l < m
 3. m < dim_row A
[PROOF STEP]
from res[unfolded find_non0_def Let_def]
[PROOF STATE]
proof (chain)
picking this:
(case filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]) of [] \<Rightarrow> None | a # list \<Rightarrow> Some (sel_fun (filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A])))) = Some m
[PROOF STEP]
have xs: "?xs \<noteq> []" and m: "m = sel_fun ?xs"
[PROOF STATE]
proof (prove)
using this:
(case filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]) of [] \<Rightarrow> None | a # list \<Rightarrow> Some (sel_fun (filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A])))) = Some m

goal (1 subgoal):
 1. filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]) \<noteq> [] &&& m = sel_fun (filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]))
[PROOF STEP]
by (cases ?xs, auto)+
[PROOF STATE]
proof (state)
this:
filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]) \<noteq> []
m = sel_fun (filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]))

goal (3 subgoals):
 1. A $$ (m, l) \<noteq> (0::'a)
 2. l < m
 3. m < dim_row A
[PROOF STEP]
from det_selection_funD[OF sel_fun xs, folded m]
[PROOF STATE]
proof (chain)
picking this:
m \<in> fst ` set (filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]))
[PROOF STEP]
show "A $$ (m, l) \<noteq> 0" "l < m" "m < dim_row A"
[PROOF STATE]
proof (prove)
using this:
m \<in> fst ` set (filter (\<lambda>(i, Ail). Ail \<noteq> (0::'a)) (map (\<lambda>i. (i, A $$ (i, l))) [Suc l..<dim_row A]))

goal (1 subgoal):
 1. A $$ (m, l) \<noteq> (0::'a) &&& l < m &&& m < dim_row A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A $$ (m, l) \<noteq> (0::'a)
l < m
m < dim_row A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_zip_rightI: "\<lbrakk> x \<in> set ys; length xs \<ge> length ys \<rbrakk> \<Longrightarrow> \<exists>z. (z, x) \<in> set (zip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> set ys; length ys \<le> length xs\<rbrakk> \<Longrightarrow> \<exists>z. (z, x) \<in> set (zip xs ys)
[PROOF STEP]
by(fastforce simp add: in_set_zip in_set_conv_nth simp del: length_greater_0_conv intro!: nth_zip conjI[rotated])


[STATEMENT]
lemma row_mult[simp]: assumes m: "A \<in> carrier_mat nr n" "B \<in> carrier_mat n nc"
  and i: "i < nr"
  shows "row (A * B) i = vec nc (\<lambda> j. row A i \<bullet> col B j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (A * B) i = vec nc (\<lambda>j. row A i \<bullet> col B j)
[PROOF STEP]
by (rule eq_vecI, insert m i, auto)


[STATEMENT]
lemma DERIV_power[derivative_intros]:
  "(f has_field_derivative D) (at x within s) \<Longrightarrow>
    ((\<lambda>x. f x ^ n) has_field_derivative of_nat n * (D * f x ^ (n - Suc 0))) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within s) \<Longrightarrow> ((\<lambda>x. f x ^ n) has_field_derivative of_nat n * (D * f x ^ (n - Suc 0))) (at x within s)
[PROOF STEP]
by (rule has_derivative_imp_has_field_derivative[OF has_derivative_power])
     (auto simp: has_field_derivative_def)


[STATEMENT]
lemma not_span_independent_insert:
  fixes v :: "('a::real_vector)^'n"
  assumes "independent S" and "v \<notin> span S"
  shows "independent (insert v S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent (insert v S)
[PROOF STEP]
by (simp add: assms independent_insert)


[STATEMENT]
lemma merge_map: "sorted_distinct ns \<Longrightarrow> sorted_distinct ms \<Longrightarrow> set ns \<inter> set ms = {} \<Longrightarrow>
  map snd (merge (zip ns (map \<sigma> ns)) (zip ms (map \<sigma> ms))) = map \<sigma> (sort (ns @ ms))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted_distinct ns; sorted_distinct ms; set ns \<inter> set ms = {}\<rbrakk> \<Longrightarrow> map snd (merge (zip ns (map \<sigma> ns)) (zip ms (map \<sigma> ms))) = map \<sigma> (sort (ns @ ms))
[PROOF STEP]
using merge_map'[of "zip ns (map \<sigma> ns)" "zip ms (map \<sigma> ms)" \<sigma>]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sorted_distinct (map fst (zip ns (map \<sigma> ns))); sorted_distinct (map fst (zip ms (map \<sigma> ms))); fst ` set (zip ns (map \<sigma> ns)) \<inter> fst ` set (zip ms (map \<sigma> ms)) = {}; map snd (zip ns (map \<sigma> ns)) = map \<sigma> (map fst (zip ns (map \<sigma> ns))); map snd (zip ms (map \<sigma> ms)) = map \<sigma> (map fst (zip ms (map \<sigma> ms)))\<rbrakk> \<Longrightarrow> map snd (merge (zip ns (map \<sigma> ns)) (zip ms (map \<sigma> ms))) = map \<sigma> (sort (map fst (zip ns (map \<sigma> ns)) @ map fst (zip ms (map \<sigma> ms))))

goal (1 subgoal):
 1. \<lbrakk>sorted_distinct ns; sorted_distinct ms; set ns \<inter> set ms = {}\<rbrakk> \<Longrightarrow> map snd (merge (zip ns (map \<sigma> ns)) (zip ms (map \<sigma> ms))) = map \<sigma> (sort (ns @ ms))
[PROOF STEP]
by auto (metis length_map list.set_map map_fst_zip)


[STATEMENT]
lemma rel_fun_iff_geq_image2p: "rel_fun R S f g = (image2p f g R \<le> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_fun R S f g = (image2p f g R \<le> S)
[PROOF STEP]
unfolding rel_fun_def image2p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. R x y \<longrightarrow> S (f x) (g y)) = ((\<lambda>x y. \<exists>x' y'. R x' y' \<and> f x' = x \<and> g y' = y) \<le> S)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in weak_lower_semilattice) meet_le:
  assumes sub: "z \<sqsubseteq> x"  "z \<sqsubseteq> y"
    and x: "x \<in> carrier L" and y: "y \<in> carrier L" and z: "z \<in> carrier L"
  shows "z \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
proof (rule meetI [OF _ x y])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. is_glb L i {x, y} \<Longrightarrow> z \<sqsubseteq> i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. is_glb L i {x, y} \<Longrightarrow> z \<sqsubseteq> i
[PROOF STEP]
assume "greatest L i (Lower L {x, y})"
[PROOF STATE]
proof (state)
this:
is_glb L i {x, y}

goal (1 subgoal):
 1. \<And>i. is_glb L i {x, y} \<Longrightarrow> z \<sqsubseteq> i
[PROOF STEP]
with sub z
[PROOF STATE]
proof (chain)
picking this:
z \<sqsubseteq> x
z \<sqsubseteq> y
z \<in> carrier L
is_glb L i {x, y}
[PROOF STEP]
show "z \<sqsubseteq> i"
[PROOF STATE]
proof (prove)
using this:
z \<sqsubseteq> x
z \<sqsubseteq> y
z \<in> carrier L
is_glb L i {x, y}

goal (1 subgoal):
 1. z \<sqsubseteq> i
[PROOF STEP]
by (fast elim: greatest_le intro: Lower_memI)
[PROOF STATE]
proof (state)
this:
z \<sqsubseteq> i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Rep_account_plus [simp]:
  "\<pi> (\<alpha>\<^sub>1 + \<alpha>\<^sub>2) = (\<lambda> n. \<pi> \<alpha>\<^sub>1 n + \<pi> \<alpha>\<^sub>2 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (\<alpha>\<^sub>1 + \<alpha>\<^sub>2) = (\<lambda>n. \<pi> \<alpha>\<^sub>1 n + \<pi> \<alpha>\<^sub>2 n)
[PROOF STEP]
unfolding plus_account_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (\<iota> (\<lambda>n. \<pi> \<alpha>\<^sub>1 n + \<pi> \<alpha>\<^sub>2 n)) = (\<lambda>n. \<pi> \<alpha>\<^sub>1 n + \<pi> \<alpha>\<^sub>2 n)
[PROOF STEP]
by (metis (full_types)
        Abs_account_cases
        Abs_account_inverse
        fin_support_closed_under_addition)


[STATEMENT]
lemma null_set_Int1:
  assumes "B \<in> null_sets M" "A \<in> sets M" shows "A \<inter> B \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B \<in> null_sets M
[PROOF STEP]
proof (intro CollectI conjI null_setsI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. emeasure M (A \<inter> B) = 0
 2. A \<inter> B \<in> sets M
[PROOF STEP]
show "emeasure M (A \<inter> B) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (A \<inter> B) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B \<in> null_sets M
A \<in> sets M

goal (1 subgoal):
 1. emeasure M (A \<inter> B) = 0
[PROOF STEP]
by (intro emeasure_eq_0[of B _ "A \<inter> B"]) auto
[PROOF STATE]
proof (state)
this:
emeasure M (A \<inter> B) = 0

goal (1 subgoal):
 1. A \<inter> B \<in> sets M
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
lemma absolutely_integrable_bounded_variation:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes f: "f absolutely_integrable_on UNIV"
  obtains B where "\<forall>d. d division_of (\<Union>d) \<longrightarrow> sum (\<lambda>k. norm (integral k f)) d \<le> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (rule that[of "integral UNIV (\<lambda>x. norm (f x))"]; safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
fix d :: "'a set set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
assume d: "d division_of \<Union>d"
[PROOF STATE]
proof (state)
this:
d division_of \<Union> d

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
have *: "k \<in> d \<Longrightarrow> f absolutely_integrable_on k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> d \<Longrightarrow> f absolutely_integrable_on k
[PROOF STEP]
using f[THEN set_integrable_subset, of k] division_ofD(2,4)[OF d, of k]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>k \<in> sets lebesgue; k \<subseteq> UNIV\<rbrakk> \<Longrightarrow> f absolutely_integrable_on k
k \<in> d \<Longrightarrow> k \<subseteq> \<Union> d
k \<in> d \<Longrightarrow> \<exists>a b. k = cbox a b

goal (1 subgoal):
 1. k \<in> d \<Longrightarrow> f absolutely_integrable_on k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k \<in> d \<Longrightarrow> f absolutely_integrable_on ?k

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
note d' = division_ofD[OF d]
[PROOF STATE]
proof (state)
this:
finite d
?K \<in> d \<Longrightarrow> ?K \<subseteq> \<Union> d
?K \<in> d \<Longrightarrow> ?K \<noteq> {}
?K \<in> d \<Longrightarrow> \<exists>a b. ?K = cbox a b
\<lbrakk>?K1.0 \<in> d; ?K2.0 \<in> d; ?K1.0 \<noteq> ?K2.0\<rbrakk> \<Longrightarrow> interior ?K1.0 \<inter> interior ?K2.0 = {}
\<Union> d = \<Union> d

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
have "(\<Sum>k\<in>d. norm (integral k f)) = (\<Sum>k\<in>d. norm (LINT x:k|lebesgue. f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>d. norm (integral k f)) = (\<Sum>k\<in>d. norm (set_lebesgue_integral lebesgue k f))
[PROOF STEP]
by (intro sum.cong refl arg_cong[where f=norm] set_lebesgue_integral_eq_integral(2)[symmetric] *)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. norm (integral k f)) = (\<Sum>k\<in>d. norm (set_lebesgue_integral lebesgue k f))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. norm (integral k f)) = (\<Sum>k\<in>d. norm (set_lebesgue_integral lebesgue k f))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>k\<in>d. LINT x:k|lebesgue. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>d. norm (set_lebesgue_integral lebesgue k f)) \<le> (\<Sum>k\<in>d. \<integral>x\<in>k. norm (f x)\<partial>lebesgue)
[PROOF STEP]
by (intro sum_mono set_integral_norm_bound *)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. norm (set_lebesgue_integral lebesgue k f)) \<le> (\<Sum>k\<in>d. \<integral>x\<in>k. norm (f x)\<partial>lebesgue)

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. norm (set_lebesgue_integral lebesgue k f)) \<le> (\<Sum>k\<in>d. \<integral>x\<in>k. norm (f x)\<partial>lebesgue)

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
have "\<dots> = (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>d. \<integral>x\<in>k. norm (f x)\<partial>lebesgue) = (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x)))
[PROOF STEP]
by (intro sum.cong refl set_lebesgue_integral_eq_integral(2) set_integrable_norm *)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. \<integral>x\<in>k. norm (f x)\<partial>lebesgue) = (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x)))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. \<integral>x\<in>k. norm (f x)\<partial>lebesgue) = (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x)))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
have "\<dots> \<le> integral (\<Union>d) (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x))) \<le> integral (\<Union> d) (\<lambda>x. norm (f x))
[PROOF STEP]
using integrable_on_subdivision[OF d] assms f
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f integrable_on ?S; \<Union> d \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f integrable_on \<Union> d
f absolutely_integrable_on UNIV
f absolutely_integrable_on UNIV

goal (1 subgoal):
 1. (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x))) \<le> integral (\<Union> d) (\<lambda>x. norm (f x))
[PROOF STEP]
unfolding absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f integrable_on ?S; \<Union> d \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f integrable_on \<Union> d
f integrable_on UNIV \<and> (\<lambda>x. norm (f x)) integrable_on UNIV
f integrable_on UNIV \<and> (\<lambda>x. norm (f x)) integrable_on UNIV

goal (1 subgoal):
 1. (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x))) \<le> integral (\<Union> d) (\<lambda>x. norm (f x))
[PROOF STEP]
by (subst integral_combine_division_topdown[OF _ d]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x))) \<le> integral (\<Union> d) (\<lambda>x. norm (f x))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x))) \<le> integral (\<Union> d) (\<lambda>x. norm (f x))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
have "\<dots> \<le> integral UNIV (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (\<Union> d) (\<lambda>x. norm (f x)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
using integrable_on_subdivision[OF d] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f integrable_on ?S; \<Union> d \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f integrable_on \<Union> d
f absolutely_integrable_on UNIV

goal (1 subgoal):
 1. integral (\<Union> d) (\<lambda>x. norm (f x)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
unfolding absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f integrable_on ?S; \<Union> d \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f integrable_on \<Union> d
f integrable_on UNIV \<and> (\<lambda>x. norm (f x)) integrable_on UNIV

goal (1 subgoal):
 1. integral (\<Union> d) (\<lambda>x. norm (f x)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
by (intro integral_subset_le) auto
[PROOF STATE]
proof (state)
this:
integral (\<Union> d) (\<lambda>x. norm (f x)) \<le> integral UNIV (\<lambda>x. norm (f x))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>\<And>B. \<forall>d. d division_of \<Union> d \<longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> B \<Longrightarrow> thesis; d division_of \<Union> d\<rbrakk> \<Longrightarrow> (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
show "(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))

goal (1 subgoal):
 1. (\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_sorted_imp_less_sets:
  "strict_sorted (as @ bs) \<Longrightarrow> (list.set as) \<lless> (list.set bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_sorted (as @ bs) \<Longrightarrow> set as \<lless> set bs
[PROOF STEP]
by (simp add: less_sets_def sorted_wrt_append)


[STATEMENT]
lemma range_is_csubspace[simp]:
  assumes a1: "clinear f"
  shows "csubspace (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csubspace (range f)
[PROOF STEP]
using assms complex_vector.linear_subspace_image complex_vector.subspace_UNIV
[PROOF STATE]
proof (prove)
using this:
clinear f
\<lbrakk>clinear ?f; csubspace ?S\<rbrakk> \<Longrightarrow> csubspace (?f ` ?S)
csubspace UNIV

goal (1 subgoal):
 1. csubspace (range f)
[PROOF STEP]
by blast


[STATEMENT]
lemma testN_post1:
  "f k \<Longrightarrow> adjoint (testN k) * post * testN k = testN k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f k \<Longrightarrow> adjoint (testN k) * post * testN k = testN k
[PROOF STEP]
apply (subst assoc_mult_mat[of _ N N _ N _ N])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. f k \<Longrightarrow> adjoint (testN k) \<in> carrier_mat N N
 2. f k \<Longrightarrow> post \<in> carrier_mat N N
 3. f k \<Longrightarrow> testN k \<in> carrier_mat N N
 4. f k \<Longrightarrow> adjoint (testN k) * (post * testN k) = testN k
[PROOF STEP]
apply (auto simp add: adjoint_dim testN_dim post_dim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f k \<Longrightarrow> adjoint (testN k) * (post * testN k) = testN k
[PROOF STEP]
apply (subst post_mult_testNk, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f k \<Longrightarrow> adjoint (testN k) * testN k = testN k
[PROOF STEP]
unfolding hermitian_testN[unfolded hermitian_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f k \<Longrightarrow> testN k * testN k = testN k
[PROOF STEP]
using testN_mult_testN
[PROOF STATE]
proof (prove)
using this:
testN ?k * testN ?k = testN ?k

goal (1 subgoal):
 1. f k \<Longrightarrow> testN k * testN k = testN k
[PROOF STEP]
by auto


[STATEMENT]
lemma empty_set_less_aux [simp]: "{} \<sqsubset>' A \<longleftrightarrow> A \<noteq> {} \<and> finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({} \<sqsubset>' A) = (A \<noteq> {} \<and> finite A)
[PROOF STEP]
by(auto 4 3 simp add: set_less_aux_def intro!: Min_eqI intro: bexI[where x="Min A"] order_trans[where y="Min A"] Min_in)


[STATEMENT]
lemma landau_gt_1_in_cong:
  "landau_symbol L L' Lr \<Longrightarrow> (\<And>x::real. x > 1 \<Longrightarrow> f x = g x) \<Longrightarrow> f \<in> L at_top (h) \<longleftrightarrow> g \<in> L at_top (h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>landau_symbol L L' Lr; \<And>x. 1 < x \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> (f \<in> L at_top h) = (g \<in> L at_top h)
[PROOF STEP]
by (auto intro: eventually_mono [OF eventually_gt_at_top[of 1]] elim!: landau_symbol.in_cong)


[STATEMENT]
lemma wlp_while_unfold: "wlp (WHILE b DO c) Q s = (if bval b s then wlp c (wlp (WHILE b DO c) Q) s else Q s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.wlp (WHILE b DO c) Q s = (if bval b s then local.wlp c (local.wlp (WHILE b DO c) Q) s else Q s)
[PROOF STEP]
apply (subst wlp_equiv[OF while_unfold])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.wlp (IF b THEN c;; WHILE b DO c ELSE SKIP) Q s = (if bval b s then local.wlp c (local.wlp (WHILE b DO c) Q) s else Q s)
[PROOF STEP]
apply (simp add: wlp_eq')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done