[STATEMENT]
lemma fo_nmlzd_set:
  assumes "fo_nmlzd AD xs"
  shows "set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
have "Inl -` set xs \<subseteq> AD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inl -` set xs \<subseteq> AD
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fo_nmlzd AD xs

goal (1 subgoal):
 1. Inl -` set xs \<subseteq> AD
[PROOF STEP]
by (auto simp: fo_nmlzd_def)
[PROOF STATE]
proof (state)
this:
Inl -` set xs \<subseteq> AD

goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Inl -` set xs \<subseteq> AD

goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
have "Inr -` set xs = {..<card (Inr -` set xs)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inr -` set xs = {..<card (Inr -` set xs)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fo_nmlzd AD xs

goal (1 subgoal):
 1. Inr -` set xs = {..<card (Inr -` set xs)}
[PROOF STEP]
by (auto simp: Let_def fo_nmlzd_def nats_def length_rremdups set_map_filter_sum rremdups_set
        dest!: arg_cong[of _ _ set])
[PROOF STATE]
proof (state)
this:
Inr -` set xs = {..<card (Inr -` set xs)}

goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Inl -` set xs \<subseteq> AD
Inr -` set xs = {..<card (Inr -` set xs)}
[PROOF STEP]
have "set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<card (Inr -` set xs)}"
[PROOF STATE]
proof (prove)
using this:
Inl -` set xs \<subseteq> AD
Inr -` set xs = {..<card (Inr -` set xs)}

goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<card (Inr -` set xs)}
[PROOF STEP]
by auto (metis (no_types, lifting) UNIV_I UNIV_sum UnE image_iff subset_iff vimageI)
[PROOF STATE]
proof (state)
this:
set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<card (Inr -` set xs)}

goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<card (Inr -` set xs)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<card (Inr -` set xs)}

goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
using card_Inr_vimage_le_length[of xs]
[PROOF STATE]
proof (prove)
using this:
set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<card (Inr -` set xs)}
card (Inr -` set xs) \<le> length xs

goal (1 subgoal):
 1. set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}
[PROOF STEP]
by (metis min.absorb2)
[PROOF STATE]
proof (state)
this:
set xs = set xs \<inter> Inl ` AD \<union> Inr ` {..<min (length xs) (card (Inr -` set xs))}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Infinitesimal_add:
  assumes "x \<in> Infinitesimal" "y \<in> Infinitesimal"
  shows "x + y \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y \<in> Infinitesimal
[PROOF STEP]
proof (rule InfinitesimalI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> hnorm (x + y) < r
[PROOF STEP]
show "hnorm (x + y) < r"
    if "r \<in> \<real>" and "0 < r" for r :: "real star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hnorm (x + y) < r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hnorm (x + y) < r
[PROOF STEP]
have "hnorm x < r/2" "hnorm y < r/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hnorm x < r / 2 &&& hnorm y < r / 2
[PROOF STEP]
using InfinitesimalD SReal_divide_numeral assms half_gt_zero that
[PROOF STATE]
proof (prove)
using this:
?x \<in> Infinitesimal \<Longrightarrow> \<forall>r\<in>\<real>. 0 < r \<longrightarrow> hnorm ?x < r
?r \<in> \<real> \<Longrightarrow> ?r / numeral ?w \<in> \<real>
x \<in> Infinitesimal
y \<in> Infinitesimal
(0::?'a) < ?a \<Longrightarrow> (0::?'a) < ?a / (2::?'a)
r \<in> \<real>
0 < r

goal (1 subgoal):
 1. hnorm x < r / 2 &&& hnorm y < r / 2
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
hnorm x < r / 2
hnorm y < r / 2

goal (1 subgoal):
 1. hnorm (x + y) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hnorm x < r / 2
hnorm y < r / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hnorm x < r / 2
hnorm y < r / 2

goal (1 subgoal):
 1. hnorm (x + y) < r
[PROOF STEP]
using hnorm_add_less
[PROOF STATE]
proof (prove)
using this:
hnorm x < r / 2
hnorm y < r / 2
\<lbrakk>hnorm ?x < ?r; hnorm ?y < ?s\<rbrakk> \<Longrightarrow> hnorm (?x + ?y) < ?r + ?s

goal (1 subgoal):
 1. hnorm (x + y) < r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
hnorm (x + y) < r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?r \<in> \<real>; 0 < ?r\<rbrakk> \<Longrightarrow> hnorm (x + y) < ?r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_mult' [continuous_intros]:
  fixes f g :: "_ \<Rightarrow> 'b::topological_semigroup_mult"
  shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on A f; continuous_on A g\<rbrakk> \<Longrightarrow> continuous_on A (\<lambda>x. f x * g x)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A. (f \<longlongrightarrow> f x) (at x within A); \<forall>x\<in>A. (g \<longlongrightarrow> g x) (at x within A)\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. ((\<lambda>x. f x * g x) \<longlongrightarrow> f x * g x) (at x within A)
[PROOF STEP]
by (auto intro: tendsto_mult)


[STATEMENT]
lemma maximal_acyclic_paths_deadlock_targets :
  assumes "acyclic M"
  shows "maximal_acyclic_paths M
          = { p . path M (initial M) p \<and> deadlock_state M (target (initial M) p)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maximal_acyclic_paths M = {p. path M (FSM.initial M) p \<and> deadlock_state M (target (FSM.initial M) p)}
[PROOF STEP]
using maximal_acyclic_path_deadlock[OF assms]
[PROOF STATE]
proof (prove)
using this:
path M (FSM.initial M) ?p \<Longrightarrow> (\<exists>p'. p' \<noteq> [] \<and> path M (FSM.initial M) (?p @ p') \<and> distinct (visited_states (FSM.initial M) (?p @ p'))) \<noteq> deadlock_state M (target (FSM.initial M) ?p)

goal (1 subgoal):
 1. maximal_acyclic_paths M = {p. path M (FSM.initial M) p \<and> deadlock_state M (target (FSM.initial M) p)}
[PROOF STEP]
unfolding maximal_acyclic_paths_def
[PROOF STATE]
proof (prove)
using this:
path M (FSM.initial M) ?p \<Longrightarrow> (\<exists>p'. p' \<noteq> [] \<and> path M (FSM.initial M) (?p @ p') \<and> distinct (visited_states (FSM.initial M) (?p @ p'))) \<noteq> deadlock_state M (target (FSM.initial M) ?p)

goal (1 subgoal):
 1. {p. path M (FSM.initial M) p \<and> distinct (visited_states (FSM.initial M) p) \<and> (\<nexists>p'. p' \<noteq> [] \<and> path M (FSM.initial M) (p @ p') \<and> distinct (visited_states (FSM.initial M) (p @ p')))} = {p. path M (FSM.initial M) p \<and> deadlock_state M (target (FSM.initial M) p)}
[PROOF STEP]
by (metis (no_types, lifting) acyclic.elims(2) assms)


[STATEMENT]
lemma inf_0_eq_0 [simp, no_atp]: "inf a (- a) = 0 \<longleftrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inf a (- a) = (0::'a)) = (a = (0::'a))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inf a (- a) = (0::'a) \<Longrightarrow> a = (0::'a)
 2. a = (0::'a) \<Longrightarrow> inf a (- a) = (0::'a)
[PROOF STEP]
apply (erule inf_0_imp_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = (0::'a) \<Longrightarrow> inf a (- a) = (0::'a)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lenlex_trans:
    "\<lbrakk>(x,y) \<in> lenlex r; (y,z) \<in> lenlex r; trans r\<rbrakk> \<Longrightarrow> (x,z) \<in> lenlex r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> lenlex r; (y, z) \<in> lenlex r; trans r\<rbrakk> \<Longrightarrow> (x, z) \<in> lenlex r
[PROOF STEP]
by (meson lenlex_transI transD)


[STATEMENT]
lemma prime_factorization_gcd_factorial:
  assumes [simp]: "a \<noteq> 0" "b \<noteq> 0"
  shows   "prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
have "prime_factorization (gcd_factorial a b) =
          prime_factorization (prod_mset (prime_factorization a \<inter># prime_factorization b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization (gcd_factorial a b) = prime_factorization (\<Prod>\<^sub># (prime_factorization a \<inter># prime_factorization b))
[PROOF STEP]
by (simp add: gcd_factorial_def)
[PROOF STATE]
proof (state)
this:
prime_factorization (gcd_factorial a b) = prime_factorization (\<Prod>\<^sub># (prime_factorization a \<inter># prime_factorization b))

goal (1 subgoal):
 1. prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factorization (gcd_factorial a b) = prime_factorization (\<Prod>\<^sub># (prime_factorization a \<inter># prime_factorization b))

goal (1 subgoal):
 1. prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
have "\<dots> = prime_factorization a \<inter># prime_factorization b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization (\<Prod>\<^sub># (prime_factorization a \<inter># prime_factorization b)) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
by (subst prime_factorization_prod_mset_primes) auto
[PROOF STATE]
proof (state)
this:
prime_factorization (\<Prod>\<^sub># (prime_factorization a \<inter># prime_factorization b)) = prime_factorization a \<inter># prime_factorization b

goal (1 subgoal):
 1. prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b

goal (1 subgoal):
 1. prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prime_factorization (gcd_factorial a b) = prime_factorization a \<inter># prime_factorization b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma \<Sigma>_add:
  "\<Sigma> (\<lambda>k. f k + g k) j l = \<Sigma> f j l + \<Sigma> g j l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sigma> (\<lambda>k. f k + g k) j l = \<Sigma> f j l + \<Sigma> g j l
[PROOF STEP]
by (simp add: \<Sigma>_def sum.distrib)


[STATEMENT]
lemma inv_permutep [simp]:
  fixes f :: "'a \<Rightarrow> 'a"
  assumes "bij f"
  shows   "inv_into UNIV (permutep f) = permutep (inv_into UNIV f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (permutep f) = permutep (inv f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. inv (permutep f) x = permutep (inv f) x
[PROOF STEP]
fix m :: "'a \<Rightarrow>\<^sub>0 'b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. inv (permutep f) x = permutep (inv f) x
[PROOF STEP]
show "inv_into UNIV (permutep f) m = permutep (inv_into UNIV f) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (permutep f) m = permutep (inv f) m
[PROOF STEP]
using permutep_comp'[of "inv_into UNIV f" f m] assms inj_iff[of f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij (inv f); bij f\<rbrakk> \<Longrightarrow> permutep (inv f \<circ> f) m = permutep f (permutep (inv f) m)
bij f
inj f = (inv f \<circ> f = id)

goal (1 subgoal):
 1. inv (permutep f) m = permutep (inv f) m
[PROOF STEP]
by (intro inv_f_eq) (auto simp: bij_imp_bij_inv bij_is_inj)
[PROOF STATE]
proof (state)
this:
inv (permutep f) m = permutep (inv f) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_ge_1_two_diff:
  assumes "card A > 1"
  obtains x y where "x \<in> A" "y \<in> A" "x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have fA: "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < card A

goal (1 subgoal):
 1. finite A
[PROOF STEP]
by (metis card.infinite not_one_less_zero)
[PROOF STATE]
proof (state)
this:
finite A

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < card A
[PROOF STEP]
obtain x where x: "x \<in> A"
[PROOF STATE]
proof (prove)
using this:
1 < card A

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

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with assms fA
[PROOF STATE]
proof (chain)
picking this:
1 < card A
finite A
x \<in> A
[PROOF STEP]
have "card (A - {x}) > 0"
[PROOF STATE]
proof (prove)
using this:
1 < card A
finite A
x \<in> A

goal (1 subgoal):
 1. 0 < card (A - {x})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < card (A - {x})

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < card (A - {x})
[PROOF STEP]
obtain y where y: "y \<in> (A - {x})"
[PROOF STATE]
proof (prove)
using this:
0 < card (A - {x})

goal (1 subgoal):
 1. (\<And>y. y \<in> A - {x} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis card_gt_0_iff ex_in_conv)
[PROOF STATE]
proof (state)
this:
y \<in> A - {x}

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<in> A - {x}

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that[of x y] x
[PROOF STATE]
proof (prove)
using this:
y \<in> A - {x}
\<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> thesis
x \<in> A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma len_equiv_rels: "length (equiv_rels n) = Bell n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
have a:"finite {p. equiv {..<n} p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {p. equiv {..<n} p}
[PROOF STEP]
by (simp add: finite_equiv)
[PROOF STATE]
proof (state)
this:
finite {p. equiv {..<n} p}

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
have b: "set (equiv_rels n)  \<subseteq>  {p. equiv {..<n} p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (equiv_rels n) \<subseteq> {p. equiv {..<n} p}
[PROOF STEP]
using equiv_rels_set
[PROOF STATE]
proof (prove)
using this:
?x \<in> set (equiv_rels ?n) \<Longrightarrow> equiv {..<?n} ?x

goal (1 subgoal):
 1. set (equiv_rels n) \<subseteq> {p. equiv {..<n} p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (equiv_rels n) \<subseteq> {p. equiv {..<n} p}

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
have "length (equiv_rels n) =
    (\<Sum>x \<in> {p. equiv {..<n} p}. count_list (equiv_rels n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (equiv_rels n) = sum (count_list (equiv_rels n)) {p. equiv {..<n} p}
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
finite {p. equiv {..<n} p}
set (equiv_rels n) \<subseteq> {p. equiv {..<n} p}

goal (1 subgoal):
 1. length (equiv_rels n) = sum (count_list (equiv_rels n)) {p. equiv {..<n} p}
[PROOF STEP]
by (simp add:sum_count_set)
[PROOF STATE]
proof (state)
this:
length (equiv_rels n) = sum (count_list (equiv_rels n)) {p. equiv {..<n} p}

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (equiv_rels n) = sum (count_list (equiv_rels n)) {p. equiv {..<n} p}

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
have "... = card {p. equiv {..<n} p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (count_list (equiv_rels n)) {p. equiv {..<n} p} = card {p. equiv {..<n} p}
[PROOF STEP]
by (simp add: equiv_rels)
[PROOF STATE]
proof (state)
this:
sum (count_list (equiv_rels n)) {p. equiv {..<n} p} = card {p. equiv {..<n} p}

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (count_list (equiv_rels n)) {p. equiv {..<n} p} = card {p. equiv {..<n} p}

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
have "... = Bell (card {..<n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. equiv {..<n} p} = Bell (card {..<n})
[PROOF STEP]
using card_equiv_rel_eq_Bell
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> card {R. equiv ?A R} = Bell (card ?A)

goal (1 subgoal):
 1. card {p. equiv {..<n} p} = Bell (card {..<n})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card {p. equiv {..<n} p} = Bell (card {..<n})

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {p. equiv {..<n} p} = Bell (card {..<n})

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
have "... = Bell n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bell (card {..<n}) = Bell n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Bell (card {..<n}) = Bell n

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length (equiv_rels n) = Bell n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (equiv_rels n) = Bell n

goal (1 subgoal):
 1. length (equiv_rels n) = Bell n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (equiv_rels n) = Bell n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma skolemize2: "\<forall>x. P x \<longrightarrow> (\<exists>y z. Q x y z) \<Longrightarrow> \<exists>f g.\<forall>x. P x \<longrightarrow> Q x (f x) (g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. P x \<longrightarrow> (\<exists>y z. Q x y z) \<Longrightarrow> \<exists>f g. \<forall>x. P x \<longrightarrow> Q x (f x) (g x)
[PROOF STEP]
apply (drule skolemize1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. \<forall>x. P x \<longrightarrow> (\<exists>z. Q x (f x) z) \<Longrightarrow> \<exists>f g. \<forall>x. P x \<longrightarrow> Q x (f x) (g x)
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<forall>x. P x \<longrightarrow> (\<exists>z. Q x (f x) z) \<Longrightarrow> \<exists>f g. \<forall>x. P x \<longrightarrow> Q x (f x) (g x)
[PROOF STEP]
apply (drule skolemize1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<exists>fa. \<forall>x. P x \<longrightarrow> Q x (f x) (fa x) \<Longrightarrow> \<exists>f g. \<forall>x. P x \<longrightarrow> Q x (f x) (g x)
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma weak_reduction_simulations_iff_bisimulation:
  fixes Rel :: "('proc \<times> 'proc) set"
    and Cal :: "'proc processCalculus"
  shows "(weak_reduction_simulation Rel Cal \<and> weak_reduction_simulation (Rel\<inverse>) Cal)
         = weak_reduction_bisimulation Rel Cal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (weak_reduction_simulation Rel Cal \<and> weak_reduction_simulation (Rel\<inverse>) Cal) = weak_reduction_bisimulation Rel Cal
[PROOF STEP]
using weak_reduction_simulations_impl_bisimulation[where Rel="Rel" and Cal="Cal"]
            weak_reduction_bisimulations_impl_inverse_is_simulation[where Rel="Rel" and Cal="Cal"]
[PROOF STATE]
proof (prove)
using this:
weak_reduction_simulation Rel Cal \<and> weak_reduction_simulation (Rel\<inverse>) Cal \<Longrightarrow> weak_reduction_bisimulation Rel Cal
weak_reduction_bisimulation Rel Cal \<Longrightarrow> weak_reduction_simulation (Rel\<inverse>) Cal

goal (1 subgoal):
 1. (weak_reduction_simulation Rel Cal \<and> weak_reduction_simulation (Rel\<inverse>) Cal) = weak_reduction_bisimulation Rel Cal
[PROOF STEP]
by blast


[STATEMENT]
lemma (in prob_space) distributed_marginal_eq_joint2:
  assumes T: "sigma_finite_measure T"
  assumes S: "sigma_finite_measure S"
  assumes Py: "distributed M T Y Py"
  assumes Pxy: "distributed M (S \<Otimes>\<^sub>M T) (\<lambda>x. (X x, Y x)) Pxy"
  shows "AE y in T. Py y = (\<integral>\<^sup>+x. Pxy (x, y) \<partial>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE y in T. Py y = \<integral>\<^sup>+ x. Pxy (x, y) \<partial>S
[PROOF STEP]
using Py distr_marginal2[OF S T Pxy]
[PROOF STATE]
proof (prove)
using this:
distributed M T Y Py
distributed M T Y (\<lambda>y. \<integral>\<^sup>+ x. Pxy (x, y) \<partial>S)

goal (1 subgoal):
 1. AE y in T. Py y = \<integral>\<^sup>+ x. Pxy (x, y) \<partial>S
[PROOF STEP]
by (rule distributed_unique)


[STATEMENT]
lemma add_abs_int:
  "(abs_int (x,y)) + (abs_int (u,v)) =
   (abs_int (x + u, y + v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_int (x, y) + abs_int (u, v) = abs_int (x + u, y + v)
[PROOF STEP]
apply(simp add: plus_int_def id_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_int (plus_int_raw (rep_int (abs_int (x, y))) (rep_int (abs_int (u, v)))) = abs_int (x + u, y + v)
[PROOF STEP]
apply(fold plus_int_raw.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_int (plus_int_raw (rep_int (abs_int (x, y))) (rep_int (abs_int (u, v)))) = abs_int (plus_int_raw (x, y) (u, v))
[PROOF STEP]
apply(rule Quotient3_rel_abs[OF Quotient3_int])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. plus_int_raw (rep_int (abs_int (x, y))) (rep_int (abs_int (u, v))) \<approx> plus_int_raw (x, y) (u, v)
[PROOF STEP]
apply(rule plus_int_raw_rsp_aux)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. rep_int (abs_int (x, y)) \<approx> (x, y)
 2. rep_int (abs_int (u, v)) \<approx> (u, v)
[PROOF STEP]
apply(simp_all add: rep_abs_rsp_left[OF Quotient3_int])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma infinite_atLeast: "infinite {(n::nat)..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {n..}
[PROOF STEP]
by (rule unbounded_k_infinite[of n], fastforce)


[STATEMENT]
lemma inner_eq_vangle: "u \<bullet> v = cos (vangle u v) * (norm u * norm v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<bullet> v = cos (vangle u v) * (norm u * norm v)
[PROOF STEP]
by (simp add: cos_vangle)


[STATEMENT]
lemma d_OUT_alt_def2: "d_OUT g x = (\<Sum>\<^sup>+ y\<in>{y. (x, y) \<in> support_flow g}. g (x, y))"
  and d_IN_alt_def2: "d_IN g y = (\<Sum>\<^sup>+ x\<in>{x. (x, y) \<in> support_flow g}. g (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g x = (\<Sum>\<^sup>+ y\<in>{y. (x, y) \<in> support_flow g}. g (x, y)) &&& d_IN g y = (\<Sum>\<^sup>+ x\<in>{x. (x, y) \<in> support_flow g}. g (x, y))
[PROOF STEP]
unfolding d_OUT_def d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (x, y)) = (\<Sum>\<^sup>+ y\<in>{y. (x, y) \<in> support_flow g}. g (x, y)) &&& (\<Sum>\<^sup>+ x. g (x, y)) = (\<Sum>\<^sup>+ x\<in>{x. (x, y) \<in> support_flow g}. g (x, y))
[PROOF STEP]
by(auto simp add: max_def d_OUT_def d_IN_def nn_integral_count_space_indicator outgoing_def incoming_def support_flow.simps intro!: nn_integral_cong split: split_indicator)+


[STATEMENT]
lemma real_of_float_min: "real_of_float (min x y) = min (real_of_float x) (real_of_float y)"
  and real_of_float_max: "real_of_float (max x y) = max (real_of_float x) (real_of_float y)"
  for x y :: float
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (min x y) = min (real_of_float x) (real_of_float y) &&& real_of_float (max x y) = max (real_of_float x) (real_of_float y)
[PROOF STEP]
by (simp_all add: min_def max_def)


[STATEMENT]
lemma affine_hull_subset_span: "(affine hull s) \<subseteq> (span s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull s \<subseteq> span s
[PROOF STEP]
by (metis hull_minimal span_superset subspace_imp_affine subspace_span)


[STATEMENT]
lemma fixed_points_0inf:
  assumes "moebius_pt M 0\<^sub>h = 0\<^sub>h" and "moebius_pt M \<infinity>\<^sub>h = \<infinity>\<^sub>h"
  shows "\<exists> k::complex_homo. (k \<noteq> 0\<^sub>h \<and> k \<noteq> \<infinity>\<^sub>h) \<and> moebius_pt M = (\<lambda> z. k *\<^sub>h z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. (k \<noteq> 0\<^sub>h \<and> k \<noteq> \<infinity>\<^sub>h) \<and> moebius_pt M = (*\<^sub>h) k
[PROOF STEP]
using fixed_points_0inf'[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>k. (k \<noteq> 0\<^sub>h \<and> k \<noteq> \<infinity>\<^sub>h) \<and> (\<forall>z. moebius_pt M z = k *\<^sub>h z)

goal (1 subgoal):
 1. \<exists>k. (k \<noteq> 0\<^sub>h \<and> k \<noteq> \<infinity>\<^sub>h) \<and> moebius_pt M = (*\<^sub>h) k
[PROOF STEP]
by auto


[STATEMENT]
lemma less_char_simp [simp, code]:
  \<open>Char b0 b1 b2 b3 b4 b5 b6 b7 < Char c0 c1 c2 c3 c4 c5 c6 c7
    \<longleftrightarrow> ord_class.lexordp [b7, b6, b5, b4, b3, b2, b1, b0] [c7, c6, c5, c4, c3, c2, c1, c0]\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Char b0 b1 b2 b3 b4 b5 b6 b7 < Char c0 c1 c2 c3 c4 c5 c6 c7) = ord_class.lexordp [b7, b6, b5, b4, b3, b2, b1, b0] [c7, c6, c5, c4, c3, c2, c1, c0]
[PROOF STEP]
by (simp only: less_char_def of_char_def char.sel horner_sum_less_iff_lexordp list.size) simp


[STATEMENT]
lemma times_binomial_minus1_eq: "0 < k \<Longrightarrow> k * (n choose k) = n * ((n - 1) choose (k - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> k * (n choose k) = n * (n - 1 choose (k - 1))
[PROOF STEP]
using Suc_times_binomial_eq [where n = "n - 1" and k = "k - 1"]
[PROOF STATE]
proof (prove)
using this:
Suc (n - 1) * (n - 1 choose (k - 1)) = (Suc (n - 1) choose Suc (k - 1)) * Suc (k - 1)

goal (1 subgoal):
 1. 0 < k \<Longrightarrow> k * (n choose k) = n * (n - 1 choose (k - 1))
[PROOF STEP]
by (auto split: nat_diff_split)


[STATEMENT]
lemma dist_of_complex [simp]: "dist (of_complex x :: 'a) (of_complex y) = dist x y"
  for a :: "'a::complex_normed_div_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (of_complex x) (of_complex y) = dist x y
[PROOF STEP]
by (metis dist_norm norm_of_complex of_complex_diff)


[STATEMENT]
theorem mint_corr:assumes "invar_vebt t n" and "vebt_mint t = Some x" shows "min_in_set (set_vebt' t) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_in_set (set_vebt' t) x
[PROOF STEP]
using assms(1) assms(2) min_in_set_def mint_corr_help mint_member set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
invar_vebt t n
vebt_mint t = Some x
min_in_set ?xs ?x = (?x \<in> ?xs \<and> (\<forall>y\<in>?xs. ?x \<le> y))
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?mini; vebt_member ?t ?x\<rbrakk> \<Longrightarrow> ?mini \<le> ?x
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?maxi\<rbrakk> \<Longrightarrow> vebt_member ?t ?maxi
set_vebt' ?t = {x. vebt_member ?t x}

goal (1 subgoal):
 1. min_in_set (set_vebt' t) x
[PROOF STEP]
by auto


[STATEMENT]
lemma powr_bigtheta_iff:
  assumes "filterlim g at_top F" "F \<noteq> bot"
  shows   "(\<lambda>x. g x powr p :: real) \<in> \<Theta>[F](\<lambda>x. g x powr q) \<longleftrightarrow> p = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g x powr p) \<in> \<Theta>[F](\<lambda>x. g x powr q)) = (p = q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
filterlim g at_top F
F \<noteq> bot

goal (1 subgoal):
 1. ((\<lambda>x. g x powr p) \<in> \<Theta>[F](\<lambda>x. g x powr q)) = (p = q)
[PROOF STEP]
unfolding bigtheta_def
[PROOF STATE]
proof (prove)
using this:
filterlim g at_top F
F \<noteq> bot

goal (1 subgoal):
 1. ((\<lambda>x. g x powr p) \<in> O[F](\<lambda>x. g x powr q) \<inter> \<Omega>[F](\<lambda>x. g x powr q)) = (p = q)
[PROOF STEP]
by (auto simp: bigomega_iff_bigo powr_bigo_iff)


[STATEMENT]
lemma set_trace_conv:
 "\<And>i. set(trace d i xs) =
  (if xs=[] then {} else insert(deltas d xs i)(set(butlast(trace d i xs))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. set (trace d i xs) = (if xs = [] then {} else insert (deltas d xs i) (set (butlast (trace d i xs))))
[PROOF STEP]
apply (induct "xs")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. set (trace d i []) = (if [] = [] then {} else insert (deltas d [] i) (set (butlast (trace d i []))))
 2. \<And>a xs i. (\<And>i. set (trace d i xs) = (if xs = [] then {} else insert (deltas d xs i) (set (butlast (trace d i xs))))) \<Longrightarrow> set (trace d i (a # xs)) = (if a # xs = [] then {} else insert (deltas d (a # xs) i) (set (butlast (trace d i (a # xs)))))
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i. (\<And>i. set (trace d i xs) = (if xs = [] then {} else insert (deltas d xs i) (set (butlast (trace d i xs))))) \<Longrightarrow> set (trace d i (a # xs)) = (if a # xs = [] then {} else insert (deltas d (a # xs) i) (set (butlast (trace d i (a # xs)))))
[PROOF STEP]
apply (simp add: insert_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Join_assoc: "(F\<squnion>G)\<squnion>H = F\<squnion>(G\<squnion>H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<squnion> G \<squnion> H = F \<squnion> (G \<squnion> H)
[PROOF STEP]
by (simp add: Un_ac Join_def Int_assoc insert_absorb)


[STATEMENT]
lemma lsc_at_mem:
  assumes "lsc_at x0 f"
  assumes "x \<longlonglongrightarrow> x0"
  assumes "(f \<circ> x) \<longlonglongrightarrow> A"
  shows "f x0 \<le> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x0 \<le> A
[PROOF STEP]
using assms lsc_at_def[of x0 f]
[PROOF STATE]
proof (prove)
using this:
lsc_at x0 f
x \<longlonglongrightarrow> x0
(f \<circ> x) \<longlonglongrightarrow> A
lsc_at x0 f = (\<forall>X l. X \<longlonglongrightarrow> x0 \<and> (f \<circ> X) \<longlonglongrightarrow> l \<longrightarrow> f x0 \<le> l)

goal (1 subgoal):
 1. f x0 \<le> A
[PROOF STEP]
by blast


[STATEMENT]
lemma gauss_norm_ultrametric':
  assumes "f \<in> carrier (UP Q\<^sub>p)"
  assumes "g \<in> carrier (UP Q\<^sub>p)"
  shows "gauss_norm (f \<ominus>\<^bsub>UP Q\<^sub>p\<^esub> g) \<ge> min (gauss_norm f) (gauss_norm g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (gauss_norm f) (gauss_norm g) \<le> gauss_norm (f \<ominus>\<^bsub>UP Q\<^sub>p\<^esub> g)
[PROOF STEP]
unfolding a_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (gauss_norm f) (gauss_norm g) \<le> gauss_norm (f \<oplus>\<^bsub>UP Q\<^sub>p\<^esub> \<ominus>\<^bsub>UP Q\<^sub>p\<^esub> g)
[PROOF STEP]
using assms gauss_norm_a_inv[of g] gauss_norm_ultrametric
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (UP Q\<^sub>p)
g \<in> carrier (UP Q\<^sub>p)
g \<in> carrier (UP Q\<^sub>p) \<Longrightarrow> gauss_norm (\<ominus>\<^bsub>UP Q\<^sub>p\<^esub> g) = gauss_norm g
\<lbrakk>?g \<in> carrier (UP Q\<^sub>p); ?h \<in> carrier (UP Q\<^sub>p)\<rbrakk> \<Longrightarrow> min (gauss_norm ?g) (gauss_norm ?h) \<le> gauss_norm (?g \<oplus>\<^bsub>UP Q\<^sub>p\<^esub> ?h)

goal (1 subgoal):
 1. min (gauss_norm f) (gauss_norm g) \<le> gauss_norm (f \<oplus>\<^bsub>UP Q\<^sub>p\<^esub> \<ominus>\<^bsub>UP Q\<^sub>p\<^esub> g)
[PROOF STEP]
by (metis UPQ.UP_a_inv_closed)


[STATEMENT]
lemma rtrancl_mono_proof[mono]:
  "(\<And>a b. x a b \<longrightarrow> y a b) \<Longrightarrow> rtranclp x a b \<longrightarrow> rtranclp y a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. x a b \<longrightarrow> y a b) \<Longrightarrow> x\<^sup>*\<^sup>* a b \<longrightarrow> y\<^sup>*\<^sup>* a b
[PROOF STEP]
apply (rule impI, rotate_tac, induct rule: rtranclp.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. (\<And>a b. x a b \<longrightarrow> y a b) \<Longrightarrow> y\<^sup>*\<^sup>* a a
 2. \<And>a b c. \<lbrakk>x\<^sup>*\<^sup>* a b; (\<And>a b. x a b \<longrightarrow> y a b) \<Longrightarrow> y\<^sup>*\<^sup>* a b; x b c; \<And>a b. x a b \<longrightarrow> y a b\<rbrakk> \<Longrightarrow> y\<^sup>*\<^sup>* a c
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>x\<^sup>*\<^sup>* a b; y\<^sup>*\<^sup>* a b; x b c; \<And>a b. x a b \<longrightarrow> y a b\<rbrakk> \<Longrightarrow> y\<^sup>*\<^sup>* a c
[PROOF STEP]
apply (metis rtranclp.intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma down_chain_reaches_empty:
  assumes "finite (UNIV :: 'a set)" and "mono (\<tau> :: 'a set \<Rightarrow> 'a set)"
   and "(\<forall>i :: nat. ((\<tau> :: 'a set \<Rightarrow> 'a set) ^^ (i + (1 :: nat))) UNIV \<subset> (\<tau> ^^ i) UNIV)"
 shows "\<exists> (j :: nat). (\<tau> ^^ j) UNIV = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. (\<tau> ^^ j) UNIV = {}
[PROOF STEP]
using UNIV_tau_i_is_empty assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite UNIV; mono ?\<tau>; \<forall>i. (?\<tau> ^^ (i + 1)) UNIV \<subset> (?\<tau> ^^ i) UNIV\<rbrakk> \<Longrightarrow> (?\<tau> ^^ card UNIV) UNIV = {}
finite UNIV
mono \<tau>
\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV

goal (1 subgoal):
 1. \<exists>j. (\<tau> ^^ j) UNIV = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma e2ennreal_finite_sum:
  shows "finite I \<Longrightarrow> (\<And>i. i\<in> I \<Longrightarrow> 0 \<le> ((A i)::ereal)) \<Longrightarrow>
(\<Sum> i\<in> I. e2ennreal (A i)) = e2ennreal (\<Sum>i\<in> I. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>I. e2ennreal (A i)) = e2ennreal (sum A I)
[PROOF STEP]
proof (induct rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>{}. e2ennreal (A i)) = e2ennreal (sum A {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?i \<in> {} \<Longrightarrow> 0 \<le> A ?i

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>{}. e2ennreal (A i)) = e2ennreal (sum A {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> {} \<Longrightarrow> 0 \<le> A ?i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i \<in> {} \<Longrightarrow> 0 \<le> A ?i

goal (1 subgoal):
 1. (\<Sum>i\<in>{}. e2ennreal (A i)) = e2ennreal (sum A {})
[PROOF STEP]
by (simp add: zero_ennreal.abs_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{}. e2ennreal (A i)) = e2ennreal (sum A {})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F)
?i \<in> insert x F \<Longrightarrow> 0 \<le> A ?i

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
hence "(\<Sum> i\<in> (insert x F). e2ennreal (A i)) = e2ennreal (A x) + (\<Sum> i\<in> F. e2ennreal (A i))"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F)
?i \<in> insert x F \<Longrightarrow> 0 \<le> A ?i

goal (1 subgoal):
 1. (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (A x) + (\<Sum>i\<in>F. e2ennreal (A i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (A x) + (\<Sum>i\<in>F. e2ennreal (A i))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (A x) + (\<Sum>i\<in>F. e2ennreal (A i))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
have "... = e2ennreal (A x) + e2ennreal (\<Sum>i\<in> F. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e2ennreal (A x) + (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (A x) + e2ennreal (sum A F)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F)
?i \<in> insert x F \<Longrightarrow> 0 \<le> A ?i

goal (1 subgoal):
 1. e2ennreal (A x) + (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (A x) + e2ennreal (sum A F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e2ennreal (A x) + (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (A x) + e2ennreal (sum A F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
e2ennreal (A x) + (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (A x) + e2ennreal (sum A F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
have "... = e2ennreal (A x + (\<Sum>i\<in> F. A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e2ennreal (A x) + e2ennreal (sum A F) = e2ennreal (A x + sum A F)
[PROOF STEP]
proof (rule e2ennreal_add[symmetric])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> A x
 2. 0 \<le> sum A F
[PROOF STEP]
show "0 \<le> A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> A x
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F)
?i \<in> insert x F \<Longrightarrow> 0 \<le> A ?i

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

goal (1 subgoal):
 1. 0 \<le> sum A F
[PROOF STEP]
show "0 \<le> sum A F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sum A F
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F)
?i \<in> insert x F \<Longrightarrow> 0 \<le> A ?i

goal (1 subgoal):
 1. 0 \<le> sum A F
[PROOF STEP]
by (simp add: sum_nonneg)
[PROOF STATE]
proof (state)
this:
0 \<le> sum A F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
e2ennreal (A x) + e2ennreal (sum A F) = e2ennreal (A x + sum A F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
e2ennreal (A x) + e2ennreal (sum A F) = e2ennreal (A x + sum A F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
have "... = e2ennreal (\<Sum>i\<in> insert x F. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e2ennreal (A x + sum A F) = e2ennreal (sum A (insert x F))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F)
?i \<in> insert x F \<Longrightarrow> 0 \<le> A ?i

goal (1 subgoal):
 1. e2ennreal (A x + sum A F) = e2ennreal (sum A (insert x F))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e2ennreal (A x + sum A F) = e2ennreal (sum A (insert x F))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> A i) \<Longrightarrow> (\<Sum>i\<in>F. e2ennreal (A i)) = e2ennreal (sum A F); \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> A i\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))

goal (1 subgoal):
 1. (\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>insert x F. e2ennreal (A i)) = e2ennreal (sum A (insert x F))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_gcd_some_gcdI:
    assumes "\<exists>x. is_gcd x a b" shows "is_gcd (some_gcd a b) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_gcd (some_gcd a b) a b
[PROOF STEP]
by (unfold some_gcd_def, rule someI_ex[OF assms])


[STATEMENT]
lemma rel_interior_ball:
  "rel_interior S = {x \<in> S. \<exists>e. e > 0 \<and> ball x e \<inter> affine hull S \<subseteq> S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior S = {x \<in> S. \<exists>e>0. ball x e \<inter> affine hull S \<subseteq> S}
[PROOF STEP]
using mem_rel_interior_ball [of _ S]
[PROOF STATE]
proof (prove)
using this:
(?x \<in> rel_interior S) = (?x \<in> S \<and> (\<exists>e>0. ball ?x e \<inter> affine hull S \<subseteq> S))

goal (1 subgoal):
 1. rel_interior S = {x \<in> S. \<exists>e>0. ball x e \<inter> affine hull S \<subseteq> S}
[PROOF STEP]
by auto


[STATEMENT]
lemma "continuous_on UNIV stereographic"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV stereographic
[PROOF STEP]
unfolding continuous_on_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>UNIV. dist x' x < d \<longrightarrow> dist (stereographic x') (stereographic x) < e
[PROOF STEP]
unfolding dist_complex_homo_def dist_riemann_sphere_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>UNIV. dist_riemann_sphere' x' x < d \<longrightarrow> dist_fs (stereographic x') (stereographic x) < e
[PROOF STEP]
by (subst dist_stereographic', auto)


[STATEMENT]
lemma varsAppendValuation:
  fixes valuation1 :: Valuation and valuation2 :: Valuation
  shows "vars (valuation1 @ valuation2) = vars valuation1 \<union> vars valuation2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (valuation1 @ valuation2) = vars valuation1 \<union> vars valuation2
[PROOF STEP]
by (induct valuation1) auto


[STATEMENT]
lemma map_list_append_append: "\<And>xs1 .
  length fs1 = length xs1 \<Longrightarrow>
  map_list (fs1 @ fs2) (xs1 @ xs2) =
  map_list fs1 xs1 @
  map_list fs2 xs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs1. length fs1 = length xs1 \<Longrightarrow> map_list (fs1 @ fs2) (xs1 @ xs2) = map_list fs1 xs1 @ map_list fs2 xs2
[PROOF STEP]
apply (induct fs1, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a fs1 xs1. \<lbrakk>\<And>xs1. length fs1 = length xs1 \<Longrightarrow> map_list (fs1 @ fs2) (xs1 @ xs2) = map_list fs1 xs1 @ map_list fs2 xs2; Suc (length fs1) = length xs1\<rbrakk> \<Longrightarrow> a (hd (xs1 @ xs2)) = a (hd xs1) \<and> map_list (fs1 @ fs2) (tl (xs1 @ xs2)) = map_list fs1 (tl xs1) @ map_list fs2 xs2
[PROOF STEP]
apply (case_tac "xs1", simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fps_of_poly_diff: "fps_of_poly (p - q) = fps_of_poly p - fps_of_poly q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (p - q) = fps_of_poly p - fps_of_poly q
[PROOF STEP]
by (simp add: fps_of_poly_def minus_poly.rep_eq fps_minus_def)


[STATEMENT]
lemma Arctan_0 [simp]: "Arctan 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arctan 0 = 0
[PROOF STEP]
by (simp add: Arctan_def)


[STATEMENT]
lemma finite_sum_le_has_sum:
  fixes f :: "'a \<Rightarrow> 'b::{topological_ab_group_add, ordered_comm_monoid_add,linorder_topology}"
  assumes "has_sum f A S" "finite B" "B \<subseteq> A"
  assumes "\<And>x. x \<in> A - B \<Longrightarrow> f x \<ge> 0"
  shows   "sum f B \<le> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f B \<le> S
[PROOF STEP]
proof (rule has_sum_mono2)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. has_sum ?f ?A (sum f B)
 2. has_sum ?f ?B S
 3. ?A \<subseteq> ?B
 4. \<And>x. x \<in> ?B - ?A \<Longrightarrow> (0::'b) \<le> ?f x
[PROOF STEP]
show "has_sum f A S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum f A S
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
has_sum f A S

goal (3 subgoals):
 1. has_sum f ?A (sum f B)
 2. ?A \<subseteq> A
 3. \<And>x. x \<in> A - ?A \<Longrightarrow> (0::'b) \<le> f x
[PROOF STEP]
show "has_sum f B (sum f B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum f B (sum f B)
[PROOF STEP]
by (rule has_sum_finite) fact+
[PROOF STATE]
proof (state)
this:
has_sum f B (sum f B)

goal (2 subgoals):
 1. B \<subseteq> A
 2. \<And>x. x \<in> A - B \<Longrightarrow> (0::'b) \<le> f x
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma integrable_reflect_real[simp]:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  shows "integrable (lebesgue_on {-b..-a}) (\<lambda>x. f(-x)) \<longleftrightarrow> integrable (lebesgue_on {a..b}) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {- b..- a}) (\<lambda>x. f (- x)) = integrable (lebesgue_on {a..b}) f
[PROOF STEP]
by (metis has_bochner_integral_iff has_bochner_integral_reflect_real)


[STATEMENT]
lemma suminf_eq_SUP: "suminf f = (SUP n. \<Sum>i<n. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf f = (SUP n. sum f {..<n})
[PROOF STEP]
using sums_SUP
[PROOF STATE]
proof (prove)
using this:
f sums (SUP n. sum f {..<n})

goal (1 subgoal):
 1. suminf f = (SUP n. sum f {..<n})
[PROOF STEP]
by (rule sums_unique[symmetric])


[STATEMENT]
lemma path_connected_not_frontier_subset:
  fixes S :: "'a::real_normed_vector set"
  assumes "path_connected S"
  assumes "S \<inter> T \<noteq> {}"
  assumes "S \<inter> frontier T = {}"
  shows "S \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> T
[PROOF STEP]
using path_connected_frontier assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path_connected ?S; ?S \<inter> ?T \<noteq> {}; ?S \<inter> - ?T \<noteq> {}; \<And>s. \<lbrakk>s \<in> ?S; s \<in> frontier ?T\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
path_connected S
S \<inter> T \<noteq> {}
S \<inter> frontier T = {}

goal (1 subgoal):
 1. S \<subseteq> T
[PROOF STEP]
by auto


[STATEMENT]
lemma l2product_rdiff:
   "\<lbrakk>f square_integrable S; g square_integrable S; h square_integrable S\<rbrakk>
    \<Longrightarrow> l2product S f(\<lambda>x. g x - h x) = l2product S f g - l2product S f h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f square_integrable S; g square_integrable S; h square_integrable S\<rbrakk> \<Longrightarrow> l2product S f (\<lambda>x. g x - h x) = l2product S f g - l2product S f h
[PROOF STEP]
by (simp add: l2product_def algebra_simps square_integrable_imp_integrable_product)


[STATEMENT]
lemma relInvImage_Gr: "\<lbrakk>R \<subseteq> B \<times> B\<rbrakk> \<Longrightarrow> relInvImage A R f = Gr A f O R O (Gr A f)\<inverse>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<subseteq> B \<times> B \<Longrightarrow> relInvImage A R f = Gr A f O R O (Gr A f)\<inverse>
[PROOF STEP]
unfolding Gr_def relcomp_def image_def relInvImage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<subseteq> B \<times> B \<Longrightarrow> {(a1, a2) |a1 a2. a1 \<in> A \<and> a2 \<in> A \<and> (f a1, f a2) \<in> R} = {(x, y). ((\<lambda>x xa. (x, xa) \<in> {(a, f a) |a. a \<in> A}) OO (\<lambda>x xa. (x, xa) \<in> {(x, y). ((\<lambda>x xa. (x, xa) \<in> R) OO (\<lambda>x xa. (x, xa) \<in> {(a, f a) |a. a \<in> A}\<inverse>)) x y})) x y}
[PROOF STEP]
by auto


[STATEMENT]
lemma preorder_reflect: "preorder (reflect t) = rev (postorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preorder (reflect t) = rev (postorder t)
[PROOF STEP]
apply (induct t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. preorder (reflect Lf) = rev (postorder Lf)
 2. \<And>x1 t1 t2. \<lbrakk>preorder (reflect t1) = rev (postorder t1); preorder (reflect t2) = rev (postorder t2)\<rbrakk> \<Longrightarrow> preorder (reflect (Br x1 t1 t2)) = rev (postorder (Br x1 t1 t2))
[PROOF STEP]
apply (metis Nil_is_rev_conv postorder.simps(1) preorder.simps(1)
              reflect.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>preorder (reflect t1) = rev (postorder t1); preorder (reflect t2) = rev (postorder t2)\<rbrakk> \<Longrightarrow> preorder (reflect (Br x1 t1 t2)) = rev (postorder (Br x1 t1 t2))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Union_connected_components_of:
   "\<Union>(connected_components_of X) = topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (connected_components_of X) = topspace X
[PROOF STEP]
unfolding connected_components_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (connected_component_of_set X ` topspace X) = topspace X
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (connected_component_of_set X ` topspace X) \<subseteq> topspace X
 2. topspace X \<subseteq> \<Union> (connected_component_of_set X ` topspace X)
[PROOF STEP]
apply (simp add: SUP_least connected_component_of_subset_topspace)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace X \<subseteq> \<Union> (connected_component_of_set X ` topspace X)
[PROOF STEP]
using connected_component_of_refl
[PROOF STATE]
proof (prove)
using this:
connected_component_of ?X ?x ?x = (?x \<in> topspace ?X)

goal (1 subgoal):
 1. topspace X \<subseteq> \<Union> (connected_component_of_set X ` topspace X)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Cauchy_Schwarz_complex_vec:
  fixes x y :: "complex vec"
  assumes "x \<in> carrier_vec n" and "y \<in> carrier_vec n"
  shows "inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
define cnj_a where "cnj_a = - (inner_prod x y)/ cnj (inner_prod y y)"
[PROOF STATE]
proof (state)
this:
cnj_a = - inner_prod x y / cnj (inner_prod y y)

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
define a where "a = cnj (cnj_a)"
[PROOF STATE]
proof (state)
this:
a = cnj cnj_a

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
have cnj_rw: "(cnj a) = cnj_a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj a = cnj_a
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (cnj cnj_a) = cnj_a
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
cnj a = cnj_a

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
have rw_0: "cnj (inner_prod x y) + a * (inner_prod y y) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (inner_prod x y) + a * inner_prod y y = 0
[PROOF STEP]
unfolding a_def cnj_a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (inner_prod x y) + cnj (- inner_prod x y / cnj (inner_prod y y)) * inner_prod y y = 0
[PROOF STEP]
using assms(1) assms(2) conjugate_square_eq_0_vec
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n
y \<in> carrier_vec n
?v \<in> carrier_vec ?n \<Longrightarrow> (inner_prod ?v ?v = (0::?'a)) = (?v = 0\<^sub>v ?n)

goal (1 subgoal):
 1. cnj (inner_prod x y) + cnj (- inner_prod x y / cnj (inner_prod y y)) * inner_prod y y = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
cnj (inner_prod x y) + a * inner_prod y y = 0

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
have "0 \<le>  (inner_prod x x + a * (inner_prod x y) + (cnj a) * ((cnj (inner_prod x y)) + a * (inner_prod y y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
using aux_Cauchy assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier_vec ?n; ?y \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> 0 \<le> inner_prod ?x ?x + ?a * inner_prod ?x ?y + cnj ?a * (cnj (inner_prod ?x ?y) + ?a * inner_prod ?y ?y)
x \<in> carrier_vec n
y \<in> carrier_vec n

goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
have "\<dots> =  (inner_prod x x + a * (inner_prod x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y) = inner_prod x x + a * inner_prod x y
[PROOF STEP]
unfolding rw_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod x x + a * inner_prod x y + cnj a * 0 = inner_prod x x + a * inner_prod x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y) = inner_prod x x + a * inner_prod x y

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y) = inner_prod x x + a * inner_prod x y

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
have "\<dots> =  (inner_prod x x - (inner_prod x y) * cnj (inner_prod x y) / (inner_prod y y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod x x + a * inner_prod x y = inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y
[PROOF STEP]
unfolding a_def cnj_a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod x x + cnj (- inner_prod x y / cnj (inner_prod y y)) * inner_prod x y = inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inner_prod x x + a * inner_prod x y = inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y
[PROOF STEP]
have " 0 \<le>  (inner_prod x x - (inner_prod x y) * cnj (inner_prod x y) / (inner_prod y y)) "
[PROOF STATE]
proof (prove)
using this:
0 \<le> inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y

goal (1 subgoal):
 1. 0 \<le> inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
hence "0 \<le> (inner_prod x x - (inner_prod x y) * cnj (inner_prod x y) / (inner_prod y y)) * (inner_prod y y)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y

goal (1 subgoal):
 1. 0 \<le> (inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y) * inner_prod y y
[PROOF STEP]
by (auto simp: less_eq_complex_def)
[PROOF STATE]
proof (state)
this:
0 \<le> (inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y) * inner_prod y y

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> (inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y) * inner_prod y y

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
have "\<dots> = ((inner_prod x x)*(inner_prod y y) - (inner_prod x y) * cnj (inner_prod x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y) * inner_prod y y = inner_prod x x * inner_prod y y - inner_prod x y * cnj (inner_prod x y)
[PROOF STEP]
by (smt add.inverse_neutral add_diff_cancel diff_0 diff_divide_eq_iff divide_cancel_right mult_eq_0_iff nonzero_mult_div_cancel_right rw_0)
[PROOF STATE]
proof (state)
this:
(inner_prod x x - inner_prod x y * cnj (inner_prod x y) / inner_prod y y) * inner_prod y y = inner_prod x x * inner_prod y y - inner_prod x y * cnj (inner_prod x y)

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> inner_prod x x * inner_prod y y - inner_prod x y * cnj (inner_prod x y)
[PROOF STEP]
have "(inner_prod x y) * cnj (inner_prod x y) \<le> (inner_prod x x)*(inner_prod y y)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> inner_prod x x * inner_prod y y - inner_prod x y * cnj (inner_prod x y)

goal (1 subgoal):
 1. inner_prod x y * cnj (inner_prod x y) \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod x y * cnj (inner_prod x y) \<le> inner_prod x x * inner_prod y y

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

goal (1 subgoal):
 1. inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
apply (subst inner_prod_swap[of y n x])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inner_prod x y * cnj (inner_prod x y) \<le> inner_prod x x * inner_prod y y \<Longrightarrow> y \<in> carrier_vec n
 2. inner_prod x y * cnj (inner_prod x y) \<le> inner_prod x x * inner_prod y y \<Longrightarrow> x \<in> carrier_vec n
 3. inner_prod x y * cnj (inner_prod x y) \<le> inner_prod x x * inner_prod y y \<Longrightarrow> inner_prod x y * conjugate (inner_prod x y) \<le> inner_prod x x * inner_prod y y
[PROOF STEP]
by (auto simp add: assms)
[PROOF STATE]
proof (state)
this:
inner_prod x y * inner_prod y x \<le> inner_prod x x * inner_prod y y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma neg_numeral_le_floor [simp]: "- numeral v \<le> \<lfloor>x\<rfloor> \<longleftrightarrow> - numeral v \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- numeral v \<le> \<lfloor>x\<rfloor>) = (- numeral v \<le> x)
[PROOF STEP]
by (simp add: le_floor_iff)


[STATEMENT]
lemma equiv_partition_on:
  assumes P: "partition_on A P"
  shows "equiv A {(x, y). \<exists>p \<in> P. x \<in> p \<and> y \<in> p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv A {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
proof (rule equivI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. refl_on A {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
 2. sym {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
 3. trans {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
have "A = \<Union>P" "disjoint P" "{} \<notin> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = \<Union> P &&& disjoint P &&& {} \<notin> P
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
partition_on A P

goal (1 subgoal):
 1. A = \<Union> P &&& disjoint P &&& {} \<notin> P
[PROOF STEP]
by (auto simp: partition_on_def)
[PROOF STATE]
proof (state)
this:
A = \<Union> P
disjoint P
{} \<notin> P

goal (3 subgoals):
 1. refl_on A {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
 2. sym {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
 3. trans {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = \<Union> P
disjoint P
{} \<notin> P
[PROOF STEP]
show "refl_on A {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}"
[PROOF STATE]
proof (prove)
using this:
A = \<Union> P
disjoint P
{} \<notin> P

goal (1 subgoal):
 1. refl_on A {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
unfolding refl_on_def
[PROOF STATE]
proof (prove)
using this:
A = \<Union> P
disjoint P
{} \<notin> P

goal (1 subgoal):
 1. {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p} \<subseteq> A \<times> A \<and> (\<forall>x\<in>A. (x, x) \<in> {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
refl_on A {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}

goal (2 subgoals):
 1. sym {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
 2. trans {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
show "trans {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
using \<open>disjoint P\<close>
[PROOF STATE]
proof (prove)
using this:
disjoint P

goal (1 subgoal):
 1. trans {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
by (auto simp: trans_def disjoint_def)
[PROOF STATE]
proof (state)
this:
trans {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}

goal (1 subgoal):
 1. sym {(x, y). \<exists>p\<in>P. x \<in> p \<and> y \<in> p}
[PROOF STEP]
qed (auto simp: sym_def)


[STATEMENT]
lemma deriv_sum [simp]:
  "\<lbrakk>\<And>i. f i field_differentiable at z\<rbrakk>
   \<Longrightarrow> deriv (\<lambda>w. sum (\<lambda>i. f i w) S) z = sum (\<lambda>i. deriv (f i) z) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. f i field_differentiable at z) \<Longrightarrow> deriv (\<lambda>w. \<Sum>i\<in>S. f i w) z = (\<Sum>i\<in>S. deriv (f i) z)
[PROOF STEP]
unfolding DERIV_deriv_iff_field_differentiable[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. (f i has_field_derivative deriv (f i) z) (at z)) \<Longrightarrow> deriv (\<lambda>w. \<Sum>i\<in>S. f i w) z = (\<Sum>i\<in>S. deriv (f i) z)
[PROOF STEP]
by (auto intro!: DERIV_imp_deriv derivative_intros)


[STATEMENT]
lemma s2p_inter_hom: "s2p (A \<inter> B) = (s2p A) \<sqinter> (s2p B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s2p (A \<inter> B) = s2p A \<sqinter> s2p B
[PROOF STEP]
by (metis Collect_mem_eq comp_eq_dest_lhs id_apply inf_set_def sps)


[STATEMENT]
lemma matrix_vector_mul_linear[intro, simp]: "linear (\<lambda>x. A *v (x::'a::real_algebra_1 ^ _))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear ((*v) A)
[PROOF STEP]
by (simp add: linear_iff matrix_vector_mult_def vec_eq_iff field_simps sum_distrib_left
      sum.distrib scaleR_right.sum)


[STATEMENT]
lemma val_zero_imp_val_pow_zero:
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "val a = 0"
  shows "val (a[^](n::nat)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (a [^] n) = 0
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. val (a [^] 0) = 0
 2. \<And>n. val (a [^] n) = 0 \<Longrightarrow> val (a [^] Suc n) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
val a = 0

goal (2 subgoals):
 1. val (a [^] 0) = 0
 2. \<And>n. val (a [^] n) = 0 \<Longrightarrow> val (a [^] Suc n) = 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. val (a [^] n) = 0 \<Longrightarrow> val (a [^] Suc n) = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. val (a [^] n) = 0 \<Longrightarrow> val (a [^] Suc n) = 0
[PROOF STEP]
fix n ::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. val (a [^] n) = 0 \<Longrightarrow> val (a [^] Suc n) = 0
[PROOF STEP]
assume A: "val (a [^] n) = 0"
[PROOF STATE]
proof (state)
this:
val (a [^] n) = 0

goal (1 subgoal):
 1. \<And>n. val (a [^] n) = 0 \<Longrightarrow> val (a [^] Suc n) = 0
[PROOF STEP]
have 0: "a [^] Suc n = a [^] n \<otimes> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] Suc n = a [^] n \<otimes> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a [^] Suc n = a [^] n \<otimes> a

goal (1 subgoal):
 1. \<And>n. val (a [^] n) = 0 \<Longrightarrow> val (a [^] Suc n) = 0
[PROOF STEP]
show "val (a [^] Suc n) = 0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (a [^] Suc n) = 0
[PROOF STEP]
unfolding 0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (a [^] n \<otimes> a) = 0
[PROOF STEP]
using A assms
[PROOF STATE]
proof (prove)
using this:
val (a [^] n) = 0
a \<in> carrier Q\<^sub>p
val a = 0

goal (1 subgoal):
 1. val (a [^] n \<otimes> a) = 0
[PROOF STEP]
by (simp add: val_mult)
[PROOF STATE]
proof (state)
this:
val (a [^] Suc n) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma N_of_norm:
  "eNorm N_of_norm f = ennreal (norm f)"
  "Norm N_of_norm f = norm f"
  "defect (N_of_norm) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm N_of_norm f = ennreal (norm f) &&& Norm N_of_norm f = norm f &&& defect N_of_norm = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. eNorm N_of_norm f = ennreal (norm f)
 2. Norm N_of_norm f = norm f
 3. defect N_of_norm = 1
[PROOF STEP]
have *: "quasinorm_on UNIV 1 (\<lambda>f. norm f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quasinorm_on UNIV 1 (\<lambda>x. ennreal (norm x))
[PROOF STEP]
by (rule quasinorm_onI, auto simp add: ennreal_mult', metis ennreal_leI ennreal_plus norm_imp_pos_and_ge norm_triangle_ineq)
[PROOF STATE]
proof (state)
this:
quasinorm_on UNIV 1 (\<lambda>x. ennreal (norm x))

goal (3 subgoals):
 1. eNorm N_of_norm f = ennreal (norm f)
 2. Norm N_of_norm f = norm f
 3. defect N_of_norm = 1
[PROOF STEP]
show "eNorm N_of_norm f = ennreal (norm f)"
       "defect (N_of_norm) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm N_of_norm f = ennreal (norm f) &&& defect N_of_norm = 1
[PROOF STEP]
unfolding N_of_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm (quasinorm_of (case (1, norm) of (x, y) \<Rightarrow> (x, \<lambda>x. ennreal (y x)))) f = ennreal (norm f) &&& defect (quasinorm_of (case (1, norm) of (x, y) \<Rightarrow> (x, \<lambda>x. ennreal (y x)))) = 1
[PROOF STEP]
using quasinorm_of[OF *]
[PROOF STATE]
proof (prove)
using this:
eNorm (quasinorm_of (1, \<lambda>x. ennreal (norm x))) ?x = ennreal (norm ?x)
defect (quasinorm_of (1, \<lambda>x. ennreal (norm x))) = 1

goal (1 subgoal):
 1. eNorm (quasinorm_of (case (1, norm) of (x, y) \<Rightarrow> (x, \<lambda>x. ennreal (y x)))) f = ennreal (norm f) &&& defect (quasinorm_of (case (1, norm) of (x, y) \<Rightarrow> (x, \<lambda>x. ennreal (y x)))) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eNorm N_of_norm f = ennreal (norm f)
defect N_of_norm = 1

goal (1 subgoal):
 1. Norm N_of_norm f = norm f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eNorm N_of_norm f = ennreal (norm f)
defect N_of_norm = 1
[PROOF STEP]
show "Norm N_of_norm f = norm f"
[PROOF STATE]
proof (prove)
using this:
eNorm N_of_norm f = ennreal (norm f)
defect N_of_norm = 1

goal (1 subgoal):
 1. Norm N_of_norm f = norm f
[PROOF STEP]
unfolding Norm_def
[PROOF STATE]
proof (prove)
using this:
eNorm N_of_norm f = ennreal (norm f)
defect N_of_norm = 1

goal (1 subgoal):
 1. enn2real (eNorm N_of_norm f) = norm f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Norm N_of_norm f = norm f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_elem_multiplicity_mult_distrib:
  assumes "prime_elem p" "x \<noteq> 0" "y \<noteq> 0"
  shows   "multiplicity p (x * y) = multiplicity p x + multiplicity p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
have "multiplicity p (x * y) = count (prime_factorization (x * y)) (normalize p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (x * y) = count (prime_factorization (x * y)) (normalize p)
[PROOF STEP]
by (subst count_prime_factorization_prime) (simp_all add: assms)
[PROOF STATE]
proof (state)
this:
multiplicity p (x * y) = count (prime_factorization (x * y)) (normalize p)

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p (x * y) = count (prime_factorization (x * y)) (normalize p)

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prime_elem p
x \<noteq> (0::'a)
y \<noteq> (0::'a)
[PROOF STEP]
have "prime_factorization (x * y) = prime_factorization x + prime_factorization y"
[PROOF STATE]
proof (prove)
using this:
prime_elem p
x \<noteq> (0::'a)
y \<noteq> (0::'a)

goal (1 subgoal):
 1. prime_factorization (x * y) = prime_factorization x + prime_factorization y
[PROOF STEP]
by (intro prime_factorization_mult)
[PROOF STATE]
proof (state)
this:
prime_factorization (x * y) = prime_factorization x + prime_factorization y

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factorization (x * y) = prime_factorization x + prime_factorization y

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
have "count \<dots> (normalize p) =
    count (prime_factorization x) (normalize p) + count (prime_factorization y) (normalize p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (prime_factorization x + prime_factorization y) (normalize p) = count (prime_factorization x) (normalize p) + count (prime_factorization y) (normalize p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count (prime_factorization x + prime_factorization y) (normalize p) = count (prime_factorization x) (normalize p) + count (prime_factorization y) (normalize p)

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count (prime_factorization x + prime_factorization y) (normalize p) = count (prime_factorization x) (normalize p) + count (prime_factorization y) (normalize p)

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
have "\<dots> = multiplicity p x + multiplicity p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (prime_factorization x) (normalize p) + count (prime_factorization y) (normalize p) = multiplicity p x + multiplicity p y
[PROOF STEP]
by (subst (1 2) count_prime_factorization_prime) (simp_all add: assms)
[PROOF STATE]
proof (state)
this:
count (prime_factorization x) (normalize p) + count (prime_factorization y) (normalize p) = multiplicity p x + multiplicity p y

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
multiplicity p (x * y) = multiplicity p x + multiplicity p y

goal (1 subgoal):
 1. multiplicity p (x * y) = multiplicity p x + multiplicity p y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
multiplicity p (x * y) = multiplicity p x + multiplicity p y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_of_eucl_eq_iff:
  "list_of_eucl (x::'a::executable_euclidean_space) = list_of_eucl (y::'b::executable_euclidean_space) \<longleftrightarrow>
  (DIM('a) = DIM('b) \<and> (\<forall>i < DIM('b). x \<bullet> Basis_list ! i = y \<bullet> Basis_list ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (list_of_eucl x = list_of_eucl y) = (DIM('a) = DIM('b) \<and> (\<forall>i<DIM('b). x \<bullet> Basis_list ! i = y \<bullet> Basis_list ! i))
[PROOF STEP]
by (auto simp: list_eq_iff_nth_eq)


[STATEMENT]
lemma union_eq_subsetD: "A \<union> B = C \<Longrightarrow> A \<union> B \<subseteq> C \<and>  C \<subseteq> A \<union> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> B = C \<Longrightarrow> A \<union> B \<subseteq> C \<and> C \<subseteq> A \<union> B
[PROOF STEP]
by auto


[STATEMENT]
lemma vector_fraction_eq_iff [vector_add_divide_simps]:
  fixes x :: "'a :: real_vector"
  shows "((u / v) *\<^sub>R a = x) \<longleftrightarrow> (if v=0 then x = 0 else u *\<^sub>R a = v *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((u / v) *\<^sub>R a = x) = (if v = 0 then x = (0::'a) else u *\<^sub>R a = v *\<^sub>R x)
[PROOF STEP]
by (metis eq_vector_fraction_iff)


[STATEMENT]
lemma (in group) lcos_m_assoc:
  "\<lbrakk> M \<subseteq> carrier G; g \<in> carrier G; h \<in> carrier G \<rbrakk> \<Longrightarrow> g <# (h <# M) = (g \<otimes> h) <# M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M \<subseteq> carrier G; g \<in> carrier G; h \<in> carrier G\<rbrakk> \<Longrightarrow> g <# (h <# M) = g \<otimes> h <# M
[PROOF STEP]
by (force simp add: l_coset_def m_assoc)


[STATEMENT]
lemma union_lclss_of_state[simp]:
  "lclss_of_state (N1, P1, Q1) \<union> lclss_of_state (N2, P2, Q2) =
   lclss_of_state (N1 \<union> N2, P1 \<union> P2, Q1 \<union> Q2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lclss_of_state (N1, P1, Q1) \<union> lclss_of_state (N2, P2, Q2) = lclss_of_state (N1 \<union> N2, P1 \<union> P2, Q1 \<union> Q2)
[PROOF STEP]
unfolding lclss_of_state_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>C. (C, New)) ` N_of_state (N1, P1, Q1) \<union> (\<lambda>C. (C, Processed)) ` P_of_state (N1, P1, Q1) \<union> (\<lambda>C. (C, Old)) ` Q_of_state (N1, P1, Q1) \<union> ((\<lambda>C. (C, New)) ` N_of_state (N2, P2, Q2) \<union> (\<lambda>C. (C, Processed)) ` P_of_state (N2, P2, Q2) \<union> (\<lambda>C. (C, Old)) ` Q_of_state (N2, P2, Q2)) = (\<lambda>C. (C, New)) ` N_of_state (N1 \<union> N2, P1 \<union> P2, Q1 \<union> Q2) \<union> (\<lambda>C. (C, Processed)) ` P_of_state (N1 \<union> N2, P1 \<union> P2, Q1 \<union> Q2) \<union> (\<lambda>C. (C, Old)) ` Q_of_state (N1 \<union> N2, P1 \<union> P2, Q1 \<union> Q2)
[PROOF STEP]
by auto


[STATEMENT]
lemma of_nat_dvd_imp_dvd_gauss_cnj:
  fixes z :: gauss_int
  assumes "of_nat n dvd z"
  shows   "of_nat n dvd gauss_cnj z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n dvd gauss_cnj z
[PROOF STEP]
using of_int_dvd_imp_dvd_gauss_cnj[of "int n"] assms
[PROOF STATE]
proof (prove)
using this:
of_int (int n) dvd ?z \<Longrightarrow> of_int (int n) dvd gauss_cnj ?z
of_nat n dvd z

goal (1 subgoal):
 1. of_nat n dvd gauss_cnj z
[PROOF STEP]
by simp


[STATEMENT]
lemma mk_poly2:
  fixes A :: "'a :: comm_semiring_1 mat"
  assumes i: "i < dim_row A"
      and c: "dim_col A > 0"
  shows "mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i,j')) (dim_col A - Suc  j'))"
    (is "?l = sum ?f ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
define l where "l = dim_col A - 1"
[PROOF STATE]
proof (state)
this:
l = dim_col A - 1

goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
have dim: "dim_col A = Suc l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col A = Suc l
[PROOF STEP]
unfolding l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col A = Suc (dim_col A - 1)
[PROOF STEP]
using i c
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
0 < dim_col A

goal (1 subgoal):
 1. dim_col A = Suc (dim_col A - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_col A = Suc l

goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
let ?g = "\<lambda>j. l - j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
have "?l = sum (?f \<circ> ?g) ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_poly2 A $ i = sum ((\<lambda>j'. monom (A $$ (i, j')) (dim_col A - Suc j')) \<circ> (-) l) {..<dim_col A}
[PROOF STEP]
unfolding l_def mk_poly2_pre[OF i]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j'<dim_col A. monom (A $$ (i, dim_col A - Suc j')) j') = sum ((\<lambda>j'. monom (A $$ (i, j')) (dim_col A - Suc j')) \<circ> (-) (dim_col A - 1)) {..<dim_col A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mk_poly2 A $ i = sum ((\<lambda>j'. monom (A $$ (i, j')) (dim_col A - Suc j')) \<circ> (-) l) {..<dim_col A}

goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mk_poly2 A $ i = sum ((\<lambda>j'. monom (A $$ (i, j')) (dim_col A - Suc j')) \<circ> (-) l) {..<dim_col A}

goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
have "... = sum ?f ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((\<lambda>j'. monom (A $$ (i, j')) (dim_col A - Suc j')) \<circ> (-) l) {..<dim_col A} = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
unfolding dim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((\<lambda>j'. monom (A $$ (i, j')) (Suc l - Suc j')) \<circ> (-) l) {..<Suc l} = (\<Sum>j'<Suc l. monom (A $$ (i, j')) (Suc l - Suc j'))
[PROOF STEP]
unfolding lessThan_Suc_atMost
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((\<lambda>j'. monom (A $$ (i, j')) (Suc l - Suc j')) \<circ> (-) l) {..l} = (\<Sum>j'\<le>l. monom (A $$ (i, j')) (Suc l - Suc j'))
[PROOF STEP]
using sum.reindex[OF inj_on_diff_nat2,symmetric,unfolded image_diff_atMost]
[PROOF STATE]
proof (prove)
using this:
sum (?g \<circ> (-) ?n) {..?n} = sum ?g {..?n}

goal (1 subgoal):
 1. sum ((\<lambda>j'. monom (A $$ (i, j')) (Suc l - Suc j')) \<circ> (-) l) {..l} = (\<Sum>j'\<le>l. monom (A $$ (i, j')) (Suc l - Suc j'))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum ((\<lambda>j'. monom (A $$ (i, j')) (dim_col A - Suc j')) \<circ> (-) l) {..<dim_col A} = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))

goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))

goal (1 subgoal):
 1. mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mk_poly2 A $ i = (\<Sum>j'<dim_col A. monom (A $$ (i, j')) (dim_col A - Suc j'))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma valid_path_poly_linepath:
  fixes a b::"'a::real_normed_field"
  shows "valid_path (poly p o linepath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (poly p \<circ> linepath a b)
[PROOF STEP]
proof (rule valid_path_compose)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. valid_path (linepath a b)
 2. \<And>x. x \<in> path_image (linepath a b) \<Longrightarrow> poly p field_differentiable at x
 3. continuous_on (path_image (linepath a b)) (deriv (poly p))
[PROOF STEP]
show "valid_path (linepath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (linepath a b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
valid_path (linepath a b)

goal (2 subgoals):
 1. \<And>x. x \<in> path_image (linepath a b) \<Longrightarrow> poly p field_differentiable at x
 2. continuous_on (path_image (linepath a b)) (deriv (poly p))
[PROOF STEP]
show "\<And>x. x \<in> path_image (linepath a b) \<Longrightarrow> poly p field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> path_image (linepath a b) \<Longrightarrow> poly p field_differentiable at x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x \<in> path_image (linepath a b) \<Longrightarrow> poly p field_differentiable at ?x

goal (1 subgoal):
 1. continuous_on (path_image (linepath a b)) (deriv (poly p))
[PROOF STEP]
show "continuous_on (path_image (linepath a b)) (deriv (poly p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image (linepath a b)) (deriv (poly p))
[PROOF STEP]
unfolding deriv_pderiv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image (linepath a b)) (poly (pderiv p))
[PROOF STEP]
by (auto intro:continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on (path_image (linepath a b)) (deriv (poly p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_norm_zero_cancel: "((\<lambda>x. norm (f x)) \<longlongrightarrow> 0) F \<Longrightarrow> (f \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. norm (f x)) \<longlongrightarrow> 0) F \<Longrightarrow> (f \<longlongrightarrow> (0::'b)) F
[PROOF STEP]
unfolding tendsto_iff dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<forall>\<^sub>F x in F. norm (norm (f x) - 0) < e \<Longrightarrow> \<forall>e>0. \<forall>\<^sub>F x in F. norm (f x - (0::'b)) < e
[PROOF STEP]
by simp


[STATEMENT]
lemma ell2_norm_square: \<open>(ell2_norm x)\<^sup>2 = (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ell2_norm x)\<^sup>2 = (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2)
[PROOF STEP]
unfolding ell2_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sqrt (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2))\<^sup>2 = (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2)
[PROOF STEP]
apply (subst real_sqrt_pow2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2)
 2. (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2) = (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2)
[PROOF STEP]
by (simp_all add: infsum_nonneg)


[STATEMENT]
lemma
  fixes x :: "'a :: {field_char_0, field_gcd}"
  shows degree_min_int_poly_pos [intro]: "degree (min_int_poly x) > 0"
    and degree_min_int_poly_nonzero [simp]: "degree (min_int_poly x) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < degree (min_int_poly x) &&& degree (min_int_poly x) \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < degree (min_int_poly x)
 2. degree (min_int_poly x) \<noteq> 0
[PROOF STEP]
show "degree (min_int_poly x) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < degree (min_int_poly x)
[PROOF STEP]
proof (cases "algebraic x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. algebraic x \<Longrightarrow> 0 < degree (min_int_poly x)
 2. \<not> algebraic x \<Longrightarrow> 0 < degree (min_int_poly x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
algebraic x

goal (2 subgoals):
 1. algebraic x \<Longrightarrow> 0 < degree (min_int_poly x)
 2. \<not> algebraic x \<Longrightarrow> 0 < degree (min_int_poly x)
[PROOF STEP]
hence "min_int_poly x represents x"
[PROOF STATE]
proof (prove)
using this:
algebraic x

goal (1 subgoal):
 1. min_int_poly x represents x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
min_int_poly x represents x

goal (2 subgoals):
 1. algebraic x \<Longrightarrow> 0 < degree (min_int_poly x)
 2. \<not> algebraic x \<Longrightarrow> 0 < degree (min_int_poly x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
min_int_poly x represents x

goal (1 subgoal):
 1. 0 < degree (min_int_poly x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < degree (min_int_poly x)

goal (1 subgoal):
 1. \<not> algebraic x \<Longrightarrow> 0 < degree (min_int_poly x)
[PROOF STEP]
qed (auto simp: min_int_poly_def)
[PROOF STATE]
proof (state)
this:
0 < degree (min_int_poly x)

goal (1 subgoal):
 1. degree (min_int_poly x) \<noteq> 0
[PROOF STEP]
thus "degree (min_int_poly x) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < degree (min_int_poly x)

goal (1 subgoal):
 1. degree (min_int_poly x) \<noteq> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
degree (min_int_poly x) \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_less_divide_eq [field_simps]:
  assumes "0 < c"
  shows "a < b / c \<longleftrightarrow> a * c < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a < b / c) = (a * c < b)
[PROOF STEP]
using assms local.dual_order.strict_iff_order local.nonzero_divide_eq_eq local.pos_le_divide_eq
[PROOF STATE]
proof (prove)
using this:
(0::'a) < c
(?b < ?a) = (?b \<le> ?a \<and> ?a \<noteq> ?b)
?c \<noteq> (0::'a) \<Longrightarrow> (?b / ?c = ?a) = (?b = ?a * ?c)
(0::'a) < ?c \<Longrightarrow> (?a \<le> ?b / ?c) = (?a * ?c \<le> ?b)

goal (1 subgoal):
 1. (a < b / c) = (a * c < b)
[PROOF STEP]
by auto


[STATEMENT]
lemma max_reg_Eq: "max_reg (Eq a b) = max (AExp.max_reg a) (AExp.max_reg b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GExp.max_reg (Eq a b) = max (AExp.max_reg a) (AExp.max_reg b)
[PROOF STEP]
apply (simp add: max_reg_def AExp.max_reg_def Let_def max_absorb2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AExp.enumerate_regs a \<noteq> {} \<longrightarrow> AExp.enumerate_regs b \<noteq> {} \<longrightarrow> Some (Max (AExp.enumerate_regs a \<union> AExp.enumerate_regs b)) = max (Some (Max (AExp.enumerate_regs a))) (Some (Max (AExp.enumerate_regs b)))
[PROOF STEP]
by (metis AExp.finite_enumerate_regs Max.union bot_option_def max_bot2 sup_Some sup_max)


[STATEMENT]
lemma twice_field_differentiable_at_polyn_fun [simp]:
  fixes coef :: "nat \<Rightarrow> 'a :: {real_normed_field}"
    and n :: nat
  assumes "f twice_field_differentiable_at x"
  shows "(\<lambda>x. \<Sum>i<n. coef i * f x ^ i) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<n. coef i * f x ^ i) twice_field_differentiable_at x
[PROOF STEP]
by (blast intro: assms twice_field_differentiable_at_compose [OF _ twice_field_differentiable_at_polyn])


[STATEMENT]
lemma mset_merge: "mset_tree (merge t1 t2) = mset_tree t1 + mset_tree t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_tree (merge t1 t2) = mset_tree t1 + mset_tree t2
[PROOF STEP]
by (induction t1 t2 rule: merge.induct) (auto simp add: ac_simps)


[STATEMENT]
lemma permutes_univ: "p permutes UNIV \<longleftrightarrow> (\<forall>y. \<exists>!x. p x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p permutes UNIV) = (\<forall>y. \<exists>!x. p x = y)
[PROOF STEP]
by (simp add: permutes_def)


[STATEMENT]
lemma vars_mset_subst[simp]: "vars_mset (subst \<rho> s) = (\<Sum>\<^sub># {#vars_mset (\<rho> x). x \<in># vars_mset s#})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars_mset (subst \<rho> s) = (\<Sum>x\<in>#vars_mset s. vars_mset (\<rho> x))
[PROOF STEP]
proof (induct s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. vars_mset (subst \<rho> (Hd x)) = (\<Sum>x\<in>#vars_mset (Hd x). vars_mset (\<rho> x))
 2. \<And>s1 s2. \<lbrakk>vars_mset (subst \<rho> s1) = (\<Sum>x\<in>#vars_mset s1. vars_mset (\<rho> x)); vars_mset (subst \<rho> s2) = (\<Sum>x\<in>#vars_mset s2. vars_mset (\<rho> x))\<rbrakk> \<Longrightarrow> vars_mset (subst \<rho> (App s1 s2)) = (\<Sum>x\<in>#vars_mset (App s1 s2). vars_mset (\<rho> x))
[PROOF STEP]
case (Hd \<zeta>)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>x. vars_mset (subst \<rho> (Hd x)) = (\<Sum>x\<in>#vars_mset (Hd x). vars_mset (\<rho> x))
 2. \<And>s1 s2. \<lbrakk>vars_mset (subst \<rho> s1) = (\<Sum>x\<in>#vars_mset s1. vars_mset (\<rho> x)); vars_mset (subst \<rho> s2) = (\<Sum>x\<in>#vars_mset s2. vars_mset (\<rho> x))\<rbrakk> \<Longrightarrow> vars_mset (subst \<rho> (App s1 s2)) = (\<Sum>x\<in>#vars_mset (App s1 s2). vars_mset (\<rho> x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars_mset (subst \<rho> (Hd \<zeta>)) = (\<Sum>x\<in>#vars_mset (Hd \<zeta>). vars_mset (\<rho> x))
[PROOF STEP]
by (cases \<zeta>) auto
[PROOF STATE]
proof (state)
this:
vars_mset (subst \<rho> (Hd \<zeta>)) = (\<Sum>x\<in>#vars_mset (Hd \<zeta>). vars_mset (\<rho> x))

goal (1 subgoal):
 1. \<And>s1 s2. \<lbrakk>vars_mset (subst \<rho> s1) = (\<Sum>x\<in>#vars_mset s1. vars_mset (\<rho> x)); vars_mset (subst \<rho> s2) = (\<Sum>x\<in>#vars_mset s2. vars_mset (\<rho> x))\<rbrakk> \<Longrightarrow> vars_mset (subst \<rho> (App s1 s2)) = (\<Sum>x\<in>#vars_mset (App s1 s2). vars_mset (\<rho> x))
[PROOF STEP]
qed auto


[STATEMENT]
theorem isin_list_set:
  assumes "sorted_less xs"
  shows "isin_list x xs = (x \<in> set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isin_list x xs = (x \<in> set xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted_less xs

goal (1 subgoal):
 1. isin_list x xs = (x \<in> set xs)
[PROOF STEP]
using isin_sorted_split_list[of xs x]
[PROOF STATE]
proof (prove)
using this:
sorted_less xs
\<lbrakk>sorted_less xs; split_list xs x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> (x \<in> set xs) = (x \<in> set ?rs)

goal (1 subgoal):
 1. isin_list x xs = (x \<in> set xs)
[PROOF STEP]
using isin_sorted_split_list_right[of xs x]
[PROOF STATE]
proof (prove)
using this:
sorted_less xs
\<lbrakk>sorted_less xs; split_list xs x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> (x \<in> set xs) = (x \<in> set ?rs)
\<lbrakk>split_list xs x = (?ls, ?sep # ?rs); sorted_less xs\<rbrakk> \<Longrightarrow> (x \<in> set (?sep # ?rs)) = (x = ?sep)

goal (1 subgoal):
 1. isin_list x xs = (x \<in> set xs)
[PROOF STEP]
by (auto split!: list.splits)


[STATEMENT]
lemma IVT_strict:
  fixes f :: "'a::linear_continuum_topology \<Rightarrow> 'b::linorder_topology"
  assumes "(f a > y \<and> y > f b) \<or> (f a < y \<and> y < f b)" "a<b" "continuous_on {a .. b} f"
  shows "\<exists>x. a < x \<and> x < b \<and> f x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x>a. x < b \<and> f x = y
[PROOF STEP]
by (metis IVT' IVT2' assms(1) assms(2) assms(3) linorder_neq_iff order_le_less order_less_imp_le)


[STATEMENT]
lemma measure_preserving_preserves_integral':
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes "T \<in> measure_preserving M N"
      and [measurable]: "integrable M (\<lambda>x. f (T x))" "f \<in> borel_measurable N"
  shows "integrable N f" "(\<integral>x. f x \<partial>N) = (\<integral>x. f (T x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable N f &&& integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable N f
 2. integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
have a [measurable]: "T \<in> measurable M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<in> M \<rightarrow>\<^sub>M N
[PROOF STEP]
by (rule measure_preservingE(1)[OF assms(1)])
[PROOF STATE]
proof (state)
this:
T \<in> M \<rightarrow>\<^sub>M N

goal (2 subgoals):
 1. integrable N f
 2. integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
have "integrable M (\<lambda>x. f(T x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. f (T x))
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. f (T x))

goal (1 subgoal):
 1. integrable M (\<lambda>x. f (T x))
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. f (T x))

goal (1 subgoal):
 1. integrable M (\<lambda>x. f (T x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. f (T x))

goal (2 subgoals):
 1. integrable N f
 2. integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. f (T x))
[PROOF STEP]
have "integrable (distr M N T) f"
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. f (T x))

goal (1 subgoal):
 1. integrable (distr M N T) f
[PROOF STEP]
using integrable_distr_eq[OF a assms(3)]
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. f (T x))
integrable (distr M N T) f = integrable M (\<lambda>x. f (T x))

goal (1 subgoal):
 1. integrable (distr M N T) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integrable (distr M N T) f

goal (2 subgoals):
 1. integrable N f
 2. integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable (distr M N T) f
[PROOF STEP]
show *: "integrable N f"
[PROOF STATE]
proof (prove)
using this:
integrable (distr M N T) f

goal (1 subgoal):
 1. integrable N f
[PROOF STEP]
using measure_preserving_distr[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
integrable (distr M N T) f
distr M N T = N

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

goal (1 subgoal):
 1. integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable N f
[PROOF STEP]
show "(\<integral>x. f x \<partial>N) = (\<integral>x. f (T x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
integrable N f

goal (1 subgoal):
 1. integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
using measure_preserving_preserves_integral[OF assms(1) *]
[PROOF STATE]
proof (prove)
using this:
integrable N f
integrable M (\<lambda>x. f (T x))
integral\<^sup>L N f = LINT x|M. f (T x)

goal (1 subgoal):
 1. integral\<^sup>L N f = LINT x|M. f (T x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>L N f = LINT x|M. f (T x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Im_complex_div_eq_0: "Im (a / b) = 0 \<longleftrightarrow> Im (a * cnj b) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im (a / b) = 0) = (Im (a * cnj b) = 0)
[PROOF STEP]
by (auto simp add: Im_divide)


[STATEMENT]
lemma norm_dist_dot: "(norm_dist x y)\<^sup>2 = (x - y) \<bullet> (x - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm_dist x y)\<^sup>2 = (x - y) \<bullet> (x - y)
[PROOF STEP]
by (simp add: power2_norm_eq_inner)