[STATEMENT]
lemma free_tv_S':
 "\<And>(A::type_scheme list) (t::typ).
  free_tv (\<lambda>n. if n : free_tv A Un free_tv t then S n else TVar n) \<subseteq>
  free_tv A Un free_tv ($ S A) Un free_tv t Un free_tv ($ S t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A t. free_tv (\<lambda>n. if n \<in> free_tv A \<union> free_tv t then S n else TVar n) \<subseteq> free_tv A \<union> free_tv ($ S A) \<union> free_tv t \<union> free_tv ($ S t)
[PROOF STEP]
apply (unfold free_tv_subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A t. Type.dom (\<lambda>n. if n \<in> free_tv A \<union> free_tv t then S n else TVar n) \<union> cod (\<lambda>n. if n \<in> free_tv A \<union> free_tv t then S n else TVar n) \<subseteq> free_tv A \<union> free_tv ($ S A) \<union> free_tv t \<union> free_tv ($ S t)
[PROOF STEP]
apply (fast dest: dom_S' [THEN subsetD] cod_S' [THEN subsetD])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ordLeq_natLeq_on_imp_finite:
assumes "|A| \<le>o natLeq_on n"
shows "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
have "|A| \<le>o |{0 ..< n}|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A| \<le>o |{0..<n}|
[PROOF STEP]
using assms card_of_less ordIso_symmetric ordLeq_ordIso_trans
[PROOF STATE]
proof (prove)
using this:
|A| \<le>o natLeq_on n
|{0..<?n}| =o natLeq_on ?n
?r =o ?r' \<Longrightarrow> ?r' =o ?r
\<lbrakk>?r \<le>o ?r'; ?r' =o ?r''\<rbrakk> \<Longrightarrow> ?r \<le>o ?r''

goal (1 subgoal):
 1. |A| \<le>o |{0..<n}|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|A| \<le>o |{0..<n}|

goal (1 subgoal):
 1. finite A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
|A| \<le>o |{0..<n}|

goal (1 subgoal):
 1. finite A
[PROOF STEP]
by (auto simp add: card_of_ordLeq_finite)
[PROOF STATE]
proof (state)
this:
finite A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma root_sgn_power: "0 < n \<Longrightarrow> root n (sgn y * \<bar>y\<bar>^n) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> root n (sgn y * \<bar>y\<bar> ^ n) = y
[PROOF STEP]
using the_inv_f_f[OF inj_sgn_power]
[PROOF STATE]
proof (prove)
using this:
0 < ?n1 \<Longrightarrow> the_inv (\<lambda>y. sgn y * \<bar>y\<bar> ^ ?n1) (sgn ?x * \<bar>?x\<bar> ^ ?n1) = ?x

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> root n (sgn y * \<bar>y\<bar> ^ n) = y
[PROOF STEP]
by (simp add: root_def)


[STATEMENT]
lemma F_Un_D_eq_A: "F \<union> D = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<union> D = A
[PROOF STEP]
using finite_A F_Un_D_subset A_card_eq F_Un_D_card
[PROOF STATE]
proof (prove)
using this:
finite A
F \<union> D \<subseteq> A
card A = nat ((int p - 1) div 2)
card (F \<union> D) = nat (int ((p - 1) div 2))

goal (1 subgoal):
 1. F \<union> D = A
[PROOF STEP]
by (auto simp add: card_seteq)


[STATEMENT]
lemma fls_nth_of_fpxs:
  "fls_nth (fls_of_fpxs f) n = fpxs_nth f (of_int n / of_nat (fpxs_root_order f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_nth (fls_of_fpxs f) n = fpxs_nth f (rat_of_int n / rat_of_nat (fpxs_root_order f))
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma continuous_on_joinpaths_D1:
    "continuous_on {0..1} (g1 +++ g2) \<Longrightarrow> continuous_on {0..1} g1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (g1 +++ g2) \<Longrightarrow> continuous_on {0..1} g1
[PROOF STEP]
apply (rule continuous_on_eq [of _ "(g1 +++ g2) \<circ> ((*)(inverse 2))"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0..1} (g1 +++ g2) \<Longrightarrow> continuous_on {0..1} (g1 +++ g2 \<circ> (*) (inverse 2))
 2. \<And>x. \<lbrakk>continuous_on {0..1} (g1 +++ g2); x \<in> {0..1}\<rbrakk> \<Longrightarrow> (g1 +++ g2 \<circ> (*) (inverse 2)) x = g1 x
[PROOF STEP]
apply (rule continuous_intros | simp)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0..1} (g1 +++ g2) \<Longrightarrow> continuous_on {0..1 / 2} (g1 +++ g2)
 2. \<And>x. \<lbrakk>continuous_on {0..1} (g1 +++ g2); x \<in> {0..1}\<rbrakk> \<Longrightarrow> (g1 +++ g2 \<circ> (*) (inverse 2)) x = g1 x
[PROOF STEP]
apply (auto elim!: continuous_on_subset simp: joinpaths_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem star_comp_fix: "x ^ * * y = (x * (x ^ *) * y) \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ * * y = x * x ^ * * y \<sqinter> y
[PROOF STEP]
apply (subst star_fix)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * x ^ * \<sqinter> (1::'a) * y = x * x ^ * * y \<sqinter> y
[PROOF STEP]
by (simp add: inf_comp)


[STATEMENT]
lemma dir_tree_sel[intro]: "r \<in> verts G \<Longrightarrow> directed_tree.tree_sel (dir_tree_r r) match_sel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in> verts G \<Longrightarrow> directed_tree.tree_sel (dir_tree_r r) match_sel
[PROOF STEP]
unfolding directed_tree.tree_sel_def[OF directed_tree_r]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in> verts G \<Longrightarrow> \<forall>x y. \<not> (x \<rightarrow>\<^bsub>dir_tree_r r\<^esub> y \<or> y \<rightarrow>\<^bsub>dir_tree_r r\<^esub> x) \<longrightarrow> match_sel x y = 1
[PROOF STEP]
using match_sel1_if_no_arc dom_in_dir_tree_r_iff
[PROOF STATE]
proof (prove)
using this:
\<not> (?x \<rightarrow>\<^bsub>G\<^esub> ?y \<or> ?y \<rightarrow>\<^bsub>G\<^esub> ?x) \<Longrightarrow> match_sel ?x ?y = 1
?r \<in> verts G \<Longrightarrow> (?x \<rightarrow>\<^bsub>dir_tree_r ?r\<^esub> ?y \<or> ?y \<rightarrow>\<^bsub>dir_tree_r ?r\<^esub> ?x) = (?x \<rightarrow>\<^bsub>G\<^esub> ?y)

goal (1 subgoal):
 1. r \<in> verts G \<Longrightarrow> \<forall>x y. \<not> (x \<rightarrow>\<^bsub>dir_tree_r r\<^esub> y \<or> y \<rightarrow>\<^bsub>dir_tree_r r\<^esub> x) \<longrightarrow> match_sel x y = 1
[PROOF STEP]
by blast


[STATEMENT]
lemma pp_bijective_linorder_matrix:
  fixes f :: "('a::finite,'b::non_trivial_linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.pp_bijective f \<longleftrightarrow> (\<forall>j . \<exists>i . f (i,j) \<noteq> bot \<and> (\<forall>k . i \<noteq> k \<longrightarrow> f (k,j) = bot))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.pp_bijective f = (\<forall>j. \<exists>i. f (i, j) \<noteq> bot \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))
[PROOF STEP]
by (unfold matrix_stone_relation_algebra.pp_bijective_conv_mapping pp_mapping_linorder_matrix) (simp add: conv_matrix_def)


[STATEMENT]
lemma set_map_pmf[simp]: "set_pmf (map_pmf f M) = f`set_pmf M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_pmf (map_pmf f M) = f ` set_pmf M
[PROOF STEP]
using pmf_set_map[of f]
[PROOF STATE]
proof (prove)
using this:
set_pmf \<circ> map_pmf f = (`) f \<circ> set_pmf

goal (1 subgoal):
 1. set_pmf (map_pmf f M) = f ` set_pmf M
[PROOF STEP]
by (auto simp: comp_def fun_eq_iff)


[STATEMENT]
lemma denesting: "Star (Plus r s) = Times (Star r) (Star (Times s (Star r)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Star (Plus r s) = Times (Star r) (Star (Times s (Star r)))
[PROOF STEP]
proof (rule antisym[OF ord_eq_le_trans[OF Times_OneR[symmetric] ardenL[OF Plus_upper]]
   ardenR[OF Plus_upper[OF Star_mono[OF le_PlusL]]]])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. One \<le> Times (Star r) (Star (Times s (Star r)))
 2. Times (Plus r s) (Times (Star r) (Star (Times s (Star r)))) \<le> Times (Star r) (Star (Times s (Star r)))
 3. Times (Star (Plus r s)) (Times s (Star r)) \<le> Star (Plus r s)
[PROOF STEP]
show "Times (Plus r s) (Times (Star r) (Star (Times s (Star r))))
    \<le> Times (Star r) (Star (Times s (Star r)))" (is "Times _ ?L \<le> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Times (Plus r s) (Times (Star r) (Star (Times s (Star r)))) \<le> Times (Star r) (Star (Times s (Star r)))
[PROOF STEP]
unfolding Times_PlusL
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Plus (Times r (Times (Star r) (Star (Times s (Star r))))) (Times s (Times (Star r) (Star (Times s (Star r))))) \<le> Times (Star r) (Star (Times s (Star r)))
[PROOF STEP]
by (rule Plus_upper,
      metis Star_unfoldL Times_assoc Times_mono le_PlusR order_refl,
      metis Star_unfoldL Times_assoc \<oo>_Star le_PlusR le_TimesR order_trans)
[PROOF STATE]
proof (state)
this:
Times (Plus r s) (Times (Star r) (Star (Times s (Star r)))) \<le> Times (Star r) (Star (Times s (Star r)))

goal (2 subgoals):
 1. One \<le> Times (Star r) (Star (Times s (Star r)))
 2. Times (Star (Plus r s)) (Times s (Star r)) \<le> Star (Plus r s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. One \<le> Times (Star r) (Star (Times s (Star r)))
 2. Times (Star (Plus r s)) (Times s (Star r)) \<le> Star (Plus r s)
[PROOF STEP]
show "Times (Star (Plus r s)) (Times s (Star r)) \<le> Star (Plus r s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Times (Star (Plus r s)) (Times s (Star r)) \<le> Star (Plus r s)
[PROOF STEP]
by (metis Plus_comm Star_unfoldL Times_PlusR Times_assoc ardenR bisimulation le_PlusR)
[PROOF STATE]
proof (state)
this:
Times (Star (Plus r s)) (Times s (Star r)) \<le> Star (Plus r s)

goal (1 subgoal):
 1. One \<le> Times (Star r) (Star (Times s (Star r)))
[PROOF STEP]
qed simp


[STATEMENT]
lemma one_less_log_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 1 < log a x \<longleftrightarrow> a < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (1 < log a x) = (a < x)
[PROOF STEP]
using log_less_cancel_iff[of a a x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < a; 0 < x\<rbrakk> \<Longrightarrow> (log a a < log a x) = (a < x)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (1 < log a x) = (a < x)
[PROOF STEP]
by simp


[STATEMENT]
lemma REFL_IMP_3_CONJ_1:
  fixes R P x y
  assumes "((\<lambda>x y. R x y \<and> P x y)\<^sup>+\<^sup>+ x y)"
  shows "R\<^sup>+\<^sup>+ x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R\<^sup>+\<^sup>+ x y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. R x y \<and> P x y)\<^sup>+\<^sup>+ x y

goal (1 subgoal):
 1. R\<^sup>+\<^sup>+ x y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x y. R x y \<and> P x y)\<^sup>+\<^sup>+ x y \<Longrightarrow> R\<^sup>+\<^sup>+ x y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R\<^sup>+\<^sup>+ x y
[PROOF STEP]
using assms TC_IMP_NOT_TC_CONJ_1
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. R x y \<and> P x y)\<^sup>+\<^sup>+ x y
\<not> ?R\<^sup>+\<^sup>+ ?x ?y \<Longrightarrow> \<not> (\<lambda>x y. ?R x y \<and> ?P x y)\<^sup>+\<^sup>+ ?x ?y

goal (1 subgoal):
 1. R\<^sup>+\<^sup>+ x y
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
R\<^sup>+\<^sup>+ x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polyfun_extremal_lemma:
    fixes c :: "nat \<Rightarrow> 'a::real_normed_div_algebra"
  assumes "0 < e"
    shows "\<exists>M. \<forall>z. M \<le> norm(z) \<longrightarrow> norm (\<Sum>i\<le>n. c(i) * z^i) \<le> e * norm(z) ^ (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>0. c i * z ^ i) \<le> e * norm z ^ Suc 0
 2. \<And>n. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n \<Longrightarrow> \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>0. c i * z ^ i) \<le> e * norm z ^ Suc 0
 2. \<And>n. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n \<Longrightarrow> \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>0. c i * z ^ i) \<le> e * norm z ^ Suc 0
[PROOF STEP]
apply (rule_tac x="norm (c 0) / e" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e \<Longrightarrow> \<forall>z. norm (c 0) / e \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>0. c i * z ^ i) \<le> e * norm z ^ Suc 0
[PROOF STEP]
apply (auto simp: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>0. c i * z ^ i) \<le> e * norm z ^ Suc 0

goal (1 subgoal):
 1. \<And>n. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n \<Longrightarrow> \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n \<Longrightarrow> \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n

goal (1 subgoal):
 1. \<And>n. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n \<Longrightarrow> \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
obtain M where M: "\<And>z. M \<le> norm z \<Longrightarrow> norm (\<Sum>i\<le>n. c i * z^i) \<le> e * norm z ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. (\<And>z. M \<le> norm z \<Longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Suc assms
[PROOF STATE]
proof (prove)
using this:
\<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n
0 < e

goal (1 subgoal):
 1. (\<And>M. (\<And>z. M \<le> norm z \<Longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
M \<le> norm ?z \<Longrightarrow> norm (\<Sum>i\<le>n. c i * ?z ^ i) \<le> e * norm ?z ^ Suc n

goal (1 subgoal):
 1. \<And>n. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n \<Longrightarrow> \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
proof (rule exI [where x= "max M (1 + norm(c(Suc n)) / e)"], clarsimp simp del: power_Suc)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
fix z::'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
assume z1: "M \<le> norm z" and "1 + norm (c (Suc n)) / e \<le> norm z"
[PROOF STATE]
proof (state)
this:
M \<le> norm z
1 + norm (c (Suc n)) / e \<le> norm z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M \<le> norm z
1 + norm (c (Suc n)) / e \<le> norm z
[PROOF STEP]
have z2: "e + norm (c (Suc n)) \<le> e * norm z"
[PROOF STATE]
proof (prove)
using this:
M \<le> norm z
1 + norm (c (Suc n)) / e \<le> norm z

goal (1 subgoal):
 1. e + norm (c (Suc n)) \<le> e * norm z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
M \<le> norm z
1 + norm (c (Suc n)) / e \<le> norm z
0 < e

goal (1 subgoal):
 1. e + norm (c (Suc n)) \<le> e * norm z
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
e + norm (c (Suc n)) \<le> e * norm z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
have "norm (\<Sum>i\<le>n. c i * z^i) \<le> e * norm z ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n
[PROOF STEP]
using M [OF z1]
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n

goal (1 subgoal):
 1. norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n
[PROOF STEP]
have "norm (\<Sum>i\<le>n. c i * z^i) + norm (c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>i\<le>n. c i * z ^ i) \<le> e * norm z ^ Suc n

goal (1 subgoal):
 1. norm (\<Sum>i\<le>n. c i * z ^ i) + norm (c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (\<Sum>i\<le>n. c i * z ^ i) + norm (c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (\<Sum>i\<le>n. c i * z ^ i) + norm (c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)
[PROOF STEP]
have "norm ((\<Sum>i\<le>n. c i * z^i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>i\<le>n. c i * z ^ i) + norm (c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)

goal (1 subgoal):
 1. norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)
[PROOF STEP]
by (blast intro: norm_triangle_le elim: )
[PROOF STATE]
proof (state)
this:
norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
have "... \<le> (e + norm (c (Suc n))) * norm z ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n) \<le> (e + norm (c (Suc n))) * norm z ^ Suc n
[PROOF STEP]
by (simp add: norm_power norm_mult algebra_simps)
[PROOF STATE]
proof (state)
this:
e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n) \<le> (e + norm (c (Suc n))) * norm z ^ Suc n

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
e * norm z ^ Suc n + norm (c (Suc n) * z ^ Suc n) \<le> (e + norm (c (Suc n))) * norm z ^ Suc n

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
have "... \<le> (e * norm z) * norm z ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (e + norm (c (Suc n))) * norm z ^ Suc n \<le> e * norm z * norm z ^ Suc n
[PROOF STEP]
by (metis z2 mult.commute mult_left_mono norm_ge_zero norm_power)
[PROOF STATE]
proof (state)
this:
(e + norm (c (Suc n))) * norm z ^ Suc n \<le> e * norm z * norm z ^ Suc n

goal (1 subgoal):
 1. \<And>z. \<lbrakk>M \<le> norm z; 1 + norm (c (Suc n)) / e \<le> norm z\<rbrakk> \<Longrightarrow> norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z * norm z ^ Suc n
[PROOF STEP]
show "norm ((\<Sum>i\<le>n. c i * z^i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)"
[PROOF STATE]
proof (prove)
using this:
norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z * norm z ^ Suc n

goal (1 subgoal):
 1. norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm ((\<Sum>i\<le>n. c i * z ^ i) + c (Suc n) * z ^ Suc n) \<le> e * norm z ^ Suc (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>Suc n. c i * z ^ i) \<le> e * norm z ^ Suc (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_lemma: "\<And> x y. rec_exec rec_mod [x, y] = (x mod y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. rec_exec rec_mod [x, y] = x mod y
[PROOF STEP]
by(simp add: rec_exec.simps rec_mod_def quo_lemma2 minus_div_mult_eq_mod)


[STATEMENT]
lemma measurable_expr_sem_eq:
    "\<Gamma> \<turnstile> e : t \<Longrightarrow> \<sigma> \<in> space (state_measure V \<Gamma>) \<Longrightarrow> free_vars e \<subseteq> V \<Longrightarrow>
       measurable (expr_sem \<sigma> e) = measurable (stock_measure t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Gamma> \<turnstile> e : t; \<sigma> \<in> space (state_measure V \<Gamma>); free_vars e \<subseteq> V\<rbrakk> \<Longrightarrow> (\<rightarrow>\<^sub>M) (expr_sem \<sigma> e) = (\<rightarrow>\<^sub>M) (stock_measure t)
[PROOF STEP]
by (intro ext measurable_cong_sets sets_expr_sem)
     (auto simp: state_measure_def space_PiM dest: PiE_mem)


[STATEMENT]
lemma ports_to_set_wordinterval: "ports_to_set ps = wordinterval_to_set (l2wi ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ports_to_set ps = wordinterval_to_set (l2wi ps)
[PROOF STEP]
by(induction ps rule: l2wi.induct) (auto)


[STATEMENT]
lemma fps_XD_add[simp]:"fps_XD (a + b) = fps_XD a + fps_XD (b :: 'a::comm_ring_1 fps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_XD (a + b) = fps_XD a + fps_XD b
[PROOF STEP]
by (simp add: fps_XD_def field_simps)


[STATEMENT]
lemma point_abscissa_diff [simp]:
  "abscissa (A - B) = abscissa (A) - abscissa (B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abscissa (A - B) = abscissa A - abscissa B
[PROOF STEP]
by (simp add: point_diff_def)


[STATEMENT]
lemma f_Exec_Stream_nth_calc_Previous: "
  n < length xs \<Longrightarrow>
  f_Exec_Comp_Stream trans_fun xs c ! n =
  trans_fun (xs ! n) ((f_Exec_Comp_Stream trans_fun xs c)\<^bsup>\<leftarrow>' c\<^esup> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length xs \<Longrightarrow> f_Exec_Comp_Stream trans_fun xs c ! n = trans_fun (xs ! n) ((f_Exec_Comp_Stream trans_fun xs c)\<^bsup>\<leftarrow>' c\<^esup> n)
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>n < length xs; n = 0\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream trans_fun xs c ! n = trans_fun (xs ! n) ((f_Exec_Comp_Stream trans_fun xs c)\<^bsup>\<leftarrow>' c\<^esup> n)
 2. \<And>nat. \<lbrakk>n < length xs; n = Suc nat\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream trans_fun xs c ! n = trans_fun (xs ! n) ((f_Exec_Comp_Stream trans_fun xs c)\<^bsup>\<leftarrow>' c\<^esup> n)
[PROOF STEP]
apply (simp add: list_Previous_0 f_Exec_Stream_nth_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>n < length xs; n = Suc nat\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream trans_fun xs c ! n = trans_fun (xs ! n) ((f_Exec_Comp_Stream trans_fun xs c)\<^bsup>\<leftarrow>' c\<^esup> n)
[PROOF STEP]
apply (simp add: list_Previous_def f_Exec_Stream_nth_gr0_calc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in Order) ord_isom_inj:"\<lbrakk>Order E; ord_isom D E f;
      a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> (a = b) = ((f a) = (f b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_isom D E f; a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> (a = b) = (f a = f b)
[PROOF STEP]
apply (frule ord_isom_inj_on[of E f], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_isom D E f; a \<in> carrier D; b \<in> carrier D; inj_on f (carrier D)\<rbrakk> \<Longrightarrow> (a = b) = (f a = f b)
[PROOF STEP]
apply (simp add:injective_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma kozen_induct_l:
  assumes "x \<cdot> y + z \<le> y"
  shows "x\<^sup>\<star>\<cdot>z \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star> \<cdot> z \<le> y
[PROOF STEP]
by (metis dual.kozen_induct_r times.opp_mult_def assms)


[STATEMENT]
lemma td_gal:
  \<open>0 < c \<Longrightarrow> b * c \<le> a  \<longleftrightarrow> b \<le> a div c\<close>
  for a b c :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c \<Longrightarrow> (b * c \<le> a) = (b \<le> a div c)
[PROOF STEP]
by (simp add: less_eq_div_iff_mult_less_eq)


[STATEMENT]
lemma Derivs_simps [simp]:
  shows "Derivs [] A = A"
  and   "Derivs (c # s) A = Derivs s (Deriv c A)"
  and   "Derivs (s1 @ s2) A = Derivs s2 (Derivs s1 A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Derivs [] A = A &&& Derivs (c # s) A = Derivs s (Deriv c A) &&& Derivs (s1 @ s2) A = Derivs s2 (Derivs s1 A)
[PROOF STEP]
unfolding Derivs_def Deriv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ys. [] @ ys \<in> A} = A &&& {ys. (c # s) @ ys \<in> A} = {ys. s @ ys \<in> {xs. c # xs \<in> A}} &&& {ys. (s1 @ s2) @ ys \<in> A} = {ys. s2 @ ys \<in> {ys. s1 @ ys \<in> A}}
[PROOF STEP]
by auto


[STATEMENT]
lemma subresultant_zero_ge: assumes "k \<ge> degree f + (degree g - J)"
  and "(degree f - J) + (degree g - J) \<noteq> 0"
  shows "coeff (subresultant J f g) k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (subresultant J f g) k = (0::'a)
[PROOF STEP]
unfolding coeff_subresultant
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if degree f - J + (degree g - J) = 0 \<and> k \<noteq> 0 then 0::'a else det (subresultant'_mat J k f g)) = (0::'a)
[PROOF STEP]
by (subst subresultant'_zero_ge[OF assms(2,1)], simp)


[STATEMENT]
lemma is_lub_exec_lub:
  "\<lbrakk> single_valued r; acyclic r; (x,u):r^*; (y,u):r^*; \<forall>x y. (x,y) \<in> r \<longrightarrow> f x = y \<rbrakk>
  \<Longrightarrow> is_lub (r^* ) x y (exec_lub r f x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued r; acyclic r; (x, u) \<in> r\<^sup>*; (y, u) \<in> r\<^sup>*; \<forall>x y. (x, y) \<in> r \<longrightarrow> f x = y\<rbrakk> \<Longrightarrow> is_lub (r\<^sup>*) x y (exec_lub r f x y)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued r; acyclic r; (x, u) \<in> r\<^sup>*; (y, u) \<in> r\<^sup>*; \<forall>x y. (x, y) \<in> r \<longrightarrow> f x = y\<rbrakk> \<Longrightarrow> is_lub (r\<^sup>*) x y (exec_lub r f x y)
[PROOF STEP]
by (fastforce dest: single_valued_has_lubs simp add: exec_lub_conv)


[STATEMENT]
lemma tendsto_sinh [tendsto_intros]:
  fixes f :: "_ \<Rightarrow>'a::{real_normed_field,banach}"
  shows "(f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. sinh (f x)) \<longlongrightarrow> sinh a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. sinh (f x)) \<longlongrightarrow> sinh a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_sinh])


[STATEMENT]
lemma iso_fiter_ext:
  fixes f :: "'a::order \<Rightarrow> 'b::complete_lattice"
  shows "mono f \<Longrightarrow> mono (\<lambda>x. y \<sqinter> f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> mono (\<lambda>x. y \<sqinter> f x)
[PROOF STEP]
by (simp add: le_infI2 mono_def)


[STATEMENT]
lemma face_of_halfspace_le:
  fixes a :: "'n::euclidean_space"
  shows "F face_of {x. a \<bullet> x \<le> b} \<longleftrightarrow>
         F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}"
     (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
 2. a \<noteq> (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = (0::'n)

goal (2 subgoals):
 1. a = (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
 2. a \<noteq> (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = (0::'n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = (0::'n)

goal (1 subgoal):
 1. (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
using face_of_affine_eq affine_UNIV
[PROOF STATE]
proof (prove)
using this:
a = (0::'n)
affine ?S \<Longrightarrow> (?T face_of ?S) = (?T = {} \<or> ?T = ?S)
affine UNIV

goal (1 subgoal):
 1. (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})

goal (1 subgoal):
 1. a \<noteq> (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'n)

goal (1 subgoal):
 1. a \<noteq> (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'n)
[PROOF STEP]
have ine: "interior {x. a \<bullet> x \<le> b} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'n)

goal (1 subgoal):
 1. interior {x. a \<bullet> x \<le> b} \<noteq> {}
[PROOF STEP]
using halfspace_eq_empty_lt interior_halfspace_le
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'n)
({x. ?a \<bullet> x < ?b} = {}) = (?a = (0::?'a) \<and> ?b \<le> 0)
?a \<noteq> (0::?'a) \<Longrightarrow> interior {x. ?a \<bullet> x \<le> ?b} = {x. ?a \<bullet> x < ?b}

goal (1 subgoal):
 1. interior {x. a \<bullet> x \<le> b} \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
interior {x. a \<bullet> x \<le> b} \<noteq> {}

goal (1 subgoal):
 1. a \<noteq> (0::'n) \<Longrightarrow> (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F face_of {x. a \<bullet> x \<le> b} \<Longrightarrow> F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}
 2. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x \<le> b}
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
F face_of {x. a \<bullet> x \<le> b}

goal (2 subgoals):
 1. F face_of {x. a \<bullet> x \<le> b} \<Longrightarrow> F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}
 2. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x \<le> b}
[PROOF STEP]
have "F face_of {x. a \<bullet> x = b}" if "F \<noteq> {x. a \<bullet> x \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F face_of {x. a \<bullet> x = b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F face_of {x. a \<bullet> x = b}
[PROOF STEP]
have "F face_of rel_frontier {x. a \<bullet> x \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F face_of rel_frontier {x. a \<bullet> x \<le> b}
[PROOF STEP]
proof (rule face_of_subset [OF L])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F \<subseteq> rel_frontier {x. a \<bullet> x \<le> b}
 2. rel_frontier {x. a \<bullet> x \<le> b} \<subseteq> {x. a \<bullet> x \<le> b}
[PROOF STEP]
show "F \<subseteq> rel_frontier {x. a \<bullet> x \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<subseteq> rel_frontier {x. a \<bullet> x \<le> b}
[PROOF STEP]
by (simp add: L face_of_subset_rel_frontier that)
[PROOF STATE]
proof (state)
this:
F \<subseteq> rel_frontier {x. a \<bullet> x \<le> b}

goal (1 subgoal):
 1. rel_frontier {x. a \<bullet> x \<le> b} \<subseteq> {x. a \<bullet> x \<le> b}
[PROOF STEP]
qed (force simp: rel_frontier_def closed_halfspace_le)
[PROOF STATE]
proof (state)
this:
F face_of rel_frontier {x. a \<bullet> x \<le> b}

goal (1 subgoal):
 1. F face_of {x. a \<bullet> x = b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
F face_of rel_frontier {x. a \<bullet> x \<le> b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
F face_of rel_frontier {x. a \<bullet> x \<le> b}

goal (1 subgoal):
 1. F face_of {x. a \<bullet> x = b}
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
F face_of rel_frontier {x. a \<bullet> x \<le> b}
a \<noteq> (0::'n)

goal (1 subgoal):
 1. F face_of {x. a \<bullet> x = b}
[PROOF STEP]
by (simp add: frontier_halfspace_le rel_frontier_nonempty_interior [OF ine])
[PROOF STATE]
proof (state)
this:
F face_of {x. a \<bullet> x = b}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
F \<noteq> {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x = b}

goal (2 subgoals):
 1. F face_of {x. a \<bullet> x \<le> b} \<Longrightarrow> F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}
 2. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x \<le> b}
[PROOF STEP]
with L
[PROOF STATE]
proof (chain)
picking this:
F face_of {x. a \<bullet> x \<le> b}
F \<noteq> {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x = b}
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
F face_of {x. a \<bullet> x \<le> b}
F \<noteq> {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x = b}

goal (1 subgoal):
 1. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}
[PROOF STEP]
using affine_hyperplane face_of_affine_eq
[PROOF STATE]
proof (prove)
using this:
F face_of {x. a \<bullet> x \<le> b}
F \<noteq> {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x = b}
affine {x. ?a \<bullet> x = ?b}
affine ?S \<Longrightarrow> (?T face_of ?S) = (?T = {} \<or> ?T = ?S)

goal (1 subgoal):
 1. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}

goal (1 subgoal):
 1. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x \<le> b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x \<le> b}
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}

goal (1 subgoal):
 1. F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b} \<Longrightarrow> F face_of {x. a \<bullet> x \<le> b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b}

goal (1 subgoal):
 1. F face_of {x. a \<bullet> x \<le> b}
[PROOF STEP]
by (metis convex_halfspace_le empty_face_of face_of_refl hyperplane_face_of_halfspace_le)
[PROOF STATE]
proof (state)
this:
F face_of {x. a \<bullet> x \<le> b}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(F face_of {x. a \<bullet> x \<le> b}) = (F = {} \<or> F = {x. a \<bullet> x = b} \<or> F = {x. a \<bullet> x \<le> b})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SA_poly_to_Qp_poly_add:
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f \<in> carrier (UP (SA n))"
  assumes "g \<in> carrier (UP (SA n))"
  shows "SA_poly_to_Qp_poly n a (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<oplus>\<^bsub>Q\<^sub>p_x\<^esub> SA_poly_to_Qp_poly n a g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<oplus>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n a g
[PROOF STEP]
using SA_poly_to_Qp_poly_is_hom ring_hom_add assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> SA_poly_to_Qp_poly ?n ?a \<in> ring_hom (UP (SA ?n)) (UP Q\<^sub>p)
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<oplus>\<^bsub>?R\<^esub> ?y) = ?h ?x \<oplus>\<^bsub>?S\<^esub> ?h ?y
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (UP (SA n))
g \<in> carrier (UP (SA n))

goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<oplus>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n a g
[PROOF STEP]
by (metis (no_types, opaque_lifting))


[STATEMENT]
lemma (in domain) field_long_division_theorem:
  assumes "subfield K R" "polynomial K p" and "polynomial K b" "b \<noteq> []"
  shows "\<exists>q r. polynomial K q \<and> polynomial K r \<and>
               p = (b \<otimes>\<^bsub>K[X]\<^esub> q) \<oplus>\<^bsub>K[X]\<^esub> r \<and> (r = [] \<or> degree r < degree b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q r. polynomial K q \<and> polynomial K r \<and> p = b \<otimes>\<^bsub>K [X]\<^esub> q \<oplus>\<^bsub>K [X]\<^esub> r \<and> (r = [] \<or> degree r < degree b)
[PROOF STEP]
using long_division_theorem[OF subfieldE(1)[OF assms(1)] assms(2-4)] assms(3-4)
        subfield.subfield_Units[OF assms(1)] lead_coeff_not_zero[of K "hd b" "tl b"]
[PROOF STATE]
proof (prove)
using this:
lead_coeff b \<in> Units (R\<lparr>carrier := K\<rparr>) \<Longrightarrow> \<exists>q r. polynomial K q \<and> polynomial K r \<and> p = b \<otimes>\<^bsub>K [X]\<^esub> q \<oplus>\<^bsub>K [X]\<^esub> r \<and> (r = [] \<or> degree r < degree b)
polynomial K b
b \<noteq> []
Units (R\<lparr>carrier := K\<rparr>) = K - {\<zero>}
polynomial K (lead_coeff b # tl b) \<Longrightarrow> lead_coeff b \<in> K - {\<zero>}

goal (1 subgoal):
 1. \<exists>q r. polynomial K q \<and> polynomial K r \<and> p = b \<otimes>\<^bsub>K [X]\<^esub> q \<oplus>\<^bsub>K [X]\<^esub> r \<and> (r = [] \<or> degree r < degree b)
[PROOF STEP]
by simp


[STATEMENT]
lemma Suc_less:
  fixes i::'a
  assumes "i<j"
  and "i+1 \<noteq> j"
  shows "i+1<j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + (1::'a) < j
[PROOF STEP]
by (metis assms le_Suc le_neq_trans)


[STATEMENT]
lemma pairwise_disjnt_quadruple_diff:
 "pairwise disjnt ((\<lambda> x. {(a, b, c, d) | a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<ominus> c = x \<and> d \<ominus> b = x}) ` (differenceset A A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise disjnt ((\<lambda>x. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<ominus> c = x \<and> d \<ominus> b = x}) ` differenceset A A)
[PROOF STEP]
unfolding disjnt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (\<lambda>A B. A \<inter> B = {}) ((\<lambda>x. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<ominus> c = x \<and> d \<ominus> b = x}) ` differenceset A A)
[PROOF STEP]
by (intro pairwiseI) (auto)


[STATEMENT]
lemma octo_add_cnj1: "q + cnj q = octo_of_real (2*\<^sub>R (Ree q))"
                     "cnj q + q = octo_of_real (2*\<^sub>R (Ree q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q + Octonions.cnj q = octo_of_real (2 *\<^sub>R Ree q) &&& Octonions.cnj q + q = octo_of_real (2 *\<^sub>R Ree q)
[PROOF STEP]
by (auto simp: octo_eq_iff octo_mult_components)


[STATEMENT]
lemma (in aGroup)  agsum_add1p:"\<lbrakk> a \<in> carrier A; 0 \<le> n; 0 \<le> m\<rbrakk> \<Longrightarrow>
                      (n + m)\<triangleright>a\<^bsub>A\<^esub> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> (m\<triangleright>a\<^bsub>A\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> n; 0 \<le> m\<rbrakk> \<Longrightarrow> (n + m)\<triangleright>a\<^bsub>A\<^esub> = n\<triangleright>a\<^bsub>A\<^esub> \<plusminus> m\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (simp add:sprod_n_a_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> n; 0 \<le> m\<rbrakk> \<Longrightarrow> aSum A (nat (n + m)) a = aSum A (nat n) a \<plusminus> aSum A (nat m) a
[PROOF STEP]
apply (subst nat_add_distrib[of "n" "m"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; 0 \<le> n; 0 \<le> m\<rbrakk> \<Longrightarrow> aSum A (nat n + nat m) a = aSum A (nat n) a \<plusminus> aSum A (nat m) a
[PROOF STEP]
apply (simp add:asumTr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma enat_add_sub_same:
  fixes a b :: enat shows "a \<noteq> \<infinity> \<Longrightarrow> a + b - a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> \<infinity> \<Longrightarrow> a + b - a = b
[PROOF STEP]
by(cases b) auto


[STATEMENT]
lemma union_le_diff_plus: "P \<subseteq># M \<Longrightarrow> N < P \<Longrightarrow> M - P + N < M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<subseteq># M; N < P\<rbrakk> \<Longrightarrow> M - P + N < M
[PROOF STEP]
by (drule subset_mset.diff_add[symmetric]) (metis union_le_mono2)


[STATEMENT]
lemma set_count_size_min: "count A a \<ge> n \<Longrightarrow> size A \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> count A a \<Longrightarrow> n \<le> size A
[PROOF STEP]
by (metis (full_types) count_le_replicate_mset_subset_eq size_mset_mono size_replicate_mset)


[STATEMENT]
lemma iMODb_iIN_subset_conv: "
  ([r', mod m', c'] \<subseteq> [n\<dots>,d]) = (n \<le> r' \<and> r' + m' * c' \<le> n + d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r', mod m', c' ] \<subseteq> [n\<dots>,d]) = (n \<le> r' \<and> r' + m' * c' \<le> n + d)
[PROOF STEP]
by (fastforce simp: subset_iff iT_iff)


[STATEMENT]
lemma less_add_order_eq_0_contra: "k>0 \<Longrightarrow> k < add_order a \<Longrightarrow> a+^k \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; k < add_order a\<rbrakk> \<Longrightarrow> a +^ k \<noteq> (0::'a)
[PROOF STEP]
using less_add_order_eq_0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a +^ ?k = (0::'a); ?k < add_order ?a\<rbrakk> \<Longrightarrow> ?k = 0

goal (1 subgoal):
 1. \<lbrakk>0 < k; k < add_order a\<rbrakk> \<Longrightarrow> a +^ k \<noteq> (0::'a)
[PROOF STEP]
by fast


[STATEMENT]
lemma ordering_sym:
  assumes ord_sym: "\<And>a b c. ord a b c \<Longrightarrow> ord c b a"
      and "finite X"
      and "ordering f ord X"
  shows "ordering (\<lambda>n. f (card X - 1 - n)) ord X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TernaryOrdering.ordering (\<lambda>n. f (card X - 1 - n)) ord X
[PROOF STEP]
unfolding ordering_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f (card X - 1 - n) \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f (card X - 1 - n) = x) \<and> (\<forall>n n' n''. (finite X \<longrightarrow> n'' < card X) \<and> n < n' \<and> n' < n'' \<longrightarrow> ord (f (card X - 1 - n)) (f (card X - 1 - n')) (f (card X - 1 - n'')))
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. (\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f (card X - 1 - n) \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f (card X - 1 - n) = x) \<and> (\<forall>n n' n''. (finite X \<longrightarrow> n'' < card X) \<and> n < n' \<and> n' < n'' \<longrightarrow> ord (f (card X - 1 - n)) (f (card X - 1 - n')) (f (card X - 1 - n'')))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. \<lbrakk>finite X; n < card X\<rbrakk> \<Longrightarrow> f (card X - Suc n) \<in> X
 2. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 3. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
apply (metis ordering_def assms(3) card_0_eq card_gt_0_iff diff_Suc_less gr_implies_not0)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 2. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 2. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 2. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
assume "finite X"
[PROOF STATE]
proof (state)
this:
finite X

goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 2. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
assume "x \<in> X"
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 2. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
obtain n where "finite X \<longrightarrow> n < card X" and "f n = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<lbrakk>finite X \<longrightarrow> n < card X; f n = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ordering_def \<open>x \<in> X\<close> assms(3))
[PROOF STATE]
proof (state)
this:
finite X \<longrightarrow> n < card X
f n = x

goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 2. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
have "f (card X - ((card X - 1 - n) + 1)) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (card X - (card X - 1 - n + 1)) = x
[PROOF STEP]
by (simp add: Suc_leI \<open>f n = x\<close> \<open>finite X \<longrightarrow> n < card X\<close> assms(2))
[PROOF STATE]
proof (state)
this:
f (card X - (card X - 1 - n + 1)) = x

goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite X; x \<in> X\<rbrakk> \<Longrightarrow> \<exists>n<card X. f (card X - Suc n) = x
 2. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
thus "\<exists>n<card X. f (card X - Suc n) = x"
[PROOF STATE]
proof (prove)
using this:
f (card X - (card X - 1 - n + 1)) = x

goal (1 subgoal):
 1. \<exists>n<card X. f (card X - Suc n) = x
[PROOF STEP]
by (metis \<open>x \<in> X\<close> add.commute assms(2) card_Diff_singleton card_Suc_Diff1 diff_less_Suc plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
\<exists>n<card X. f (card X - Suc n) = x

goal (1 subgoal):
 1. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
fix n n' n''
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
assume "finite X"
[PROOF STATE]
proof (state)
this:
finite X

goal (1 subgoal):
 1. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
assume "n'' < card X" "n < n'" "n' < n''"
[PROOF STATE]
proof (state)
this:
n'' < card X
n < n'
n' < n''

goal (1 subgoal):
 1. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
have "ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
TernaryOrdering.ordering f ord X

goal (1 subgoal):
 1. ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))
[PROOF STEP]
unfolding ordering_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f n \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f n = x) \<and> (\<forall>n n' n''. (finite X \<longrightarrow> n'' < card X) \<and> n < n' \<and> n' < n'' \<longrightarrow> ord (f n) (f n') (f n''))

goal (1 subgoal):
 1. ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))
[PROOF STEP]
using \<open>n < n'\<close> \<open>n' < n''\<close> \<open>n'' < card X\<close> diff_less_mono2
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f n \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f n = x) \<and> (\<forall>n n' n''. (finite X \<longrightarrow> n'' < card X) \<and> n < n' \<and> n' < n'' \<longrightarrow> ord (f n) (f n') (f n''))
n < n'
n' < n''
n'' < card X
\<lbrakk>?m < ?n; ?m < ?l\<rbrakk> \<Longrightarrow> ?l - ?n < ?l - ?m

goal (1 subgoal):
 1. ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))

goal (1 subgoal):
 1. \<And>n n' n''. \<lbrakk>finite X; n'' < card X; n < n'; n' < n''\<rbrakk> \<Longrightarrow> ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
thus " ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))"
[PROOF STATE]
proof (prove)
using this:
ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))

goal (1 subgoal):
 1. ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
using ord_sym
[PROOF STATE]
proof (prove)
using this:
ord (f (card X - Suc n'')) (f (card X - Suc n')) (f (card X - Suc n))
ord ?a ?b ?c \<Longrightarrow> ord ?c ?b ?a

goal (1 subgoal):
 1. ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ord (f (card X - Suc n)) (f (card X - Suc n')) (f (card X - Suc n''))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multiplicity_decomposeI:
 assumes "x = p^k * x'" and "\<not> p dvd x'" and "p \<noteq> 0"
 shows "multiplicity p x = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p x = k
[PROOF STEP]
using assms local.multiplicity_eqI local.power_Suc2
[PROOF STATE]
proof (prove)
using this:
x = p ^ k * x'
\<not> p dvd x'
p \<noteq> (0::'a)
\<lbrakk>?p ^ ?n dvd ?x; \<not> ?p ^ Suc ?n dvd ?x\<rbrakk> \<Longrightarrow> multiplicity ?p ?x = ?n
?a ^ Suc ?n = ?a ^ ?n * ?a

goal (1 subgoal):
 1. multiplicity p x = k
[PROOF STEP]
by force


[STATEMENT]
lemma prime_factors_gauss_int_of_nat_correct:
  "prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have [simp]: "n > 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

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

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
have "prime_factors (of_nat n :: gauss_int) =
          prime_factors (of_nat (prod_mset (prime_factorization n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors (of_nat n) = prime_factors (of_nat (\<Prod>\<^sub># (prime_factorization n)))
[PROOF STEP]
by (subst prod_mset_prime_factorization_nat [symmetric]) auto
[PROOF STATE]
proof (state)
this:
prime_factors (of_nat n) = prime_factors (of_nat (\<Prod>\<^sub># (prime_factorization n)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factors (of_nat n) = prime_factors (of_nat (\<Prod>\<^sub># (prime_factorization n)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
have "\<dots> = prime_factors (prod_mset (image_mset of_nat (prime_factorization n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors (of_nat (\<Prod>\<^sub># (prime_factorization n))) = prime_factors (\<Prod>\<^sub># (image_mset of_nat (prime_factorization n)))
[PROOF STEP]
by (subst of_nat_prod_mset) auto
[PROOF STATE]
proof (state)
this:
prime_factors (of_nat (\<Prod>\<^sub># (prime_factorization n))) = prime_factors (\<Prod>\<^sub># (image_mset of_nat (prime_factorization n)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factors (of_nat (\<Prod>\<^sub># (prime_factorization n))) = prime_factors (\<Prod>\<^sub># (image_mset of_nat (prime_factorization n)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
have "\<dots> = (\<Union>p\<in>prime_factors n. prime_factors (of_nat p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors (\<Prod>\<^sub># (image_mset of_nat (prime_factorization n))) = (\<Union>p\<in>prime_factors n. prime_factors (of_nat p))
[PROOF STEP]
by (subst prime_factorization_prod_mset) auto
[PROOF STATE]
proof (state)
this:
prime_factors (\<Prod>\<^sub># (image_mset of_nat (prime_factorization n))) = (\<Union>p\<in>prime_factors n. prime_factors (of_nat p))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factors (\<Prod>\<^sub># (image_mset of_nat (prime_factorization n))) = (\<Union>p\<in>prime_factors n. prime_factors (of_nat p))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
have "\<dots> = (\<Union>p\<in>prime_factors n. set (factor_gauss_int_prime_nat p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>p\<in>prime_factors n. prime_factors (of_nat p)) = (\<Union>p\<in>prime_factors n. set (factor_gauss_int_prime_nat p))
[PROOF STEP]
by (intro SUP_cong refl factor_gauss_int_prime_nat_correct [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Union>p\<in>prime_factors n. prime_factors (of_nat p)) = (\<Union>p\<in>prime_factors n. set (factor_gauss_int_prime_nat p))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
 2. n \<noteq> 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prime_factors (of_nat n) = (\<Union>p\<in>prime_factors n. set (factor_gauss_int_prime_nat p))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime_factors (of_nat n) = (\<Union>p\<in>prime_factors n. set (factor_gauss_int_prime_nat p))

goal (1 subgoal):
 1. prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
by (simp add: prime_factors_gauss_int_of_nat_def)
[PROOF STATE]
proof (state)
this:
prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> prime_factors_gauss_int_of_nat n = prime_factors (of_nat n)
[PROOF STEP]
qed (auto simp:  prime_factors_gauss_int_of_nat_def)


[STATEMENT]
lemma vCons_set_contains_add: "a \<notin> set\<^sub>v v \<Longrightarrow> set\<^sub>v (vCons a v) = set\<^sub>v v \<union> {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> set\<^sub>v v \<Longrightarrow> set\<^sub>v (vCons a v) = set\<^sub>v v \<union> {a}
[PROOF STEP]
using vec_mset_set vec_mset_vCons
[PROOF STATE]
proof (prove)
using this:
set\<^sub>v ?v = set_mset (vec_mset ?v)
vec_mset (vCons ?x ?v) = add_mset ?x (vec_mset ?v)

goal (1 subgoal):
 1. a \<notin> set\<^sub>v v \<Longrightarrow> set\<^sub>v (vCons a v) = set\<^sub>v v \<union> {a}
[PROOF STEP]
by (metis Un_insert_right set_mset_add_mset_insert sup_bot_right)


[STATEMENT]
lemma ncols_Diagonal_to_Smith_row_i[simp]: "ncols (Diagonal_to_Smith_row_i A i bezout) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols (Diagonal_to_Smith_row_i A i bezout) = ncols A
[PROOF STEP]
unfolding Diagonal_to_Smith_row_i_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols (diagonal_to_Smith_i [i + 1..<min (nrows A) (ncols A)] A i bezout) = ncols A
[PROOF STEP]
by auto


[STATEMENT]
lemma eval_not : "eval (neg a) L \<longleftrightarrow> \<not>(eval a L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (neg a) L = (\<not> eval a L)
[PROOF STEP]
by (simp add: neg_def)


[STATEMENT]
lemma monad_duplicate_id [locale_witness]: "monad_duplicate return_id bind_id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monad_duplicate return_id bind_id
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m f. bind_id m (\<lambda>x. bind_id m (f x)) = bind_id m (\<lambda>x. f x x)
[PROOF STEP]
show "bind_id m (\<lambda>x. bind_id m (f x)) = bind_id m (\<lambda>x. f x x)" for m :: "'a id" and f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bind_id m (\<lambda>x. bind_id m (f x)) = bind_id m (\<lambda>x. f x x)
[PROOF STEP]
by(rule id.expand) simp
[PROOF STATE]
proof (state)
this:
bind_id ?m (\<lambda>x. bind_id ?m (?f x)) = bind_id ?m (\<lambda>x. ?f x x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invc_join:
  "\<lbrakk> invc l; invc r \<rbrakk> \<Longrightarrow>
  (color l = Black \<and> color r = Black \<longrightarrow> invc (join l r)) \<and> invc2 (join l r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invc l; invc r\<rbrakk> \<Longrightarrow> (color l = Black \<and> color r = Black \<longrightarrow> invc (join l r)) \<and> invc2 (join l r)
[PROOF STEP]
by (induct l r rule: join.induct)
   (auto simp: invc_baldL invc2I split: tree.splits color.splits)


[STATEMENT]
lemma conjugate_char_1_isotone:
  "conjugate f g \<Longrightarrow> isotone f \<Longrightarrow> isotone g \<Longrightarrow> f(x \<sqinter> -(g y)) \<le> f x \<sqinter> -y \<and> g(y \<sqinter> -(f x)) \<le> g y \<sqinter> -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>conjugate f g; isotone f; isotone g\<rbrakk> \<Longrightarrow> f (x \<sqinter> - g y) \<le> f x \<sqinter> - y \<and> g (y \<sqinter> - f x) \<le> g y \<sqinter> - x
[PROOF STEP]
by (simp add: conjugate_char_1_pp ord.isotone_def)


[STATEMENT]
lemma (in additive_subgroup) a_closed [intro, simp]:
     "\<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<oplus> y \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<oplus> y \<in> H
[PROOF STEP]
by (rule subgroup.m_closed[OF a_subgroup,
    simplified monoid_record_simps])


[STATEMENT]
lemma algebraic_int_power_iff' [simp]:
  "n > 0 \<Longrightarrow> algebraic_int (x ^ n :: 'a :: field_char_0) \<longleftrightarrow> algebraic_int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> algebraic_int (x ^ n) = algebraic_int x
[PROOF STEP]
by (subst algebraic_int_power_iff) auto


[STATEMENT]
lemma foldr_prod: "foldr (\<lambda>x y. (f1 x (fst y), f2 x (snd y))) xs y = (foldr f1 xs (fst y), foldr f2 xs (snd y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>x y. (f1 x (fst y), f2 x (snd y))) xs y = (foldr f1 xs (fst y), foldr f2 xs (snd y))
[PROOF STEP]
by (induction xs, auto)


[STATEMENT]
lemma safety_transition_relation:
  shows "safety (\<lambda>\<sigma>. \<forall>i. (\<sigma> i, \<sigma> (i + 1)) \<in> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. safety (\<lambda>\<sigma>. \<forall>i. (\<sigma> i, \<sigma> (i + 1)) \<in> R)
[PROOF STEP]
apply (rule safetyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<sigma>. \<not> (\<forall>i. (\<sigma> i, \<sigma> (i + 1)) \<in> R) \<Longrightarrow> \<exists>i. \<forall>\<beta>. \<not> (\<forall>ia. ((stake i \<sigma> @- \<beta>) ia, (stake i \<sigma> @- \<beta>) (ia + 1)) \<in> R)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<sigma> i. (\<sigma> i, \<sigma> (Suc i)) \<notin> R \<Longrightarrow> \<exists>i. \<forall>\<beta>. \<exists>ia. ((stake i \<sigma> @- \<beta>) ia, (stake i \<sigma> @- \<beta>) (Suc ia)) \<notin> R
[PROOF STEP]
apply (metis (no_types, opaque_lifting) Suc_eq_plus1 add.left_neutral add_Suc_right add_diff_cancel_left' le_add1 list.sel(1) list.simps(3) shift_simps(1) stake.simps(2) stake_suffix suffix_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_on_closest_point:
  assumes "convex S"
    and "closed S"
    and "S \<noteq> {}"
  shows "continuous_on t (closest_point S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on t (closest_point S)
[PROOF STEP]
by (metis continuous_at_imp_continuous_on continuous_at_closest_point[OF assms])


[STATEMENT]
lemma ftt_3: assumes dx: "dim_vec x = 3"
  and be: "x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = True"
  shows "ceros_of_boolean_input x = {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {0}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = True

goal (1 subgoal):
 1. ceros_of_boolean_input x = {0}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = True

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0}
[PROOF STEP]
using less_3_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = True
?n < 3 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0}
[PROOF STEP]
by auto


[STATEMENT]
lemma uminus_mono_iff:
  fixes f :: "'a::complete_boolean_algebra_alt_with_dual \<Rightarrow> 'b::complete_boolean_algebra_alt_with_dual"
  shows "(\<partial> \<circ> f = \<partial> \<circ> g) = (f = g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<partial> \<circ> f = \<partial> \<circ> g) = (f = g)
[PROOF STEP]
using uminus_galois_var
[PROOF STATE]
proof (prove)
using this:
(\<partial> \<circ> ?f = ?g) = (\<partial> \<circ> ?g = ?f)

goal (1 subgoal):
 1. (\<partial> \<circ> f = \<partial> \<circ> g) = (f = g)
[PROOF STEP]
by force


[STATEMENT]
lemma matrix_to_iarray_minorM[code_unfold]:
  "matrix_to_iarray (minorM A i j) = minorM_iarrays (matrix_to_iarray A) (to_nat i) (to_nat j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (minorM A i j) = minorM_iarrays (matrix_to_iarray A) (mod_type_class.to_nat i) (mod_type_class.to_nat j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_to_iarray (minorM A i j) = minorM_iarrays (matrix_to_iarray A) (mod_type_class.to_nat i) (mod_type_class.to_nat j)
[PROOF STEP]
have n_rw: "nrows_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ from_nat x $ from_nat i)
    [0..<CARD('b)])) [0..<CARD('c)])) = CARD('c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('c)])) = CARD('c)
[PROOF STEP]
unfolding nrows_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('c)])) = CARD('c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nrows_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('c)])) = CARD('c)

goal (1 subgoal):
 1. matrix_to_iarray (minorM A i j) = minorM_iarrays (matrix_to_iarray A) (mod_type_class.to_nat i) (mod_type_class.to_nat j)
[PROOF STEP]
have n_rw2: "ncols_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ from_nat x $ from_nat i)
    [0..<CARD('b)])) [0..<CARD('c)])) = CARD('b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('c)])) = CARD('b)
[PROOF STEP]
unfolding ncols_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('c)]) !! 0) = CARD('b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ncols_iarray (IArray (map (\<lambda>x. IArray (map (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) [0..<CARD('b)])) [0..<CARD('c)])) = CARD('b)

goal (1 subgoal):
 1. matrix_to_iarray (minorM A i j) = minorM_iarrays (matrix_to_iarray A) (mod_type_class.to_nat i) (mod_type_class.to_nat j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (minorM A i j) = minorM_iarrays (matrix_to_iarray A) (mod_type_class.to_nat i) (mod_type_class.to_nat j)
[PROOF STEP]
unfolding matrix_to_iarray_def o_def
    minorM_def minorM_iarrays_def
    tabulate2_def vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray (map (\<lambda>x. IArray.of_fun (\<lambda>ia. (\<chi>k l. if k = i \<and> l = j then 1::'a else if k = i \<or> l = j then 0::'a else A $ k $ l) $ mod_type_class.from_nat x $ mod_type_class.from_nat ia) CARD('b)) [0..<CARD('c)]) = IArray.of_fun (\<lambda>ia. IArray.of_fun (\<lambda>l. if ia = mod_type_class.to_nat i \<and> l = mod_type_class.to_nat j then 1::'a else if ia = mod_type_class.to_nat i \<or> l = mod_type_class.to_nat j then 0::'a else IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('b)) [0..<CARD('c)]) !! ia !! l) (ncols_iarray (IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('b)) [0..<CARD('c)])))) (nrows_iarray (IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('b)) [0..<CARD('c)])))
[PROOF STEP]
by (auto simp add: n_rw n_rw2 to_nat_from_nat_id)
[PROOF STATE]
proof (state)
this:
matrix_to_iarray (minorM A i j) = minorM_iarrays (matrix_to_iarray A) (mod_type_class.to_nat i) (mod_type_class.to_nat j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma oprod_cong:
  assumes "t =o u" and "r =o s"
  shows "t *o r =o u *o s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t *o r =o u *o s
[PROOF STEP]
using ordIso_transitive[OF oprod_congL[OF assms(1)] oprod_congR[OF assms(2)]]
  assms[unfolded ordIso_def]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Well_order r; Well_order u\<rbrakk> \<Longrightarrow> t *o r =o u *o s
(t, u) \<in> {(r, r'). Well_order r \<and> Well_order r' \<and> Ex (iso r r')}
(r, s) \<in> {(r, r'). Well_order r \<and> Well_order r' \<and> Ex (iso r r')}

goal (1 subgoal):
 1. t *o r =o u *o s
[PROOF STEP]
by auto


[STATEMENT]
lemma acyclic_initial :
  assumes "acyclic M"
  shows "\<not> (\<exists> t \<in> transitions M . t_target t = initial M \<and>
                                  (\<exists> p . path M (initial M) p \<and> target (initial M) p = t_source t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>t\<in>FSM.transitions M. t_target t = FSM.initial M \<and> (\<exists>p. path M (FSM.initial M) p \<and> target (FSM.initial M) p = t_source t))
[PROOF STEP]
by (metis append_Cons assms cyclic_cycle_rev list.distinct(1) path.simps
        path_append path_append_transition_elim(3) single_transition_path)


[STATEMENT]
lemma UINF_as_Sup_collect: "(\<Sqinter>P\<in>A \<bullet> f(P)) = (\<Sqinter>P\<in>A. f(P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> P \<in> A \<bullet> f P) = \<Sqinter>(f ` A)
[PROOF STEP]
apply (simp add: upred_defs bop.rep_eq lit.rep_eq Sup_uexpr_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> P \<in> A \<bullet> f P) = mk\<^sub>e (\<lambda>Aa. \<Sqinter>x\<in>A. \<lbrakk>f x\<rbrakk>\<^sub>e Aa)
[PROOF STEP]
apply (pred_simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<Sqinter>{uu_. \<exists>x. uu_ = \<lbrakk>f x\<rbrakk>\<^sub>e b \<and> x \<in> A} = (\<Sqinter>x\<in>A. \<lbrakk>f x\<rbrakk>\<^sub>e b)
[PROOF STEP]
apply (simp add: Setcompr_eq_image)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma suc_underS:
assumes B: "B \<subseteq> Field r" and A: "AboveS B \<noteq> {}" and b: "b \<in> B"
shows "b \<in> underS (suc B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> local.underS (local.suc B)
[PROOF STEP]
using suc_AboveS[OF B A] b
[PROOF STATE]
proof (prove)
using this:
local.suc B \<in> local.AboveS B
b \<in> B

goal (1 subgoal):
 1. b \<in> local.underS (local.suc B)
[PROOF STEP]
unfolding underS_def AboveS_def
[PROOF STATE]
proof (prove)
using this:
local.suc B \<in> {b \<in> Field r. \<forall>a\<in>B. b \<noteq> a \<and> (a, b) \<in> r}
b \<in> B

goal (1 subgoal):
 1. b \<in> {b. b \<noteq> local.suc B \<and> (b, local.suc B) \<in> r}
[PROOF STEP]
by auto


[STATEMENT]
lemma [THEN has_vderiv_on_eq_rhs, derivative_intros]:
  fixes f::"real \<Rightarrow> real" and g::"real \<Rightarrow> 'a::real_normed_vector"
  assumes "(f has_vderiv_on f') T"
  assumes "(g has_vderiv_on g') T"
  shows has_vderiv_on_scaleR: "((\<lambda>x. f x *\<^sub>R g x) has_vderiv_on (\<lambda>x. f x *\<^sub>R g' x + f' x *\<^sub>R g x)) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x *\<^sub>R g x) has_vderiv_on (\<lambda>x. f x *\<^sub>R g' x + f' x *\<^sub>R g x)) T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_vderiv_on f') T
(g has_vderiv_on g') T

goal (1 subgoal):
 1. ((\<lambda>x. f x *\<^sub>R g x) has_vderiv_on (\<lambda>x. f x *\<^sub>R g' x + f' x *\<^sub>R g x)) T
[PROOF STEP]
by (auto simp: has_vderiv_on_def has_real_derivative_iff_has_vector_derivative
    intro!: derivative_eq_intros)


[STATEMENT]
lemma invimage_vrestriction[simp]: "(r \<restriction>\<^sub>\<circ> A) -`\<^sub>\<circ> B = A \<inter>\<^sub>\<circ> (r -`\<^sub>\<circ> (A \<inter>\<^sub>\<circ> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r \<restriction>\<^sub>\<circ> A) -`\<^sub>\<circ> B = A \<inter>\<^sub>\<circ> r -`\<^sub>\<circ> (A \<inter>\<^sub>\<circ> B)
[PROOF STEP]
by blast


[STATEMENT]
lemma invertible_fst_Gauss_Jordan_column_k_PA:
fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
assumes inv_P: "invertible P"
shows "invertible (fst (Gauss_Jordan_column_k_PA (P,i,A) k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (fst (Gauss_Jordan_column_k_PA (P, i, A) k))
[PROOF STEP]
proof (unfold Gauss_Jordan_column_k_PA_def Let_def snd_conv fst_conv, auto simp add: inv_P)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> invertible (fst (Gauss_Jordan_in_ij_PA (P, A) (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> invertible (fst (Gauss_Jordan_in_ij_PA (P, A) (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
assume i_less_m: "from_nat i \<le> m" and Amk_not_0: "A $ m $ from_nat k \<noteq> 0"
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat i \<le> m
A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> invertible (fst (Gauss_Jordan_in_ij_PA (P, A) (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
show "invertible (fst (Gauss_Jordan_in_ij_PA (P, A) (from_nat i) (from_nat k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (fst (Gauss_Jordan_in_ij_PA (P, A) (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
by (rule invertible_fst_Gauss_Jordan_in_ij_PA[OF inv_P], auto intro!: i_less_m Amk_not_0)
[PROOF STATE]
proof (state)
this:
invertible (fst (Gauss_Jordan_in_ij_PA (P, A) (mod_type_class.from_nat i) (mod_type_class.from_nat k)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_restrict_union:
  "rel_restrict R (A \<union> B) = rel_restrict (rel_restrict R A) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_restrict R (A \<union> B) = rel_restrict (rel_restrict R A) B
[PROOF STEP]
unfolding rel_restrict_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(v, w). (v, w) \<in> R \<and> v \<notin> A \<union> B \<and> w \<notin> A \<union> B} = {(v, w). (v, w) \<in> {(v, w). (v, w) \<in> R \<and> v \<notin> A \<and> w \<notin> A} \<and> v \<notin> B \<and> w \<notin> B}
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_trees_del_min:
  assumes "ts \<noteq> []"
  shows "mset_trees ts = mset_trees (del_min ts) + {# get_min ts #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_trees ts = mset_trees (del_min ts) + {#get_min ts#}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ts \<noteq> []

goal (1 subgoal):
 1. mset_trees ts = mset_trees (del_min ts) + {#get_min ts#}
[PROOF STEP]
unfolding del_min_def
[PROOF STATE]
proof (prove)
using this:
ts \<noteq> []

goal (1 subgoal):
 1. mset_trees ts = mset_trees (case get_min_rest ts of (Node r x ts\<^sub>1, ts\<^sub>2) \<Rightarrow> merge (rev ts\<^sub>1) ts\<^sub>2) + {#get_min ts#}
[PROOF STEP]
apply (clarsimp split: tree.split prod.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x2 x1 x2a x3. \<lbrakk>ts \<noteq> []; get_min_rest ts = (Node x1 x2a x3, x2)\<rbrakk> \<Longrightarrow> mset_trees ts = add_mset (get_min ts) (mset_trees x3 + mset_trees x2)
[PROOF STEP]
apply (frule (1) get_min_rest_get_min_same_root)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x2 x1 x2a x3. \<lbrakk>ts \<noteq> []; get_min_rest ts = (Node x1 x2a x3, x2); tree.root (Node x1 x2a x3) = get_min ts\<rbrakk> \<Longrightarrow> mset_trees ts = add_mset (get_min ts) (mset_trees x3 + mset_trees x2)
[PROOF STEP]
apply (frule (1) mset_get_min_rest)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x2 x1 x2a x3. \<lbrakk>ts \<noteq> []; get_min_rest ts = (Node x1 x2a x3, x2); tree.root (Node x1 x2a x3) = get_min ts; mset ts = {#Node x1 x2a x3#} + mset x2\<rbrakk> \<Longrightarrow> mset_trees ts = add_mset (get_min ts) (mset_trees x3 + mset_trees x2)
[PROOF STEP]
apply (auto simp: mset_trees_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma antisym_mono_imp_fp_complete:
  assumes anti: "antisymmetric A (\<sqsubseteq>)"
    and comp: "CC-complete A (\<sqsubseteq>)"
    and wr_CC: "\<forall>C \<subseteq> A. well_related_set C (\<sqsubseteq>) \<longrightarrow> C \<in> CC"
    and extend: "\<forall>X \<in> CC. \<forall>Y \<in> CC. X \<sqsubseteq>\<^sup>s Y \<longrightarrow> X \<union> Y \<in> CC"
    and mono: "monotone_on A (\<sqsubseteq>) (\<sqsubseteq>) f"
  shows "CC-complete {p \<in> A. f p = p} (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CC-complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CC-complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
interpret antisymmetric
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. antisymmetric A (\<sqsubseteq>)
[PROOF STEP]
using anti
[PROOF STATE]
proof (prove)
using this:
antisymmetric A (\<sqsubseteq>)

goal (1 subgoal):
 1. antisymmetric A (\<sqsubseteq>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CC-complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
have *: "{q \<in> A. f q \<sim> q} \<subseteq> {p \<in> A. f p = p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {q \<in> A. f q \<sim> q} \<subseteq> {p \<in> A. f p = p}
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f ` A \<subseteq> A

goal (1 subgoal):
 1. {q \<in> A. f q \<sim> q} \<subseteq> {p \<in> A. f p = p}
[PROOF STEP]
by (auto intro!: antisym)
[PROOF STATE]
proof (state)
this:
{q \<in> A. f q \<sim> q} \<subseteq> {p \<in> A. f p = p}

goal (1 subgoal):
 1. CC-complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
from * attract_mono_imp_fp_qfp_complete[OF attractive_axioms comp wr_CC extend mono, of "{p\<in>A. f p = p}"]
[PROOF STATE]
proof (chain)
picking this:
{q \<in> A. f q \<sim> q} \<subseteq> {p \<in> A. f p = p}
{p \<in> A. f p = p} \<subseteq> {x \<in> A. f x = x} \<Longrightarrow> CC-complete ({q \<in> A. f q \<sim> q} \<union> {p \<in> A. f p = p}) (\<sqsubseteq>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{q \<in> A. f q \<sim> q} \<subseteq> {p \<in> A. f p = p}
{p \<in> A. f p = p} \<subseteq> {x \<in> A. f x = x} \<Longrightarrow> CC-complete ({q \<in> A. f q \<sim> q} \<union> {p \<in> A. f p = p}) (\<sqsubseteq>)

goal (1 subgoal):
 1. CC-complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
by (auto simp: subset_Un_eq)
[PROOF STATE]
proof (state)
this:
CC-complete {p \<in> A. f p = p} (\<sqsubseteq>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_unit [simp]: "inverse \<one> = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse \<one> = \<one>
[PROOF STEP]
using inverse_equality
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<cdot> ?v = \<one>; ?v \<cdot> ?u = \<one>; ?u \<in> M; ?v \<in> M\<rbrakk> \<Longrightarrow> inverse ?u = ?v

goal (1 subgoal):
 1. inverse \<one> = \<one>
[PROOF STEP]
by blast