[STATEMENT]
theorem fermat_test_Carmichael_number:
  assumes "Carmichael_number n"
  shows   "fermat_test n = bernoulli_pmf (real (totient n - 1) / real (n - 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fermat_test n = bernoulli_pmf (real (totient n - 1) / real (n - 2))
[PROOF STEP]
proof (rule eq_bernoulli_pmfI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Carmichael_number n
[PROOF STEP]
have n: "n > 3" "odd n"
[PROOF STATE]
proof (prove)
using this:
Carmichael_number n

goal (1 subgoal):
 1. 3 < n &&& odd n
[PROOF STEP]
using Carmichael_number_odd Carmichael_number_gt_3
[PROOF STATE]
proof (prove)
using this:
Carmichael_number n
Carmichael_number ?n \<Longrightarrow> odd ?n
Carmichael_number ?n \<Longrightarrow> 3 < ?n

goal (1 subgoal):
 1. 3 < n &&& odd n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 < n
odd n

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
3 < n
odd n
[PROOF STEP]
have "fermat_test n = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n))"
[PROOF STATE]
proof (prove)
using this:
3 < n
odd n

goal (1 subgoal):
 1. fermat_test n = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n))
[PROOF STEP]
by (simp add: fermat_test_def primality_test_def)
[PROOF STATE]
proof (state)
this:
fermat_test n = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n))

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fermat_test n = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n))

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
have "\<dots> = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n)) = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))
[PROOF STEP]
using n assms lucas_coprime_lemma[of "n - 1" _ n]
[PROOF STATE]
proof (prove)
using this:
3 < n
odd n
Carmichael_number n
\<lbrakk>n - 1 \<noteq> 0; [?a ^ (n - 1) = 1] (mod n)\<rbrakk> \<Longrightarrow> coprime ?a n

goal (1 subgoal):
 1. pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n)) = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))
[PROOF STEP]
by (intro bind_pmf_cong refl) (auto simp: Carmichael_number_def fermat_liar_def)
[PROOF STATE]
proof (state)
this:
pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n)) = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (fermat_liar a n)) = pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
have "pmf \<dots> True = (\<Sum>a=2..<n. indicat_real {True} (coprime a n)) / real (n - 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))) True = (\<Sum>a = 2..<n. indicat_real {True} (coprime a n)) / real (n - 2)
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
3 < n
odd n

goal (1 subgoal):
 1. pmf (pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))) True = (\<Sum>a = 2..<n. indicat_real {True} (coprime a n)) / real (n - 2)
[PROOF STEP]
by (auto simp: pmf_bind_pmf_of_set)
[PROOF STATE]
proof (state)
this:
pmf (pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))) True = (\<Sum>a = 2..<n. indicat_real {True} (coprime a n)) / real (n - 2)

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pmf (pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (coprime a n))) True = (\<Sum>a = 2..<n. indicat_real {True} (coprime a n)) / real (n - 2)

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
have "(\<Sum>a=2..<n. indicat_real {True} (coprime a n)) =
               (\<Sum>a | a \<in> {2..<n} \<and> coprime a n. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a = 2..<n. indicat_real {True} (coprime a n)) = (\<Sum>a | a \<in> {2..<n} \<and> coprime a n. 1)
[PROOF STEP]
by (intro sum.mono_neutral_cong_right) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>a = 2..<n. indicat_real {True} (coprime a n)) = (\<Sum>a | a \<in> {2..<n} \<and> coprime a n. 1)

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a = 2..<n. indicat_real {True} (coprime a n)) = (\<Sum>a | a \<in> {2..<n} \<and> coprime a n. 1)

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
have "\<dots> = card {a\<in>{2..<n}. coprime a n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a | a \<in> {2..<n} \<and> coprime a n. 1) = real (card {a \<in> {2..<n}. coprime a n})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>a | a \<in> {2..<n} \<and> coprime a n. 1) = real (card {a \<in> {2..<n}. coprime a n})

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a | a \<in> {2..<n} \<and> coprime a n. 1) = real (card {a \<in> {2..<n}. coprime a n})

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
have "{a\<in>{2..<n}. coprime a n} = totatives n - {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> {2..<n}. coprime a n} = totatives n - {1}
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
3 < n
odd n

goal (1 subgoal):
 1. {a \<in> {2..<n}. coprime a n} = totatives n - {1}
[PROOF STEP]
by (auto simp: totatives_def order.strict_iff_order[of _ n])
[PROOF STATE]
proof (state)
this:
{a \<in> {2..<n}. coprime a n} = totatives n - {1}

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{a \<in> {2..<n}. coprime a n} = totatives n - {1}

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
have "card \<dots> = totient n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (totatives n - {1}) = totient n - 1
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
3 < n
odd n

goal (1 subgoal):
 1. card (totatives n - {1}) = totient n - 1
[PROOF STEP]
by (subst card_Diff_subset) (auto simp: totient_def)
[PROOF STATE]
proof (state)
this:
card (totatives n - {1}) = totient n - 1

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
show "pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)"
[PROOF STATE]
proof (prove)
using this:
pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
3 < n
odd n

goal (1 subgoal):
 1. pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pmf (fermat_test n) True = real (totient n - 1) / real (n - 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_interval_as_convex_hull:
  fixes a :: "'a::euclidean_space"
  obtains S where "finite S" "cbox a b = convex hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "cbox a b = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
cbox a b = {}

goal (2 subgoals):
 1. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with convex_hull_empty that
[PROOF STATE]
proof (chain)
picking this:
convex hull {} = {}
\<lbrakk>finite ?S; cbox a b = convex hull ?S\<rbrakk> \<Longrightarrow> thesis
cbox a b = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
convex hull {} = {}
\<lbrakk>finite ?S; cbox a b = convex hull ?S\<rbrakk> \<Longrightarrow> thesis
cbox a b = {}

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

goal (1 subgoal):
 1. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
cbox a b \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain S::"'a set" where "finite S" and eq: "cbox 0 One = convex hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>finite S; cbox (0::'a) One = convex hull S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: unit_cube_convex_hull)
[PROOF STATE]
proof (state)
this:
finite S
cbox (0::'a) One = convex hull S

goal (1 subgoal):
 1. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
let ?S = "((+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>S. \<lbrakk>finite S; cbox a b = convex hull S\<rbrakk> \<Longrightarrow> thesis; cbox a b \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite ?S
 2. cbox a b = convex hull ?S
[PROOF STEP]
show "finite ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S)
[PROOF STEP]
by (simp add: \<open>finite S\<close>)
[PROOF STATE]
proof (state)
this:
finite ((+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S)

goal (1 subgoal):
 1. cbox a b = convex hull (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S
[PROOF STEP]
have lin: "linear (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k)
[PROOF STEP]
by (rule linear_compose_sum) (auto simp: algebra_simps linearI)
[PROOF STATE]
proof (state)
this:
linear (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k)

goal (1 subgoal):
 1. cbox a b = convex hull (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S
[PROOF STEP]
show "cbox a b = convex hull ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox a b = convex hull (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S
[PROOF STEP]
using convex_hull_linear_image [OF lin]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` (convex hull ?s) = convex hull (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` ?s

goal (1 subgoal):
 1. cbox a b = convex hull (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S
[PROOF STEP]
by (simp add: convex_hull_translation eq cbox_image_unit_interval [OF False])
[PROOF STATE]
proof (state)
this:
cbox a b = convex hull (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comm_monoid_mult_ow: "class.comm_monoid_mult = comm_monoid_mult_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.comm_monoid_mult = comm_monoid_mult_ow UNIV
[PROOF STEP]
unfolding
    class.comm_monoid_mult_def comm_monoid_mult_ow_def
    class.comm_monoid_mult_axioms_def comm_monoid_mult_ow_axioms_def
    one_ow_def neutral_ow_def
    ab_semigroup_mult_ow
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>times one. ab_semigroup_mult_ow UNIV times \<and> (\<forall>a. times one a = a)) = (\<lambda>times one. ab_semigroup_mult_ow UNIV times \<and> one \<in> UNIV \<and> (\<forall>a. a \<in> UNIV \<longrightarrow> times one a = a))
[PROOF STEP]
by simp


[STATEMENT]
lemma awalk_verts_subset_if_p_sub:
  "\<lbrakk>awalk u p1 v; awalk u p2 v; set p1 \<subseteq> set p2\<rbrakk>
    \<Longrightarrow> set (awalk_verts u p1) \<subseteq> set (awalk_verts u p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>awalk u p1 v; awalk u p2 v; set p1 \<subseteq> set p2\<rbrakk> \<Longrightarrow> set (awalk_verts u p1) \<subseteq> set (awalk_verts u p2)
[PROOF STEP]
using awalk_verts_conv
[PROOF STATE]
proof (prove)
using this:
awalk_verts ?u ?p = (if ?p = [] then [?u] else map (tail G) ?p @ [head G (last ?p)])

goal (1 subgoal):
 1. \<lbrakk>awalk u p1 v; awalk u p2 v; set p1 \<subseteq> set p2\<rbrakk> \<Longrightarrow> set (awalk_verts u p1) \<subseteq> set (awalk_verts u p2)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma line_integral_on_reverse_path:
  assumes "valid_path \<gamma>" "line_integral_exists F basis \<gamma>"
  shows "line_integral F basis \<gamma> = - (line_integral F basis (reversepath \<gamma>))"
        "line_integral_exists F basis (reversepath \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>) &&& line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)
 2. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
obtain i where
    0: "((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i){0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. ((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path \<gamma>
line_integral_exists F basis \<gamma>

goal (1 subgoal):
 1. (\<And>i. ((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding integrable_on_def line_integral_exists_def
[PROOF STATE]
proof (prove)
using this:
valid_path \<gamma>
\<exists>y. ((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral y) {0..1}

goal (1 subgoal):
 1. (\<And>i. ((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1}

goal (2 subgoals):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)
 2. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1}
[PROOF STEP]
have 1: "((\<lambda>x. \<Sum>b\<in>basis. F ((reversepath \<gamma>) x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral -i){0..1}"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1}

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>b\<in>basis. F (reversepath \<gamma> x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral - i) {0..1}
[PROOF STEP]
using has_line_integral_on_reverse_path assms
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1}
\<lbrakk>valid_path ?g; ((\<lambda>x. \<Sum>b\<in>?basis. ?F (?g x) \<bullet> b * (vector_derivative ?g (at x within {0..1}) \<bullet> b)) has_integral ?c) {0..1}\<rbrakk> \<Longrightarrow> ((\<lambda>x. \<Sum>b\<in>?basis. ?F (reversepath ?g x) \<bullet> b * (vector_derivative (reversepath ?g) (at x within {0..1}) \<bullet> b)) has_integral - ?c) {0..1}
valid_path \<gamma>
line_integral_exists F basis \<gamma>

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>b\<in>basis. F (reversepath \<gamma> x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral - i) {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>b\<in>basis. F (reversepath \<gamma> x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral - i) {0..1}

goal (2 subgoals):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)
 2. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<Sum>b\<in>basis. F (reversepath \<gamma> x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral - i) {0..1}
[PROOF STEP]
have rev_line_integral:"line_integral F basis (reversepath \<gamma>) = -i"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>b\<in>basis. F (reversepath \<gamma> x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral - i) {0..1}

goal (1 subgoal):
 1. line_integral F basis (reversepath \<gamma>) = - i
[PROOF STEP]
using line_integral_def Henstock_Kurzweil_Integration.integral_unique
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>b\<in>basis. F (reversepath \<gamma> x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral - i) {0..1}
line_integral ?F ?basis ?g \<equiv> integral {0..1} (\<lambda>x. \<Sum>b\<in>?basis. ?F (?g x) \<bullet> b * (vector_derivative ?g (at x within {0..1}) \<bullet> b))
(?f has_integral ?y) ?k \<Longrightarrow> integral ?k ?f = ?y

goal (1 subgoal):
 1. line_integral F basis (reversepath \<gamma>) = - i
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
line_integral F basis (reversepath \<gamma>) = - i

goal (2 subgoals):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)
 2. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
have line_integral: "line_integral F basis \<gamma> = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F basis \<gamma> = i
[PROOF STEP]
using line_integral_def 0 Henstock_Kurzweil_Integration.integral_unique
[PROOF STATE]
proof (prove)
using this:
line_integral ?F ?basis ?g \<equiv> integral {0..1} (\<lambda>x. \<Sum>b\<in>?basis. ?F (?g x) \<bullet> b * (vector_derivative ?g (at x within {0..1}) \<bullet> b))
((\<lambda>x. \<Sum>b\<in>basis. F (\<gamma> x) \<bullet> b * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> b)) has_integral i) {0..1}
(?f has_integral ?y) ?k \<Longrightarrow> integral ?k ?f = ?y

goal (1 subgoal):
 1. line_integral F basis \<gamma> = i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
line_integral F basis \<gamma> = i

goal (2 subgoals):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)
 2. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
show "line_integral F basis \<gamma> = - (line_integral F basis (reversepath \<gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)
[PROOF STEP]
using line_integral rev_line_integral
[PROOF STATE]
proof (prove)
using this:
line_integral F basis \<gamma> = i
line_integral F basis (reversepath \<gamma>) = - i

goal (1 subgoal):
 1. line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line_integral F basis \<gamma> = - line_integral F basis (reversepath \<gamma>)

goal (1 subgoal):
 1. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
show "line_integral_exists F basis (reversepath \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
using 1 line_integral_exists_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>b\<in>basis. F (reversepath \<gamma> x) \<bullet> b * (vector_derivative (reversepath \<gamma>) (at x within {0..1}) \<bullet> b)) has_integral - i) {0..1}
line_integral_exists ?F ?basis ?\<gamma> \<equiv> (\<lambda>x. \<Sum>b\<in>?basis. ?F (?\<gamma> x) \<bullet> b * (vector_derivative ?\<gamma> (at x within {0..1}) \<bullet> b)) integrable_on {0..1}

goal (1 subgoal):
 1. line_integral_exists F basis (reversepath \<gamma>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line_integral_exists F basis (reversepath \<gamma>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_derivative_minus_at [simp]:
  "f differentiable at a
   \<Longrightarrow> vector_derivative (\<lambda>x. - f x) (at a) = - vector_derivative f (at a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f differentiable at a \<Longrightarrow> vector_derivative (\<lambda>x. - f x) (at a) = - vector_derivative f (at a)
[PROOF STEP]
by (simp add: vector_derivative_at has_vector_derivative_minus vector_derivative_works [symmetric])


[STATEMENT]
lemma ccINF_lower2: "countable A \<Longrightarrow> i \<in> A \<Longrightarrow> f i \<le> u \<Longrightarrow> (INF i \<in> A. f i) \<le> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; i \<in> A; f i \<le> u\<rbrakk> \<Longrightarrow> Inf (f ` A) \<le> u
[PROOF STEP]
using ccINF_lower [of A i f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable A; i \<in> A\<rbrakk> \<Longrightarrow> Inf (f ` A) \<le> f i

goal (1 subgoal):
 1. \<lbrakk>countable A; i \<in> A; f i \<le> u\<rbrakk> \<Longrightarrow> Inf (f ` A) \<le> u
[PROOF STEP]
by auto


[STATEMENT]
lemma opp_powsum_def:
  "dioid_one_zero.powsum (+) (\<odot>) 1 0 x m n = x\<^bsub>m\<^esub>\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dioid_one_zero.powsum (+) (\<odot>) (1::'a) (0::'a) x m n = x\<^bsub>m\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dioid_one_zero.powsum (+) (\<odot>) (1::'a) (0::'a) x m n = x\<^bsub>m\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
have "sum (power.power 1 (\<odot>) x) {m..n + m} = sum ((^) x) {m..n + m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (power.power (1::'a) (\<odot>) x) {m..n + m} = sum ((^) x) {m..n + m}
[PROOF STEP]
by (induction n, simp_all add:opp_power_def)
[PROOF STATE]
proof (state)
this:
sum (power.power (1::'a) (\<odot>) x) {m..n + m} = sum ((^) x) {m..n + m}

goal (1 subgoal):
 1. dioid_one_zero.powsum (+) (\<odot>) (1::'a) (0::'a) x m n = x\<^bsub>m\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sum (power.power (1::'a) (\<odot>) x) {m..n + m} = sum ((^) x) {m..n + m}

goal (1 subgoal):
 1. dioid_one_zero.powsum (+) (\<odot>) (1::'a) (0::'a) x m n = x\<^bsub>m\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
by (simp add: dioid_one_zero.powsum_def[of _ _ _ _ "(\<le>)" "(<)"] dual_dioid_one_zero powsum_def)
[PROOF STATE]
proof (state)
this:
dioid_one_zero.powsum (+) (\<odot>) (1::'a) (0::'a) x m n = x\<^bsub>m\<^esub>\<^bsup>n\<^esup>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma merge_pure_and[simp]:
  "\<up>a \<and>\<^sub>A \<up>b = \<up>(a\<and>b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<up> a \<and>\<^sub>A \<up> b = \<up> (a \<and> b)
[PROOF STEP]
unfolding inf_assn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_assn (\<lambda>h. h \<Turnstile> \<up> a \<and> h \<Turnstile> \<up> b) = \<up> (a \<and> b)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. (h \<Turnstile> \<up> a \<and> h \<Turnstile> \<up> b) = (h \<Turnstile> \<up> (a \<and> b))
[PROOF STEP]
unfolding pure_assn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. (h \<Turnstile> Abs_assn (pure_assn_raw a) \<and> h \<Turnstile> Abs_assn (pure_assn_raw b)) = (h \<Turnstile> Abs_assn (pure_assn_raw (a \<and> b)))
[PROOF STEP]
apply (simp add: Abs_assn_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. (pure_assn_raw a h \<and> pure_assn_raw b h) = pure_assn_raw (a \<and> b) h
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Game_ext: "(Game l1 r1 = Game l2 r2) = ((l1 = l2) \<and> (r1 = r2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Game l1 r1 = Game l2 r2) = (l1 = l2 \<and> r1 = r2)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Game l1 r1 = Game l2 r2 \<Longrightarrow> l1 = l2
 2. Game l1 r1 = Game l2 r2 \<Longrightarrow> r1 = r2
[PROOF STEP]
apply (subst left_options[where l=l1 and r=r1,symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Game l1 r1 = Game l2 r2 \<Longrightarrow> left_options (Game l1 r1) = l2
 2. Game l1 r1 = Game l2 r2 \<Longrightarrow> r1 = r2
[PROOF STEP]
apply (subst left_options[where l=l2 and r=r2,symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Game l1 r1 = Game l2 r2 \<Longrightarrow> left_options (Game l1 r1) = left_options (Game l2 r2)
 2. Game l1 r1 = Game l2 r2 \<Longrightarrow> r1 = r2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Game l1 r1 = Game l2 r2 \<Longrightarrow> r1 = r2
[PROOF STEP]
apply (subst right_options[where l=l1 and r=r1,symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Game l1 r1 = Game l2 r2 \<Longrightarrow> right_options (Game l1 r1) = r2
[PROOF STEP]
apply (subst right_options[where l=l2 and r=r2,symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Game l1 r1 = Game l2 r2 \<Longrightarrow> right_options (Game l1 r1) = right_options (Game l2 r2)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_kmax:
"finite (kmax f PR)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (kmax f PR)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (kmax f PR)
[PROOF STEP]
have "finite PR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite PR
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite PR

goal (1 subgoal):
 1. finite (kmax f PR)
[PROOF STEP]
with  kmax_prop and finite_subset
[PROOF STATE]
proof (chain)
picking this:
kmax ?f PR \<subseteq> PR \<and> card (kmax ?f PR) = khl \<and> (\<forall>i\<in>kmax ?f PR. \<forall>j\<in>PR - kmax ?f PR. ?f j \<le> ?f i)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
finite PR
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
kmax ?f PR \<subseteq> PR \<and> card (kmax ?f PR) = khl \<and> (\<forall>i\<in>kmax ?f PR. \<forall>j\<in>PR - kmax ?f PR. ?f j \<le> ?f i)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
finite PR

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_temp:
  fixes x s as h
  assumes "x \<in> state_set (state_list s as)"
  shows "length (h # state_list s as) > length x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length x < length (h # state_list s as)
[PROOF STEP]
using assms LENGTH_state_set le_imp_less_Suc
[PROOF STATE]
proof (prove)
using this:
x \<in> state_set (state_list s as)
?e \<in> state_set ?X \<Longrightarrow> length ?e \<le> length ?X
?m \<le> ?n \<Longrightarrow> ?m < Suc ?n

goal (1 subgoal):
 1. length x < length (h # state_list s as)
[PROOF STEP]
by force


[STATEMENT]
theorem var_not_in_linear :
  assumes "var \<notin> vars b"
  assumes "var \<notin> vars c"
  shows "freeIn var (Atom (linear_substitution var b c A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
proof(cases A)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x1. A = Less x1 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x2. A = Eq x2 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 3. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 4. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
case (Less p)
[PROOF STATE]
proof (state)
this:
A = Less p

goal (4 subgoals):
 1. \<And>x1. A = Less x1 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x2. A = Eq x2 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 3. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 4. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
define d where "d = MPoly_Type.degree p var"
[PROOF STATE]
proof (state)
this:
d = MPoly_Type.degree p var

goal (4 subgoals):
 1. \<And>x1. A = Less x1 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x2. A = Eq x2 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 3. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 4. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d = MPoly_Type.degree p var
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
using Less
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var
A = Less p

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = MPoly_Type.degree p var; A = Less p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = MPoly_Type.degree p var in Less (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))))
[PROOF STEP]
unfolding d_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = d; A = Less p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = d in Less (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Less p \<Longrightarrow> var \<notin> vars (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))
[PROOF STEP]
using not_in_sum
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})

goal (1 subgoal):
 1. A = Less p \<Longrightarrow> var \<notin> vars (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))
[PROOF STEP]
using not_in_isovarspar assms  not_in_mult not_in_neg not_in_pow not_in_add
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})
isolate_variable_sparse ?p ?var ?x = ?q \<Longrightarrow> ?var \<notin> vars ?q
var \<notin> vars b
var \<notin> vars c
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p * ?q)
(?var \<notin> vars ?p) = (?var \<notin> vars (- ?p))
?var \<notin> vars ?p \<Longrightarrow> ?var \<notin> vars (?p ^ ?i)
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p + ?q)

goal (1 subgoal):
 1. A = Less p \<Longrightarrow> var \<notin> vars (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
freeIn var (fm.Atom (linear_substitution var b c A))

goal (3 subgoals):
 1. \<And>x2. A = Eq x2 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 3. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x2. A = Eq x2 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 3. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
case (Eq p)
[PROOF STATE]
proof (state)
this:
A = Eq p

goal (3 subgoals):
 1. \<And>x2. A = Eq x2 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 3. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
define d where "d = MPoly_Type.degree p var"
[PROOF STATE]
proof (state)
this:
d = MPoly_Type.degree p var

goal (3 subgoals):
 1. \<And>x2. A = Eq x2 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 3. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d = MPoly_Type.degree p var
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
using Eq
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var
A = Eq p

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = MPoly_Type.degree p var; A = Eq p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = MPoly_Type.degree p var in Eq ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)))
[PROOF STEP]
unfolding d_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = d; A = Eq p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = d in Eq ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Eq p \<Longrightarrow> var \<notin> vars ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)
[PROOF STEP]
using not_in_sum
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})

goal (1 subgoal):
 1. A = Eq p \<Longrightarrow> var \<notin> vars ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)
[PROOF STEP]
using not_in_isovarspar assms  not_in_mult not_in_neg not_in_pow not_in_add
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})
isolate_variable_sparse ?p ?var ?x = ?q \<Longrightarrow> ?var \<notin> vars ?q
var \<notin> vars b
var \<notin> vars c
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p * ?q)
(?var \<notin> vars ?p) = (?var \<notin> vars (- ?p))
?var \<notin> vars ?p \<Longrightarrow> ?var \<notin> vars (?p ^ ?i)
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p + ?q)

goal (1 subgoal):
 1. A = Eq p \<Longrightarrow> var \<notin> vars ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
freeIn var (fm.Atom (linear_substitution var b c A))

goal (2 subgoals):
 1. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
case (Leq p)
[PROOF STATE]
proof (state)
this:
A = Leq p

goal (2 subgoals):
 1. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
define d where "d = MPoly_Type.degree p var"
[PROOF STATE]
proof (state)
this:
d = MPoly_Type.degree p var

goal (2 subgoals):
 1. \<And>x3. A = Leq x3 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
 2. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d = MPoly_Type.degree p var
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
using Leq
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var
A = Leq p

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = MPoly_Type.degree p var; A = Leq p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = MPoly_Type.degree p var in Leq (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))))
[PROOF STEP]
unfolding d_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = d; A = Leq p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = d in Leq (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Leq p \<Longrightarrow> var \<notin> vars (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))
[PROOF STEP]
using not_in_sum
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})

goal (1 subgoal):
 1. A = Leq p \<Longrightarrow> var \<notin> vars (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))
[PROOF STEP]
using not_in_isovarspar assms  not_in_mult not_in_neg not_in_pow not_in_add
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})
isolate_variable_sparse ?p ?var ?x = ?q \<Longrightarrow> ?var \<notin> vars ?q
var \<notin> vars b
var \<notin> vars c
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p * ?q)
(?var \<notin> vars ?p) = (?var \<notin> vars (- ?p))
?var \<notin> vars ?p \<Longrightarrow> ?var \<notin> vars (?p ^ ?i)
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p + ?q)

goal (1 subgoal):
 1. A = Leq p \<Longrightarrow> var \<notin> vars (((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d) * c ^ (d mod 2))
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
freeIn var (fm.Atom (linear_substitution var b c A))

goal (1 subgoal):
 1. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
case (Neq p)
[PROOF STATE]
proof (state)
this:
A = Neq p

goal (1 subgoal):
 1. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
define d where "d = MPoly_Type.degree p var"
[PROOF STATE]
proof (state)
this:
d = MPoly_Type.degree p var

goal (1 subgoal):
 1. \<And>x4. A = Neq x4 \<Longrightarrow> freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d = MPoly_Type.degree p var
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
using Neq
[PROOF STATE]
proof (prove)
using this:
d = MPoly_Type.degree p var
A = Neq p

goal (1 subgoal):
 1. freeIn var (fm.Atom (linear_substitution var b c A))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = MPoly_Type.degree p var; A = Neq p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = MPoly_Type.degree p var in Neq ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)))
[PROOF STEP]
unfolding d_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d = d; A = Neq p\<rbrakk> \<Longrightarrow> freeIn var (fm.Atom (let d = d in Neq ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Neq p \<Longrightarrow> var \<notin> vars ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)
[PROOF STEP]
using not_in_sum
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})

goal (1 subgoal):
 1. A = Neq p \<Longrightarrow> var \<notin> vars ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)
[PROOF STEP]
using not_in_isovarspar assms  not_in_mult not_in_neg not_in_pow not_in_add
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?var \<notin> vars (?f i) \<Longrightarrow> \<forall>n. ?var \<notin> vars (sum ?f {0..<n})
isolate_variable_sparse ?p ?var ?x = ?q \<Longrightarrow> ?var \<notin> vars ?q
var \<notin> vars b
var \<notin> vars c
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p * ?q)
(?var \<notin> vars ?p) = (?var \<notin> vars (- ?p))
?var \<notin> vars ?p \<Longrightarrow> ?var \<notin> vars (?p ^ ?i)
\<lbrakk>?var \<notin> vars ?p; ?var \<notin> vars ?q\<rbrakk> \<Longrightarrow> ?var \<notin> vars (?p + ?q)

goal (1 subgoal):
 1. A = Neq p \<Longrightarrow> var \<notin> vars ((\<Sum>i = 0..<d. isolate_variable_sparse p var i * b ^ i * c ^ (d - i)) + isolate_variable_sparse p var d * b ^ d)
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
freeIn var (fm.Atom (linear_substitution var b c A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iWeakUntil_iUntil_conv: "(P t'. t' \<W> t I. Q t) = ((P t'. t' \<U> t I. Q t) \<or> (\<box> t I. P t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t'. t' \<W> t I. Q t) = ((P t'. t' \<U> t I. Q t) \<or> (\<box> t I. P t))
[PROOF STEP]
unfolding iWeakUntil_def iUntil_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<box> t I. P t) \<or> (\<diamond> t I. Q t \<and> (\<box> t' I \<down>< t. P t'))) = ((\<diamond> t I. Q t \<and> (\<box> t' I \<down>< t. P t')) \<or> (\<box> t I. P t))
[PROOF STEP]
by blast


[STATEMENT]
lemma length_prefixes[simp]: "length (prefixes xs) = length xs+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (prefixes xs) = length xs + 1
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma inj_on_fst_graph: "inj_on fst (graph m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on fst (graph m)
[PROOF STEP]
unfolding graph_def inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{(a, b) |a b. m a = Some b}. \<forall>y\<in>{(a, b) |a b. m a = Some b}. fst x = fst y \<longrightarrow> x = y
[PROOF STEP]
by force


[STATEMENT]
lemma tanh_real_strict_mono: "strict_mono (tanh :: real \<Rightarrow> real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono tanh
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. strict_mono tanh
[PROOF STEP]
have *: "tanh x ^ 2 < 1" for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tanh x)\<^sup>2 < 1
[PROOF STEP]
using tanh_real_bounds[of x]
[PROOF STATE]
proof (prove)
using this:
tanh x \<in> {- 1<..<1}

goal (1 subgoal):
 1. (tanh x)\<^sup>2 < 1
[PROOF STEP]
by (simp add: abs_square_less_1 abs_if)
[PROOF STATE]
proof (state)
this:
(tanh ?x)\<^sup>2 < 1

goal (1 subgoal):
 1. strict_mono tanh
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono tanh
[PROOF STEP]
by (rule pos_deriv_imp_strict_mono) (insert *, auto intro!: derivative_intros)
[PROOF STATE]
proof (state)
this:
strict_mono tanh

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_demorgan_2:
  "-(x \<sqinter> y) = -x \<squnion> -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x \<sqinter> y) = - x \<squnion> - y
[PROOF STEP]
using sba3_complement_inf_double_complement sba5_inf_commutative sub_sup_closed sub_sup_demorgan
[PROOF STATE]
proof (prove)
using this:
- (?x \<sqinter> - - ?y) = - (?x \<sqinter> ?y)
?x \<sqinter> ?y = ?y \<sqinter> ?x
- ?x \<squnion> - ?y = - - (- ?x \<squnion> - ?y)
- (- ?x \<squnion> - ?y) = - - ?x \<sqinter> - - ?y

goal (1 subgoal):
 1. - (x \<sqinter> y) = - x \<squnion> - y
[PROOF STEP]
by auto


[STATEMENT]
lemma nonpos_Reals_divide_I1:
    fixes a :: "'a::real_div_algebra"
    shows "\<lbrakk>a \<in> \<real>\<^sub>\<ge>\<^sub>0; b \<in> \<real>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> a / b \<in> \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> \<real>\<^sub>\<ge>\<^sub>0; b \<in> \<real>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> a / b \<in> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (simp add: nonpos_Reals_inverse_I nonpos_Reals_mult_I1 divide_inverse)


[STATEMENT]
lemma (in module) sum_is_minimal:
  fixes N N1 N2
  assumes h1: "submodule R N1 M" and h2: "submodule R N2 M" and h3: "submodule R N M"
  shows "(submodule_sum N1 N2) \<subseteq> N \<longleftrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (submodule_sum N1 N2 \<subseteq> N) = (N1 \<subseteq> N \<and> N2 \<subseteq> N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (submodule_sum N1 N2 \<subseteq> N) = (N1 \<subseteq> N \<and> N2 \<subseteq> N)
[PROOF STEP]
have 1: "(submodule_sum N1 N2) \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
[PROOF STEP]
assume 10: "(submodule_sum N1 N2) \<subseteq> N"
[PROOF STATE]
proof (state)
this:
submodule_sum N1 N2 \<subseteq> N

goal (1 subgoal):
 1. submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
[PROOF STEP]
from h1 h2
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R N1 M
LinearCombinations.submodule R N2 M
[PROOF STEP]
have 11: "N1\<subseteq>submodule_sum N1 N2"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R N1 M
LinearCombinations.submodule R N2 M

goal (1 subgoal):
 1. N1 \<subseteq> submodule_sum N1 N2
[PROOF STEP]
by (rule in_sum)
[PROOF STATE]
proof (state)
this:
N1 \<subseteq> submodule_sum N1 N2

goal (1 subgoal):
 1. submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
[PROOF STEP]
from h2 h1
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R N2 M
LinearCombinations.submodule R N1 M
[PROOF STEP]
have 12: "N2\<subseteq>submodule_sum N2 N1"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R N2 M
LinearCombinations.submodule R N1 M

goal (1 subgoal):
 1. N2 \<subseteq> submodule_sum N2 N1
[PROOF STEP]
by (rule in_sum)
[PROOF STATE]
proof (state)
this:
N2 \<subseteq> submodule_sum N2 N1

goal (1 subgoal):
 1. submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
[PROOF STEP]
from 12 h1 h2
[PROOF STATE]
proof (chain)
picking this:
N2 \<subseteq> submodule_sum N2 N1
LinearCombinations.submodule R N1 M
LinearCombinations.submodule R N2 M
[PROOF STEP]
have 13: "N2\<subseteq>submodule_sum N1 N2"
[PROOF STATE]
proof (prove)
using this:
N2 \<subseteq> submodule_sum N2 N1
LinearCombinations.submodule R N1 M
LinearCombinations.submodule R N2 M

goal (1 subgoal):
 1. N2 \<subseteq> submodule_sum N1 N2
[PROOF STEP]
by (metis msum_comm)
[PROOF STATE]
proof (state)
this:
N2 \<subseteq> submodule_sum N1 N2

goal (1 subgoal):
 1. submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
[PROOF STEP]
from 10 11 13
[PROOF STATE]
proof (chain)
picking this:
submodule_sum N1 N2 \<subseteq> N
N1 \<subseteq> submodule_sum N1 N2
N2 \<subseteq> submodule_sum N1 N2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
submodule_sum N1 N2 \<subseteq> N
N1 \<subseteq> submodule_sum N1 N2
N2 \<subseteq> submodule_sum N1 N2

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N1 \<subseteq> N \<and> N2 \<subseteq> N

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N

goal (1 subgoal):
 1. (submodule_sum N1 N2 \<subseteq> N) = (N1 \<subseteq> N \<and> N2 \<subseteq> N)
[PROOF STEP]
have 2: "N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> (submodule_sum N1 N2) \<subseteq> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
assume 19: "N1 \<subseteq> N \<and> N2 \<subseteq> N"
[PROOF STATE]
proof (state)
this:
N1 \<subseteq> N \<and> N2 \<subseteq> N

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
N1 \<subseteq> N \<and> N2 \<subseteq> N

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
assume 20: "v\<in>submodule_sum N1 N2"
[PROOF STATE]
proof (state)
this:
v \<in> submodule_sum N1 N2

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
from 20
[PROOF STATE]
proof (chain)
picking this:
v \<in> submodule_sum N1 N2
[PROOF STEP]
obtain w1 w2 where 21: "w1\<in>N1" and 22: "w2\<in>N2" and 23: "v=w1\<oplus>\<^bsub>M\<^esub> w2"
[PROOF STATE]
proof (prove)
using this:
v \<in> submodule_sum N1 N2

goal (1 subgoal):
 1. (\<And>w1 w2. \<lbrakk>w1 \<in> N1; w2 \<in> N2; v = w1 \<oplus>\<^bsub>M\<^esub> w2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (unfold submodule_sum_def image_def, auto)
[PROOF STATE]
proof (state)
this:
w1 \<in> N1
w2 \<in> N2
v = w1 \<oplus>\<^bsub>M\<^esub> w2

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
from 19 21 22 23 h3
[PROOF STATE]
proof (chain)
picking this:
N1 \<subseteq> N \<and> N2 \<subseteq> N
w1 \<in> N1
w2 \<in> N2
v = w1 \<oplus>\<^bsub>M\<^esub> w2
LinearCombinations.submodule R N M
[PROOF STEP]
have "v \<in> N"
[PROOF STATE]
proof (prove)
using this:
N1 \<subseteq> N \<and> N2 \<subseteq> N
w1 \<in> N1
w2 \<in> N2
v = w1 \<oplus>\<^bsub>M\<^esub> w2
LinearCombinations.submodule R N M

goal (1 subgoal):
 1. v \<in> N
[PROOF STEP]
apply (unfold submodule_def, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w1 \<in> N1; w2 \<in> N2; v = w1 \<oplus>\<^bsub>M\<^esub> w2; LinearCombinations.submodule R N M; module R M; N1 \<subseteq> N; N2 \<subseteq> N; N \<subseteq> carrier M; \<forall>v. v \<in> N \<longrightarrow> (\<forall>w. w \<in> N \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> N); \<zero>\<^bsub>M\<^esub> \<in> N; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> N \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> N)\<rbrakk> \<Longrightarrow> w1 \<oplus>\<^bsub>M\<^esub> w2 \<in> N
[PROOF STEP]
by (metis (poly_guards_query)  contra_subsetD)
[PROOF STATE]
proof (state)
this:
v \<in> N

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
(*how is an obtain goal rep'd?*)
[PROOF STATE]
proof (state)
this:
v \<in> N

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?v3 \<in> submodule_sum N1 N2 \<Longrightarrow> ?v3 \<in> N

goal (1 subgoal):
 1. N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?v3 \<in> submodule_sum N1 N2 \<Longrightarrow> ?v3 \<in> N

goal (1 subgoal):
 1. submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
by (metis subset_iff)
[PROOF STATE]
proof (state)
this:
submodule_sum N1 N2 \<subseteq> N

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N

goal (1 subgoal):
 1. (submodule_sum N1 N2 \<subseteq> N) = (N1 \<subseteq> N \<and> N2 \<subseteq> N)
[PROOF STEP]
from 1 2
[PROOF STATE]
proof (chain)
picking this:
submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
submodule_sum N1 N2 \<subseteq> N \<Longrightarrow> N1 \<subseteq> N \<and> N2 \<subseteq> N
N1 \<subseteq> N \<and> N2 \<subseteq> N \<Longrightarrow> submodule_sum N1 N2 \<subseteq> N

goal (1 subgoal):
 1. (submodule_sum N1 N2 \<subseteq> N) = (N1 \<subseteq> N \<and> N2 \<subseteq> N)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(submodule_sum N1 N2 \<subseteq> N) = (N1 \<subseteq> N \<and> N2 \<subseteq> N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma last_message_append: "\<And>xs.
  last_message (xs @ ys) = (
  if last_message ys = \<NoMsg> then last_message xs else last_message ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. last_message (xs @ ys) = (if last_message ys = NoMsg then last_message xs else last_message ys)
[PROOF STEP]
apply (induct ys, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys xs. (\<And>xs. last_message (xs @ ys) = (if last_message ys = NoMsg then last_message xs else last_message ys)) \<Longrightarrow> last_message (xs @ a # ys) = (if last_message (a # ys) = NoMsg then last_message xs else last_message (a # ys))
[PROOF STEP]
apply (drule_tac x="xs @ [a]" in meta_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys xs. last_message ((xs @ [a]) @ ys) = (if last_message ys = NoMsg then last_message (xs @ [a]) else last_message ys) \<Longrightarrow> last_message (xs @ a # ys) = (if last_message (a # ys) = NoMsg then last_message xs else last_message (a # ys))
[PROOF STEP]
apply (simp add: last_message_append_one)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma aform_vals_pdevs_vals:
  "aform_vals e X = map (\<lambda>(x, y). x + y) (zip (map fst X) (pdevs_vals e (map snd X)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aform_vals e X = map2 (+) (map fst X) (pdevs_vals e (map snd X))
[PROOF STEP]
by (auto simp: pdevs_vals_def aform_vals_def aform_val_def[abs_def]
      map_zip_map map_zip_map2 split_beta' zip_same_conv_map)


[STATEMENT]
lemma irregularAmicPair_sym:
  assumes "irregularAmicPair n m"
  shows "irregularAmicPair m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irregularAmicPair m n
[PROOF STEP]
using  irregularAmicPair_def regularAmicPair_sym Amicable_pair_sym assms
[PROOF STATE]
proof (prove)
using this:
irregularAmicPair ?n ?m = (?n Amic ?m \<and> \<not> regularAmicPair ?n ?m)
regularAmicPair ?n ?m \<Longrightarrow> regularAmicPair ?m ?n
?m Amic ?n \<Longrightarrow> ?n Amic ?m
irregularAmicPair n m

goal (1 subgoal):
 1. irregularAmicPair m n
[PROOF STEP]
by blast


[STATEMENT]
lemma rbl_word_xor: "rev (to_bl (x XOR y)) = map2 (\<noteq>) (rev (to_bl x)) (rev (to_bl y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (to_bl (x XOR y)) = map2 (\<noteq>) (rev (to_bl x)) (rev (to_bl y))
[PROOF STEP]
by (simp add: zip_rev bl_word_xor rev_map)


[STATEMENT]
lemma sum'_subtractf_nat:
  fixes f :: "'a \<Rightarrow> nat"
  assumes "finite {i \<in> A. f i \<noteq> 0}"
  assumes "\<And>i. i \<in> A \<Longrightarrow> g i \<le> f i"
  shows "sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have c:"finite {i \<in> A. g i \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i \<in> A. g i \<noteq> 0}
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
?i \<in> A \<Longrightarrow> g ?i \<le> f ?i

goal (1 subgoal):
 1. finite {i \<in> A. g i \<noteq> 0}
[PROOF STEP]
by (intro finite_subset[OF _ assms(1)] subsetI, force)
[PROOF STATE]
proof (state)
this:
finite {i \<in> A. g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
let ?B = "{i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have b:"?B = {i \<in> A. f i \<noteq> 0} \<union> {i \<in> A. g i \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = {i \<in> A. f i \<noteq> 0} \<union> {i \<in> A. g i \<noteq> 0}
[PROOF STEP]
by (auto simp add:set_eq_iff)
[PROOF STATE]
proof (state)
this:
{i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = {i \<in> A. f i \<noteq> 0} \<union> {i \<in> A. g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have a:"finite ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}
[PROOF STEP]
using assms(1) c
[PROOF STATE]
proof (prove)
using this:
finite {i \<in> A. f i \<noteq> 0}
finite {i \<in> A. g i \<noteq> 0}

goal (1 subgoal):
 1. finite {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}
[PROOF STEP]
by (subst b, simp)
[PROOF STATE]
proof (state)
this:
finite {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have "?lhs = sum' (\<lambda>i. f i - g i) ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' (\<lambda>i. f i - g i) {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}
[PROOF STEP]
by (intro sum.mono_neutral_cong_right', simp_all)
[PROOF STATE]
proof (state)
this:
sum' (\<lambda>i. f i - g i) A = sum' (\<lambda>i. f i - g i) {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum' (\<lambda>i. f i - g i) A = sum' (\<lambda>i. f i - g i) {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have "... = sum (\<lambda>i. f i - g i) ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = (\<Sum>i | i \<in> A \<and> (f i \<noteq> 0 \<or> g i \<noteq> 0). f i - g i)
[PROOF STEP]
by (intro sum.eq_sum a)
[PROOF STATE]
proof (state)
this:
sum' (\<lambda>i. f i - g i) {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = (\<Sum>i | i \<in> A \<and> (f i \<noteq> 0 \<or> g i \<noteq> 0). f i - g i)

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum' (\<lambda>i. f i - g i) {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = (\<Sum>i | i \<in> A \<and> (f i \<noteq> 0 \<or> g i \<noteq> 0). f i - g i)

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have "... = sum f ?B - sum g ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i | i \<in> A \<and> (f i \<noteq> 0 \<or> g i \<noteq> 0). f i - g i) = sum f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
?i \<in> A \<Longrightarrow> g ?i \<le> f ?i

goal (1 subgoal):
 1. (\<Sum>i | i \<in> A \<and> (f i \<noteq> 0 \<or> g i \<noteq> 0). f i - g i) = sum f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}
[PROOF STEP]
by (subst sum_subtractf_nat, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i | i \<in> A \<and> (f i \<noteq> 0 \<or> g i \<noteq> 0). f i - g i) = sum f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i | i \<in> A \<and> (f i \<noteq> 0 \<or> g i \<noteq> 0). f i - g i) = sum f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have "... = sum' f ?B - sum' g ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = sum' f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum' g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}
[PROOF STEP]
by (intro arg_cong2[where f="(-)"] sum.eq_sum[symmetric] a)
[PROOF STATE]
proof (state)
this:
sum f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = sum' f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum' g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = sum' f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum' g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0}

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum' f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum' g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = sum' f A - sum' g A
[PROOF STEP]
by (intro arg_cong2[where f="(-)"] sum.mono_neutral_cong_left')
      simp_all
[PROOF STATE]
proof (state)
this:
sum' f {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} - sum' g {i \<in> A. f i \<noteq> 0 \<or> g i \<noteq> 0} = sum' f A - sum' g A

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A

goal (1 subgoal):
 1. sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum' (\<lambda>i. f i - g i) A = sum' f A - sum' g A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_hull_eq_empty [simp]: "affine hull S = {} \<longleftrightarrow> S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (affine hull S = {}) = (S = {})
[PROOF STEP]
by (metis affine_empty subset_empty subset_hull)


[STATEMENT]
lemma STAR_sin_Infinitesimal_divide:
  fixes x :: "'a::{real_normed_field,banach} star"
  shows "\<lbrakk>x \<in> Infinitesimal; x \<noteq> 0\<rbrakk> \<Longrightarrow> ( *f* sin) x/x \<approx> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> Infinitesimal; x \<noteq> 0\<rbrakk> \<Longrightarrow> (*f* sin) x / x \<approx> 1
[PROOF STEP]
using DERIV_sin [of "0::'a"]
[PROOF STATE]
proof (prove)
using this:
(sin has_field_derivative cos (0::'a)) (at (0::'a))

goal (1 subgoal):
 1. \<lbrakk>x \<in> Infinitesimal; x \<noteq> 0\<rbrakk> \<Longrightarrow> (*f* sin) x / x \<approx> 1
[PROOF STEP]
by (simp add: NSDERIV_DERIV_iff [symmetric] nsderiv_def)


[STATEMENT]
lemma (in Corps) Vr_potent_eqTr1:"\<lbrakk>valuation K v; 0 \<le> n; 0 \<le> m;
        (vp K v) \<^bsup>(Vr K v) n\<^esup> = (vp K v) \<^bsup>(Vr K v) m\<^esup>; m = 0\<rbrakk>  \<Longrightarrow>  n = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n; 0 \<le> m; vp K v\<^bsup> Vr K v n\<^esup> = vp K v\<^bsup> Vr K v m\<^esup>; m = 0\<rbrakk> \<Longrightarrow> n = m
[PROOF STEP]
(*** compare the value of the generator of each ideal ***)
(** express each ideal as a principal ideal **)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n; 0 \<le> m; vp K v\<^bsup> Vr K v n\<^esup> = vp K v\<^bsup> Vr K v m\<^esup>; m = 0\<rbrakk> \<Longrightarrow> n = m
[PROOF STEP]
apply (frule Vr_ring[of v],
       simp add:r_apow_def,
       case_tac "n = 0", simp,
       case_tac "n = \<infinity>", simp,
       frule val_Pg[of v], erule conjE, simp,
       erule conjE,
       rotate_tac -3, drule sym,
       frule Lv_pos[of v], simp,
       frule val_poss_mem_Vr[of v "Pg K v"], assumption+,
       drule sym, simp, simp add:Vr_0_f_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; 0 \<le> n; (if n = \<infinity> then {\<zero>\<^bsub>Vr K v\<^esub>} else if n = 0 then carrier (Vr K v) else vp K v \<^bsup>\<diamondsuit>Vr K v na n\<^esup>) = carrier (Vr K v); m = 0; Ring (Vr K v); n \<noteq> 0; n \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> n = 0
[PROOF STEP]
apply (simp,
       drule sym,
       frule Ring.ring_one[of "Vr K v"], simp,

       frule n_value_x_1_nat[of v "1\<^sub>r\<^bsub>(Vr K v)\<^esub>" "na n"], assumption,
       simp add:an_na, simp add:Vr_1_f_1,
       frule n_val_valuation[of v],
       simp add:value_of_one[of "n_val K v"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_telescope': "(\<Sum>i\<le>k. f (Suc i) - f i ) = f (Suc k) - (f 0 :: 'c :: ab_group_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. f (Suc i) - f i) = f (Suc k) - f 0
[PROOF STEP]
using sum_telescope[of "-f" k]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>k. (- f) i - (- f) (Suc i)) = (- f) 0 - (- f) (Suc k)

goal (1 subgoal):
 1. (\<Sum>i\<le>k. f (Suc i) - f i) = f (Suc k) - f 0
[PROOF STEP]
by auto


[STATEMENT]
lemma of_rat_power: "(of_rat (a ^ n) :: 'a::field_char_0) = of_rat a ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_rat (a ^ n) = of_rat a ^ n
[PROOF STEP]
by (induct n) (simp_all add: of_rat_mult)


[STATEMENT]
lemma Sigma_mset_cong:
  "\<lbrakk>A = B; \<And>x. x \<in># B \<Longrightarrow> C x = D x\<rbrakk> \<Longrightarrow> (SIGMAMSET x \<in># A. C x) = (SIGMAMSET x \<in># B. D x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x. x \<in># B \<Longrightarrow> C x = D x\<rbrakk> \<Longrightarrow> Sigma_mset A C = Sigma_mset B D
[PROOF STEP]
by (metis (mono_tags, lifting) Sigma_mset_def image_mset_cong)


[STATEMENT]
lemma card_reachable_s_non_zero:
  fixes s
  assumes "finite (PROB :: 'a problem)" "(s \<in> valid_states PROB)"
  shows "(0 < card (reachable_s PROB s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < card (reachable_s PROB s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite PROB
s \<in> valid_states PROB

goal (1 subgoal):
 1. 0 < card (reachable_s PROB s)
[PROOF STEP]
by (simp add: card_gt_0_iff reachable_s_finite_thm reachable_s_non_empty)


[STATEMENT]
lemma min_height_size1: "2 ^ min_height t \<le> size1 t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ min_height t \<le> size1 t
[PROOF STEP]
proof(induction t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 ^ min_height \<langle>\<rangle> \<le> size1 \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>2 ^ min_height t1 \<le> size1 t1; 2 ^ min_height t2 \<le> size1 t2\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> \<le> size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
case (Node l a r)
[PROOF STATE]
proof (state)
this:
2 ^ min_height l \<le> size1 l
2 ^ min_height r \<le> size1 r

goal (2 subgoals):
 1. 2 ^ min_height \<langle>\<rangle> \<le> size1 \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>2 ^ min_height t1 \<le> size1 t1; 2 ^ min_height t2 \<le> size1 t2\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> \<le> size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "(2::nat) ^ min_height (Node l a r) \<le> 2 ^ min_height l + 2 ^ min_height r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, a, r\<rangle> \<le> 2 ^ min_height l + 2 ^ min_height r
[PROOF STEP]
by (simp add: min_def)
[PROOF STATE]
proof (state)
this:
2 ^ min_height \<langle>l, a, r\<rangle> \<le> 2 ^ min_height l + 2 ^ min_height r

goal (2 subgoals):
 1. 2 ^ min_height \<langle>\<rangle> \<le> size1 \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>2 ^ min_height t1 \<le> size1 t1; 2 ^ min_height t2 \<le> size1 t2\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> \<le> size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ min_height \<langle>l, a, r\<rangle> \<le> 2 ^ min_height l + 2 ^ min_height r

goal (2 subgoals):
 1. 2 ^ min_height \<langle>\<rangle> \<le> size1 \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>2 ^ min_height t1 \<le> size1 t1; 2 ^ min_height t2 \<le> size1 t2\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> \<le> size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "\<dots> \<le> size1(Node l a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ min_height l + 2 ^ min_height r \<le> size1 \<langle>l, a, r\<rangle>
[PROOF STEP]
using Node.IH
[PROOF STATE]
proof (prove)
using this:
2 ^ min_height l \<le> size1 l
2 ^ min_height r \<le> size1 r

goal (1 subgoal):
 1. 2 ^ min_height l + 2 ^ min_height r \<le> size1 \<langle>l, a, r\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ min_height l + 2 ^ min_height r \<le> size1 \<langle>l, a, r\<rangle>

goal (2 subgoals):
 1. 2 ^ min_height \<langle>\<rangle> \<le> size1 \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>2 ^ min_height t1 \<le> size1 t1; 2 ^ min_height t2 \<le> size1 t2\<rbrakk> \<Longrightarrow> 2 ^ min_height \<langle>t1, x2, t2\<rangle> \<le> size1 \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 ^ min_height \<langle>l, a, r\<rangle> \<le> size1 \<langle>l, a, r\<rangle>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
2 ^ min_height \<langle>l, a, r\<rangle> \<le> size1 \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. 2 ^ min_height \<langle>l, a, r\<rangle> \<le> size1 \<langle>l, a, r\<rangle>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 ^ min_height \<langle>l, a, r\<rangle> \<le> size1 \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. 2 ^ min_height \<langle>\<rangle> \<le> size1 \<langle>\<rangle>
[PROOF STEP]
qed simp


[STATEMENT]
lemma as_subset_p: "set as \<subseteq> {..<p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set as \<subseteq> {..<p}
[PROOF STEP]
using as_lt_p
[PROOF STATE]
proof (prove)
using this:
?x \<in> set as \<Longrightarrow> ?x < p

goal (1 subgoal):
 1. set as \<subseteq> {..<p}
[PROOF STEP]
by (simp add: subset_iff)


[STATEMENT]
lemma map_family_fun:"\<lbrakk>\<forall>j\<in>I. aGroup (A j); aGroup S;
      \<forall>j\<in>I. ((g j) \<in> aHom S (A j)); x \<in> carrier S\<rbrakk> \<Longrightarrow>
         (\<lambda>y \<in> carrier S. (\<lambda>j\<in>I. (g j) y)) x \<in> carrier (a\<Pi>\<^bsub>I\<^esub> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<in>I. aGroup (A j); aGroup S; \<forall>j\<in>I. g j \<in> aHom S (A j); x \<in> carrier S\<rbrakk> \<Longrightarrow> (\<lambda>y\<in>carrier S. \<lambda>j\<in>I. g j y) x \<in> carrier (a\<Pi>\<^bsub>I\<^esub> A)
[PROOF STEP]
apply (simp add:prodag_def carr_prodag_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<in>I. aGroup (A j); aGroup S; \<forall>j\<in>I. g j \<in> aHom S (A j); x \<in> carrier S\<rbrakk> \<Longrightarrow> (\<lambda>j\<in>I. g j x) \<in> I \<rightarrow> Un_carrier I A \<and> (\<forall>i\<in>I. g i x \<in> carrier (A i))
[PROOF STEP]
apply (simp add:aHom_mem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<in>I. aGroup (A j); aGroup S; \<forall>j\<in>I. g j \<in> aHom S (A j); x \<in> carrier S\<rbrakk> \<Longrightarrow> (\<lambda>j\<in>I. g j x) \<in> I \<rightarrow> Un_carrier I A
[PROOF STEP]
apply (rule Pi_I, simp add:Un_carrier_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>\<forall>j\<in>I. aGroup (A j); aGroup S; \<forall>j\<in>I. g j \<in> aHom S (A j); x \<in> carrier S; xa \<in> I\<rbrakk> \<Longrightarrow> \<exists>xb. (\<exists>i\<in>I. xb = carrier (A i)) \<and> g xa x \<in> xb
[PROOF STEP]
apply (frule_tac x = xa in bspec, assumption,
        thin_tac "\<forall>j\<in>I. aGroup (A j)",
        frule_tac x = xa in bspec, assumption,
        thin_tac "\<forall>j\<in>I. g j \<in> aHom S (A j)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>aGroup S; x \<in> carrier S; xa \<in> I; aGroup (A xa); g xa \<in> aHom S (A xa)\<rbrakk> \<Longrightarrow> \<exists>xb. (\<exists>i\<in>I. xb = carrier (A i)) \<and> g xa x \<in> xb
[PROOF STEP]
apply (frule_tac G = "A xa" and f = "g xa" and a = x in aHom_mem[of "S"],
        assumption+, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma filterlim_power_at_infinity:
  assumes "n\<noteq>0"
  shows "filterlim (\<lambda>x::'a::real_normed_field. x^n) at_infinity at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_infinity. x ^ n :> at_infinity
[PROOF STEP]
using filterlim_poly_at_infinity[of "monom 1 n"] assms
[PROOF STATE]
proof (prove)
using this:
0 < degree (monom (1::?'b1) n) \<Longrightarrow> filterlim (poly (monom (1::?'b1) n)) at_infinity at_infinity
n \<noteq> 0

goal (1 subgoal):
 1. LIM x at_infinity. x ^ n :> at_infinity
[PROOF STEP]
apply (subst filterlim_cong[where g="poly (monom 1 n)"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>0 < degree (monom (1::?'b1) n) \<Longrightarrow> filterlim (poly (monom (1::?'b1) n)) at_infinity at_infinity; n \<noteq> 0\<rbrakk> \<Longrightarrow> at_infinity = ?F1'4
 2. \<lbrakk>0 < degree (monom (1::?'b1) n) \<Longrightarrow> filterlim (poly (monom (1::?'b1) n)) at_infinity at_infinity; n \<noteq> 0\<rbrakk> \<Longrightarrow> at_infinity = ?F2'4
 3. \<lbrakk>0 < degree (monom (1::?'b1) n) \<Longrightarrow> filterlim (poly (monom (1::?'b1) n)) at_infinity at_infinity; n \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_infinity. x ^ n = poly (monom (1::'a) n) x
 4. \<lbrakk>0 < degree (monom (1::?'b1) n) \<Longrightarrow> filterlim (poly (monom (1::?'b1) n)) at_infinity at_infinity; n \<noteq> 0\<rbrakk> \<Longrightarrow> filterlim (poly (monom (1::'a) n)) ?F1'4 ?F2'4
[PROOF STEP]
by (auto simp add:poly_monom degree_monom_eq)


[STATEMENT]
lemma transitive: assumes "a~b" and "b~c" shows "a~c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ~ c
[PROOF STEP]
using Tangle_Equivalence.trans assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A ~ ?B; ?B ~ ?C\<rbrakk> \<Longrightarrow> ?A ~ ?C
a ~ b
b ~ c

goal (1 subgoal):
 1. a ~ c
[PROOF STEP]
by metis


[STATEMENT]
lemma mult_mat_vec_resize:
  "v \<^sub>v* A = (resize_vec (dim_row A) v) \<^sub>v* A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<^sub>v* A = resize_vec (dim_row A) v \<^sub>v* A
[PROOF STEP]
by (simp add: mult_vec_mat_def scalar_prod_def, rule arg_cong2[of _ _ _ _ vec], rule, rule,
      rule sum.cong, rule, simp add: resize_vec_index)


[STATEMENT]
lemma le_mid2__le13:
  assumes "M Midpoint A B" and
    "M' Midpoint A' B'" and
    "A M Le A' M'"
  shows "A B Le A' B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B Le A' B'
[PROOF STEP]
by (smt Tarski_neutral_dimensionless.cong_mid2__cong Tarski_neutral_dimensionless.l7_13 Tarski_neutral_dimensionless_axioms assms(1) assms(2) assms(3) bet2_le2__le2356 l5_6 l7_3_2 le_anti_symmetry le_comm local.le_cases midpoint_bet)


[STATEMENT]
lemma FAddSA_Root_def:
  "\<lbrakk> S \<in> dom G; (States SA) \<inter> (dom G) = {} \<rbrakk>  \<Longrightarrow>
   (Root F (G [f+] (S,SA)) = (@ A . A \<in> F \<and> A \<notin> insert SA (\<Union> (ran G))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<in> dom G; States SA \<inter> dom G = {}\<rbrakk> \<Longrightarrow> Root F (G [f+] (S, SA)) = (SOME A. A \<in> F \<and> A \<notin> insert SA (\<Union> (ran G)))
[PROOF STEP]
apply (unfold Root_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<in> dom G; States SA \<inter> dom G = {}\<rbrakk> \<Longrightarrow> (SOME A. A \<in> F \<and> A \<notin> \<Union> (ran (G [f+] (S, SA)))) = (SOME A. A \<in> F \<and> A \<notin> insert SA (\<Union> (ran G)))
[PROOF STEP]
apply (simp only: FAddSA_Union_ran Int_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma not_outside_connected_component_le:
  fixes S :: "'a::euclidean_space set"
  assumes S: "bounded S"  "2 \<le> DIM('a)"
  shows "- (outside S) = {x. \<forall>B. \<exists>y. B \<le> norm(y) \<and> \<not> connected_component (- S) x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - outside S = {x. \<forall>B. \<exists>y. B \<le> norm y \<and> \<not> connected_component (- S) x y}
[PROOF STEP]
apply (auto intro: less_imp_le simp: not_outside_connected_component_lt [OF assms])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x B. \<forall>B. \<exists>y. B \<le> norm y \<and> \<not> connected_component (- S) x y \<Longrightarrow> \<exists>y. B < norm y \<and> \<not> connected_component (- S) x y
[PROOF STEP]
by (meson gt_ex less_le_trans)


[STATEMENT]
theorem stern_brocot_rationals_not_repeated:
  assumes "root (traverse_tree path (pure rat_of \<diamondop> stern_brocot_recurse))
         = root (traverse_tree path' (pure rat_of \<diamondop> stern_brocot_recurse))"
  shows "path = path'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path = path'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
root (traverse_tree path (pure rat_of \<diamondop> stern_brocot_recurse)) = root (traverse_tree path' (pure rat_of \<diamondop> stern_brocot_recurse))

goal (1 subgoal):
 1. path = path'
[PROOF STEP]
using stern_brocot_coprime[where path=path]
      stern_brocot_coprime[where path=path']
      stern_brocot_denominator_non_zero[where path=path]
      stern_brocot_denominator_non_zero[where path=path']
[PROOF STATE]
proof (prove)
using this:
root (traverse_tree path (pure rat_of \<diamondop> stern_brocot_recurse)) = root (traverse_tree path' (pure rat_of \<diamondop> stern_brocot_recurse))
case root (traverse_tree path stern_brocot_recurse) of (m, n) \<Rightarrow> coprime m n
case root (traverse_tree path' stern_brocot_recurse) of (m, n) \<Rightarrow> coprime m n
case root (traverse_tree path stern_brocot_recurse) of (m, n) \<Rightarrow> 0 < m \<and> 0 < n
case root (traverse_tree path' stern_brocot_recurse) of (m, n) \<Rightarrow> 0 < m \<and> 0 < n

goal (1 subgoal):
 1. path = path'
[PROOF STEP]
by(auto simp: gcd_int_def dest!: rat_inv_eq intro: stern_brocot_fractions_not_repeated simp add: stern_brocot_recurse_iterate[symmetric] split: prod.splits)


[STATEMENT]
lemma symm_trans_Euclid: \<open>symmetric M \<Longrightarrow> transitive M \<Longrightarrow> Euclidean M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>symmetric M; transitive M\<rbrakk> \<Longrightarrow> Euclidean M
[PROOF STEP]
unfolding symmetric_def transitive_def Euclidean_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i. \<forall>v\<in>\<W> M. \<forall>w\<in>\<W> M. (v \<in> \<K> M i w) = (w \<in> \<K> M i v); \<forall>i. \<forall>u\<in>\<W> M. \<forall>v\<in>\<W> M. \<forall>w\<in>\<W> M. w \<in> \<K> M i v \<and> u \<in> \<K> M i w \<longrightarrow> u \<in> \<K> M i v\<rbrakk> \<Longrightarrow> \<forall>i. \<forall>u\<in>\<W> M. \<forall>v\<in>\<W> M. \<forall>w\<in>\<W> M. v \<in> \<K> M i u \<longrightarrow> w \<in> \<K> M i u \<longrightarrow> w \<in> \<K> M i v
[PROOF STEP]
by blast


[STATEMENT]
lemma (in encoding_wrt_barbs) indRelSTEQ_impl_SRel_and_TRel_reflect_barbs:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  assumes reflection: "rel_reflects_barbs (indRelSTEQ SRel TRel) (STCalWB SWB TWB)"
  shows "rel_reflects_barbs SRel SWB"
    and "rel_reflects_barbs TRel TWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB) &&& rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)
 2. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
show "rel_reflects_barbs SRel SWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)
[PROOF STEP]
using reflection rel_with_source_impl_SRel_reflects_barbs[where
                        Rel="indRelSTEQ SRel TRel" and SRel="SRel"]
[PROOF STATE]
proof (prove)
using this:
rel_reflects_binary_pred (indRelSTEQ SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB))
rel_reflects_binary_pred (indRelSTEQ SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB)) \<and> (\<forall>S1 S2. (S1, S2) \<in> SRel \<longrightarrow> SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2) \<Longrightarrow> rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)

goal (1 subgoal):
 1. rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)
[PROOF STEP]
by (simp add: indRelSTEQ.source)
[PROOF STATE]
proof (state)
this:
rel_reflects_binary_pred SRel (\<lambda>b. hasBarb b SWB)

goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
show "rel_reflects_barbs TRel TWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
using reflection rel_with_target_impl_TRel_reflects_barbs[where
                        Rel="indRelSTEQ SRel TRel" and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
rel_reflects_binary_pred (indRelSTEQ SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB))
rel_reflects_binary_pred (indRelSTEQ SRel TRel) (\<lambda>b. hasBarb b (STCalWB SWB TWB)) \<and> (\<forall>T1 T2. (T1, T2) \<in> TRel \<longrightarrow> TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2) \<Longrightarrow> rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)

goal (1 subgoal):
 1. rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)
[PROOF STEP]
by (simp add: indRelSTEQ.target)
[PROOF STATE]
proof (state)
this:
rel_reflects_binary_pred TRel (\<lambda>b. hasBarb b TWB)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma external_equiv_internal_invariant:
  "\<lbrakk> (obs S)`P = Q; observable (obs S) P \<rbrakk>
  \<Longrightarrow> (oreach S \<subseteq> Q) = (reach S \<subseteq> P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>obs S ` P = Q; observable (obs S) P\<rbrakk> \<Longrightarrow> (oreach S \<subseteq> Q) = (reach S \<subseteq> P)
[PROOF STEP]
by (rule external_equiv_internal_invariant_vimage) (auto)


[STATEMENT]
lemma (in order_topology) order_tendstoI:
  "(\<And>a. a < y \<Longrightarrow> eventually (\<lambda>x. a < f x) F) \<Longrightarrow> (\<And>a. y < a \<Longrightarrow> eventually (\<lambda>x. f x < a) F) \<Longrightarrow>
    (f \<longlongrightarrow> y) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a. a < y \<Longrightarrow> \<forall>\<^sub>F x in F. a < f x; \<And>a. y < a \<Longrightarrow> \<forall>\<^sub>F x in F. f x < a\<rbrakk> \<Longrightarrow> (f \<longlongrightarrow> y) F
[PROOF STEP]
by (auto simp: order_tendsto_iff)


[STATEMENT]
lemma scene_union_mono: "\<lbrakk> a \<subseteq>\<^sub>S c; b \<subseteq>\<^sub>S c; a ##\<^sub>S b; idem_scene a; idem_scene b \<rbrakk> \<Longrightarrow> a \<squnion>\<^sub>S b \<subseteq>\<^sub>S c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<subseteq>\<^sub>S c; b \<subseteq>\<^sub>S c; a ##\<^sub>S b; idem_scene a; idem_scene b\<rbrakk> \<Longrightarrow> a \<squnion>\<^sub>S b \<subseteq>\<^sub>S c
[PROOF STEP]
by (simp add: less_eq_scene_def, transfer, auto)


[STATEMENT]
lemma iNextWeak_iff : "(\<circle>\<^sub>W t t0 I. P t) = ((\<circle> t t0 I. P t) \<or> (I \<down>> t0 = {}) \<or> t0 \<notin> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iNextWeak t0 I P = (iNext t0 I P \<or> I \<down>> t0 = {} \<or> t0 \<notin> I)
[PROOF STEP]
apply (unfold iTL_defs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>t\<in>{inext t0 I} \<down>> t0. P t) = (P (inext t0 I) \<or> I \<down>> t0 = {} \<or> t0 \<notin> I)
[PROOF STEP]
apply (simp add: inext_singleton_cut_greater_empty_iff[symmetric] cut_greater_singleton)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma snd_graph_ran: "snd ` graph m = ran m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd ` graph m = ran m
[PROOF STEP]
unfolding graph_def ran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd ` {(a, b) |a b. m a = Some b} = {b. \<exists>a. m a = Some b}
[PROOF STEP]
by force


[STATEMENT]
theorem HEndPhase1_HInv4a:
  "\<lbrakk> HEndPhase1 s s' p; HInv4a s q;  Inv2a s \<rbrakk> \<Longrightarrow> HInv4a s' q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>HEndPhase1 s s' p; HInv4a s q; Inv2a s\<rbrakk> \<Longrightarrow> HInv4a s' q
[PROOF STEP]
by(blast dest: HEndPhase1_HInv4a_p HEndPhase1_HInv4a_q)


[STATEMENT]
lemma lm148:
  assumes "card (Pow X) = 1 \<or> card (Pow X) = 2"
  shows "trivial X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial X
[PROOF STEP]
using assms trivial_empty_or_singleton lm143 lm147 cardinalityOneTheElemIdentity
[PROOF STATE]
proof (prove)
using this:
card (Pow X) = 1 \<or> card (Pow X) = 2
trivial ?X = (?X = {} \<or> ?X = {the_elem ?X})
card (Pow ?A) = 1 \<Longrightarrow> ?A = {}
card (Pow ?A) = 2 \<Longrightarrow> card ?A = 1
(card ?X = 1) = (?X = {the_elem ?X})

goal (1 subgoal):
 1. trivial X
[PROOF STEP]
by metis


[STATEMENT]
lemma map_bset_eq_bempty_iff[simp]: "map_bset f X = bempty \<longleftrightarrow> X = bempty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_bset f X = bempty) = (X = bempty)
[PROOF STEP]
by transfer auto


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

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


[STATEMENT]
lemma moebius_inv_rotation_rotation [simp]:
  shows "moebius_pt (moebius_rotation (-\<phi>)) (moebius_pt (moebius_rotation \<phi>) z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_rotation (- \<phi>)) (moebius_pt (moebius_rotation \<phi>) z) = z
[PROOF STEP]
using moebius_rotation_inv[symmetric, of \<phi>]
[PROOF STATE]
proof (prove)
using this:
moebius_rotation (- \<phi>) = moebius_inv (moebius_rotation \<phi>)

goal (1 subgoal):
 1. moebius_pt (moebius_rotation (- \<phi>)) (moebius_pt (moebius_rotation \<phi>) z) = z
[PROOF STEP]
by (simp del: moebius_rotation_inv)


[STATEMENT]
lemma comm_monoid_ow: "comm_monoid = comm_monoid_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_monoid = comm_monoid_ow UNIV
[PROOF STEP]
unfolding
    comm_monoid_def comm_monoid_ow_def
    comm_monoid_axioms_def comm_monoid_ow_axioms_def
    neutral_ow_def
    abel_semigroup_ow
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f z. abel_semigroup_ow UNIV f \<and> (\<forall>a. f a z = a)) = (\<lambda>f z. abel_semigroup_ow UNIV f \<and> z \<in> UNIV \<and> (\<forall>a. a \<in> UNIV \<longrightarrow> f a z = a))
[PROOF STEP]
by simp


[STATEMENT]
lemma valid_states_nempty:
  fixes PROB :: "(('a, 'b) fmap \<times> ('a, 'b) fmap) set"
  assumes "finite PROB"
  shows "\<exists>s. s \<in> (valid_states PROB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s. s \<in> valid_states PROB
[PROOF STEP]
unfolding valid_states_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s. s \<in> {s. fmdom' s = prob_dom PROB}
[PROOF STEP]
using fmchoice'[OF FINITE_prob_dom[OF assms], where Q = "\<lambda>_ _. True"]
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>prob_dom PROB. \<exists>y. True \<Longrightarrow> \<exists>m. fmdom' m = prob_dom PROB \<and> fmpred (\<lambda>_ _. True) m

goal (1 subgoal):
 1. \<exists>s. s \<in> {s. fmdom' s = prob_dom PROB}
[PROOF STEP]
by auto


[STATEMENT]
lemma size1_imbal2:
  assumes "\<not> bal_log t" and "bal_log (hchild t)" and "t \<noteq> Leaf"
  shows "size1 (t) < (2 powr (1/c) / (2 - 2 powr (1/c))) * (imbal t + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
have *: "2 powr (1 - 1 / c) - 1 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 powr (1 - 1 / c) - 1
[PROOF STEP]
using c1
[PROOF STATE]
proof (prove)
using this:
1 < c

goal (1 subgoal):
 1. 0 < 2 powr (1 - 1 / c) - 1
[PROOF STEP]
by(simp add: field_simps log_less_iff[symmetric])
[PROOF STATE]
proof (state)
this:
0 < 2 powr (1 - 1 / c) - 1

goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
have "(2 powr (1 - 1 / c) - 1) * size1 t < imbal t + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 powr (1 - 1 / c) - 1) * real (size1 t) < real (imbal t + 1)
[PROOF STEP]
using size1_imbal[OF assms]
[PROOF STATE]
proof (prove)
using this:
(2 powr (1 - 1 / c) - 1) * real (size1 t) - 1 < real (imbal t)

goal (1 subgoal):
 1. (2 powr (1 - 1 / c) - 1) * real (size1 t) < real (imbal t + 1)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(2 powr (1 - 1 / c) - 1) * real (size1 t) < real (imbal t + 1)

goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
hence "size1 t < 1 / (2 powr (1 - 1 / c) - 1) * (imbal t + 1)"
[PROOF STATE]
proof (prove)
using this:
(2 powr (1 - 1 / c) - 1) * real (size1 t) < real (imbal t + 1)

goal (1 subgoal):
 1. real (size1 t) < 1 / (2 powr (1 - 1 / c) - 1) * real (imbal t + 1)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
(2 powr (1 - 1 / c) - 1) * real (size1 t) < real (imbal t + 1)
0 < 2 powr (1 - 1 / c) - 1

goal (1 subgoal):
 1. real (size1 t) < 1 / (2 powr (1 - 1 / c) - 1) * real (imbal t + 1)
[PROOF STEP]
by(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
real (size1 t) < 1 / (2 powr (1 - 1 / c) - 1) * real (imbal t + 1)

goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (size1 t) < 1 / (2 powr (1 - 1 / c) - 1) * real (imbal t + 1)

goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
have "1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1/c) / (2 - 2 powr (1/c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
have "1 / (2 powr (1 - 1 / c) - 1) = 1 / (2 / 2 powr (1/c) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (2 powr (1 - 1 / c) - 1) = 1 / (2 / 2 powr (1 / c) - 1)
[PROOF STEP]
by(simp add: powr_diff)
[PROOF STATE]
proof (state)
this:
1 / (2 powr (1 - 1 / c) - 1) = 1 / (2 / 2 powr (1 / c) - 1)

goal (1 subgoal):
 1. 1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / (2 powr (1 - 1 / c) - 1) = 1 / (2 / 2 powr (1 / c) - 1)

goal (1 subgoal):
 1. 1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
have "\<dots> = 2 powr (1/c) / (2 - 2 powr (1/c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (2 / 2 powr (1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
by(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
1 / (2 / 2 powr (1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))

goal (1 subgoal):
 1. 1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))

goal (1 subgoal):
 1. 1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 / (2 powr (1 - 1 / c) - 1) = 2 powr (1 / c) / (2 - 2 powr (1 / c))

goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)

goal (1 subgoal):
 1. real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real (size1 t) < 2 powr (1 / c) / (2 - 2 powr (1 / c)) * real (imbal t + 1)

goal:
No subgoals!
[PROOF STEP]
qed