[STATEMENT]
lemma convex_rel_open_finite_inter:
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set) \<and> rel_open S"
    and "finite I"
  shows "convex (\<Inter>I) \<and> rel_open (\<Inter>I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
proof (cases "\<Inter>{rel_interior S |S. S \<in> I} = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<Inter> {rel_interior S |S. S \<in> I} = {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
 2. \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<Inter> {rel_interior S |S. S \<in> I} = {}

goal (2 subgoals):
 1. \<Inter> {rel_interior S |S. S \<in> I} = {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
 2. \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Inter> {rel_interior S |S. S \<in> I} = {}
[PROOF STEP]
have "\<Inter>I = {}"
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> I} = {}

goal (1 subgoal):
 1. \<Inter> I = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> I} = {}
\<forall>S\<in>I. convex S \<and> rel_open S
finite I

goal (1 subgoal):
 1. \<Inter> I = {}
[PROOF STEP]
unfolding rel_open_def
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> I} = {}
\<forall>S\<in>I. convex S \<and> rel_interior S = S
finite I

goal (1 subgoal):
 1. \<Inter> I = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Inter> I = {}

goal (2 subgoals):
 1. \<Inter> {rel_interior S |S. S \<in> I} = {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
 2. \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Inter> I = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Inter> I = {}

goal (1 subgoal):
 1. convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
unfolding rel_open_def
[PROOF STATE]
proof (prove)
using this:
\<Inter> I = {}

goal (1 subgoal):
 1. convex (\<Inter> I) \<and> rel_interior (\<Inter> I) = \<Inter> I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
convex (\<Inter> I) \<and> rel_open (\<Inter> I)

goal (1 subgoal):
 1. \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}

goal (1 subgoal):
 1. \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}
[PROOF STEP]
have "rel_open (\<Inter>I)"
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}

goal (1 subgoal):
 1. rel_open (\<Inter> I)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}
\<forall>S\<in>I. convex S \<and> rel_open S
finite I

goal (1 subgoal):
 1. rel_open (\<Inter> I)
[PROOF STEP]
unfolding rel_open_def
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}
\<forall>S\<in>I. convex S \<and> rel_interior S = S
finite I

goal (1 subgoal):
 1. rel_interior (\<Inter> I) = \<Inter> I
[PROOF STEP]
using convex_rel_interior_finite_inter[of I]
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}
\<forall>S\<in>I. convex S \<and> rel_interior S = S
finite I
\<lbrakk>\<forall>S\<in>I. convex S; \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}; finite I\<rbrakk> \<Longrightarrow> rel_interior (\<Inter> I) = \<Inter> {rel_interior S |S. S \<in> I}

goal (1 subgoal):
 1. rel_interior (\<Inter> I) = \<Inter> I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_open (\<Inter> I)

goal (1 subgoal):
 1. \<Inter> {rel_interior S |S. S \<in> I} \<noteq> {} \<Longrightarrow> convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_open (\<Inter> I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel_open (\<Inter> I)

goal (1 subgoal):
 1. convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
using convex_Inter assms
[PROOF STATE]
proof (prove)
using this:
rel_open (\<Inter> I)
(\<And>s. s \<in> ?f \<Longrightarrow> convex s) \<Longrightarrow> convex (\<Inter> ?f)
\<forall>S\<in>I. convex S \<and> rel_open S
finite I

goal (1 subgoal):
 1. convex (\<Inter> I) \<and> rel_open (\<Inter> I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
convex (\<Inter> I) \<and> rel_open (\<Inter> I)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polys_to_mat_index:
  assumes "i < length ps" and "j < length ts"
  shows "(polys_to_mat ts ps) $$ (i, j) = lookup (ps ! i) (ts ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polys_to_mat ts ps $$ (i, j) = lookup (ps ! i) (ts ! j)
[PROOF STEP]
by (simp add: polys_to_mat_def index_mat(1)[OF assms] mat_of_rows_def nth_map[OF assms(1)],
      rule poly_to_row_index, fact)


[STATEMENT]
lemma generate_valid_topology_mono_models:
      "edges (generate_valid_topology (m#M) \<lparr> nodes = V, edges = E \<rparr>) \<subseteq> edges (generate_valid_topology M \<lparr> nodes = V, edges = E \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges (generate_valid_topology (m # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology M \<lparr>nodes = V, edges = E\<rparr>)
[PROOF STEP]
proof(induction M arbitrary: E m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>E m. edges (generate_valid_topology [m] \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology [] \<lparr>nodes = V, edges = E\<rparr>)
 2. \<And>a M E m. (\<And>E m. edges (generate_valid_topology (m # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology M \<lparr>nodes = V, edges = E\<rparr>)) \<Longrightarrow> edges (generate_valid_topology (m # a # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology (a # M) \<lparr>nodes = V, edges = E\<rparr>)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>E m. edges (generate_valid_topology [m] \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology [] \<lparr>nodes = V, edges = E\<rparr>)
 2. \<And>a M E m. (\<And>E m. edges (generate_valid_topology (m # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology M \<lparr>nodes = V, edges = E\<rparr>)) \<Longrightarrow> edges (generate_valid_topology (m # a # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology (a # M) \<lparr>nodes = V, edges = E\<rparr>)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges (generate_valid_topology [m] \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology [] \<lparr>nodes = V, edges = E\<rparr>)
[PROOF STEP]
by(simp add: delete_edges_simp2)
[PROOF STATE]
proof (state)
this:
edges (generate_valid_topology [m] \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology [] \<lparr>nodes = V, edges = E\<rparr>)

goal (1 subgoal):
 1. \<And>a M E m. (\<And>E m. edges (generate_valid_topology (m # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology M \<lparr>nodes = V, edges = E\<rparr>)) \<Longrightarrow> edges (generate_valid_topology (m # a # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology (a # M) \<lparr>nodes = V, edges = E\<rparr>)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
edges (generate_valid_topology (?m # M_) \<lparr>nodes = V, edges = ?E\<rparr>) \<subseteq> edges (generate_valid_topology M_ \<lparr>nodes = V, edges = ?E\<rparr>)

goal (1 subgoal):
 1. \<And>a M E m. (\<And>E m. edges (generate_valid_topology (m # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology M \<lparr>nodes = V, edges = E\<rparr>)) \<Longrightarrow> edges (generate_valid_topology (m # a # M) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology (a # M) \<lparr>nodes = V, edges = E\<rparr>)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
edges (generate_valid_topology (?m # M_) \<lparr>nodes = V, edges = ?E\<rparr>) \<subseteq> edges (generate_valid_topology M_ \<lparr>nodes = V, edges = ?E\<rparr>)

goal (1 subgoal):
 1. edges (generate_valid_topology (m # a_ # M_) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology (a_ # M_) \<lparr>nodes = V, edges = E\<rparr>)
[PROOF STEP]
by(simp add: delete_edges_simp2)
[PROOF STATE]
proof (state)
this:
edges (generate_valid_topology (m # a_ # M_) \<lparr>nodes = V, edges = E\<rparr>) \<subseteq> edges (generate_valid_topology (a_ # M_) \<lparr>nodes = V, edges = E\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma theFT_Un_theNFT_One_Both[simp]:
assumes "length cl = length dl"
shows
"theFTOne cl dl \<union> theNFTBoth cl dl = {..< length cl}" and
"theNFTBoth cl dl \<union> theFTOne cl dl = {..< length cl}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. theFTOne cl dl \<union> theNFTBoth cl dl = {..<length cl} &&& theNFTBoth cl dl \<union> theFTOne cl dl = {..<length cl}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length cl = length dl

goal (1 subgoal):
 1. theFTOne cl dl \<union> theNFTBoth cl dl = {..<length cl} &&& theNFTBoth cl dl \<union> theFTOne cl dl = {..<length cl}
[PROOF STEP]
unfolding theFTOne_def theNFTBoth_def theFT_def theNFT_def
[PROOF STATE]
proof (prove)
using this:
length cl = length dl

goal (1 subgoal):
 1. {n. n < length cl \<and> finished (cl ! n)} \<union> {n. n < length dl \<and> finished (dl ! n)} \<union> {n. n < length cl \<and> \<not> finished (cl ! n)} \<inter> {n. n < length dl \<and> \<not> finished (dl ! n)} = {..<length cl} &&& {n. n < length cl \<and> \<not> finished (cl ! n)} \<inter> {n. n < length dl \<and> \<not> finished (dl ! n)} \<union> ({n. n < length cl \<and> finished (cl ! n)} \<union> {n. n < length dl \<and> finished (dl ! n)}) = {..<length cl}
[PROOF STEP]
by auto


[STATEMENT]
lemma [simp, code]: "mat_of_cblinfun pauliZ = matrix_pauliZ"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun pauliZ = matrix_pauliZ
[PROOF STEP]
apply (auto simp add: pauliZ_def matrix_pauliZ_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (cblinfun_of_mat (mat_of_rows_list 2 [[1, 0], [0, - 1]])) = mat_of_rows_list 2 [[1, 0], [0, - 1]]
[PROOF STEP]
apply (subst cblinfun_of_mat_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mat_of_rows_list 2 [[1, 0], [0, - 1]] \<in> carrier_mat (length canonical_basis) (length canonical_basis)
 2. mat_of_rows_list 2 [[1, 0], [0, - 1]] = mat_of_rows_list 2 [[1, 0], [0, - 1]]
[PROOF STEP]
by (auto)


[STATEMENT]
lemma (in \<Z>) vsnd_arrow_is_cat_Set_iso_arr'[cat_rel_par_Set_cs_intros]:
  assumes "a \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "AB = set {a} \<times>\<^sub>\<circ> B"
    and "A' = A"
    and "\<CC>' = cat_Set \<alpha>"
  shows "vsnd_arrow (set {a}) B : AB \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsnd_arrow (ZFC_in_HOL.set {a}) B : AB \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B
[PROOF STEP]
using assms(1-2)
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vsnd_arrow (ZFC_in_HOL.set {a}) B : AB \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B
[PROOF STEP]
unfolding assms(3-5)
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vsnd_arrow (ZFC_in_HOL.set {a}) B : ZFC_in_HOL.set {a} \<times>\<^sub>\<circ> B \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_Set \<alpha>\<^esub> B
[PROOF STEP]
by (rule vsnd_arrow_is_cat_Set_iso_arr)


[STATEMENT]
lemma disjoint_interval_cart:
  fixes a::"real^'n"
  shows "cbox a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i. (b$i < a$i \<or> d$i < c$i \<or> b$i < c$i \<or> d$i < a$i))" (is ?th1)
    and "cbox a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i. (b$i < a$i \<or> d$i \<le> c$i \<or> b$i \<le> c$i \<or> d$i \<le> a$i))" (is ?th2)
    and "box a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i. (b$i \<le> a$i \<or> d$i < c$i \<or> b$i \<le> c$i \<or> d$i \<le> a$i))" (is ?th3)
    and "box a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i. (b$i \<le> a$i \<or> d$i \<le> c$i \<or> b$i \<le> c$i \<or> d$i \<le> a$i))" (is ?th4)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((cbox a b \<inter> cbox c d = {}) = (\<exists>i. b $ i < a $ i \<or> d $ i < c $ i \<or> b $ i < c $ i \<or> d $ i < a $ i) &&& (cbox a b \<inter> box c d = {}) = (\<exists>i. b $ i < a $ i \<or> d $ i \<le> c $ i \<or> b $ i \<le> c $ i \<or> d $ i \<le> a $ i)) &&& (box a b \<inter> cbox c d = {}) = (\<exists>i. b $ i \<le> a $ i \<or> d $ i < c $ i \<or> b $ i \<le> c $ i \<or> d $ i \<le> a $ i) &&& (box a b \<inter> box c d = {}) = (\<exists>i. b $ i \<le> a $ i \<or> d $ i \<le> c $ i \<or> b $ i \<le> c $ i \<or> d $ i \<le> a $ i)
[PROOF STEP]
using disjoint_interval[of a b c d]
[PROOF STATE]
proof (prove)
using this:
(cbox a b \<inter> cbox c d = {}) = (\<exists>i\<in>Basis. b \<bullet> i < a \<bullet> i \<or> d \<bullet> i < c \<bullet> i \<or> b \<bullet> i < c \<bullet> i \<or> d \<bullet> i < a \<bullet> i)
(cbox a b \<inter> box c d = {}) = (\<exists>i\<in>Basis. b \<bullet> i < a \<bullet> i \<or> d \<bullet> i \<le> c \<bullet> i \<or> b \<bullet> i \<le> c \<bullet> i \<or> d \<bullet> i \<le> a \<bullet> i)
(box a b \<inter> cbox c d = {}) = (\<exists>i\<in>Basis. b \<bullet> i \<le> a \<bullet> i \<or> d \<bullet> i < c \<bullet> i \<or> b \<bullet> i \<le> c \<bullet> i \<or> d \<bullet> i \<le> a \<bullet> i)
(box a b \<inter> box c d = {}) = (\<exists>i\<in>Basis. b \<bullet> i \<le> a \<bullet> i \<or> d \<bullet> i \<le> c \<bullet> i \<or> b \<bullet> i \<le> c \<bullet> i \<or> d \<bullet> i \<le> a \<bullet> i)

goal (1 subgoal):
 1. ((cbox a b \<inter> cbox c d = {}) = (\<exists>i. b $ i < a $ i \<or> d $ i < c $ i \<or> b $ i < c $ i \<or> d $ i < a $ i) &&& (cbox a b \<inter> box c d = {}) = (\<exists>i. b $ i < a $ i \<or> d $ i \<le> c $ i \<or> b $ i \<le> c $ i \<or> d $ i \<le> a $ i)) &&& (box a b \<inter> cbox c d = {}) = (\<exists>i. b $ i \<le> a $ i \<or> d $ i < c $ i \<or> b $ i \<le> c $ i \<or> d $ i \<le> a $ i) &&& (box a b \<inter> box c d = {}) = (\<exists>i. b $ i \<le> a $ i \<or> d $ i \<le> c $ i \<or> b $ i \<le> c $ i \<or> d $ i \<le> a $ i)
[PROOF STEP]
by (simp_all add: Basis_vec_def inner_axis)


[STATEMENT]
lemma Im7_tendsto_lowerbound:
   "\<lbrakk>(f \<longlongrightarrow> limit) net; \<forall>\<^sub>F x in net. b \<le> Im7 (f x); net \<noteq> bot\<rbrakk> \<Longrightarrow> b \<le> Im7 limit"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> limit) net; \<forall>\<^sub>F x in net. b \<le> Im7 (f x); net \<noteq> bot\<rbrakk> \<Longrightarrow> b \<le> Im7 limit
[PROOF STEP]
by (blast intro: tendsto_lowerbound [OF tendsto_Im7])


[STATEMENT]
lemma inverse_Infinitesimal_iff_HInfinite:
  "x \<noteq> 0 \<Longrightarrow> inverse x \<in> Infinitesimal \<longleftrightarrow> x \<in> HInfinite"
  for x :: "'a::real_normed_div_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> (inverse x \<in> Infinitesimal) = (x \<in> HInfinite)
[PROOF STEP]
by (metis Compl_HFinite Compl_iff HInfinite_inverse_Infinitesimal InfinitesimalD Infinitesimal_HFinite_mult Reals_1 hnorm_one left_inverse less_irrefl zero_less_one)


[STATEMENT]
lemma coeff_subresultant: "coeff (subresultant J F G) l =
  (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0 else det (subresultant'_mat J l F G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
proof (cases "degree F - J + (degree G - J) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree F - J + (degree G - J) = 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
 2. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
degree F - J + (degree G - J) = 0

goal (2 subgoals):
 1. degree F - J + (degree G - J) = 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
 2. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
unfolding subresultant_def subresultant_mat_def subresultant'_mat_def Let_def True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (det (mat 0 0 (\<lambda>(i, j). if j < degree G - J then if i = 0 - 1 then monom (1::'a) (degree G - J - 1 - j) * F else [:coeff_int F (int (degree F) - int i + int j):] else if i = 0 - 1 then monom (1::'a) (degree F - J - 1 - (j - (degree G - J))) * G else [:coeff_int G (int (degree G) - int i + int (j - (degree G - J))):]))) l = (if 0 = 0 \<and> l \<noteq> 0 then 0::'a else det (mat 0 0 (\<lambda>(i, j). if j < degree G - J then if i = 0 - 1 then coeff_int F (int l - int (degree G - J - 1) + int j) else coeff_int F (int (degree F) - int i + int j) else if i = 0 - 1 then coeff_int G (int l - int (degree F - J - 1) + int (j - (degree G - J))) else coeff_int G (int (degree G) - int i + int (j - (degree G - J))))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
degree F - J + (degree G - J) \<noteq> 0

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
let ?n = "degree F - J + (degree G - J)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
define n where "n = ?n"
[PROOF STATE]
proof (state)
this:
n = degree F - J + (degree G - J)

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
degree F - J + (degree G - J) \<noteq> 0
[PROOF STEP]
have n: "n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree F - J + (degree G - J) \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
degree F - J + (degree G - J) \<noteq> 0

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
hence id: "{0..<n} = insert (n - 1) {0..< (n - 1)}"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. {0..<n} = insert (n - 1) {0..<n - 1}
[PROOF STEP]
by (cases n, auto)
[PROOF STATE]
proof (state)
this:
{0..<n} = insert (n - 1) {0..<n - 1}

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have idn: "(x = x) = True" for x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x = x) = True
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(?x = ?x) = True

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
let ?M = "subresultant_mat J F G"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
define M where "M = ?M"
[PROOF STATE]
proof (state)
this:
M = subresultant_mat J F G

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
let ?L = "subresultant'_mat J l F G"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
define L where "L = ?L"
[PROOF STATE]
proof (state)
this:
L = subresultant'_mat J l F G

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
L = subresultant'_mat J l F G

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
assume p: "p permutes {0..<n}"
[PROOF STATE]
proof (state)
this:
p permutes {0..<n}

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
from n p
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
p permutes {0..<n}
[PROOF STEP]
have n1: "n - 1 < n" "p (n - 1) < n"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
p permutes {0..<n}

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

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) l =
      (\<Prod>i = 0 ..< (n - 1). coeff_int (M $$ (i, p i)) 0) * coeff_int (M $$ (n - 1, p (n - 1))) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n - 1. coeff_int (M $$ (i, p i)) 0) * coeff_int (M $$ (n - 1, p (n - 1))) (int l)
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (\<Prod>i\<in>insert (n - 1) {0..<n - 1}. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n - 1. coeff_int (M $$ (i, p i)) 0) * coeff_int (M $$ (n - 1, p (n - 1))) (int l)
[PROOF STEP]
proof (rule coeff_int_prod_const, (auto)[2])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n - 1} \<Longrightarrow> degree (M $$ (i, p i)) = 0
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n - 1} \<Longrightarrow> degree (M $$ (i, p i)) = 0
[PROOF STEP]
assume "i \<in> {0 ..< n - 1}"
[PROOF STATE]
proof (state)
this:
i \<in> {0..<n - 1}

goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n - 1} \<Longrightarrow> degree (M $$ (i, p i)) = 0
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
p permutes {0..<n}
i \<in> {0..<n - 1}
[PROOF STEP]
have i: "i \<noteq> n - 1" and "i < n" "p i < n"
[PROOF STATE]
proof (prove)
using this:
p permutes {0..<n}
i \<in> {0..<n - 1}

goal (1 subgoal):
 1. i \<noteq> n - 1 &&& i < n &&& p i < n
[PROOF STEP]
by (auto simp: n_def)
[PROOF STATE]
proof (state)
this:
i \<noteq> n - 1
i < n
p i < n

goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n - 1} \<Longrightarrow> degree (M $$ (i, p i)) = 0
[PROOF STEP]
note id = subresultant_index_mat[OF this(2-3)[unfolded n_def], folded M_def n_def]
[PROOF STATE]
proof (state)
this:
M $$ (i, p i) = (if p i < degree G - J then if i = n - 1 then monom (1::'a) (degree G - J - 1 - p i) * F else [:coeff_int F (int (degree F) - int i + int (p i)):] else let jj = p i - (degree G - J) in if i = n - 1 then monom (1::'a) (degree F - J - 1 - jj) * G else [:coeff_int G (int (degree G) - int i + int jj):])

goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n - 1} \<Longrightarrow> degree (M $$ (i, p i)) = 0
[PROOF STEP]
show "degree (M $$ (i, p i)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (M $$ (i, p i)) = 0
[PROOF STEP]
unfolding id Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (if p i < degree G - J then if i = n - 1 then monom (1::'a) (degree G - J - 1 - p i) * F else [:coeff_int F (int (degree F) - int i + int (p i)):] else if i = n - 1 then monom (1::'a) (degree F - J - 1 - (p i - (degree G - J))) * G else [:coeff_int G (int (degree G) - int i + int (p i - (degree G - J))):]) = 0
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<noteq> n - 1

goal (1 subgoal):
 1. degree (if p i < degree G - J then if i = n - 1 then monom (1::'a) (degree G - J - 1 - p i) * F else [:coeff_int F (int (degree F) - int i + int (p i)):] else if i = n - 1 then monom (1::'a) (degree F - J - 1 - (p i - (degree G - J))) * G else [:coeff_int G (int (degree G) - int i + int (p i - (degree G - J))):]) = 0
[PROOF STEP]
by (simp split: if_splits)
[PROOF STATE]
proof (state)
this:
degree (M $$ (i, p i)) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n - 1. coeff_int (M $$ (i, p i)) 0) * coeff_int (M $$ (n - 1, p (n - 1))) (int l)

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n - 1. coeff_int (M $$ (i, p i)) 0) * coeff_int (M $$ (n - 1, p (n - 1))) (int l)

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "(\<Prod>i = 0 ..< (n - 1). coeff_int (M $$ (i, p i)) 0)
       = (\<Prod>i = 0 ..< (n - 1). L $$ (i, p i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<n - 1. coeff_int (M $$ (i, p i)) 0) = (\<Prod>i = 0..<n - 1. L $$ (i, p i))
[PROOF STEP]
proof (rule prod.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n - 1} \<Longrightarrow> coeff_int (M $$ (x, p x)) 0 = L $$ (x, p x)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n - 1} \<Longrightarrow> coeff_int (M $$ (x, p x)) 0 = L $$ (x, p x)
[PROOF STEP]
assume "i \<in> {0 ..< n - 1}"
[PROOF STATE]
proof (state)
this:
i \<in> {0..<n - 1}

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n - 1} \<Longrightarrow> coeff_int (M $$ (x, p x)) 0 = L $$ (x, p x)
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
p permutes {0..<n}
i \<in> {0..<n - 1}
[PROOF STEP]
have i: "i \<noteq> n - 1" and ii: "i < n" "p i < n"
[PROOF STATE]
proof (prove)
using this:
p permutes {0..<n}
i \<in> {0..<n - 1}

goal (1 subgoal):
 1. i \<noteq> n - 1 &&& i < n &&& p i < n
[PROOF STEP]
by (auto simp: n_def)
[PROOF STATE]
proof (state)
this:
i \<noteq> n - 1
i < n
p i < n

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n - 1} \<Longrightarrow> coeff_int (M $$ (x, p x)) 0 = L $$ (x, p x)
[PROOF STEP]
note id = subresultant_index_mat[OF this(2-3)[unfolded n_def], folded M_def n_def]
[PROOF STATE]
proof (state)
this:
M $$ (i, p i) = (if p i < degree G - J then if i = n - 1 then monom (1::'a) (degree G - J - 1 - p i) * F else [:coeff_int F (int (degree F) - int i + int (p i)):] else let jj = p i - (degree G - J) in if i = n - 1 then monom (1::'a) (degree F - J - 1 - jj) * G else [:coeff_int G (int (degree G) - int i + int jj):])

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n - 1} \<Longrightarrow> coeff_int (M $$ (x, p x)) 0 = L $$ (x, p x)
[PROOF STEP]
note id' = L_def[unfolded subresultant'_mat_def Let_def, folded n_def] index_mat[OF ii]
[PROOF STATE]
proof (state)
this:
L = mat n n (\<lambda>(i, j). if j < degree G - J then if i = n - 1 then coeff_int F (int l - int (degree G - J - 1) + int j) else coeff_int F (int (degree F) - int i + int j) else if i = n - 1 then coeff_int G (int l - int (degree F - J - 1) + int (j - (degree G - J))) else coeff_int G (int (degree G) - int i + int (j - (degree G - J))))
mat n n ?f $$ (i, p i) = ?f (i, p i)
mat\<^sub>r n n ?g $$ (i, p i) = ?g i $ p i

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n - 1} \<Longrightarrow> coeff_int (M $$ (x, p x)) 0 = L $$ (x, p x)
[PROOF STEP]
show "coeff_int (M $$ (i, p i)) 0 = L $$ (i, p i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (M $$ (i, p i)) 0 = L $$ (i, p i)
[PROOF STEP]
unfolding id id' split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (if p i < degree G - J then if i = n - 1 then monom (1::'a) (degree G - J - 1 - p i) * F else [:coeff_int F (int (degree F) - int i + int (p i)):] else let jj = p i - (degree G - J) in if i = n - 1 then monom (1::'a) (degree F - J - 1 - jj) * G else [:coeff_int G (int (degree G) - int i + int jj):]) 0 = (if p i < degree G - J then if i = n - 1 then coeff_int F (int l - int (degree G - J - 1) + int (p i)) else coeff_int F (int (degree F) - int i + int (p i)) else if i = n - 1 then coeff_int G (int l - int (degree F - J - 1) + int (p i - (degree G - J))) else coeff_int G (int (degree G) - int i + int (p i - (degree G - J))))
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<noteq> n - 1

goal (1 subgoal):
 1. coeff_int (if p i < degree G - J then if i = n - 1 then monom (1::'a) (degree G - J - 1 - p i) * F else [:coeff_int F (int (degree F) - int i + int (p i)):] else let jj = p i - (degree G - J) in if i = n - 1 then monom (1::'a) (degree F - J - 1 - jj) * G else [:coeff_int G (int (degree G) - int i + int jj):]) 0 = (if p i < degree G - J then if i = n - 1 then coeff_int F (int l - int (degree G - J - 1) + int (p i)) else coeff_int F (int (degree F) - int i + int (p i)) else if i = n - 1 then coeff_int G (int l - int (degree F - J - 1) + int (p i - (degree G - J))) else coeff_int G (int (degree G) - int i + int (p i - (degree G - J))))
[PROOF STEP]
proof (simp add: if_splits Let_def)
[PROOF STATE]
proof (state)
goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coeff_int (M $$ (i, p i)) 0 = L $$ (i, p i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<n - 1. coeff_int (M $$ (i, p i)) 0) = (\<Prod>i = 0..<n - 1. L $$ (i, p i))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<n - 1. coeff_int (M $$ (i, p i)) 0) = (\<Prod>i = 0..<n - 1. L $$ (i, p i))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "coeff_int (M $$ (n - 1, p (n - 1))) l =
      (if p (n - 1) < degree G - J then
         coeff_int (monom 1 (degree G - J - 1 - p (n - 1)) * F) l
         else coeff_int (monom 1 (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (M $$ (n - 1, p (n - 1))) (int l) = (if p (n - 1) < degree G - J then coeff_int (monom (1::'a) (degree G - J - 1 - p (n - 1)) * F) (int l) else coeff_int (monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) (int l))
[PROOF STEP]
using subresultant_index_mat[OF n1[unfolded n_def], folded M_def n_def, unfolded idn if_True Let_def]
[PROOF STATE]
proof (prove)
using this:
M $$ (n - 1, p (n - 1)) = (if p (n - 1) < degree G - J then monom (1::'a) (degree G - J - 1 - p (n - 1)) * F else monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G)

goal (1 subgoal):
 1. coeff_int (M $$ (n - 1, p (n - 1))) (int l) = (if p (n - 1) < degree G - J then coeff_int (monom (1::'a) (degree G - J - 1 - p (n - 1)) * F) (int l) else coeff_int (monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) (int l))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff_int (M $$ (n - 1, p (n - 1))) (int l) = (if p (n - 1) < degree G - J then coeff_int (monom (1::'a) (degree G - J - 1 - p (n - 1)) * F) (int l) else coeff_int (monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) (int l))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coeff_int (M $$ (n - 1, p (n - 1))) (int l) = (if p (n - 1) < degree G - J then coeff_int (monom (1::'a) (degree G - J - 1 - p (n - 1)) * F) (int l) else coeff_int (monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) (int l))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "\<dots> = (if p (n - 1) < degree G - J
      then coeff_int F (int l - int (degree G - J - 1 - p (n - 1)))
      else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int (monom (1::'a) (degree G - J - 1 - p (n - 1)) * F) (int l) else coeff_int (monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) (int l)) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J)))))
[PROOF STEP]
unfolding coeff_int_monom_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then (1::'a) * coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else (1::'a) * coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J)))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int (monom (1::'a) (degree G - J - 1 - p (n - 1)) * F) (int l) else coeff_int (monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) (int l)) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J)))))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int (monom (1::'a) (degree G - J - 1 - p (n - 1)) * F) (int l) else coeff_int (monom (1::'a) (degree F - J - 1 - (p (n - 1) - (degree G - J))) * G) (int l)) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J)))))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "\<dots> = (if p (n - 1) < degree G - J
      then coeff_int F (int l - int (degree G - J - 1) + p (n - 1))
      else coeff_int G (int l - int (degree F - J - 1) + (p (n - 1) - (degree G - J))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
proof (cases "p (n - 1) < degree G - J")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
 2. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p (n - 1) < degree G - J

goal (2 subgoals):
 1. p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
 2. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
hence "int (degree G - J - 1 - p (n - 1)) = int (degree G - J - 1) - p (n - 1)"
[PROOF STATE]
proof (prove)
using this:
p (n - 1) < degree G - J

goal (1 subgoal):
 1. int (degree G - J - 1 - p (n - 1)) = int (degree G - J - 1) - int (p (n - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (degree G - J - 1 - p (n - 1)) = int (degree G - J - 1) - int (p (n - 1))

goal (2 subgoals):
 1. p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
 2. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
hence id: "int l - int (degree G - J - 1 - p (n - 1)) = int l - int (degree G - J - 1) + p (n - 1)"
[PROOF STATE]
proof (prove)
using this:
int (degree G - J - 1 - p (n - 1)) = int (degree G - J - 1) - int (p (n - 1))

goal (1 subgoal):
 1. int l - int (degree G - J - 1 - p (n - 1)) = int l - int (degree G - J - 1) + int (p (n - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int l - int (degree G - J - 1 - p (n - 1)) = int l - int (degree G - J - 1) + int (p (n - 1))

goal (2 subgoals):
 1. p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
 2. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
p (n - 1) < degree G - J

goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
using this:
p (n - 1) < degree G - J

goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))

goal (1 subgoal):
 1. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> p (n - 1) < degree G - J

goal (1 subgoal):
 1. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
from n1 False
[PROOF STATE]
proof (chain)
picking this:
n - 1 < n
p (n - 1) < n
\<not> p (n - 1) < degree G - J
[PROOF STEP]
have "degree F - J - 1 \<ge> p (n - 1) - (degree G - J)"
[PROOF STATE]
proof (prove)
using this:
n - 1 < n
p (n - 1) < n
\<not> p (n - 1) < degree G - J

goal (1 subgoal):
 1. p (n - 1) - (degree G - J) \<le> degree F - J - 1
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
degree F - J + (degree G - J) - 1 < degree F - J + (degree G - J)
p (degree F - J + (degree G - J) - 1) < degree F - J + (degree G - J)
\<not> p (degree F - J + (degree G - J) - 1) < degree G - J

goal (1 subgoal):
 1. p (degree F - J + (degree G - J) - 1) - (degree G - J) \<le> degree F - J - 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
p (n - 1) - (degree G - J) \<le> degree F - J - 1

goal (1 subgoal):
 1. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
hence "int (degree F - J - 1 - (p (n - 1) - (degree G - J))) = int (degree F - J - 1) - (p (n - 1) - (degree G - J))"
[PROOF STATE]
proof (prove)
using this:
p (n - 1) - (degree G - J) \<le> degree F - J - 1

goal (1 subgoal):
 1. int (degree F - J - 1 - (p (n - 1) - (degree G - J))) = int (degree F - J - 1) - int (p (n - 1) - (degree G - J))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
int (degree F - J - 1 - (p (n - 1) - (degree G - J))) = int (degree F - J - 1) - int (p (n - 1) - (degree G - J))

goal (1 subgoal):
 1. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
hence id: "int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))) =
       int l - int (degree F - J - 1) + (p (n - 1) - (degree G - J))"
[PROOF STATE]
proof (prove)
using this:
int (degree F - J - 1 - (p (n - 1) - (degree G - J))) = int (degree F - J - 1) - int (p (n - 1) - (degree G - J))

goal (1 subgoal):
 1. int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))) = int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))) = int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))

goal (1 subgoal):
 1. \<not> p (n - 1) < degree G - J \<Longrightarrow> (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J)))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> p (n - 1) < degree G - J

goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J)))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1 - p (n - 1))) else coeff_int G (int l - int (degree F - J - 1 - (p (n - 1) - (degree G - J))))) = (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J))))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "\<dots> = L $$ (n - 1, p (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J)))) = L $$ (n - 1, p (n - 1))
[PROOF STEP]
unfolding L_def subresultant'_mat_def Let_def n_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J)))) = mat n n (\<lambda>(i, j). if j < degree G - J then if i = n - 1 then coeff_int F (int l - int (degree G - J - 1) + int j) else coeff_int F (int (degree F) - int i + int j) else if i = n - 1 then coeff_int G (int l - int (degree F - J - 1) + int (j - (degree G - J))) else coeff_int G (int (degree G) - int i + int (j - (degree G - J)))) $$ (n - 1, p (n - 1))
[PROOF STEP]
using n1
[PROOF STATE]
proof (prove)
using this:
n - 1 < n
p (n - 1) < n

goal (1 subgoal):
 1. (if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J)))) = mat n n (\<lambda>(i, j). if j < degree G - J then if i = n - 1 then coeff_int F (int l - int (degree G - J - 1) + int j) else coeff_int F (int (degree F) - int i + int j) else if i = n - 1 then coeff_int G (int l - int (degree F - J - 1) + int (j - (degree G - J))) else coeff_int G (int (degree G) - int i + int (j - (degree G - J)))) $$ (n - 1, p (n - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J)))) = L $$ (n - 1, p (n - 1))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if p (n - 1) < degree G - J then coeff_int F (int l - int (degree G - J - 1) + int (p (n - 1))) else coeff_int G (int l - int (degree F - J - 1) + int (p (n - 1) - (degree G - J)))) = L $$ (n - 1, p (n - 1))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "(\<Prod>i = 0..<n - 1. L $$ (i, p i)) * \<dots> = (\<Prod>i = 0..<n. L $$ (i, p i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<n - 1. L $$ (i, p i)) * L $$ (n - 1, p (n - 1)) = (\<Prod>i = 0..<n. L $$ (i, p i))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<n - 1. L $$ (i, p i)) * L $$ (n - 1, p (n - 1)) = (\<Prod>i\<in>insert (n - 1) {0..<n - 1}. L $$ (i, p i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<n - 1. L $$ (i, p i)) * L $$ (n - 1, p (n - 1)) = (\<Prod>i = 0..<n. L $$ (i, p i))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n. L $$ (i, p i))
[PROOF STEP]
have "coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n. L $$ (i, p i))"
[PROOF STATE]
proof (prove)
using this:
coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n. L $$ (i, p i))

goal (1 subgoal):
 1. coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n. L $$ (i, p i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l) = (\<Prod>i = 0..<n. L $$ (i, p i))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?p2 permutes {0..<n} \<Longrightarrow> coeff_int (\<Prod>i = 0..<n. M $$ (i, ?p2 i)) (int l) = (\<Prod>i = 0..<n. L $$ (i, ?p2 i))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
?p2 permutes {0..<n} \<Longrightarrow> coeff_int (\<Prod>i = 0..<n. M $$ (i, ?p2 i)) (int l) = (\<Prod>i = 0..<n. L $$ (i, ?p2 i))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "coeff_int (subresultant J F G) l =
    (\<Sum>p\<in>{p. p permutes {0..<n}}. signof p * coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (subresultant J F G) (int l) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l))
[PROOF STEP]
unfolding subresultant_def det_def subresultant_mat_dim idn if_True n_def[symmetric] M_def
      coeff_int_sum coeff_int_signof_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{p. p permutes {0..<n}}. of_int (sign x) * coeff_int (\<Prod>i = 0..<n. subresultant_mat J F G $$ (i, x i)) (int l)) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * coeff_int (\<Prod>i = 0..<n. subresultant_mat J F G $$ (i, p i)) (int l))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff_int (subresultant J F G) (int l) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coeff_int (subresultant J F G) (int l) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "\<dots> = (\<Sum>p\<in>{p. p permutes {0..<n}}. signof p * (\<Prod>i = 0..<n. L $$ (i, p i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p | p permutes {0..<n}. of_int (sign p) * coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l)) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i)))
[PROOF STEP]
by (rule sum.cong[OF refl], insert *, simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>p | p permutes {0..<n}. of_int (sign p) * coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l)) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i)))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>p | p permutes {0..<n}. of_int (sign p) * coeff_int (\<Prod>i = 0..<n. M $$ (i, p i)) (int l)) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i)))

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
have "\<dots> = det L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i))) = det L
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i))) = det L
[PROOF STEP]
have id: "dim_row (subresultant'_mat J l F G) = n"
      "dim_col (subresultant'_mat J l F G) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (subresultant'_mat J l F G) = n &&& dim_col (subresultant'_mat J l F G) = n
[PROOF STEP]
unfolding subresultant'_mat_def Let_def n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (degree F - J + (degree G - J)) (degree F - J + (degree G - J)) (\<lambda>(i, j). if j < degree G - J then if i = degree F - J + (degree G - J) - 1 then coeff_int F (int l - int (degree G - J - 1) + int j) else coeff_int F (int (degree F) - int i + int j) else if i = degree F - J + (degree G - J) - 1 then coeff_int G (int l - int (degree F - J - 1) + int (j - (degree G - J))) else coeff_int G (int (degree G) - int i + int (j - (degree G - J))))) = degree F - J + (degree G - J) &&& dim_col (mat (degree F - J + (degree G - J)) (degree F - J + (degree G - J)) (\<lambda>(i, j). if j < degree G - J then if i = degree F - J + (degree G - J) - 1 then coeff_int F (int l - int (degree G - J - 1) + int j) else coeff_int F (int (degree F) - int i + int j) else if i = degree F - J + (degree G - J) - 1 then coeff_int G (int l - int (degree F - J - 1) + int (j - (degree G - J))) else coeff_int G (int (degree G) - int i + int (j - (degree G - J))))) = degree F - J + (degree G - J)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row (subresultant'_mat J l F G) = n
dim_col (subresultant'_mat J l F G) = n

goal (1 subgoal):
 1. (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i))) = det L
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i))) = det L
[PROOF STEP]
unfolding det_def L_def id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. subresultant'_mat J l F G $$ (i, p i))) = (if n = n then \<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. subresultant'_mat J l F G $$ (i, p i)) else (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i))) = det L

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. L $$ (i, p i))) = det L

goal (1 subgoal):
 1. degree F - J + (degree G - J) \<noteq> 0 \<Longrightarrow> coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
coeff_int (subresultant J F G) (int l) = det L
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff_int (subresultant J F G) (int l) = det L

goal (1 subgoal):
 1. coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
unfolding L_def coeff_int_def
[PROOF STATE]
proof (prove)
using this:
(if int l < 0 then 0::'a else coeff (subresultant J F G) (nat (int l))) = det (subresultant'_mat J l F G)

goal (1 subgoal):
 1. coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
(if int l < 0 then 0::'a else coeff (subresultant J F G) (nat (int l))) = det (subresultant'_mat J l F G)
degree F - J + (degree G - J) \<noteq> 0

goal (1 subgoal):
 1. coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coeff (subresultant J F G) l = (if degree F - J + (degree G - J) = 0 \<and> l \<noteq> 0 then 0::'a else det (subresultant'_mat J l F G))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_X_plus_const_neg_power:
  "c \<noteq> 0 \<Longrightarrow> inverse ((fps_X + fps_const c) ^ n) =
     fps_const (inverse c^n) * fps_compose (fps_binomial (-of_nat n)) (fps_const (inverse c) * fps_X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> inverse ((fps_X + fps_const c) ^ n) = fps_const (inverse c ^ n) * (fps_binomial (- of_nat n) oo fps_const (inverse c) * fps_X)
[PROOF STEP]
by (subst fps_binomial_minus_of_nat)
     (simp add: fps_compose_power [symmetric] fps_binomial_of_nat fps_compose_add_distrib
                fps_const_power [symmetric] power_mult_distrib [symmetric] fps_inverse_compose
                algebra_simps fps_const_inverse [symmetric] fps_inverse_mult [symmetric]
                fps_inverse_power [symmetric] inverse_mult_eq_1'
           del: fps_const_power)


[STATEMENT]
lemma (in CRR_market_viable) asian_effect_compute:
shows "(\<Sum> w\<in> range (pseudo_proj_True matur). (prod (prob_component pr w) {0..<matur}) *
      (discounted_value r (\<lambda>m. (asian_option matur)) matur w)) =
      (\<Sum> y\<in> (gener_bool_list matur). lprob_comp pr y * (det_discount r matur) *
      (\<Sum> i\<in> {1.. matur}. lgeom_proc u d init (take i y))/ matur)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>w\<in>range (pseudo_proj_True matur). prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w) = (\<Sum>y\<in>gener_bool_list matur. lprob_comp pr y * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i y)) / real matur)
[PROOF STEP]
proof (rule pseudo_range_stake)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
have "prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w =
    lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w
[PROOF STEP]
using lprob_comp_stake
[PROOF STATE]
proof (prove)
using this:
prod (prob_component ?pr ?w) {0..<?matur} = lprob_comp ?pr (stake ?matur ?w)

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w

goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w

goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
have "... = lprob_comp pr (stake matur w) *
    (det_discount r matur) * (\<Sum> i\<in> {1.. matur}. lgeom_proc u d init (take i (stake matur w)))/ matur"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
using disc_asian_option_lgeom[of matur w]
[PROOF STATE]
proof (prove)
using this:
discounted_value r (\<lambda>m. asian_option matur) matur w = det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur

goal (1 subgoal):
 1. lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur

goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
show "prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w =
    lprob_comp pr (stake matur w) *
    (det_discount r matur) * (\<Sum> i\<in> {1.. matur}. lgeom_proc u d init (take i (stake matur w)))/ matur"
[PROOF STATE]
proof (prove)
using this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. asian_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * (\<Sum>i = 1..matur. lgeom_proc u d init (take i (stake matur w))) / real matur

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "!!a::real. a < b ==> c < d ==> a - d \<le> b + (-c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a < b; c < d\<rbrakk> \<Longrightarrow> a - d \<le> b + - c
[PROOF STEP]
by linarith


[STATEMENT]
lemma euler_genus_da: "H.euler_genus = G.euler_genus"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H.euler_genus = G.euler_genus
[PROOF STEP]
unfolding G.euler_genus_def H.euler_genus_def G.euler_char_def H.euler_char_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int (2 * card H.sccs) - int (card H.isolated_verts) - (int (card (verts H)) - int (card (arcs H) div 2) + int (card H.face_cycle_sets))) div 2 = (int (2 * card G.sccs) - int (card G.isolated_verts) - (int (card (verts G)) - int (card (arcs G) div 2) + int (card G.face_cycle_sets))) div 2
[PROOF STEP]
by (simp add: card_isolated_verts_da verts_H card_arcs_da card_face_cycle_sets_da card_sccs_da)


[STATEMENT]
lemma keys_frag_extend: "Poly_Mapping.keys(frag_extend f c) \<subseteq> (\<Union>x \<in> Poly_Mapping.keys c. Poly_Mapping.keys(f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (frag_extend f c) \<subseteq> (\<Union>x\<in>keys c. keys (f x))
[PROOF STEP]
unfolding frag_extend_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (\<Sum>i\<in>keys c. frag_cmul (lookup c i) (f i)) \<subseteq> (\<Union>x\<in>keys c. keys (f x))
[PROOF STEP]
using keys_sum
[PROOF STATE]
proof (prove)
using this:
keys (sum ?b ?I) \<subseteq> (\<Union>i\<in>?I. keys (?b i))

goal (1 subgoal):
 1. keys (\<Sum>i\<in>keys c. frag_cmul (lookup c i) (f i)) \<subseteq> (\<Union>x\<in>keys c. keys (f x))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma pdivmod_via_pseudo_divmod_list:
  "(f div g, f mod g) =
    (let cg = coeffs g in
      if cg = [] then (0, f)
      else
        let
          cf = coeffs f;
          ilc = inverse (last cg);
          ch = map ((*) ilc) cg;
          (q, r) = pseudo_divmod_main_list 1 [] (rev cf) (rev ch) (1 + length cf - length cg)
        in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
note d = pdivmod_via_pseudo_divmod pseudo_divmod_impl pseudo_divmod_list_def
[PROOF STATE]
proof (state)
this:
(?f div ?g, ?f mod ?g) = (if ?g = 0 then (0, ?f) else let ilc = inverse (lead_coeff ?g); h = smult ilc ?g; (q, r) = pseudo_divmod ?f h in (smult ilc q, r))
pseudo_divmod ?f ?g = map_prod poly_of_list poly_of_list (pseudo_divmod_list (coeffs ?f) (coeffs ?g))
pseudo_divmod_list ?p ?q = (if ?q = [] then ([], ?p) else let rq = rev ?q; (qu, re) = pseudo_divmod_main_list (hd rq) [] (rev ?p) rq (1 + length ?p - length ?q) in (qu, rev re))

goal (1 subgoal):
 1. (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
proof (cases "g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g = 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
 2. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
g = 0

goal (2 subgoals):
 1. g = 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
 2. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
with d
[PROOF STATE]
proof (chain)
picking this:
(?f div ?g, ?f mod ?g) = (if ?g = 0 then (0, ?f) else let ilc = inverse (lead_coeff ?g); h = smult ilc ?g; (q, r) = pseudo_divmod ?f h in (smult ilc q, r))
pseudo_divmod ?f ?g = map_prod poly_of_list poly_of_list (pseudo_divmod_list (coeffs ?f) (coeffs ?g))
pseudo_divmod_list ?p ?q = (if ?q = [] then ([], ?p) else let rq = rev ?q; (qu, re) = pseudo_divmod_main_list (hd rq) [] (rev ?p) rq (1 + length ?p - length ?q) in (qu, rev re))
g = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(?f div ?g, ?f mod ?g) = (if ?g = 0 then (0, ?f) else let ilc = inverse (lead_coeff ?g); h = smult ilc ?g; (q, r) = pseudo_divmod ?f h in (smult ilc q, r))
pseudo_divmod ?f ?g = map_prod poly_of_list poly_of_list (pseudo_divmod_list (coeffs ?f) (coeffs ?g))
pseudo_divmod_list ?p ?q = (if ?q = [] then ([], ?p) else let rq = rev ?q; (qu, re) = pseudo_divmod_main_list (hd rq) [] (rev ?p) rq (1 + length ?p - length ?q) in (qu, rev re))
g = 0

goal (1 subgoal):
 1. (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
g \<noteq> 0

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
define ilc where "ilc = inverse (coeff g (degree g))"
[PROOF STATE]
proof (state)
this:
ilc = inverse (lead_coeff g)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
g \<noteq> 0
[PROOF STEP]
have ilc: "ilc \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0

goal (1 subgoal):
 1. ilc \<noteq> (0::'a)
[PROOF STEP]
by (auto simp: ilc_def)
[PROOF STATE]
proof (state)
this:
ilc \<noteq> (0::'a)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
g \<noteq> 0
ilc \<noteq> (0::'a)
[PROOF STEP]
have id: "g = 0 \<longleftrightarrow> False" "coeffs g = [] \<longleftrightarrow> False"
      "last (coeffs g) = coeff g (degree g)"
      "coeffs (smult ilc g) = [] \<longleftrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0
ilc \<noteq> (0::'a)

goal (1 subgoal):
 1. ((g = 0) = False &&& (coeffs g = []) = False) &&& last (coeffs g) = lead_coeff g &&& (coeffs (smult ilc g) = []) = False
[PROOF STEP]
by (auto simp: last_coeffs_eq_coeff_degree)
[PROOF STATE]
proof (state)
this:
(g = 0) = False
(coeffs g = []) = False
last (coeffs g) = lead_coeff g
(coeffs (smult ilc g) = []) = False

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
have id2: "hd (rev (coeffs (smult ilc g))) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (rev (coeffs (smult ilc g))) = (1::'a)
[PROOF STEP]
by (subst hd_rev, insert id ilc, auto simp: coeffs_smult, subst last_map, auto simp: id ilc_def)
[PROOF STATE]
proof (state)
this:
hd (rev (coeffs (smult ilc g))) = (1::'a)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
have id3: "length (coeffs (smult ilc g)) = length (coeffs g)"
      "rev (coeffs (smult ilc g)) = rev (map ((*) ilc) (coeffs g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (coeffs (smult ilc g)) = length (coeffs g) &&& rev (coeffs (smult ilc g)) = rev (map ((*) ilc) (coeffs g))
[PROOF STEP]
unfolding coeffs_smult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (if ilc = (0::'a) then [] else map ((*) ilc) (coeffs g)) = length (coeffs g) &&& rev (if ilc = (0::'a) then [] else map ((*) ilc) (coeffs g)) = rev (map ((*) ilc) (coeffs g))
[PROOF STEP]
using ilc
[PROOF STATE]
proof (prove)
using this:
ilc \<noteq> (0::'a)

goal (1 subgoal):
 1. length (if ilc = (0::'a) then [] else map ((*) ilc) (coeffs g)) = length (coeffs g) &&& rev (if ilc = (0::'a) then [] else map ((*) ilc) (coeffs g)) = rev (map ((*) ilc) (coeffs g))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (coeffs (smult ilc g)) = length (coeffs g)
rev (coeffs (smult ilc g)) = rev (map ((*) ilc) (coeffs g))

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
obtain q r where pair:
      "pseudo_divmod_main_list 1 [] (rev (coeffs f)) (rev (map ((*) ilc) (coeffs g)))
        (1 + length (coeffs f) - length (coeffs g)) = (q, r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q r. pseudo_divmod_main_list (1::'a) [] (rev (coeffs f)) (rev (map ((*) ilc) (coeffs g))) (1 + length (coeffs f) - length (coeffs g)) = (q, r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
pseudo_divmod_main_list (1::'a) [] (rev (coeffs f)) (rev (map ((*) ilc) (coeffs g))) (1 + length (coeffs f) - length (coeffs g)) = (q, r)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))
[PROOF STEP]
unfolding d Let_def id if_False ilc_def[symmetric] map_prod_def[symmetric] id2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_prod (smult ilc) (\<lambda>y. y) (map_prod poly_of_list poly_of_list (map_prod (\<lambda>qu. qu) rev (pseudo_divmod_main_list (1::'a) [] (rev (coeffs f)) (rev (coeffs (smult ilc g))) (1 + length (coeffs f) - length (coeffs (smult ilc g)))))) = map_prod (\<lambda>q. poly_of_list (map ((*) ilc) q)) (\<lambda>r. poly_of_list (rev r)) (pseudo_divmod_main_list (1::'a) [] (rev (coeffs f)) (rev (map ((*) ilc) (coeffs g))) (1 + length (coeffs f) - length (coeffs g)))
[PROOF STEP]
unfolding id3 pair map_prod_def split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (smult ilc (poly_of_list q), poly_of_list (rev r)) = (poly_of_list (map ((*) ilc) q), poly_of_list (rev r))
[PROOF STEP]
by (auto simp: Poly_map)
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (let cg = coeffs g in if cg = [] then (0, f) else let cf = coeffs f; ilc = inverse (last cg); ch = map ((*) ilc) cg; (q, r) = pseudo_divmod_main_list (1::'a) [] (rev cf) (rev ch) (1 + length cf - length cg) in (poly_of_list (map ((*) ilc) q), poly_of_list (rev r)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nfv_regex_simps[simp]:
  assumes [simp]: "(\<And>z. z \<in> atms r \<Longrightarrow> finite (fv z))" "(\<And>z. z \<in> atms s \<Longrightarrow> finite (fv z))"
  shows
  "nfv_regex fv (Skip n) = 0"
  "nfv_regex fv (Test \<phi>) = Max (insert 0 (Suc ` fv \<phi>))"
  "nfv_regex fv (Plus r s) = max (nfv_regex fv r) (nfv_regex fv s)"
  "nfv_regex fv (Times r s) = max (nfv_regex fv r) (nfv_regex fv s)"
  "nfv_regex fv (Star r) = nfv_regex fv r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nfv_regex fv (Skip n) = 0 &&& nfv_regex fv (Test \<phi>) = Max (insert 0 (Suc ` fv \<phi>))) &&& nfv_regex fv (Plus r s) = max (nfv_regex fv r) (nfv_regex fv s) &&& nfv_regex fv (Times r s) = max (nfv_regex fv r) (nfv_regex fv s) &&& nfv_regex fv (Star r) = nfv_regex fv r
[PROOF STEP]
unfolding nfv_regex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Max (insert 0 (Suc ` fv_regex fv (Skip n))) = 0 &&& Max (insert 0 (Suc ` fv_regex fv (Test \<phi>))) = Max (insert 0 (Suc ` fv \<phi>))) &&& Max (insert 0 (Suc ` fv_regex fv (Plus r s))) = max (Max (insert 0 (Suc ` fv_regex fv r))) (Max (insert 0 (Suc ` fv_regex fv s))) &&& Max (insert 0 (Suc ` fv_regex fv (Times r s))) = max (Max (insert 0 (Suc ` fv_regex fv r))) (Max (insert 0 (Suc ` fv_regex fv s))) &&& Max (insert 0 (Suc ` fv_regex fv (Star r))) = Max (insert 0 (Suc ` fv_regex fv r))
[PROOF STEP]
by (auto simp add: image_Un Max_Un insert_Un simp del: Un_insert_right Un_insert_left)


[STATEMENT]
lemma lt_Q_inv: "lower_triangular_mat (matrix_inv (Q_mat d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_triangular_mat (matrix_inv (Q_mat d))
[PROOF STEP]
unfolding inv_Q_mat_suminf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_triangular_mat (suminf (matpow (l *\<^sub>R P_lower d)))
[PROOF STEP]
using summable_inv_Q[of "Q_GS d"] norm_\<P>\<^sub>L_less_one summable_blinfun_to_matrix[of "\<lambda>i.  (l *\<^sub>R \<P>\<^sub>L d)^^i"]
[PROOF STATE]
proof (prove)
using this:
norm (id_blinfun - Q_GS d) < 1 \<Longrightarrow> summable ((^^) (id_blinfun - Q_GS d))
norm (l *\<^sub>R \<P>\<^sub>L ?d) < 1
summable ((^^) (l *\<^sub>R \<P>\<^sub>L d)) \<Longrightarrow> summable (\<lambda>i. blinfun_to_matrix ((l *\<^sub>R \<P>\<^sub>L d) ^^ i))

goal (1 subgoal):
 1. lower_triangular_mat (suminf (matpow (l *\<^sub>R P_lower d)))
[PROOF STEP]
by (intro lower_triangular_suminf lower_triangular_pow)
    (auto simp: lower_triangular_mat_def P_lower_def Q_GS_def blinfun_to_matrix_scaleR blinfun_to_matrix_matpow \<P>\<^sub>L_def)


[STATEMENT]
lemma module_iff_vector_space: "module s \<longleftrightarrow> vector_space s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module s = vector_space s
[PROOF STEP]
unfolding module_def vector_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((\<forall>a x y. s a (x + y) = s a x + s a y) \<and> (\<forall>a b x. s (a + b) x = s a x + s b x)) \<and> (\<forall>a b x. s a (s b x) = s (a * b) x) \<and> (\<forall>x. s (1::'a) x = x)) = (((\<forall>a x y. s a (x + y) = s a x + s a y) \<and> (\<forall>a b x. s (a + b) x = s a x + s b x)) \<and> (\<forall>a b x. s a (s b x) = s (a * b) x) \<and> (\<forall>x. s (1::'a) x = x))
[PROOF STEP]
..


[STATEMENT]
lemma wp_SetDC:
  assumes wp: "\<And>s x. x \<in> S s \<Longrightarrow> P x \<tturnstile> wp (f x) Q"
      and ne: "\<And>s. S s \<noteq> {}"
      and sP: "\<And>x. sound (P x)"
  shows "(\<lambda>s. Inf ((\<lambda>x. P x s) ` S s)) \<tturnstile> wp (SetDC f S) Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lambda>s. INF x\<in>S s. P x s \<tturnstile> wp (SetDC f S) Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> S ?s \<Longrightarrow> P ?x \<tturnstile> wp (f ?x) Q
S ?s \<noteq> {}
sound (P ?x)

goal (1 subgoal):
 1. \<lambda>s. INF x\<in>S s. P x s \<tturnstile> wp (SetDC f S) Q
[PROOF STEP]
by(intro le_funI, simp add:wp_eval, blast intro!:cInf_mono)


[STATEMENT]
lemma squarefree_prod_coprime:
  fixes f :: "'a \<Rightarrow> 'b :: factorial_semiring_gcd"
  assumes "\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> a \<noteq> b \<Longrightarrow> coprime (f a) (f b)"
  assumes "\<And>a. a \<in> A \<Longrightarrow> squarefree (f a)"
  shows   "squarefree (prod f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squarefree (prod f A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> A; ?b \<in> A; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> coprime (f ?a) (f ?b)
?a \<in> A \<Longrightarrow> squarefree (f ?a)

goal (1 subgoal):
 1. squarefree (prod f A)
[PROOF STEP]
by (induction A rule: infinite_finite_induct)
     (auto intro!: squarefree_mult_coprime prod_coprime_right)


[STATEMENT]
lemma div_lt_nat: "(j :: nat) < x * y \<Longrightarrow> j div x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < x * y \<Longrightarrow> j div x < y
[PROOF STEP]
by (simp add: less_mult_imp_div_less mult.commute)


[STATEMENT]
lemma not_isFault_iff: "(\<not> isFault t) = (\<forall>f. t \<noteq> Fault f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> isFault t) = (\<forall>f. t \<noteq> Fault f)
[PROOF STEP]
by (auto elim: isFaultE)