[STATEMENT]
lemma right_minus:
  assumes [simp]: "a \<in> R" "b \<in> R" shows "a \<cdot> (- b) = - a \<cdot> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
have "\<zero> = a \<cdot> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero> = a \<cdot> \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<zero> = a \<cdot> \<zero>

goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<zero> = a \<cdot> \<zero>

goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
have "\<dots> = a \<cdot> (b - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot> \<zero> = a \<cdot> (b - b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<cdot> \<zero> = a \<cdot> (b - b)

goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a \<cdot> \<zero> = a \<cdot> (b - b)

goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
have "\<dots> = a \<cdot> b + a \<cdot> (- b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot> (b - b) = a \<cdot> b + a \<cdot> (- b)
[PROOF STEP]
by (simp add: distributive del: additive.invertible_right_inverse)
[PROOF STATE]
proof (state)
this:
a \<cdot> (b - b) = a \<cdot> b + a \<cdot> (- b)

goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<zero> = a \<cdot> b + a \<cdot> (- b)
[PROOF STEP]
have "- a \<cdot> b + \<zero> = - a \<cdot> b + a \<cdot> b + a \<cdot> (- b)"
[PROOF STATE]
proof (prove)
using this:
\<zero> = a \<cdot> b + a \<cdot> (- b)

goal (1 subgoal):
 1. - a \<cdot> b + \<zero> = - a \<cdot> b + a \<cdot> b + a \<cdot> (- b)
[PROOF STEP]
by (simp add: additive.associative del: additive.invertible_left_inverse)
[PROOF STATE]
proof (state)
this:
- a \<cdot> b + \<zero> = - a \<cdot> b + a \<cdot> b + a \<cdot> (- b)

goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- a \<cdot> b + \<zero> = - a \<cdot> b + a \<cdot> b + a \<cdot> (- b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- a \<cdot> b + \<zero> = - a \<cdot> b + a \<cdot> b + a \<cdot> (- b)

goal (1 subgoal):
 1. a \<cdot> (- b) = - a \<cdot> b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<cdot> (- b) = - a \<cdot> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma partition_on_cart_prod:
  assumes "card I > 0"
  assumes "A \<noteq> {}"
  assumes "G \<noteq> {}"
  assumes "partition_on A G"
  shows "partition_on (A \<times> I) {g \<times> I |g. g \<in> G}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_on (A \<times> I) {g \<times> I |g. g \<in> G}
[PROOF STEP]
proof (intro partition_onI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>p. p \<in> {g \<times> I |g. g \<in> G} \<Longrightarrow> p \<noteq> {}
 2. \<Union> {g \<times> I |g. g \<in> G} = A \<times> I
 3. \<And>p p'. \<lbrakk>p \<in> {g \<times> I |g. g \<in> G}; p' \<in> {g \<times> I |g. g \<in> G}; p \<noteq> p'\<rbrakk> \<Longrightarrow> p \<inter> p' = {}
[PROOF STEP]
show "\<And>p. p \<in> {g \<times> I |g. g \<in> G} \<Longrightarrow> p \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> {g \<times> I |g. g \<in> G} \<Longrightarrow> p \<noteq> {}
[PROOF STEP]
using assms(1) assms(4) partition_onD3
[PROOF STATE]
proof (prove)
using this:
0 < card I
partition_on A G
partition_on ?A ?P \<Longrightarrow> {} \<notin> ?P

goal (1 subgoal):
 1. \<And>p. p \<in> {g \<times> I |g. g \<in> G} \<Longrightarrow> p \<noteq> {}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?p \<in> {g \<times> I |g. g \<in> G} \<Longrightarrow> ?p \<noteq> {}

goal (2 subgoals):
 1. \<Union> {g \<times> I |g. g \<in> G} = A \<times> I
 2. \<And>p p'. \<lbrakk>p \<in> {g \<times> I |g. g \<in> G}; p' \<in> {g \<times> I |g. g \<in> G}; p \<noteq> p'\<rbrakk> \<Longrightarrow> p \<inter> p' = {}
[PROOF STEP]
show "\<Union> {g \<times> I |g. g \<in> G} = A \<times> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {g \<times> I |g. g \<in> G} = A \<times> I
[PROOF STEP]
by (metis Setcompr_eq_image Sigma_Union assms(4) partition_onD1)
[PROOF STATE]
proof (state)
this:
\<Union> {g \<times> I |g. g \<in> G} = A \<times> I

goal (1 subgoal):
 1. \<And>p p'. \<lbrakk>p \<in> {g \<times> I |g. g \<in> G}; p' \<in> {g \<times> I |g. g \<in> G}; p \<noteq> p'\<rbrakk> \<Longrightarrow> p \<inter> p' = {}
[PROOF STEP]
show "\<And>p p'. p \<in> {g \<times> I |g. g \<in> G} \<Longrightarrow> p' \<in> {g \<times> I |g. g \<in> G} \<Longrightarrow> p \<noteq> p' \<Longrightarrow> p \<inter> p' = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p p'. \<lbrakk>p \<in> {g \<times> I |g. g \<in> G}; p' \<in> {g \<times> I |g. g \<in> G}; p \<noteq> p'\<rbrakk> \<Longrightarrow> p \<inter> p' = {}
[PROOF STEP]
by (smt (verit, best) Sigma_Int_distrib1 Sigma_empty1 assms(4) mem_Collect_eq partition_onE)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?p \<in> {g \<times> I |g. g \<in> G}; ?p' \<in> {g \<times> I |g. g \<in> G}; ?p \<noteq> ?p'\<rbrakk> \<Longrightarrow> ?p \<inter> ?p' = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Join_commute: "F\<squnion>G = G\<squnion>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<squnion> G = G \<squnion> F
[PROOF STEP]
by (simp add: Join_def Un_commute Int_commute)


[STATEMENT]
lemma of_real_arccos: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> of_real(arccos x) = Arccos(of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> 1 \<Longrightarrow> complex_of_real (arccos x) = Arccos (complex_of_real x)
[PROOF STEP]
by (metis Im_Arccos_of_real add.right_neutral arccos_eq_Re_Arccos complex_eq mult_zero_right of_real_0)


[STATEMENT]
lemma homologous_rel_singular_relcycle:
  assumes "homologous_rel p X S c1 c2"
  shows "singular_relcycle p X S c1 = singular_relcycle p X S c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_relcycle p X S c1 = singular_relcycle p X S c2
[PROOF STEP]
using assms homologous_rel_singular_relcycle_1
[PROOF STATE]
proof (prove)
using this:
homologous_rel p X S c1 c2
\<lbrakk>homologous_rel ?p ?X ?S ?c1.0 ?c2.0; singular_relcycle ?p ?X ?S ?c1.0\<rbrakk> \<Longrightarrow> singular_relcycle ?p ?X ?S ?c2.0

goal (1 subgoal):
 1. singular_relcycle p X S c1 = singular_relcycle p X S c2
[PROOF STEP]
using homologous_rel_sym
[PROOF STATE]
proof (prove)
using this:
homologous_rel p X S c1 c2
\<lbrakk>homologous_rel ?p ?X ?S ?c1.0 ?c2.0; singular_relcycle ?p ?X ?S ?c1.0\<rbrakk> \<Longrightarrow> singular_relcycle ?p ?X ?S ?c2.0
homologous_rel ?p ?X ?S ?a ?b = homologous_rel ?p ?X ?S ?b ?a

goal (1 subgoal):
 1. singular_relcycle p X S c1 = singular_relcycle p X S c2
[PROOF STEP]
by blast


[STATEMENT]
theorem tableau_soundness:
  \<open>tableauproof ps p \<Longrightarrow> list_all (eval e f g) ps \<Longrightarrow> eval e f g p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>tableauproof ps p; list_all (eval e f g) ps\<rbrakk> \<Longrightarrow> eval e f g p
[PROOF STEP]
using TC_soundness
[PROOF STATE]
proof (prove)
using this:
\<stileturn> ?G \<Longrightarrow> \<exists>p\<in>set ?G. \<not> eval ?e ?f ?g p

goal (1 subgoal):
 1. \<lbrakk>tableauproof ps p; list_all (eval e f g) ps\<rbrakk> \<Longrightarrow> eval e f g p
[PROOF STEP]
unfolding tableauproof_def list_all_def
[PROOF STATE]
proof (prove)
using this:
\<stileturn> ?G \<Longrightarrow> \<exists>p\<in>set ?G. \<not> eval ?e ?f ?g p

goal (1 subgoal):
 1. \<lbrakk>\<stileturn> Neg p # ps; Ball (set ps) (eval e f g)\<rbrakk> \<Longrightarrow> eval e f g p
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Ima''m_calc_aux: "$(I^{m}a'')^{m}_n = (\<Sum>k<n*m. $v.^(k/m) * (k+1) / m^2)"
  if "m \<noteq> 0" for m::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $(I^{m}a'')^{m}_n = (\<Sum>k<n * m. $v .^ (real k / real m) * real (k + 1) / real (m\<^sup>2))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0

goal (1 subgoal):
 1. $(I^{m}a'')^{m}_n = (\<Sum>k<n * m. $v .^ (real k / real m) * real (k + 1) / real (m\<^sup>2))
[PROOF STEP]
apply (subst Ila''m_Ilam, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (1 + i) .^ (1 / real m) * $(I^{m}a)^{m}_n = (\<Sum>k<n * m. $v .^ (real k / real m) * real (k + 1) / real (m\<^sup>2))
[PROOF STEP]
apply (subst Imam_calc_aux, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (1 + i) .^ (1 / real m) * (\<Sum>k<n * m. $v .^ (real (k + 1) / real m) * real (k + 1) / real (m\<^sup>2)) = (\<Sum>k<n * m. $v .^ (real k / real m) * real (k + 1) / real (m\<^sup>2))
[PROOF STEP]
apply (subst sum_distrib_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<Sum>n<n * m. (1 + i) .^ (1 / real m) * ($v .^ (real (n + 1) / real m) * real (n + 1) / real (m\<^sup>2))) = (\<Sum>k<n * m. $v .^ (real k / real m) * real (k + 1) / real (m\<^sup>2))
[PROOF STEP]
apply (rule sum.cong; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < m; x < n * m\<rbrakk> \<Longrightarrow> (1 + i) .^ (1 / real m) * $v .^ ((1 + real x) / real m) = $v .^ (real x / real m)
[PROOF STEP]
using powr_add[of "$v", THEN sym] i_v_powr
[PROOF STATE]
proof (prove)
using this:
$v .^ ?a1 * $v .^ ?b1 = $v .^ (?a1 + ?b1)
(1 + i) .^ ?a = $v .^ - ?a

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < m; x < n * m\<rbrakk> \<Longrightarrow> (1 + i) .^ (1 / real m) * $v .^ ((1 + real x) / real m) = $v .^ (real x / real m)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma exists_smaller_in_list0[simp]:
  "\<lbrakk>m \<noteq> n; m < length initlm; n < length initlm;
    k + l = initlm ! m + initlm ! n; k \<le> initlm ! m; 0 < k\<rbrakk>
 \<Longrightarrow> \<exists>ka la. initlm[m := k, n := l, m := k - Suc 0] =
     initlm[m := ka, n := la] \<and>
     Suc (ka + la) = initlm ! m + initlm ! n \<and>
     ka < initlm ! m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<noteq> n; m < length initlm; n < length initlm; k + l = initlm ! m + initlm ! n; k \<le> initlm ! m; 0 < k\<rbrakk> \<Longrightarrow> \<exists>ka la. initlm[m := k, n := l, m := k - Suc 0] = initlm[m := ka, n := la] \<and> Suc (ka + la) = initlm ! m + initlm ! n \<and> ka < initlm ! m
[PROOF STEP]
apply(rule_tac x = "k - Suc 0" in exI, rule_tac x = l in exI, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<noteq> n; m < length initlm; n < length initlm; k + l = initlm ! m + initlm ! n; k \<le> initlm ! m; 0 < k\<rbrakk> \<Longrightarrow> initlm[m := k, n := l, m := k - Suc 0] = initlm[m := k - Suc 0, n := l]
[PROOF STEP]
apply(subgoal_tac
      "initlm[m := k, n := l, m := k - Suc 0] =
       initlm[n := l, m := k, m := k - Suc 0]",force intro:list_update_swap)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<noteq> n; m < length initlm; n < length initlm; k + l = initlm ! m + initlm ! n; k \<le> initlm ! m; 0 < k\<rbrakk> \<Longrightarrow> initlm[m := k, n := l, m := k - Suc 0] = initlm[n := l, m := k, m := k - Suc 0]
[PROOF STEP]
by(simp add: list_update_swap)


[STATEMENT]
lemma Lambert_W'_eq_iff [simp]:
  "x \<in> {-exp(-1)..<0} \<Longrightarrow> y \<in> {-exp(-1)..<0} \<Longrightarrow> Lambert_W' x = Lambert_W' y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> {- exp (- 1)..<0}; y \<in> {- exp (- 1)..<0}\<rbrakk> \<Longrightarrow> (Lambert_W' x = Lambert_W' y) = (x = y)
[PROOF STEP]
using Lambert_W'_strict_antimono[of x y] Lambert_W'_strict_antimono[of y x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- exp (- 1) \<le> x; x < y; y < 0\<rbrakk> \<Longrightarrow> Lambert_W' y < Lambert_W' x
\<lbrakk>- exp (- 1) \<le> y; y < x; x < 0\<rbrakk> \<Longrightarrow> Lambert_W' x < Lambert_W' y

goal (1 subgoal):
 1. \<lbrakk>x \<in> {- exp (- 1)..<0}; y \<in> {- exp (- 1)..<0}\<rbrakk> \<Longrightarrow> (Lambert_W' x = Lambert_W' y) = (x = y)
[PROOF STEP]
by (cases x y rule: linorder_cases) auto


[STATEMENT]
lemma f_join_Nil_conv: "(xs \<Join>\<^sub>f I = []) = (I \<down>< length xs = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<Join>\<^sub> I = []) = (I \<down>< length xs = {})
[PROOF STEP]
by (simp add: length_0_conv[symmetric] f_join_length card_0_eq[OF nat_cut_less_finite] del: length_0_conv)


[STATEMENT]
lemma par_strict_not_col_2:
  assumes "A B ParStrict C D"
  shows "\<not> Col B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Col B C D
[PROOF STEP]
using ParStrict_def assms col_trivial_3
[PROOF STATE]
proof (prove)
using this:
?A ?B ParStrict ?C ?D \<equiv> Coplanar ?A ?B ?C ?D \<and> (\<nexists>X. Col X ?A ?B \<and> Col X ?C ?D)
A B ParStrict C D
Col ?A ?B ?A

goal (1 subgoal):
 1. \<not> Col B C D
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_insort: "mset (insort xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (insort xs) = mset xs
[PROOF STEP]
apply(induction xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mset (insort []) = mset []
 2. \<And>a xs. mset (insort xs) = mset xs \<Longrightarrow> mset (insort (a # xs)) = mset (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. mset (insort xs) = mset xs \<Longrightarrow> mset (insort (a # xs)) = mset (a # xs)
[PROOF STEP]
apply (simp add: mset_insort1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma knights_path_6xm_ul_exists:
  assumes "m \<ge> 5"
  shows "\<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1,1) \<and> last ps = (5,2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
5 \<le> m

goal (1 subgoal):
 1. \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
proof (induction m rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>y < x; 5 \<le> y\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 y) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2); 5 \<le> x\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 x) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
case (less m)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y < m; 5 \<le> ?y\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 ?y) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
5 \<le> m

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>y < x; 5 \<le> y\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 y) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2); 5 \<le> x\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 x) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y < m; 5 \<le> ?y\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 ?y) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
5 \<le> m
[PROOF STEP]
have "m \<in> {5,6,7,8,9} \<or> 5 \<le> m-5"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y < m; 5 \<le> ?y\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 ?y) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
5 \<le> m

goal (1 subgoal):
 1. m \<in> {5, 6, 7, 8, 9} \<or> 5 \<le> m - 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m \<in> {5, 6, 7, 8, 9} \<or> 5 \<le> m - 5

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>y < x; 5 \<le> y\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 y) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2); 5 \<le> x\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 x) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<in> {5, 6, 7, 8, 9} \<or> 5 \<le> m - 5
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m \<in> {5, 6, 7, 8, 9} \<or> 5 \<le> m - 5

goal (1 subgoal):
 1. \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
proof (elim disjE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m \<in> {5, 6, 7, 8, 9} \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
 2. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
assume "m \<in> {5,6,7,8,9}"
[PROOF STATE]
proof (state)
this:
m \<in> {5, 6, 7, 8, 9}

goal (2 subgoals):
 1. m \<in> {5, 6, 7, 8, 9} \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
 2. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<in> {5, 6, 7, 8, 9}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m \<in> {5, 6, 7, 8, 9}

goal (1 subgoal):
 1. \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
using kp_6xm_ul
[PROOF STATE]
proof (prove)
using this:
m \<in> {5, 6, 7, 8, 9}
knights_path b6x5 kp6x5ul
hd kp6x5ul = (1, 1)
last kp6x5ul = (5, 2)
kp6x5ul \<noteq> []
knights_path b6x6 kp6x6ul
hd kp6x6ul = (1, 1)
last kp6x6ul = (5, 2)
kp6x6ul \<noteq> []
knights_path b6x7 kp6x7ul
hd kp6x7ul = (1, 1)
last kp6x7ul = (5, 2)
kp6x7ul \<noteq> []
knights_path b6x8 kp6x8ul
hd kp6x8ul = (1, 1)
last kp6x8ul = (5, 2)
kp6x8ul \<noteq> []
knights_path b6x9 kp6x9ul
hd kp6x9ul = (1, 1)
last kp6x9ul = (5, 2)
kp6x9ul \<noteq> []

goal (1 subgoal):
 1. \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
let ?ps\<^sub>1="kp6x5ul"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
let ?b\<^sub>1="board 6 5"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
have ps\<^sub>1_prems: "knights_path ?b\<^sub>1 ?ps\<^sub>1" "hd ?ps\<^sub>1 = (1,1)" "last ?ps\<^sub>1 = (5,2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knights_path b6x5 kp6x5ul &&& hd kp6x5ul = (1, 1) &&& last kp6x5ul = (5, 2)
[PROOF STEP]
using kp_6xm_ul
[PROOF STATE]
proof (prove)
using this:
knights_path b6x5 kp6x5ul
hd kp6x5ul = (1, 1)
last kp6x5ul = (5, 2)
kp6x5ul \<noteq> []
knights_path b6x6 kp6x6ul
hd kp6x6ul = (1, 1)
last kp6x6ul = (5, 2)
kp6x6ul \<noteq> []
knights_path b6x7 kp6x7ul
hd kp6x7ul = (1, 1)
last kp6x7ul = (5, 2)
kp6x7ul \<noteq> []
knights_path b6x8 kp6x8ul
hd kp6x8ul = (1, 1)
last kp6x8ul = (5, 2)
kp6x8ul \<noteq> []
knights_path b6x9 kp6x9ul
hd kp6x9ul = (1, 1)
last kp6x9ul = (5, 2)
kp6x9ul \<noteq> []

goal (1 subgoal):
 1. knights_path b6x5 kp6x5ul &&& hd kp6x5ul = (1, 1) &&& last kp6x5ul = (5, 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
knights_path b6x5 kp6x5ul
hd kp6x5ul = (1, 1)
last kp6x5ul = (5, 2)

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
assume m_ge: "5 \<le> m-5"
[PROOF STATE]
proof (state)
this:
5 \<le> m - 5

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
(* \<longleftrightarrow> 10 \<le> m *)
[PROOF STATE]
proof (state)
this:
5 \<le> m - 5

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
5 \<le> m - 5
[PROOF STEP]
obtain ps\<^sub>2 where ps\<^sub>2_IH: "knights_path (board 6 (m-5)) ps\<^sub>2" "hd ps\<^sub>2 = (1,1)"
                                "last ps\<^sub>2 = (5,2)"
[PROOF STATE]
proof (prove)
using this:
5 \<le> m - 5

goal (1 subgoal):
 1. (\<And>ps\<^sub>2. \<lbrakk>knights_path (board 6 (m - 5)) ps\<^sub>2; hd ps\<^sub>2 = (1, 1); last ps\<^sub>2 = (5, 2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using less.IH[of "m-5"] knights_path_non_nil
[PROOF STATE]
proof (prove)
using this:
5 \<le> m - 5
\<lbrakk>m - 5 < m; 5 \<le> m - 5\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 (m - 5)) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
knights_path ?b ?ps \<Longrightarrow> ?ps \<noteq> []

goal (1 subgoal):
 1. (\<And>ps\<^sub>2. \<lbrakk>knights_path (board 6 (m - 5)) ps\<^sub>2; hd ps\<^sub>2 = (1, 1); last ps\<^sub>2 = (5, 2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
knights_path (board 6 (m - 5)) ps\<^sub>2
hd ps\<^sub>2 = (1, 1)
last ps\<^sub>2 = (5, 2)

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
have "27 < length ?ps\<^sub>1" "last (take 27 ?ps\<^sub>1) = (2,4)" "hd (drop 27 ?ps\<^sub>1) = (4,5)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 27 < length kp6x5ul &&& last (take 27 kp6x5ul) = (2, 4) &&& hd (drop 27 kp6x5ul) = (4, 5)
[PROOF STEP]
by eval+
[PROOF STATE]
proof (state)
this:
27 < length kp6x5ul
last (take 27 kp6x5ul) = (2, 4)
hd (drop 27 kp6x5ul) = (4, 5)

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
27 < length kp6x5ul
last (take 27 kp6x5ul) = (2, 4)
hd (drop 27 kp6x5ul) = (4, 5)
[PROOF STEP]
have "step_in ?ps\<^sub>1 (2,4) (4,5)"
[PROOF STATE]
proof (prove)
using this:
27 < length kp6x5ul
last (take 27 kp6x5ul) = (2, 4)
hd (drop 27 kp6x5ul) = (4, 5)

goal (1 subgoal):
 1. step_in kp6x5ul (2, 4) (4, 5)
[PROOF STEP]
unfolding step_in_def
[PROOF STATE]
proof (prove)
using this:
27 < length kp6x5ul
last (take 27 kp6x5ul) = (2, 4)
hd (drop 27 kp6x5ul) = (4, 5)

goal (1 subgoal):
 1. \<exists>k>0. k < length kp6x5ul \<and> last (take k kp6x5ul) = (2, 4) \<and> hd (drop k kp6x5ul) = (4, 5)
[PROOF STEP]
using zero_less_numeral
[PROOF STATE]
proof (prove)
using this:
27 < length kp6x5ul
last (take 27 kp6x5ul) = (2, 4)
hd (drop 27 kp6x5ul) = (4, 5)
(0::?'a) < numeral ?n

goal (1 subgoal):
 1. \<exists>k>0. k < length kp6x5ul \<and> last (take k kp6x5ul) = (2, 4) \<and> hd (drop k kp6x5ul) = (4, 5)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
step_in kp6x5ul (2, 4) (4, 5)

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
step_in kp6x5ul (2, 4) (4, 5)
[PROOF STEP]
have "step_in ?ps\<^sub>1 (2,4) (4,5)"
              "valid_step (2,4) (1,int 5+1)"
              "valid_step (5,int 5+2) (4,5)"
[PROOF STATE]
proof (prove)
using this:
step_in kp6x5ul (2, 4) (4, 5)

goal (1 subgoal):
 1. step_in kp6x5ul (2, 4) (4, 5) &&& valid_step (2, 4) (1, int 5 + 1) &&& valid_step (5, int 5 + 2) (4, 5)
[PROOF STEP]
unfolding valid_step_def
[PROOF STATE]
proof (prove)
using this:
step_in kp6x5ul (2, 4) (4, 5)

goal (1 subgoal):
 1. step_in kp6x5ul (2, 4) (4, 5) &&& case (2, 4) of (i, j) \<Rightarrow> (1, int 5 + 1) \<in> {(i + 1, j + 2), (i - 1, j + 2), (i + 1, j - 2), (i - 1, j - 2), (i + 2, j + 1), (i - 2, j + 1), (i + 2, j - 1), (i - 2, j - 1)} &&& case (5, int 5 + 2) of (i, j) \<Rightarrow> (4, 5) \<in> {(i + 1, j + 2), (i - 1, j + 2), (i + 1, j - 2), (i - 1, j - 2), (i + 2, j + 1), (i - 2, j + 1), (i + 2, j - 1), (i - 2, j - 1)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
step_in kp6x5ul (2, 4) (4, 5)
valid_step (2, 4) (1, int 5 + 1)
valid_step (5, int 5 + 2) (4, 5)

goal (1 subgoal):
 1. 5 \<le> m - 5 \<Longrightarrow> \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
step_in kp6x5ul (2, 4) (4, 5)
valid_step (2, 4) (1, int 5 + 1)
valid_step (5, int 5 + 2) (4, 5)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
step_in kp6x5ul (2, 4) (4, 5)
valid_step (2, 4) (1, int 5 + 1)
valid_step (5, int 5 + 2) (4, 5)

goal (1 subgoal):
 1. \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
using \<open>5 \<le> m-5\<close> ps\<^sub>1_prems ps\<^sub>2_IH knights_path_split_concat[of 6 5 ?ps\<^sub>1 "m-5" ps\<^sub>2]
[PROOF STATE]
proof (prove)
using this:
step_in kp6x5ul (2, 4) (4, 5)
valid_step (2, 4) (1, int 5 + 1)
valid_step (5, int 5 + 2) (4, 5)
5 \<le> m - 5
knights_path b6x5 kp6x5ul
hd kp6x5ul = (1, 1)
last kp6x5ul = (5, 2)
knights_path (board 6 (m - 5)) ps\<^sub>2
hd ps\<^sub>2 = (1, 1)
last ps\<^sub>2 = (5, 2)
\<lbrakk>knights_path b6x5 kp6x5ul; knights_path (board 6 (m - 5)) ps\<^sub>2; step_in kp6x5ul ?s\<^sub>i ?s\<^sub>j; hd ps\<^sub>2 = (?i\<^sub>h, ?j\<^sub>h); last ps\<^sub>2 = (?i\<^sub>l, ?j\<^sub>l); valid_step ?s\<^sub>i (?i\<^sub>h, int 5 + ?j\<^sub>h); valid_step (?i\<^sub>l, int 5 + ?j\<^sub>l) ?s\<^sub>j\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board 6 (5 + (m - 5))) ps \<and> hd ps = hd kp6x5ul \<and> last ps = last kp6x5ul

goal (1 subgoal):
 1. \<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ps. knights_path (board 6 m) ps \<and> hd ps = (1, 1) \<and> last ps = (5, 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma round_mono: "x \<le> y \<Longrightarrow> round x \<le> round y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> round x \<le> round y
[PROOF STEP]
unfolding round_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> \<lfloor>y + (1::'a) / (2::'a)\<rfloor>
[PROOF STEP]
by (intro floor_mono) simp


[STATEMENT]
lemma is_distinguishing_formula_eqvt (*[eqvt]*):
    assumes "x distinguishes P from Q" shows "(p \<bullet> x) distinguishes (p \<bullet> P) from (p \<bullet> Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<bullet> x) distinguishes (p \<bullet> P) from (p \<bullet> Q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x distinguishes P from Q

goal (1 subgoal):
 1. (p \<bullet> x) distinguishes (p \<bullet> P) from (p \<bullet> Q)
[PROOF STEP]
unfolding is_distinguishing_formula_def
[PROOF STATE]
proof (prove)
using this:
P \<Turnstile> x \<and> \<not> Q \<Turnstile> x

goal (1 subgoal):
 1. p \<bullet> P \<Turnstile> p \<bullet> x \<and> \<not> p \<bullet> Q \<Turnstile> p \<bullet> x
[PROOF STEP]
by (metis permute_minus_cancel(2) valid_eqvt)


[STATEMENT]
lemma floor_conv_div_nat:
  "of_int (floor (real m / real n)) = real (m div n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lfloor>real m / real n\<rfloor> = real (m div n)
[PROOF STEP]
by (subst floor_divide_of_nat_eq) simp


[STATEMENT]
lemma fact_diff_Suc: "n < Suc m \<Longrightarrow> fact (Suc m - n) = (Suc m - n) * fact (m - n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < Suc m \<Longrightarrow> fact (Suc m - n) = (Suc m - n) * fact (m - n)
[PROOF STEP]
by (subst fact_reduce) auto


[STATEMENT]
lemma expands_to_power:
  assumes "trimmed F" "basis_wf basis" "(f expands_to F) basis"
  shows   "((\<lambda>x. f x ^ n) expands_to power_expansion abort F n) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x ^ n) expands_to power_expansion abort F n) basis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
trimmed F
basis_wf basis
(f expands_to F) basis

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ n) expands_to power_expansion abort F n) basis
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_power elim: eventually_mono)


[STATEMENT]
lemma permutations_of_multiset_empty [simp]: "permutations_of_multiset {#} = {[]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_multiset {#} = {[]}
[PROOF STEP]
unfolding permutations_of_multiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. mset xs = {#}} = {[]}
[PROOF STEP]
by simp


[STATEMENT]
lemma eint_plus_times:
  assumes "(d::eint) \<ge> 0"
  assumes "(b::eint) \<ge> c + (eint k)*d"
  assumes "k \<ge> l"
  shows "b \<ge> c + l*d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c + eint l * d \<le> b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c + eint l * d \<le> b
[PROOF STEP]
have "k*d \<ge> l*d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eint l * d \<le> eint k * d
[PROOF STEP]
by (smt assms(1) assms(3) eint_mult_mono' eint_ord_simps(2) eq_iff times_eint_simps(4))
[PROOF STATE]
proof (state)
this:
eint l * d \<le> eint k * d

goal (1 subgoal):
 1. c + eint l * d \<le> b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
eint l * d \<le> eint k * d

goal (1 subgoal):
 1. c + eint l * d \<le> b
[PROOF STEP]
by (meson add_mono_thms_linordered_semiring(2) assms(2) order_subst2)
[PROOF STATE]
proof (state)
this:
c + eint l * d \<le> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p2_ident: "int (CARD('a) - 2) = p - 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (CARD('a) - 2) = p - 2
[PROOF STEP]
using p2
[PROOF STATE]
proof (prove)
using this:
2 \<le> p

goal (1 subgoal):
 1. int (CARD('a) - 2) = p - 2
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
using this:
2 \<le> int CARD('a)

goal (1 subgoal):
 1. int (CARD('a) - 2) = int CARD('a) - 2
[PROOF STEP]
by simp


[STATEMENT]
lemma sign_changes_poly_times_one_minus_x:
  fixes g :: "'a :: linordered_idom poly" and a :: 'a
  assumes nz: "g \<noteq> 0"
  defines "v \<equiv> coeff_sign_changes"
  shows "v ([:1, -1:] * g) - v g > 0 \<and> odd (v ([:1, -1:] * g) - v g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
define xs where "xs = coeffs ([:1, -1:] * g)"
[PROOF STATE]
proof (state)
this:
xs = coeffs ([:1::'a, - (1::'a):] * g)

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
define ys where "ys = coeffs g @ [0]"
[PROOF STATE]
proof (state)
this:
ys = coeffs g @ [0::'a]

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
have ys: "ys = psums xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ys = psums xs
[PROOF STEP]
proof (rule Poly_times_one_minus_x_eq_psums)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length xs = length ys
 2. Poly xs = Poly ys * [:1::'a, - (1::'a):]
[PROOF STEP]
show "length xs = length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
unfolding xs_def ys_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (coeffs ([:1::'a, - (1::'a):] * g)) = length (coeffs g @ [0::'a])
[PROOF STEP]
by (simp add: length_coeffs nz degree_mult_eq no_zero_divisors del: mult_pCons_left)
[PROOF STATE]
proof (state)
this:
length xs = length ys

goal (1 subgoal):
 1. Poly xs = Poly ys * [:1::'a, - (1::'a):]
[PROOF STEP]
show "Poly xs = Poly ys * [:1, - 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly xs = Poly ys * [:1::'a, - (1::'a):]
[PROOF STEP]
unfolding xs_def ys_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (coeffs ([:1::'a, - (1::'a):] * g)) = Poly (coeffs g @ [0::'a]) * [:1::'a, - (1::'a):]
[PROOF STEP]
by (simp only: Poly_snoc Poly_coeffs) simp
[PROOF STATE]
proof (state)
this:
Poly xs = Poly ys * [:1::'a, - (1::'a):]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ys = psums xs

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "sign_changes (psums xs) < sign_changes xs \<and>
        odd (sign_changes xs - sign_changes (psums xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes (psums xs) < sign_changes xs \<and> odd (sign_changes xs - sign_changes (psums xs))
[PROOF STEP]
proof (rule arthan)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. xs \<noteq> []
 2. last xs \<noteq> (0::'a)
 3. sum_list xs = (0::'a)
[PROOF STEP]
show "xs \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> []
[PROOF STEP]
by (auto simp: xs_def nz simp del: mult_pCons_left)
[PROOF STATE]
proof (state)
this:
xs \<noteq> []

goal (2 subgoals):
 1. last xs \<noteq> (0::'a)
 2. sum_list xs = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
[PROOF STEP]
show "sum_list xs = 0"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. sum_list xs = (0::'a)
[PROOF STEP]
by (simp add: last_psums [symmetric] ys [symmetric] ys_def)
[PROOF STATE]
proof (state)
this:
sum_list xs = (0::'a)

goal (1 subgoal):
 1. last xs \<noteq> (0::'a)
[PROOF STEP]
show "last xs \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last xs \<noteq> (0::'a)
[PROOF STEP]
by (auto simp: xs_def nz last_coeffs_eq_coeff_degree simp del: mult_pCons_left)
[PROOF STATE]
proof (state)
this:
last xs \<noteq> (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sign_changes (psums xs) < sign_changes xs \<and> odd (sign_changes xs - sign_changes (psums xs))

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
with ys
[PROOF STATE]
proof (chain)
picking this:
ys = psums xs
sign_changes (psums xs) < sign_changes xs \<and> odd (sign_changes xs - sign_changes (psums xs))
[PROOF STEP]
have "sign_changes ys < sign_changes xs \<and>
                odd (sign_changes xs - sign_changes ys)"
[PROOF STATE]
proof (prove)
using this:
ys = psums xs
sign_changes (psums xs) < sign_changes xs \<and> odd (sign_changes xs - sign_changes (psums xs))

goal (1 subgoal):
 1. sign_changes ys < sign_changes xs \<and> odd (sign_changes xs - sign_changes ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sign_changes ys < sign_changes xs \<and> odd (sign_changes xs - sign_changes ys)

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sign_changes ys < sign_changes xs \<and> odd (sign_changes xs - sign_changes ys)

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "sign_changes xs = v ([:1, -1:] * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes xs = v ([:1::'a, - (1::'a):] * g)
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes xs = sign_changes (coeffs ([:1::'a, - (1::'a):] * g))
[PROOF STEP]
by (intro sign_changes_coeff_sign_changes) (simp_all add: xs_def)
[PROOF STATE]
proof (state)
this:
sign_changes xs = v ([:1::'a, - (1::'a):] * g)

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sign_changes xs = v ([:1::'a, - (1::'a):] * g)

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "sign_changes ys = v g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes ys = v g
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes ys = sign_changes (coeffs g)
[PROOF STEP]
by (intro sign_changes_coeff_sign_changes) (simp_all add: ys_def Poly_snoc)
[PROOF STATE]
proof (state)
this:
sign_changes ys = v g

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
v g < v ([:1::'a, - (1::'a):] * g) \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v g < v ([:1::'a, - (1::'a):] * g) \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < v ([:1::'a, - (1::'a):] * g) - v g \<and> odd (v ([:1::'a, - (1::'a):] * g) - v g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hnorm_minus_cancel [simp]: "\<And>x::'a::real_normed_vector star. hnorm (- x) = hnorm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. hnorm (- x) = hnorm x
[PROOF STEP]
by transfer (rule norm_minus_cancel)


[STATEMENT]
lemma iT_Mult_finite_iff: "0 < k \<Longrightarrow> finite (I \<otimes> k) = finite I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> finite (I \<otimes> k) = finite I
[PROOF STEP]
by (simp add: iT_Mult_def inj_on_finite_image_iff[OF inj_imp_inj_on] mult_right_inj)


[STATEMENT]
lemma iMinI2_order:"
  \<lbrakk> k \<in> I; \<And>y. y \<in> I \<Longrightarrow> k \<le> y;
    \<And>x. \<lbrakk> x \<in> I; \<forall>y\<in>I. x \<le> y \<rbrakk> \<Longrightarrow> P x \<rbrakk> \<Longrightarrow>
  P (iMin I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<in> I; \<And>y. y \<in> I \<Longrightarrow> k \<le> y; \<And>x. \<lbrakk>x \<in> I; \<forall>y\<in>I. x \<le> y\<rbrakk> \<Longrightarrow> P x\<rbrakk> \<Longrightarrow> P (iMin I)
[PROOF STEP]
by (simp add: iMin_def LeastI2_order)


[STATEMENT]
lemma sqrt_rat_floor[simp]: "sqrt_rat_floor x = \<lfloor> sqrt (of_rat x) \<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_rat_floor x = \<lfloor>sqrt (real_of_rat x)\<rfloor>
[PROOF STEP]
unfolding sqrt_rat_floor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root_rat_floor 2 x = \<lfloor>sqrt (real_of_rat x)\<rfloor>
[PROOF STEP]
by (simp add: sqrt_def)


[STATEMENT]
theorem Sum_List_sums:
  "{{xs = \<guillemotleft>XS\<guillemotright>}} Sum_List {{ans = list_sum(xs)}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>&xs =\<^sub>u \<guillemotleft>XS\<guillemotright>\<rbrace> i := 0 ;; ans := 0 ;; while &i <\<^sub>u #\<^sub>u(&xs) invr &ans =\<^sub>u sum\<^sub>u(take\<^sub>u(&i, &xs)) do ans := &ans + &xs(&i)\<^sub>a ;; i := &i + 1 od \<lbrace>&ans =\<^sub>u sum\<^sub>u(&xs)\<rbrace>\<^sub>u
[PROOF STEP]
by (hoare_auto, metis add.foldr_snoc take_Suc_conv_app_nth)


[STATEMENT]
lemma inext_le_mono_infin_rev: "
  \<lbrakk> inext a I \<le> inext b I; a \<in> I; b \<in> I; infinite I \<rbrakk> \<Longrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inext a I \<le> inext b I; a \<in> I; b \<in> I; infinite I\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
by (metis inext_in_iff inext_le_mono_rev inext_mono2_infin_fin)


[STATEMENT]
lemma dfa_of_pf'_correctness:
  "list_all (is_alph n) bss \<Longrightarrow>
     dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss)
[PROOF STEP]
proof (induct n p arbitrary: bss rule: dfa_of_pf'_induct)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)
 2. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 5. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 8. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Eq n ks l)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) bss

goal (8 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)
 2. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 5. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 8. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: eq_dfa_accepts)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (Eq ks l)) bss = eval_pf (Eq ks l) (nats_of_boolss n bss)

goal (7 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Le n ks l)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) bss

goal (7 subgoals):
 1. \<And>n ks l bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 4. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 7. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: ineq_dfa_accepts)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (Le ks l)) bss = eval_pf (Le ks l) (nats_of_boolss n bss)

goal (6 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (And n p q)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (6 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 3. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 6. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: and_dfa_accepts [of _ n] dfa_of_pf'_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (And p q)) bss = eval_pf (And p q) (nats_of_boolss n bss)

goal (5 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Or n p q)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (5 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
 2. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 5. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: or_dfa_accepts [of _ n] dfa_of_pf'_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (Or p q)) bss = eval_pf (Or p q) (nats_of_boolss n bss)

goal (4 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Imp n p q)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (4 subgoals):
 1. \<And>n p q bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); \<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) bss = eval_pf q (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 4. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n q) ?bss = eval_pf q (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: imp_dfa_accepts [of _ n] dfa_of_pf'_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (Imp p q)) bss = eval_pf (Imp p q) (nats_of_boolss n bss)

goal (3 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
case (Neg n p)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (3 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
 3. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) bss = eval_pf p (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n p) ?bss = eval_pf p (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add: dfa_accepts_negate [of _ n] dfa_of_pf'_well_formed)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (Neg p)) bss = eval_pf (Neg p) (nats_of_boolss n bss)

goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
case (Exist n p)
[PROOF STATE]
proof (state)
this:
list_all (is_alph (Suc n)) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) ?bss = eval_pf p (nats_of_boolss (Suc n) ?bss)
list_all (is_alph n) bss

goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
have "(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) =
    (\<exists>x. eval_pf p (x # nats_of_boolss n bss))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k \<Longrightarrow> \<exists>x. eval_pf p (x # nats_of_boolss n bss)
 2. \<exists>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (erule exE conjE)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k bs. \<lbrakk>eval_pf p (nat_of_bools bs # nats_of_boolss n bss); length bs = length bss + k\<rbrakk> \<Longrightarrow> \<exists>x. eval_pf p (x # nats_of_boolss n bss)
 2. \<exists>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (erule exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k
[PROOF STEP]
apply (rule_tac x="length (bools_of_nat (length bss) x) - length bss" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> \<exists>bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + (length (bools_of_nat (length bss) x) - length bss)
[PROOF STEP]
apply (rule_tac x="bools_of_nat (length bss) x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. eval_pf p (x # nats_of_boolss n bss) \<Longrightarrow> eval_pf p (nat_of_bools (bools_of_nat (length bss) x) # nats_of_boolss n bss) \<and> length (bools_of_nat (length bss) x) = length bss + (length (bools_of_nat (length bss) x) - length bss)
[PROOF STEP]
apply (simp add: bools_of_nat_inverse bools_of_nat_length)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))

goal (2 subgoals):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph (Suc n)) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) bss = eval_pf p (nats_of_boolss (Suc n) bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
 2. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
with Exist
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph (Suc n)) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) ?bss = eval_pf p (nats_of_boolss (Suc n) ?bss)
list_all (is_alph n) bss
(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph (Suc n)) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' (Suc n) p) ?bss = eval_pf p (nats_of_boolss (Suc n) ?bss)
list_all (is_alph n) bss
(\<exists>k bs. eval_pf p (nat_of_bools bs # nats_of_boolss n bss) \<and> length bs = length bss + k) = (\<exists>x. eval_pf p (x # nats_of_boolss n bss))

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)
[PROOF STEP]
by (simp add:
    rquot_accepts det_wf_nfa quantify_nfa_well_formed_aut dfa2wf_nfa
    det_nfa_accepts [of _ n] zeros_is_alpha nfa_accepts_quantify_nfa [of _ n]
    nfa_of_dfa_accepts [of _ "Suc n"] insertll_len2 nats_of_boolss_insertll
    zeros_len nats_of_boolss_append nats_of_boolss_zeros zip_replicate_mapr
    nats_of_boolss_length o_def insertl_0_eq
    dfa_of_pf'_well_formed min_dfa_accept [of _ n] min_dfa_wf rquot_well_formed_aut
    cong: rev_conj_cong)
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (Exist p)) bss = eval_pf (Exist p) (nats_of_boolss n bss)

goal (1 subgoal):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
case (Forall n p)
[PROOF STATE]
proof (state)
this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) ?bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. \<And>n p bss. \<lbrakk>\<And>bss. list_all (is_alph n) bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n bss); list_all (is_alph n) bss\<rbrakk> \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) ?bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n ?bss)
list_all (is_alph n) bss
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) ?bss \<Longrightarrow> dfa_accepts (dfa_of_pf' n (Neg (Exist (Neg p)))) ?bss = eval_pf (Neg (Exist (Neg p))) (nats_of_boolss n ?bss)
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dfa_accepts (dfa_of_pf' n (Forall p)) bss = eval_pf (Forall p) (nats_of_boolss n bss)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lubIa: "\<lbrakk>S \<subseteq> A; isLub S cl L\<rbrakk> \<Longrightarrow> L = lub S cl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> A; isLub S cl L\<rbrakk> \<Longrightarrow> L = lub S cl
[PROOF STEP]
by (meson isLub_lub lub_unique)


[STATEMENT]
lemma insertion_fun_single: "insertion_fun f (\<lambda>m. (a when (Poly_Mapping.single (v::nat) (n::nat)) = m)) = a * f v ^ n" (is "?i = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
have setsum_single:"\<And> a f. (\<Sum>m\<in>{a}. f m) = f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a f. sum f {a} = f a
[PROOF STEP]
by (metis add.right_neutral empty_Diff finite.emptyI sum.empty sum.insert_remove)
[PROOF STATE]
proof (state)
this:
sum ?f {?a} = ?f ?a

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
have 1:"?i = (\<Sum>m. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = (\<Sum>m. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v))
[PROOF STEP]
unfolding insertion_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)) = (\<Sum>m. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = (\<Sum>m. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v))

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
have "\<forall>m. m \<noteq> Poly_Mapping.single v n \<longrightarrow> (a when Poly_Mapping.single v n = m) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. m \<noteq> Poly_Mapping.single v n \<longrightarrow> (a when Poly_Mapping.single v n = m) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>m. m \<noteq> Poly_Mapping.single v n \<longrightarrow> (a when Poly_Mapping.single v n = m) = (0::'a)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
have "(\<Sum>m\<in>{Poly_Mapping.single v n}. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)) = ?i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>{Poly_Mapping.single v n}. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)
[PROOF STEP]
unfolding 1 when_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>{Poly_Mapping.single v n}. a * (\<Prod>v. f v ^ lookup m v) when Poly_Mapping.single v n = m) = (\<Sum>m. a * (\<Prod>v. f v ^ lookup m v) when Poly_Mapping.single v n = m)
[PROOF STEP]
unfolding when_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>{Poly_Mapping.single v n}. if Poly_Mapping.single v n = m then a * (\<Prod>v. f v ^ lookup m v) else (0::'a)) = (\<Sum>m. if Poly_Mapping.single v n = m then a * (\<Prod>v. f v ^ lookup m v) else (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<in>{Poly_Mapping.single v n}. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>m\<in>{Poly_Mapping.single v n}. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)
[PROOF STEP]
have 2:"?i = a * (\<Prod>va. f va ^ lookup (Poly_Mapping.single v n) va)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>m\<in>{Poly_Mapping.single v n}. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * (\<Prod>va. f va ^ lookup (Poly_Mapping.single v n) va)
[PROOF STEP]
unfolding setsum_single[of "\<lambda>m. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)" "Poly_Mapping.single k v"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>m\<in>{Poly_Mapping.single v n}. (a when Poly_Mapping.single v n = m) * (\<Prod>v. f v ^ lookup m v)) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * (\<Prod>va. f va ^ lookup (Poly_Mapping.single v n) va)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * (\<Prod>va. f va ^ lookup (Poly_Mapping.single v n) va)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
have "\<forall>v0. v0\<noteq>v \<longrightarrow> lookup (Poly_Mapping.single v n) v0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>v0. v0 \<noteq> v \<longrightarrow> lookup (Poly_Mapping.single v n) v0 = 0
[PROOF STEP]
by (simp add: lookup_single_not_eq)
[PROOF STATE]
proof (state)
this:
\<forall>v0. v0 \<noteq> v \<longrightarrow> lookup (Poly_Mapping.single v n) v0 = 0

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>v0. v0 \<noteq> v \<longrightarrow> lookup (Poly_Mapping.single v n) v0 = 0
[PROOF STEP]
have "\<forall>va. va\<noteq>v \<longrightarrow> f va ^ lookup (Poly_Mapping.single v n) va = 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>v0. v0 \<noteq> v \<longrightarrow> lookup (Poly_Mapping.single v n) v0 = 0

goal (1 subgoal):
 1. \<forall>va. va \<noteq> v \<longrightarrow> f va ^ lookup (Poly_Mapping.single v n) va = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>va. va \<noteq> v \<longrightarrow> f va ^ lookup (Poly_Mapping.single v n) va = (1::'a)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>va. va \<noteq> v \<longrightarrow> f va ^ lookup (Poly_Mapping.single v n) va = (1::'a)
[PROOF STEP]
have "a * (\<Prod>va\<in>{v}. f va ^ lookup (Poly_Mapping.single v n) va) = ?i"
[PROOF STATE]
proof (prove)
using this:
\<forall>va. va \<noteq> v \<longrightarrow> f va ^ lookup (Poly_Mapping.single v n) va = (1::'a)

goal (1 subgoal):
 1. a * (\<Prod>va\<in>{v}. f va ^ lookup (Poly_Mapping.single v n) va) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)
[PROOF STEP]
unfolding 2
[PROOF STATE]
proof (prove)
using this:
\<forall>va. va \<noteq> v \<longrightarrow> f va ^ lookup (Poly_Mapping.single v n) va = (1::'a)

goal (1 subgoal):
 1. a * (\<Prod>va\<in>{v}. f va ^ lookup (Poly_Mapping.single v n) va) = a * (\<Prod>va. f va ^ lookup (Poly_Mapping.single v n) va)
[PROOF STEP]
using Prod_any.expand_superset[of "{v}" "\<lambda>va. f va ^ lookup (Poly_Mapping.single v n) va", simplified]
[PROOF STATE]
proof (prove)
using this:
\<forall>va. va \<noteq> v \<longrightarrow> f va ^ lookup (Poly_Mapping.single v n) va = (1::'a)
{a. f a ^ lookup (Poly_Mapping.single v n) a \<noteq> (1::'a)} \<subseteq> {v} \<Longrightarrow> (\<Prod>va. f va ^ lookup (Poly_Mapping.single v n) va) = f v ^ n

goal (1 subgoal):
 1. a * (\<Prod>va\<in>{v}. f va ^ lookup (Poly_Mapping.single v n) va) = a * (\<Prod>va. f va ^ lookup (Poly_Mapping.single v n) va)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a * (\<Prod>va\<in>{v}. f va ^ lookup (Poly_Mapping.single v n) va) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * (\<Prod>va\<in>{v}. f va ^ lookup (Poly_Mapping.single v n) va) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a * (\<Prod>va\<in>{v}. f va ^ lookup (Poly_Mapping.single v n) va) = insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m)

goal (1 subgoal):
 1. insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
insertion_fun f (\<lambda>m. a when Poly_Mapping.single v n = m) = a * f v ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma igba_impl_rel_eext_def:
  "\<langle>Rm,Rv,Rl\<rangle>igba_impl_rel_eext \<equiv> \<langle>Rm, Rv \<rightarrow> Rl \<rightarrow> bool_rel\<rangle>gen_igba_impl_rel_eext"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>Rm, Rv, Rl\<rangle>igba_impl_rel_eext \<equiv> \<langle>Rm, Rv \<rightarrow> Rl \<rightarrow> bool_rel\<rangle>gen_igba_impl_rel_eext
[PROOF STEP]
unfolding igba_impl_rel_eext_internal_def relAPP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen_igba_impl_rel_eext Rm (fun_rel Rv (fun_rel Rl bool_rel)) \<equiv> gen_igba_impl_rel_eext Rm (fun_rel Rv (fun_rel Rl bool_rel))
[PROOF STEP]
by simp


[STATEMENT]
lemma triangle_in_graph_edge_point:
  assumes "uwellformed G"
  shows "triangle_in_graph x y z G \<longleftrightarrow> {y, z} \<in> uedges G \<and> neighbor_in_graph x y G \<and> neighbor_in_graph x z G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. triangle_in_graph x y z G = ({y, z} \<in> uedges G \<and> neighbor_in_graph x y G \<and> neighbor_in_graph x z G)
[PROOF STEP]
by (auto simp add: triangle_in_graph_def neighbor_in_graph_def assms uwellformed_alt_fst uwellformed_alt_snd)