[STATEMENT]
lemma gval_fold_rev_true:
  "gval (fold gAnd (rev G) (Bc True)) s = true \<Longrightarrow>
   gval (fold gAnd G (Bc True)) s = true"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gval (fold gAnd (rev G) (Bc True)) s = true \<Longrightarrow> gval (fold gAnd G (Bc True)) s = true
[PROOF STEP]
by (metis foldr_conv_fold gval_foldr_true rev_rev_ident set_rev)


[STATEMENT]
lemma out_ocircline_ounit_circle_conjugate [simp]:
  assumes "out_ocircline ounit_circle z"
  shows "out_ocircline ounit_circle (conjugate z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_ocircline ounit_circle (conjugate z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
out_ocircline ounit_circle z

goal (1 subgoal):
 1. out_ocircline ounit_circle (conjugate z)
[PROOF STEP]
by (transfer, transfer, auto simp add: vec_cnj_def)


[STATEMENT]
lemma (in group) cyclic_group_epimorphic_image:
  assumes "h \<in> epi G H" "cyclic_group G" "group H"
  shows "cyclic_group H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
interpret h: group_hom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom G H h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h \<in> epi G H
cyclic_group G
Group.group H

goal (1 subgoal):
 1. group_hom G H h
[PROOF STEP]
by (simp add: group_hom_def group_hom_axioms_def is_group epi_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
obtain x where "x \<in> carrier G" and x: "carrier G = range (\<lambda>n::int. x [^] n)" and eq: "carrier H = h ` carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> carrier G; carrier G = range (([^]) x); carrier H = h ` carrier G\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h \<in> epi G H
cyclic_group G
Group.group H

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> carrier G; carrier G = range (([^]) x); carrier H = h ` carrier G\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: cyclic_group epi_def)
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
carrier G = range (([^]) x)
carrier H = h ` carrier G

goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
have "h ` carrier G = range (\<lambda>n::int. h x [^]\<^bsub>H\<^esub> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))
[PROOF STEP]
by (metis (no_types, lifting) \<open>x \<in> carrier G\<close> h.hom_int_pow image_cong image_image x)
[PROOF STATE]
proof (state)
this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))

goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))

goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
using \<open>x \<in> carrier G\<close> eq h.cyclic_group
[PROOF STATE]
proof (prove)
using this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))
x \<in> carrier G
carrier H = h ` carrier G
cyclic_group H = (\<exists>x\<in>carrier H. carrier H = range (([^]\<^bsub>H\<^esub>) x))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linepath_cnj': "cnj \<circ> linepath a b = linepath (cnj a) (cnj b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj \<circ> linepath a b = linepath (cnj a) (cnj b)
[PROOF STEP]
by (simp add: linepath_def fun_eq_iff)


[STATEMENT]
lemma integral_discrete_difference:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes X: "countable X"
  assumes null: "\<And>x. x \<in> X \<Longrightarrow> emeasure M {x} = 0"
  assumes sets: "\<And>x. x \<in> X \<Longrightarrow> {x} \<in> sets M"
  assumes eq: "\<And>x. x \<in> space M \<Longrightarrow> x \<notin> X \<Longrightarrow> f x = g x"
  shows "integral\<^sup>L M f = integral\<^sup>L M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
proof (rule integral_eq_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable M f = integrable M g
 2. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
show eq: "integrable M f \<longleftrightarrow> integrable M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M f = integrable M g
[PROOF STEP]
by (rule integrable_discrete_difference[where X=X]) fact+
[PROOF STATE]
proof (state)
this:
integrable M f = integrable M g

goal (1 subgoal):
 1. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
assume f: "integrable M f"
[PROOF STATE]
proof (state)
this:
integrable M f

goal (1 subgoal):
 1. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
show "integral\<^sup>L M f = integral\<^sup>L M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
proof (rule integral_cong_AE)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f \<in> borel_measurable M
 2. g \<in> borel_measurable M
 3. AE x in M. f x = g x
[PROOF STEP]
show "f \<in> borel_measurable M" "g \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M &&& g \<in> borel_measurable M
[PROOF STEP]
using f eq
[PROOF STATE]
proof (prove)
using this:
integrable M f
integrable M f = integrable M g

goal (1 subgoal):
 1. f \<in> borel_measurable M &&& g \<in> borel_measurable M
[PROOF STEP]
by (auto intro: borel_measurable_integrable)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. AE x in M. f x = g x
[PROOF STEP]
have "AE x in M. x \<notin> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. x \<notin> X
[PROOF STEP]
by (rule AE_discrete_difference) fact+
[PROOF STATE]
proof (state)
this:
AE x in M. x \<notin> X

goal (1 subgoal):
 1. AE x in M. f x = g x
[PROOF STEP]
with AE_space
[PROOF STATE]
proof (chain)
picking this:
AE x in ?M. x \<in> space ?M
AE x in M. x \<notin> X
[PROOF STEP]
show "AE x in M. f x = g x"
[PROOF STATE]
proof (prove)
using this:
AE x in ?M. x \<in> space ?M
AE x in M. x \<notin> X

goal (1 subgoal):
 1. AE x in M. f x = g x
[PROOF STEP]
by eventually_elim fact
[PROOF STATE]
proof (state)
this:
AE x in M. f x = g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M f = integral\<^sup>L M g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HInfiniteI: "(\<And>r. r \<in> \<real> \<Longrightarrow> r < hnorm x) \<Longrightarrow> x \<in> HInfinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. r \<in> \<real> \<Longrightarrow> r < hnorm x) \<Longrightarrow> x \<in> HInfinite
[PROOF STEP]
by (simp add: HInfinite_def)


[STATEMENT]
lemma inner_minus_left [simp]: "inner (- x) y = - inner x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (- x) y = - inner x y
[PROOF STEP]
using inner_add_left [of x "- x" y]
[PROOF STATE]
proof (prove)
using this:
inner (x + - x) y = inner x y + inner (- x) y

goal (1 subgoal):
 1. inner (- x) y = - inner x y
[PROOF STEP]
using add_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
inner (x + - x) y = inner x y + inner (- x) y
(?a + ?b = (0::?'a)) = (?b = - ?a)

goal (1 subgoal):
 1. inner (- x) y = - inner x y
[PROOF STEP]
by force


[STATEMENT]
lemma size_bubble_min: "size(bubble_min xs) = size xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (bubble_min xs) = length xs
[PROOF STEP]
by(induction xs rule: bubble_min.induct) (auto split: list.split)


[STATEMENT]
lemma take_bit_push_bit:
  "take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
proof (cases "m \<le> n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
 2. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m \<le> n

goal (2 subgoals):
 1. m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
 2. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
apply (simp add:)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = (0::'a)
[PROOF STEP]
apply (simp_all add: push_bit_eq_mult take_bit_eq_mod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> a * (2::'a) ^ n mod (2::'a) ^ m = (0::'a)
[PROOF STEP]
apply (auto dest!: le_Suc_ex simp add: power_add ac_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. n = na + m \<Longrightarrow> a * ((2::'a) ^ na * (2::'a) ^ m) mod (2::'a) ^ m = (0::'a)
[PROOF STEP]
using mult_exp_mod_exp_eq [of m m \<open>a * 2 ^ n\<close> for n]
[PROOF STATE]
proof (prove)
using this:
m \<le> m \<Longrightarrow> a * (2::'a) ^ ?na3 * (2::'a) ^ m mod (2::'a) ^ m = a * (2::'a) ^ ?na3 mod (2::'a) ^ (m - m) * (2::'a) ^ m

goal (1 subgoal):
 1. \<And>na. n = na + m \<Longrightarrow> a * ((2::'a) ^ na * (2::'a) ^ m) mod (2::'a) ^ m = (0::'a)
[PROOF STEP]
apply (simp add: ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)

goal (1 subgoal):
 1. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> m \<le> n

goal (1 subgoal):
 1. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> m \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> m \<le> n

goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
using push_bit_take_bit [of n "m - n" a]
[PROOF STATE]
proof (prove)
using this:
\<not> m \<le> n
push_bit n (take_bit (m - n) a) = take_bit (n + (m - n)) (push_bit n a)

goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma correctCompositionOut_prop1:
assumes "subcomponents PQ = {P,Q}"
       and "correctCompositionOut PQ"
       and "x \<in> (out PQ)"
shows    "(x \<in> (out P)) \<or> (x \<in> (out Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> out P \<or> x \<in> out Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subcomponents PQ = {P, Q}
correctCompositionOut PQ
x \<in> out PQ

goal (1 subgoal):
 1. x \<in> out P \<or> x \<in> out Q
[PROOF STEP]
by (simp add: correctCompositionOut_def)


[STATEMENT]
lemma irreducibleI:
  "p \<noteq> 0 \<Longrightarrow> \<not>p dvd 1 \<Longrightarrow> (\<And>a b. p = a * b \<Longrightarrow> a dvd 1 \<or> b dvd 1) \<Longrightarrow> irreducible p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<noteq> (0::'a); \<not> p dvd (1::'a); \<And>a b. p = a * b \<Longrightarrow> a dvd (1::'a) \<or> b dvd (1::'a)\<rbrakk> \<Longrightarrow> irreducible p
[PROOF STEP]
by (simp add: irreducible_def)


[STATEMENT]
lemma singular_simplex_chain_map_id:
  assumes "singular_simplex p X f"
  shows "chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
have "(restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p)) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f
[PROOF STEP]
by (rule ext) (metis assms comp_apply extensional_arb id_apply restrict_apply singular_simplex_def)
[PROOF STATE]
proof (state)
this:
restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f

goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f

goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
by (simp add: simplex_map_def)
[PROOF STATE]
proof (state)
this:
chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_map_upt: "length (map f [a..<b]) = b - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
have "length [a..<b] = b - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [a..<b] = b - a
[PROOF STEP]
using length_upt
[PROOF STATE]
proof (prove)
using this:
length [?i..<?j] = ?j - ?i

goal (1 subgoal):
 1. length [a..<b] = b - a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length [a..<b] = b - a

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length [a..<b] = b - a

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
have "length (map f [a..<b]) = length [a..<b]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map f [a..<b]) = length [a..<b]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (map f [a..<b]) = length [a..<b]

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length [a..<b] = b - a
length (map f [a..<b]) = length [a..<b]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length [a..<b] = b - a
length (map f [a..<b]) = length [a..<b]

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
length (map f [a..<b]) = b - a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphismI [intro?]:
  assumes "continuous_on S f" "continuous_on T g"
          "f ` S \<subseteq> T" "g ` T \<subseteq> S" "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "\<And>y. y \<in> T \<Longrightarrow> f(g y) = y"
    shows "homeomorphism S T f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism S T f g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
continuous_on T g
f ` S \<subseteq> T
g ` T \<subseteq> S
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
?y \<in> T \<Longrightarrow> f (g ?y) = ?y

goal (1 subgoal):
 1. homeomorphism S T f g
[PROOF STEP]
by (force simp: homeomorphism_def)


[STATEMENT]
lemma compose_map1: "map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)"
  for S1 :: "('a, 'b) dds" and S2 :: "('b, 'c) dds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
using compose_parametric[of "(Grp UNIV f)\<inverse>\<inverse>" "Grp UNIV g" "Grp UNIV id :: 'c \<Rightarrow> 'c \<Rightarrow> bool"]
[PROOF STATE]
proof (prove)
using this:
(rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV g) (Grp UNIV id) ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV id)) (\<bullet>) (\<bullet>)

goal (1 subgoal):
 1. map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(rewrite in "_ ===> rel_dds \<hole> _ ===> _" in asm conversep_conversep[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV g)\<inverse>\<inverse>\<inverse>\<inverse> (Grp UNIV id) ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV id)) (\<bullet>) (\<bullet>) \<Longrightarrow> map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(rewrite in "_ ===> rel_dds _ \<hole> ===> _" in asm conversep_Grp_id[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV g)\<inverse>\<inverse>\<inverse>\<inverse> (Grp UNIV id)\<inverse>\<inverse> ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV id)) (\<bullet>) (\<bullet>) \<Longrightarrow> map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(simp only: rel_dds_conversep rel_dds_Grp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Grp UNIV (map_dds f g) ===> (Grp UNIV (map_dds g id))\<inverse>\<inverse> ===> Grp UNIV (map_dds f id)) (\<bullet>) (\<bullet>) \<Longrightarrow> map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(simp add: rel_fun_def Grp_apply)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_of_assoc_list_of_array:
  "map_of (assoc_list_of_array a) k = (if k < array_length a then Some (array_get a k) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (assoc_list_of_array a) k = (if k < array_length a then Some (array_get a k) else None)
[PROOF STEP]
by(cases a, cases "k < array_length a")(force simp add: set_zip)+


[STATEMENT]
lemma set_of_l_bal: "height l = height r + 2 \<Longrightarrow>
  set_of (l_bal\<^sub>0 x l r) = insert x (set_of l \<union> set_of r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height l = height r + 2 \<Longrightarrow> set_of (l_bal\<^sub>0 x l r) = insert x (set_of l \<union> set_of r)
[PROOF STEP]
by (cases l) (auto split: tree\<^sub>0.splits)


[STATEMENT]
lemma ennreal_suminf_cmult[simp]: "(\<Sum>i. r * f i) = r * (\<Sum>i. f i::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. r * f i) = r * (\<Sum>i. f i)
[PROOF STEP]
by transfer (auto intro!: suminf_cmult_ereal)


[STATEMENT]
lemma leftmost_Derives1_propagate:
  assumes leftmost: "leftmost i a"
      and Derives1: "Derives1 a j r b"
    shows "(is_word b \<and> i = j) \<or> (\<exists> k. leftmost k b \<and> i \<le> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
from leftmost_Derives1[OF leftmost Derives1]
[PROOF STATE]
proof (chain)
picking this:
i \<le> j
[PROOF STEP]
have ij: "i \<le> j"
[PROOF STATE]
proof (prove)
using this:
i \<le> j

goal (1 subgoal):
 1. i \<le> j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<le> j

goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
proof (cases "is_word b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
 2. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
is_word b

goal (2 subgoals):
 1. is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
 2. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
by (metis Derives1 True ij le_neq_implies_less leftmost
          leftmost_unaffected_Derives1 order_refl)
[PROOF STATE]
proof (state)
this:
is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)

goal (1 subgoal):
 1. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> is_word b

goal (1 subgoal):
 1. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
by (metis (no_types, opaque_lifting) Derives1 Derives1_bound Derives1_sentence2
          Derives1_take append_take_drop_id ij le_neq_implies_less leftmost
          leftmost_append leftmost_cons_less leftmost_def length_take
          min.absorb2 nat_le_linear nonword_leftmost_exists not_le)
[PROOF STATE]
proof (state)
this:
is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_abs_leI:
  fixes x y :: ereal
  shows "\<lbrakk> x \<le> y; -x \<le> y \<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; - x \<le> y\<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<le> y
[PROOF STEP]
by(cases x y rule: ereal2_cases)(simp_all)


[STATEMENT]
lemma path_component_of_subset: "S \<subseteq> T \<Longrightarrow> path_component S x y \<Longrightarrow> path_component T x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; path_component S x y\<rbrakk> \<Longrightarrow> path_component T x y
[PROOF STEP]
unfolding path_component_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; \<exists>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> T \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
by auto


[STATEMENT]
lemma dm_eq: assumes i:"irrefl r" and t: "trans r" shows "dm r M = dm r (M -s dm r M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<down>m M = r \<down>m (M -s r \<down>m M)
[PROOF STEP]
using dm_subset[OF assms]
[PROOF STATE]
proof (prove)
using this:
r \<down>m ?M \<subseteq> r \<down>m (?M -s r \<down>m ?M)

goal (1 subgoal):
 1. r \<down>m M = r \<down>m (M -s r \<down>m M)
[PROOF STEP]
unfolding dm_def ds_def diff_def
[PROOF STATE]
proof (prove)
using this:
{y. \<exists>x\<in>#?M. (y, x) \<in> r} \<subseteq> {y. \<exists>x\<in>#{#x \<in># ?M. x \<notin> {y. \<exists>x\<in>#?M. (y, x) \<in> r}#}. (y, x) \<in> r}

goal (1 subgoal):
 1. {y. \<exists>x\<in>#M. (y, x) \<in> r} = {y. \<exists>x\<in>#{#x \<in># M. x \<notin> {y. \<exists>x\<in>#M. (y, x) \<in> r}#}. (y, x) \<in> r}
[PROOF STEP]
by auto


[STATEMENT]
lemma finsum_scalar_prod_sum:
  assumes f: "f : U \<rightarrow> carrier_vec n"
      and w: "w: carrier_vec n"
  shows "finsum V f U \<bullet> w = sum (\<lambda>u. f u \<bullet> w) U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
[PROOF STEP]
using w f
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
f \<in> U \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
[PROOF STEP]
proof (induct U rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>w \<in> carrier_vec n; f \<in> F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f F \<bullet> w = (\<Sum>u\<in>F. f u \<bullet> w); w \<in> carrier_vec n; f \<in> insert x F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f (insert x F) \<bullet> w = (\<Sum>u\<in>insert x F. f u \<bullet> w)
[PROOF STEP]
case (insert u U)
[PROOF STATE]
proof (state)
this:
finite U
u \<notin> U
\<lbrakk>w \<in> carrier_vec n; f \<in> U \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
w \<in> carrier_vec n
f \<in> insert u U \<rightarrow> carrier_vec n

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>w \<in> carrier_vec n; f \<in> F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f F \<bullet> w = (\<Sum>u\<in>F. f u \<bullet> w); w \<in> carrier_vec n; f \<in> insert x F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f (insert x F) \<bullet> w = (\<Sum>u\<in>insert x F. f u \<bullet> w)
[PROOF STEP]
hence f: "f : U \<rightarrow> carrier_vec n" "f u : carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
finite U
u \<notin> U
\<lbrakk>w \<in> carrier_vec n; f \<in> U \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
w \<in> carrier_vec n
f \<in> insert u U \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. f \<in> U \<rightarrow> carrier_vec n &&& f u \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> U \<rightarrow> carrier_vec n
f u \<in> carrier_vec n

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>w \<in> carrier_vec n; f \<in> F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f F \<bullet> w = (\<Sum>u\<in>F. f u \<bullet> w); w \<in> carrier_vec n; f \<in> insert x F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f (insert x F) \<bullet> w = (\<Sum>u\<in>insert x F. f u \<bullet> w)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum V f (insert u U) \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
unfolding finsum_insert[OF insert(1) insert(2) f]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f u + finsum V f U) \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
apply (subst add_scalar_prod_distrib)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. f u \<in> carrier_vec ?n1
 2. finsum V f U \<in> carrier_vec ?n1
 3. w \<in> carrier_vec ?n1
 4. f u \<bullet> w + finsum V f U \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite U
u \<notin> U
\<lbrakk>w \<in> carrier_vec n; f \<in> U \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
w \<in> carrier_vec n
f \<in> insert u U \<rightarrow> carrier_vec n

goal (4 subgoals):
 1. f u \<in> carrier_vec ?n1
 2. finsum V f U \<in> carrier_vec ?n1
 3. w \<in> carrier_vec ?n1
 4. f u \<bullet> w + finsum V f U \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finsum V f (insert u U) \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
[PROOF STEP]
qed auto


[STATEMENT]
lemma bifunctor_proj_fst_ObjMap_vsv[cat_cs_intros]:
  assumes "\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<DD>" and "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>"
  shows "vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
interpret \<SS>: is_functor \<alpha> \<AA> \<DD> \<open>\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<DD>
[PROOF STEP]
by (rule bifunctor_proj_fst_is_functor[OF assms])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
by (rule \<SS>.cf_ObjMap_vsv)
[PROOF STATE]
proof (state)
this:
vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma calculate_test_suite_naive_as_io_sequences_with_assumption_check_completeness :
  fixes M :: "('a::linorder,'b::linorder,'c) fsm"
  assumes "observable M'"
  and     "inputs M' = inputs M"
  and     "completely_specified M'"
  and     "size M' \<le> m"
  and     "calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts"
shows  "(L M' \<subseteq> L M) \<longleftrightarrow> pass_io_set_maximal M' ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
have "inputs M \<noteq> {}"
  and  "observable M"
  and  "completely_specified M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FSM.inputs M \<noteq> {} &&& observable M &&& completely_specified M
[PROOF STEP]
using \<open>calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts\<close>
[PROOF STATE]
proof (prove)
using this:
calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts

goal (1 subgoal):
 1. FSM.inputs M \<noteq> {} &&& observable M &&& completely_specified M
[PROOF STEP]
unfolding calculate_test_suite_naive_as_io_sequences_with_assumption_check_def
[PROOF STATE]
proof (prove)
using this:
(if FSM.inputs M \<noteq> {} then if observable M then if completely_specified M then Inr (test_suite_to_io_maximal M (calculate_test_suite_naive M m)) else Inl STR ''specification is not completely specified'' else Inl STR ''specification is not observable'' else Inl STR ''specification has no inputs'') = Inr ts

goal (1 subgoal):
 1. FSM.inputs M \<noteq> {} &&& observable M &&& completely_specified M
[PROOF STEP]
by (meson Inl_Inr_False)+
[PROOF STATE]
proof (state)
this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M
[PROOF STEP]
have "ts = (test_suite_to_io_maximal M (calculate_test_suite_naive M m))"
[PROOF STATE]
proof (prove)
using this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M

goal (1 subgoal):
 1. ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
using \<open>calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts\<close>
[PROOF STATE]
proof (prove)
using this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M
calculate_test_suite_naive_as_io_sequences_with_assumption_check M m = Inr ts

goal (1 subgoal):
 1. ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
unfolding calculate_test_suite_naive_as_io_sequences_with_assumption_check_def
[PROOF STATE]
proof (prove)
using this:
FSM.inputs M \<noteq> {}
observable M
completely_specified M
(if FSM.inputs M \<noteq> {} then if observable M then if completely_specified M then Inr (test_suite_to_io_maximal M (calculate_test_suite_naive M m)) else Inl STR ''specification is not completely specified'' else Inl STR ''specification is not observable'' else Inl STR ''specification has no inputs'') = Inr ts

goal (1 subgoal):
 1. ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
by (metis sum.inject(2))
[PROOF STATE]
proof (state)
this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
using calculate_test_suite_naive_completeness(2)[OF \<open>observable M\<close> assms(1,2) \<open>inputs M \<noteq> {}\<close>
                                                        \<open>completely_specified M\<close> assms(3,4)]
[PROOF STATE]
proof (prove)
using this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
(L M' \<subseteq> L M) = pass_io_set_maximal M' (calculate_test_suite_naive_as_io_sequences M m)

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
unfolding calculate_test_suite_naive_as_io_sequences_def
[PROOF STATE]
proof (prove)
using this:
ts = test_suite_to_io_maximal M (calculate_test_suite_naive M m)
(L M' \<subseteq> L M) = pass_io_set_maximal M' (test_suite_to_io_maximal M (calculate_test_suite_naive M m))

goal (1 subgoal):
 1. (L M' \<subseteq> L M) = pass_io_set_maximal M' ts
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(L M' \<subseteq> L M) = pass_io_set_maximal M' ts

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspace_Int: "(\<And>i. i \<in> I \<Longrightarrow> subspace (s i)) \<Longrightarrow> subspace (\<Inter>i\<in>I. s i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> subspace (s i)) \<Longrightarrow> subspace (\<Inter> (s ` I))
[PROOF STEP]
by (auto simp: subspace_def)


[STATEMENT]
lemma genPrefix_length_le: "(xs,ys) \<in> genPrefix r \<Longrightarrow> length xs <= length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> genPrefix r \<Longrightarrow> length xs \<le> length ys
[PROOF STEP]
by (erule genPrefix.induct, auto)


[STATEMENT]
lemma arcosh_ge_0 [simp]:
  fixes x::real
  assumes "x \<ge> 1"
  shows "arcosh x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> arcosh x
[PROOF STEP]
by (smt arcosh_def assms ln_ge_zero powr_ge_pzero)


[STATEMENT]
lemma distinct_set_mset_eq:
  assumes "distinct_mset M" "distinct_mset N" "set_mset M = set_mset N"
  shows "M = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = N
[PROOF STEP]
using assms distinct_mset_set_mset_ident
[PROOF STATE]
proof (prove)
using this:
distinct_mset M
distinct_mset N
set_mset M = set_mset N
distinct_mset ?M \<Longrightarrow> mset_set (set_mset ?M) = ?M

goal (1 subgoal):
 1. M = N
[PROOF STEP]
by fastforce


[STATEMENT]
theorem fermat_test_prime:
  assumes "prime n"
  shows   "fermat_test n = return_pmf True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
interpret fermat_test_not_Carmichael_number n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fermat_test_not_Carmichael_number n
[PROOF STEP]
using assms Carmichael_number_not_prime
[PROOF STATE]
proof (prove)
using this:
prime n
Carmichael_number ?n \<Longrightarrow> \<not> prime ?n

goal (1 subgoal):
 1. fermat_test_not_Carmichael_number n
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prime n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime n

goal (1 subgoal):
 1. fermat_test n = return_pmf True
[PROOF STEP]
by (rule fermat_test.prime)
[PROOF STATE]
proof (state)
this:
fermat_test n = return_pmf True

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iprev_UNIV: "iprev n UNIV = n - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iprev n UNIV = n - Suc 0
[PROOF STEP]
apply (simp add: iprev_def cut_less_def, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x < n \<Longrightarrow> Max {x. x < n} = n - Suc 0
 2. \<forall>x. \<not> x < n \<Longrightarrow> n = n - Suc 0
[PROOF STEP]
apply (rule Max_equality)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. x < n \<Longrightarrow> n - Suc 0 \<in> {x. x < n}
 2. \<And>x. x < n \<Longrightarrow> finite {x. x < n}
 3. \<And>x xa. \<lbrakk>x < n; xa \<in> {x. x < n}\<rbrakk> \<Longrightarrow> xa \<le> n - Suc 0
 4. \<forall>x. \<not> x < n \<Longrightarrow> n = n - Suc 0
[PROOF STEP]
apply fastforce+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma psi_convex1:
  assumes "psi c a b"
  assumes "psi d a b"
  assumes "0 \<le> u" "0 \<le> v" "u + v = 1"
  shows "psi (u *\<^sub>R c + v *\<^sub>R d) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
psi c a b
psi d a b
0 \<le> u
0 \<le> v
u + v = 1
[PROOF STEP]
have v: "v = (1 - u)"
[PROOF STATE]
proof (prove)
using this:
psi c a b
psi d a b
0 \<le> u
0 \<le> v
u + v = 1

goal (1 subgoal):
 1. v = 1 - u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v = 1 - u

goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
psi c a b
psi d a b
0 \<le> u
0 \<le> v
u + v = 1

goal (1 subgoal):
 1. psi (u *\<^sub>R c + v *\<^sub>R d) a b
[PROOF STEP]
by (auto simp: psi_def v intro!: lex_convex2' lex_convex2)
[PROOF STATE]
proof (state)
this:
psi (u *\<^sub>R c + v *\<^sub>R d) a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subresultant'_mat_sylvester_mat: "transpose_mat (subresultant'_mat 0 0 f g) = sylvester_mat f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
obtain dg where dg: "degree g = dg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>dg. degree g = dg \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree g = dg

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
obtain df where df: "degree f = df"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>df. degree f = df \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree f = df

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
let ?M = "transpose_mat (subresultant'_mat 0 0 f g)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
let ?n = "degree f + degree g"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
have dim: "dim_row ?M = ?n" "dim_col ?M = ?n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g &&& dim_col (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g
[PROOF STEP]
by (auto simp: subresultant'_mat_def Let_def)
[PROOF STATE]
proof (state)
this:
dim_row (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g
dim_col (subresultant'_mat 0 0 f g)\<^sup>T = degree f + degree g

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g
[PROOF STEP]
proof (rule eq_matI, unfold sylvester_mat_dim dim df dg, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
case ij: (1 i j)
[PROOF STATE]
proof (state)
this:
i < df + dg
j < df + dg

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
have "?M $$ (i,j) = (if i < dg
         then if j = df + dg - 1
              then coeff_int f (- int (dg - 1) + int i)
              else coeff_int f (int df - int j + int i)
         else if j = df + dg - 1
              then coeff_int g (- int (df - 1) + int (i - dg))
              else coeff_int g (int dg - int j + int (i - dg)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
using ij
[PROOF STATE]
proof (prove)
using this:
i < df + dg
j < df + dg

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
unfolding subresultant'_mat_def Let_def
[PROOF STATE]
proof (prove)
using this:
i < df + dg
j < df + dg

goal (1 subgoal):
 1. (mat (degree f - 0 + (degree g - 0)) (degree f - 0 + (degree g - 0)) (\<lambda>(i, j). if j < degree g - 0 then if i = degree f - 0 + (degree g - 0) - 1 then coeff_int f (int 0 - int (degree g - 0 - 1) + int j) else coeff_int f (int (degree f) - int i + int j) else if i = degree f - 0 + (degree g - 0) - 1 then coeff_int g (int 0 - int (degree f - 0 - 1) + int (j - (degree g - 0))) else coeff_int g (int (degree g) - int i + int (j - (degree g - 0)))))\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
by (simp add: if_splits df dg)
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
have "\<dots> = (if i < dg
         then coeff_int f (int df - int j + int i)
         else coeff_int g (int dg - int j + int (i - dg)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
have cong: "(b \<Longrightarrow> x = z) \<Longrightarrow> (\<not> b \<Longrightarrow> y = z) \<Longrightarrow> (if b then coeff_int f x else coeff_int f y) = coeff_int f z"
        for b x y z and f :: "'a poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<Longrightarrow> x = z; \<not> b \<Longrightarrow> y = z\<rbrakk> \<Longrightarrow> (if b then coeff_int f x else coeff_int f y) = coeff_int f z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<Longrightarrow> ?x = ?z; \<not> ?b \<Longrightarrow> ?y = ?z\<rbrakk> \<Longrightarrow> (if ?b then coeff_int ?f ?x else coeff_int ?f ?y) = coeff_int ?f ?z

goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))
[PROOF STEP]
by (rule if_cong[OF refl cong cong], insert ij, auto)
[PROOF STATE]
proof (state)
this:
(if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if i < dg then if j = df + dg - 1 then coeff_int f (- int (dg - 1) + int i) else coeff_int f (int df - int j + int i) else if j = df + dg - 1 then coeff_int g (- int (df - 1) + int (i - dg)) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
have "\<dots> = sylvester_mat f g $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
have *: "i \<le> j \<Longrightarrow> j - i \<le> df \<Longrightarrow> nat (int df - int j + int i) = df - (j - i)" for j i df
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j - i \<le> df\<rbrakk> \<Longrightarrow> nat (int df - int j + int i) = df - (j - i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i \<le> ?j; ?j - ?i \<le> ?df\<rbrakk> \<Longrightarrow> nat (int ?df - int ?j + int ?i) = ?df - (?j - ?i)

goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
unfolding sylvester_index_mat[OF ij[folded df dg]] df dg
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = (if i < dg then if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a) else if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
proof (rule if_cong[OF refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < dg \<Longrightarrow> coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
 2. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
assume i: "i < dg"
[PROOF STATE]
proof (state)
this:
i < dg

goal (2 subgoals):
 1. i < dg \<Longrightarrow> coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
 2. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
have "int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df

goal (2 subgoals):
 1. i < dg \<Longrightarrow> coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
 2. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
thus "coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else 0)"
[PROOF STATE]
proof (prove)
using this:
int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df

goal (1 subgoal):
 1. coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
[PROOF STEP]
using i ij
[PROOF STATE]
proof (prove)
using this:
int df - int j + int i < 0 \<longrightarrow> \<not> j - i \<le> df
i < dg
i < df + dg
j < df + dg

goal (1 subgoal):
 1. coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))
[PROOF STEP]
by (simp add: coeff_int_def *, intro impI  coeff_eq_0[of f, unfolded df], linarith)
[PROOF STATE]
proof (state)
this:
coeff_int f (int df - int j + int i) = (if i \<le> j \<and> j - i \<le> df then coeff f (df + i - j) else (0::'a))

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
assume i: "\<not> i < dg"
[PROOF STATE]
proof (state)
this:
\<not> i < dg

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
hence **: "i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j"
[PROOF STATE]
proof (prove)
using this:
\<not> i < dg

goal (1 subgoal):
 1. i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j
[PROOF STEP]
using ij
[PROOF STATE]
proof (prove)
using this:
\<not> i < dg
i < df + dg
j < df + dg

goal (1 subgoal):
 1. i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
i - dg \<le> j \<Longrightarrow> dg - (j + dg - i) = i - j

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
have "int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i

goal (1 subgoal):
 1. \<not> i < dg \<Longrightarrow> coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
thus "coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else 0)"
[PROOF STATE]
proof (prove)
using this:
int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i

goal (1 subgoal):
 1. coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
using ij i
[PROOF STATE]
proof (prove)
using this:
int dg - int j + int (i - dg) < 0 \<longrightarrow> \<not> j \<le> i
i < df + dg
j < df + dg
\<not> i < dg

goal (1 subgoal):
 1. coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))
[PROOF STEP]
by (simp add: coeff_int_def * **, intro impI  coeff_eq_0[of g, unfolded dg], linarith)
[PROOF STATE]
proof (state)
this:
coeff_int g (int dg - int j + int (i - dg)) = (if i - dg \<le> j \<and> j \<le> i then coeff g (i - j) else (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if i < dg then coeff_int f (int df - int j + int i) else coeff_int g (int dg - int j + int (i - dg))) = sylvester_mat f g $$ (i, j)

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < df + dg; j < df + dg\<rbrakk> \<Longrightarrow> (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
 2. df + dg = df + dg
 3. df + dg = df + dg
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)

goal (1 subgoal):
 1. (subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T $$ (i, j) = sylvester_mat f g $$ (i, j)

goal (2 subgoals):
 1. df + dg = df + dg
 2. df + dg = df + dg
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(subresultant'_mat 0 0 f g)\<^sup>T = sylvester_mat f g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cauchy_snd: "Cauchy X \<Longrightarrow> Cauchy (\<lambda>n. snd (X n :: 'a::metric_space \<times> 'b::metric_space))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy X \<Longrightarrow> Cauchy (\<lambda>n. snd (X n))
[PROOF STEP]
unfolding Cauchy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < e \<Longrightarrow> \<forall>e>0. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (snd (X m)) (snd (X n)) < e
[PROOF STEP]
by (fast elim: le_less_trans [OF dist_snd_le])


[STATEMENT]
lemma residual_galois: "residuated f \<Longrightarrow> f(x) \<le> y \<longleftrightarrow> x \<le> residual f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated f \<Longrightarrow> (f x \<le> y) = (x \<le> residual f y)
[PROOF STEP]
apply (clarsimp simp: residuated_def residuated_pair_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> (x \<le> g y) = (x \<le> residual f y)
[PROOF STEP]
apply (subgoal_tac "residual f = g")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>g. \<lbrakk>\<forall>x y. (f x \<le> y) = (x \<le> g y); residual f = g\<rbrakk> \<Longrightarrow> (x \<le> g y) = (x \<le> residual f y)
 2. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> residual f = g
[PROOF STEP]
apply (simp_all add: residual_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> (THE g. residuated_pair f g) = g
[PROOF STEP]
apply (rule the1_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> \<exists>!g. residuated_pair f g
 2. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> residuated_pair f g
[PROOF STEP]
apply (metis residuated_def residuated_pair_def residual_unique)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> residuated_pair f g
[PROOF STEP]
by (simp add: residuated_pair_def)


[STATEMENT]
lemma regular_Append: "regular (Append T k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
have "pointwise (Append T k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pointwise (Append T k)
[PROOF STEP]
using pointwise_Append
[PROOF STATE]
proof (prove)
using this:
pointwise (Append ?T ?k)

goal (1 subgoal):
 1. pointwise (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pointwise (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pointwise (Append T k)
[PROOF STEP]
have "pointbased (Append T k)"
[PROOF STATE]
proof (prove)
using this:
pointwise (Append T k)

goal (1 subgoal):
 1. pointbased (Append T k)
[PROOF STEP]
using pointwise_implies_pointbased
[PROOF STATE]
proof (prove)
using this:
pointwise (Append T k)
pointwise ?f \<Longrightarrow> pointbased ?f

goal (1 subgoal):
 1. pointbased (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pointbased (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pointbased (Append T k)
[PROOF STEP]
have "continuous (Append T k)"
[PROOF STATE]
proof (prove)
using this:
pointbased (Append T k)

goal (1 subgoal):
 1. continuous (Append T k)
[PROOF STEP]
using pointbased_implies_continuous
[PROOF STATE]
proof (prove)
using this:
pointbased (Append T k)
pointbased ?f \<Longrightarrow> continuous ?f

goal (1 subgoal):
 1. continuous (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
have "setmonotone (Append T k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. setmonotone (Append T k)
[PROOF STEP]
by (simp add: setmonotone_def Append_def)
[PROOF STATE]
proof (state)
this:
setmonotone (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous (Append T k)
setmonotone (Append T k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous (Append T k)
setmonotone (Append T k)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
using regular_def
[PROOF STATE]
proof (prove)
using this:
continuous (Append T k)
setmonotone (Append T k)
regular ?f = (setmonotone ?f \<and> continuous ?f)

goal (1 subgoal):
 1. regular (Append T k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
regular (Append T k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_entries [simp]: "entries (map f t) = List.map (\<lambda>(k, v). (k, f k v)) (entries t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. entries (RBT_Impl.map f t) = list.map (\<lambda>(k, v). (k, f k v)) (entries t)
[PROOF STEP]
by (induct t) auto


[STATEMENT]
lemma fls_integral_add [simp]: "fls_integral (f+g) = fls_integral f + fls_integral g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (f + g) = fls_integral f + fls_integral g
[PROOF STEP]
by (intro fls_eqI) (simp add: algebra_simps)


[STATEMENT]
lemma gbinomial_index_swap:
  "((-1) ^ k) * ((- (of_nat n) - 1) gchoose k) = ((-1) ^ n) * ((- (of_nat k) - 1) gchoose n)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "?lhs = (of_nat (k + n) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k
[PROOF STEP]
by (subst gbinomial_negated_upper) (simp add: power_mult_distrib [symmetric])
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = (of_nat (k + n) gchoose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose k = of_nat (k + n) gchoose n
[PROOF STEP]
by (subst gbinomial_of_nat_symmetric) simp_all
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
by (subst gbinomial_negated_upper) simp
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma construct_tree_inv_aux:
  assumes "\<not> y \<le> v"
      and "construct_tree_inv v x y D R"
    shows "singleton (choose_singleton (v*-v\<^sup>T \<cdot> R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singleton (choose_singleton (v * - v\<^sup>T \<cdot> R))
[PROOF STEP]
proof (rule choose_singleton_singleton, rule notI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
assume "v*-v\<^sup>T \<cdot> R = 0"
[PROOF STATE]
proof (state)
this:
v * - v\<^sup>T \<cdot> R = 0

goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
hence "R\<^sup>T\<^sup>\<star>*v \<le> v"
[PROOF STATE]
proof (prove)
using this:
v * - v\<^sup>T \<cdot> R = 0

goal (1 subgoal):
 1. R\<^sup>T\<^sup>\<star> * v \<le> v
[PROOF STEP]
by (metis galois_aux conv_compl conv_galois_1 conv_galois_2 conv_invol double_compl
              star_inductl_var)
[PROOF STATE]
proof (state)
this:
R\<^sup>T\<^sup>\<star> * v \<le> v

goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
hence "y = 0"
[PROOF STATE]
proof (prove)
using this:
R\<^sup>T\<^sup>\<star> * v \<le> v

goal (1 subgoal):
 1. y = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R\<^sup>T\<^sup>\<star> * v \<le> v
\<not> y \<le> v
construct_tree_inv v x y D R

goal (1 subgoal):
 1. y = 0
[PROOF STEP]
by (meson mult_isol order_trans sup.cobounded1)
[PROOF STATE]
proof (state)
this:
y = 0

goal (1 subgoal):
 1. v * - v\<^sup>T \<cdot> R = 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
y = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms point_is_point
[PROOF STATE]
proof (prove)
using this:
y = 0
\<not> y \<le> v
construct_tree_inv v x y D R
point ?x = is_point ?x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma three_div_general:
  fixes D :: "nat \<Rightarrow> nat"
  shows "(3 dvd (\<Sum>x<nd. D x * 10^x)) = (3 dvd (\<Sum>x<nd. D x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (3 dvd (\<Sum>x<nd. D x * 10 ^ x)) = (3 dvd sum D {..<nd})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
have mono: "(\<Sum>x<nd. D x) \<le> (\<Sum>x<nd. D x * 10^x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
by (rule sum_mono) simp
[PROOF STATE]
proof (state)
this:
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
txt \<open>This lets us form the term
         \<^term>\<open>(\<Sum>x<nd. D x * 10^x) - (\<Sum>x<nd. D x)\<close>\<close>
[PROOF STATE]
proof (state)
this:
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
assume "3 dvd (\<Sum>x<nd. D x)"
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd}

goal (2 subgoals):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
 2. 3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
with three_divs_2 mono
[PROOF STATE]
proof (chain)
picking this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd sum D {..<nd}
[PROOF STEP]
show "3 dvd (\<Sum>x<nd. D x * 10^x)"
[PROOF STATE]
proof (prove)
using this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd sum D {..<nd}

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
by (blast intro: dvd_diffD)
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd} \<Longrightarrow> 3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
assume "3 dvd (\<Sum>x<nd. D x * 10^x)"
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}
[PROOF STEP]
with three_divs_2 mono
[PROOF STATE]
proof (chain)
picking this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd (\<Sum>x<nd. D x * 10 ^ x)
[PROOF STEP]
show "3 dvd (\<Sum>x<nd. D x)"
[PROOF STATE]
proof (prove)
using this:
3 dvd (\<Sum>x<?nd. ?D x * 10 ^ x) - sum ?D {..<?nd}
sum D {..<nd} \<le> (\<Sum>x<nd. D x * 10 ^ x)
3 dvd (\<Sum>x<nd. D x * 10 ^ x)

goal (1 subgoal):
 1. 3 dvd sum D {..<nd}
[PROOF STEP]
by (blast intro: dvd_diffD1)
[PROOF STATE]
proof (state)
this:
3 dvd sum D {..<nd}

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * 10 ^ x) \<Longrightarrow> 3 dvd sum D {..<nd}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_nodesRight: "finite nodesRight"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite nodesRight
[PROOF STEP]
using finite_nodes nodes_nodesLeftRight
[PROOF STATE]
proof (prove)
using this:
finite nodes
nodes = nodesLeft \<union> nodesRight

goal (1 subgoal):
 1. finite nodesRight
[PROOF STEP]
by auto


[STATEMENT]
lemma atoms_of_cnf_Un: "atoms_of_cnf (S \<union> T) = atoms_of_cnf S \<union> atoms_of_cnf T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_of_cnf (S \<union> T) = atoms_of_cnf S \<union> atoms_of_cnf T
[PROOF STEP]
unfolding atoms_of_cnf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_of_lit ` \<Union> (S \<union> T) = atoms_of_lit ` \<Union> S \<union> atoms_of_lit ` \<Union> T
[PROOF STEP]
by auto


[STATEMENT]
lemma transfer_rec_list[refine_transfer]:
  assumes FN: "\<And>s. \<alpha> (fn s) \<le> fn' s"
  assumes FC: "\<And>x l rec rec' s. \<lbrakk> \<And>s. \<alpha> (rec s) \<le> (rec' s) \<rbrakk>
    \<Longrightarrow> \<alpha> (fc x l rec s) \<le> fc' x l rec' s"
  shows "\<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s
[PROOF STEP]
apply (induct l arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. \<alpha> (rec_list fn fc [] s) \<le> rec_list fn' fc' [] s
 2. \<And>a l s. (\<And>s. \<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s) \<Longrightarrow> \<alpha> (rec_list fn fc (a # l) s) \<le> rec_list fn' fc' (a # l) s
[PROOF STEP]
apply (simp add: FN)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l s. (\<And>s. \<alpha> (rec_list fn fc l s) \<le> rec_list fn' fc' l s) \<Longrightarrow> \<alpha> (rec_list fn fc (a # l) s) \<le> rec_list fn' fc' (a # l) s
[PROOF STEP]
apply (simp add: FC)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fBall_alt_def: "fBall S P \<longleftrightarrow> (\<forall>x. x |\<in>| S \<longrightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fBall S P = (\<forall>x. x |\<in>| S \<longrightarrow> P x)
[PROOF STEP]
by force


[STATEMENT]
lemma aff_dim_simplex:
   "n simplex S \<Longrightarrow> aff_dim S = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n simplex S \<Longrightarrow> aff_dim S = n
[PROOF STEP]
by (metis simplex add.commute add_diff_cancel_left' aff_dim_convex_hull affine_independent_iff_card)


[STATEMENT]
lemma partition_Union: "A \<subseteq> \<Union>C \<Longrightarrow> (\<Union>c\<in>C. A \<inter> c) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> \<Union> C \<Longrightarrow> \<Union> ((\<inter>) A ` C) = A
[PROOF STEP]
by blast


[STATEMENT]
lemma Fract_of_nat_eq: "Fract (of_nat k) 1 = of_nat k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract (int k) 1 = of_nat k
[PROOF STEP]
by (rule of_nat_rat [symmetric])


[STATEMENT]
lemma continuous_map_Euclidean_space_diff [continuous_intros]:
   "\<lbrakk>continuous_map X (Euclidean_space n) f; continuous_map X (Euclidean_space n) g\<rbrakk>
    \<Longrightarrow> continuous_map X (Euclidean_space n) (\<lambda>x i. f x i - g x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X (Euclidean_space n) f; continuous_map X (Euclidean_space n) g\<rbrakk> \<Longrightarrow> continuous_map X (Euclidean_space n) (\<lambda>x i. f x i - g x i)
[PROOF STEP]
unfolding Euclidean_space_def continuous_map_in_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X (powertop_real UNIV) f \<and> f ` topspace X \<subseteq> {x. \<forall>i\<ge>n. x i = 0}; continuous_map X (powertop_real UNIV) g \<and> g ` topspace X \<subseteq> {x. \<forall>i\<ge>n. x i = 0}\<rbrakk> \<Longrightarrow> continuous_map X (powertop_real UNIV) (\<lambda>x i. f x i - g x i) \<and> (\<lambda>x i. f x i - g x i) ` topspace X \<subseteq> {x. \<forall>i\<ge>n. x i = 0}
[PROOF STEP]
by (fastforce simp add: continuous_map_componentwise_UNIV continuous_map_diff)


[STATEMENT]
lemma int_fun_to_poly_deg:
  assumes "\<And>i. i > d \<Longrightarrow> f i = 0"
  shows "deg Q\<^sub>p (int_fun_to_poly f) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg Q\<^sub>p (int_fun_to_poly f) \<le> d
[PROOF STEP]
apply(rule UPQ.deg_leqI, rule int_fun_to_poly_closed, rule assms, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> int_fun_to_poly f n = \<zero>
[PROOF STEP]
unfolding int_fun_to_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> [f n] \<cdot> \<one> = \<zero>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
d < ?i4 \<Longrightarrow> f ?i4 = 0

goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> [f n] \<cdot> \<one> = \<zero>
[PROOF STEP]
using Qp.int_inc_zero
[PROOF STATE]
proof (prove)
using this:
d < ?i4 \<Longrightarrow> f ?i4 = 0
[0] \<cdot> \<one> = \<zero>

goal (1 subgoal):
 1. \<And>n. d < n \<Longrightarrow> [f n] \<cdot> \<one> = \<zero>
[PROOF STEP]
by presburger


[STATEMENT]
lemma compl_of_1: "NOT 1 = (-2 :: 'a :: len word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NOT 1 = - 2
[PROOF STEP]
by (fact not_one_eq)


[STATEMENT]
lemma tm_abs_range:
  assumes x: "x \<in>\<^sub>i range_tm e t"
  assumes n: "num_params (tm_poly t) \<le> length I" and d: "develops_at_within e a I"
  shows "abs x \<in>\<^sub>i range_tm e (tm_abs prec I a t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
obtain p e where t_def[simp]: "t = TaylorModel p e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p e. t = TaylorModel p e \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using taylor_model.exhaust
[PROOF STATE]
proof (prove)
using this:
(\<And>x1 x2. ?y = TaylorModel x1 x2 \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>p e. t = TaylorModel p e \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t = TaylorModel p e

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
define bound where "bound = compute_bound_tm prec I a t"
[PROOF STATE]
proof (state)
this:
bound = compute_bound_tm prec I a t

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
have bound: "x \<in>\<^sub>r bound"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in>\<^sub>r bound
[PROOF STEP]
unfolding bound_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in>\<^sub>r compute_bound_tm prec I a t
[PROOF STEP]
using n d x
[PROOF STATE]
proof (prove)
using this:
num_params (tm_poly t) \<le> length I
develops_at_within e a I
x \<in>\<^sub>i range_tm e t

goal (1 subgoal):
 1. x \<in>\<^sub>r compute_bound_tm prec I a t
[PROOF STEP]
by (rule compute_bound_tm_correct)
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>r bound

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
define abs_bound where "abs_bound \<equiv> Ivl 0 (max \<bar>lower bound\<bar> \<bar>upper bound\<bar>)"
[PROOF STATE]
proof (state)
this:
abs_bound \<equiv> Ivl 0 (max \<bar>lower bound\<bar> \<bar>upper bound\<bar>)

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
have abs_bound: "\<bar>x\<bar> \<in>\<^sub>r abs_bound"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>r abs_bound
[PROOF STEP]
using bound
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>r bound

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>r abs_bound
[PROOF STEP]
by (auto simp: abs_bound_def set_of_eq abs_real_def max_def min_def)
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<in>\<^sub>r abs_bound

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
have tm_abs_decomp: "tm_abs prec I a t = TaylorModel (poly.C (mid abs_bound)) (centered abs_bound)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tm_abs prec I a t = TaylorModel (mid abs_bound)\<^sub>p (centered abs_bound)
[PROOF STEP]
by (simp add: bound_def abs_bound_def Let_def tm_abs.simps)
[PROOF STATE]
proof (state)
this:
tm_abs prec I a t = TaylorModel (mid abs_bound)\<^sub>p (centered abs_bound)

goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)
[PROOF STEP]
unfolding tm_abs_decomp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<in>\<^sub>i range_tm e (TaylorModel (mid abs_bound)\<^sub>p (centered abs_bound))
[PROOF STEP]
by (rule range_tmI) (auto simp: mid_centered_collapse abs_bound)
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<in>\<^sub>i range_tm e (tm_abs prec I a t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in semicategory) op_smc_is_monic_arr[smc_op_simps]:
  "f : b \<mapsto>\<^sub>m\<^sub>o\<^sub>n\<^bsub>op_smc \<CC>\<^esub> a \<longleftrightarrow> f : a \<mapsto>\<^sub>e\<^sub>p\<^sub>i\<^bsub>\<CC>\<^esub> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f : b \<mapsto>\<^sub>m\<^sub>o\<^sub>n\<^bsub>op_smc \<CC>\<^esub> a = f : a \<mapsto>\<^sub>e\<^sub>p\<^sub>i\<^bsub>\<CC>\<^esub> b
[PROOF STEP]
unfolding is_monic_arr_def is_epic_arr_def smc_op_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f : a \<mapsto>\<^bsub>\<CC>\<^esub> b \<and> (\<forall>fa g a. fa : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> g : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> fa = f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> g \<longrightarrow> fa = g)) = (f : a \<mapsto>\<^bsub>\<CC>\<^esub> b \<and> (\<forall>fa g a. fa : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> g : b \<mapsto>\<^bsub>\<CC>\<^esub> a \<longrightarrow> f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> fa = f \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> g \<longrightarrow> fa = g))
[PROOF STEP]
..


[STATEMENT]
lemma mcont_Pair:
  "\<lbrakk> mcont lub ord luba orda f; mcont lub ord lubb ordb g \<rbrakk>
  \<Longrightarrow> mcont lub ord (prod_lub luba lubb) (rel_prod orda ordb) (\<lambda>x. (f x, g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mcont lub ord luba orda f; mcont lub ord lubb ordb g\<rbrakk> \<Longrightarrow> mcont lub ord (prod_lub luba lubb) (rel_prod orda ordb) (\<lambda>x. (f x, g x))
[PROOF STEP]
by(rule mcontI)(simp_all add: monotone_Pair mcont_mono cont_Pair)


[STATEMENT]
lemma zhmset_of_enat_lt_iff_ne_infinity: "zhmset_of_enat x < \<omega>\<^sub>z \<longleftrightarrow> x \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (zhmset_of_enat x < \<omega>\<^sub>z) = (x \<noteq> \<infinity>)
[PROOF STEP]
by (cases x; simp)


[STATEMENT]
lemma insert_filter_set_false: "\<not> P x \<Longrightarrow> {a \<in> (insert x A) . P a} = {a \<in> A . P a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> P x \<Longrightarrow> {a \<in> insert x A. P a} = {a \<in> A. P a}
[PROOF STEP]
by auto


[STATEMENT]
lemma hom_mult:
  "\<lbrakk>h \<in> hom G H; x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> hom G H; x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y
[PROOF STEP]
by (auto simp: hom_def)


[STATEMENT]
lemma forward_UV_lists_arg_min_ex_aux:
  "\<lbrakk>finite ys; ys \<noteq> {};
    ys = {x. set x = xs \<and> distinct x \<and> take 1 x = [r] \<and> forward x \<and> (\<forall>xs \<in> Y. sublist xs x)}\<rbrakk>
    \<Longrightarrow> \<exists>y \<in> ys. \<forall>z \<in> ys. (f :: 'a list \<Rightarrow> real) y \<le> f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite ys; ys \<noteq> {}; ys = {x. set x = xs \<and> distinct x \<and> take 1 x = [r] \<and> forward x \<and> (\<forall>xs\<in>Y. sublist xs x)}\<rbrakk> \<Longrightarrow> \<exists>y\<in>ys. \<forall>z\<in>ys. f y \<le> f z
[PROOF STEP]
using arg_min_if_finite(1)[of ys f] arg_min_least[of ys, where ?f = f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ys; ys \<noteq> {}\<rbrakk> \<Longrightarrow> arg_min_on f ys \<in> ys
\<lbrakk>finite ys; ys \<noteq> {}; ?y \<in> ys\<rbrakk> \<Longrightarrow> f (arg_min_on f ys) \<le> f ?y

goal (1 subgoal):
 1. \<lbrakk>finite ys; ys \<noteq> {}; ys = {x. set x = xs \<and> distinct x \<and> take 1 x = [r] \<and> forward x \<and> (\<forall>xs\<in>Y. sublist xs x)}\<rbrakk> \<Longrightarrow> \<exists>y\<in>ys. \<forall>z\<in>ys. f y \<le> f z
[PROOF STEP]
by auto


[STATEMENT]
lemma conga_os__out:
  assumes "A B C CongA A B C'" and
    "A B OS C C'"
  shows "B Out C C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B Out C C'
[PROOF STEP]
using assms(1) assms(2) conga_cop__or_out_ts l9_9 os__coplanar
[PROOF STATE]
proof (prove)
using this:
A B C CongA A B C'
A B OS C C'
\<lbrakk>Coplanar ?A ?B ?C ?C'; ?A ?B ?C CongA ?A ?B ?C'\<rbrakk> \<Longrightarrow> ?B Out ?C ?C' \<or> ?A ?B TS ?C ?C'
?P ?Q TS ?A ?B \<Longrightarrow> \<not> ?P ?Q OS ?A ?B
?A ?B OS ?C ?D \<Longrightarrow> Coplanar ?A ?B ?C ?D

goal (1 subgoal):
 1. B Out C C'
[PROOF STEP]
by blast


[STATEMENT]
lemma kruskal_exchange_injective_inv_1:
  assumes "injective f"
      and "covector q"
      and "q * f\<^sup>T \<le> q"
      and "q\<^sup>T * q \<sqinter> f\<^sup>T * f \<le> 1"
    shows "injective ((f \<sqinter> -q) \<squnion> (f \<sqinter> q)\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective (f \<sqinter> - q \<squnion> (f \<sqinter> q)\<^sup>T)
[PROOF STEP]
using kruskal_injective_inv[where e=bot]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>injective ?f; covector ?q; ?q * ?f\<^sup>T \<le> ?q; bot \<le> ?q; ?q * ?f\<^sup>T \<le> - bot; injective bot; coreflexive (?q\<^sup>T * ?q \<sqinter> ?f\<^sup>T * ?f)\<rbrakk> \<Longrightarrow> injective (?f \<sqinter> - ?q \<squnion> (?f \<sqinter> ?q)\<^sup>T \<squnion> bot)

goal (1 subgoal):
 1. injective (f \<sqinter> - q \<squnion> (f \<sqinter> q)\<^sup>T)
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma quotr_unique: "x \<preceq>\<^sub>R y  \<Longrightarrow> (\<exists>!z. D x z \<and> y = x \<cdot> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<preceq>\<^sub>R y \<Longrightarrow> \<exists>!z. D x z \<and> y = x \<oplus> z
[PROOF STEP]
using gR_rel_def add_cancl
[PROOF STATE]
proof (prove)
using this:
(?x \<preceq>\<^sub>R ?y) = (\<exists>z. D ?x z \<and> ?x \<oplus> z = ?y)
\<lbrakk>D ?z ?x; D ?z ?y; ?z \<oplus> ?x = ?z \<oplus> ?y\<rbrakk> \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. x \<preceq>\<^sub>R y \<Longrightarrow> \<exists>!z. D x z \<and> y = x \<oplus> z
[PROOF STEP]
by force


[STATEMENT]
lemma Riemann_lebesgue_cos:
  assumes "f absolutely_integrable_on {-pi..pi}"
  shows "(\<lambda>n. integral\<^sup>L (lebesgue_on {-pi..pi}) (\<lambda>x. cos(real n * x) * f x)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding lim_sequentially
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
fix e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
obtain N where N: "\<And>n. n \<ge> N \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e/4"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Riemann_lebesgue [OF assms]
[PROOF STATE]
proof (prove)
using this:
0 < e
Fourier_coefficient f \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding lim_sequentially
[PROOF STATE]
proof (prove)
using this:
0 < e
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (Fourier_coefficient f n) 0 < r

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> \<bar>Fourier_coefficient f n\<bar> < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis norm_conv_dist real_norm_def zero_less_divide_iff zero_less_numeral)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> \<bar>Fourier_coefficient f ?n\<bar> < e / 4

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
have "\<bar>LINT x|lebesgue_on {-pi..pi}. cos (real n * x) * f x\<bar> < e" if "n > N" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
N < n

goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e
N < Suc n

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
have eq: "(x * 2 + x * (real n * 2)) / 2 = x + x * (real n)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * 2 + x * (real n * 2)) / 2 = x + x * real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(?x * 2 + ?x * (real n * 2)) / 2 = ?x + ?x * real n

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
have "\<bar>Fourier_coefficient f(2*n + 2)\<bar> < e/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4
[PROOF STEP]
using N Suc.prems
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> \<bar>Fourier_coefficient f ?n\<bar> < e / 4
N < Suc n

goal (1 subgoal):
 1. \<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4
[PROOF STEP]
have "\<bar>LINT x|lebesgue_on {-pi..pi}. f x * cos (x + x * (real n))\<bar> < sqrt pi * e / 4"
[PROOF STATE]
proof (prove)
using this:
\<bar>Fourier_coefficient f (2 * n + 2)\<bar> < e / 4

goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < sqrt pi * e / 4
[PROOF STEP]
by (simp add: Fourier_coefficient_def orthonormal_coeff_def
          trigonometric_set_def l2product_def field_simps eq)
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < sqrt pi * e / 4

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < sqrt pi * e / 4

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
have "\<dots> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt pi * e / 4 \<le> e
[PROOF STEP]
using \<open>0 < e\<close> pi_less_4 real_sqrt_less_mono
[PROOF STATE]
proof (prove)
using this:
0 < e
pi < 4
?x < ?y \<Longrightarrow> sqrt ?x < sqrt ?y

goal (1 subgoal):
 1. sqrt pi * e / 4 \<le> e
[PROOF STEP]
by (fastforce simp add: field_simps)
[PROOF STATE]
proof (state)
this:
sqrt pi * e / 4 \<le> e

goal (2 subgoals):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
 2. \<And>n. \<lbrakk>N < n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x\<bar> < e; N < Suc n\<rbrakk> \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < e
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>LINT x|lebesgue_on {- pi..pi}. f x * cos (x + x * real n)\<bar> < e

goal (1 subgoal):
 1. \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x\<bar> < e

goal (1 subgoal):
 1. N < 0 \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real 0 * x) * f x\<bar> < e
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
N < ?n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real ?n * x) * f x\<bar> < e

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N < ?n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real ?n * x) * f x\<bar> < e
[PROOF STEP]
show "\<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {-pi..pi}. cos (real n * x) * f x) 0 < e"
[PROOF STATE]
proof (prove)
using this:
N < ?n \<Longrightarrow> \<bar>LINT x|lebesgue_on {- pi..pi}. cos (real ?n * x) * f x\<bar> < e

goal (1 subgoal):
 1. \<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < e
[PROOF STEP]
by (metis (full_types) le_neq_implies_less less_add_same_cancel2 less_trans norm_conv_dist real_norm_def zero_less_one)
[PROOF STATE]
proof (state)
this:
\<exists>no. \<forall>n\<ge>no. dist (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * f x) 0 < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mgu_gives_subst_idem: "mgu s t = Some \<theta> \<Longrightarrow> subst_idem \<theta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mgu s t = Some \<theta> \<Longrightarrow> subst_idem \<theta>
[PROOF STEP]
using mgu_sound[of s t \<theta>]
[PROOF STATE]
proof (prove)
using this:
mgu s t = Some \<theta> \<Longrightarrow> is_imgu \<theta> {(s, t)}

goal (1 subgoal):
 1. mgu s t = Some \<theta> \<Longrightarrow> subst_idem \<theta>
[PROOF STEP]
unfolding is_imgu_def subst_idem_def
[PROOF STATE]
proof (prove)
using this:
mgu s t = Some \<theta> \<Longrightarrow> \<theta> \<in> unifiers {(s, t)} \<and> (\<forall>\<tau>\<in>unifiers {(s, t)}. \<tau> = \<theta> \<circ>\<^sub>s \<tau>)

goal (1 subgoal):
 1. mgu s t = Some \<theta> \<Longrightarrow> \<theta> \<circ>\<^sub>s \<theta> = \<theta>
[PROOF STEP]
by auto


[STATEMENT]
lemma rev_ordsetmap_strict: "\<lbrakk> a\<in>P; b\<in>P; f a \<^bold><* f b \<rbrakk> \<Longrightarrow> a \<^bold>< b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> P; b \<in> P; f a \<^bold><* f b\<rbrakk> \<Longrightarrow> a \<^bold>< b
[PROOF STEP]
using inv_ordsetmap_strict the_inv_into_f_f[OF inj]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> f ` P; ?b \<in> f ` P; ?a \<^bold><* ?b\<rbrakk> \<Longrightarrow> the_inv_into P f ?a \<^bold>< the_inv_into P f ?b
?x \<in> P \<Longrightarrow> the_inv_into P f (f ?x) = ?x

goal (1 subgoal):
 1. \<lbrakk>a \<in> P; b \<in> P; f a \<^bold><* f b\<rbrakk> \<Longrightarrow> a \<^bold>< b
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Infinitesimal_star_of_mult2: "x \<in> Infinitesimal \<Longrightarrow> star_of r * x \<in> Infinitesimal"
  for x :: "'a::real_normed_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Infinitesimal \<Longrightarrow> star_of r * x \<in> Infinitesimal
[PROOF STEP]
by (erule HFinite_star_of [THEN [2] Infinitesimal_HFinite_mult2])


[STATEMENT]
lemma hypext_sqrt_Hyperdual:
      "a > 0 \<Longrightarrow> (*h* sqrt) (Hyperdual a b c d) =
       sqrt a *\<^sub>H ba + (b * inverse (sqrt a) / 2) *\<^sub>H e1 + (c * inverse (sqrt a) / 2) *\<^sub>H e2 +
       (d * inverse (sqrt a) / 2 - b * c * inverse (sqrt a ^ 3) / 4) *\<^sub>H e12"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (*h* sqrt) (Hyperdual a b c d) = sqrt a *\<^sub>H ba + (b * inverse (sqrt a) / 2) *\<^sub>H e1 + (c * inverse (sqrt a) / 2) *\<^sub>H e2 + (d * inverse (sqrt a) / 2 - b * c * inverse (sqrt a ^ 3) / 4) *\<^sub>H e12
[PROOF STEP]
by (auto simp add: hypext_Hyperdual_eq_parts)