[STATEMENT]
lemma nn_integral_def_finite:
  "integral\<^sup>N M f = (SUP g \<in> {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)}. integral\<^sup>S M g)"
    (is "_ = Sup (?A ` ?f)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M f = Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
unfolding nn_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f}) = Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
proof (safe intro!: antisym SUP_least)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>simple_function M i; i \<le> f\<rbrakk> \<Longrightarrow> integral\<^sup>S M i \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<And>g. \<lbrakk>simple_function M g; g \<le> f; \<forall>x. g x < top\<rbrakk> \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f})
[PROOF STEP]
fix g
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>simple_function M i; i \<le> f\<rbrakk> \<Longrightarrow> integral\<^sup>S M i \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<And>g. \<lbrakk>simple_function M g; g \<le> f; \<forall>x. g x < top\<rbrakk> \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f})
[PROOF STEP]
assume g[measurable]: "simple_function M g" "g \<le> f"
[PROOF STATE]
proof (state)
this:
simple_function M g
g \<le> f

goal (2 subgoals):
 1. \<And>i. \<lbrakk>simple_function M i; i \<le> f\<rbrakk> \<Longrightarrow> integral\<^sup>S M i \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<And>g. \<lbrakk>simple_function M g; g \<le> f; \<forall>x. g x < top\<rbrakk> \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f})
[PROOF STEP]
show "integral\<^sup>S M g \<le> Sup (?A ` ?f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<not> ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
assume ae: "AE x in M. g x \<noteq> top"
[PROOF STATE]
proof (state)
this:
AE x in M. g x \<noteq> top

goal (2 subgoals):
 1. ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<not> ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
let ?G = "{x \<in> space M. g x \<noteq> top}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<not> ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
have "integral\<^sup>S M g = integral\<^sup>S M (\<lambda>x. g x * indicator ?G x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>S M g = \<integral>\<^sup>S x. g x * indicator {x \<in> space M. g x \<noteq> top} x \<partial>M
[PROOF STEP]
proof (rule simple_integral_cong_AE)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. simple_function M g
 2. simple_function M (\<lambda>x. g x * indicator {x \<in> space M. g x \<noteq> top} x)
 3. AE x in M. g x = g x * indicator {x \<in> space M. g x \<noteq> top} x
[PROOF STEP]
show "AE x in M. g x = g x * indicator ?G x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. g x = g x * indicator {x \<in> space M. g x \<noteq> top} x
[PROOF STEP]
using ae AE_space
[PROOF STATE]
proof (prove)
using this:
AE x in M. g x \<noteq> top
AE x in ?M. x \<in> space ?M

goal (1 subgoal):
 1. AE x in M. g x = g x * indicator {x \<in> space M. g x \<noteq> top} x
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
AE x in M. g x = g x * indicator {x \<in> space M. g x \<noteq> top} x

goal (2 subgoals):
 1. simple_function M g
 2. simple_function M (\<lambda>x. g x * indicator {x \<in> space M. g x \<noteq> top} x)
[PROOF STEP]
qed (insert g, auto)
[PROOF STATE]
proof (state)
this:
integral\<^sup>S M g = \<integral>\<^sup>S x. g x * indicator {x \<in> space M. g x \<noteq> top} x \<partial>M

goal (2 subgoals):
 1. ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<not> ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>S M g = \<integral>\<^sup>S x. g x * indicator {x \<in> space M. g x \<noteq> top} x \<partial>M

goal (2 subgoals):
 1. ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<not> ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
have "\<dots> \<le> Sup (?A ` ?f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>S x. g x * indicator {x \<in> space M. g x \<noteq> top} x \<partial>M \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
simple_function M g
g \<le> f

goal (1 subgoal):
 1. \<integral>\<^sup>S x. g x * indicator {x \<in> space M. g x \<noteq> top} x \<partial>M \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
by (intro SUP_upper) (auto simp: le_fun_def less_top split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. g x * indicator {x \<in> space M. g x \<noteq> top} x \<partial>M \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})

goal (2 subgoals):
 1. ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
 2. \<not> ?P \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})

goal (1 subgoal):
 1. integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})

goal (1 subgoal):
 1. \<not> (AE x in M. g x \<noteq> top) \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (AE x in M. g x \<noteq> top) \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
assume nAE: "\<not> (AE x in M. g x \<noteq> top)"
[PROOF STATE]
proof (state)
this:
\<not> (AE x in M. g x \<noteq> top)

goal (1 subgoal):
 1. \<not> (AE x in M. g x \<noteq> top) \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (AE x in M. g x \<noteq> top)
[PROOF STEP]
have "emeasure M {x\<in>space M. g x = top} \<noteq> 0" (is "emeasure M ?G \<noteq> 0")
[PROOF STATE]
proof (prove)
using this:
\<not> (AE x in M. g x \<noteq> top)

goal (1 subgoal):
 1. emeasure M {x \<in> space M. g x = top} \<noteq> 0
[PROOF STEP]
by (subst (asm) AE_iff_measurable[OF _ refl]) auto
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> space M. g x = top} \<noteq> 0

goal (1 subgoal):
 1. \<not> (AE x in M. g x \<noteq> top) \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure M {x \<in> space M. g x = top} \<noteq> 0
[PROOF STEP]
have "top = (SUP n. (\<integral>\<^sup>Sx. of_nat n * indicator ?G x \<partial>M))"
[PROOF STATE]
proof (prove)
using this:
emeasure M {x \<in> space M. g x = top} \<noteq> 0

goal (1 subgoal):
 1. top = (SUP n. \<integral>\<^sup>S x. of_nat n * indicator {x \<in> space M. g x = top} x \<partial>M)
[PROOF STEP]
by (simp add: ennreal_SUP_of_nat_eq_top ennreal_top_eq_mult_iff SUP_mult_right_ennreal[symmetric])
[PROOF STATE]
proof (state)
this:
top = (SUP n. \<integral>\<^sup>S x. of_nat n * indicator {x \<in> space M. g x = top} x \<partial>M)

goal (1 subgoal):
 1. \<not> (AE x in M. g x \<noteq> top) \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
top = (SUP n. \<integral>\<^sup>S x. of_nat n * indicator {x \<in> space M. g x = top} x \<partial>M)

goal (1 subgoal):
 1. \<not> (AE x in M. g x \<noteq> top) \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
have "\<dots> \<le> Sup (?A ` ?f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP n. \<integral>\<^sup>S x. of_nat n * indicator {x \<in> space M. g x = top} x \<partial>M) \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
simple_function M g
g \<le> f

goal (1 subgoal):
 1. (SUP n. \<integral>\<^sup>S x. of_nat n * indicator {x \<in> space M. g x = top} x \<partial>M) \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
by (safe intro!: SUP_least SUP_upper)
         (auto simp: le_fun_def of_nat_less_top top_unique[symmetric] split: split_indicator
               intro: order_trans[of _ "g x" "f x" for x, OF order_trans[of _ top]])
[PROOF STATE]
proof (state)
this:
(SUP n. \<integral>\<^sup>S x. of_nat n * indicator {x \<in> space M. g x = top} x \<partial>M) \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})

goal (1 subgoal):
 1. \<not> (AE x in M. g x \<noteq> top) \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
top \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
top \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})

goal (1 subgoal):
 1. integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})
[PROOF STEP]
by (simp add: top_unique del: SUP_eq_top_iff Sup_eq_top_iff)
[PROOF STATE]
proof (state)
this:
integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f \<and> (\<forall>x. g x < top)})

goal (1 subgoal):
 1. \<And>g. \<lbrakk>simple_function M g; g \<le> f; \<forall>x. g x < top\<rbrakk> \<Longrightarrow> integral\<^sup>S M g \<le> Sup (integral\<^sup>S M ` {g. simple_function M g \<and> g \<le> f})
[PROOF STEP]
qed (auto intro: SUP_upper)


[STATEMENT]
lemma Reals_minus_iff [simp]: "- a \<in> \<real> \<longleftrightarrow> a \<in> \<real>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- a \<in> \<real>) = (a \<in> \<real>)
[PROOF STEP]
using Reals_minus
[PROOF STATE]
proof (prove)
using this:
?a \<in> \<real> \<Longrightarrow> - ?a \<in> \<real>

goal (1 subgoal):
 1. (- a \<in> \<real>) = (a \<in> \<real>)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma subdegree_minus_cutoff_ge:
  assumes "f - fps_cutoff n (f :: 'a :: ab_group_add fps) \<noteq> 0"
  shows   "subdegree (f - fps_cutoff n f) \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> subdegree (f - fps_cutoff n f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f - fps_cutoff n f \<noteq> 0

goal (1 subgoal):
 1. n \<le> subdegree (f - fps_cutoff n f)
[PROOF STEP]
by (rule subdegree_geI) simp_all


[STATEMENT]
lemma wr_subcat_antisym:
  assumes "\<AA> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>r\<^bsub>\<alpha>\<^esub>  \<BB>" and "\<BB> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>r\<^bsub>\<alpha>\<^esub>  \<AA>"
  shows "\<AA> = \<BB>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
interpret \<AA>\<BB>: wide_replete_subcategory \<alpha> \<AA> \<BB>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>r\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
interpret \<BB>\<AA>: wide_replete_subcategory \<alpha> \<BB> \<AA>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>r\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
by (rule subcat_antisym[OF \<AA>\<BB>.subcategory_axioms \<BB>\<AA>.subcategory_axioms])
[PROOF STATE]
proof (state)
this:
\<AA> = \<BB>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma step_push_size_small [simp]: "\<lbrakk>
  invar (States dir big small);
  step (States dir big (Small.push x small)) = States dir' big' small'
\<rbrakk> \<Longrightarrow> size small' = Suc (size small)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir big (Small.push x small)) = States dir' big' small'\<rbrakk> \<Longrightarrow> size small' = Suc (size small)
[PROOF STEP]
using
    invar_push_small[of dir big small x]
    step_size_small[of dir big "Small.push x small" dir' big' small']
    size_push[of small x]
[PROOF STATE]
proof (prove)
using this:
invar (States dir big small) \<Longrightarrow> invar (States dir big (Small.push x small))
\<lbrakk>invar (States dir big (Small.push x small)); step (States dir big (Small.push x small)) = States dir' big' small'\<rbrakk> \<Longrightarrow> size small' = size (Small.push x small)
invar small \<Longrightarrow> size (Small.push x small) = Suc (size small)

goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir big (Small.push x small)) = States dir' big' small'\<rbrakk> \<Longrightarrow> size small' = Suc (size small)
[PROOF STEP]
by simp


[STATEMENT]
theorem VSLEG: "\<forall>xs. eval (VSLEG \<phi>) xs = eval \<phi> xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs. eval (VSLEG \<phi>) xs = eval \<phi> xs
[PROOF STEP]
unfolding VSLEG_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs. eval ((VSGeneral \<circ> VSEquality \<circ> VSLucky) \<phi>) xs = eval \<phi> xs
[PROOF STEP]
using VSLucky VSEquality VSGeneral
[PROOF STATE]
proof (prove)
using this:
\<forall>xs. eval (VSLucky ?\<phi>) xs = eval ?\<phi> xs
\<forall>xs. eval (VSEquality ?\<phi>) xs = eval ?\<phi> xs
\<forall>xs. eval (VSGeneral ?\<phi>) xs = eval ?\<phi> xs

goal (1 subgoal):
 1. \<forall>xs. eval ((VSGeneral \<circ> VSEquality \<circ> VSLucky) \<phi>) xs = eval \<phi> xs
[PROOF STEP]
by auto


[STATEMENT]
lemma ac_p_int_pow_factor:
  assumes "a \<in> nonzero Q\<^sub>p"
  shows "ac m ((\<pp> [^] (n::int)) \<otimes> a) = ac m a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac m (\<pp> [^] n \<otimes> a) = ac m a
[PROOF STEP]
apply(cases "m = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> ac m (\<pp> [^] n \<otimes> a) = ac m a
 2. m \<noteq> 0 \<Longrightarrow> ac m (\<pp> [^] n \<otimes> a) = ac m a
[PROOF STEP]
apply (metis (no_types, lifting) Qp.integral Qp.nonzero_closed Qp.nonzero_memE(2)
          ac_def angular_component_p_int_pow_factor assms p_intpow_closed(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> ac m (\<pp> [^] n \<otimes> a) = ac m a
[PROOF STEP]
using assms angular_component_p_int_pow_factor[of a n]
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
a \<in> carrier Q\<^sub>p \<Longrightarrow> angular_component (\<pp> [^] n \<otimes> a) = angular_component a

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> ac m (\<pp> [^] n \<otimes> a) = ac m a
[PROOF STEP]
by (metis (no_types, lifting) Qp.integral Qp.nonzero_closed Qp.not_nonzero_memI ac_def
      p_intpow_closed(2))


[STATEMENT]
theorem irreducible\<^sub>d_factorization_exists:
  assumes "degree p > 0"
  shows "\<exists>fs. fs \<noteq> [] \<and> (\<forall>f \<in> set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs"
    and "\<not>irreducible\<^sub>d p \<Longrightarrow> \<exists>fs. length fs > 1 \<and> (\<forall>f \<in> set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs &&& (\<not> irreducible\<^sub>d p \<Longrightarrow> \<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs)
[PROOF STEP]
proof (atomize(full), insert assms, induct "degree p" arbitrary:p rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; 0 < degree pa\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree pa) \<and> pa = prod_list fs) \<and> (\<not> irreducible\<^sub>d pa \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree pa) \<and> pa = prod_list fs)); 0 < degree p\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree ?p < degree p; 0 < degree ?p\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree ?p) \<and> ?p = prod_list fs) \<and> (\<not> irreducible\<^sub>d ?p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree ?p) \<and> ?p = prod_list fs))
0 < degree p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; 0 < degree pa\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree pa) \<and> pa = prod_list fs) \<and> (\<not> irreducible\<^sub>d pa \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree pa) \<and> pa = prod_list fs)); 0 < degree p\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>degree ?p < degree p; 0 < degree ?p\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree ?p) \<and> ?p = prod_list fs) \<and> (\<not> irreducible\<^sub>d ?p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree ?p) \<and> ?p = prod_list fs))
0 < degree p
[PROOF STEP]
have deg_f: "degree p > 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>degree ?p < degree p; 0 < degree ?p\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree ?p) \<and> ?p = prod_list fs) \<and> (\<not> irreducible\<^sub>d ?p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree ?p) \<and> ?p = prod_list fs))
0 < degree p

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

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; 0 < degree pa\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree pa) \<and> pa = prod_list fs) \<and> (\<not> irreducible\<^sub>d pa \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree pa) \<and> pa = prod_list fs)); 0 < degree p\<rbrakk> \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
proof (cases "irreducible\<^sub>d p")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
 2. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
irreducible\<^sub>d p

goal (2 subgoals):
 1. irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
 2. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
irreducible\<^sub>d p
[PROOF STEP]
have "set [p] \<subseteq> Collect irreducible\<^sub>d" "p = prod_list [p]"
[PROOF STATE]
proof (prove)
using this:
irreducible\<^sub>d p

goal (1 subgoal):
 1. set [p] \<subseteq> Collect irreducible\<^sub>d &&& p = prod_list [p]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set [p] \<subseteq> Collect irreducible\<^sub>d
p = prod_list [p]

goal (2 subgoals):
 1. irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
 2. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
irreducible\<^sub>d p
set [p] \<subseteq> Collect irreducible\<^sub>d
p = prod_list [p]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
irreducible\<^sub>d p
set [p] \<subseteq> Collect irreducible\<^sub>d
p = prod_list [p]

goal (1 subgoal):
 1. (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
by (auto intro: exI[of _ "[p]"])
[PROOF STATE]
proof (state)
this:
(\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> irreducible\<^sub>d p

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
with deg_f
[PROOF STATE]
proof (chain)
picking this:
0 < degree p
\<not> irreducible\<^sub>d p
[PROOF STEP]
obtain g h
    where deg_g: "degree g < degree p" "degree g > 0"
      and deg_h: "degree h < degree p" "degree h > 0"
      and f_gh: "p = g * h"
[PROOF STATE]
proof (prove)
using this:
0 < degree p
\<not> irreducible\<^sub>d p

goal (1 subgoal):
 1. (\<And>g h. \<lbrakk>degree g < degree p; 0 < degree g; degree h < degree p; 0 < degree h; p = g * h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree g < degree p
0 < degree g
degree h < degree p
0 < degree h
p = g * h

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
from less.hyps[OF deg_g] less.hyps[OF deg_h]
[PROOF STATE]
proof (chain)
picking this:
(\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree g) \<and> g = prod_list fs) \<and> (\<not> irreducible\<^sub>d g \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree g) \<and> g = prod_list fs))
(\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree h) \<and> h = prod_list fs) \<and> (\<not> irreducible\<^sub>d h \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree h) \<and> h = prod_list fs))
[PROOF STEP]
obtain gs hs
    where emp: "length gs > 0" "length hs > 0"
      and "\<forall>f \<in> set gs. irreducible\<^sub>d f \<and> degree f \<le> degree g" "g = prod_list gs"
      and "\<forall>f \<in> set hs. irreducible\<^sub>d f \<and> degree f \<le> degree h" "h = prod_list hs"
[PROOF STATE]
proof (prove)
using this:
(\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree g) \<and> g = prod_list fs) \<and> (\<not> irreducible\<^sub>d g \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree g) \<and> g = prod_list fs))
(\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree h) \<and> h = prod_list fs) \<and> (\<not> irreducible\<^sub>d h \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree h) \<and> h = prod_list fs))

goal (1 subgoal):
 1. (\<And>gs hs. \<lbrakk>0 < length gs; 0 < length hs; \<forall>f\<in>set gs. irreducible\<^sub>d f \<and> degree f \<le> degree g; g = prod_list gs; \<forall>f\<in>set hs. irreducible\<^sub>d f \<and> degree f \<le> degree h; h = prod_list hs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < length gs
0 < length hs
\<forall>f\<in>set gs. irreducible\<^sub>d f \<and> degree f \<le> degree g
g = prod_list gs
\<forall>f\<in>set hs. irreducible\<^sub>d f \<and> degree f \<le> degree h
h = prod_list hs

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
with f_gh deg_g deg_h
[PROOF STATE]
proof (chain)
picking this:
p = g * h
degree g < degree p
0 < degree g
degree h < degree p
0 < degree h
0 < length gs
0 < length hs
\<forall>f\<in>set gs. irreducible\<^sub>d f \<and> degree f \<le> degree g
g = prod_list gs
\<forall>f\<in>set hs. irreducible\<^sub>d f \<and> degree f \<le> degree h
h = prod_list hs
[PROOF STEP]
have len: "length (gs@hs) > 1"
     and mem: "\<forall>f \<in> set (gs@hs). irreducible\<^sub>d f \<and> degree f < degree p"
     and p: "p = prod_list (gs@hs)"
[PROOF STATE]
proof (prove)
using this:
p = g * h
degree g < degree p
0 < degree g
degree h < degree p
0 < degree h
0 < length gs
0 < length hs
\<forall>f\<in>set gs. irreducible\<^sub>d f \<and> degree f \<le> degree g
g = prod_list gs
\<forall>f\<in>set hs. irreducible\<^sub>d f \<and> degree f \<le> degree h
h = prod_list hs

goal (1 subgoal):
 1. 1 < length (gs @ hs) &&& \<forall>f\<in>set (gs @ hs). irreducible\<^sub>d f \<and> degree f < degree p &&& p = prod_list (gs @ hs)
[PROOF STEP]
by (auto simp del: length_greater_0_conv)
[PROOF STATE]
proof (state)
this:
1 < length (gs @ hs)
\<forall>f\<in>set (gs @ hs). irreducible\<^sub>d f \<and> degree f < degree p
p = prod_list (gs @ hs)

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> irreducible\<^sub>d p
1 < length (gs @ hs)
\<forall>f\<in>set (gs @ hs). irreducible\<^sub>d f \<and> degree f < degree p
p = prod_list (gs @ hs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> irreducible\<^sub>d p
1 < length (gs @ hs)
\<forall>f\<in>set (gs @ hs). irreducible\<^sub>d f \<and> degree f < degree p
p = prod_list (gs @ hs)

goal (1 subgoal):
 1. (\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))
[PROOF STEP]
by (auto intro!: exI[of _ "gs@hs"] simp: less_imp_le)
[PROOF STATE]
proof (state)
this:
(\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>fs. fs \<noteq> [] \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f \<le> degree p) \<and> p = prod_list fs) \<and> (\<not> irreducible\<^sub>d p \<longrightarrow> (\<exists>fs. 1 < length fs \<and> (\<forall>f\<in>set fs. irreducible\<^sub>d f \<and> degree f < degree p) \<and> p = prod_list fs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_of_ratfps_mod [simp]:
   "fps_of_ratfps (f mod g :: 'a ratfps) = fps_of_ratfps f mod fps_of_ratfps g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_ratfps (f mod g) = fps_of_ratfps f mod fps_of_ratfps g
[PROOF STEP]
unfolding fps_mod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_ratfps (f mod g) = (if fps_of_ratfps g = 0 then fps_of_ratfps f else let h = unit_factor (fps_of_ratfps g) in fps_cutoff (subdegree (fps_of_ratfps g)) (fps_of_ratfps f * inverse h) * h)
[PROOF STEP]
by transfer' (simp add: Let_def ratfps_subdegree_altdef)


[STATEMENT]
lemma closure_V_int:
  "Closure\<^sub>\<alpha> Z = Closure\<^sub>\<alpha> (Z \<inter> V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Closure\<^sub>\<alpha> Z = Closure\<^sub>\<alpha> (Z \<inter> V)
[PROOF STEP]
unfolding cla_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {R \<in> \<R>. R \<inter> Z \<noteq> {}} = \<Union> {R \<in> \<R>. R \<inter> (Z \<inter> V) \<noteq> {}}
[PROOF STEP]
using region_V
[PROOF STATE]
proof (prove)
using this:
?R \<in> \<R> \<Longrightarrow> ?R \<subseteq> V

goal (1 subgoal):
 1. \<Union> {R \<in> \<R>. R \<inter> Z \<noteq> {}} = \<Union> {R \<in> \<R>. R \<inter> (Z \<inter> V) \<noteq> {}}
[PROOF STEP]
by auto


[STATEMENT]
lemma ccsubspace_Times_sup: \<open>sup (ccsubspace_Times A B) (ccsubspace_Times C D) = ccsubspace_Times (sup A C) (sup B D)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccsubspace_Times A B \<squnion> ccsubspace_Times C D = ccsubspace_Times (A \<squnion> C) (B \<squnion> D)
[PROOF STEP]
proof transfer
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
fix A C :: \<open>'a set\<close> and B D :: \<open>'b set\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
have \<open>A \<times> B +\<^sub>M C \<times> D = closure ((A \<times> B) + (C \<times> D))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> B +\<^sub>M C \<times> D = closure (A \<times> B + C \<times> D)
[PROOF STEP]
using closed_sum_def
[PROOF STATE]
proof (prove)
using this:
?A +\<^sub>M ?B = closure (?A + ?B)

goal (1 subgoal):
 1. A \<times> B +\<^sub>M C \<times> D = closure (A \<times> B + C \<times> D)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<times> B +\<^sub>M C \<times> D = closure (A \<times> B + C \<times> D)

goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A \<times> B +\<^sub>M C \<times> D = closure (A \<times> B + C \<times> D)

goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
have \<open>\<dots> = closure ((A + C) \<times> (B + D))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (A \<times> B + C \<times> D) = closure ((A + C) \<times> (B + D))
[PROOF STEP]
by (simp add: set_Times_plus_distrib)
[PROOF STATE]
proof (state)
this:
closure (A \<times> B + C \<times> D) = closure ((A + C) \<times> (B + D))

goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure (A \<times> B + C \<times> D) = closure ((A + C) \<times> (B + D))

goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
have \<open>\<dots> = closure (A + C) \<times> closure (B + D)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure ((A + C) \<times> (B + D)) = closure (A + C) \<times> closure (B + D)
[PROOF STEP]
by (simp add: closure_Times)
[PROOF STATE]
proof (state)
this:
closure ((A + C) \<times> (B + D)) = closure (A + C) \<times> closure (B + D)

goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure ((A + C) \<times> (B + D)) = closure (A + C) \<times> closure (B + D)

goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
have \<open>\<dots> = (A +\<^sub>M C) \<times> (B +\<^sub>M D)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (A + C) \<times> closure (B + D) = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
by (simp add: closed_sum_def)
[PROOF STATE]
proof (state)
this:
closure (A + C) \<times> closure (B + D) = (A +\<^sub>M C) \<times> (B +\<^sub>M D)

goal (1 subgoal):
 1. \<And>A B C D. \<lbrakk>closed_csubspace A; closed_csubspace B; closed_csubspace C; closed_csubspace D\<rbrakk> \<Longrightarrow> A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
show \<open>A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)\<close>
[PROOF STATE]
proof (prove)
using this:
A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)

goal (1 subgoal):
 1. A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
A \<times> B +\<^sub>M C \<times> D = (A +\<^sub>M C) \<times> (B +\<^sub>M D)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Order) augmented_set_minimum:"\<lbrakk>X \<subseteq> carrier D; a \<in> carrier D;
       Y - {a} \<subseteq> X; y - {a} \<noteq> {}; minimum_elem (Iod D X) (Y - {a}) x;
       \<forall>x\<in>X. x \<preceq> a\<rbrakk> \<Longrightarrow>  minimum_elem (Iod D (insert a X)) Y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; Y - {a} \<subseteq> X; y - {a} \<noteq> {}; minimum_elem (Iod D X) (Y - {a}) x; \<forall>x\<in>X. x \<preceq> a\<rbrakk> \<Longrightarrow> minimum_elem (Iod D (insert a X)) Y x
[PROOF STEP]
apply (frule insert_mono[of "Y - {a}" "X" "a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; Y - {a} \<subseteq> X; y - {a} \<noteq> {}; minimum_elem (Iod D X) (Y - {a}) x; \<forall>x\<in>X. x \<preceq> a; insert a (Y - {a}) \<subseteq> insert a X\<rbrakk> \<Longrightarrow> minimum_elem (Iod D (insert a X)) Y x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; Y - {a} \<subseteq> X; \<not> y \<subseteq> {a}; minimum_elem (Iod D X) (Y - {a}) x; \<forall>x\<in>X. x \<preceq> a; Y \<subseteq> insert a X\<rbrakk> \<Longrightarrow> minimum_elem (Iod D (insert a X)) Y x
[PROOF STEP]
apply (frule insert_sub[of X "carrier D" a], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; Y - {a} \<subseteq> X; \<not> y \<subseteq> {a}; minimum_elem (Iod D X) (Y - {a}) x; \<forall>x\<in>X. x \<preceq> a; Y \<subseteq> insert a X; insert a X \<subseteq> carrier D\<rbrakk> \<Longrightarrow> minimum_elem (Iod D (insert a X)) Y x
[PROOF STEP]
apply (simp add:minimum_elem_sub[THEN sym, of "insert a X" Y],
        simp add:minimum_elem_sub[THEN sym, of X "Y - {a}"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; Y - {a} \<subseteq> X; \<not> y \<subseteq> {a}; minimum_elem D (Y - {a}) x; \<forall>x\<in>X. x \<preceq> a; Y \<subseteq> insert a X\<rbrakk> \<Longrightarrow> minimum_elem D Y x
[PROOF STEP]
apply (simp add:subset_eq[of "Y - {a}" X])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; \<forall>x\<in>Y - {a}. x \<in> X; \<not> y \<subseteq> {a}; minimum_elem D (Y - {a}) x; \<forall>x\<in>X. x \<preceq> a; Y \<subseteq> insert a X\<rbrakk> \<Longrightarrow> minimum_elem D Y x
[PROOF STEP]
apply (simp add:minimum_elem_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; \<forall>x\<in>Y - {a}. x \<in> X; \<not> y \<subseteq> {a}; \<forall>x\<in>X. x \<preceq> a; Y \<subseteq> insert a X; x \<in> Y; x \<noteq> a; \<forall>xa\<in>Y - {a}. x \<preceq> xa\<rbrakk> \<Longrightarrow> Ball Y ((\<preceq>) x)
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>X \<subseteq> carrier D; a \<in> carrier D; \<forall>x\<in>Y - {a}. x \<in> X; \<not> y \<subseteq> {a}; \<forall>x\<in>X. x \<preceq> a; Y \<subseteq> insert a X; x \<in> Y; x \<noteq> a; \<forall>xa\<in>Y - {a}. x \<preceq> xa; xa \<in> Y\<rbrakk> \<Longrightarrow> x \<preceq> xa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma intersect_list_nodes_finite[intro]:
    assumes "list_all (finite \<circ> NBA.nodes) AA"
    shows "finite (NBA.nodes (intersect_list AA))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (NBA.nodes (intersect_list AA))
[PROOF STEP]
using intersect_list'_nodes_finite assms
[PROOF STATE]
proof (prove)
using this:
list_all (finite \<circ> NBA.nodes) ?AA \<Longrightarrow> finite (NGBA.nodes (intersect_list' ?AA))
list_all (finite \<circ> NBA.nodes) AA

goal (1 subgoal):
 1. finite (NBA.nodes (intersect_list AA))
[PROOF STEP]
by simp


[STATEMENT]
lemma inside_connected_component_le:
    fixes S :: "'a::euclidean_space set"
    assumes S: "bounded S"  "2 \<le> DIM('a)"
      shows "inside S = {x. (x \<notin> S) \<and> (\<forall>B. \<exists>y. B \<le> norm(y) \<and> \<not> connected_component (- S) x y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inside S = {x. x \<notin> S \<and> (\<forall>B. \<exists>y. B \<le> norm y \<and> \<not> connected_component (- S) x y)}
[PROOF STEP]
by (auto simp: inside_outside not_outside_connected_component_le [OF assms])


[STATEMENT]
lemma ereal_mult_eq_MInfty[simp]:
  "a * b = -(\<infinity>::ereal) \<longleftrightarrow>
    (a = \<infinity> \<and> b < 0) \<or> (a < 0 \<and> b = \<infinity>) \<or> (a = -\<infinity> \<and> b > 0) \<or> (a > 0 \<and> b = -\<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * b = - \<infinity>) = (a = \<infinity> \<and> b < 0 \<or> a < 0 \<and> b = \<infinity> \<or> a = - \<infinity> \<and> 0 < b \<or> 0 < a \<and> b = - \<infinity>)
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) auto


[STATEMENT]
lemma eq_rel_eval_trm: "v \<in> eq_rel n t1 t2 \<Longrightarrow> MFOTL.is_Const t1 \<or> MFOTL.is_Const t2 \<Longrightarrow>
  \<forall>x\<in>MFOTL.fv_trm t1 \<union> MFOTL.fv_trm t2. x < n \<Longrightarrow>
  MFOTL.eval_trm (map the v) t1 = MFOTL.eval_trm (map the v) t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> eq_rel n t1 t2; trm.is_Const t1 \<or> trm.is_Const t2; \<forall>x\<in>fv_trm t1 \<union> fv_trm t2. x < n\<rbrakk> \<Longrightarrow> MFOTL.eval_trm (map the v) t1 = MFOTL.eval_trm (map the v) t2
[PROOF STEP]
by (cases t1; cases t2) (simp_all add: singleton_table_def split: if_splits)


[STATEMENT]
lemma less_omegaD: "x < \<omega> \<Longrightarrow> \<exists>n. x = ordinal_of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < \<omega> \<Longrightarrow> \<exists>n. x = ordinal_of_nat n
[PROOF STEP]
apply (unfold omega_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < oLimit ordinal_of_nat \<Longrightarrow> \<exists>n. x = ordinal_of_nat n
[PROOF STEP]
apply (drule less_oLimitD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. x < ordinal_of_nat n \<Longrightarrow> \<exists>n. x = ordinal_of_nat n
[PROOF STEP]
apply (clarsimp simp add: less_ordinal_of_nat)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cond1_propagate:
  assumes "cond1 f bs y xs ys"
  shows "cond1 f (b # bs) y xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cond1 f (b # bs) y xs ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cond1 f bs y xs ys

goal (1 subgoal):
 1. cond1 f (b # bs) y xs ys
[PROOF STEP]
unfolding cond1_def
[PROOF STATE]
proof (prove)
using this:
(\<exists>b. b \<in> set bs \<and> fst (f b y) \<and> snd (mul_ext f (remove1 b xs) (filter (\<lambda>y. \<not> fst (f b y)) ys))) \<or> (\<exists>b. b \<in> set bs \<and> snd (f b y) \<and> fst (mul_ext f (remove1 b xs) ys))

goal (1 subgoal):
 1. (\<exists>ba. ba \<in> set (b # bs) \<and> fst (f ba y) \<and> snd (mul_ext f (remove1 ba xs) (filter (\<lambda>y. \<not> fst (f ba y)) ys))) \<or> (\<exists>ba. ba \<in> set (b # bs) \<and> snd (f ba y) \<and> fst (mul_ext f (remove1 ba xs) ys))
[PROOF STEP]
by auto


[STATEMENT]
lemma pmf_scale_spmf_None:
  "pmf (scale_spmf k p) None = 1 - min 1 (max 0 k * (1 - pmf p None))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (scale_spmf k p) None = 1 - min 1 (max 0 k * (1 - pmf p None))
[PROOF STEP]
unfolding pmf_None_eq_weight_spmf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - weight_spmf (scale_spmf k p) = 1 - min 1 (max 0 k * (1 - (1 - weight_spmf p)))
[PROOF STEP]
by(simp add: weight_scale_spmf)


[STATEMENT]
lemma DERIV_deriv_iff_field_differentiable:
  "DERIV f x :> deriv f x \<longleftrightarrow> f field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative deriv f x) (at x) = (f field_differentiable at x)
[PROOF STEP]
unfolding field_differentiable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative deriv f x) (at x) = (\<exists>f'. (f has_field_derivative f') (at x))
[PROOF STEP]
by (metis DERIV_imp_deriv)


[STATEMENT]
lemma not_conj_deMorgans [simp]: "(\<not> ((P::'\<alpha> upred) \<and> Q)) = ((\<not> P) \<or> (\<not> Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (P \<and> Q)) = (\<not> P \<or> \<not> Q)
[PROOF STEP]
by (pred_auto)


[STATEMENT]
lemma Iff_E:
  "insert A (insert B H) \<turnstile> C \<Longrightarrow> insert (Neg A) (insert (Neg B) H) \<turnstile> C \<Longrightarrow> insert (A IFF B) H \<turnstile> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>insert A (insert B H) \<turnstile> C; insert (Neg A) (insert (Neg B) H) \<turnstile> C\<rbrakk> \<Longrightarrow> insert (A IFF B) H \<turnstile> C
[PROOF STEP]
by (smt (verit) AssumeH(2) Conj_E Disj_E Iff_def Neg_D rotate2)


[STATEMENT]
lemma power_similiar_sq_mtx_diag_eq:
  assumes "mtx_invertible P"
      and "A = P\<^sup>-\<^sup>1 * (sq_mtx_diag f) * P"
    shows "A^n = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i^n) * P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^ n = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P
[PROOF STEP]
proof(induct n, simp_all add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (P\<^sup>-\<^sup>1 * sq_mtx_diag f * P) ^ n = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P \<Longrightarrow> P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
fix n::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (P\<^sup>-\<^sup>1 * sq_mtx_diag f * P) ^ n = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P \<Longrightarrow> P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
have "P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) =
  P\<^sup>-\<^sup>1 * sq_mtx_diag f * (\<d>\<i>\<a>\<g> i. f i ^ n) * P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * sq_mtx_diag f * (\<d>\<i>\<a>\<g> i. f i ^ n) * P
[PROOF STEP]
by (metis (no_types, lifting) assms(1) mtx_invertibleD(2) mult.assoc mult.right_neutral)
[PROOF STATE]
proof (state)
this:
P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * sq_mtx_diag f * (\<d>\<i>\<a>\<g> i. f i ^ n) * P

goal (1 subgoal):
 1. \<And>n. (P\<^sup>-\<^sup>1 * sq_mtx_diag f * P) ^ n = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P \<Longrightarrow> P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * sq_mtx_diag f * (\<d>\<i>\<a>\<g> i. f i ^ n) * P

goal (1 subgoal):
 1. \<And>n. (P\<^sup>-\<^sup>1 * sq_mtx_diag f * P) ^ n = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P \<Longrightarrow> P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
have "... = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P\<^sup>-\<^sup>1 * sq_mtx_diag f * (\<d>\<i>\<a>\<g> i. f i ^ n) * P = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
by (simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
P\<^sup>-\<^sup>1 * sq_mtx_diag f * (\<d>\<i>\<a>\<g> i. f i ^ n) * P = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P

goal (1 subgoal):
 1. \<And>n. (P\<^sup>-\<^sup>1 * sq_mtx_diag f * P) ^ n = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P \<Longrightarrow> P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
show "P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) =
  P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P"
[PROOF STATE]
proof (prove)
using this:
P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P

goal (1 subgoal):
 1. P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P\<^sup>-\<^sup>1 * sq_mtx_diag f * P * (P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i ^ n) * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i * f i ^ n) * P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DERIV_deriv_iff_has_field_derivative:
  "DERIV f x :> deriv f x \<longleftrightarrow> (\<exists>f'. (f has_field_derivative f') (at x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative deriv f x) (at x) = (\<exists>f'. (f has_field_derivative f') (at x))
[PROOF STEP]
by (auto simp: has_field_derivative_def DERIV_imp_deriv)


[STATEMENT]
lemma nth_digit_bounded: "b>1 \<Longrightarrow> nth_digit a k b \<le> b-1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < b \<Longrightarrow> nth_digit a k b \<le> b - 1
[PROOF STEP]
apply (auto simp add: nth_digit_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < b \<Longrightarrow> a div b ^ k mod b \<le> b - Suc 0
[PROOF STEP]
using less_Suc_eq_le
[PROOF STATE]
proof (prove)
using this:
(?m < Suc ?n) = (?m \<le> ?n)

goal (1 subgoal):
 1. Suc 0 < b \<Longrightarrow> a div b ^ k mod b \<le> b - Suc 0
[PROOF STEP]
by fastforce


[STATEMENT]
lemma rat_floor_code [code]: "\<lfloor>p\<rfloor> = (let (a, b) = quotient_of p in a div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>p\<rfloor> = (let (a, b) = quotient_of p in a div b)
[PROOF STEP]
by (cases p) (simp add: quotient_of_Fract floor_Fract)


[STATEMENT]
lemma set_compre_subset: "B \<subseteq> A \<Longrightarrow> {x \<in> B. P x} \<subseteq> {x \<in> A. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> {x \<in> B. P x} \<subseteq> {x \<in> A. P x}
[PROOF STEP]
by blast


[STATEMENT]
lemma higher_plus: "higher (p + q) v = higher p v + higher q v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher (p + q) v = higher p v + higher q v
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_add lookup_higher)


[STATEMENT]
lemma unat_less_iff:
  "\<lbrakk> unat (a :: 'a :: len word) = b; c < 2 ^ LENGTH('a) \<rbrakk> \<Longrightarrow> (a < of_nat c) = (b < c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat a = b; c < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> (a < word_of_nat c) = (b < c)
[PROOF STEP]
using unat_ucast_less_no_overflow_simp
[PROOF STATE]
proof (prove)
using this:
?n < 2 ^ LENGTH(?'a) \<Longrightarrow> (unat ?f < ?n) = (?f < word_of_nat ?n)

goal (1 subgoal):
 1. \<lbrakk>unat a = b; c < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> (a < word_of_nat c) = (b < c)
[PROOF STEP]
by blast


[STATEMENT]
lemma mat_rows_hom_lim_distinct_iff:
  assumes "elements_mat M \<subseteq> A"
  shows "distinct (rows M) \<longleftrightarrow> distinct (map (map_vec f) (rows M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (rows M) = distinct (map (map_vec f) (rows M))
[PROOF STEP]
apply (intro vec_hom_lim_set_distinct_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. v \<in> set (rows M) \<Longrightarrow> set\<^sub>v v \<subseteq> A
[PROOF STEP]
using setv_row_subset_mat_elems assms
[PROOF STATE]
proof (prove)
using this:
?v \<in> set (rows ?M) \<Longrightarrow> set\<^sub>v ?v \<subseteq> elements_mat ?M
elements_mat M \<subseteq> A

goal (1 subgoal):
 1. \<And>v. v \<in> set (rows M) \<Longrightarrow> set\<^sub>v v \<subseteq> A
[PROOF STEP]
by blast


[STATEMENT]
lemma varsL_substL:
"varsL (substL \<pi> l) = (\<Union> x \<in> varsL l. vars (\<pi> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. varsL (substL \<pi> l) = (\<Union>x\<in>varsL l. vars (\<pi> x))
[PROOF STEP]
using varsA_substA[of \<pi>]
[PROOF STATE]
proof (prove)
using this:
varsA (substA \<pi> ?at) = (\<Union>x\<in>varsA ?at. vars (\<pi> x))

goal (1 subgoal):
 1. varsL (substL \<pi> l) = (\<Union>x\<in>varsL l. vars (\<pi> x))
[PROOF STEP]
by (cases l, auto)


[STATEMENT]
lemma "VARS x y z w h
 {(x \<mapsto> y ** z \<mapsto> w) h}
 SKIP
 {x \<noteq> z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x \<mapsto> y \<and>* z \<mapsto> w) h}
SKIP
{x \<noteq> z}
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z w h. (x \<mapsto> y \<and>* z \<mapsto> w) h \<Longrightarrow> x \<noteq> z
[PROOF STEP]
apply(auto elim!: sep_conjE simp: maps_to_def sep_disj_fun_def domain_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma three_div_two [simp]:
  shows "3 div Suc (Suc 0) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 div Suc (Suc 0) = 1
[PROOF STEP]
by (simp add: numeral_3_eq_3)


[STATEMENT]
lemma adj_prop:
  fixes f :: "'a::preorder \<Rightarrow>'a"
  shows "f \<stileturn> g \<Longrightarrow> f \<circ> g \<le> g \<circ> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> g \<Longrightarrow> f \<circ> g \<le> g \<circ> f
[PROOF STEP]
using adj_cancel1 adj_cancel2 order_trans
[PROOF STATE]
proof (prove)
using this:
?f \<stileturn> ?g \<Longrightarrow> ?f \<circ> ?g \<le> id
?f \<stileturn> ?g \<Longrightarrow> id \<le> ?g \<circ> ?f
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. f \<stileturn> g \<Longrightarrow> f \<circ> g \<le> g \<circ> f
[PROOF STEP]
by blast


[STATEMENT]
lemma kat_prop: "d x \<cdot> y \<le> y \<cdot> d z \<longleftrightarrow> d x \<cdot> y \<cdot> ad z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d x \<cdot> y \<le> y \<cdot> d z) = (d x \<cdot> y \<cdot> ad z = (0::'a))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d x \<cdot> y \<le> y \<cdot> d z \<Longrightarrow> d x \<cdot> y \<cdot> ad z = (0::'a)
 2. d x \<cdot> y \<cdot> ad z = (0::'a) \<Longrightarrow> d x \<cdot> y \<le> y \<cdot> d z
[PROOF STEP]
show  "d x \<cdot> y \<le> y \<cdot> d z \<Longrightarrow> d x \<cdot> y \<cdot> ad z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x \<cdot> y \<le> y \<cdot> d z \<Longrightarrow> d x \<cdot> y \<cdot> ad z = (0::'a)
[PROOF STEP]
by (metis add_commute dom_op_def add_zerol annir as1 less_eq_def mult_isor mult_assoc)
[PROOF STATE]
proof (state)
this:
d x \<cdot> y \<le> y \<cdot> d z \<Longrightarrow> d x \<cdot> y \<cdot> ad z = (0::'a)

goal (1 subgoal):
 1. d x \<cdot> y \<cdot> ad z = (0::'a) \<Longrightarrow> d x \<cdot> y \<le> y \<cdot> d z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d x \<cdot> y \<cdot> ad z = (0::'a) \<Longrightarrow> d x \<cdot> y \<le> y \<cdot> d z
[PROOF STEP]
assume h: "d x \<cdot> y \<cdot> ad z = 0"
[PROOF STATE]
proof (state)
this:
d x \<cdot> y \<cdot> ad z = (0::'a)

goal (1 subgoal):
 1. d x \<cdot> y \<cdot> ad z = (0::'a) \<Longrightarrow> d x \<cdot> y \<le> y \<cdot> d z
[PROOF STEP]
hence "d x \<cdot> y = d x \<cdot> y \<cdot> d z + d x \<cdot> y \<cdot> ad z"
[PROOF STATE]
proof (prove)
using this:
d x \<cdot> y \<cdot> ad z = (0::'a)

goal (1 subgoal):
 1. d x \<cdot> y = d x \<cdot> y \<cdot> d z + d x \<cdot> y \<cdot> ad z
[PROOF STEP]
by (metis dom_op_def as3 distrib_left mult_1_right)
[PROOF STATE]
proof (state)
this:
d x \<cdot> y = d x \<cdot> y \<cdot> d z + d x \<cdot> y \<cdot> ad z

goal (1 subgoal):
 1. d x \<cdot> y \<cdot> ad z = (0::'a) \<Longrightarrow> d x \<cdot> y \<le> y \<cdot> d z
[PROOF STEP]
thus  "d x \<cdot> y \<le> y \<cdot> d z"
[PROOF STATE]
proof (prove)
using this:
d x \<cdot> y = d x \<cdot> y \<cdot> d z + d x \<cdot> y \<cdot> ad z

goal (1 subgoal):
 1. d x \<cdot> y \<le> y \<cdot> d z
[PROOF STEP]
by (metis a_subid_aux add_commute dom_op_def h add_zerol mult_assoc)
[PROOF STATE]
proof (state)
this:
d x \<cdot> y \<le> y \<cdot> d z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_field_derivative_stirling_integral_complex:
  fixes x :: complex
  assumes "x \<notin> \<real>\<^sub>\<le>\<^sub>0" "n > 0"
  shows   "(stirling_integral n has_field_derivative deriv (stirling_integral n) x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (stirling_integral n has_field_derivative deriv (stirling_integral n) x) (at x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<real>\<^sub>\<le>\<^sub>0
0 < n

goal (1 subgoal):
 1. (stirling_integral n has_field_derivative deriv (stirling_integral n) x) (at x)
[PROOF STEP]
by (intro holomorphic_derivI[OF stirling_integral_holomorphic, of n  "-\<real>\<^sub>\<le>\<^sub>0"]) auto


[STATEMENT]
lemma add_order_relator: "add_order (a+^(add_order a)) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_order (a +^ add_order a) = 1
[PROOF STEP]
using add_order
[PROOF STATE]
proof (prove)
using this:
?a +^ add_order ?a = (0::'a)

goal (1 subgoal):
 1. add_order (a +^ add_order a) = 1
[PROOF STEP]
by (auto intro: add_order_equality)


[STATEMENT]
theorem c_hj_IKKBZ: "left_deep t \<Longrightarrow> c_hj cf f t = c_IKKBZ (\<lambda>_ _. 1.2) cf f t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_deep t \<Longrightarrow> c_hj cf f t = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f t
[PROOF STEP]
proof(induction t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. left_deep (Relation x) \<Longrightarrow> c_hj cf f (Relation x) = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>left_deep t1 \<Longrightarrow> c_hj cf f t1 = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f t1; left_deep t2 \<Longrightarrow> c_hj cf f t2 = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f t2; left_deep (Join t1 t2)\<rbrakk> \<Longrightarrow> c_hj cf f (Join t1 t2) = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f (Join t1 t2)
[PROOF STEP]
case ind: (Join l r)
[PROOF STATE]
proof (state)
this:
left_deep l \<Longrightarrow> c_hj cf f l = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f l
left_deep r \<Longrightarrow> c_hj cf f r = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f r
left_deep (Join l r)

goal (2 subgoals):
 1. \<And>x. left_deep (Relation x) \<Longrightarrow> c_hj cf f (Relation x) = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>left_deep t1 \<Longrightarrow> c_hj cf f t1 = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f t1; left_deep t2 \<Longrightarrow> c_hj cf f t2 = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f t2; left_deep (Join t1 t2)\<rbrakk> \<Longrightarrow> c_hj cf f (Join t1 t2) = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f (Join t1 t2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
left_deep l \<Longrightarrow> c_hj cf f l = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f l
left_deep r \<Longrightarrow> c_hj cf f r = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f r
left_deep (Join l r)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
left_deep l \<Longrightarrow> c_hj cf f l = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f l
left_deep r \<Longrightarrow> c_hj cf f r = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f r
left_deep (Join l r)

goal (1 subgoal):
 1. c_hj cf f (Join l r) = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f (Join l r)
[PROOF STEP]
by(cases r) auto
[PROOF STATE]
proof (state)
this:
c_hj cf f (Join l r) = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f (Join l r)

goal (1 subgoal):
 1. \<And>x. left_deep (Relation x) \<Longrightarrow> c_hj cf f (Relation x) = c_IKKBZ (\<lambda>_ _. 12 / 10) cf f (Relation x)
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma case_pl_inf[case_names NegAny AnyNeg PosPos PosNum NumPos NumNum]:
  shows
  "\<And>w1 w2 P.
      (w1 = NEG_INF \<Longrightarrow> P w1 w2)
  \<Longrightarrow> (w2 = NEG_INF \<Longrightarrow> P w1 w2)
  \<Longrightarrow> (w1 = POS_INF \<Longrightarrow> w2 = POS_INF \<Longrightarrow> P w1 w2)
  \<Longrightarrow> (w1 = POS_INF \<Longrightarrow> w2 \<noteq> POS_INF \<Longrightarrow> w2 \<noteq> NEG_INF \<Longrightarrow> P w1 w2)
  \<Longrightarrow> (w1 \<noteq> POS_INF \<Longrightarrow> w1 \<noteq> NEG_INF \<Longrightarrow> w2 = POS_INF \<Longrightarrow> P w1 w2)
  \<Longrightarrow> (w1 \<noteq> POS_INF \<Longrightarrow> w1 \<noteq> NEG_INF \<Longrightarrow> w2 \<noteq> POS_INF \<Longrightarrow> w2 \<noteq> NEG_INF \<Longrightarrow> P w1 w2)
  \<Longrightarrow> P w1 w2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w1 w2 P. \<lbrakk>w1 = NEG_INF \<Longrightarrow> P w1 w2; w2 = NEG_INF \<Longrightarrow> P w1 w2; \<lbrakk>w1 = POS_INF; w2 = POS_INF\<rbrakk> \<Longrightarrow> P w1 w2; \<lbrakk>w1 = POS_INF; w2 \<noteq> POS_INF; w2 \<noteq> NEG_INF\<rbrakk> \<Longrightarrow> P w1 w2; \<lbrakk>w1 \<noteq> POS_INF; w1 \<noteq> NEG_INF; w2 = POS_INF\<rbrakk> \<Longrightarrow> P w1 w2; \<lbrakk>w1 \<noteq> POS_INF; w1 \<noteq> NEG_INF; w2 \<noteq> POS_INF; w2 \<noteq> NEG_INF\<rbrakk> \<Longrightarrow> P w1 w2\<rbrakk> \<Longrightarrow> P w1 w2
[PROOF STEP]
by(auto)


[STATEMENT]
lemma USUP_mem_UNIV [simp]: "(\<Squnion> x\<in>UNIV \<bullet> P(x)) = (\<Squnion> x \<bullet> P(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion> x \<in> UNIV \<bullet> P x) = (\<Squnion> x \<bullet> P x)
[PROOF STEP]
by (pred_auto)


[STATEMENT]
lemma monoms_of_const:
"monomials_of R (indexed_const k) = (if k = \<zero> then {} else {{#}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomials_of R (indexed_const k) = (if k = \<zero> then {} else {{#}})
[PROOF STEP]
unfolding indexed_const_def monomials_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m. (if m = {#} then k else \<zero>) \<noteq> \<zero>} = (if k = \<zero> then {} else {{#}})
[PROOF STEP]
by auto


[STATEMENT]
lemma contractible_UNIV [simp]: "contractible (UNIV :: 'a::real_normed_vector set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contractible UNIV
[PROOF STEP]
by (simp add: starlike_imp_contractible)


[STATEMENT]
lemma matchrel_sound:
  assumes "((P, Map.empty), ({#}, \<sigma>)) \<in> matchrel\<^sup>*"
  shows "subst_of_map d \<sigma> \<in> matchers (set_mset P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_of_map d \<sigma> \<in> matchers (set_mset P)
[PROOF STEP]
using matchrel_rtrancl_matchers [OF assms]
[PROOF STATE]
proof (prove)
using this:
matchers_map (snd (P, Map.empty)) \<inter> matchers (set_mset (fst (P, Map.empty))) = matchers_map (snd ({#}, \<sigma>)) \<inter> matchers (set_mset (fst ({#}, \<sigma>)))

goal (1 subgoal):
 1. subst_of_map d \<sigma> \<in> matchers (set_mset P)
[PROOF STEP]
by simp


[STATEMENT]
lemma conjl1_sup: "z \<lhd> (x \<squnion> y) = (z \<lhd> x) \<squnion> (z \<lhd> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<lhd> x \<squnion> y = (z \<lhd> x) \<squnion> (z \<lhd> y)
[PROOF STEP]
by (metis conjugate_l_def compl_inf resl_distr)


[STATEMENT]
lemma Collect_Int_Times: "{(x, y). R x y} \<inter> A \<times> B = {(x, y). R x y \<and> x \<in> A \<and> y \<in> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). R x y} \<inter> A \<times> B = {(x, y). R x y \<and> x \<in> A \<and> y \<in> B}
[PROOF STEP]
by auto


[STATEMENT]
lemma pcompose_coeff_0:
  "coeff (pcompose p q) 0 = poly p (coeff q 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p q) 0 = poly p (coeff q 0)
[PROOF STEP]
apply (induct p)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. coeff (0 \<circ>\<^sub>p q) 0 = poly 0 (coeff q 0)
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; coeff (p \<circ>\<^sub>p q) 0 = poly p (coeff q 0)\<rbrakk> \<Longrightarrow> coeff (pCons a p \<circ>\<^sub>p q) 0 = poly (pCons a p) (coeff q 0)
[PROOF STEP]
by (auto simp add:pcompose_pCons coeff_mult)


[STATEMENT]
lemma nonpos_Ints_mult: "x \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> y \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> x * y \<in> \<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<int>\<^sub>\<le>\<^sub>0; y \<in> \<int>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> x * y \<in> \<nat>
[PROOF STEP]
using Nats_mult[of "-x" "-y"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- x \<in> \<nat>; - y \<in> \<nat>\<rbrakk> \<Longrightarrow> - x * - y \<in> \<nat>

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<int>\<^sub>\<le>\<^sub>0; y \<in> \<int>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> x * y \<in> \<nat>
[PROOF STEP]
by (simp add: uminus_in_Nats_iff)


[STATEMENT]
lemma nvalids_SucD: "Ball A (nvalid (Suc n)) \<Longrightarrow>  Ball A (nvalid n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball A (nvalid (Suc n)) \<Longrightarrow> Ball A (nvalid n)
[PROOF STEP]
by (fast intro: nvalid_SucD)


[STATEMENT]
lemma nonneg_dirichlet_series_const [simp,intro]:
  "c \<in> \<real>\<^sub>\<ge>\<^sub>0 \<Longrightarrow> nonneg_dirichlet_series (fds_const c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> \<real>\<^sub>\<ge>\<^sub>0 \<Longrightarrow> nonneg_dirichlet_series (fds_const c)
[PROOF STEP]
by standard (auto simp: fds_const_def)


[STATEMENT]
lemma assumes f: "f \<in> rv M" and g: "g \<in> rv M"
  shows f_eq_g_measurable: "{w. f w = g w} \<in> measurable_sets M" (*<*)(is "?a \<in> ?M")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
from g
[PROOF STATE]
proof (chain)
picking this:
g \<in> rv M
[PROOF STEP]
have ms: "measure_space M"
[PROOF STATE]
proof (prove)
using this:
g \<in> rv M

goal (1 subgoal):
 1. measure_space M
[PROOF STEP]
by (simp add: rv_def)
[PROOF STATE]
proof (state)
this:
measure_space M

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
hence "sigma_algebra ?M"
[PROOF STATE]
proof (prove)
using this:
measure_space M

goal (1 subgoal):
 1. sigma_algebra (measurable_sets M)
[PROOF STEP]
by (simp only: measure_space_def)
[PROOF STATE]
proof (state)
this:
sigma_algebra (measurable_sets M)

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sigma_algebra (measurable_sets M)

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
from f g ms
[PROOF STATE]
proof (chain)
picking this:
f \<in> rv M
g \<in> rv M
measure_space M
[PROOF STEP]
have "{w. f w \<le> g w} \<in> ?M" and "{w. g w \<le> f w} \<in> ?M"
[PROOF STATE]
proof (prove)
using this:
f \<in> rv M
g \<in> rv M
measure_space M

goal (1 subgoal):
 1. {w. f w \<le> g w} \<in> measurable_sets M &&& {w. g w \<le> f w} \<in> measurable_sets M
[PROOF STEP]
by (auto simp only: rv_le_rv_measurable)
[PROOF STATE]
proof (state)
this:
{w. f w \<le> g w} \<in> measurable_sets M
{w. g w \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sigma_algebra (measurable_sets M)
{w. f w \<le> g w} \<in> measurable_sets M
{w. g w \<le> f w} \<in> measurable_sets M
[PROOF STEP]
have "{w. f w \<le> g w} \<inter> {w. g w \<le> f w} \<in> ?M" (is "?b \<in> ?M")
[PROOF STATE]
proof (prove)
using this:
sigma_algebra (measurable_sets M)
{w. f w \<le> g w} \<in> measurable_sets M
{w. g w \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. {w. f w \<le> g w} \<inter> {w. g w \<le> f w} \<in> measurable_sets M
[PROOF STEP]
by (rule sigma_algebra_inter)
[PROOF STATE]
proof (state)
this:
{w. f w \<le> g w} \<inter> {w. g w \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{w. f w \<le> g w} \<inter> {w. g w \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
have "?b = ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w. f w \<le> g w} \<inter> {w. g w \<le> f w} = {w. f w = g w}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{w. f w \<le> g w} \<inter> {w. g w \<le> f w} = {w. f w = g w}

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{w. f w = g w} \<in> measurable_sets M

goal (1 subgoal):
 1. {w. f w = g w} \<in> measurable_sets M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{w. f w = g w} \<in> measurable_sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma empty_is_zero: "nat_to_set u = {} \<Longrightarrow> u = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set u = {} \<Longrightarrow> u = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>nat_to_set u = {}; u \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume A1: "nat_to_set u = {}"
[PROOF STATE]
proof (state)
this:
nat_to_set u = {}

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u = {}; u \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume A2: "u \<noteq> 0"
[PROOF STATE]
proof (state)
this:
u \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u = {}; u \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<noteq> 0
[PROOF STEP]
have S1: "u > 0"
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0

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

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u = {}; u \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
0 < u
[PROOF STEP]
have "nat_to_set u \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. nat_to_set u \<noteq> {}
[PROOF STEP]
by (rule pos_imp_ne)
[PROOF STATE]
proof (state)
this:
nat_to_set u \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u = {}; u \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = {}
nat_to_set u \<noteq> {}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = {}
nat_to_set u \<noteq> {}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma analz_insert_Nonce [simp]:
     "analz (insert (Nonce N) H) = insert (Nonce N) (analz H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (insert (Nonce N) H) = insert (Nonce N) (analz H)
[PROOF STEP]
apply (rule analz_insert_eq_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert (Nonce N) H) \<Longrightarrow> x \<in> insert (Nonce N) (analz H)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma residual_eq2: "residuated f \<Longrightarrow> f x = \<Sqinter> {y. x \<le> residual f y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated f \<Longrightarrow> f x = \<Sqinter> {y. x \<le> residual f y}
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. residuated f \<Longrightarrow> f x \<le> \<Sqinter> {y. x \<le> residual f y}
 2. residuated f \<Longrightarrow> \<Sqinter> {y. x \<le> residual f y} \<le> f x
[PROOF STEP]
assume assm: "residuated f"
[PROOF STATE]
proof (state)
this:
residuated f

goal (2 subgoals):
 1. residuated f \<Longrightarrow> f x \<le> \<Sqinter> {y. x \<le> residual f y}
 2. residuated f \<Longrightarrow> \<Sqinter> {y. x \<le> residual f y} \<le> f x
[PROOF STEP]
thus "f x \<le> \<Sqinter>{y. x \<le> residual f y}"
[PROOF STATE]
proof (prove)
using this:
residuated f

goal (1 subgoal):
 1. f x \<le> \<Sqinter> {y. x \<le> residual f y}
[PROOF STEP]
by (auto intro: Inf_greatest residual_galoisI2)
[PROOF STATE]
proof (state)
this:
f x \<le> \<Sqinter> {y. x \<le> residual f y}

goal (1 subgoal):
 1. residuated f \<Longrightarrow> \<Sqinter> {y. x \<le> residual f y} \<le> f x
[PROOF STEP]
show "\<Sqinter>{y. x \<le> residual f y} \<le> f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {y. x \<le> residual f y} \<le> f x
[PROOF STEP]
using assm
[PROOF STATE]
proof (prove)
using this:
residuated f

goal (1 subgoal):
 1. \<Sqinter> {y. x \<le> residual f y} \<le> f x
[PROOF STEP]
by (auto simp: res_c1 intro!: Inf_lower)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {y. x \<le> residual f y} \<le> f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_mapping_eq_zeroI:
  assumes "keys s = {}"
  shows "s = (0::('a, 'b::zero) poly_mapping)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = 0
[PROOF STEP]
proof (rule poly_mapping_eqI, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. lookup s k = (0::'b)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. lookup s k = (0::'b)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
keys s = {}
[PROOF STEP]
show "lookup s x = 0"
[PROOF STATE]
proof (prove)
using this:
keys s = {}

goal (1 subgoal):
 1. lookup s x = (0::'b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lookup s x = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coprime_mult_right_iff [simp]:
  "coprime c (a * b) \<longleftrightarrow> coprime c a \<and> coprime c b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime c (a * b) = (coprime c a \<and> coprime c b)
[PROOF STEP]
using coprime_mult_left_iff [of a b c]
[PROOF STATE]
proof (prove)
using this:
coprime (a * b) c = (coprime a c \<and> coprime b c)

goal (1 subgoal):
 1. coprime c (a * b) = (coprime c a \<and> coprime c b)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma pderiv_coeff:
  assumes "subring K R"
  assumes "f \<in> carrier (K[X])"
  shows "coeff (pderiv f) k = int_embed R (Suc k) \<otimes> coeff f (Suc k)"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
proof (cases "k + 1  < length f")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k + 1 < length f

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
define j where "j = length f - k - 2"
[PROOF STATE]
proof (state)
this:
j = length f - k - 2

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
define d where
    "d = map (\<lambda>i. int_embed R i \<otimes> coeff f i) (rev [1..<length f])"
[PROOF STATE]
proof (state)
this:
d = map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f])

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have a: "j+1 < length f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j + 1 < length f
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
k + 1 < length f

goal (1 subgoal):
 1. j + 1 < length f
[PROOF STEP]
unfolding j_def
[PROOF STATE]
proof (prove)
using this:
k + 1 < length f

goal (1 subgoal):
 1. length f - k - 2 + 1 < length f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
j + 1 < length f

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
hence b: "j < length [1..<length f]"
[PROOF STATE]
proof (prove)
using this:
j + 1 < length f

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

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have c: "k < length d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < length d
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < length (map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f]))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
k + 1 < length f

goal (1 subgoal):
 1. k < length (map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k < length d

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have d: "degree d - k = j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree d - k = j
[PROOF STEP]
unfolding d_def j_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f])) - k = length f - k - 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree d - k = j

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have e: "rev [Suc 0..<length f] ! j = length f - 1 - j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev [Suc 0..<length f] ! j = degree f - j
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
j < length [1..<length f]

goal (1 subgoal):
 1. rev [Suc 0..<length f] ! j = degree f - j
[PROOF STEP]
by (subst rev_nth, auto)
[PROOF STATE]
proof (state)
this:
rev [Suc 0..<length f] ! j = degree f - j

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have f: "length f - j - 1 = k+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length f - j - 1 = k + 1
[PROOF STEP]
unfolding j_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length f - (length f - k - 2) - 1 = k + 1
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
k + 1 < length f

goal (1 subgoal):
 1. length f - (length f - k - 2) - 1 = k + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length f - j - 1 = k + 1

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have "coeff (pderiv f ) k = coeff (normalize d) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (pderiv f) k = local.coeff (local.normalize d) k
[PROOF STEP]
unfolding pderiv_def d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (local.normalize (map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f]))) k = local.coeff (local.normalize (map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f]))) k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.coeff (pderiv f) k = local.coeff (local.normalize d) k

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.coeff (pderiv f) k = local.coeff (local.normalize d) k

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have "... = coeff d k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (local.normalize d) k = local.coeff d k
[PROOF STEP]
using normalize_coeff
[PROOF STATE]
proof (prove)
using this:
local.coeff ?p = local.coeff (local.normalize ?p)

goal (1 subgoal):
 1. local.coeff (local.normalize d) k = local.coeff d k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.coeff (local.normalize d) k = local.coeff d k

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.coeff (local.normalize d) k = local.coeff d k

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have "... = d ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff d k = d ! j
[PROOF STEP]
using c d
[PROOF STATE]
proof (prove)
using this:
k < length d
degree d - k = j

goal (1 subgoal):
 1. local.coeff d k = d ! j
[PROOF STEP]
by (subst coeff_nth, auto)
[PROOF STATE]
proof (state)
this:
local.coeff d k = d ! j

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.coeff d k = d ! j

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have
    "... = int_embed R (length f - j - 1) \<otimes> coeff f (length f - j - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d ! j = int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1)
[PROOF STEP]
using b e
[PROOF STATE]
proof (prove)
using this:
j < length [1..<length f]
rev [Suc 0..<length f] ! j = degree f - j

goal (1 subgoal):
 1. d ! j = int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1)
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
using this:
j < length [1..<length f]
rev [Suc 0..<length f] ! j = degree f - j

goal (1 subgoal):
 1. map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f]) ! j = int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d ! j = int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1)

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d ! j = int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1)

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1) = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
length f - j - 1 = k + 1

goal (1 subgoal):
 1. int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1) = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int_embed R (int (length f - j - 1)) \<otimes> local.coeff f (length f - j - 1) = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)

goal (2 subgoals):
 1. k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
 2. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)

goal (1 subgoal):
 1. local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)

goal (1 subgoal):
 1. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k + 1 < length f

goal (1 subgoal):
 1. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
hence "Suc k \<ge> length f"
[PROOF STATE]
proof (prove)
using this:
\<not> k + 1 < length f

goal (1 subgoal):
 1. length f \<le> Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length f \<le> Suc k

goal (1 subgoal):
 1. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
hence a:"coeff f (Suc k) = \<zero>"
[PROOF STATE]
proof (prove)
using this:
length f \<le> Suc k

goal (1 subgoal):
 1. local.coeff f (Suc k) = \<zero>
[PROOF STEP]
using coeff_img
[PROOF STATE]
proof (prove)
using this:
length f \<le> Suc k
local.coeff ?p ` {..<length ?p} = set ?p
local.coeff ?p ` {length ?p..} = {\<zero>}
range (local.coeff ?p) = set ?p \<union> {\<zero>}

goal (1 subgoal):
 1. local.coeff f (Suc k) = \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
local.coeff f (Suc k) = \<zero>

goal (1 subgoal):
 1. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
have b:"coeff (pderiv f) k = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (pderiv f) k = \<zero>
[PROOF STEP]
unfolding pderiv_def normalize_coeff[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f])) k = \<zero>
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> k + 1 < length f

goal (1 subgoal):
 1. local.coeff (map (\<lambda>i. int_embed R (int i) \<otimes> local.coeff f i) (rev [1..<length f])) k = \<zero>
[PROOF STEP]
by (intro coeff_length, simp)
[PROOF STATE]
proof (state)
this:
local.coeff (pderiv f) k = \<zero>

goal (1 subgoal):
 1. \<not> k + 1 < length f \<Longrightarrow> local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
using int_embed_range[OF carrier_is_subring]
[PROOF STATE]
proof (prove)
using this:
int_embed R ?k \<in> carrier R

goal (1 subgoal):
 1. local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)
[PROOF STEP]
by (simp add:a b)
[PROOF STATE]
proof (state)
this:
local.coeff (pderiv f) k = int_embed R (int (Suc k)) \<otimes> local.coeff f (Suc k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem geq_noPH_confIDs:
assumes a: "reach s"
shows "phase s confID > noPH \<longrightarrow> confID \<in>\<in> confIDs s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. noPH < phase s confID \<longrightarrow> confID \<in>\<in> confIDs s
[PROOF STEP]
using geq_noPH_confIDs1[OF a]
[PROOF STATE]
proof (prove)
using this:
geq_noPH_confIDs s

goal (1 subgoal):
 1. noPH < phase s confID \<longrightarrow> confID \<in>\<in> confIDs s
[PROOF STEP]
unfolding geq_noPH_confIDs_def
[PROOF STATE]
proof (prove)
using this:
\<forall>confID. noPH < phase s confID \<longrightarrow> confID \<in>\<in> confIDs s

goal (1 subgoal):
 1. noPH < phase s confID \<longrightarrow> confID \<in>\<in> confIDs s
[PROOF STEP]
by auto


[STATEMENT]
lemma binop_G_comp_binop_\<ii>G: "g\<in>G \<Longrightarrow> x\<in>G \<Longrightarrow> binop g (binop (\<ii> g) x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<in> G; x \<in> G\<rbrakk> \<Longrightarrow> binop g (binop (\<ii> g) x) = x
[PROOF STEP]
using the_inverseD(1) assoc[of g "\<ii> g" x]
[PROOF STATE]
proof (prove)
using this:
?g \<in> G \<Longrightarrow> \<ii> ?g \<in> G
\<lbrakk>g \<in> G; \<ii> g \<in> G; x \<in> G\<rbrakk> \<Longrightarrow> binop (binop g (\<ii> g)) x = binop g (binop (\<ii> g) x)

goal (1 subgoal):
 1. \<lbrakk>g \<in> G; x \<in> G\<rbrakk> \<Longrightarrow> binop g (binop (\<ii> g) x) = x
[PROOF STEP]
by (simp add: identity(3) the_inverseD(2))