[STATEMENT]
lemma le_floor_iff: "z \<le> \<lfloor>x\<rfloor> \<longleftrightarrow> of_int z \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<le> \<lfloor>x\<rfloor>) = (of_int z \<le> x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
assume "z \<le> \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (state)
this:
z \<le> \<lfloor>x\<rfloor>

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
have "(of_int z :: 'a) \<le> of_int \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
z \<le> \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. of_int z \<le> of_int \<lfloor>x\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int \<lfloor>x\<rfloor>

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int \<lfloor>x\<rfloor>

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
have "of_int \<lfloor>x\<rfloor> \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> \<le> x
[PROOF STEP]
by (rule of_int_floor_le)
[PROOF STATE]
proof (state)
this:
of_int \<lfloor>x\<rfloor> \<le> x

goal (2 subgoals):
 1. z \<le> \<lfloor>x\<rfloor> \<Longrightarrow> of_int z \<le> x
 2. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_int z \<le> x
[PROOF STEP]
show "of_int z \<le> x"
[PROOF STATE]
proof (prove)
using this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
assume "of_int z \<le> x"
[PROOF STATE]
proof (state)
this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int z \<le> x

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
have "x < of_int (\<lfloor>x\<rfloor> + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < of_int (\<lfloor>x\<rfloor> + 1)
[PROOF STEP]
using floor_correct
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>?x\<rfloor> \<le> ?x \<and> ?x < of_int (\<lfloor>?x\<rfloor> + 1)

goal (1 subgoal):
 1. x < of_int (\<lfloor>x\<rfloor> + 1)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x < of_int (\<lfloor>x\<rfloor> + 1)

goal (1 subgoal):
 1. of_int z \<le> x \<Longrightarrow> z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_int z < of_int (\<lfloor>x\<rfloor> + 1)
[PROOF STEP]
show "z \<le> \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
of_int z < of_int (\<lfloor>x\<rfloor> + 1)

goal (1 subgoal):
 1. z \<le> \<lfloor>x\<rfloor>
[PROOF STEP]
by (simp del: of_int_add)
[PROOF STATE]
proof (state)
this:
z \<le> \<lfloor>x\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonpos_Reals_add_I [simp]: "\<lbrakk>a \<in> \<real>\<^sub>\<le>\<^sub>0; b \<in> \<real>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> a + b \<in> \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> \<real>\<^sub>\<le>\<^sub>0; b \<in> \<real>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> a + b \<in> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (metis nonneg_Reals_add_I add_uminus_conv_diff minus_diff_eq minus_minus uminus_nonpos_Reals_iff)


[STATEMENT]
lemma represents_mult_scalar:
  assumes "pmdl.represents B r x"
  shows "pmdl.represents B (punit.monom_mult c 0 r) (c \<odot> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmdl.represents B (punit.monom_mult c 0 r) (c \<odot> x)
[PROOF STEP]
unfolding punit.mult_scalar_monomial[symmetric] punit_mult_scalar
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmdl.represents B (monomial c 0 * r) (c \<odot> x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pmdl.represents B r x

goal (1 subgoal):
 1. pmdl.represents B (monomial c 0 * r) (c \<odot> x)
[PROOF STEP]
by (rule pmdl.represents_scale)


[STATEMENT]
lemma path_weightp_distinct_nonempty:
  "{xs. path_weightp l1 l2 xs} \<noteq> {} \<longleftrightarrow> {xs. path_weightp_distinct l1 l2 xs} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({xs. path_weightp l1 l2 xs} \<noteq> {}) = ({xs. path_weightp_distinct l1 l2 xs} \<noteq> {})
[PROOF STEP]
by (auto dest: path_distinct simp: path_weightp_def path_weightp_distinct_def)


[STATEMENT]
lemma pm_of_poly_zero [simp]: "pm_of_poly x 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pm_of_poly x 0 = 0
[PROOF STEP]
by (rule poly_mapping_eqI) (simp add: pm_of_poly.rep_eq)


[STATEMENT]
lemma array_rel_def:
  "\<langle>R\<rangle>array_rel \<equiv> {(Array xs, Array ys)|xs ys. (xs,ys) \<in> \<langle>R\<rangle>list_rel}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>R\<rangle>array_rel \<equiv> {(Array xs, Array ys) |xs ys. (xs, ys) \<in> \<langle>R\<rangle>list_rel}
[PROOF STEP]
unfolding array_rel_def_internal relAPP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(Array xs, Array ys) |xs ys. (xs, ys) \<in> list_rel R} \<equiv> {(Array xs, Array ys) |xs ys. (xs, ys) \<in> list_rel R}
[PROOF STEP]
.


[STATEMENT]
lemma (in ring_closed) coeff_mult_closed [intro]:
  "(\<And>x. coeff p x \<in> A) \<Longrightarrow> (\<And>x. coeff q x \<in> A) \<Longrightarrow> coeff (p * q) x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. MPoly_Type.coeff p x \<in> A; \<And>x. MPoly_Type.coeff q x \<in> A\<rbrakk> \<Longrightarrow> MPoly_Type.coeff (p * q) x \<in> A
[PROOF STEP]
by (auto simp: coeff_mpoly_times prod_fun_closed)


[STATEMENT]
lemma bigo_lesseq2: "f =o O(h) \<Longrightarrow> \<forall>x. \<bar>g x\<bar> <= f x \<Longrightarrow>
      g =o O(h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O(h); \<forall>x. \<bar>g x\<bar> \<le> f x\<rbrakk> \<Longrightarrow> g \<in> O(h)
[PROOF STEP]
apply (erule bigo_lesseq1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<bar>g x\<bar> \<le> f x \<Longrightarrow> \<forall>x. \<bar>g x\<bar> \<le> \<bar>f x\<bar>
[PROOF STEP]
apply (blast intro: abs_ge_self order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma not_summable_infsetsum_eq:
  "\<not>f abs_summable_on A \<Longrightarrow> infsetsum f A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f abs_summable_on A \<Longrightarrow> infsetsum f A = (0::'b)
[PROOF STEP]
by (simp add: abs_summable_on_def infsetsum_def not_integrable_integral_eq)


[STATEMENT]
lemma remdups_mset_singleton[simp]: "remdups_mset {#a#} = {#a#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remdups_mset {#a#} = {#a#}
[PROOF STEP]
unfolding remdups_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set (set_mset {#a#}) = {#a#}
[PROOF STEP]
by auto


[STATEMENT]
theorem abs_conv_le_conv_abscissa_plus_1: "abs_conv_abscissa (f :: 'a fds) \<le> conv_abscissa f + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa f \<le> conv_abscissa f + 1
[PROOF STEP]
proof (rule abs_conv_abscissa_leI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c'. conv_abscissa f + 1 < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges f s
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c'. conv_abscissa f + 1 < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges f s
[PROOF STEP]
assume less: "conv_abscissa f + 1 < ereal c"
[PROOF STATE]
proof (state)
this:
conv_abscissa f + 1 < ereal c

goal (1 subgoal):
 1. \<And>c'. conv_abscissa f + 1 < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges f s
[PROOF STEP]
define c' where "c' = (if conv_abscissa f = -\<infinity> then c - 2
                     else (c - 1 + real_of_ereal (conv_abscissa f)) / 2)"
[PROOF STATE]
proof (state)
this:
c' = (if conv_abscissa f = - \<infinity> then c - 2 else (c - 1 + real_of_ereal (conv_abscissa f)) / 2)

goal (1 subgoal):
 1. \<And>c'. conv_abscissa f + 1 < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges f s
[PROOF STEP]
from less
[PROOF STATE]
proof (chain)
picking this:
conv_abscissa f + 1 < ereal c
[PROOF STEP]
have c': "conv_abscissa f < ereal c' \<and> c' < c - 1"
[PROOF STATE]
proof (prove)
using this:
conv_abscissa f + 1 < ereal c

goal (1 subgoal):
 1. conv_abscissa f < ereal c' \<and> c' < c - 1
[PROOF STEP]
by (cases "conv_abscissa f") (simp_all add: c'_def field_simps)
[PROOF STATE]
proof (state)
this:
conv_abscissa f < ereal c' \<and> c' < c - 1

goal (1 subgoal):
 1. \<And>c'. conv_abscissa f + 1 < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges f s
[PROOF STEP]
from c'
[PROOF STATE]
proof (chain)
picking this:
conv_abscissa f < ereal c' \<and> c' < c - 1
[PROOF STEP]
have "fds_converges f (of_real c')"
[PROOF STATE]
proof (prove)
using this:
conv_abscissa f < ereal c' \<and> c' < c - 1

goal (1 subgoal):
 1. fds_converges f (of_real c')
[PROOF STEP]
by (intro fds_converges) (simp_all add: inner_diff_left dot_square_norm)
[PROOF STATE]
proof (state)
this:
fds_converges f (of_real c')

goal (1 subgoal):
 1. \<And>c'. conv_abscissa f + 1 < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges f s
[PROOF STEP]
hence "fds_abs_converges f (of_real c)"
[PROOF STATE]
proof (prove)
using this:
fds_converges f (of_real c')

goal (1 subgoal):
 1. fds_abs_converges f (of_real c)
[PROOF STEP]
by (rule fds_converges_imp_abs_converges) (insert c', simp_all)
[PROOF STATE]
proof (state)
this:
fds_abs_converges f (of_real c)

goal (1 subgoal):
 1. \<And>c'. conv_abscissa f + 1 < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges f s
[PROOF STEP]
thus "\<exists>s. s \<bullet> 1 = c \<and> fds_abs_converges f s"
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges f (of_real c)

goal (1 subgoal):
 1. \<exists>s. s \<bullet> (1::'a) = c \<and> fds_abs_converges f s
[PROOF STEP]
by (intro exI[of _ "of_real c"]) auto
[PROOF STATE]
proof (state)
this:
\<exists>s. s \<bullet> (1::'a) = c \<and> fds_abs_converges f s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lta_comm:
  assumes "A B C LtA D E F"
  shows "C B A LtA F E D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C B A LtA F E D
[PROOF STEP]
using assms lta_left_comm lta_right_comm
[PROOF STATE]
proof (prove)
using this:
A B C LtA D E F
?A ?B ?C LtA ?D ?E ?F \<Longrightarrow> ?C ?B ?A LtA ?D ?E ?F
?A ?B ?C LtA ?D ?E ?F \<Longrightarrow> ?A ?B ?C LtA ?F ?E ?D

goal (1 subgoal):
 1. C B A LtA F E D
[PROOF STEP]
by blast


[STATEMENT]
lemma less_eq_top_is_Top: "Top \<le> x \<Longrightarrow> x = Top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Top \<le> x \<Longrightarrow> x = Top
[PROOF STEP]
by (cases x) (simp_all add: less_eq_top_def)


[STATEMENT]
theorem infinite_soundness:
  assumes "wf t" and "good t" and "S \<in> structure"
  shows "sat S (fst (root t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sat S (fst (tree.root t))
[PROOF STEP]
using F[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<not> sat S (fst (tree.root t)) \<Longrightarrow> False

goal (1 subgoal):
 1. sat S (fst (tree.root t))
[PROOF STEP]
by auto


[STATEMENT]
lemma Bex_set_replicate[simp]:
  "(\<exists>x \<in> set(replicate n a). P x) = (P a \<and> n\<noteq>0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>set (replicate n a). P x) = (P a \<and> n \<noteq> 0)
[PROOF STEP]
by(simp add: set_replicate_conv_if)


[STATEMENT]
lemma absolutely_integrable_abs:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  assumes "f absolutely_integrable_on S"
  shows "(\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S"
        (is "?g absolutely_integrable_on S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
have *: "(\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else 0) \<circ>
           (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else 0)) \<circ> f
           absolutely_integrable_on S"
        if "i \<in> Basis" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
have "bounded_linear (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b))
[PROOF STEP]
by (simp add: linear_linear algebra_simps linearI)
[PROOF STATE]
proof (state)
this:
bounded_linear (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b))

goal (1 subgoal):
 1. (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bounded_linear (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b))

goal (1 subgoal):
 1. (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
have "(\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else 0)) \<circ> f
                   absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
using assms \<open>i \<in> Basis\<close>
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S
i \<in> Basis

goal (1 subgoal):
 1. (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S
i \<in> Basis

goal (1 subgoal):
 1. (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (f x \<bullet> i) *\<^sub>R j else (0::'b))) absolutely_integrable_on S
[PROOF STEP]
by (intro absolutely_integrable_norm [unfolded o_def])
         (auto simp: algebra_simps dest: absolutely_integrable_component)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bounded_linear (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b))
(\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bounded_linear (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b))
(\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S
[PROOF STEP]
by (subst comp_assoc) (blast intro: absolutely_integrable_linear)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i \<in> Basis \<Longrightarrow> (\<lambda>y. \<Sum>j\<in>Basis. if j = ?i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = ?i then (x \<bullet> ?i) *\<^sub>R j else (0::'b))) \<circ> f absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
have eq: "?g =
        (\<lambda>x. \<Sum>i\<in>Basis. ((\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else 0) \<circ>
               (\<lambda>x. norm(\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else 0)) \<circ> f) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) = (\<lambda>x. \<Sum>i\<in>Basis. ((\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f) x)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) = (\<lambda>x. \<Sum>i\<in>Basis. ((\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f) x)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. ((\<lambda>y. \<Sum>j\<in>Basis. if j = i then y *\<^sub>R j else (0::'b)) \<circ> (\<lambda>x. norm (\<Sum>j\<in>Basis. if j = i then (x \<bullet> i) *\<^sub>R j else (0::'b))) \<circ> f) x) absolutely_integrable_on S
[PROOF STEP]
by (rule absolutely_integrable_sum) (force simp: intro!: *)+
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Rat_induct_pos [case_names Fract, induct type: rat]:
  assumes step: "\<And>a b. 0 < b \<Longrightarrow> P (Fract a b)"
  shows "P q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P q
[PROOF STEP]
proof (cases q)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>q = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> P q
[PROOF STEP]
case (Fract a b)
[PROOF STATE]
proof (state)
this:
q = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>q = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> P q
[PROOF STEP]
have step': "P (Fract a b)" if b: "b < 0" for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (Fract a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P (Fract a b)
[PROOF STEP]
from b
[PROOF STATE]
proof (chain)
picking this:
b < 0
[PROOF STEP]
have "0 < - b"
[PROOF STATE]
proof (prove)
using this:
b < 0

goal (1 subgoal):
 1. 0 < - b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < - b

goal (1 subgoal):
 1. P (Fract a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < - b
[PROOF STEP]
have "P (Fract (- a) (- b))"
[PROOF STATE]
proof (prove)
using this:
0 < - b

goal (1 subgoal):
 1. P (Fract (- a) (- b))
[PROOF STEP]
by (rule step)
[PROOF STATE]
proof (state)
this:
P (Fract (- a) (- b))

goal (1 subgoal):
 1. P (Fract a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P (Fract (- a) (- b))
[PROOF STEP]
show "P (Fract a b)"
[PROOF STATE]
proof (prove)
using this:
P (Fract (- a) (- b))

goal (1 subgoal):
 1. P (Fract a b)
[PROOF STEP]
by (simp add: order_less_imp_not_eq [OF b])
[PROOF STATE]
proof (state)
this:
P (Fract a b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?b < 0 \<Longrightarrow> P (Fract ?a ?b)

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>q = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> P q
[PROOF STEP]
from Fract
[PROOF STATE]
proof (chain)
picking this:
q = Fract a b
0 < b
coprime a b
[PROOF STEP]
show "P q"
[PROOF STATE]
proof (prove)
using this:
q = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. P q
[PROOF STEP]
by (auto simp add: linorder_neq_iff step step')
[PROOF STATE]
proof (state)
this:
P q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma i_Exec_Stream_Acc_Output_Init_1: "
  i_Exec_Comp_Stream_Acc_Output_Init (Suc 0) output_fun trans_fun input c =
  output_fun \<circ> (i_Exec_Comp_Stream_Init trans_fun input c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i_Exec_Comp_Stream_Acc_Output_Init (Suc 0) output_fun trans_fun input c = output_fun \<circ> i_Exec_Comp_Stream_Init trans_fun input c
[PROOF STEP]
by (simp add: i_Exec_Comp_Stream_Acc_Output_Init_def i_Exec_Stream_Init_eq_i_Exec_Stream_Cons)


[STATEMENT]
lemma poly_sgnx_left_right:
  fixes c a::real and p::"real poly"
  assumes "p\<noteq>0"
  shows "sgnx (poly p) (at_left a) = (if even (order a p)
            then sgnx (poly p) (at_right a)
            else -sgnx (poly p) (at_right a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
proof (induction "degree p" arbitrary: p rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly pa) (at_left a) = (if even (order a pa) then sgnx (poly pa) (at_right a) else - sgnx (poly pa) (at_right a)); p \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree ?p < degree p; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly ?p) (at_left a) = (if even (order a ?p) then sgnx (poly ?p) (at_right a) else - sgnx (poly ?p) (at_right a))
p \<noteq> 0

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly pa) (at_left a) = (if even (order a pa) then sgnx (poly pa) (at_right a) else - sgnx (poly pa) (at_right a)); p \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have ?case when "poly p a\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have "sgnx (poly p) (at_left a) = sgn (poly p a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = sgn (poly p a)
[PROOF STEP]
by (simp add: has_sgnx_imp_sgnx tendsto_nonzero_has_sgnx that)
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = sgn (poly p a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = sgn (poly p a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have "sgnx (poly p) (at_right a) = sgn (poly p a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgn (poly p a)
[PROOF STEP]
by (simp add: has_sgnx_imp_sgnx tendsto_nonzero_has_sgnx that)
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right a) = sgn (poly p a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right a) = sgn (poly p a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have "order a p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order a p = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
poly p a \<noteq> 0

goal (1 subgoal):
 1. order a p = 0
[PROOF STEP]
by (simp add: order_0I)
[PROOF STATE]
proof (state)
this:
order a p = 0

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sgnx (poly p) (at_left a) = sgn (poly p a)
sgnx (poly p) (at_right a) = sgn (poly p a)
order a p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sgnx (poly p) (at_left a) = sgn (poly p a)
sgnx (poly p) (at_right a) = sgn (poly p a)
order a p = 0

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly p a \<noteq> 0 \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly pa) (at_left a) = (if even (order a pa) then sgnx (poly pa) (at_right a) else - sgnx (poly pa) (at_right a)); p \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poly p a \<noteq> 0 \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly pa) (at_left a) = (if even (order a pa) then sgnx (poly pa) (at_right a) else - sgnx (poly pa) (at_right a)); p \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have ?case when "poly p a=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
obtain q where pq:"p= [:-a,1:] * q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. p = [:- a, 1:] * q \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>poly p a=0\<close>
[PROOF STATE]
proof (prove)
using this:
poly p a = 0

goal (1 subgoal):
 1. (\<And>q. p = [:- a, 1:] * q \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson dvdE poly_eq_0_iff_dvd)
[PROOF STATE]
proof (state)
this:
p = [:- a, 1:] * q

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = [:- a, 1:] * q
[PROOF STEP]
have "q\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
p = [:- a, 1:] * q

goal (1 subgoal):
 1. q \<noteq> 0
[PROOF STEP]
using \<open>p\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
p = [:- a, 1:] * q
p \<noteq> 0

goal (1 subgoal):
 1. q \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q \<noteq> 0

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> 0
[PROOF STEP]
have "degree q < degree p"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0

goal (1 subgoal):
 1. degree q < degree p
[PROOF STEP]
unfolding pq
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0

goal (1 subgoal):
 1. degree q < degree ([:- a, 1:] * q)
[PROOF STEP]
by (subst degree_mult_eq,auto)
[PROOF STATE]
proof (state)
this:
degree q < degree p

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have "sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
[PROOF STEP]
have "sgnx (\<lambda>x. poly p x) (at_left a)
          = sgnx (poly q) (at_left a) * sgnx (poly [:-a,1:]) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)
[PROOF STEP]
unfolding pq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly ([:- a, 1:] * q)) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)
[PROOF STEP]
apply (subst poly_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (\<lambda>x. poly [:- a, 1:] x * poly q x) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)
[PROOF STEP]
apply (subst sgnx_times)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. at_left a \<noteq> bot
 2. poly [:- a, 1:] sgnx_able at_left a
 3. poly q sgnx_able at_left a
 4. sgnx (poly [:- a, 1:]) (at_left a) * sgnx (poly q) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
[PROOF STEP]
have "sgnx (\<lambda>x. poly [:-a,1:] x) (at_left a) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly [:- a, 1:]) (at_left a) = - 1
[PROOF STEP]
apply (intro has_sgnx_imp_sgnx)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (poly [:- a, 1:] has_sgnx - 1) (at_left a)
 2. at_left a \<noteq> bot
[PROOF STEP]
unfolding has_sgnx_def eventually_at_left
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>b<a. \<forall>y>b. y < a \<longrightarrow> sgn (poly [:- a, 1:] y) = - 1
 2. at_left a \<noteq> bot
[PROOF STEP]
by (auto simp add: linordered_field_no_lb)
[PROOF STATE]
proof (state)
this:
sgnx (poly [:- a, 1:]) (at_left a) = - 1

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sgnx (poly p) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)
sgnx (poly [:- a, 1:]) (at_left a) = - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sgnx (poly p) (at_left a) = sgnx (poly q) (at_left a) * sgnx (poly [:- a, 1:]) (at_left a)
sgnx (poly [:- a, 1:]) (at_left a) = - 1

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have "sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
[PROOF STEP]
have "sgnx (\<lambda>x. poly p x) (at_right a)
          = sgnx (poly q) (at_right a) * sgnx (poly [:-a,1:]) (at_right a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)
[PROOF STEP]
unfolding pq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly ([:- a, 1:] * q)) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)
[PROOF STEP]
apply (subst poly_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (\<lambda>x. poly [:- a, 1:] x * poly q x) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)
[PROOF STEP]
apply (subst sgnx_times)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. at_right a \<noteq> bot
 2. poly [:- a, 1:] sgnx_able at_right a
 3. poly q sgnx_able at_right a
 4. sgnx (poly [:- a, 1:]) (at_right a) * sgnx (poly q) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)

goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)

goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
[PROOF STEP]
have "sgnx (\<lambda>x. poly [:-a,1:] x) (at_right a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly [:- a, 1:]) (at_right a) = 1
[PROOF STEP]
apply (intro has_sgnx_imp_sgnx)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (poly [:- a, 1:] has_sgnx 1) (at_right a)
 2. at_right a \<noteq> bot
[PROOF STEP]
unfolding has_sgnx_def eventually_at_right
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>b>a. \<forall>y>a. y < b \<longrightarrow> sgn (poly [:- a, 1:] y) = 1
 2. at_right a \<noteq> bot
[PROOF STEP]
by (auto simp add: linordered_field_no_ub)
[PROOF STATE]
proof (state)
this:
sgnx (poly [:- a, 1:]) (at_right a) = 1

goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)
sgnx (poly [:- a, 1:]) (at_right a) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a) * sgnx (poly [:- a, 1:]) (at_right a)
sgnx (poly [:- a, 1:]) (at_right a) = 1

goal (1 subgoal):
 1. sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
have "even (order a p) \<longleftrightarrow> odd (order a q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (order a p) = odd (order a q)
[PROOF STEP]
unfolding pq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (order a ([:- a, 1:] * q)) = odd (order a q)
[PROOF STEP]
apply (subst order_mult[OF \<open>p \<noteq> 0\<close>[unfolded pq]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (order a [:- a, 1:] + order a q) = odd (order a q)
[PROOF STEP]
using  \<open>q\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0

goal (1 subgoal):
 1. even (order a [:- a, 1:] + order a q) = odd (order a q)
[PROOF STEP]
by (auto simp add:order_power_n_n[of _ 1, simplified])
[PROOF STATE]
proof (state)
this:
even (order a p) = odd (order a q)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even (order a p) = odd (order a q)

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
note less.hyps[OF \<open>degree q < degree p\<close> \<open>q\<noteq>0\<close>]
[PROOF STATE]
proof (state)
this:
sgnx (poly q) (at_left a) = (if even (order a q) then sgnx (poly q) (at_right a) else - sgnx (poly q) (at_right a))

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
even (order a p) = odd (order a q)
sgnx (poly q) (at_left a) = (if even (order a q) then sgnx (poly q) (at_right a) else - sgnx (poly q) (at_right a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sgnx (poly p) (at_left a) = - sgnx (poly q) (at_left a)
sgnx (poly p) (at_right a) = sgnx (poly q) (at_right a)
even (order a p) = odd (order a q)
sgnx (poly q) (at_left a) = (if even (order a q) then sgnx (poly q) (at_right a) else - sgnx (poly q) (at_right a))

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly p a = 0 \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly pa) (at_left a) = (if even (order a pa) then sgnx (poly pa) (at_right a) else - sgnx (poly pa) (at_right a)); p \<noteq> 0\<rbrakk> \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
poly p a \<noteq> 0 \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
poly p a = 0 \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
poly p a \<noteq> 0 \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
poly p a = 0 \<Longrightarrow> sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))

goal (1 subgoal):
 1. sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left a) = (if even (order a p) then sgnx (poly p) (at_right a) else - sgnx (poly p) (at_right a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tllist_ord_trans [trans]: "\<lbrakk> tllist_ord xs ys; tllist_ord ys zs \<rbrakk> \<Longrightarrow> tllist_ord xs zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.tllist_ord xs ys; local.tllist_ord ys zs\<rbrakk> \<Longrightarrow> local.tllist_ord xs zs
[PROOF STEP]
by transfer(auto simp add: flat_ord_def split: if_split_asm intro: lprefix_trans)


[STATEMENT]
lemma \<Sigma>n_m_eq: "\<lbrakk>(\<Sigma>\<^sup>n) \<noteq> {}; (\<Sigma>\<^sup>n) = (\<Sigma>\<^sup>m)\<rbrakk> \<Longrightarrow> n = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Sigma>\<^sup>n \<noteq> {}; \<Sigma>\<^sup>n = \<Sigma>\<^sup>m\<rbrakk> \<Longrightarrow> n = m
[PROOF STEP]
by auto


[STATEMENT]
lemma Gleason9_34:
  assumes "cut A" "0 < u"
  shows "\<exists>r \<in> A. r + u \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r\<in>A. r + u \<notin> A
[PROOF STEP]
using assms Gleason9_34_contra preal_exists_bound
[PROOF STATE]
proof (prove)
using this:
Dedekind_Real.cut A
0 < u
\<lbrakk>Dedekind_Real.cut ?A; \<forall>x\<in>?A. x + ?u \<in> ?A; 0 < ?u; 0 < ?y; ?y \<notin> ?A\<rbrakk> \<Longrightarrow> False
Dedekind_Real.cut ?A \<Longrightarrow> \<exists>x>0. x \<notin> ?A

goal (1 subgoal):
 1. \<exists>r\<in>A. r + u \<notin> A
[PROOF STEP]
by blast


[STATEMENT]
lemma (in abelian_subgroup) a_inv_op_closed2:
  shows "\<lbrakk>x \<in> carrier G; h \<in> H\<rbrakk> \<Longrightarrow> x \<oplus> h \<oplus> (\<ominus> x) \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; h \<in> H\<rbrakk> \<Longrightarrow> x \<oplus> h \<oplus> \<ominus> x \<in> H
[PROOF STEP]
by (rule normal.inv_op_closed2 [OF a_normal,
    folded a_inv_def, simplified monoid_record_simps])


[STATEMENT]
lemma product_reachable[simp]: "c.reachable (product A B) (p, q) \<subseteq> a.reachable A p \<times> b.reachable B q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c.reachable' (product A B) (p, q) \<subseteq> a.reachable' A p \<times> b.reachable' B q
[PROOF STEP]
unfolding c.reachable_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {c.target (product A B) r (p, q) |r. c.path' (product A B) r (p, q)} \<subseteq> a.reachable' A p \<times> b.reachable' B q
[PROOF STEP]
by auto


[STATEMENT]
lemma merge1_fcard_le: "fcard (sucs (merge1 (Node r xs))) \<le> fcard xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fcard (sucs (merge1 (Node r xs))) \<le> fcard xs
[PROOF STEP]
using fcard_image_le merge_fcard_le1[of "Node r xs"]
[PROOF STATE]
proof (prove)
using this:
fcard (?f |`| ?xs) \<le> fcard ?xs
fcard (sucs (merge (Node r xs))) \<le> 1

goal (1 subgoal):
 1. fcard (sucs (merge1 (Node r xs))) \<le> fcard xs
[PROOF STEP]
by auto


[STATEMENT]
lemma (in cring) associated_iff_same_ideal:
  assumes "a \<in> carrier R" "b \<in> carrier R"
  shows "a \<sim> b \<longleftrightarrow> PIdl a = PIdl b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sim> b = (PIdl a = PIdl b)
[PROOF STEP]
unfolding associated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a divides b \<and> b divides a) = (PIdl a = PIdl b)
[PROOF STEP]
using to_contain_is_to_divide[OF assms]
        to_contain_is_to_divide[OF assms(2,1)]
[PROOF STATE]
proof (prove)
using this:
(PIdl b \<subseteq> PIdl a) = a divides b
(PIdl a \<subseteq> PIdl b) = b divides a

goal (1 subgoal):
 1. (a divides b \<and> b divides a) = (PIdl a = PIdl b)
[PROOF STEP]
by auto


[STATEMENT]
lemma reflexive:
  fixes P :: pi

  shows "P \<sim>\<^sup>s P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<sim>\<^sup>s P
[PROOF STEP]
by(force simp add: substClosed_def intro: Strong_Late_Bisim.reflexive)


[STATEMENT]
lemma simple_bochner_integral_minus:
  assumes f: "simple_bochner_integrable M f"
  shows "simple_bochner_integral M (\<lambda>x. - f x) = - simple_bochner_integral M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. - f x) = - simple_bochner_integral M f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. - f x) = - simple_bochner_integral M f
[PROOF STEP]
from linear_uminus f
[PROOF STATE]
proof (chain)
picking this:
linear uminus
simple_bochner_integrable M f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
linear uminus
simple_bochner_integrable M f

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. - f x) = - simple_bochner_integral M f
[PROOF STEP]
by (rule simple_bochner_integral_linear)
[PROOF STATE]
proof (state)
this:
simple_bochner_integral M (\<lambda>x. - f x) = - simple_bochner_integral M f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_at_bot_at_top:
  fixes p :: "real poly"
  assumes "degree p \<ge> 1" "coeff p (degree p) < 0"
  shows "LIM x at_top. poly p x :> at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim (poly p) at_bot at_top
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filterlim (poly p) at_bot at_top
[PROOF STEP]
from poly_at_top_at_top[of "-p"] and assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>1 \<le> degree (- p); 0 < lead_coeff (- p)\<rbrakk> \<Longrightarrow> filterlim (poly (- p)) at_top at_top
1 \<le> degree p
lead_coeff p < 0
[PROOF STEP]
have "LIM x at_top. -poly p x :> at_top"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> degree (- p); 0 < lead_coeff (- p)\<rbrakk> \<Longrightarrow> filterlim (poly (- p)) at_top at_top
1 \<le> degree p
lead_coeff p < 0

goal (1 subgoal):
 1. LIM x at_top. - poly p x :> at_top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LIM x at_top. - poly p x :> at_top

goal (1 subgoal):
 1. filterlim (poly p) at_bot at_top
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_top. - poly p x :> at_top

goal (1 subgoal):
 1. filterlim (poly p) at_bot at_top
[PROOF STEP]
by (simp add: filterlim_uminus_at_bot)
[PROOF STATE]
proof (state)
this:
filterlim (poly p) at_bot at_top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homology_dimension_reduced:
  assumes "topspace X = {a}"
  shows "trivial_group (reduced_homology_group p X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group (reduced_homology_group p X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trivial_group (reduced_homology_group p X)
[PROOF STEP]
have iso: "(hom_induced p X {} (discrete_topology {()}) {} (\<lambda>x. ()))
           \<in> iso (homology_group p X) (homology_group p (discrete_topology {()}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p X {} (discrete_topology {()}) {} (\<lambda>x. ()) \<in> Group.iso (homology_group p X) (homology_group p (discrete_topology {()}))
[PROOF STEP]
apply (rule homeomorphic_map_homology_iso)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X (discrete_topology {()}) (\<lambda>x. ())
[PROOF STEP]
apply (force simp: homeomorphic_map_maps homeomorphic_maps_def assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
hom_induced p X {} (discrete_topology {()}) {} (\<lambda>x. ()) \<in> Group.iso (homology_group p X) (homology_group p (discrete_topology {()}))

goal (1 subgoal):
 1. trivial_group (reduced_homology_group p X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group (reduced_homology_group p X)
[PROOF STEP]
unfolding reduced_homology_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group (subgroup_generated (homology_group p X) (kernel (homology_group p X) (homology_group p (discrete_topology {()})) (hom_induced p X {} (discrete_topology {()}) {} (\<lambda>x. ()))))
[PROOF STEP]
by (rule group.trivial_group_subgroup_generated) (use iso in \<open>auto simp: iso_kernel_image\<close>)
[PROOF STATE]
proof (state)
this:
trivial_group (reduced_homology_group p X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bit_of_nat_iff_bit [bit_simps]:
  \<open>bit (of_nat m) n \<longleftrightarrow> bit m n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit (of_nat m) n = bit m n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bit (of_nat m) n = bit m n
[PROOF STEP]
have \<open>even (m div 2 ^ n) \<longleftrightarrow> even (of_nat (m div 2 ^ n))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (m div 2 ^ n) = even (of_nat (m div 2 ^ n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (m div 2 ^ n) = even (of_nat (m div 2 ^ n))

goal (1 subgoal):
 1. bit (of_nat m) n = bit m n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
even (m div 2 ^ n) = even (of_nat (m div 2 ^ n))

goal (1 subgoal):
 1. bit (of_nat m) n = bit m n
[PROOF STEP]
have \<open>of_nat (m div 2 ^ n) = of_nat m div of_nat (2 ^ n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (m div 2 ^ n) = of_nat m div of_nat (2 ^ n)
[PROOF STEP]
by (simp add: of_nat_div)
[PROOF STATE]
proof (state)
this:
of_nat (m div 2 ^ n) = of_nat m div of_nat (2 ^ n)

goal (1 subgoal):
 1. bit (of_nat m) n = bit m n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
even (m div 2 ^ n) = even (of_nat m div of_nat (2 ^ n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
even (m div 2 ^ n) = even (of_nat m div of_nat (2 ^ n))

goal (1 subgoal):
 1. bit (of_nat m) n = bit m n
[PROOF STEP]
by (simp add: bit_iff_odd semiring_bits_class.bit_iff_odd)
[PROOF STATE]
proof (state)
this:
bit (of_nat m) n = bit m n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma corollary5:
  assumes T: "\<forall>a b. \<exists>a1 b1 d. a = a1 * d \<and> b = b1 * d
        \<and> ideal_generated {a1, b1} = ideal_generated {1::'a}"
 and i2: "ideal_generated {a,b,c} = ideal_generated {d}"
  shows "\<exists> a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d
  \<and> ideal_generated {a1,b1,c1} = ideal_generated {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have da: "d dvd a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd a
[PROOF STEP]
using ideal_generated_singleton_dvd[OF i2]
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a, b, c} \<Longrightarrow> d dvd ?x

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

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have db: "d dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd b
[PROOF STEP]
using ideal_generated_singleton_dvd[OF i2]
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a, b, c} \<Longrightarrow> d dvd ?x

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

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have dc: "d dvd c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd c
[PROOF STEP]
using ideal_generated_singleton_dvd[OF i2]
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a, b, c} \<Longrightarrow> d dvd ?x

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

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
d dvd c
[PROOF STEP]
obtain c1' where c: "c = c1' * d"
[PROOF STATE]
proof (prove)
using this:
d dvd c

goal (1 subgoal):
 1. (\<And>c1'. c = c1' * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using dvd_def mult_ac(2)
[PROOF STATE]
proof (prove)
using this:
d dvd c
(?b dvd ?a) = (\<exists>k. ?a = ?b * k)
?a * ?b = ?b * ?a

goal (1 subgoal):
 1. (\<And>c1'. c = c1' * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = c1' * d

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
obtain a1 b1 d' where a: "a = a1 * d'" and b: "b = b1 * d' "
    and i: "ideal_generated {a1, b1} = ideal_generated {1::'a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a1 d' b1. \<lbrakk>a = a1 * d'; b = b1 * d'; ideal_generated {a1, b1} = ideal_generated {1::'a}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using T
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. \<exists>a1 b1 d. a = a1 * d \<and> b = b1 * d \<and> ideal_generated {a1, b1} = ideal_generated {1::'a}

goal (1 subgoal):
 1. (\<And>a1 d' b1. \<lbrakk>a = a1 * d'; b = b1 * d'; ideal_generated {a1, b1} = ideal_generated {1::'a}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a = a1 * d'
b = b1 * d'
ideal_generated {a1, b1} = ideal_generated {1::'a}

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have i_ab_d': "ideal_generated {a, b} = ideal_generated {d'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {a, b} = ideal_generated {d'}
[PROOF STEP]
by (simp add: a b i lemma4_prev)
[PROOF STATE]
proof (state)
this:
ideal_generated {a, b} = ideal_generated {d'}

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have i2: "ideal_generated {d', c} = ideal_generated {d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {d', c} = ideal_generated {d}
[PROOF STEP]
by (rule ideal_generated_triple_pair_rewrite[OF i2 i_ab_d'])
[PROOF STATE]
proof (state)
this:
ideal_generated {d', c} = ideal_generated {d}

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
obtain u v dp  where d'1: "d' = u * dp" and d'2: "c = v * dp"
    and xy: "ideal_generated{u,v}=ideal_generated{1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u dp v. \<lbrakk>d' = u * dp; c = v * dp; ideal_generated {u, v} = ideal_generated {1::'a}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using T
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. \<exists>a1 b1 d. a = a1 * d \<and> b = b1 * d \<and> ideal_generated {a1, b1} = ideal_generated {1::'a}

goal (1 subgoal):
 1. (\<And>u dp v. \<lbrakk>d' = u * dp; c = v * dp; ideal_generated {u, v} = ideal_generated {1::'a}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d' = u * dp
c = v * dp
ideal_generated {u, v} = ideal_generated {1::'a}

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have "\<exists>a1' b1'. d' = a1' * d \<and> c = b1' * d \<and> ideal_generated {a1', b1'} = ideal_generated {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a1' b1'. d' = a1' * d \<and> c = b1' * d \<and> ideal_generated {a1', b1'} = ideal_generated {1::'a}
[PROOF STEP]
by (rule lemma4[OF d'1 d'2 xy i2])
[PROOF STATE]
proof (state)
this:
\<exists>a1' b1'. d' = a1' * d \<and> c = b1' * d \<and> ideal_generated {a1', b1'} = ideal_generated {1::'a}

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>a1' b1'. d' = a1' * d \<and> c = b1' * d \<and> ideal_generated {a1', b1'} = ideal_generated {1::'a}
[PROOF STEP]
obtain a1' c1 where d'_a1: "d' = a1' * d" and c: "c = c1 * d"
    and i3: "ideal_generated {a1', c1} = ideal_generated {1}"
[PROOF STATE]
proof (prove)
using this:
\<exists>a1' b1'. d' = a1' * d \<and> c = b1' * d \<and> ideal_generated {a1', b1'} = ideal_generated {1::'a}

goal (1 subgoal):
 1. (\<And>a1' c1. \<lbrakk>d' = a1' * d; c = c1 * d; ideal_generated {a1', c1} = ideal_generated {1::'a}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d' = a1' * d
c = c1 * d
ideal_generated {a1', c1} = ideal_generated {1::'a}

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have r1: "a = a1 * a1' * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = a1 * a1' * d
[PROOF STEP]
by (simp add: d'_a1 a local.semiring_normalization_rules(18))
[PROOF STATE]
proof (state)
this:
a = a1 * a1' * d

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have r2: "b = b1 * a1' * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = b1 * a1' * d
[PROOF STEP]
by (simp add: d'_a1 b local.semiring_normalization_rules(18))
[PROOF STATE]
proof (state)
this:
b = b1 * a1' * d

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
have i4: "ideal_generated {a1 * a1',b1 * a1', c1} = ideal_generated {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
obtain p q where 1: "p * a1' + q * c1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q. p * a1' + q * c1 = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using i3
[PROOF STATE]
proof (prove)
using this:
ideal_generated {a1', c1} = ideal_generated {1::'a}

goal (1 subgoal):
 1. (\<And>p q. p * a1' + q * c1 = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding ideal_generated_pair_exists_UNIV
[PROOF STATE]
proof (prove)
using this:
\<exists>p q. p * a1' + q * c1 = (1::'a)

goal (1 subgoal):
 1. (\<And>p q. p * a1' + q * c1 = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p * a1' + q * c1 = (1::'a)

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
obtain x y where 2: "x*a1 + y*b1 = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. x * a1 + y * b1 = p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ideal_generated_UNIV_obtain_pair[OF i]
[PROOF STATE]
proof (prove)
using this:
\<exists>p q. p * a1 + q * b1 = ?d

goal (1 subgoal):
 1. (\<And>x y. x * a1 + y * b1 = p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x * a1 + y * b1 = p

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
have "1 = (x*a1 + y*b1) * a1' + q * c1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) = (x * a1 + y * b1) * a1' + q * c1
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
p * a1' + q * c1 = (1::'a)
x * a1 + y * b1 = p

goal (1 subgoal):
 1. (1::'a) = (x * a1 + y * b1) * a1' + q * c1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1::'a) = (x * a1 + y * b1) * a1' + q * c1

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) = (x * a1 + y * b1) * a1' + q * c1

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
have "... = x*a1*a1' + y*b1*a1' + q * c1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * a1 + y * b1) * a1' + q * c1 = x * a1 * a1' + y * b1 * a1' + q * c1
[PROOF STEP]
by (simp add: local.ring_distribs(2))
[PROOF STATE]
proof (state)
this:
(x * a1 + y * b1) * a1' + q * c1 = x * a1 * a1' + y * b1 * a1' + q * c1

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1::'a) = x * a1 * a1' + y * b1 * a1' + q * c1
[PROOF STEP]
have "1 = x*a1*a1' + y*b1*a1' + q * c1"
[PROOF STATE]
proof (prove)
using this:
(1::'a) = x * a1 * a1' + y * b1 * a1' + q * c1

goal (1 subgoal):
 1. (1::'a) = x * a1 * a1' + y * b1 * a1' + q * c1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1::'a) = x * a1 * a1' + y * b1 * a1' + q * c1

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
hence "1 \<in> ideal_generated {a1 * a1', b1 * a1', c1}"
[PROOF STATE]
proof (prove)
using this:
(1::'a) = x * a1 * a1' + y * b1 * a1' + q * c1

goal (1 subgoal):
 1. (1::'a) \<in> ideal_generated {a1 * a1', b1 * a1', c1}
[PROOF STEP]
using ideal_explicit2[of "{a1 * a1', b1 * a1', c1}"] sum_three_elements'
[PROOF STATE]
proof (prove)
using this:
(1::'a) = x * a1 * a1' + y * b1 * a1' + q * c1
finite {a1 * a1', b1 * a1', c1} \<Longrightarrow> ideal_generated {a1 * a1', b1 * a1', c1} = {y. \<exists>f. (\<Sum>i\<in>{a1 * a1', b1 * a1', c1}. f i * i) = y}
\<exists>f. (\<Sum>i\<in>{?a, ?b, ?c}. f i * i) = ?x * ?a + ?y * ?b + ?z * ?c

goal (1 subgoal):
 1. (1::'a) \<in> ideal_generated {a1 * a1', b1 * a1', c1}
[PROOF STEP]
by (simp add: mult_assoc)
[PROOF STATE]
proof (state)
this:
(1::'a) \<in> ideal_generated {a1 * a1', b1 * a1', c1}

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
hence "ideal_generated {1} \<subseteq> ideal_generated {a1 * a1',b1 * a1', c1}"
[PROOF STATE]
proof (prove)
using this:
(1::'a) \<in> ideal_generated {a1 * a1', b1 * a1', c1}

goal (1 subgoal):
 1. ideal_generated {1::'a} \<subseteq> ideal_generated {a1 * a1', b1 * a1', c1}
[PROOF STEP]
by (rule ideal_generated_singleton_subset, auto)
[PROOF STATE]
proof (state)
this:
ideal_generated {1::'a} \<subseteq> ideal_generated {a1 * a1', b1 * a1', c1}

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ideal_generated {1::'a} \<subseteq> ideal_generated {a1 * a1', b1 * a1', c1}

goal (1 subgoal):
 1. ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
using r1 r2 i4 c
[PROOF STATE]
proof (prove)
using this:
a = a1 * a1' * d
b = b1 * a1' * d
ideal_generated {a1 * a1', b1 * a1', c1} = ideal_generated {1::'a}
c = c1 * d

goal (1 subgoal):
 1. \<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a1 b1 c1. a = a1 * d \<and> b = b1 * d \<and> c = c1 * d \<and> ideal_generated {a1, b1, c1} = ideal_generated {1::'a}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_extend:
  assumes *: "bij_betw f A B"
    and "A \<subseteq> V"
    and "B \<subseteq> V"
    and "finite A"
  shows "\<exists>g. finite {x. g x \<noteq> x} \<and>
    (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and>
    (\<forall>x\<in>A. g x = f x) \<and>
    bij_betw g V V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw f A B
A \<subseteq> V
B \<subseteq> V
finite A

goal (1 subgoal):
 1. finite B
[PROOF STEP]
by (metis bij_betw_finite)
[PROOF STATE]
proof (state)
this:
finite B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have [simp]: "card A = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = card B
[PROOF STEP]
by (metis * bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card A = card B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "card (A - B) = card (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
have "card (A - B) = card A - card (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A - B) = card A - card (A \<inter> B)
[PROOF STEP]
by (metis \<open>finite A\<close> card_Diff_subset_Int finite_Int)
[PROOF STATE]
proof (state)
this:
card (A - B) = card A - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (A - B) = card A - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
have "card (B - A) = card B - card (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (B - A) = card B - card (A \<inter> B)
[PROOF STEP]
by (metis \<open>finite A\<close> card_Diff_subset_Int finite_Int inf_commute)
[PROOF STATE]
proof (state)
this:
card (B - A) = card B - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (A - B) = card A - card (A \<inter> B)
card (B - A) = card B - card (A \<inter> B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (A - B) = card A - card (A \<inter> B)
card (B - A) = card B - card (A \<inter> B)

goal (1 subgoal):
 1. card (A - B) = card (B - A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (A - B) = card (B - A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (A - B) = card (B - A)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (A - B) = card (B - A)
[PROOF STEP]
obtain g where **: "bij_betw g (B - A) (A - B)"
[PROOF STATE]
proof (prove)
using this:
card (A - B) = card (B - A)

goal (1 subgoal):
 1. (\<And>g. bij_betw g (B - A) (A - B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>finite A\<close> \<open>finite B\<close> bij_betw_iff_card finite_Diff)
[PROOF STATE]
proof (state)
this:
bij_betw g (B - A) (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
define h where "h = (\<lambda>x. if x \<in> A then f x else if x \<in> B - A then g x else x)"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>x. if x \<in> A then f x else if x \<in> B - A then g x else x)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "bij_betw h A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw h A B
[PROOF STEP]
by (metis (full_types) * bij_betw_cong h_def)
[PROOF STATE]
proof (state)
this:
bij_betw h A B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h A B

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "bij_betw h (V - (A \<union> B)) (V - (A \<union> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw h (V - (A \<union> B)) (V - (A \<union> B))
[PROOF STEP]
by (auto simp: bij_betw_def h_def inj_on_def)
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "B \<inter> (V - (A \<union> B)) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<inter> (V - (A \<union> B)) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B \<inter> (V - (A \<union> B)) = {}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h A B
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))
B \<inter> (V - (A \<union> B)) = {}
[PROOF STEP]
have "bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))"
[PROOF STATE]
proof (prove)
using this:
bij_betw h A B
bij_betw h (V - (A \<union> B)) (V - (A \<union> B))
B \<inter> (V - (A \<union> B)) = {}

goal (1 subgoal):
 1. bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))
[PROOF STEP]
by (rule bij_betw_combine)
[PROOF STATE]
proof (state)
this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "A \<union> (V - (A \<union> B)) = V - (B - A)"
    and "B \<union> (V - (A \<union> B)) = V - (A - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> (V - (A \<union> B)) = V - (B - A) &&& B \<union> (V - (A \<union> B)) = V - (A - B)
[PROOF STEP]
using \<open>A \<subseteq> V\<close> and \<open>B \<subseteq> V\<close>
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> V
B \<subseteq> V

goal (1 subgoal):
 1. A \<union> (V - (A \<union> B)) = V - (B - A) &&& B \<union> (V - (A \<union> B)) = V - (A - B)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
A \<union> (V - (A \<union> B)) = V - (B - A)
B \<union> (V - (A \<union> B)) = V - (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))
A \<union> (V - (A \<union> B)) = V - (B - A)
B \<union> (V - (A \<union> B)) = V - (A - B)
[PROOF STEP]
have "bij_betw h (V - (B - A)) (V - (A - B))"
[PROOF STATE]
proof (prove)
using this:
bij_betw h (A \<union> (V - (A \<union> B))) (B \<union> (V - (A \<union> B)))
A \<union> (V - (A \<union> B)) = V - (B - A)
B \<union> (V - (A \<union> B)) = V - (A - B)

goal (1 subgoal):
 1. bij_betw h (V - (B - A)) (V - (A - B))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A)) (V - (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A)) (V - (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "bij_betw h (B - A) (A - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw h (B - A) (A - B)
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
bij_betw g (B - A) (A - B)

goal (1 subgoal):
 1. bij_betw h (B - A) (A - B)
[PROOF STEP]
by (auto simp: bij_betw_def h_def inj_on_def)
[PROOF STATE]
proof (state)
this:
bij_betw h (B - A) (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (B - A) (A - B)

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "(V - (A - B)) \<inter> (A - B) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (V - (A - B)) \<inter> (A - B) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(V - (A - B)) \<inter> (A - B) = {}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h (V - (B - A)) (V - (A - B))
bij_betw h (B - A) (A - B)
(V - (A - B)) \<inter> (A - B) = {}
[PROOF STEP]
have "bij_betw h ((V - (B - A)) \<union> (B - A)) ((V - (A - B)) \<union> (A - B))"
[PROOF STATE]
proof (prove)
using this:
bij_betw h (V - (B - A)) (V - (A - B))
bij_betw h (B - A) (A - B)
(V - (A - B)) \<inter> (A - B) = {}

goal (1 subgoal):
 1. bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))
[PROOF STEP]
by (rule bij_betw_combine)
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "(V - (B - A)) \<union> (B - A) = V"
    and "(V - (A - B)) \<union> (A - B) = V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V - (B - A) \<union> (B - A) = V &&& V - (A - B) \<union> (A - B) = V
[PROOF STEP]
using \<open>A \<subseteq> V\<close> and \<open>B \<subseteq> V\<close>
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> V
B \<subseteq> V

goal (1 subgoal):
 1. V - (B - A) \<union> (B - A) = V &&& V - (A - B) \<union> (A - B) = V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V - (B - A) \<union> (B - A) = V
V - (A - B) \<union> (A - B) = V

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))
V - (B - A) \<union> (B - A) = V
V - (A - B) \<union> (A - B) = V
[PROOF STEP]
have "bij_betw h V V"
[PROOF STATE]
proof (prove)
using this:
bij_betw h (V - (B - A) \<union> (B - A)) (V - (A - B) \<union> (A - B))
V - (B - A) \<union> (B - A) = V
V - (A - B) \<union> (A - B) = V

goal (1 subgoal):
 1. bij_betw h V V
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bij_betw h V V

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw h V V

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "\<forall>x\<in>A. h x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. h x = f x
[PROOF STEP]
by (auto simp: h_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. h x = f x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. h x = f x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "finite {x. h x \<noteq> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
have "finite (A \<union> (B - A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (A \<union> (B - A))
[PROOF STEP]
using \<open>finite A\<close> and \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. finite (A \<union> (B - A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (A \<union> (B - A))

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (A \<union> (B - A))

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
have "{x. h x \<noteq> x} \<subseteq> (A \<union> (B - A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. h x \<noteq> x} \<subseteq> A \<union> (B - A)
[PROOF STEP]
by (auto simp: h_def)
[PROOF STATE]
proof (state)
this:
{x. h x \<noteq> x} \<subseteq> A \<union> (B - A)

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (A \<union> (B - A))
{x. h x \<noteq> x} \<subseteq> A \<union> (B - A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (A \<union> (B - A))
{x. h x \<noteq> x} \<subseteq> A \<union> (B - A)

goal (1 subgoal):
 1. finite {x. h x \<noteq> x}
[PROOF STEP]
by (metis finite_subset)
[PROOF STATE]
proof (state)
this:
finite {x. h x \<noteq> x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {x. h x \<noteq> x}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {x. h x \<noteq> x}

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
have "\<forall>x\<in>UNIV - (A \<union> B). h x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV - (A \<union> B). h x = x
[PROOF STEP]
by (simp add: h_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>UNIV - (A \<union> B). h x = x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw h V V
\<forall>x\<in>A. h x = f x
finite {x. h x \<noteq> x}
\<forall>x\<in>UNIV - (A \<union> B). h x = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw h V V
\<forall>x\<in>A. h x = f x
finite {x. h x \<noteq> x}
\<forall>x\<in>UNIV - (A \<union> B). h x = x

goal (1 subgoal):
 1. \<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g. finite {x. g x \<noteq> x} \<and> (\<forall>x\<in>UNIV - (A \<union> B). g x = x) \<and> (\<forall>x\<in>A. g x = f x) \<and> bij_betw g V V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lepoll_iff_leqpoll: "A \<lesssim> B \<longleftrightarrow> A \<prec> B | A \<approx> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<lesssim> B) = (A \<prec> B \<or> A \<approx> B)
[PROOF STEP]
using eqpoll_imp_lepoll lesspoll_def
[PROOF STATE]
proof (prove)
using this:
?A \<approx> ?B \<Longrightarrow> ?A \<lesssim> ?B
?A \<prec> ?B \<equiv> ?A \<lesssim> ?B \<and> \<not> ?A \<approx> ?B

goal (1 subgoal):
 1. (A \<lesssim> B) = (A \<prec> B \<or> A \<approx> B)
[PROOF STEP]
by blast


[STATEMENT]
lemma f2_assoc: "associative f2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. associative f2
[PROOF STEP]
unfolding associative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
proof auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
fix x y z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
show "f2 x (f2 y z) = f2 (f2 x y) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f2 x (f2 y z) = f2 (f2 x y) z
[PROOF STEP]
by (cases z, auto)
[PROOF STATE]
proof (state)
this:
f2 x (f2 y z) = f2 (f2 x y) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_cartesian_product_singleton [simp]: "size ({#a#} \<times># B) = size B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size ({#a#} \<times># B) = size B
[PROOF STEP]
by (simp add: Times_mset_single_left)


[STATEMENT]
lemma pole_polar: "pole (polar p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
from polar_rep_non_zero
[PROOF STATE]
proof (chain)
picking this:
M *v proj2_rep ?p \<noteq> 0
[PROOF STEP]
have "pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))"
[PROOF STATE]
proof (prove)
using this:
M *v proj2_rep ?p \<noteq> 0

goal (1 subgoal):
 1. pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))
[PROOF STEP]
unfolding polar_def
[PROOF STATE]
proof (prove)
using this:
M *v proj2_rep ?p \<noteq> 0

goal (1 subgoal):
 1. pole (proj2_line_abs (M *v proj2_rep p)) = proj2_abs (M *v (M *v proj2_rep p))
[PROOF STEP]
by (rule pole_abs)
[PROOF STATE]
proof (state)
this:
pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))

goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
with M_self_inverse
[PROOF STATE]
proof (chain)
picking this:
M ** M = mat 1
pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))
[PROOF STEP]
show "pole (polar p) = p"
[PROOF STATE]
proof (prove)
using this:
M ** M = mat 1
pole (polar p) = proj2_abs (M *v (M *v proj2_rep p))

goal (1 subgoal):
 1. pole (polar p) = p
[PROOF STEP]
by (simp add: matrix_vector_mul_assoc proj2_abs_rep)
[PROOF STATE]
proof (state)
this:
pole (polar p) = p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ENR_imp_locally_connected:
  fixes S :: "'a::euclidean_space set"
  assumes "ENR S"
    shows "locally connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected S
[PROOF STEP]
using ANR_imp_locally_connected ENR_ANR assms
[PROOF STATE]
proof (prove)
using this:
ANR ?S \<Longrightarrow> locally connected ?S
ENR ?S = (ANR ?S \<and> locally compact ?S)
ENR S

goal (1 subgoal):
 1. locally connected S
[PROOF STEP]
by blast


[STATEMENT]
lemma equal_inc_mat_isomorphism_obtain:
  assumes "D1.N = D2.N"
  obtains \<pi> where "incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> \<pi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<pi>. incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> \<pi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using equal_inc_mat_isomorphism assms
[PROOF STATE]
proof (prove)
using this:
D1.N = D2.N \<Longrightarrow> incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> (\<lambda>x. \<V>s' ! index \<V>s x)
D1.N = D2.N

goal (1 subgoal):
 1. (\<And>\<pi>. incidence_system_isomorphism D1.\<V> D1.\<B> D2.\<V> D2.\<B> \<pi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
theorem main: \<open>valid p \<longleftrightarrow> (\<turnstile> p)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid p = (\<turnstile> p)
[PROOF STEP]
using completeness soundness
[PROOF STATE]
proof (prove)
using this:
\<forall>E F G. \<lbrakk>E, F, G\<rbrakk> ?p \<Longrightarrow> \<turnstile> ?p
\<turnstile> ?p \<Longrightarrow> \<lbrakk>?E, ?F, ?G\<rbrakk> ?p

goal (1 subgoal):
 1. valid p = (\<turnstile> p)
[PROOF STEP]
by blast


[STATEMENT]
lemma funpow_cycle: "(f ^^ k) x = x \<Longrightarrow> (f ^^ l) x = (f ^^ (l mod k)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ k) x = x \<Longrightarrow> (f ^^ l) x = (f ^^ (l mod k)) x
[PROOF STEP]
by (subst div_mult_mod_eq[symmetric, of l k])
    (simp only: add.commute funpow_add funpow_cycle_mult o_apply)


[STATEMENT]
lemma diff_le_self_hmset: "m - n \<le> m" for m n :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m - n \<le> m
[PROOF STEP]
by (metis add.commute add.right_neutral diff_add_zero diff_diff_add_hmset
    le_minus_plus_same_hmset)


[STATEMENT]
lemma butterfly_scaleR_right[simp]: "butterfly \<psi> (r *\<^sub>R \<phi>) = r *\<^sub>C butterfly \<psi> \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butterfly \<psi> (r *\<^sub>R \<phi>) = complex_of_real r *\<^sub>C butterfly \<psi> \<phi>
[PROOF STEP]
by (simp add: butterfly_scaleC_right scaleR_scaleC)


[STATEMENT]
lemma holomorphic_on_add [holomorphic_intros]:
  "\<lbrakk>f holomorphic_on s; g holomorphic_on s\<rbrakk> \<Longrightarrow> (\<lambda>z. f z + g z) holomorphic_on s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f holomorphic_on s; g holomorphic_on s\<rbrakk> \<Longrightarrow> (\<lambda>z. f z + g z) holomorphic_on s
[PROOF STEP]
unfolding holomorphic_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>s. f field_differentiable at x within s; \<forall>x\<in>s. g field_differentiable at x within s\<rbrakk> \<Longrightarrow> \<forall>x\<in>s. (\<lambda>z. f z + g z) field_differentiable at x within s
[PROOF STEP]
by (metis field_differentiable_add)


[STATEMENT]
lemma length_upto_enum_less_one:
  "\<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk>
  \<Longrightarrow> length [a .e. b - 1] = unat (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk> \<Longrightarrow> length [a .e. b - 1] = unat (b - a)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk> \<Longrightarrow> unat b - unat a = unat (b - a)
[PROOF STEP]
apply (subst unat_sub[symmetric], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; b \<noteq> 0\<rbrakk> \<Longrightarrow> unat (b - a) = unat (b - a)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(\<lambda>x. Suc (f x)) ` {x. even x} \<subseteq> A \<Longrightarrow> \<forall>x. even x --> Suc (f x) \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Suc (f x)) ` Collect even \<subseteq> A \<Longrightarrow> \<forall>x. even x \<longrightarrow> Suc (f x) \<in> A
[PROOF STEP]
by (metis mem_Collect_eq image_eqI subsetD)


[STATEMENT]
lemma (in abelian_group_hom) additive_subgroup_a_kernel:
  "additive_subgroup (a_kernel G H h) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. additive_subgroup (a_kernel G H h) G
[PROOF STEP]
by (simp add: additive_subgroup.intro a_group_hom a_kernel_def group_hom.subgroup_kernel)


[STATEMENT]
lemma "(0::real) \<le> x \<and> 0 \<le> y \<and> 0 \<le> z \<and> x + y + z \<le> 3 \<longrightarrow> x * y + x * z + y * z \<ge> 3 * x * y * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<and> 0 \<le> y \<and> 0 \<le> z \<and> x + y + z \<le> 3 \<longrightarrow> 3 * x * y * z \<le> x * y + x * z + y * z
[PROOF STEP]
by (sos "(((A<0 * R<1) + (((A<0 * R<1) * (R<1/2 * [1]^2)) + (((A<=2 * R<1) * (R<1/2 * [~1*x + y]^2)) + (((A<=1 * R<1) * (R<1/2 * [~1*x + z]^2)) + (((A<=1 * (A<=2 * (A<=3 * R<1))) * (R<1/2 * [1]^2)) + (((A<=0 * R<1) * (R<1/2 * [~1*y + z]^2)) + (((A<=0 * (A<=2 * (A<=3 * R<1))) * (R<1/2 * [1]^2)) + ((A<=0 * (A<=1 * (A<=3 * R<1))) * (R<1/2 * [1]^2))))))))))")


[STATEMENT]
lemma map_fun_upds: "length xs = length ys \<Longrightarrow> distinct xs \<Longrightarrow> map (\<sigma>[xs :=\<^sup>* ys]) xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; distinct xs\<rbrakk> \<Longrightarrow> map (\<sigma>[xs :=\<^sup>* ys]) xs = ys
[PROOF STEP]
by (induct xs ys arbitrary: \<sigma> rule: list_induct2) auto


[STATEMENT]
lemma iless_Suc_eq [simp]: "enat m < eSuc n \<longleftrightarrow> enat m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (enat m < eSuc n) = (enat m \<le> n)
[PROOF STEP]
by (auto simp add: eSuc_def less_enat_def split: enat.splits)


[STATEMENT]
lemma erfc_real_less_0_iff [simp]: "erfc (x::real) < 1 \<longleftrightarrow> x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (erfc x < 1) = (0 < x)
[PROOF STEP]
by (simp add: erfc_def)


[STATEMENT]
lemma gtr_find_thread: "\<lbrakk>
    (c,e,c')\<in>gtr gtrs;
    !!s ce s' ce'. \<lbrakk>c=add_mset s ce; c'=add_mset s' ce'; ((s,ce),e,(s',ce'))\<in>gtrs\<rbrakk> \<Longrightarrow> P
  \<rbrakk> \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, e, c') \<in> gtr gtrs; \<And>s ce s' ce'. \<lbrakk>c = add_mset s ce; c' = add_mset s' ce'; ((s, ce), e, s', ce') \<in> gtrs\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (unfold gtr_def) auto


[STATEMENT]
lemma fract_content_fract_poly [simp]: "fract_content (fract_poly p) = to_fract (content p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
have "Lcm_coeff_denoms (fract_poly p) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm (snd ` quot_of_fract ` set (coeffs (map_poly to_fract p))) = (1::'a)
[PROOF STEP]
by (auto simp: set_coeffs_map_poly)
[PROOF STATE]
proof (state)
this:
Lcm (snd ` quot_of_fract ` set (coeffs (map_poly to_fract p))) = (1::'a)

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
hence "fract_content (fract_poly p) =
           to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))"
[PROOF STATE]
proof (prove)
using this:
Lcm (snd ` quot_of_fract ` set (coeffs (map_poly to_fract p))) = (1::'a)

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))
[PROOF STEP]
by (simp add: fract_content_def to_fract_def fract_collapse map_poly_map_poly del: Lcm_1_iff)
[PROOF STATE]
proof (state)
this:
fract_content (map_poly to_fract p) = to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fract_content (map_poly to_fract p) = to_fract (content (map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p))

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
have "map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p = p
[PROOF STEP]
by (intro map_poly_idI) simp_all
[PROOF STATE]
proof (state)
this:
map_poly (fst \<circ> quot_of_fract \<circ> to_fract) p = p

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fract_content (map_poly to_fract p) = to_fract (content p)

goal (1 subgoal):
 1. fract_content (map_poly to_fract p) = to_fract (content p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fract_content (map_poly to_fract p) = to_fract (content p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ac_cong_set_SA:
  assumes "n > 0"
  assumes "k \<in> Units (Zp_res_ring n)"
  assumes "c \<in> carrier (SA (m+l))"
  shows "is_semialgebraic (m+l) {x \<in> carrier (Q\<^sub>p\<^bsup>m+l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
have  "{x \<in> carrier (Q\<^sub>p\<^bsup>m+l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}= (c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k
[PROOF STEP]
unfolding ac_cong_set_def evimage_def nonzero_def mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). (c x \<in> carrier Q\<^sub>p \<and> c x \<noteq> \<zero>) \<and> ac n (c x) = k} = c -` {x \<in> carrier Q\<^sub>p. x \<noteq> \<zero> \<and> ac n x = k} \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n
k \<in> Units (residue_ring (p ^ n))
c \<in> carrier (SA (m + l))

goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). (c x \<in> carrier Q\<^sub>p \<and> c x \<noteq> \<zero>) \<and> ac n (c x) = k} = c -` {x \<in> carrier Q\<^sub>p. x \<noteq> \<zero> \<and> ac n x = k} \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k

goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k

goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
using assms ac_cong_set_is_univ_semialg[of n k] evimage_is_semialg[of c "m+l" "ac_cong_set n k"]
[PROOF STATE]
proof (prove)
using this:
{x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k} = c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k
0 < n
k \<in> Units (residue_ring (p ^ n))
c \<in> carrier (SA (m + l))
\<lbrakk>0 < n; k \<in> Units (residue_ring (p ^ n))\<rbrakk> \<Longrightarrow> is_univ_semialgebraic (ac_cong_set n k)
\<lbrakk>c \<in> carrier (SA (m + l)); is_univ_semialgebraic (ac_cong_set n k)\<rbrakk> \<Longrightarrow> is_semialgebraic (m + l) (c \<inverse>\<^bsub>m + l\<^esub> ac_cong_set n k)

goal (1 subgoal):
 1. is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
is_semialgebraic (m + l) {x \<in> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>). c x \<in> nonzero Q\<^sub>p \<and> ac n (c x) = k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_component_Union: "connected_component_set S x = \<Union>{T. connected T \<and> x \<in> T \<and> T \<subseteq> S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_component_set S x = \<Union> {T. connected T \<and> x \<in> T \<and> T \<subseteq> S}
[PROOF STEP]
by (auto simp: connected_component_def)