[STATEMENT]
lemma ex_map_conv:
  "(\<exists>xs. ys = map f xs) = (\<forall>y \<in> set ys. \<exists>x. y = f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. ys = map f xs) = (\<forall>y\<in>set ys. \<exists>x. y = f x)
[PROOF STEP]
by(induct ys, auto simp add: Cons_eq_map_conv)


[STATEMENT]
lemma rbt_delete_in_tree:
  assumes "is_rbt t"
  shows "entry_in_tree k v (rbt_delete x t) = (x \<noteq> k \<and> entry_in_tree k v t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((k, v) \<in> set (entries (rbt_delete x t))) = (x \<noteq> k \<and> (k, v) \<in> set (entries t))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_rbt t

goal (1 subgoal):
 1. ((k, v) \<in> set (entries (rbt_delete x t))) = (x \<noteq> k \<and> (k, v) \<in> set (entries t))
[PROOF STEP]
unfolding is_rbt_def rbt_delete_def
[PROOF STATE]
proof (prove)
using this:
inv1 t \<and> inv2 t \<and> color_of t = B \<and> rbt_sorted t

goal (1 subgoal):
 1. ((k, v) \<in> set (entries (paint B (rbt_del x t)))) = (x \<noteq> k \<and> (k, v) \<in> set (entries t))
[PROOF STEP]
by (auto simp: rbt_del_in_tree)


[STATEMENT]
lemma groupF_Union_set: "(\<Union>x \<in> set (groupF f xs). set x) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set ` set (groupF f xs)) = set xs
[PROOF STEP]
proof(induction f xs rule: groupF.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<Union> (set ` set (groupF f [])) = set []
 2. \<And>f x xs. \<Union> (set ` set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs))) = set (filter (\<lambda>y. f x \<noteq> f y) xs) \<Longrightarrow> \<Union> (set ` set (groupF f (x # xs))) = set (x # xs)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
\<Union> (set ` set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_))) = set (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)

goal (2 subgoals):
 1. \<And>f. \<Union> (set ` set (groupF f [])) = set []
 2. \<And>f x xs. \<Union> (set ` set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs))) = set (filter (\<lambda>y. f x \<noteq> f y) xs) \<Longrightarrow> \<Union> (set ` set (groupF f (x # xs))) = set (x # xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<Union> (set ` set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_))) = set (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)

goal (1 subgoal):
 1. \<Union> (set ` set (groupF f_ (x_ # xs_))) = set (x_ # xs_)
[PROOF STEP]
by (simp) blast
[PROOF STATE]
proof (state)
this:
\<Union> (set ` set (groupF f_ (x_ # xs_))) = set (x_ # xs_)

goal (1 subgoal):
 1. \<And>f. \<Union> (set ` set (groupF f [])) = set []
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma simple_match_ip_conjunct:
    fixes ip1 :: "'i::len word \<times> nat"
    shows "simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip \<longleftrightarrow>
            (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
fix b1 m1 b2 m2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
have "simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip \<longleftrightarrow>
          p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip) = (p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip) = (p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2)

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip) = (p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2)

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> p_ip \<in> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2) = (p_ip \<in> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx))
[PROOF STEP]
using ipcidr_conjunct_correct
[PROOF STATE]
proof (prove)
using this:
(case ipcidr_conjunct (?b1.0, ?m1.0) (?b2.0, ?m2.0) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx) = ipset_from_cidr ?b1.0 ?m1.0 \<inter> ipset_from_cidr ?b2.0 ?m2.0

goal (1 subgoal):
 1. (p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2) = (p_ip \<in> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2) = (p_ip \<in> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx))

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(p_ip \<in> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2) = (p_ip \<in> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx))

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p_ip \<in> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx)) = (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
by(simp split: option.split)
[PROOF STATE]
proof (state)
this:
(p_ip \<in> (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx)) = (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip) = (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
have "simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip \<longleftrightarrow>
         (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)"
[PROOF STATE]
proof (prove)
using this:
(simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip) = (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)

goal (1 subgoal):
 1. (simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip) = (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(simple_match_ip (b1, m1) p_ip \<and> simple_match_ip (b2, m2) p_ip) = (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(simple_match_ip (?b1.2, ?m1.2) p_ip \<and> simple_match_ip (?b2.2, ?m2.2) p_ip) = (case ipcidr_conjunct (?b1.2, ?m1.2) (?b2.2, ?m2.2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(simple_match_ip (?b1.2, ?m1.2) p_ip \<and> simple_match_ip (?b2.2, ?m2.2) p_ip) = (case ipcidr_conjunct (?b1.2, ?m1.2) (?b2.2, ?m2.2) of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)

goal (1 subgoal):
 1. (simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)
[PROOF STEP]
by(cases ip1, cases ip2, simp)
[PROOF STATE]
proof (state)
this:
(simple_match_ip ip1 p_ip \<and> simple_match_ip ip2 p_ip) = (case ipcidr_conjunct ip1 ip2 of None \<Rightarrow> False | Some ipx \<Rightarrow> simple_match_ip ipx p_ip)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma derived_set_of_derived_set_subset:
   "Hausdorff_space X \<Longrightarrow> X derived_set_of (X derived_set_of S) \<subseteq> X derived_set_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hausdorff_space X \<Longrightarrow> X derived_set_of (X derived_set_of S) \<subseteq> X derived_set_of S
[PROOF STEP]
by (simp add: Hausdorff_imp_t1_space derived_set_of_derived_set_subset_gen)


[STATEMENT]
lemma real_poly_power: fixes p :: "'a :: {idom,real_algebra_1} poly"
  assumes p: "set (coeffs p) \<subseteq> \<real>"
  shows "set (coeffs (p ^ n)) \<subseteq> \<real>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (coeffs (p ^ n)) \<subseteq> \<real>
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (coeffs (p ^ 0)) \<subseteq> \<real>
 2. \<And>n. set (coeffs (p ^ n)) \<subseteq> \<real> \<Longrightarrow> set (coeffs (p ^ Suc n)) \<subseteq> \<real>
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
set (coeffs (p ^ n)) \<subseteq> \<real>

goal (2 subgoals):
 1. set (coeffs (p ^ 0)) \<subseteq> \<real>
 2. \<And>n. set (coeffs (p ^ n)) \<subseteq> \<real> \<Longrightarrow> set (coeffs (p ^ Suc n)) \<subseteq> \<real>
[PROOF STEP]
from real_poly_mult[OF p this]
[PROOF STATE]
proof (chain)
picking this:
set (coeffs (p * p ^ n)) \<subseteq> \<real>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
set (coeffs (p * p ^ n)) \<subseteq> \<real>

goal (1 subgoal):
 1. set (coeffs (p ^ Suc n)) \<subseteq> \<real>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (coeffs (p ^ Suc n)) \<subseteq> \<real>

goal (1 subgoal):
 1. set (coeffs (p ^ 0)) \<subseteq> \<real>
[PROOF STEP]
qed simp


[STATEMENT]
lemma higher_deriv_mult_at:
  assumes "f analytic_on {z}" "g analytic_on {z}"
    shows "(deriv ^^ n) (\<lambda>w. f w * g w) z =
           (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w * g w) z = (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w * g w) z = (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)
[PROOF STEP]
have "f analytic_on {z} \<and> g analytic_on {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f analytic_on {z} \<and> g analytic_on {z}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f analytic_on {z}
g analytic_on {z}

goal (1 subgoal):
 1. f analytic_on {z} \<and> g analytic_on {z}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f analytic_on {z} \<and> g analytic_on {z}

goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w * g w) z = (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)
[PROOF STEP]
with higher_deriv_mult
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?f holomorphic_on ?S; ?g holomorphic_on ?S; open ?S; ?z \<in> ?S\<rbrakk> \<Longrightarrow> (deriv ^^ ?n) (\<lambda>w. ?f w * ?g w) ?z = (\<Sum>i = 0..?n. of_nat (?n choose i) * (deriv ^^ i) ?f ?z * (deriv ^^ (?n - i)) ?g ?z)
f analytic_on {z} \<and> g analytic_on {z}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f holomorphic_on ?S; ?g holomorphic_on ?S; open ?S; ?z \<in> ?S\<rbrakk> \<Longrightarrow> (deriv ^^ ?n) (\<lambda>w. ?f w * ?g w) ?z = (\<Sum>i = 0..?n. of_nat (?n choose i) * (deriv ^^ i) ?f ?z * (deriv ^^ (?n - i)) ?g ?z)
f analytic_on {z} \<and> g analytic_on {z}

goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w * g w) z = (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)
[PROOF STEP]
by (auto simp: analytic_at_two)
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) (\<lambda>w. f w * g w) z = (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l2product_ldiff:
   "\<lbrakk>f square_integrable S; g square_integrable S; h square_integrable S\<rbrakk>
    \<Longrightarrow> l2product S (\<lambda>x. f x - g x) h = l2product S f h - l2product S g 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 (\<lambda>x. f x - g x) h = l2product S f h - l2product S g h
[PROOF STEP]
by (simp add: l2product_def algebra_simps square_integrable_imp_integrable_product)


[STATEMENT]
lemma pdevs_val_One_pdevs:
  "pdevs_val e (One_pdevs::'a::executable_euclidean_space pdevs) = (\<Sum>i<DIM('a). e i *\<^sub>R Basis_list ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e One_pdevs = (\<Sum>i<DIM('a). e i *\<^sub>R Basis_list ! i)
[PROOF STEP]
by (auto simp: pdevs_val_pdevs_domain length_Basis_list intro!:sum.cong)


[STATEMENT]
lemma shortest_path_intro:
  assumes "n \<noteq> top"
  assumes "(\<exists> p \<in> connecting_paths u v . walk_length p = n)"
  assumes "(\<And> p. p \<in> connecting_paths u v \<Longrightarrow> n \<le> walk_length p)"
  shows "shortest_path u v = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shortest_path u v = enat n
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. shortest_path u v \<noteq> enat n \<Longrightarrow> False
[PROOF STEP]
assume a: "shortest_path u v \<noteq> enat n"
[PROOF STATE]
proof (state)
this:
shortest_path u v \<noteq> enat n

goal (1 subgoal):
 1. shortest_path u v \<noteq> enat n \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
shortest_path u v \<noteq> enat n
[PROOF STEP]
have "shortest_path u v < n"
[PROOF STATE]
proof (prove)
using this:
shortest_path u v \<noteq> enat n

goal (1 subgoal):
 1. shortest_path u v < enat n
[PROOF STEP]
by (metis antisym_conv2 assms(2) shortest_path_lte)
[PROOF STATE]
proof (state)
this:
shortest_path u v < enat n

goal (1 subgoal):
 1. shortest_path u v \<noteq> enat n \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
shortest_path u v < enat n
[PROOF STEP]
have "\<exists> p \<in> connecting_paths u v .walk_length p < n"
[PROOF STATE]
proof (prove)
using this:
shortest_path u v < enat n

goal (1 subgoal):
 1. \<exists>p\<in>connecting_paths u v. walk_length p < n
[PROOF STEP]
using shortest_path_def
[PROOF STATE]
proof (prove)
using this:
shortest_path u v < enat n
shortest_path ?u ?v \<equiv> INF p\<in>connecting_paths ?u ?v. enat (walk_length p)

goal (1 subgoal):
 1. \<exists>p\<in>connecting_paths u v. walk_length p < n
[PROOF STEP]
by (simp add: INF_less_iff)
[PROOF STATE]
proof (state)
this:
\<exists>p\<in>connecting_paths u v. walk_length p < n

goal (1 subgoal):
 1. shortest_path u v \<noteq> enat n \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
\<exists>p\<in>connecting_paths u v. walk_length p < n

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
\<exists>p\<in>connecting_paths u v. walk_length p < n
?p \<in> connecting_paths u v \<Longrightarrow> n \<le> walk_length ?p

goal (1 subgoal):
 1. False
[PROOF STEP]
using le_antisym less_imp_le_nat
[PROOF STATE]
proof (prove)
using this:
\<exists>p\<in>connecting_paths u v. walk_length p < n
?p \<in> connecting_paths u v \<Longrightarrow> n \<le> walk_length ?p
\<lbrakk>?m \<le> ?n; ?n \<le> ?m\<rbrakk> \<Longrightarrow> ?m = ?n
?m < ?n \<Longrightarrow> ?m \<le> ?n

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniform_limit_minus[uniform_limit_intros]:
  fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
  assumes "uniform_limit X f l F"
  assumes "uniform_limit X g m F"
  shows "uniform_limit X (\<lambda>a b. f a b - g a b) (\<lambda>a. l a - m a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit X (\<lambda>a b. f a b - g a b) (\<lambda>a. l a - m a) F
[PROOF STEP]
unfolding diff_conv_add_uminus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit X (\<lambda>a b. f a b + - g a b) (\<lambda>a. l a + - m a) F
[PROOF STEP]
by (rule uniform_limit_intros assms)+


[STATEMENT]
lemma transfer_rec_nat[refine_transfer]:
  assumes FN: "\<And>s. \<alpha> (fn s) \<le> fn' s"
  assumes FC: "\<And>n rec rec' s. \<lbrakk> \<And>s. \<alpha> (rec s) \<le> rec' s \<rbrakk>
    \<Longrightarrow> \<alpha> (fs n rec s) \<le> fs' n rec' s"
  shows "\<alpha> (rec_nat fn fs n s) \<le> rec_nat fn' fs' n s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> (rec_nat fn fs n s) \<le> rec_nat fn' fs' n s
[PROOF STEP]
apply (induct n arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. \<alpha> (rec_nat fn fs 0 s) \<le> rec_nat fn' fs' 0 s
 2. \<And>n s. (\<And>s. \<alpha> (rec_nat fn fs n s) \<le> rec_nat fn' fs' n s) \<Longrightarrow> \<alpha> (rec_nat fn fs (Suc n) s) \<le> rec_nat fn' fs' (Suc n) s
[PROOF STEP]
apply (simp add: FN)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n s. (\<And>s. \<alpha> (rec_nat fn fs n s) \<le> rec_nat fn' fs' n s) \<Longrightarrow> \<alpha> (rec_nat fn fs (Suc n) s) \<le> rec_nat fn' fs' (Suc n) s
[PROOF STEP]
apply (simp add: FC)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma interval_integral_sum:
  fixes a b c :: ereal
  assumes integrable: "interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f"
  shows "(LBINT x=a..b. f x) + (LBINT x=b..c. f x) = (LBINT x=a..c. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
let ?I = "\<lambda>a b. LBINT x=a..b. f x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
fix a b c :: ereal
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
assume "interval_lebesgue_integrable lborel a c f" "a \<le> b" "b \<le> c"
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integrable lborel a c f
a \<le> b
b \<le> c

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interval_lebesgue_integrable lborel a c f
a \<le> b
b \<le> c
[PROOF STEP]
have ord: "a \<le> b" "b \<le> c" "a \<le> c" and f': "set_integrable lborel (einterval a c) f"
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integrable lborel a c f
a \<le> b
b \<le> c

goal (1 subgoal):
 1. (a \<le> b &&& b \<le> c &&& a \<le> c) &&& set_integrable lborel (einterval a c) f
[PROOF STEP]
by (auto simp: interval_lebesgue_integrable_def)
[PROOF STATE]
proof (state)
this:
a \<le> b
b \<le> c
a \<le> c
set_integrable lborel (einterval a c) f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<le> b
b \<le> c
a \<le> c
set_integrable lborel (einterval a c) f
[PROOF STEP]
have f: "set_borel_measurable borel (einterval a c) f"
[PROOF STATE]
proof (prove)
using this:
a \<le> b
b \<le> c
a \<le> c
set_integrable lborel (einterval a c) f

goal (1 subgoal):
 1. set_borel_measurable borel (einterval a c) f
[PROOF STEP]
unfolding set_integrable_def set_borel_measurable_def
[PROOF STATE]
proof (prove)
using this:
a \<le> b
b \<le> c
a \<le> c
integrable lborel (\<lambda>x. indicat_real (einterval a c) x *\<^sub>R f x)

goal (1 subgoal):
 1. (\<lambda>x. indicat_real (einterval a c) x *\<^sub>R f x) \<in> borel_measurable borel
[PROOF STEP]
by (drule_tac borel_measurable_integrable) simp
[PROOF STATE]
proof (state)
this:
set_borel_measurable borel (einterval a c) f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
have "(LBINT x:einterval a c. f x) = (LBINT x:einterval a b \<union> einterval b c. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral lborel (einterval a c) f = set_lebesgue_integral lborel (einterval a b \<union> einterval b c) f
[PROOF STEP]
proof (rule set_integral_cong_set)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. set_borel_measurable lborel (einterval a b \<union> einterval b c) f
 2. set_borel_measurable lborel (einterval a c) f
 3. AE x in lborel. (x \<in> einterval a b \<union> einterval b c) = (x \<in> einterval a c)
[PROOF STEP]
show "AE x in lborel. (x \<in> einterval a b \<union> einterval b c) = (x \<in> einterval a c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in lborel. (x \<in> einterval a b \<union> einterval b c) = (x \<in> einterval a c)
[PROOF STEP]
using AE_lborel_singleton[of "real_of_ereal b"] ord
[PROOF STATE]
proof (prove)
using this:
AE x in lborel. x \<noteq> real_of_ereal b
a \<le> b
b \<le> c
a \<le> c

goal (1 subgoal):
 1. AE x in lborel. (x \<in> einterval a b \<union> einterval b c) = (x \<in> einterval a c)
[PROOF STEP]
by (cases a b c rule: ereal3_cases) (auto simp: einterval_iff)
[PROOF STATE]
proof (state)
this:
AE x in lborel. (x \<in> einterval a b \<union> einterval b c) = (x \<in> einterval a c)

goal (2 subgoals):
 1. set_borel_measurable lborel (einterval a b \<union> einterval b c) f
 2. set_borel_measurable lborel (einterval a c) f
[PROOF STEP]
show "set_borel_measurable lborel (einterval a c) f" "set_borel_measurable lborel (einterval a b \<union> einterval b c) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_borel_measurable lborel (einterval a c) f &&& set_borel_measurable lborel (einterval a b \<union> einterval b c) f
[PROOF STEP]
unfolding set_borel_measurable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real (einterval a c) x *\<^sub>R f x) \<in> borel_measurable lborel &&& (\<lambda>x. indicat_real (einterval a b \<union> einterval b c) x *\<^sub>R f x) \<in> borel_measurable lborel
[PROOF STEP]
using ord
[PROOF STATE]
proof (prove)
using this:
a \<le> b
b \<le> c
a \<le> c

goal (1 subgoal):
 1. (\<lambda>x. indicat_real (einterval a c) x *\<^sub>R f x) \<in> borel_measurable lborel &&& (\<lambda>x. indicat_real (einterval a b \<union> einterval b c) x *\<^sub>R f x) \<in> borel_measurable lborel
[PROOF STEP]
by (auto simp: einterval_iff intro!: set_borel_measurable_subset[OF f, unfolded set_borel_measurable_def])
[PROOF STATE]
proof (state)
this:
set_borel_measurable lborel (einterval a c) f
set_borel_measurable lborel (einterval a b \<union> einterval b c) f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_lebesgue_integral lborel (einterval a c) f = set_lebesgue_integral lborel (einterval a b \<union> einterval b c) f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_lebesgue_integral lborel (einterval a c) f = set_lebesgue_integral lborel (einterval a b \<union> einterval b c) f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
have "\<dots> = (LBINT x:einterval a b. f x) + (LBINT x:einterval b c. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral lborel (einterval a b \<union> einterval b c) f = set_lebesgue_integral lborel (einterval a b) f + set_lebesgue_integral lborel (einterval b c) f
[PROOF STEP]
using ord
[PROOF STATE]
proof (prove)
using this:
a \<le> b
b \<le> c
a \<le> c

goal (1 subgoal):
 1. set_lebesgue_integral lborel (einterval a b \<union> einterval b c) f = set_lebesgue_integral lborel (einterval a b) f + set_lebesgue_integral lborel (einterval b c) f
[PROOF STEP]
by (intro set_integral_Un_AE) (auto intro!: set_integrable_subset[OF f'] simp: einterval_iff not_less)
[PROOF STATE]
proof (state)
this:
set_lebesgue_integral lborel (einterval a b \<union> einterval b c) f = set_lebesgue_integral lborel (einterval a b) f + set_lebesgue_integral lborel (einterval b c) f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_lebesgue_integral lborel (einterval a c) f = set_lebesgue_integral lborel (einterval a b) f + set_lebesgue_integral lborel (einterval b c) f
[PROOF STEP]
have "?I a b + ?I b c = ?I a c"
[PROOF STATE]
proof (prove)
using this:
set_lebesgue_integral lborel (einterval a c) f = set_lebesgue_integral lborel (einterval a b) f + set_lebesgue_integral lborel (einterval b c) f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
using ord
[PROOF STATE]
proof (prove)
using this:
set_lebesgue_integral lborel (einterval a c) f = set_lebesgue_integral lborel (einterval a b) f + set_lebesgue_integral lborel (einterval b c) f
a \<le> b
b \<le> c
a \<le> c

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
by (simp add: interval_lebesgue_integral_def)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>interval_lebesgue_integrable lborel ?aa2 ?ca2 f; ?aa2 \<le> ?ba2; ?ba2 \<le> ?ca2\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel ?aa2 ?ba2 f + interval_lebesgue_integral lborel ?ba2 ?ca2 f = interval_lebesgue_integral lborel ?aa2 ?ca2 f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
note 1 = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>interval_lebesgue_integrable lborel ?aa2 ?ca2 f; ?aa2 \<le> ?ba2; ?ba2 \<le> ?ca2\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel ?aa2 ?ba2 f + interval_lebesgue_integral lborel ?ba2 ?ca2 f = interval_lebesgue_integral lborel ?aa2 ?ca2 f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>interval_lebesgue_integrable lborel ?aa2 ?ca2 f; ?aa2 \<le> ?ba2; ?ba2 \<le> ?ca2\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel ?aa2 ?ba2 f + interval_lebesgue_integral lborel ?ba2 ?ca2 f = interval_lebesgue_integral lborel ?aa2 ?ca2 f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
fix a b c :: ereal
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
assume "interval_lebesgue_integrable lborel a c f" "a \<le> b" "b \<le> c"
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integrable lborel a c f
a \<le> b
b \<le> c

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
from 1[OF this]
[PROOF STATE]
proof (chain)
picking this:
interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
have "?I b c + ?I a b = ?I a c"
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel b c f + interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
by (metis add.commute)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel b c f + interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a c f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>interval_lebesgue_integrable lborel ?aa2 ?ca2 f; ?aa2 \<le> ?ba2; ?ba2 \<le> ?ca2\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel ?ba2 ?ca2 f + interval_lebesgue_integral lborel ?aa2 ?ba2 f = interval_lebesgue_integral lborel ?aa2 ?ca2 f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
note 2 = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>interval_lebesgue_integrable lborel ?aa2 ?ca2 f; ?aa2 \<le> ?ba2; ?ba2 \<le> ?ca2\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel ?ba2 ?ca2 f + interval_lebesgue_integral lborel ?aa2 ?ba2 f = interval_lebesgue_integral lborel ?aa2 ?ca2 f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
have 3: "\<And>a b. b \<le> a \<Longrightarrow> (LBINT x=a..b. f x) = - (LBINT x=b..a. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. b \<le> a \<Longrightarrow> interval_lebesgue_integral lborel a b f = - interval_lebesgue_integral lborel b a f
[PROOF STEP]
by (rule interval_integral_endpoints_reverse)
[PROOF STATE]
proof (state)
this:
?b \<le> ?a \<Longrightarrow> interval_lebesgue_integral lborel ?a ?b f = - interval_lebesgue_integral lborel ?b ?a f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
using integrable
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
apply (cases a b b c a c rule: linorder_le_cases[case_product linorder_le_cases linorder_cases])
[PROOF STATE]
proof (prove)
goal (12 subgoals):
 1. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; a \<le> b; b \<le> c; a < c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 2. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; a \<le> b; b \<le> c; a = c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 3. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; a \<le> b; b \<le> c; c < a\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 4. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; a \<le> b; c \<le> b; a < c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 5. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; a \<le> b; c \<le> b; a = c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 6. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; a \<le> b; c \<le> b; c < a\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 7. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; b \<le> a; b \<le> c; a < c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 8. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; b \<le> a; b \<le> c; a = c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 9. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; b \<le> a; b \<le> c; c < a\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 10. \<lbrakk>interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f; b \<le> a; c \<le> b; a < c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
A total of 12 subgoals...
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<lbrakk>interval_lebesgue_integrable lborel a c f; a \<le> b; b \<le> c; a < c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 2. \<lbrakk>interval_lebesgue_integrable lborel a b f; a \<le> b; c \<le> b; a < c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 3. \<lbrakk>interval_lebesgue_integrable lborel c b f; c \<le> b; a = c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel c b f + interval_lebesgue_integral lborel b c f = (0::'a)
 4. \<lbrakk>interval_lebesgue_integrable lborel c b f; a \<le> b; c \<le> b; c < a\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 5. \<lbrakk>interval_lebesgue_integrable lborel b c f; b \<le> a; b \<le> c; a < c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 6. \<lbrakk>interval_lebesgue_integrable lborel b c f; b \<le> c; a = c\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel c b f + interval_lebesgue_integral lborel b c f = (0::'a)
 7. \<lbrakk>interval_lebesgue_integrable lborel b a f; b \<le> a; b \<le> c; c < a\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
 8. \<lbrakk>interval_lebesgue_integrable lborel c a f; b \<le> a; c \<le> b; c < a\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f
[PROOF STEP]
by (simp_all add: min_absorb1 min_absorb2 max_absorb1 max_absorb2 field_simps 1 2 3)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f + interval_lebesgue_integral lborel b c f = interval_lebesgue_integral lborel a c f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_eval_fps:
  fixes f :: "'a :: {banach, real_normed_div_algebra} fps"
  shows "continuous_on (eball 0 (fps_conv_radius f)) (eval_fps f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (eball (0::'a) (fps_conv_radius f)) (eval_fps f)
[PROOF STEP]
proof (subst continuous_on_eq_continuous_at [OF open_eball], safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> eball (0::'a) (fps_conv_radius f) \<Longrightarrow> isCont (eval_fps f) x
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> eball (0::'a) (fps_conv_radius f) \<Longrightarrow> isCont (eval_fps f) x
[PROOF STEP]
assume x: "x \<in> eball 0 (fps_conv_radius f)"
[PROOF STATE]
proof (state)
this:
x \<in> eball (0::'a) (fps_conv_radius f)

goal (1 subgoal):
 1. \<And>x. x \<in> eball (0::'a) (fps_conv_radius f) \<Longrightarrow> isCont (eval_fps f) x
[PROOF STEP]
define r where "r = (if fps_conv_radius f = \<infinity> then norm x + 1 else
                        (norm x + real_of_ereal (fps_conv_radius f)) / 2)"
[PROOF STATE]
proof (state)
this:
r = (if fps_conv_radius f = \<infinity> then norm x + 1 else (norm x + real_of_ereal (fps_conv_radius f)) / 2)

goal (1 subgoal):
 1. \<And>x. x \<in> eball (0::'a) (fps_conv_radius f) \<Longrightarrow> isCont (eval_fps f) x
[PROOF STEP]
have r: "norm x < r \<and> ereal r < fps_conv_radius f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x < r \<and> ereal r < fps_conv_radius f
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> eball (0::'a) (fps_conv_radius f)

goal (1 subgoal):
 1. norm x < r \<and> ereal r < fps_conv_radius f
[PROOF STEP]
by (cases "fps_conv_radius f")
               (auto simp: r_def eball_def split: if_splits)
[PROOF STATE]
proof (state)
this:
norm x < r \<and> ereal r < fps_conv_radius f

goal (1 subgoal):
 1. \<And>x. x \<in> eball (0::'a) (fps_conv_radius f) \<Longrightarrow> isCont (eval_fps f) x
[PROOF STEP]
have "continuous_on (cball 0 r) (\<lambda>x. \<Sum>i. fps_nth f i * (x - 0) ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cball (0::'a) r) (\<lambda>x. \<Sum>i. fps_nth f i * (x - (0::'a)) ^ i)
[PROOF STEP]
by (rule powser_continuous_suminf) (insert r, auto simp: fps_conv_radius_def)
[PROOF STATE]
proof (state)
this:
continuous_on (cball (0::'a) r) (\<lambda>x. \<Sum>i. fps_nth f i * (x - (0::'a)) ^ i)

goal (1 subgoal):
 1. \<And>x. x \<in> eball (0::'a) (fps_conv_radius f) \<Longrightarrow> isCont (eval_fps f) x
[PROOF STEP]
hence "continuous_on (cball 0 r) (eval_fps f)"
[PROOF STATE]
proof (prove)
using this:
continuous_on (cball (0::'a) r) (\<lambda>x. \<Sum>i. fps_nth f i * (x - (0::'a)) ^ i)

goal (1 subgoal):
 1. continuous_on (cball (0::'a) r) (eval_fps f)
[PROOF STEP]
by (simp add: eval_fps_def)
[PROOF STATE]
proof (state)
this:
continuous_on (cball (0::'a) r) (eval_fps f)

goal (1 subgoal):
 1. \<And>x. x \<in> eball (0::'a) (fps_conv_radius f) \<Longrightarrow> isCont (eval_fps f) x
[PROOF STEP]
thus "isCont (eval_fps f) x"
[PROOF STATE]
proof (prove)
using this:
continuous_on (cball (0::'a) r) (eval_fps f)

goal (1 subgoal):
 1. isCont (eval_fps f) x
[PROOF STEP]
by (rule continuous_on_interior) (use r in auto)
[PROOF STATE]
proof (state)
this:
isCont (eval_fps f) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_ceiling_le_Ints:
  assumes "0 \<le> a" "a \<in> Ints"
  shows "(of_int \<lceil>a * b\<rceil> :: 'a :: linordered_idom) \<le> of_int(\<lceil>a\<rceil> * \<lceil>b\<rceil>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int \<lceil>a * b\<rceil> \<le> of_int (\<lceil>a\<rceil> * \<lceil>b\<rceil>)
[PROOF STEP]
by (metis Ints_cases assms ceiling_le_iff ceiling_of_int le_of_int_ceiling mult_left_mono of_int_le_iff of_int_mult)


[STATEMENT]
lemma continuous_attains_sup:
  fixes f :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"
  shows "compact s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> continuous_on s f \<Longrightarrow> (\<exists>x\<in>s. \<forall>y\<in>s.  f y \<le> f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>compact s; s \<noteq> {}; continuous_on s f\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. \<forall>y\<in>s. f y \<le> f x
[PROOF STEP]
using compact_attains_sup[of "f ` s"] compact_continuous_image[of s f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact (f ` s); f ` s \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>sa\<in>f ` s. \<forall>t\<in>f ` s. t \<le> sa
\<lbrakk>continuous_on s f; compact s\<rbrakk> \<Longrightarrow> compact (f ` s)

goal (1 subgoal):
 1. \<lbrakk>compact s; s \<noteq> {}; continuous_on s f\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. \<forall>y\<in>s. f y \<le> f x
[PROOF STEP]
by auto


[STATEMENT]
lemma ceiling_less_cancel: "\<lceil>x\<rceil> < \<lceil>y\<rceil> \<Longrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x\<rceil> < \<lceil>y\<rceil> \<Longrightarrow> x < y
[PROOF STEP]
by (auto simp add: not_le [symmetric] ceiling_mono)


[STATEMENT]
lemma closure_bounded_linear_image:
    fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
    shows "\<lbrakk>linear f; bounded S\<rbrakk> \<Longrightarrow> f ` (closure S) = closure (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear f; bounded S\<rbrakk> \<Longrightarrow> f ` closure S = closure (f ` S)
[PROOF STEP]
apply (rule subset_antisym, simp add: closure_linear_image_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear f; bounded S\<rbrakk> \<Longrightarrow> closure (f ` S) \<subseteq> f ` closure S
[PROOF STEP]
apply (rule closure_minimal, simp add: closure_subset image_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear f; bounded S\<rbrakk> \<Longrightarrow> closed (f ` closure S)
[PROOF STEP]
by (meson bounded_closure closed_closure compact_continuous_image compact_eq_bounded_closed linear_continuous_on linear_conv_bounded_linear)


[STATEMENT]
lemma vec_to_iarray_norm[code_unfold]:
  shows "(norm A) = norm_iarray (vec_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm A = norm_iarray (vec_to_iarray A)
[PROOF STEP]
unfolding norm_eq_sqrt_inner norm_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (A \<bullet> A) = sqrt (vec_to_iarray A \<bullet>i vec_to_iarray A)
[PROOF STEP]
unfolding vec_to_iarray_inner
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (vec_to_iarray A \<bullet>i vec_to_iarray A) = sqrt (vec_to_iarray A \<bullet>i vec_to_iarray A)
[PROOF STEP]
..


[STATEMENT]
lemma DERIV_cdivide:
  "(f has_field_derivative D) (at x within s) \<Longrightarrow>
    ((\<lambda>x. f x / c) has_field_derivative D / c) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within s) \<Longrightarrow> ((\<lambda>x. f x / c) has_field_derivative D / c) (at x within s)
[PROOF STEP]
using DERIV_cmult_right[of f D x s "1 / c"]
[PROOF STATE]
proof (prove)
using this:
(f has_field_derivative D) (at x within s) \<Longrightarrow> ((\<lambda>x. f x * ((1::'a) / c)) has_field_derivative D * ((1::'a) / c)) (at x within s)

goal (1 subgoal):
 1. (f has_field_derivative D) (at x within s) \<Longrightarrow> ((\<lambda>x. f x / c) has_field_derivative D / c) (at x within s)
[PROOF STEP]
by simp


[STATEMENT]
lemma sumlist_dim: assumes "\<And> x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n"
  shows "dim_vec (sumlist xs) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (M.sumlist xs) = n
[PROOF STEP]
using sumlist_carrier assms
[PROOF STATE]
proof (prove)
using this:
set ?xs \<subseteq> carrier_vec n \<Longrightarrow> M.sumlist ?xs \<in> carrier_vec n
?x1 \<in> set xs \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (1 subgoal):
 1. dim_vec (M.sumlist xs) = n
[PROOF STEP]
by fastforce


[STATEMENT]
lemma mult_vec_minus_mult_left: "(- p) ** q = - (p ** q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p ** q = - (p ** q)
[PROOF STEP]
by (rule sym, rule minus_unique, simp add: mult_vec_distrib_right[symmetric] mult_vec_zero_left)


[STATEMENT]
lemma mem_ball_0 [simp]: "x \<in> ball 0 e \<longleftrightarrow> norm x < e"
  for x :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> ball (0::'a) e) = (norm x < e)
[PROOF STEP]
by simp


[STATEMENT]
lemma p_convex:
  fixes a b c x y z :: real
  assumes p_def: "p = (\<lambda>x. a * x\<^sup>2 + b * x + c)"
  assumes less : "x < y" "y < z"
      and ge   : "p x > p y" "p y \<le> p z"
  shows "a > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
using less ge
[PROOF STATE]
proof (prove)
using this:
x < y
y < z
p y < p x
p y \<le> p z

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
x < y
y < z
a * y\<^sup>2 + b * y + c < a * x\<^sup>2 + b * x + c
a * y\<^sup>2 + b * y + c \<le> a * z\<^sup>2 + b * z + c

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
by (sos "((((A<0 * (A<1 * A<2)) * R<1) + (((A<2 * R<1) * (R<1/4 * [y + ~1*z]^2)) +
    (((A<=1 * R<1) * (R<1 * [x + ~1*y]^2)) + (((A<=1 * (A<0 * (A<1 * R<1))) * (R<1/4 * [1]^2)) +
    (((A<=0 * R<1) * (R<1/4 * [~1*y^2 + x*y + ~1*x*z + y*z]^2)) +
    ((A<=0 * (A<0 * (A<1 * R<1))) * (R<1 * [x + ~1/2*y + ~1/2*z]^2))))))))")


[STATEMENT]
lemma representation_add:
  "independent basis \<Longrightarrow> v \<in> span basis \<Longrightarrow> u \<in> span basis \<Longrightarrow>
    representation basis (u + v) = (\<lambda>b. representation basis u b + representation basis v b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>independent basis; v \<in> span basis; u \<in> span basis\<rbrakk> \<Longrightarrow> representation basis (u + v) = (\<lambda>b. representation basis u b + representation basis v b)
[PROOF STEP]
using representation_diff[of basis "-v" u]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>independent basis; - v \<in> span basis; u \<in> span basis\<rbrakk> \<Longrightarrow> representation basis (u - - v) = (\<lambda>b. representation basis u b - representation basis (- v) b)

goal (1 subgoal):
 1. \<lbrakk>independent basis; v \<in> span basis; u \<in> span basis\<rbrakk> \<Longrightarrow> representation basis (u + v) = (\<lambda>b. representation basis u b + representation basis v b)
[PROOF STEP]
by (simp add: representation_neg representation_diff span_neg)


[STATEMENT]
lemma cos_periodic_pi [simp]: "cos (x + pi) = - cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + pi) = - cos x
[PROOF STEP]
by (simp add: cos_add)


[STATEMENT]
lemma homeomorphic_compact_space:
  assumes "X homeomorphic_space Y"
  shows "compact_space X \<longleftrightarrow> compact_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact_space X = compact_space Y
[PROOF STEP]
using homeomorphic_space_sym
[PROOF STATE]
proof (prove)
using this:
(?X homeomorphic_space ?Y) = (?Y homeomorphic_space ?X)

goal (1 subgoal):
 1. compact_space X = compact_space Y
[PROOF STEP]
by (metis assms compact_space_def homeomorphic_eq_everything_map homeomorphic_space image_compactin)


[STATEMENT]
lemma conjugate_comp_ext: "residuated f \<Longrightarrow> residuated g \<Longrightarrow> conjugate (\<lambda>x. f (g x)) x = conjugate g (conjugate f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> conjugate (\<lambda>x. f (g x)) x = conjugate g (conjugate f x)
[PROOF STEP]
using conjugate_comp
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>residuated ?f; residuated ?g\<rbrakk> \<Longrightarrow> conjugate (?f \<circ> ?g) = conjugate ?g \<circ> conjugate ?f

goal (1 subgoal):
 1. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> conjugate (\<lambda>x. f (g x)) x = conjugate g (conjugate f x)
[PROOF STEP]
by (simp add: comp_def)


[STATEMENT]
lemma PNT2_imp_PNT3:
  assumes "(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)"
  shows   "nth_prime \<sim>[at_top] (\<lambda>n. n * ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
have "(\<lambda>n. nth_prime n) \<sim>[at_top] (\<lambda>n. \<pi> (nth_prime n) * ln (\<pi> (nth_prime n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>n. \<pi> (real (nth_prime n)) * ln (\<pi> (real (nth_prime n))))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>n. \<pi> (real (nth_prime n)) * ln (\<pi> (real (nth_prime n))))
[PROOF STEP]
by (rule asymp_equiv_symI [OF asymp_equiv_compose'])
       (auto intro!: filterlim_compose[OF filterlim_real_sequentially nth_prime_at_top])
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>n. \<pi> (real (nth_prime n)) * ln (\<pi> (real (nth_prime n))))

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>n. \<pi> (real (nth_prime n)) * ln (\<pi> (real (nth_prime n))))

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
have "\<dots> = (\<lambda>n. real (Suc n) * ln (real (Suc n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<pi> (real (nth_prime n)) * ln (\<pi> (real (nth_prime n)))) = (\<lambda>n. real (Suc n) * ln (real (Suc n)))
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<pi> (real (nth_prime n)) * ln (\<pi> (real (nth_prime n)))) = (\<lambda>n. real (Suc n) * ln (real (Suc n)))

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<pi> (real (nth_prime n)) * ln (\<pi> (real (nth_prime n)))) = (\<lambda>n. real (Suc n) * ln (real (Suc n)))

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
have "\<dots> \<sim>[at_top] (\<lambda>n. real n * ln (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real (Suc n) * ln (real (Suc n))) \<sim>[sequentially] (\<lambda>n. real n * ln (real n))
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real (Suc n) * ln (real (Suc n))) \<sim>[sequentially] (\<lambda>n. real n * ln (real n))

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>c d. c \<sim>[sequentially] d \<Longrightarrow> c \<sim>[sequentially] d) \<Longrightarrow> (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>a. real a * ln (real a))
[PROOF STEP]
show "nth_prime \<sim>[at_top] (\<lambda>n. n * ln n)"
[PROOF STATE]
proof (prove)
using this:
(\<And>c d. c \<sim>[sequentially] d \<Longrightarrow> c \<sim>[sequentially] d) \<Longrightarrow> (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>a. real a * ln (real a))

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (nth_prime x)) \<sim>[sequentially] (\<lambda>x. real x * ln (real x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma somegcd_meet:
  fixes G (structure)
  assumes carr: "a \<in> carrier G"  "b \<in> carrier G"
  shows "somegcd G a b = meet (division_rel G) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. somegcd G a b = a \<sqinter>\<^bsub>division_rel G\<^esub> b
[PROOF STEP]
by (simp add: somegcd_def meet_def inf_def gcdof_greatestLower[OF carr])


[STATEMENT]
lemma lattice_of_altdef_lincomb:
  assumes "set fs \<subseteq> carrier_vec n"
  shows "lattice_of fs = {y. \<exists>f. lincomb (of_int \<circ> f) (set fs) = y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of fs = {y. \<exists>f. lincomb (of_int \<circ> f) (set fs) = y}
[PROOF STEP]
unfolding lincomb_def lattice_of_altdef[OF assms] image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>UNIV. y = (\<Oplus>\<^bsub>V\<^esub>v\<in>set fs. of_int (x v) \<cdot>\<^sub>v v)} = {y. \<exists>f. (\<Oplus>\<^bsub>V\<^esub>v\<in>set fs. (of_int \<circ> f) v \<cdot>\<^sub>v v) = y}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Ring) coprime_n_idealsTr4:"\<lbrakk>(\<forall>k \<le> (Suc n). ideal R (J k)) \<and>
   (\<forall>i \<le> (Suc n). \<forall>j \<le> (Suc n). i \<noteq> j \<longrightarrow>
    coprime_ideals R (J i) (J j))\<rbrakk> \<Longrightarrow> coprime_ideals R (i\<Pi>\<^bsub>R,n\<^esub> J) (J (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>k\<le>Suc n. ideal R (J k)) \<and> (\<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i \<noteq> j \<longrightarrow> coprime_ideals R (J i) (J j)) \<Longrightarrow> coprime_ideals R (i\<Pi>\<^bsub>R,n\<^esub> J) (J (Suc n))
[PROOF STEP]
apply (simp add:coprime_n_idealsTr3)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma evens_closure:
  shows "closure evens = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure evens = UNIV
[PROOF STEP]
using evens_infinite
[PROOF STATE]
proof (prove)
using this:
infinite evens

goal (1 subgoal):
 1. closure evens = UNIV
[PROOF STEP]
by (rule cofinite_closure_infinite)


[STATEMENT]
lemma iT_Div_icard: "
  \<lbrakk> 0 < d; finite I \<Longrightarrow> Max I div d \<le> n\<rbrakk> \<Longrightarrow>
  icard (I \<oslash> d) =
  (if finite I then enat (\<Sum>k\<le>n. if I \<inter> [k * d\<dots>,d - Suc 0] = {} then 0 else Suc 0) else \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < d; finite I \<Longrightarrow> Max I div d \<le> n\<rbrakk> \<Longrightarrow> icard (I \<oslash> d) = (if finite I then enat (\<Sum>k\<le>n. if I \<inter> [k * d\<dots>,d - Suc 0] = {} then 0 else Suc 0) else \<infinity>)
[PROOF STEP]
by (simp add: icard_finite iT_Div_finite_iff iT_Div_card)


[STATEMENT]
lemma SUP_ereal_add_right:
  fixes c :: ereal
  shows "I \<noteq> {} \<Longrightarrow> c \<noteq> -\<infinity> \<Longrightarrow> (SUP i\<in>I. c + f i) = c + (SUP i\<in>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; c \<noteq> - \<infinity>\<rbrakk> \<Longrightarrow> (SUP i\<in>I. c + f i) = c + Sup (f ` I)
[PROOF STEP]
using SUP_ereal_add_left[of I c f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>I \<noteq> {}; c \<noteq> - \<infinity>\<rbrakk> \<Longrightarrow> (SUP i\<in>I. f i + c) = Sup (f ` I) + c

goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; c \<noteq> - \<infinity>\<rbrakk> \<Longrightarrow> (SUP i\<in>I. c + f i) = c + Sup (f ` I)
[PROOF STEP]
by (simp add: add.commute)


[STATEMENT]
lemma mset_map_filter: "mset (map v (filter (\<lambda>e. c e) t)) + mset (map v (filter (\<lambda>e. \<not>(c e)) t)) = mset (map v t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map v (filter c t)) + mset (map v (filter (\<lambda>e. \<not> c e) t)) = mset (map v t)
[PROOF STEP]
by (induct t, auto)


[STATEMENT]
lemma max_idx_list:
  assumes "i < length x13 "
  shows " n * height (x13 !i) \<le> Suc (Suc (n * max (height x14) (Max (height ` set x13))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n * height (x13 ! i) \<le> Suc (Suc (n * max (height x14) (Max (height ` set x13))))
[PROOF STEP]
by (metis assms height_i_max less_Suc_eq mult_le_mono2 nat_less_le)


[STATEMENT]
lemma exp_zero [simp]: "exp 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (0::'a) = (1::'a)
[PROOF STEP]
unfolding exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (0::'a) ^ n /\<^sub>R fact n) = (1::'a)
[PROOF STEP]
by (simp add: scaleR_conv_of_real)


[STATEMENT]
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S = (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)
[PROOF STEP]
by (simp add: open_dist subset_eq Ball_def dist_commute)


[STATEMENT]
lemma leftrec_41: "n > 0 \<Longrightarrow> leftrec u v lc rc ((4 * real m + 1) / 2 ^ (Suc n)) = leftrec u v lc rc ((2 * real m + 1) / 2^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> leftrec u v lc rc ((4 * real m + 1) / 2 ^ Suc n) = leftrec u v lc rc ((2 * real m + 1) / 2 ^ n)
[PROOF STEP]
unfolding dyad_rec2_def dyad_rec_41_times2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> fst (case dyad_rec (\<lambda>z. (u, v)) (\<lambda>(a, b). (a, lc a b (midpoint a b))) (\<lambda>(a, b). (rc a b (midpoint a b), b)) (2 * (2 * real m + 1) / 2 ^ n) of (a, b) \<Rightarrow> (a, lc a b (midpoint a b))) = fst (dyad_rec (\<lambda>z. (u, v)) (\<lambda>(a, b). (a, lc a b (midpoint a b))) (\<lambda>(a, b). (rc a b (midpoint a b), b)) (2 * ((2 * real m + 1) / 2 ^ n)))
[PROOF STEP]
by (simp add: case_prod_beta)


[STATEMENT]
lemma Max_union_Max_out_insert:
  "\<lbrakk>finite Y; \<forall>y \<in> Y. finite (f y); \<forall>y \<in> Y. f y \<noteq> {}; Y \<noteq> {}\<rbrakk>
    \<Longrightarrow> Max (insert x (\<Union>y\<in>Y. {Max (f y)})) = Max (insert x (\<Union>y\<in>Y. f y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite Y; \<forall>y\<in>Y. finite (f y); \<forall>y\<in>Y. f y \<noteq> {}; Y \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert x (\<Union>y\<in>Y. {Max (f y)})) = Max (insert x (\<Union> (f ` Y)))
[PROOF STEP]
using Max_union_Max_out[of Y f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite Y; \<forall>y\<in>Y. finite (f y); \<forall>y\<in>Y. f y \<noteq> {}; Y \<noteq> {}\<rbrakk> \<Longrightarrow> Max (\<Union>y\<in>Y. {Max (f y)}) = Max (\<Union> (f ` Y))

goal (1 subgoal):
 1. \<lbrakk>finite Y; \<forall>y\<in>Y. finite (f y); \<forall>y\<in>Y. f y \<noteq> {}; Y \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert x (\<Union>y\<in>Y. {Max (f y)})) = Max (insert x (\<Union> (f ` Y)))
[PROOF STEP]
by simp


[STATEMENT]
lemma luckiestFind_eval' : "
      (\<exists>xs. (length xs = var + 1) \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) =
      (\<exists>xs. (length xs = var + 1) \<and> eval (luckiestFind var L F) (xs @ \<Gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = var + 1 \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) = (\<exists>xs. length xs = var + 1 \<and> eval (luckiestFind var L F) (xs @ \<Gamma>))
[PROOF STEP]
apply(rule step_converter[of luckiestFind var L F \<Gamma>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs var L F \<Gamma>. length xs = var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (luckiestFind var L F) (xs @ x # \<Gamma>))
[PROOF STEP]
using luckiestFind_eval
[PROOF STATE]
proof (prove)
using this:
length ?xs = ?var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom ?L @ ?F)) (?xs @ x # ?\<Gamma>)) = (\<exists>x. eval (luckiestFind ?var ?L ?F) (?xs @ x # ?\<Gamma>))

goal (1 subgoal):
 1. \<And>xs var L F \<Gamma>. length xs = var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (luckiestFind var L F) (xs @ x # \<Gamma>))
[PROOF STEP]
by blast


[STATEMENT]
lemma allocationReverseInjective:
  "a \<in> allAllocations N G =
   (a^-1 \<in> injections (Range a) N  &  Range a \<in> all_partitions G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> allAllocations N G) = (a\<inverse> \<in> injections (Range a) N \<and> Range a \<in> all_partitions G)
[PROOF STEP]
using lm034 lm035
[PROOF STATE]
proof (prove)
using this:
?a \<in> allAllocations ?N ?G \<Longrightarrow> ?a\<inverse> \<in> injections (Range ?a) ?N \<and> Range ?a \<in> all_partitions ?G
\<lbrakk>?a\<inverse> \<in> injections (Range ?a) ?N; Range ?a \<in> all_partitions ?G\<rbrakk> \<Longrightarrow> ?a \<in> allAllocations ?N ?G

goal (1 subgoal):
 1. (a \<in> allAllocations N G) = (a\<inverse> \<in> injections (Range a) N \<and> Range a \<in> all_partitions G)
[PROOF STEP]
by metis


[STATEMENT]
lemma pq_eq2: "int p * int q = (2 * ((int p * int q - 1) div 2)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int p * int q = 2 * ((int p * int q - 1) div 2) + 1
[PROOF STEP]
using odd_p odd_q
[PROOF STATE]
proof (prove)
using this:
odd p
odd q

goal (1 subgoal):
 1. int p * int q = 2 * ((int p * int q - 1) div 2) + 1
[PROOF STEP]
by simp


[STATEMENT]
lemma finprod_mono_neutral_cong:
  assumes [simp]: "finite B" "finite A"
    and *: "\<And>i. i \<in> B - A \<Longrightarrow> h i = \<one>" "\<And>i. i \<in> A - B \<Longrightarrow> g i = \<one>"
    and gh: "\<And>x. x \<in> A \<inter> B \<Longrightarrow> g x = h x"
    and g: "g \<in> A \<rightarrow> carrier G"
    and h: "h \<in> B \<rightarrow> carrier G"
 shows "finprod G g A = finprod G h B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
have "finprod G g A = finprod G g (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G g A = finprod G g (A \<inter> B)
[PROOF STEP]
by (rule finprod_mono_neutral_cong_right) (use assms in auto)
[PROOF STATE]
proof (state)
this:
finprod G g A = finprod G g (A \<inter> B)

goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
finprod G g A = finprod G g (A \<inter> B)

goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
have "\<dots> = finprod G h (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G g (A \<inter> B) = finprod G h (A \<inter> B)
[PROOF STEP]
by (rule finprod_cong) (use assms in auto)
[PROOF STATE]
proof (state)
this:
finprod G g (A \<inter> B) = finprod G h (A \<inter> B)

goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
finprod G g (A \<inter> B) = finprod G h (A \<inter> B)

goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
have "\<dots> = finprod G h B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G h (A \<inter> B) = finprod G h B
[PROOF STEP]
by (rule finprod_mono_neutral_cong_left) (use assms in auto)
[PROOF STATE]
proof (state)
this:
finprod G h (A \<inter> B) = finprod G h B

goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finprod G g A = finprod G h B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finprod G g A = finprod G h B

goal (1 subgoal):
 1. finprod G g A = finprod G h B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finprod G g A = finprod G h B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr256':
  "62 ^ 256 = (- 1::fin7681 mod_ring)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
have calc1: "62^16 = (1366::fin7681 mod_ring)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 62 ^ 16 = 1366
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
62 ^ 16 = 1366

goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
have calc2: "1366^16 = (-1::fin7681 mod_ring)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1366 ^ 16 = - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1366 ^ 16 = - 1

goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
have "(62::fin7681 mod_ring)^256 = (62^16)^16"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 62 ^ 256 = (62 ^ 16) ^ 16
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) num_double numeral_times_numeral power_mult)
[PROOF STATE]
proof (state)
this:
62 ^ 256 = (62 ^ 16) ^ 16

goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
62 ^ 256 = (62 ^ 16) ^ 16

goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
have "\<dots> = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (62 ^ 16) ^ 16 = - 1
[PROOF STEP]
unfolding calc1 calc2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(62 ^ 16) ^ 16 = - 1

goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
62 ^ 256 = - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
62 ^ 256 = - 1

goal (1 subgoal):
 1. 62 ^ 256 = - 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
62 ^ 256 = - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma choose_odd_sum:
  assumes "n > 0"
  shows "2 * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else 0) = (2 ^ n :: 'a::comm_ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "2 ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (-1) ^ i * of_nat (n choose i) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
using choose_row_sum[of n]
[PROOF STATE]
proof (prove)
using this:
sum ((choose) n) {..n} = 2 ^ n

goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: choose_alternating_sum assms atLeast0AtMost of_nat_sum[symmetric])
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) - (-1) ^ i * of_nat (n choose i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) - (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: sum_subtractf)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) - (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) - (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) - (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = 2 * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) - (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
by (subst sum_distrib_left, intro sum.cong) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) - (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(2::'a) * (\<Sum>i\<le>n. if odd i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_le_zero [simp]: "\<lceil>x\<rceil> \<le> 0 \<longleftrightarrow> x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> \<le> 0) = (x \<le> (0::'a))
[PROOF STEP]
by (simp add: ceiling_le_iff)


[STATEMENT]
lemma fps_lr_inverse_unique_divring:
  fixes   f g :: "'a ::division_ring fps"
  assumes fg: "f * g = 1"
  shows   "fps_left_inverse g (f$0) = f"
  and     "fps_right_inverse f (g$0) = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_left_inverse g (f $ 0) = f &&& fps_right_inverse f (g $ 0) = g
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fps_left_inverse g (f $ 0) = f
 2. fps_right_inverse f (g $ 0) = g
[PROOF STEP]
from fg
[PROOF STATE]
proof (chain)
picking this:
f * g = 1
[PROOF STEP]
have "f$0 * g$0 = 1"
[PROOF STATE]
proof (prove)
using this:
f * g = 1

goal (1 subgoal):
 1. f $ 0 * g $ 0 = (1::'a)
[PROOF STEP]
using fps_mult_nth_0[of f g]
[PROOF STATE]
proof (prove)
using this:
f * g = 1
(f * g) $ 0 = f $ 0 * g $ 0

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

goal (2 subgoals):
 1. fps_left_inverse g (f $ 0) = f
 2. fps_right_inverse f (g $ 0) = g
[PROOF STEP]
hence "g$0 * f$0 = 1"
[PROOF STATE]
proof (prove)
using this:
f $ 0 * g $ 0 = (1::'a)

goal (1 subgoal):
 1. g $ 0 * f $ 0 = (1::'a)
[PROOF STEP]
using inverse_unique[of "f$0"] left_inverse[of "f$0"]
[PROOF STATE]
proof (prove)
using this:
f $ 0 * g $ 0 = (1::'a)
f $ 0 * ?b = (1::'a) \<Longrightarrow> inverse (f $ 0) = ?b
f $ 0 \<noteq> (0::'a) \<Longrightarrow> inverse (f $ 0) * f $ 0 = (1::'a)

goal (1 subgoal):
 1. g $ 0 * f $ 0 = (1::'a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
g $ 0 * f $ 0 = (1::'a)

goal (2 subgoals):
 1. fps_left_inverse g (f $ 0) = f
 2. fps_right_inverse f (g $ 0) = g
[PROOF STEP]
thus "fps_left_inverse g (f$0) = f" "fps_right_inverse f (g$0) = g"
[PROOF STATE]
proof (prove)
using this:
g $ 0 * f $ 0 = (1::'a)

goal (1 subgoal):
 1. fps_left_inverse g (f $ 0) = f &&& fps_right_inverse f (g $ 0) = g
[PROOF STEP]
using fg fps_lr_inverse_unique_ring1
[PROOF STATE]
proof (prove)
using this:
g $ 0 * f $ 0 = (1::'a)
f * g = 1
\<lbrakk>?f * ?g = 1; ?g $ 0 * ?f $ 0 = (1::?'a)\<rbrakk> \<Longrightarrow> fps_left_inverse ?g (?f $ 0) = ?f
\<lbrakk>?f * ?g = 1; ?g $ 0 * ?f $ 0 = (1::?'a)\<rbrakk> \<Longrightarrow> fps_right_inverse ?f (?g $ 0) = ?g

goal (1 subgoal):
 1. fps_left_inverse g (f $ 0) = f &&& fps_right_inverse f (g $ 0) = g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fps_left_inverse g (f $ 0) = f
fps_right_inverse f (g $ 0) = g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma combine_eq_foldr:
  "combine Ks Us = foldr (\<lambda>(k, u). \<lambda>l. (k \<otimes> u) \<oplus> l) (zip Ks Us) \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. combine Ks Us = foldr (\<lambda>(k, u). (\<oplus>) (k \<otimes> u)) (zip Ks Us) \<zero>
[PROOF STEP]
by (induct Ks Us rule: combine.induct) (auto)


[STATEMENT]
lemma mem_cbox_2D:
  fixes x :: real and y :: real
  shows "x\<^sub>0 \<le> x \<and> x \<le> x\<^sub>1 \<and> y\<^sub>0 \<le> y \<and> y \<le> y\<^sub>1 \<longleftrightarrow> (x, y) \<in> cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>1, y\<^sub>1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sub>0 \<le> x \<and> x \<le> x\<^sub>1 \<and> y\<^sub>0 \<le> y \<and> y \<le> y\<^sub>1) = ((x, y) \<in> cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>1, y\<^sub>1))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma compactE: (*related to COMPACT_IMP_HEINE_BOREL in HOL Light*)
  assumes "compact S" "S \<subseteq> \<Union>\<T>" "\<And>B. B \<in> \<T> \<Longrightarrow> open B"
  obtains \<T>' where "\<T>' \<subseteq> \<T>" "finite \<T>'" "S \<subseteq> \<Union>\<T>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<T>'. \<lbrakk>\<T>' \<subseteq> \<T>; finite \<T>'; S \<subseteq> \<Union> \<T>'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson assms compact_eq_Heine_Borel)


[STATEMENT]
lemma walk_length_app: "xs \<noteq> [] \<Longrightarrow> ys \<noteq> [] \<Longrightarrow> walk_length (xs @ ys) = walk_length xs + walk_length ys + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; ys \<noteq> []\<rbrakk> \<Longrightarrow> walk_length (xs @ ys) = walk_length xs + walk_length ys + 1
[PROOF STEP]
apply (induct xs rule: walk_edges.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>[] \<noteq> []; ys \<noteq> []\<rbrakk> \<Longrightarrow> walk_length ([] @ ys) = walk_length [] + walk_length ys + 1
 2. \<And>x. \<lbrakk>[x] \<noteq> []; ys \<noteq> []\<rbrakk> \<Longrightarrow> walk_length ([x] @ ys) = walk_length [x] + walk_length ys + 1
 3. \<And>x y ysa. \<lbrakk>\<lbrakk>y # ysa \<noteq> []; ys \<noteq> []\<rbrakk> \<Longrightarrow> walk_length ((y # ysa) @ ys) = walk_length (y # ysa) + walk_length ys + 1; x # y # ysa \<noteq> []; ys \<noteq> []\<rbrakk> \<Longrightarrow> walk_length ((x # y # ysa) @ ys) = walk_length (x # y # ysa) + walk_length ys + 1
[PROOF STEP]
apply (simp_all add: walk_length_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ys \<noteq> [] \<Longrightarrow> length (walk_edges (x # ys)) = Suc (length (walk_edges ys))
[PROOF STEP]
using walk_edges_singleton_app
[PROOF STATE]
proof (prove)
using this:
?ys \<noteq> [] \<Longrightarrow> walk_edges ([?x] @ ?ys) = {?x, hd ?ys} # walk_edges ?ys

goal (1 subgoal):
 1. \<And>x. ys \<noteq> [] \<Longrightarrow> length (walk_edges (x # ys)) = Suc (length (walk_edges ys))
[PROOF STEP]
by force


[STATEMENT]
lemma inorder_node32: "height r > 0 \<Longrightarrow>
  inorder (treeD (node32 l a m' b r)) = inorder l @ a # inorder (treeD m') @ b # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height r \<Longrightarrow> inorder (treeD (node32 l a m' b r)) = inorder l @ a # inorder (treeD m') @ b # inorder r
[PROOF STEP]
by(induct l a m' b r rule: node32.induct) auto


[STATEMENT]
lemma  Z_I_unitary:
  shows "unitary Z_I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary Z_I
[PROOF STEP]
unfolding Z_I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary (Z \<Otimes> 1\<^sub>m 2)
[PROOF STEP]
using tensor_mat_unitary[of Z "1\<^sub>m 2"] Z_carrier unitary_Z
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary Z; Complex_Matrix.unitary (1\<^sub>m 2); 0 < dim_row Z; 0 < dim_row (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (Z \<Otimes> 1\<^sub>m 2)
Z \<in> carrier_mat 2 2
Complex_Matrix.unitary Z

goal (1 subgoal):
 1. Complex_Matrix.unitary (Z \<Otimes> 1\<^sub>m 2)
[PROOF STEP]
using unitary_one
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary Z; Complex_Matrix.unitary (1\<^sub>m 2); 0 < dim_row Z; 0 < dim_row (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (Z \<Otimes> 1\<^sub>m 2)
Z \<in> carrier_mat 2 2
Complex_Matrix.unitary Z
Complex_Matrix.unitary (1\<^sub>m ?n)

goal (1 subgoal):
 1. Complex_Matrix.unitary (Z \<Otimes> 1\<^sub>m 2)
[PROOF STEP]
by auto


[STATEMENT]
lemma size_greater_than_median:
  "size {#y \<in># mset xs. y > median xs#} \<le> length xs div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
proof (cases "xs = []")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
xs \<noteq> []

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
hence "length xs > 0"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. 0 < length xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < length xs

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
hence "(length xs - 1) div 2 < length xs"
[PROOF STATE]
proof (prove)
using this:
0 < length xs

goal (1 subgoal):
 1. (length xs - 1) div 2 < length xs
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(length xs - 1) div 2 < length xs

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
hence "size {#y \<in># mset (sort xs). y > median xs#} \<le>
           size (mset (drop (Suc ((length xs - 1) div 2)) (sort xs)))"
[PROOF STATE]
proof (prove)
using this:
(length xs - 1) div 2 < length xs

goal (1 subgoal):
 1. size (filter_mset ((<) (median xs)) (mset (sort xs))) \<le> size (mset (drop (Suc ((length xs - 1) div 2)) (sort xs)))
[PROOF STEP]
unfolding median_def select_def
[PROOF STATE]
proof (prove)
using this:
(length xs - 1) div 2 < length xs

goal (1 subgoal):
 1. size (filter_mset ((<) (sort xs ! ((length xs - 1) div 2))) (mset (sort xs))) \<le> size (mset (drop (Suc ((length xs - 1) div 2)) (sort xs)))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
(length xs - 1) div 2 < length xs
xs \<noteq> []

goal (1 subgoal):
 1. size (filter_mset ((<) (sort xs ! ((length xs - 1) div 2))) (mset (sort xs))) \<le> size (mset (drop (Suc ((length xs - 1) div 2)) (sort xs)))
[PROOF STEP]
by (intro size_mset_mono sorted_filter_greater_subset_drop) auto
[PROOF STATE]
proof (state)
this:
size (filter_mset ((<) (median xs)) (mset (sort xs))) \<le> size (mset (drop (Suc ((length xs - 1) div 2)) (sort xs)))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
hence "size (filter_mset (\<lambda>y. y > median xs) (mset xs)) \<le>
           length xs - Suc ((length xs - 1) div 2)"
[PROOF STATE]
proof (prove)
using this:
size (filter_mset ((<) (median xs)) (mset (sort xs))) \<le> size (mset (drop (Suc ((length xs - 1) div 2)) (sort xs)))

goal (1 subgoal):
 1. size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs - Suc ((length xs - 1) div 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs - Suc ((length xs - 1) div 2)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs - Suc ((length xs - 1) div 2)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
have "\<dots> = length xs div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs - Suc ((length xs - 1) div 2) = length xs div 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
length xs - Suc ((length xs - 1) div 2) = length xs div 2

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
 2. xs \<noteq> [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2

goal (1 subgoal):
 1. size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2

goal (1 subgoal):
 1. xs = [] \<Longrightarrow> size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2
[PROOF STEP]
qed auto


[STATEMENT]
lemma permutep_monom_of_set:
  assumes "bij f"
  shows   "permutep f (monom_of_set A) = monom_of_set (f -` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutep f (monom_of_set A) = monom_of_set (f -` A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij f

goal (1 subgoal):
 1. permutep f (monom_of_set A) = monom_of_set (f -` A)
[PROOF STEP]
by transfer (auto simp: fun_eq_iff bij_is_inj finite_vimage_iff)


[STATEMENT]
lemma scaleR_half_double [simp]:
  fixes a :: "'a::real_vector"
  shows "(1 / 2) *\<^sub>R (a + a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>R (a + a) = a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>R (a + a) = a
[PROOF STEP]
have "\<And>r. r *\<^sub>R (a + a) = (r * 2) *\<^sub>R a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. r *\<^sub>R (a + a) = (r * 2) *\<^sub>R a
[PROOF STEP]
by (metis scaleR_2 scaleR_scaleR)
[PROOF STATE]
proof (state)
this:
?r *\<^sub>R (a + a) = (?r * 2) *\<^sub>R a

goal (1 subgoal):
 1. (1 / 2) *\<^sub>R (a + a) = a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?r *\<^sub>R (a + a) = (?r * 2) *\<^sub>R a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?r *\<^sub>R (a + a) = (?r * 2) *\<^sub>R a

goal (1 subgoal):
 1. (1 / 2) *\<^sub>R (a + a) = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 / 2) *\<^sub>R (a + a) = a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem LT17: "\<turnstile> ((F \<or> G) \<leadsto> H) = ((F \<leadsto> H) \<and> (G \<leadsto> H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (F \<or> G \<leadsto> H) = ((F \<leadsto> H) \<and> (G \<leadsto> H))
[PROOF STEP]
by (auto elim: LT14[unlift_rule] LT15[unlift_rule]
                 LT16[unlift_rule])


[STATEMENT]
lemma ccSUP_commute: "countable A \<Longrightarrow> countable B \<Longrightarrow> (SUP i\<in>A. SUP j\<in>B. f i j) = (SUP j\<in>B. SUP i\<in>A. f i j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; countable B\<rbrakk> \<Longrightarrow> (SUP i\<in>A. Sup (f i ` B)) = (SUP j\<in>B. SUP i\<in>A. f i j)
[PROOF STEP]
by (iprover intro: ccSUP_upper ccSUP_least order_trans order.antisym)


[STATEMENT]
lemma absolutely_integrable_sum:
  fixes f :: "'a \<Rightarrow> 'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  assumes "finite T" and "\<And>a. a \<in> T \<Longrightarrow> (f a) absolutely_integrable_on S"
  shows "(\<lambda>x. sum (\<lambda>a. f a x) T) absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>a\<in>T. f a x) absolutely_integrable_on S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite T
?a \<in> T \<Longrightarrow> f ?a absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>a\<in>T. f a x) absolutely_integrable_on S
[PROOF STEP]
by induction auto


[STATEMENT]
lemma algebraic_diff_cancel_right [simp]:
  assumes "algebraic y"
  shows   "algebraic (x - y) \<longleftrightarrow> algebraic x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic (x - y) = algebraic x
[PROOF STEP]
using algebraic_add_cancel_right[of "-y" x] assms
[PROOF STATE]
proof (prove)
using this:
algebraic (- y) \<Longrightarrow> algebraic (x + - y) = algebraic x
algebraic y

goal (1 subgoal):
 1. algebraic (x - y) = algebraic x
[PROOF STEP]
by (simp del: algebraic_add_cancel_right)


[STATEMENT]
lemma connected_space_iff_connected_component:
   "connected_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. \<forall>y \<in> topspace X. connected_component_of X x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_space X = (\<forall>x\<in>topspace X. \<forall>y\<in>topspace X. connected_component_of X x y)
[PROOF STEP]
by (simp add: connected_component_of_def connected_space_subconnected)


[STATEMENT]
lemma "!!a::int. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |]
      ==> a+a+a+a <= l+l+l+l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a + b + c + d \<le> i + j + k + l; a \<le> b; b \<le> c; c \<le> d; i \<le> j; j \<le> k; k \<le> l\<rbrakk> \<Longrightarrow> a + a + a + a \<le> l + l + l + l
[PROOF STEP]
by arith


[STATEMENT]
lemma span_carrier_lin_indpt_card_n:
  assumes "W \<subseteq> carrier_vec n" "card W = n" "lin_indpt W"
  shows "span W = carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span W = carrier_vec n
[PROOF STEP]
using assms basis_def dim_is_n dim_li_is_basis fin_dim_li_fin
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> carrier_vec n
card W = n
lin_indpt W
basis ?A = (lin_indpt ?A \<and> local.span ?A = carrier_vec n \<and> ?A \<subseteq> carrier_vec n)
local.dim = n
\<lbrakk>fin_dim; finite ?A; ?A \<subseteq> carrier_vec n; lin_indpt ?A; local.dim \<le> card ?A\<rbrakk> \<Longrightarrow> basis ?A
\<lbrakk>fin_dim; lin_indpt ?A; ?A \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. local.span W = carrier_vec n
[PROOF STEP]
by simp


[STATEMENT]
lemma card_stabilizer_sumset_divide_sumset:
  "card (stabilizer (sumset A B)) dvd card (sumset A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (stabilizer (sumset A B)) dvd card (sumset A B)
[PROOF STEP]
using card_divide_sumset
  sumset_commute sumset_stabilizer_eq_self sumset_subset_carrier
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> G \<Longrightarrow> card (stabilizer ?Aa) dvd card (sumset ?A (stabilizer ?Aa))
sumset ?A ?B = sumset ?B ?A
?A \<subseteq> G \<Longrightarrow> sumset (stabilizer ?A) ?A = ?A
sumset ?A ?B \<subseteq> G

goal (1 subgoal):
 1. card (stabilizer (sumset A B)) dvd card (sumset A B)
[PROOF STEP]
by metis


[STATEMENT]
lemma "Suc n + Suc m = n + Suc (Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n + Suc m = n + Suc (Suc m)
[PROOF STEP]
by normalization


[STATEMENT]
lemma specializedtoprimes1:
  fixes p::nat
  shows "\<lbrakk>prime p; prime q; p \<noteq> q; a mod p = b mod p ; a mod q = b mod q\<rbrakk>
         \<Longrightarrow> a mod (p*q) = b mod (p*q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q; a mod p = b mod p; a mod q = b mod q\<rbrakk> \<Longrightarrow> a mod (p * q) = b mod (p * q)
[PROOF STEP]
by (metis equalmodstrick1 equalmodstrick2 productdivides)


[STATEMENT]
lemma mset_factorsI[intro!]:
  assumes "\<And>f. f \<in># F \<Longrightarrow> irreducible f" and "F \<noteq> {#}" and "prod_mset F = p"
  shows "mset_factors F p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_factors F p
[PROOF STEP]
unfolding mset_factors_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<noteq> {#} \<and> (\<forall>f. f \<in># F \<longrightarrow> irreducible f) \<and> p = \<Prod>\<^sub># F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?f1 \<in># F \<Longrightarrow> irreducible ?f1
F \<noteq> {#}
\<Prod>\<^sub># F = p

goal (1 subgoal):
 1. F \<noteq> {#} \<and> (\<forall>f. f \<in># F \<longrightarrow> irreducible f) \<and> p = \<Prod>\<^sub># F
[PROOF STEP]
by auto


[STATEMENT]
theorem updVal_commute:
assumes "xs \<noteq> ys \<or> x \<noteq> y"
shows "((val (x := sX)_xs) (y := sY)_ys) = ((val (y := sY)_ys) (x := sX)_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (x := sX)_xs (y := sY)_ys = val (y := sY)_ys (x := sX)_xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> ys \<or> x \<noteq> y

goal (1 subgoal):
 1. val (x := sX)_xs (y := sY)_ys = val (y := sY)_ys (x := sX)_xs
[PROOF STEP]
unfolding updVal_def
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> ys \<or> x \<noteq> y

goal (1 subgoal):
 1. (\<lambda>ysa ya. if ysa = ys \<and> ya = y then sY else if ysa = xs \<and> ya = x then sX else val ysa ya) = (\<lambda>ysa ya. if ysa = xs \<and> ya = x then sX else if ysa = ys \<and> ya = y then sY else val ysa ya)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma openE[elim?]:
  assumes "open S" "x\<in>S"
  obtains e where "e>0" "ball x e \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
open S
x \<in> S

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding open_contains_ball
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S
x \<in> S

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma smult_add_left: "smult (a + b) p = smult a p + smult b p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (a + b) p = smult a p + smult b p
[PROOF STEP]
by (rule poly_eqI) (simp add: algebra_simps)


[STATEMENT]
lemma iterator_to_ordered_iterator_mergesort_correct :
assumes lin : "\<And>x y. (R x y) \<or> (R y x)"
    and trans_R: "\<And>x y z. R x y \<Longrightarrow> R y z \<Longrightarrow> R x z"
    and it_OK: "set_iterator it S0"
shows "set_iterator_genord (iterator_to_ordered_iterator_mergesort R it) S0 R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_genord (iterator_to_ordered_iterator_mergesort R it) S0 R
[PROOF STEP]
unfolding iterator_to_ordered_iterator_mergesort_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_genord (iterator_to_ordered_iterator (mergesort_by_rel R) it) S0 R
[PROOF STEP]
apply (rule iterator_to_ordered_iterator_correct [OF _ it_OK])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l. sorted_wrt R (mergesort_by_rel R l) \<and> mset (mergesort_by_rel R l) = mset l
[PROOF STEP]
apply (simp_all add: sorted_wrt_mergesort_by_rel[OF lin trans_R])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma T_vebt_buildupi_univ:
  assumes "u =2^n "
  shows   "T_vebt_buildupi n  \<le>10 * u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_vebt_buildupi n \<le> 10 * u
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T_vebt_buildupi n \<le> 10 * u
[PROOF STEP]
have "cnt (vebt_buildup n) \<le> 2 * u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnt (vebt_buildup n) \<le> real (2 * u)
[PROOF STEP]
using count_buildup[of n] assms
[PROOF STATE]
proof (prove)
using this:
cnt (vebt_buildup n) \<le> 2 * 2 ^ n
u = 2 ^ n

goal (1 subgoal):
 1. cnt (vebt_buildup n) \<le> real (2 * u)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnt (vebt_buildup n) \<le> real (2 * u)

goal (1 subgoal):
 1. T_vebt_buildupi n \<le> 10 * u
[PROOF STEP]
hence "real (T_vebt_buildupi n)  \<le> 5 * 2 * u"
[PROOF STATE]
proof (prove)
using this:
cnt (vebt_buildup n) \<le> real (2 * u)

goal (1 subgoal):
 1. real (T_vebt_buildupi n) \<le> real (5 * 2 * u)
[PROOF STEP]
using T_vebt_buildupi_cnt'[of n]
[PROOF STATE]
proof (prove)
using this:
cnt (vebt_buildup n) \<le> real (2 * u)
real (T_vebt_buildupi n) \<le> 5 * cnt (vebt_buildup n)

goal (1 subgoal):
 1. real (T_vebt_buildupi n) \<le> real (5 * 2 * u)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (T_vebt_buildupi n) \<le> real (5 * 2 * u)

goal (1 subgoal):
 1. T_vebt_buildupi n \<le> 10 * u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (T_vebt_buildupi n) \<le> real (5 * 2 * u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (T_vebt_buildupi n) \<le> real (5 * 2 * u)

goal (1 subgoal):
 1. T_vebt_buildupi n \<le> 10 * u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
T_vebt_buildupi n \<le> 10 * u

goal:
No subgoals!
[PROOF STEP]
qed