[STATEMENT]
lemma "eval (ExQ (ExQ F)) L = eval (ExQ (ExQ (swap_fm 0 1 F))) L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (ExQ (ExQ F)) L = eval (ExQ (ExQ (swap_fm 0 1 F))) L
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x xa. eval F (xa # x # L)) = (\<exists>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L))
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. eval F (xa # x # L) \<Longrightarrow> \<exists>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L)
 2. \<And>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L) \<Longrightarrow> \<exists>x xa. eval F (xa # x # L)
[PROOF STEP]
subgoal for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> \<exists>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L)
[PROOF STEP]
apply(rule exI[where x=j])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> \<exists>x. eval (swap_fm 0 (Suc 0) F) (x # j # L)
[PROOF STEP]
apply(rule exI[where x=i])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> eval (swap_fm 0 (Suc 0) F) (i # j # L)
[PROOF STEP]
using swap_fm[of 0 "j # i # L" "Suc 0" F]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (j # i # L); Suc 0 < length (j # i # L)\<rbrakk> \<Longrightarrow> eval F (j # i # L) = eval (swap_fm 0 (Suc 0) F) (swap_list 0 (Suc 0) (j # i # L))

goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> eval (swap_fm 0 (Suc 0) F) (i # j # L)
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L) \<Longrightarrow> \<exists>x xa. eval F (xa # x # L)
[PROOF STEP]
subgoal for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> \<exists>x xa. eval F (xa # x # L)
[PROOF STEP]
apply(rule exI[where x=j])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> \<exists>x. eval F (x # j # L)
[PROOF STEP]
apply(rule exI[where x=i])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> eval F (i # j # L)
[PROOF STEP]
using swap_fm[of 0 "i # j # L" "Suc 0" F]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (i # j # L); Suc 0 < length (i # j # L)\<rbrakk> \<Longrightarrow> eval F (i # j # L) = eval (swap_fm 0 (Suc 0) F) (swap_list 0 (Suc 0) (i # j # L))

goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> eval F (i # j # L)
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma st_hrabs: "x \<in> HFinite \<Longrightarrow> \<bar>st x\<bar> = st \<bar>x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> HFinite \<Longrightarrow> \<bar>st x\<bar> = st \<bar>x\<bar>
[PROOF STEP]
by (simp add: order_class.order.antisym st_zero_ge linorder_not_le st_zero_le abs_if st_minus linorder_not_less)


[STATEMENT]
lemma nextState_decide:
  assumes run:"HORun OTR_M rho HOs"
  and chg: "decide (rho (Suc n) p) \<noteq> decide (rho n p)"
  shows "TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n))
                   (the (decide (rho (Suc n) p)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
from run
[PROOF STATE]
proof (chain)
picking this:
HORun OTR_M rho HOs
[PROOF STEP]
have "OTR_nextState n p (rho n p)
                    (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)"
[PROOF STATE]
proof (prove)
using this:
HORun OTR_M rho HOs

goal (1 subgoal):
 1. OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)
[PROOF STEP]
by (simp add: HORun_eq HOnextConfig_eq OTR_HOMachine_def nextState_def)
[PROOF STATE]
proof (state)
this:
OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)

goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
with chg
[PROOF STATE]
proof (chain)
picking this:
decide (rho (Suc n) p) \<noteq> decide (rho n p)
OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
decide (rho (Suc n) p) \<noteq> decide (rho n p)
OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)

goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
by (auto simp: OTR_nextState_def elim: someI)
[PROOF STATE]
proof (state)
this:
TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Shuffle_PlusR[simp]: "Shuffle r (Plus s t) = Plus (Shuffle r s) (Shuffle r t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Shuffle r (Plus s t) = Plus (Shuffle r s) (Shuffle r t)
[PROOF STEP]
by (coinduction arbitrary: r s t rule: language_coinduct_upto_Plus)
    (force intro!: Trans[OF Plus[OF Base Base] Refl])


[STATEMENT]
lemma exp_cf4_pos: "exp_cf4 x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < exp_cf4 x
[PROOF STEP]
unfolding exp_cf4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < numer_cf4 x / numer_cf4 (- x)
[PROOF STEP]
by (auto simp add: divide_simps numer_cf4_pos)


[STATEMENT]
lemma ket_injective[simp]: \<open>ket i = ket j \<longleftrightarrow> i = j\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ket i = ket j) = (i = j)
[PROOF STEP]
by (metis cinner_ket one_neq_zero)


[STATEMENT]
lemma justified_sum:
  assumes "\<forall>p\<in>P. justified (f p) (g p)"
    and   "\<forall>p\<in>P. \<forall>t. 0 \<le> zcount (f p) t"
  shows   "justified (\<Sum>p\<in>P. f p) (\<Sum>p\<in>P. g p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. justified (sum f P) (sum g P)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>P. justified (f p) (g p)
\<forall>p\<in>P. \<forall>t. 0 \<le> zcount (f p) t

goal (1 subgoal):
 1. justified (sum f P) (sum g P)
[PROOF STEP]
by (induct P rule: infinite_finite_induct)
    (auto intro!: justified_add sum_nonneg simp: zcount_sum)


[STATEMENT]
lemma winding_number_comp_linear:
  assumes "c\<noteq>0" "valid_path \<gamma>" and not_image: "(z-b)/c \<notin> path_image \<gamma>"
  shows "winding_number ((\<lambda>x. c*x+b) \<circ> \<gamma>) z = winding_number \<gamma> ((z-b)/c)" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
define cc where "cc=1 / (complex_of_real (2 * pi) * \<i>)"
[PROOF STATE]
proof (state)
this:
cc = 1 / (complex_of_real (2 * pi) * \<i>)

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
define zz where "zz=(z-b)/c"
[PROOF STATE]
proof (state)
this:
zz = (z - b) / c

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
have "?L = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
apply (subst winding_number_comp[of UNIV,simplified])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. (\<lambda>x. c * x + b) holomorphic_on UNIV
 2. valid_path \<gamma>
 3. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
 4. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * x + b) holomorphic_on UNIV
[PROOF STEP]
by (auto intro:holomorphic_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. valid_path \<gamma>
 2. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
 3. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
using \<open>valid_path \<gamma>\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path \<gamma>

goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
 2. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
[PROOF STEP]
using not_image \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
(z - b) / c \<notin> path_image \<gamma>
c \<noteq> 0

goal (1 subgoal):
 1. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
[PROOF STEP]
unfolding path_image_compose
[PROOF STATE]
proof (prove)
using this:
(z - b) / c \<notin> path_image \<gamma>
c \<noteq> 0

goal (1 subgoal):
 1. z \<notin> (\<lambda>x. c * x + b) ` path_image \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
unfolding cc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
have "\<dots> = cc * contour_integral \<gamma> (\<lambda>w.1 / (w - zz))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
have "deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)
[PROOF STEP]
by (auto intro:derivative_intros)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)

goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)

goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
unfolding zz_def cc_def
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)

goal (1 subgoal):
 1. 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. 1 / (w - (z - b) / c))
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)
c \<noteq> 0

goal (1 subgoal):
 1. 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. 1 / (w - (z - b) / c))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
have "\<dots> = winding_number \<gamma> zz"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz)) = winding_number \<gamma> zz
[PROOF STEP]
using winding_number_valid_path[OF \<open>valid_path \<gamma>\<close> not_image,folded zz_def cc_def]
[PROOF STATE]
proof (prove)
using this:
winding_number \<gamma> zz = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz)) = winding_number \<gamma> zz
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz)) = winding_number \<gamma> zz

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz
[PROOF STEP]
show "winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz"
[PROOF STATE]
proof (prove)
using this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma join_expansion:
    assumes "t \<frown> u"
    shows "t \<squnion> u = t \<cdot> (u \\ t)" and "seq t (u \\ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<squnion> u = t \<cdot> u \ t &&& seq t (u \ t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<squnion> u = t \<cdot> u \ t
 2. seq t (u \ t)
[PROOF STEP]
show "t \<squnion> u = t \<cdot> (u \\ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<squnion> u = t \<cdot> u \ t
[PROOF STEP]
by (metis assms comp_is_composite_of(2) has_joins join_is_join_of join_of_def)
[PROOF STATE]
proof (state)
this:
t \<squnion> u = t \<cdot> u \ t

goal (1 subgoal):
 1. seq t (u \ t)
[PROOF STEP]
thus "seq t (u \\ t)"
[PROOF STATE]
proof (prove)
using this:
t \<squnion> u = t \<cdot> u \ t

goal (1 subgoal):
 1. seq t (u \ t)
[PROOF STEP]
by (meson assms composable_def composable_iff_seq has_joins join_is_join_of join_of_def)
[PROOF STATE]
proof (state)
this:
seq t (u \ t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_leq_Max:
  assumes "x \<le>\<^sub>v y"
    and "x \<noteq> []"
  shows "\<forall>xi \<in> set x. xi \<le> Max (set y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xi\<in>set x. xi \<le> Max (set y)
[PROOF STEP]
by (metis (no_types, lifting) List.finite_set Max_ge_iff
      assms in_set_conv_nth length_0_conv less_eq_def set_empty)


[STATEMENT]
lemma powreal_not_zero: "a > 0 \<Longrightarrow> a pow\<^sub>\<real> x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> a pow\<^sub>\<real> x \<noteq> 0
[PROOF STEP]
by (metis order_less_imp_not_eq powreal_gt_zero)


[STATEMENT]
lemma numeral_less_real_of_nat_iff [simp]: "numeral w < real n \<longleftrightarrow> numeral w < n"
  for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral w < real n) = (numeral w < n)
[PROOF STEP]
by (metis of_nat_less_iff of_nat_numeral)


[STATEMENT]
lemma multiplicity_aprimedivisor_gt_0_nat [simp]:
  "d > Suc 0 \<Longrightarrow> multiplicity (aprimedivisor d) d > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < d \<Longrightarrow> 0 < multiplicity (aprimedivisor d) d
[PROOF STEP]
by (subst multiplicity_gt_zero_iff) (auto intro: aprimedivisor_dvd')


[STATEMENT]
lemma fps_shift_add:
  "fps_shift n (f + g) = fps_shift n f + fps_shift n g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_shift n (f + g) = fps_shift n f + fps_shift n g
[PROOF STEP]
by (simp add: fps_eq_iff)


[STATEMENT]
lemma tranclp_eq_rtranclp [iff]:
  "(\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ = P\<^sup>*\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ = P\<^sup>*\<^sup>*
[PROOF STEP]
proof (intro ext iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa \<Longrightarrow> P\<^sup>*\<^sup>* x xa
 2. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa \<Longrightarrow> P\<^sup>*\<^sup>* x xa
 2. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
have "(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y
[PROOF STEP]
by (rule mono_rtranclp) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y

goal (2 subgoals):
 1. \<And>x xa. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa \<Longrightarrow> P\<^sup>*\<^sup>* x xa
 2. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
thus "(\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y
[PROOF STEP]
using tranclp_into_rtranclp
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y
?r\<^sup>+\<^sup>+ ?a ?b \<Longrightarrow> ?r\<^sup>*\<^sup>* ?a ?b

goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
show "P\<^sup>*\<^sup>* x y \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P\<^sup>*\<^sup>* x y \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y
[PROOF STEP]
by (metis (mono_tags, lifting) mono_rtranclp rtranclpD tranclp.r_into_trancl)
[PROOF STATE]
proof (state)
this:
P\<^sup>*\<^sup>* x y \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sets_distinct1: "(n::int) \<noteq> m \<Longrightarrow> {(a,b). a = n} \<noteq> {(a,b). a = m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> {(a, b). a = n} \<noteq> {(a, b). a = m}
[PROOF STEP]
by auto


[STATEMENT]
lemma ntrunc_UN1: "ntrunc k (UN x. f(x)) = (UN x. ntrunc k (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ntrunc k (\<Union> (range f)) = (\<Union>x. ntrunc k (f x))
[PROOF STEP]
by (simp add: ntrunc_def, blast)


[STATEMENT]
lemma independent_injective_image: "m1.independent s \<Longrightarrow> inj_on f (m1.span s) \<Longrightarrow> m2.independent (f ` s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m1.independent s; inj_on f (m1.span s)\<rbrakk> \<Longrightarrow> m2.independent (f ` s)
[PROOF STEP]
using dependent_inj_imageD[of s]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>m2.dependent (f ` s); inj_on f (m1.span s)\<rbrakk> \<Longrightarrow> m1.dependent s

goal (1 subgoal):
 1. \<lbrakk>m1.independent s; inj_on f (m1.span s)\<rbrakk> \<Longrightarrow> m2.independent (f ` s)
[PROOF STEP]
by auto


[STATEMENT]
lemma col_cong2_bet1:
  assumes "Col A B D" and
    "Bet A C B" and
    "Cong A B C D" and
    "Cong A C B D"
  shows "Bet C B D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bet C B D
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) assms(4) bet__le1213 bet_cong_eq between_symmetry col_cong_bet cong__le cong_left_commutativity l5_12_b l5_6 outer_transitivity_between2)


[STATEMENT]
lemma properfactor_lless:
  fixes G (structure)
  shows "properfactor G = lless (division_rel G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properfactor G = (\<sqsubset>\<^bsub>division_rel G\<^esub>)
[PROOF STEP]
by (force simp: lless_def properfactor_def associated_def)


[STATEMENT]
lemma constants_are_not_variables :
  assumes "is_a_constant x"
  shows "\<not> (is_a_variable x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_a_variable x
[PROOF STEP]
by (metis assms is_a_constant.elims(2) is_a_variable.elims(2) trm.distinct(2))


[STATEMENT]
theorem while_rule_lemma:
  assumes invariant: "!!s. P s ==> b s ==> P (c s)"
    and terminate: "!!s. P s ==> \<not> b s ==> Q s"
    and wf: "wf {(t, s). P s \<and> b s \<and> t = c s}"
  shows "P s \<Longrightarrow> Q (while b c s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P s \<Longrightarrow> Q (while b c s)
[PROOF STEP]
using wf
[PROOF STATE]
proof (prove)
using this:
wf {(t, s). P s \<and> b s \<and> t = c s}

goal (1 subgoal):
 1. P s \<Longrightarrow> Q (while b c s)
[PROOF STEP]
apply (induct s)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>(y, x) \<in> {(t, s). P s \<and> b s \<and> t = c s}; P y\<rbrakk> \<Longrightarrow> Q (while b c y); P x\<rbrakk> \<Longrightarrow> Q (while b c x)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<lbrakk>b x; P (c x)\<rbrakk> \<Longrightarrow> Q (while b c (c x)); P x\<rbrakk> \<Longrightarrow> Q (while b c x)
[PROOF STEP]
apply (subst while_unfold)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<lbrakk>b x; P (c x)\<rbrakk> \<Longrightarrow> Q (while b c (c x)); P x\<rbrakk> \<Longrightarrow> Q (if b x then while b c (c x) else x)
[PROOF STEP]
apply (simp add: invariant terminate)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pj_mem:"\<lbrakk>Ring R; ideal R I; x \<in> carrier R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (frule Ring.ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (simp add:aGroup.ag_carrier_carrier [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier (b_ag R); aGroup R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (simp add:pj_def Pj_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier (b_ag R); aGroup R\<rbrakk> \<Longrightarrow> I \<bullet>\<^bsub>b_ag R\<^esub> x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (simp add:ar_coset_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_connected_space_path_component_set:
   "path_connected_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. Collect(path_component_of X x) = topspace X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected_space X = (\<forall>x\<in>topspace X. path_component_of_set X x = topspace X)
[PROOF STEP]
using path_component_of_subset_topspace path_connected_space_iff_path_component
[PROOF STATE]
proof (prove)
using this:
path_component_of_set ?X ?x \<subseteq> topspace ?X
path_connected_space ?X = (\<forall>x\<in>topspace ?X. \<forall>y\<in>topspace ?X. path_component_of ?X x y)

goal (1 subgoal):
 1. path_connected_space X = (\<forall>x\<in>topspace X. path_component_of_set X x = topspace X)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma distinct_roots_of_real_poly: "distinct (roots_of_real_poly p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (roots_of_real_poly p)
[PROOF STEP]
unfolding roots_of_real_poly_def roots_of_real_rf_polys_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (if p = 0 then [] else concat (map roots_of_real_rf_poly (polys_rf (yun_polys p))))
[PROOF STEP]
using roots_of_rf_yun_polys_distinct[of roots_of_real_rf_poly p, OF roots_of_real_rf_poly]
[PROOF STATE]
proof (prove)
using this:
distinct (concat (map roots_of_real_rf_poly (polys_rf (yun_polys p))))

goal (1 subgoal):
 1. distinct (if p = 0 then [] else concat (map roots_of_real_rf_poly (polys_rf (yun_polys p))))
[PROOF STEP]
by auto


[STATEMENT]
lemma prob_space_eP: "x \<in> space (PiM {0..<n} M) \<Longrightarrow> prob_space (eP n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> space (Pi\<^sub>M {0..<n} M) \<Longrightarrow> prob_space (eP n x)
[PROOF STEP]
unfolding eP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> space (Pi\<^sub>M {0..<n} M) \<Longrightarrow> prob_space (distr (P n x) (Pi\<^sub>M {0..<Suc n} M) (fun_upd x n))
[PROOF STEP]
by (intro prob_space.prob_space_distr prob_space_P measurable_fun_upd[where J="{0..<n}"]) auto


[STATEMENT]
lemma nonempty_connected_components_of:
   "C \<in> connected_components_of X \<Longrightarrow> C \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<in> connected_components_of X \<Longrightarrow> C \<noteq> {}
[PROOF STEP]
unfolding connected_components_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<in> connected_component_of_set X ` topspace X \<Longrightarrow> C \<noteq> {}
[PROOF STEP]
by (metis (no_types, lifting) connected_component_of_eq_empty imageE)


[STATEMENT]
lemma tensor_op_nonzero:
  fixes a :: \<open>'a::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L 'c::finite ell2\<close> and b :: \<open>'b::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L 'd::finite ell2\<close>
  assumes \<open>a \<noteq> 0\<close> and \<open>b \<noteq> 0\<close>
  shows \<open>a \<otimes>\<^sub>o b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
from \<open>a \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
obtain i where i: \<open>a *\<^sub>V ket i \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (\<And>i. a *\<^sub>V ket i \<noteq> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis cblinfun.zero_left equal_ket)
[PROOF STATE]
proof (state)
this:
a *\<^sub>V ket i \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
from \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> 0
[PROOF STEP]
obtain j where j: \<open>b *\<^sub>V ket j \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0

goal (1 subgoal):
 1. (\<And>j. b *\<^sub>V ket j \<noteq> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis cblinfun.zero_left equal_ket)
[PROOF STATE]
proof (state)
this:
b *\<^sub>V ket j \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
from i j
[PROOF STATE]
proof (chain)
picking this:
a *\<^sub>V ket i \<noteq> 0
b *\<^sub>V ket j \<noteq> 0
[PROOF STEP]
have ijneq0: \<open>(a *\<^sub>V ket i) \<otimes>\<^sub>s (b *\<^sub>V ket j) \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a *\<^sub>V ket i \<noteq> 0
b *\<^sub>V ket j \<noteq> 0

goal (1 subgoal):
 1. (a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j \<noteq> 0
[PROOF STEP]
by (simp add: tensor_ell2_nonzero)
[PROOF STATE]
proof (state)
this:
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
have \<open>(a *\<^sub>V ket i) \<otimes>\<^sub>s (b *\<^sub>V ket j) = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i,j)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)
[PROOF STEP]
by (simp add: tensor_op_ket)
[PROOF STATE]
proof (state)
this:
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
with ijneq0
[PROOF STATE]
proof (chain)
picking this:
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j \<noteq> 0
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)
[PROOF STEP]
show \<open>a \<otimes>\<^sub>o b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j \<noteq> 0
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<otimes>\<^sub>o b \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_projection_on_plus:
  assumes "\<And>x y. x \<in> A \<Longrightarrow> y \<in> B \<Longrightarrow> is_orthogonal x y"
  assumes \<open>closed_csubspace A\<close>
  assumes \<open>closed_csubspace B\<close>
  assumes \<open>is_projection_on \<pi>A A\<close>
  assumes \<open>is_projection_on \<pi>B B\<close>
  shows \<open>is_projection_on (\<lambda>x. \<pi>A x + \<pi>B x) (A +\<^sub>M B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_projection_on (\<lambda>x. \<pi>A x + \<pi>B x) (A +\<^sub>M B)
[PROOF STEP]
proof (rule is_projection_on_iff_orthog[THEN iffD2, rule_format])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. closed_csubspace (A +\<^sub>M B)
 2. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
show clAB: \<open>closed_csubspace (A +\<^sub>M B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_csubspace (A +\<^sub>M B)
[PROOF STEP]
by (simp add: assms(2) assms(3) closed_subspace_closed_sum)
[PROOF STATE]
proof (state)
this:
closed_csubspace (A +\<^sub>M B)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
have 1: \<open>\<pi>A h + \<pi>B h \<in> A +\<^sub>M B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
by (meson clAB assms(2) assms(3) assms(4) assms(5) closed_csubspace_def closed_sum_left_subset closed_sum_right_subset complex_vector.subspace_def in_mono is_projection_on_in_image)
[PROOF STATE]
proof (state)
this:
\<pi>A h + \<pi>B h \<in> A +\<^sub>M B

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
have \<open>\<pi>A (\<pi>B h) = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>A (\<pi>B h) = (0::'a)
[PROOF STEP]
by (smt (verit, del_insts) assms(1) assms(2) assms(4) assms(5) cinner_eq_zero_iff is_cadjoint_def is_projection_on_in_image is_projection_on_is_cadjoint)
[PROOF STATE]
proof (state)
this:
\<pi>A (\<pi>B h) = (0::'a)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<pi>A (\<pi>B h) = (0::'a)
[PROOF STEP]
have \<open>h - (\<pi>A h + \<pi>B h) = (h - \<pi>B h) - \<pi>A (h - \<pi>B h)\<close>
[PROOF STATE]
proof (prove)
using this:
\<pi>A (\<pi>B h) = (0::'a)

goal (1 subgoal):
 1. h - (\<pi>A h + \<pi>B h) = h - \<pi>B h - \<pi>A (h - \<pi>B h)
[PROOF STEP]
by (smt (verit) add.right_neutral add_diff_cancel_left' assms(2) assms(4) closed_csubspace.subspace complex_vector.subspace_diff diff_add_eq_diff_diff_swap diff_diff_add is_projection_on_iff_orthog orthog_proj_unique orthogonal_complement_closed_subspace)
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) = h - \<pi>B h - \<pi>A (h - \<pi>B h)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) = h - \<pi>B h - \<pi>A (h - \<pi>B h)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
have \<open>\<dots> \<in> orthogonal_complement A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h - \<pi>B h - \<pi>A (h - \<pi>B h) \<in> orthogonal_complement A
[PROOF STEP]
using assms(2) assms(4) is_projection_on_iff_orthog
[PROOF STATE]
proof (prove)
using this:
closed_csubspace A
is_projection_on \<pi>A A
closed_csubspace ?M \<Longrightarrow> is_projection_on ?\<pi> ?M = (\<forall>h. h - ?\<pi> h \<in> orthogonal_complement ?M \<and> ?\<pi> h \<in> ?M)

goal (1 subgoal):
 1. h - \<pi>B h - \<pi>A (h - \<pi>B h) \<in> orthogonal_complement A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h - \<pi>B h - \<pi>A (h - \<pi>B h) \<in> orthogonal_complement A

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement A
[PROOF STEP]
have orthoA: \<open>h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement A\<close>
[PROOF STATE]
proof (prove)
using this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement A

goal (1 subgoal):
 1. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement A
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement A

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
have \<open>\<pi>B (\<pi>A h) = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>B (\<pi>A h) = (0::'a)
[PROOF STEP]
by (smt (verit, del_insts) assms(1) assms(3) assms(4) assms(5) cinner_eq_zero_iff is_cadjoint_def is_projection_on_in_image is_projection_on_is_cadjoint)
[PROOF STATE]
proof (state)
this:
\<pi>B (\<pi>A h) = (0::'a)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<pi>B (\<pi>A h) = (0::'a)
[PROOF STEP]
have \<open>h - (\<pi>A h + \<pi>B h) = (h - \<pi>A h) - \<pi>B (h - \<pi>A h)\<close>
[PROOF STATE]
proof (prove)
using this:
\<pi>B (\<pi>A h) = (0::'a)

goal (1 subgoal):
 1. h - (\<pi>A h + \<pi>B h) = h - \<pi>A h - \<pi>B (h - \<pi>A h)
[PROOF STEP]
by (smt (verit) add.right_neutral add_diff_cancel assms(3) assms(5) closed_csubspace.subspace complex_vector.subspace_diff diff_add_eq_diff_diff_swap diff_diff_add is_projection_on_iff_orthog orthog_proj_unique orthogonal_complement_closed_subspace)
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) = h - \<pi>A h - \<pi>B (h - \<pi>A h)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) = h - \<pi>A h - \<pi>B (h - \<pi>A h)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
have \<open>\<dots> \<in> orthogonal_complement B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h - \<pi>A h - \<pi>B (h - \<pi>A h) \<in> orthogonal_complement B
[PROOF STEP]
using assms(3) assms(5) is_projection_on_iff_orthog
[PROOF STATE]
proof (prove)
using this:
closed_csubspace B
is_projection_on \<pi>B B
closed_csubspace ?M \<Longrightarrow> is_projection_on ?\<pi> ?M = (\<forall>h. h - ?\<pi> h \<in> orthogonal_complement ?M \<and> ?\<pi> h \<in> ?M)

goal (1 subgoal):
 1. h - \<pi>A h - \<pi>B (h - \<pi>A h) \<in> orthogonal_complement B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h - \<pi>A h - \<pi>B (h - \<pi>A h) \<in> orthogonal_complement B

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement B
[PROOF STEP]
have orthoB: \<open>h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement B\<close>
[PROOF STATE]
proof (prove)
using this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement B

goal (1 subgoal):
 1. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement B
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement B

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
from orthoA orthoB
[PROOF STATE]
proof (chain)
picking this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement A
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement B
[PROOF STEP]
have 2: \<open>h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B)\<close>
[PROOF STATE]
proof (prove)
using this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement A
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement B

goal (1 subgoal):
 1. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B)
[PROOF STEP]
by (metis IntI assms(2) assms(3) closed_csubspace_def complex_vector.subspace_def de_morgan_orthogonal_complement_plus)
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B)

goal (1 subgoal):
 1. \<And>h. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
from 1 2
[PROOF STATE]
proof (chain)
picking this:
\<pi>A h + \<pi>B h \<in> A +\<^sub>M B
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B)
[PROOF STEP]
show \<open>h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B\<close>
[PROOF STATE]
proof (prove)
using this:
\<pi>A h + \<pi>B h \<in> A +\<^sub>M B
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B)

goal (1 subgoal):
 1. h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h - (\<pi>A h + \<pi>B h) \<in> orthogonal_complement (A +\<^sub>M B) \<and> \<pi>A h + \<pi>B h \<in> A +\<^sub>M B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_exp [continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. exp (f x))"
  for f :: "_ \<Rightarrow>'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F f \<Longrightarrow> continuous F (\<lambda>x. exp (f x))
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F \<Longrightarrow> ((\<lambda>x. exp (f x)) \<longlongrightarrow> exp (f (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
by (rule tendsto_exp)


[STATEMENT]
lemma fps_dvd_code [code_unfold]:
  "x dvd y \<longleftrightarrow> y = 0 \<or> ((x::'a::field_gcd fps) \<noteq> 0 \<and> subdegree x \<le> subdegree y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x dvd y) = (y = 0 \<or> x \<noteq> 0 \<and> subdegree x \<le> subdegree y)
[PROOF STEP]
using fps_dvd_iff[of x y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<noteq> 0; y \<noteq> 0\<rbrakk> \<Longrightarrow> (x dvd y) = (subdegree x \<le> subdegree y)

goal (1 subgoal):
 1. (x dvd y) = (y = 0 \<or> x \<noteq> 0 \<and> subdegree x \<le> subdegree y)
[PROOF STEP]
by (cases "x = 0") auto


[STATEMENT]
lemma integral_mult_left_zero[simp]:
  fixes c :: "_::{real_normed_field,second_countable_topology}"
  shows "(\<integral> x. f x * c \<partial>M) = integral\<^sup>L M f * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. f x * c = integral\<^sup>L M f * c
[PROOF STEP]
by (rule integral_bounded_linear'[OF bounded_linear_mult_left bounded_linear_mult_left[of "1 / c"]]) simp


[STATEMENT]
theorem HFail_valueChosen:
  assumes act: "HFail s s' q"
  and vc: "valueChosen s v"
  and v_input: "v \<in> Inputs"
  shows "valueChosen s' v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valueChosen s' v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. valueChosen s' v
[PROOF STEP]
from vc
[PROOF STATE]
proof (chain)
picking this:
valueChosen s v
[PROOF STEP]
obtain b p D where
        asm1: "b \<in> (UN p. Ballot p)"
    and asm2: "D\<in>MajoritySet"
    and asm3: "maxBalInp s b v"
    and asm4: "\<forall>d\<in>D.  b \<le> bal(disk s d p)
                   \<and>(\<forall>q.(   phase s q = 1
                          \<and> b \<le>mbal(dblock s q)
                          \<and> hasRead s q d p
                         ) \<longrightarrow> (\<exists>br\<in>blocksRead s q d. b \<le> bal(block br)))"
[PROOF STATE]
proof (prove)
using this:
valueChosen s v

goal (1 subgoal):
 1. (\<And>b D p. \<lbrakk>b \<in> \<Union> (range Ballot); D \<in> MajoritySet; maxBalInp s b v; \<forall>d\<in>D. b \<le> bal (disk s d p) \<and> (\<forall>q. phase s q = 1 \<and> b \<le> mbal (dblock s q) \<and> hasRead s q d p \<longrightarrow> (\<exists>br\<in>blocksRead s q d. b \<le> bal (block br)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: valueChosen_def)
[PROOF STATE]
proof (state)
this:
b \<in> \<Union> (range Ballot)
D \<in> MajoritySet
maxBalInp s b v
\<forall>d\<in>D. b \<le> bal (disk s d p) \<and> (\<forall>q. phase s q = 1 \<and> b \<le> mbal (dblock s q) \<and> hasRead s q d p \<longrightarrow> (\<exists>br\<in>blocksRead s q d. b \<le> bal (block br)))

goal (1 subgoal):
 1. valueChosen s' v
[PROOF STEP]
from HFail_maxBalInp[OF act asm1 asm3]
[PROOF STATE]
proof (chain)
picking this:
maxBalInp s' b v
[PROOF STEP]
have "maxBalInp s' b v"
[PROOF STATE]
proof (prove)
using this:
maxBalInp s' b v

goal (1 subgoal):
 1. maxBalInp s' b v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
maxBalInp s' b v

goal (1 subgoal):
 1. valueChosen s' v
[PROOF STEP]
with HFail_valueChosen2[OF act asm4] asm1 asm2
[PROOF STATE]
proof (chain)
picking this:
\<forall>d\<in>D. b \<le> bal (disk s' d p) \<and> (\<forall>q. phase s' q = 1 \<and> b \<le> mbal (dblock s' q) \<and> hasRead s' q d p \<longrightarrow> (\<exists>br\<in>blocksRead s' q d. b \<le> bal (block br)))
b \<in> \<Union> (range Ballot)
D \<in> MajoritySet
maxBalInp s' b v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>d\<in>D. b \<le> bal (disk s' d p) \<and> (\<forall>q. phase s' q = 1 \<and> b \<le> mbal (dblock s' q) \<and> hasRead s' q d p \<longrightarrow> (\<exists>br\<in>blocksRead s' q d. b \<le> bal (block br)))
b \<in> \<Union> (range Ballot)
D \<in> MajoritySet
maxBalInp s' b v

goal (1 subgoal):
 1. valueChosen s' v
[PROOF STEP]
by(auto simp add: valueChosen_def)
[PROOF STATE]
proof (state)
this:
valueChosen s' v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ord_form_list_idemp:
  "ord_form_list_aci (ord_form_list_aci q) = ord_form_list_aci q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_form_list_aci (ord_form_list_aci q) = ord_form_list_aci q
[PROOF STEP]
apply (induct q)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. ord_form_list_aci (ord_form_list_aci form_list_aci.TT_aci) = ord_form_list_aci form_list_aci.TT_aci
 2. ord_form_list_aci (ord_form_list_aci form_list_aci.FF_aci) = ord_form_list_aci form_list_aci.FF_aci
 3. \<And>x1 x2 x3. ord_form_list_aci (ord_form_list_aci (form_list_aci.Pred_aci x1 x2 x3)) = ord_form_list_aci (form_list_aci.Pred_aci x1 x2 x3)
 4. \<And>x. (\<And>xa. xa \<in> set x \<Longrightarrow> ord_form_list_aci (ord_form_list_aci xa) = ord_form_list_aci xa) \<Longrightarrow> ord_form_list_aci (ord_form_list_aci (form_list_aci.And_aci x)) = ord_form_list_aci (form_list_aci.And_aci x)
 5. \<And>x. (\<And>xa. xa \<in> set x \<Longrightarrow> ord_form_list_aci (ord_form_list_aci xa) = ord_form_list_aci xa) \<Longrightarrow> ord_form_list_aci (ord_form_list_aci (form_list_aci.Or_aci x)) = ord_form_list_aci (form_list_aci.Or_aci x)
 6. \<And>q. ord_form_list_aci (ord_form_list_aci q) = ord_form_list_aci q \<Longrightarrow> ord_form_list_aci (ord_form_list_aci (form_list_aci.Forall_aci q)) = ord_form_list_aci (form_list_aci.Forall_aci q)
 7. \<And>q. ord_form_list_aci (ord_form_list_aci q) = ord_form_list_aci q \<Longrightarrow> ord_form_list_aci (ord_form_list_aci (form_list_aci.Exists_aci q)) = ord_form_list_aci (form_list_aci.Exists_aci q)
[PROOF STEP]
apply (auto simp: list.set_map)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. (\<And>xa. xa \<in> set x \<Longrightarrow> ord_form_list_aci (ord_form_list_aci xa) = ord_form_list_aci xa) \<Longrightarrow> sort (map ord_form_list_aci (sort (map ord_form_list_aci x))) = sort (map ord_form_list_aci x)
 2. \<And>x. (\<And>xa. xa \<in> set x \<Longrightarrow> ord_form_list_aci (ord_form_list_aci xa) = ord_form_list_aci xa) \<Longrightarrow> sort (map ord_form_list_aci (sort (map ord_form_list_aci x))) = sort (map ord_form_list_aci x)
[PROOF STEP]
apply (smt imageE list.set_map map_idI set_sort sorted_sort_id sorted_sort_key)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma omega_sum_unfold: "x\<^sup>\<omega> + x\<^sup>\<star> \<cdot> y \<cdot> (x + y)\<^sup>\<omega> = (x + y)\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<omega> + x\<^sup>\<star> \<cdot> y \<cdot> (x + y)\<^sup>\<omega> = (x + y)\<^sup>\<omega>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x\<^sup>\<omega> + x\<^sup>\<star> \<cdot> y \<cdot> (x + y)\<^sup>\<omega> = (x + y)\<^sup>\<omega>
[PROOF STEP]
have "(x + y)\<^sup>\<omega> = x \<cdot> (x + y)\<^sup>\<omega> + y \<cdot> (x+y)\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y)\<^sup>\<omega> = x \<cdot> (x + y)\<^sup>\<omega> + y \<cdot> (x + y)\<^sup>\<omega>
[PROOF STEP]
by (metis distrib_right omega_unfold_eq)
[PROOF STATE]
proof (state)
this:
(x + y)\<^sup>\<omega> = x \<cdot> (x + y)\<^sup>\<omega> + y \<cdot> (x + y)\<^sup>\<omega>

goal (1 subgoal):
 1. x\<^sup>\<omega> + x\<^sup>\<star> \<cdot> y \<cdot> (x + y)\<^sup>\<omega> = (x + y)\<^sup>\<omega>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(x + y)\<^sup>\<omega> = x \<cdot> (x + y)\<^sup>\<omega> + y \<cdot> (x + y)\<^sup>\<omega>

goal (1 subgoal):
 1. x\<^sup>\<omega> + x\<^sup>\<star> \<cdot> y \<cdot> (x + y)\<^sup>\<omega> = (x + y)\<^sup>\<omega>
[PROOF STEP]
by (metis mult.assoc wagner_3)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<omega> + x\<^sup>\<star> \<cdot> y \<cdot> (x + y)\<^sup>\<omega> = (x + y)\<^sup>\<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reachability_invariant:
  assumes reachable: "(s, x) \<in> (Edges a)\<^sup>*"
      and closed: "\<forall>v\<in>visited. Edges a `` {v} \<subseteq> visited"
      and start: "s \<in> visited"
  shows "x \<in> visited"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> visited
[PROOF STEP]
using reachable start closed
[PROOF STATE]
proof (prove)
using this:
(s, x) \<in> (Edges a)\<^sup>*
s \<in> visited
\<forall>v\<in>visited. Edges a `` {v} \<subseteq> visited

goal (1 subgoal):
 1. x \<in> visited
[PROOF STEP]
by induction auto


[STATEMENT]
lemma to_abs_list_remove_all':
  "\<alpha>\<^sub>0 D n - {s} = \<alpha>\<^sub>0 (filter (\<lambda>d. \<nexists>S. d = (Fun (Val n) [], Fun (Set s) S)) D) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha>\<^sub>0 D n - {s} = \<alpha>\<^sub>0 (filter (\<lambda>d. \<nexists>S. d = (Fun (Val n) [], Fun (Set s) S)) D) n
[PROOF STEP]
using to_abs_alt_def[of D n]
      to_abs_alt_def[of "filter (\<lambda>d. \<nexists>S. d = (Fun (Val n) [], Fun (Set s) S)) D" n]
[PROOF STATE]
proof (prove)
using this:
\<alpha>\<^sub>0 D n = {s. \<exists>S. (Fun (Val n) [], Fun (Set s) S) \<in> set D}
\<alpha>\<^sub>0 (filter (\<lambda>d. \<nexists>S. d = (Fun (Val n) [], Fun (Set s) S)) D) n = {sa. \<exists>S. (Fun (Val n) [], Fun (Set sa) S) \<in> set (filter (\<lambda>d. \<nexists>S. d = (Fun (Val n) [], Fun (Set s) S)) D)}

goal (1 subgoal):
 1. \<alpha>\<^sub>0 D n - {s} = \<alpha>\<^sub>0 (filter (\<lambda>d. \<nexists>S. d = (Fun (Val n) [], Fun (Set s) S)) D) n
[PROOF STEP]
by auto


[STATEMENT]
lemma below_lubmapI[intro]:
  "m k = Some v \<Longrightarrow> (e k v::'a::Join_cpo) \<sqsubseteq> (\<Squnion> k\<mapsto>v\<in>m. e k v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m k = Some v \<Longrightarrow> e k v \<sqsubseteq> lub (mapCollect e m)
[PROOF STEP]
unfolding mapCollect_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m k = Some v \<Longrightarrow> e k v \<sqsubseteq> lub {e k v |k v. m k = Some v}
[PROOF STEP]
by auto


[STATEMENT]
lemma lub_bool: "lub S = (True \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lub S = (True \<in> S)
[PROOF STEP]
using is_lub_bool
[PROOF STATE]
proof (prove)
using this:
?S <<| (True \<in> ?S)

goal (1 subgoal):
 1. lub S = (True \<in> S)
[PROOF STEP]
by (rule lub_eqI)


[STATEMENT]
lemma plugInLinear :
  assumes lLength : "length L>var"
  assumes nonzero : "B\<noteq>0"
  assumes hb : "\<forall>v. insertion (nth_default 0 (list_update L var v)) b = B"
  assumes hc : "\<forall>v. insertion (nth_default 0 (list_update L var v)) c = C"
  shows "aEval (Eq(b*Var var + c)) (list_update L var (-C/B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aEval (Eq (b * Var var + c)) (L[var := - C / B])
[PROOF STEP]
by(simp add: lLength insertion_add insertion_mult nonzero hb hc insertion_var)


[STATEMENT]
lemma stream_mod [simp]: "stream (t mod t') = stream t mod stream t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stream (t mod t') = stream t mod stream t'
[PROOF STEP]
by(simp add: modulo_stream_def modulo_tree_def)


[STATEMENT]
lemma dim_row_transfer_rule:
  "HMA_M A (A' :: 'a ^ 'nc ^ 'nr) \<Longrightarrow> (=) (dim_row A) (CARD('nr))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMA_M A A' \<Longrightarrow> dim_row A = CARD('nr)
[PROOF STEP]
unfolding HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = from_hma\<^sub>m A' \<Longrightarrow> dim_row A = CARD('nr)
[PROOF STEP]
by auto


[STATEMENT]
lemma distinct3_def:
  "distinct [A, B, C] = (A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct [A, B, C] = (A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in \<Z>) vprojection_arrow_is_arr:
  assumes "i \<in>\<^sub>\<circ> I" and "VLambda I A \<in>\<^sub>\<circ> Vset \<alpha>"
  shows "vprojection_arrow I A i : (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i) \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> A i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vprojection_arrow I A i : vproduct I A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> A i
[PROOF STEP]
proof(intro cat_Set_is_arrI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. arr_Set \<alpha> (vprojection_arrow I A i)
 2. vprojection_arrow I A i\<lparr>ArrDom\<rparr> = vproduct I A
 3. vprojection_arrow I A i\<lparr>ArrCod\<rparr> = A i
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
i \<in>\<^sub>\<circ> I
VLambda I A \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
show "arr_Set \<alpha> (vprojection_arrow I A i)"
[PROOF STATE]
proof (prove)
using this:
i \<in>\<^sub>\<circ> I
VLambda I A \<in>\<^sub>\<circ> Vset \<alpha>

goal (1 subgoal):
 1. arr_Set \<alpha> (vprojection_arrow I A i)
[PROOF STEP]
by (rule arr_Set_vprojection_arrow)
[PROOF STATE]
proof (state)
this:
arr_Set \<alpha> (vprojection_arrow I A i)

goal (2 subgoals):
 1. vprojection_arrow I A i\<lparr>ArrDom\<rparr> = vproduct I A
 2. vprojection_arrow I A i\<lparr>ArrCod\<rparr> = A i
[PROOF STEP]
qed (simp_all add: vprojection_arrow_components)


[STATEMENT]
lemma M_to_int_mod_ring: "M (to_int_mod_ring (x :: 'a mod_ring)) = to_int_mod_ring x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M (to_int_mod_ring x) = to_int_mod_ring x
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring x mod m = to_int_mod_ring x
[PROOF STEP]
unfolding m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring x mod int CARD('a) = to_int_mod_ring x
[PROOF STEP]
by (transfer, auto)


[STATEMENT]
lemma leadsto_exists: "\<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. (F x \<leadsto> G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> ((\<exists>x. F x) \<leadsto> G) = (\<forall>x. F x \<leadsto> G)
[PROOF STEP]
apply (unfold leadsto_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (\<box>(Init REx F \<longrightarrow> \<diamond>G)) = (\<forall>x. \<box>(Init F x \<longrightarrow> \<diamond>G))
[PROOF STEP]
apply (auto simp: allT [try_rewrite] Init_simps elim!: STL4E [temp_use])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ivp_solsI:
  assumes "D X = (\<lambda>t. f t (X t)) on U s" and "X t\<^sub>0 = s"
      and "X \<in> U s \<rightarrow> S" and "t\<^sub>0 \<in> U s"
    shows "X \<in> Sols f U S t\<^sub>0 s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> Sols f U S t\<^sub>0 s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
 D X = (\<lambda>t. f t (X t)) on U s
X t\<^sub>0 = s
X \<in> U s \<rightarrow> S
t\<^sub>0 \<in> U s

goal (1 subgoal):
 1. X \<in> Sols f U S t\<^sub>0 s
[PROOF STEP]
unfolding ivp_sols_def
[PROOF STATE]
proof (prove)
using this:
 D X = (\<lambda>t. f t (X t)) on U s
X t\<^sub>0 = s
X \<in> U s \<rightarrow> S
t\<^sub>0 \<in> U s

goal (1 subgoal):
 1. X \<in> {X \<in> U s \<rightarrow> S.  D X = (\<lambda>t. f t (X t)) on U s \<and> X t\<^sub>0 = s \<and> t\<^sub>0 \<in> U s}
[PROOF STEP]
by blast


[STATEMENT]
lemma map_vec_map_vec: "map_vec f (map_vec g v) = map_vec (f o g) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_vec f (map_vec g v) = map_vec (f \<circ> g) v
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma index_pref_pow_mod: "w \<le>p r\<^sup>@k \<Longrightarrow> i < \<^bold>|w\<^bold>| \<Longrightarrow>  w!i = r!(i mod \<^bold>|r\<^bold>| )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<le>p r \<^sup>@ k; i < \<^bold>|w\<^bold>|\<rbrakk> \<Longrightarrow> w ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
using  index_pow_mod[of i r k] less_le_trans[of i "\<^bold>|w\<^bold>|" "\<^bold>|r\<^sup>@k\<^bold>|"] prefix_length_le[of w "r\<^sup>@k"] pref_index[of w "r\<^sup>@k" i]
[PROOF STATE]
proof (prove)
using this:
i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
\<lbrakk>i < \<^bold>|w\<^bold>|; \<^bold>|w\<^bold>| \<le> \<^bold>|r \<^sup>@ k\<^bold>|\<rbrakk> \<Longrightarrow> i < \<^bold>|r \<^sup>@ k\<^bold>|
w \<le>p r \<^sup>@ k \<Longrightarrow> \<^bold>|w\<^bold>| \<le> \<^bold>|r \<^sup>@ k\<^bold>|
\<lbrakk>w \<le>p r \<^sup>@ k; i < \<^bold>|w\<^bold>|\<rbrakk> \<Longrightarrow> w ! i = (r \<^sup>@ k) ! i

goal (1 subgoal):
 1. \<lbrakk>w \<le>p r \<^sup>@ k; i < \<^bold>|w\<^bold>|\<rbrakk> \<Longrightarrow> w ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
by argo


[STATEMENT]
lemma set_of_sub_inc_left:
  "set_of (A - B) \<subseteq> set_of (A' - B)"
  if "set_of A \<subseteq> set_of A'"
  for A :: "'a::linordered_ab_group_add interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (A - B) \<subseteq> set_of (A' - B)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
set_of A \<subseteq> set_of A'

goal (1 subgoal):
 1. set_of (A - B) \<subseteq> set_of (A' - B)
[PROOF STEP]
unfolding set_of_minus
[PROOF STATE]
proof (prove)
using this:
set_of A \<subseteq> set_of A'

goal (1 subgoal):
 1. {x - y |x y. x \<in>\<^sub>i A \<and> y \<in>\<^sub>i B} \<subseteq> {x - y |x y. x \<in>\<^sub>i A' \<and> y \<in>\<^sub>i B}
[PROOF STEP]
by auto


[STATEMENT]
lemma As_append [simp]: "\s (xs @ ys) = (\s xs) \<squnion> (\s ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \s (xs @ ys) = \s xs \<squnion> \s ys
[PROOF STEP]
by(induct xs, auto simp add: hyperset_defs)


[STATEMENT]
lemma iso_eq_order: "card \<V> = card \<V>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. source.\<v> = target.\<v>
[PROOF STEP]
using bij bij_betw_same_card
[PROOF STATE]
proof (prove)
using this:
bij_betw \<pi> \<V> \<V>'
bij_betw ?f ?A ?B \<Longrightarrow> card ?A = card ?B

goal (1 subgoal):
 1. source.\<v> = target.\<v>
[PROOF STEP]
by auto


[STATEMENT]
lemma inverts_mat_unique:
  fixes A B C :: "'a::field mat"
  assumes dim: "A \<in> carrier_mat n n" "B \<in> carrier_mat n n" "C \<in> carrier_mat n n"
    and AB: "inverts_mat A B" and AC: "inverts_mat A C"
  shows "B = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B = C
[PROOF STEP]
have AB1: "A * B = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = 1\<^sub>m n
[PROOF STEP]
using AB dim
[PROOF STATE]
proof (prove)
using this:
inverts_mat A B
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. A * B = 1\<^sub>m n
[PROOF STEP]
unfolding inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
A * B = 1\<^sub>m (dim_row A)
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. A * B = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * B = 1\<^sub>m n

goal (1 subgoal):
 1. B = C
[PROOF STEP]
have "A * C = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * C = 1\<^sub>m n
[PROOF STEP]
using AC dim
[PROOF STATE]
proof (prove)
using this:
inverts_mat A C
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. A * C = 1\<^sub>m n
[PROOF STEP]
unfolding inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
A * C = 1\<^sub>m (dim_row A)
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. A * C = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * C = 1\<^sub>m n

goal (1 subgoal):
 1. B = C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A * C = 1\<^sub>m n
[PROOF STEP]
have CA1: "C * A = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
A * C = 1\<^sub>m n

goal (1 subgoal):
 1. C * A = 1\<^sub>m n
[PROOF STEP]
using mat_mult_left_right_inverse[of A n C] dim
[PROOF STATE]
proof (prove)
using this:
A * C = 1\<^sub>m n
\<lbrakk>A \<in> carrier_mat n n; C \<in> carrier_mat n n; A * C = 1\<^sub>m n\<rbrakk> \<Longrightarrow> C * A = 1\<^sub>m n
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. C * A = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C * A = 1\<^sub>m n

goal (1 subgoal):
 1. B = C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C * A = 1\<^sub>m n
[PROOF STEP]
have "C = C * 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
C * A = 1\<^sub>m n

goal (1 subgoal):
 1. C = C * 1\<^sub>m n
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
C * A = 1\<^sub>m n
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. C = C * 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C = C * 1\<^sub>m n

goal (1 subgoal):
 1. B = C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C = C * 1\<^sub>m n

goal (1 subgoal):
 1. B = C
[PROOF STEP]
have "\<dots> = C * (A * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C * 1\<^sub>m n = C * (A * B)
[PROOF STEP]
using AB1
[PROOF STATE]
proof (prove)
using this:
A * B = 1\<^sub>m n

goal (1 subgoal):
 1. C * 1\<^sub>m n = C * (A * B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C * 1\<^sub>m n = C * (A * B)

goal (1 subgoal):
 1. B = C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C * 1\<^sub>m n = C * (A * B)

goal (1 subgoal):
 1. B = C
[PROOF STEP]
have "\<dots> = (C * A) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C * (A * B) = C * A * B
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. C * (A * B) = C * A * B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C * (A * B) = C * A * B

goal (1 subgoal):
 1. B = C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C * (A * B) = C * A * B

goal (1 subgoal):
 1. B = C
[PROOF STEP]
have "\<dots> = 1\<^sub>m n * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C * A * B = 1\<^sub>m n * B
[PROOF STEP]
using CA1
[PROOF STATE]
proof (prove)
using this:
C * A = 1\<^sub>m n

goal (1 subgoal):
 1. C * A * B = 1\<^sub>m n * B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C * A * B = 1\<^sub>m n * B

goal (1 subgoal):
 1. B = C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C * A * B = 1\<^sub>m n * B

goal (1 subgoal):
 1. B = C
[PROOF STEP]
have "\<dots> = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m n * B = B
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n

goal (1 subgoal):
 1. 1\<^sub>m n * B = B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1\<^sub>m n * B = B

goal (1 subgoal):
 1. B = C
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
C = B
[PROOF STEP]
show "B = C"
[PROOF STATE]
proof (prove)
using this:
C = B

goal (1 subgoal):
 1. B = C
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
B = C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_image_join:
  assumes "pathfinish g1 = pathstart g2"
  shows "path_image(g1 +++ g2) = path_image g1 \<union> path_image g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
have "path_image g1 \<subseteq> path_image (g1 +++ g2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image g1 \<subseteq> path_image (g1 +++ g2)
[PROOF STEP]
proof (clarsimp simp: path_image_def joinpaths_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>g1 xa \<notin> (\<lambda>x. g2 (2 * x - 1)) ` ({0..1} \<inter> {x. \<not> x * 2 \<le> 1}); 0 \<le> xa; xa \<le> 1\<rbrakk> \<Longrightarrow> g1 xa \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})
[PROOF STEP]
fix u::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>g1 xa \<notin> (\<lambda>x. g2 (2 * x - 1)) ` ({0..1} \<inter> {x. \<not> x * 2 \<le> 1}); 0 \<le> xa; xa \<le> 1\<rbrakk> \<Longrightarrow> g1 xa \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})
[PROOF STEP]
assume "0 \<le> u" "u \<le> 1"
[PROOF STATE]
proof (state)
this:
0 \<le> u
u \<le> 1

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>g1 xa \<notin> (\<lambda>x. g2 (2 * x - 1)) ` ({0..1} \<inter> {x. \<not> x * 2 \<le> 1}); 0 \<le> xa; xa \<le> 1\<rbrakk> \<Longrightarrow> g1 xa \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> u
u \<le> 1
[PROOF STEP]
show "g1 u \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})"
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
u \<le> 1

goal (1 subgoal):
 1. g1 u \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})
[PROOF STEP]
by (rule_tac x="u/2" in image_eqI) auto
[PROOF STATE]
proof (state)
this:
g1 u \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
path_image g1 \<subseteq> path_image (g1 +++ g2)

goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
path_image g1 \<subseteq> path_image (g1 +++ g2)

goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
have \<section>: "g2 u \<in> (\<lambda>x. g2 (2 * x - 1)) ` ({0..1} \<inter> {x. \<not> x * 2 \<le> 1})"
    if "0 < u" "u \<le> 1" for u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g2 u \<in> (\<lambda>x. g2 (2 * x - 1)) ` ({0..1} \<inter> {x. \<not> x * 2 \<le> 1})
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
0 < u
u \<le> 1
pathfinish g1 = pathstart g2

goal (1 subgoal):
 1. g2 u \<in> (\<lambda>x. g2 (2 * x - 1)) ` ({0..1} \<inter> {x. \<not> x * 2 \<le> 1})
[PROOF STEP]
by (rule_tac x="(u+1)/2" in image_eqI) (auto simp: field_simps pathfinish_def pathstart_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?u; ?u \<le> 1\<rbrakk> \<Longrightarrow> g2 ?u \<in> (\<lambda>x. g2 (2 * x - 1)) ` ({0..1} \<inter> {x. \<not> x * 2 \<le> 1})

goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
have "g2 0 \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g2 0 \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pathfinish g1 = pathstart g2

goal (1 subgoal):
 1. g2 0 \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})
[PROOF STEP]
by (rule_tac x="1/2" in image_eqI) (auto simp: pathfinish_def pathstart_def)
[PROOF STATE]
proof (state)
this:
g2 0 \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})

goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g2 0 \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})
[PROOF STEP]
have "path_image g2 \<subseteq> path_image (g1 +++ g2)"
[PROOF STATE]
proof (prove)
using this:
g2 0 \<in> (\<lambda>x. g1 (2 * x)) ` ({0..1} \<inter> {x. x * 2 \<le> 1})

goal (1 subgoal):
 1. path_image g2 \<subseteq> path_image (g1 +++ g2)
[PROOF STEP]
by (auto simp: path_image_def joinpaths_def intro!: \<section>)
[PROOF STATE]
proof (state)
this:
path_image g2 \<subseteq> path_image (g1 +++ g2)

goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
path_image g1 \<subseteq> path_image (g1 +++ g2)
path_image g2 \<subseteq> path_image (g1 +++ g2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path_image g1 \<subseteq> path_image (g1 +++ g2)
path_image g2 \<subseteq> path_image (g1 +++ g2)

goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
using path_image_join_subset
[PROOF STATE]
proof (prove)
using this:
path_image g1 \<subseteq> path_image (g1 +++ g2)
path_image g2 \<subseteq> path_image (g1 +++ g2)
path_image (?g1.0 +++ ?g2.0) \<subseteq> path_image ?g1.0 \<union> path_image ?g2.0

goal (1 subgoal):
 1. path_image (g1 +++ g2) = path_image g1 \<union> path_image g2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
path_image (g1 +++ g2) = path_image g1 \<union> path_image g2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diag_mat_mul_diag_diag:
  fixes A B ::  "complex mat"
  assumes dimA: "A \<in> carrier_mat n n" and dimB: "B \<in> carrier_mat n n"
    and dA: "diagonal_mat A"  and dB: "diagonal_mat B"
  shows "diagonal_mat (A * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_mat (A * B)
[PROOF STEP]
proof  -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. diagonal_mat (A * B)
[PROOF STEP]
have AB: "A * B = mat n n (\<lambda>(i,j). (if (i = j) then (A$$(i, i)) * (B$$(i, i)) else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0)
[PROOF STEP]
using diag_mat_mult_diag_mat[of A n B] dimA dimB dA dB
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier_mat n n; B \<in> carrier_mat n n; diagonal_mat A; diagonal_mat B\<rbrakk> \<Longrightarrow> A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0)
A \<in> carrier_mat n n
B \<in> carrier_mat n n
diagonal_mat A
diagonal_mat B

goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0)

goal (1 subgoal):
 1. diagonal_mat (A * B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0)
[PROOF STEP]
have dAB: "\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A*B) $$ (i,j) = 0"
[PROOF STATE]
proof (prove)
using this:
A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0)

goal (1 subgoal):
 1. \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0) \<Longrightarrow> \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0) \<Longrightarrow> \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0) \<Longrightarrow> \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
assume i: "i < n" and j: "j < n" and ij: "i \<noteq> j"
[PROOF STATE]
proof (state)
this:
i < n
j < n
i \<noteq> j

goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0) \<Longrightarrow> \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
have "(A*B) $$ (i,j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A * B) $$ (i, j) = 0
[PROOF STEP]
using AB i j ij
[PROOF STATE]
proof (prove)
using this:
A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0)
i < n
j < n
i \<noteq> j

goal (1 subgoal):
 1. (A * B) $$ (i, j) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A * B) $$ (i, j) = 0

goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0) \<Longrightarrow> \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < n; ?j2 < n; ?i2 \<noteq> ?j2\<rbrakk> \<Longrightarrow> (A * B) $$ (?i2, ?j2) = 0

goal (1 subgoal):
 1. A * B = mat n n (\<lambda>(i, j). if i = j then A $$ (i, i) * B $$ (i, i) else 0) \<Longrightarrow> \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i2 < n; ?j2 < n; ?i2 \<noteq> ?j2\<rbrakk> \<Longrightarrow> (A * B) $$ (?i2, ?j2) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n; ?i2 \<noteq> ?j2\<rbrakk> \<Longrightarrow> (A * B) $$ (?i2, ?j2) = 0

goal (1 subgoal):
 1. \<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0

goal (1 subgoal):
 1. diagonal_mat (A * B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0

goal (1 subgoal):
 1. diagonal_mat (A * B)
[PROOF STEP]
using diagonal_mat_def dAB dimA dimB
[PROOF STATE]
proof (prove)
using this:
\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
diagonal_mat ?A \<equiv> \<forall>i<dim_row ?A. \<forall>j<dim_col ?A. i \<noteq> j \<longrightarrow> ?A $$ (i, j) = (0::?'a)
\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> (A * B) $$ (i, j) = 0
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. diagonal_mat (A * B)
[PROOF STEP]
by (metis carrier_matD(1) carrier_matD(2) index_mult_mat(2) index_mult_mat(3))
[PROOF STATE]
proof (state)
this:
diagonal_mat (A * B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vfinite_vcard_vinsert_nin[simp]:
  assumes "vfinite A" and "a \<notin>\<^sub>\<circ> A"
  shows "vcard (vinsert a A) = csucc (vcard A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (vinsert a A) = csucc (vcard A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vfinite A
a \<notin>\<^sub>\<circ> A

goal (1 subgoal):
 1. vcard (vinsert a A) = csucc (vcard A)
[PROOF STEP]
by (simp add: ZFC_in_HOL.vinsert_def)


[STATEMENT]
lemma list_all2_split:
  assumes major: "list_all2 P xs ys"
  and split: "\<And>x y. P x y \<Longrightarrow> \<exists>z. Q x z \<and> R z y"
  shows "\<exists>zs. list_all2 Q xs zs \<and> list_all2 R zs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>zs. list_all2 Q xs zs \<and> list_all2 R zs ys
[PROOF STEP]
using major
[PROOF STATE]
proof (prove)
using this:
list_all2 P xs ys

goal (1 subgoal):
 1. \<exists>zs. list_all2 Q xs zs \<and> list_all2 R zs ys
[PROOF STEP]
by(induct rule: list_all2_induct)(auto dest: split)


[STATEMENT]
lemma nth_rotate1:
  \<open>rotate1 xs ! n = xs ! (Suc n mod length xs)\<close> if \<open>n < length xs\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate1 xs ! n = xs ! (Suc n mod length xs)
[PROOF STEP]
using that nth_rotate [of n xs 1]
[PROOF STATE]
proof (prove)
using this:
n < length xs
n < length xs \<Longrightarrow> rotate 1 xs ! n = xs ! ((1 + n) mod length xs)

goal (1 subgoal):
 1. rotate1 xs ! n = xs ! (Suc n mod length xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma div_gt_0:
  fixes m n :: nat assumes "m \<le> n" "0 < m" shows "0 < n div m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n div m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < n div m
[PROOF STEP]
have "0 < m div m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m div m
[PROOF STEP]
using \<open>0 < m\<close> div_self
[PROOF STATE]
proof (prove)
using this:
0 < m
?a \<noteq> (0::?'a) \<Longrightarrow> ?a div ?a = (1::?'a)

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

goal (1 subgoal):
 1. 0 < n div m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < m div m

goal (1 subgoal):
 1. 0 < n div m
[PROOF STEP]
have "m div m \<le> n div m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m div m \<le> n div m
[PROOF STEP]
using \<open>m \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. m div m \<le> n div m
[PROOF STEP]
by (rule div_le_mono)
[PROOF STATE]
proof (state)
this:
m div m \<le> n div m

goal (1 subgoal):
 1. 0 < n div m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < n div m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n div m

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_mnm':
  assumes \<open>m < n\<close>
    shows \<open>card {i::nat. i < n \<and> P i}
         = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
have 1:\<open>{i::nat. i < m \<and> P i} \<inter> {i. m \<le> i \<and> i < n \<and> P i} = {}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < m \<and> P i} \<inter> {i. m \<le> i \<and> i < n \<and> P i} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < m \<and> P i} \<inter> {i. m \<le> i \<and> i < n \<and> P i} = {}

goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
m < n
[PROOF STEP]
have \<open>\<forall>i::nat. i < n = (i < m) \<or> (m \<le> i \<and> i < n)\<close>
[PROOF STATE]
proof (prove)
using this:
m < n

goal (1 subgoal):
 1. \<forall>i. (i < n) = (i < m) \<or> m \<le> i \<and> i < n
[PROOF STEP]
using less_trans
[PROOF STATE]
proof (prove)
using this:
m < n
\<lbrakk>?x < ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. \<forall>i. (i < n) = (i < m) \<or> m \<le> i \<and> i < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. (i < n) = (i < m) \<or> m \<le> i \<and> i < n

goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
hence 2:
    \<open>{i::nat. i < n \<and> P i} = {i. i < m \<and> P i} \<union> {i. m \<le> i \<and> i < n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>i. (i < n) = (i < m) \<or> m \<le> i \<and> i < n

goal (1 subgoal):
 1. {i. i < n \<and> P i} = {i. i < m \<and> P i} \<union> {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{i. i < n \<and> P i} = {i. i < m \<and> P i} \<union> {i. m \<le> i \<and> i < n \<and> P i}

goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
have 3:\<open>finite {i. i < m \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i < m \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {i. i < m \<and> P i}

goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
have 4:\<open>finite {i. m \<le> i \<and> i < n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {i. m \<le> i \<and> i < n \<and> P i}

goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
from card_Un_disjoint[OF 3 4 1] 2
[PROOF STATE]
proof (chain)
picking this:
card ({i. i < m \<and> P i} \<union> {i. m \<le> i \<and> i < n \<and> P i}) = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
{i. i < n \<and> P i} = {i. i < m \<and> P i} \<union> {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card ({i. i < m \<and> P i} \<union> {i. m \<le> i \<and> i < n \<and> P i}) = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
{i. i < n \<and> P i} = {i. i < m \<and> P i} \<union> {i. m \<le> i \<and> i < n \<and> P i}

goal (1 subgoal):
 1. card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. i < n \<and> P i} = card {i. i < m \<and> P i} + card {i. m \<le> i \<and> i < n \<and> P i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_enumerate_it_to_list[refine_transfer_post_simp]:
      "gen_enumerate (it_to_list it) =
       (\<lambda> upd emp S. snd (foldli (it_to_list it S) (\<lambda> _. True)
      (\<lambda> x s. case s of (k, m) \<Rightarrow> (Suc k, upd x k m)) (0, emp)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen_enumerate (it_to_list it) = (\<lambda>upd emp S. snd (foldli (it_to_list it S) (\<lambda>_. True) (\<lambda>x s. case s of (k, m) \<Rightarrow> (Suc k, upd x k m)) (0, emp)))
[PROOF STEP]
unfolding gen_enumerate_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>upd emp S. snd (fold (\<lambda>x (k, m). (Suc k, upd x k m)) (it_to_list it S) (0, emp))) = (\<lambda>upd emp S. snd (foldli (it_to_list it S) (\<lambda>_. True) (\<lambda>x s. case s of (k, m) \<Rightarrow> (Suc k, upd x k m)) (0, emp)))
[PROOF STEP]
unfolding foldl_conv_fold[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>upd emp S. snd (foldl (\<lambda>s x. case s of (k, m) \<Rightarrow> (Suc k, upd x k m)) (0, emp) (it_to_list it S))) = (\<lambda>upd emp S. snd (foldli (it_to_list it S) (\<lambda>_. True) (\<lambda>x s. case s of (k, m) \<Rightarrow> (Suc k, upd x k m)) (0, emp)))
[PROOF STEP]
unfolding foldli_foldl[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>upd emp S. snd (foldli (it_to_list it S) (\<lambda>_. True) (\<lambda>x s. case s of (k, m) \<Rightarrow> (Suc k, upd x k m)) (0, emp))) = (\<lambda>upd emp S. snd (foldli (it_to_list it S) (\<lambda>_. True) (\<lambda>x s. case s of (k, m) \<Rightarrow> (Suc k, upd x k m)) (0, emp)))
[PROOF STEP]
by rule


[STATEMENT]
lemma Subspace_eqdim_imp_equal :
  assumes "Subspace U" "dim U = dim V"
  shows   "U = V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U = V
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. U = V
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
Subspace U
[PROOF STEP]
obtain us where us: "basis_for U us"
[PROOF STATE]
proof (prove)
using this:
Subspace U

goal (1 subgoal):
 1. (\<And>us. set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Subspace_is_findim SubspaceD1
          VectorSpace.FinDimVectorSpaceI[of "(\<cdot>)" U]
          FinDimVectorSpace.basis_ex[of "(\<cdot>)" U]
[PROOF STATE]
proof (prove)
using this:
Subspace U
Subspace ?U \<Longrightarrow> \<exists>ms. set ms \<subseteq> ?U \<and> RSpan ms = ?U
Subspace ?U \<Longrightarrow> VectorSpace (\<cdot>) ?U
\<lbrakk>VectorSpace (\<cdot>) U; \<exists>ms. set ms \<subseteq> U \<and> RSpan ms = U\<rbrakk> \<Longrightarrow> FinDimVectorSpace (\<cdot>) U
FinDimVectorSpace (\<cdot>) U \<Longrightarrow> \<exists>vs. set vs \<subseteq> U \<and> U = RSpan vs \<and> R_lin_independent vs

goal (1 subgoal):
 1. (\<And>us. set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us

goal (1 subgoal):
 1. U = V
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
Subspace U
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us
[PROOF STEP]
obtain vs where vs: "basis_for V (vs@us)"
[PROOF STATE]
proof (prove)
using this:
Subspace U
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us

goal (1 subgoal):
 1. (\<And>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using extend_Subspace_basis[of U us]
[PROOF STATE]
proof (prove)
using this:
Subspace U
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us
\<lbrakk>U \<subseteq> V; set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us\<rbrakk> \<Longrightarrow> \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)

goal (1 subgoal):
 1. (\<And>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)

goal (1 subgoal):
 1. U = V
[PROOF STEP]
from assms us vs
[PROOF STATE]
proof (chain)
picking this:
Subspace U
dim_R U = dim_R V
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us
set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Subspace U
dim_R U = dim_R V
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us
set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)

goal (1 subgoal):
 1. U = V
[PROOF STEP]
using SubspaceD1 VectorSpace.dim_eq_size_basis[of smult U]
          dim_eq_size_basis[of "vs@us"]
[PROOF STATE]
proof (prove)
using this:
Subspace U
dim_R U = dim_R V
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us
set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
Subspace ?U \<Longrightarrow> VectorSpace (\<cdot>) ?U
\<lbrakk>VectorSpace (\<cdot>) U; set ?vs \<subseteq> U \<and> U = RSpan ?vs \<and> R_lin_independent ?vs\<rbrakk> \<Longrightarrow> length ?vs = dim_R U
set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us) \<Longrightarrow> length (vs @ us) = dim_R V

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Gcd_factorial_greatest:
  assumes "\<And>y. y \<in> A \<Longrightarrow> x dvd y"
  shows   "x dvd Gcd_factorial A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x dvd Gcd_factorial A
[PROOF STEP]
proof (cases "A \<subseteq> {0}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> A \<subseteq> {0::'a}

goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> A \<subseteq> {0::'a}
[PROOF STEP]
obtain y where "y \<in> A" "y \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> A \<subseteq> {0::'a}

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> A; y \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> A
y \<noteq> (0::'a)

goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
with assms[of y]
[PROOF STATE]
proof (chain)
picking this:
y \<in> A \<Longrightarrow> x dvd y
y \<in> A
y \<noteq> (0::'a)
[PROOF STEP]
have nz: "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
y \<in> A \<Longrightarrow> x dvd y
y \<in> A
y \<noteq> (0::'a)

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

goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
from nz assms
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> (0::'a)
?y1 \<in> A \<Longrightarrow> x dvd ?y1
[PROOF STEP]
have "prime_factorization x \<subseteq># prime_factorization y" if "y \<in> A - {0}" for y
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)
?y1 \<in> A \<Longrightarrow> x dvd ?y1

goal (1 subgoal):
 1. prime_factorization x \<subseteq># prime_factorization y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)
?y1 \<in> A \<Longrightarrow> x dvd ?y1
y \<in> A - {0::'a}

goal (1 subgoal):
 1. prime_factorization x \<subseteq># prime_factorization y
[PROOF STEP]
by (subst prime_factorization_subset_iff_dvd) auto
[PROOF STATE]
proof (state)
this:
?y1 \<in> A - {0::'a} \<Longrightarrow> prime_factorization x \<subseteq># prime_factorization ?y1

goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> A \<subseteq> {0::'a}
?y1 \<in> A - {0::'a} \<Longrightarrow> prime_factorization x \<subseteq># prime_factorization ?y1
[PROOF STEP]
have "prime_factorization x \<subseteq># Inf (prime_factorization ` (A - {0}))"
[PROOF STATE]
proof (prove)
using this:
\<not> A \<subseteq> {0::'a}
?y1 \<in> A - {0::'a} \<Longrightarrow> prime_factorization x \<subseteq># prime_factorization ?y1

goal (1 subgoal):
 1. prime_factorization x \<subseteq># Inf (prime_factorization ` (A - {0::'a}))
[PROOF STEP]
by (intro subset_mset.cInf_greatest) auto
[PROOF STATE]
proof (state)
this:
prime_factorization x \<subseteq># Inf (prime_factorization ` (A - {0::'a}))

goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factorization x \<subseteq># Inf (prime_factorization ` (A - {0::'a}))

goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> A \<subseteq> {0::'a}
[PROOF STEP]
have "\<dots> = prime_factorization (Gcd_factorial A)"
[PROOF STATE]
proof (prove)
using this:
\<not> A \<subseteq> {0::'a}

goal (1 subgoal):
 1. Inf (prime_factorization ` (A - {0::'a})) = prime_factorization (Gcd_factorial A)
[PROOF STEP]
by (rule prime_factorization_Gcd_factorial [symmetric])
[PROOF STATE]
proof (state)
this:
Inf (prime_factorization ` (A - {0::'a})) = prime_factorization (Gcd_factorial A)

goal (2 subgoals):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
 2. \<not> A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prime_factorization x \<subseteq># prime_factorization (Gcd_factorial A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime_factorization x \<subseteq># prime_factorization (Gcd_factorial A)

goal (1 subgoal):
 1. x dvd Gcd_factorial A
[PROOF STEP]
by (subst (asm) prime_factorization_subset_iff_dvd)
       (insert nz False, auto simp: Gcd_factorial_eq_0_iff)
[PROOF STATE]
proof (state)
this:
x dvd Gcd_factorial A

goal (1 subgoal):
 1. A \<subseteq> {0::'a} \<Longrightarrow> x dvd Gcd_factorial A
[PROOF STEP]
qed (simp_all add: Gcd_factorial_def)