[STATEMENT]
lemma iter_tensor_of_state_is_state:
  fixes A:: "complex Matrix.mat" and n m:: "nat"
  assumes "state m A" and "n\<ge>1"
  shows "state (m*n) (A \<otimes>\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. state (m * n) (A \<otimes>\<^bsup>n\<^esup>)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. state (m * n) (A \<otimes>\<^bsup>n\<^esup>)
[PROOF STEP]
proof(rule nat_induct_at_least)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. state (m * 1) (A \<otimes>\<^bsup>1\<^esup>)
 2. \<And>n. \<lbrakk>1 \<le> n; state (m * n) (A \<otimes>\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
show "state (m * 1) (A \<otimes>\<^bsup>1\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. state (m * 1) (A \<otimes>\<^bsup>1\<^esup>)
[PROOF STEP]
using one_tensor_is_id assms(1)
[PROOF STATE]
proof (prove)
using this:
?A \<otimes>\<^bsup>1\<^esup> = ?A
state m A

goal (1 subgoal):
 1. state (m * 1) (A \<otimes>\<^bsup>1\<^esup>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
state (m * 1) (A \<otimes>\<^bsup>1\<^esup>)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; state (m * n) (A \<otimes>\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
fix n:: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; state (m * n) (A \<otimes>\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
assume "n \<ge> 1" and IH:"state (m * n) (A \<otimes>\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (state)
this:
1 \<le> n
state (m * n) (A \<otimes>\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; state (m * n) (A \<otimes>\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
state (m * n) (A \<otimes>\<^bsup>n\<^esup>)
[PROOF STEP]
have "A \<otimes>\<^bsup>(Suc n)\<^esup> = A \<Otimes> (A \<otimes>\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
state (m * n) (A \<otimes>\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. A \<otimes>\<^bsup>Suc n\<^esup> = A \<Otimes> A \<otimes>\<^bsup>n\<^esup>
[PROOF STEP]
by (simp add: iter_tensor_suc)
[PROOF STATE]
proof (state)
this:
A \<otimes>\<^bsup>Suc n\<^esup> = A \<Otimes> A \<otimes>\<^bsup>n\<^esup>

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; state (m * n) (A \<otimes>\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<otimes>\<^bsup>Suc n\<^esup> = A \<Otimes> A \<otimes>\<^bsup>n\<^esup>

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; state (m * n) (A \<otimes>\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
have "state (m*n + m) (A \<otimes>\<^bsup>(Suc n)\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. state (m * n + m) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
using tensor_gate assms(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>gate ?m ?G1.0; gate ?n ?G2.0\<rbrakk> \<Longrightarrow> gate (?m + ?n) (?G1.0 \<Otimes> ?G2.0)
state m A

goal (1 subgoal):
 1. state (m * n + m) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
by (simp add: IH add.commute calculation)
[PROOF STATE]
proof (state)
this:
state (m * n + m) (A \<otimes>\<^bsup>Suc n\<^esup>)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; state (m * n) (A \<otimes>\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
state (m * n + m) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
show "state (m*(Suc n)) (A \<otimes>\<^bsup>(Suc n)\<^esup>)"
[PROOF STATE]
proof (prove)
using this:
state (m * n + m) (A \<otimes>\<^bsup>Suc n\<^esup>)

goal (1 subgoal):
 1. state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)
[PROOF STEP]
by (simp add: add.commute)
[PROOF STATE]
proof (state)
this:
state (m * Suc n) (A \<otimes>\<^bsup>Suc n\<^esup>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma QReachableTrans:
fixes cfg1 cfg2 cfg3 :: "('p, 'v, 's ) configuration" and
  Q :: " 'p set"
assumes "qReachable cfg2 Q cfg3" and
  "qReachable cfg1 Q cfg2"
shows "qReachable cfg1 Q cfg3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qReachable cfg1 Q cfg3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
qReachable cfg2 Q cfg3
qReachable cfg1 Q cfg2

goal (1 subgoal):
 1. qReachable cfg1 Q cfg3
[PROOF STEP]
proof (induct rule: qReachable.induct, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>cfg1a Q cfg2 msg cfg3. \<lbrakk>qReachable cfg1a Q cfg2; qReachable cfg1 Q cfg1a \<Longrightarrow> qReachable cfg1 Q cfg2; cfg2 \<turnstile> msg \<mapsto> cfg3; \<exists>p\<in>Q. isReceiverOf p msg; qReachable cfg1 Q cfg1a\<rbrakk> \<Longrightarrow> qReachable cfg1 Q cfg3
[PROOF STEP]
case (StepQ)
[PROOF STATE]
proof (state)
this:
qReachable cfg1_ Q_ cfg2_
qReachable cfg1 Q_ cfg1_ \<Longrightarrow> qReachable cfg1 Q_ cfg2_
cfg2_ \<turnstile> msg_ \<mapsto> cfg3_
\<exists>p\<in>Q_. isReceiverOf p msg_
qReachable cfg1 Q_ cfg1_

goal (1 subgoal):
 1. \<And>cfg1a Q cfg2 msg cfg3. \<lbrakk>qReachable cfg1a Q cfg2; qReachable cfg1 Q cfg1a \<Longrightarrow> qReachable cfg1 Q cfg2; cfg2 \<turnstile> msg \<mapsto> cfg3; \<exists>p\<in>Q. isReceiverOf p msg; qReachable cfg1 Q cfg1a\<rbrakk> \<Longrightarrow> qReachable cfg1 Q cfg3
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
qReachable cfg1_ Q_ cfg2_
qReachable cfg1 Q_ cfg1_ \<Longrightarrow> qReachable cfg1 Q_ cfg2_
cfg2_ \<turnstile> msg_ \<mapsto> cfg3_
\<exists>p\<in>Q_. isReceiverOf p msg_
qReachable cfg1 Q_ cfg1_

goal (1 subgoal):
 1. qReachable cfg1 Q_ cfg3_
[PROOF STEP]
using qReachable.simps
[PROOF STATE]
proof (prove)
using this:
qReachable cfg1_ Q_ cfg2_
qReachable cfg1 Q_ cfg1_ \<Longrightarrow> qReachable cfg1 Q_ cfg2_
cfg2_ \<turnstile> msg_ \<mapsto> cfg3_
\<exists>p\<in>Q_. isReceiverOf p msg_
qReachable cfg1 Q_ cfg1_
qReachable ?a1.0 ?a2.0 ?a3.0 = ((\<exists>cfg1 Q. ?a1.0 = cfg1 \<and> ?a2.0 = Q \<and> ?a3.0 = cfg1) \<or> (\<exists>cfg1 Q cfg2 msg cfg3. ?a1.0 = cfg1 \<and> ?a2.0 = Q \<and> ?a3.0 = cfg3 \<and> qReachable cfg1 Q cfg2 \<and> cfg2 \<turnstile> msg \<mapsto> cfg3 \<and> (\<exists>p\<in>Q. isReceiverOf p msg)))

goal (1 subgoal):
 1. qReachable cfg1 Q_ cfg3_
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
qReachable cfg1 Q_ cfg3_

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma positively_invariant_trapG1:
  shows "g.positively_invariant trapG1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g.positively_invariant trapG1
[PROOF STEP]
unfolding trapG1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g.positively_invariant (pos_quad \<inter> ({p. snd p - 751 / 100 \<le> 0} \<inter> {p. fst p + snd p - 812 / 100 \<le> 0}))
[PROOF STEP]
apply (rule g.positively_invariant_conj[OF positively_invariant_pos_quad])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g.positively_invariant ({p. snd p - 751 / 100 \<le> 0} \<inter> {p. fst p + snd p - 812 / 100 \<le> 0})
[PROOF STEP]
apply (rule g.positively_invariant_barrier_domain[OF positively_invariant_y_upper])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. ((\<lambda>x. fst x + snd x - 812 / 100) has_derivative ?V'2 x) (at x)
 2. continuous_on {p. snd p - 751 / 100 \<le> 0} (\<lambda>x. ?V'2 x (case x of (x, y) \<Rightarrow> (gx x y, gy x y)))
 3. \<And>s. \<lbrakk>s \<in> {p. snd p - 751 / 100 \<le> 0}; fst s + snd s - 812 / 100 = 0\<rbrakk> \<Longrightarrow> ?V'2 s (case s of (x, y) \<Rightarrow> (gx x y, gy x y)) < 0
[PROOF STEP]
apply (auto intro!: continuous_intros derivative_eq_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>b * 100 \<le> 751; a * 25 + b * 25 = 203\<rbrakk> \<Longrightarrow> gx a b + gy a b < 0
[PROOF STEP]
unfolding gx_def gy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>b * 100 \<le> 751; a * 25 + b * 25 = 203\<rbrakk> \<Longrightarrow> - a + 8 / 10\<^sup>2 * b + a\<^sup>2 * b + (6 / 10 - 8 / 10\<^sup>2 * b - a\<^sup>2 * b) < 0
[PROOF STEP]
by auto


[STATEMENT]
lemma non_trivial_neg: "\<exists> x. x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. x < (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. x < (0::'a)
[PROOF STEP]
from non_trivial
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. x \<noteq> (0::'a)
[PROOF STEP]
obtain x where "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<noteq> (0::'a)

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

goal (1 subgoal):
 1. \<exists>x. x < (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>x. x < (0::'a)
[PROOF STEP]
proof (cases "x < 0", auto, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> x < (0::'a); x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>x. x < (0::'a)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
\<not> x < (0::'a)
x \<noteq> (0::'a)

goal (1 subgoal):
 1. \<lbrakk>\<not> x < (0::'a); x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>x. x < (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> x < (0::'a)
x \<noteq> (0::'a)
[PROOF STEP]
have "x > 0"
[PROOF STATE]
proof (prove)
using this:
\<not> x < (0::'a)
x \<noteq> (0::'a)

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

goal (1 subgoal):
 1. \<lbrakk>\<not> x < (0::'a); x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>x. x < (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < x
[PROOF STEP]
have "(-x) < 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < x

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

goal (1 subgoal):
 1. \<lbrakk>\<not> x < (0::'a); x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>x. x < (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- x < (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
- x < (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x. x < (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_minus_butlast_eq_butlast_list:
  assumes "length t = length s" and "strict_prefix (butlast s) t"
  shows "t - (butlast s) = [last t]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t - butlast s = [last t]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length t = length s
strict_prefix (butlast s) t

goal (1 subgoal):
 1. t - butlast s = [last t]
[PROOF STEP]
by (metis append_butlast_last_id append_eq_append_conv butlast.simps(1) length_butlast less_numeral_extra(3) list.size(3) prefix_order.dual_order.strict_implies_order prefix_concat_minus prefix_length_less)


[STATEMENT]
lemma list_segment_length:
  assumes "i \<le> j"
  assumes "j \<le>  length as"
  shows "length (list_segment i j as) = j - i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_segment i j as) = j - i
[PROOF STEP]
using  assms
[PROOF STATE]
proof (prove)
using this:
i \<le> j
j \<le> length as

goal (1 subgoal):
 1. length (list_segment i j as) = j - i
[PROOF STEP]
unfolding list_segment_def
[PROOF STATE]
proof (prove)
using this:
i \<le> j
j \<le> length as

goal (1 subgoal):
 1. length (map ((!) as) [i..<j]) = j - i
[PROOF STEP]
by (metis length_map length_upt)


[STATEMENT]
lemma (in cpx_sq_mat) lhv_posl:
  assumes "lhv M A B R XA XB"
  shows "AE w in M. (\<forall> a \<in> spectrum A. 0 \<le> XA a w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE w in M. \<forall>a\<in>spectrum A. 0 \<le> XA a w
[PROOF STEP]
proof (rule AE_ball_countable[THEN iffD2])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. countable (spectrum A)
 2. \<forall>a\<in>spectrum A. AE w in M. 0 \<le> XA a w
[PROOF STEP]
show "countable (spectrum A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (spectrum A)
[PROOF STEP]
using spectrum_finite[of A]
[PROOF STATE]
proof (prove)
using this:
finite (spectrum A)

goal (1 subgoal):
 1. countable (spectrum A)
[PROOF STEP]
by (simp add: countable_finite)
[PROOF STATE]
proof (state)
this:
countable (spectrum A)

goal (1 subgoal):
 1. \<forall>a\<in>spectrum A. AE w in M. 0 \<le> XA a w
[PROOF STEP]
show "\<forall>a\<in>spectrum A. AE w in M. 0 \<le> XA a w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>spectrum A. AE w in M. 0 \<le> XA a w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lhv M A B R XA XB

goal (1 subgoal):
 1. \<forall>a\<in>spectrum A. AE w in M. 0 \<le> XA a w
[PROOF STEP]
unfolding lhv_def pos_rv_def
[PROOF STATE]
proof (prove)
using this:
prob_space M \<and> (\<forall>a\<in>spectrum A. XA a \<in> borel_measurable M \<and> (AE w in M. 0 \<le> XA a w)) \<and> prv_sum M A XA \<and> (\<forall>b\<in>spectrum B. XB b \<in> borel_measurable M \<and> (AE w in M. 0 \<le> XB b w)) \<and> prv_sum M B XB \<and> (\<forall>a\<in>spectrum A. \<forall>b\<in>spectrum B. integrable M (\<lambda>w. XA a w * XB b w) \<and> LINT w|M. XA a w * XB b w = Re (Complex_Matrix.trace (eigen_projector A a * eigen_projector B b * R)))

goal (1 subgoal):
 1. \<forall>a\<in>spectrum A. AE w in M. 0 \<le> XA a w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>spectrum A. AE w in M. 0 \<le> XA a w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_at_left_imp_sup_continuous:
  fixes f :: "'a::{complete_linorder, linorder_topology} \<Rightarrow> 'b::{complete_linorder, linorder_topology}"
  assumes "mono f" "\<And>x. continuous (at_left x) f"
  shows "sup_continuous f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_continuous f
[PROOF STEP]
unfolding sup_continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>M. incseq M \<longrightarrow> f (Sup (range M)) = (SUP i. f (M i))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. incseq M \<Longrightarrow> f (Sup (range M)) = (SUP i. f (M i))
[PROOF STEP]
fix M :: "nat \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. incseq M \<Longrightarrow> f (Sup (range M)) = (SUP i. f (M i))
[PROOF STEP]
assume "incseq M"
[PROOF STATE]
proof (state)
this:
incseq M

goal (1 subgoal):
 1. \<And>M. incseq M \<Longrightarrow> f (Sup (range M)) = (SUP i. f (M i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq M
[PROOF STEP]
show "f (SUP i. M i) = (SUP i. f (M i))"
[PROOF STATE]
proof (prove)
using this:
incseq M

goal (1 subgoal):
 1. f (Sup (range M)) = (SUP i. f (M i))
[PROOF STEP]
using continuous_at_Sup_mono [OF assms, of "range M"]
[PROOF STATE]
proof (prove)
using this:
incseq M
\<lbrakk>range M \<noteq> {}; bdd_above (range M)\<rbrakk> \<Longrightarrow> f (Sup (range M)) = Sup (f ` range M)

goal (1 subgoal):
 1. f (Sup (range M)) = (SUP i. f (M i))
[PROOF STEP]
by (simp add: image_comp)
[PROOF STATE]
proof (state)
this:
f (Sup (range M)) = (SUP i. f (M i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_map_openness:
  assumes hom: "homeomorphic_map X Y f" and U: "U \<subseteq> topspace X"
  shows "openin Y (f ` U) \<longleftrightarrow> openin X U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin Y (f ` U) = openin X U
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. openin Y (f ` U) = openin X U
[PROOF STEP]
obtain g where "homeomorphic_maps X Y f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. homeomorphic_maps X Y f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map X Y f
U \<subseteq> topspace X

goal (1 subgoal):
 1. (\<And>g. homeomorphic_maps X Y f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: homeomorphic_map_maps)
[PROOF STATE]
proof (state)
this:
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. openin Y (f ` U) = openin X U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_maps X Y f g
[PROOF STEP]
have g: "homeomorphic_map Y X g" and gf: "\<And>x. x \<in> topspace X \<Longrightarrow> g(f x) = x"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. homeomorphic_map Y X g &&& (\<And>x. x \<in> topspace X \<Longrightarrow> g (f x) = x)
[PROOF STEP]
by (auto simp: homeomorphic_maps_map)
[PROOF STATE]
proof (state)
this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. openin Y (f ` U) = openin X U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x
[PROOF STEP]
have "openin X U \<Longrightarrow> openin Y (f ` U)"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
using hom homeomorphic_imp_open_map open_map_def
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x
homeomorphic_map X Y f
homeomorphic_map ?X ?Y ?f \<Longrightarrow> open_map ?X ?Y ?f
open_map ?X1.0 ?X2.0 ?f \<equiv> \<forall>U. openin ?X1.0 U \<longrightarrow> openin ?X2.0 (?f ` U)

goal (1 subgoal):
 1. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
openin X U \<Longrightarrow> openin Y (f ` U)

goal (1 subgoal):
 1. openin Y (f ` U) = openin X U
[PROOF STEP]
show "openin Y (f ` U) = openin X U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin Y (f ` U) = openin X U
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. openin Y (f ` U) \<Longrightarrow> openin X U
 2. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
assume L: "openin Y (f ` U)"
[PROOF STATE]
proof (state)
this:
openin Y (f ` U)

goal (2 subgoals):
 1. openin Y (f ` U) \<Longrightarrow> openin X U
 2. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
have "U = g ` (f ` U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U = g ` f ` U
[PROOF STEP]
using U gf
[PROOF STATE]
proof (prove)
using this:
U \<subseteq> topspace X
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. U = g ` f ` U
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
U = g ` f ` U

goal (2 subgoals):
 1. openin Y (f ` U) \<Longrightarrow> openin X U
 2. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
U = g ` f ` U
[PROOF STEP]
show "openin X U"
[PROOF STATE]
proof (prove)
using this:
U = g ` f ` U

goal (1 subgoal):
 1. openin X U
[PROOF STEP]
by (metis L homeomorphic_imp_open_map open_map_def g)
[PROOF STATE]
proof (state)
this:
openin X U

goal (1 subgoal):
 1. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
assume "openin X U"
[PROOF STATE]
proof (state)
this:
openin X U

goal (1 subgoal):
 1. openin X U \<Longrightarrow> openin Y (f ` U)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin X U
[PROOF STEP]
show "openin Y (f ` U)"
[PROOF STATE]
proof (prove)
using this:
openin X U

goal (1 subgoal):
 1. openin Y (f ` U)
[PROOF STEP]
using hom homeomorphic_imp_open_map open_map_def
[PROOF STATE]
proof (prove)
using this:
openin X U
homeomorphic_map X Y f
homeomorphic_map ?X ?Y ?f \<Longrightarrow> open_map ?X ?Y ?f
open_map ?X1.0 ?X2.0 ?f \<equiv> \<forall>U. openin ?X1.0 U \<longrightarrow> openin ?X2.0 (?f ` U)

goal (1 subgoal):
 1. openin Y (f ` U)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
openin Y (f ` U)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
openin Y (f ` U) = openin X U

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monomial_decomp_imp_hom_decomp:
  assumes "monomial_decomp ps"
  shows "hom_decomp ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_decomp ps
[PROOF STEP]
proof (rule hom_decompI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h U. (h, U) \<in> set ps \<Longrightarrow> homogeneous h
[PROOF STEP]
fix h U
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h U. (h, U) \<in> set ps \<Longrightarrow> homogeneous h
[PROOF STEP]
assume "(h, U) \<in> set ps"
[PROOF STATE]
proof (state)
this:
(h, U) \<in> set ps

goal (1 subgoal):
 1. \<And>h U. (h, U) \<in> set ps \<Longrightarrow> homogeneous h
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
monomial_decomp ps
(h, U) \<in> set ps
[PROOF STEP]
have "is_monomial h"
[PROOF STATE]
proof (prove)
using this:
monomial_decomp ps
(h, U) \<in> set ps

goal (1 subgoal):
 1. is_monomial h
[PROOF STEP]
by (rule monomial_decompD)
[PROOF STATE]
proof (state)
this:
is_monomial h

goal (1 subgoal):
 1. \<And>h U. (h, U) \<in> set ps \<Longrightarrow> homogeneous h
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_monomial h
[PROOF STEP]
obtain c t where h: "h = monomial c t"
[PROOF STATE]
proof (prove)
using this:
is_monomial h

goal (1 subgoal):
 1. (\<And>t c. h = monomial c t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule is_monomial_monomial)
[PROOF STATE]
proof (state)
this:
h = monomial c t

goal (1 subgoal):
 1. \<And>h U. (h, U) \<in> set ps \<Longrightarrow> homogeneous h
[PROOF STEP]
show "homogeneous h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homogeneous h
[PROOF STEP]
unfolding h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homogeneous (monomial c t)
[PROOF STEP]
by (fact homogeneous_monomial)
[PROOF STATE]
proof (state)
this:
homogeneous h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Inf_notin_open:
  assumes A: "open A"
    and bnd: "\<forall>a\<in>A. x < a"
  shows "Inf A \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf A \<notin> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf A \<in> A \<Longrightarrow> False
[PROOF STEP]
assume "Inf A \<in> A"
[PROOF STATE]
proof (state)
this:
Inf A \<in> A

goal (1 subgoal):
 1. Inf A \<in> A \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf A \<in> A
[PROOF STEP]
obtain b where "b < Inf A" "{b <.. Inf A} \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
Inf A \<in> A

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b < Inf A; {b<..Inf A} \<subseteq> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using open_left[of A "Inf A" x] assms
[PROOF STATE]
proof (prove)
using this:
Inf A \<in> A
\<lbrakk>open A; Inf A \<in> A; x < Inf A\<rbrakk> \<Longrightarrow> \<exists>b<Inf A. {b<..Inf A} \<subseteq> A
open A
\<forall>a\<in>A. x < a

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b < Inf A; {b<..Inf A} \<subseteq> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b < Inf A
{b<..Inf A} \<subseteq> A

goal (1 subgoal):
 1. Inf A \<in> A \<Longrightarrow> False
[PROOF STEP]
with dense[of b "Inf A"]
[PROOF STATE]
proof (chain)
picking this:
b < Inf A \<Longrightarrow> \<exists>z>b. z < Inf A
b < Inf A
{b<..Inf A} \<subseteq> A
[PROOF STEP]
obtain c where "c < Inf A" "c \<in> A"
[PROOF STATE]
proof (prove)
using this:
b < Inf A \<Longrightarrow> \<exists>z>b. z < Inf A
b < Inf A
{b<..Inf A} \<subseteq> A

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c < Inf A; c \<in> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: subset_eq)
[PROOF STATE]
proof (state)
this:
c < Inf A
c \<in> A

goal (1 subgoal):
 1. Inf A \<in> A \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c < Inf A
c \<in> A
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
c < Inf A
c \<in> A

goal (1 subgoal):
 1. False
[PROOF STEP]
using cInf_lower[OF \<open>c \<in> A\<close>] bnd
[PROOF STATE]
proof (prove)
using this:
c < Inf A
c \<in> A
bdd_below A \<Longrightarrow> Inf A \<le> c
\<forall>a\<in>A. x < a

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis not_le less_imp_le bdd_belowI)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lexord_lex: "(x,y) \<in> lex r = ((x,y) \<in> lexord r \<and> length x = length y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> lex r) = ((x, y) \<in> lexord r \<and> length x = length y)
[PROOF STEP]
proof (induction x arbitrary: y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. (([], y) \<in> lex r) = (([], y) \<in> lexord r \<and> length [] = length y)
 2. \<And>a x y. (\<And>y. ((x, y) \<in> lex r) = ((x, y) \<in> lexord r \<and> length x = length y)) \<Longrightarrow> ((a # x, y) \<in> lex r) = ((a # x, y) \<in> lexord r \<and> length (a # x) = length y)
[PROOF STEP]
case (Cons a x y)
[PROOF STATE]
proof (state)
this:
((x, ?y) \<in> lex r) = ((x, ?y) \<in> lexord r \<and> length x = length ?y)

goal (2 subgoals):
 1. \<And>y. (([], y) \<in> lex r) = (([], y) \<in> lexord r \<and> length [] = length y)
 2. \<And>a x y. (\<And>y. ((x, y) \<in> lex r) = ((x, y) \<in> lexord r \<and> length x = length y)) \<Longrightarrow> ((a # x, y) \<in> lex r) = ((a # x, y) \<in> lexord r \<and> length (a # x) = length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((x, ?y) \<in> lex r) = ((x, ?y) \<in> lexord r \<and> length x = length ?y)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
((x, ?y) \<in> lex r) = ((x, ?y) \<in> lexord r \<and> length x = length ?y)

goal (1 subgoal):
 1. ((a # x, y) \<in> lex r) = ((a # x, y) \<in> lexord r \<and> length (a # x) = length y)
[PROOF STEP]
by (cases y) (force+)
[PROOF STATE]
proof (state)
this:
((a # x, y) \<in> lex r) = ((a # x, y) \<in> lexord r \<and> length (a # x) = length y)

goal (1 subgoal):
 1. \<And>y. (([], y) \<in> lex r) = (([], y) \<in> lexord r \<and> length [] = length y)
[PROOF STEP]
qed auto


[STATEMENT]
lemma find_index_first: "i < find_index P xs \<Longrightarrow> \<not>P (xs!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < find_index P xs \<Longrightarrow> \<not> P (xs ! i)
[PROOF STEP]
unfolding find_index_conv_takeWhile
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (takeWhile (Not \<circ> P) xs) \<Longrightarrow> \<not> P (xs ! i)
[PROOF STEP]
by (metis comp_apply nth_mem set_takeWhileD takeWhile_nth)


[STATEMENT]
lemma val_Zp_dist_infty':
  assumes "a \<in> carrier Zp"
  assumes "b \<in> carrier Zp"
  assumes "a = b"
  shows "val_Zp_dist a b = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val_Zp_dist a b = \<infinity>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Zp
b \<in> carrier Zp
a = b

goal (1 subgoal):
 1. val_Zp_dist a b = \<infinity>
[PROOF STEP]
unfolding val_Zp_dist_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Zp
b \<in> carrier Zp
a = b

goal (1 subgoal):
 1. val_Zp (a \<ominus> b) = \<infinity>
[PROOF STEP]
by (simp add: val_Zp_def)


[STATEMENT]
lemma permute_finite [simp]:
  shows "finite (p \<bullet> X) = finite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (p \<bullet> X) = finite X
[PROOF STEP]
unfolding permute_set_eq_vimage
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (permute (- p) -` X) = finite X
[PROOF STEP]
using bij_permute
[PROOF STATE]
proof (prove)
using this:
bij (permute ?p)

goal (1 subgoal):
 1. finite (permute (- p) -` X) = finite X
[PROOF STEP]
by (rule finite_vimage_iff)


[STATEMENT]
lemma rotater_Suc [simp]: "rotater (Suc n) xs = rotater1 (rotater n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotater (Suc n) xs = rotater1 (rotater n xs)
[PROOF STEP]
unfolding rotater_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rotater1 ^^ Suc n) xs = rotater1 ((rotater1 ^^ n) xs)
[PROOF STEP]
by auto


[STATEMENT]
lemma divisor_sigma_0_left: "divisor_sigma 0 n = of_nat (divisor_count n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma (0::'a) n = of_nat (divisor_count n)
[PROOF STEP]
unfolding divisor_sigma_0_left_nat [symmetric] divisor_sigma_of_nat [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma (0::'a) n = divisor_sigma (of_nat 0) n
[PROOF STEP]
by simp


[STATEMENT]
lemma circ_import:
  assumes "p \<le> p * p"
      and "p \<le> 1"
      and "p * x \<le> x * p"
    shows "p * x\<^sup>\<circ> = p * (p * x)\<^sup>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * x\<^sup>\<circ> = p * (p * x)\<^sup>\<circ>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p * x\<^sup>\<circ> = p * (p * x)\<^sup>\<circ>
[PROOF STEP]
have "p * x \<le> p * (p * x * p) * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * x \<le> p * (p * x * p) * p
[PROOF STEP]
by (metis assms coreflexive_transitive order.eq_iff test_preserves_equation mult_assoc)
[PROOF STATE]
proof (state)
this:
p * x \<le> p * (p * x * p) * p

goal (1 subgoal):
 1. p * x\<^sup>\<circ> = p * (p * x)\<^sup>\<circ>
[PROOF STEP]
hence "p * x\<^sup>\<circ> \<le> p * (p * x)\<^sup>\<circ>"
[PROOF STATE]
proof (prove)
using this:
p * x \<le> p * (p * x * p) * p

goal (1 subgoal):
 1. p * x\<^sup>\<circ> \<le> p * (p * x)\<^sup>\<circ>
[PROOF STEP]
by (metis (no_types) assms circ_simulate circ_slide_1 test_preserves_equation)
[PROOF STATE]
proof (state)
this:
p * x\<^sup>\<circ> \<le> p * (p * x)\<^sup>\<circ>

goal (1 subgoal):
 1. p * x\<^sup>\<circ> = p * (p * x)\<^sup>\<circ>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p * x\<^sup>\<circ> \<le> p * (p * x)\<^sup>\<circ>

goal (1 subgoal):
 1. p * x\<^sup>\<circ> = p * (p * x)\<^sup>\<circ>
[PROOF STEP]
by (metis assms(2) circ_isotone mult_left_isotone mult_1_left mult_right_isotone order.antisym)
[PROOF STATE]
proof (state)
this:
p * x\<^sup>\<circ> = p * (p * x)\<^sup>\<circ>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma differenceset_translate_eq_right:
  assumes "A \<subseteq> G" and "B \<subseteq> G" and "x \<in> G"
  shows "(differenceset A {x} = differenceset B {x}) \<longleftrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (differenceset A {x} = differenceset B {x}) = (A = B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> G
B \<subseteq> G
x \<in> G

goal (1 subgoal):
 1. (differenceset A {x} = differenceset B {x}) = (A = B)
[PROOF STEP]
by (metis Int_absorb2 differenceset_commute minus_minusset minusset_subset_carrier
    sumset_translate_eq_left)


[STATEMENT]
lemma List_eq_zipI:
  assumes "\<forall>(v1, v2) \<in> set (zip vs1 vs2). v1 = v2"
  and "length vs1 = length vs2"
  shows "vs1 = vs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs1 = vs2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>(v1, v2)\<in>set (zip vs1 vs2). v1 = v2
length vs1 = length vs2

goal (1 subgoal):
 1. vs1 = vs2
[PROOF STEP]
apply(induct vs1 arbitrary: vs2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip [] vs2). x = y; length [] = length vs2\<rbrakk> \<Longrightarrow> [] = vs2
 2. \<And>a vs1 vs2. \<lbrakk>\<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip vs1 vs2). x = y; length vs1 = length vs2\<rbrakk> \<Longrightarrow> vs1 = vs2; \<forall>(x, y)\<in>set (zip (a # vs1) vs2). x = y; length (a # vs1) = length vs2\<rbrakk> \<Longrightarrow> a # vs1 = vs2
[PROOF STEP]
apply(case_tac vs2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip [] vs2). x = y; length [] = length vs2; vs2 = []\<rbrakk> \<Longrightarrow> [] = vs2
 2. \<And>vs2 a list. \<lbrakk>\<forall>(x, y)\<in>set (zip [] vs2). x = y; length [] = length vs2; vs2 = a # list\<rbrakk> \<Longrightarrow> [] = vs2
 3. \<And>a vs1 vs2. \<lbrakk>\<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip vs1 vs2). x = y; length vs1 = length vs2\<rbrakk> \<Longrightarrow> vs1 = vs2; \<forall>(x, y)\<in>set (zip (a # vs1) vs2). x = y; length (a # vs1) = length vs2\<rbrakk> \<Longrightarrow> a # vs1 = vs2
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>vs2 a list. \<lbrakk>\<forall>(x, y)\<in>set (zip [] vs2). x = y; length [] = length vs2; vs2 = a # list\<rbrakk> \<Longrightarrow> [] = vs2
 2. \<And>a vs1 vs2. \<lbrakk>\<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip vs1 vs2). x = y; length vs1 = length vs2\<rbrakk> \<Longrightarrow> vs1 = vs2; \<forall>(x, y)\<in>set (zip (a # vs1) vs2). x = y; length (a # vs1) = length vs2\<rbrakk> \<Longrightarrow> a # vs1 = vs2
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a vs1 vs2. \<lbrakk>\<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip vs1 vs2). x = y; length vs1 = length vs2\<rbrakk> \<Longrightarrow> vs1 = vs2; \<forall>(x, y)\<in>set (zip (a # vs1) vs2). x = y; length (a # vs1) = length vs2\<rbrakk> \<Longrightarrow> a # vs1 = vs2
[PROOF STEP]
apply(case_tac vs2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a vs1 vs2. \<lbrakk>\<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip vs1 vs2). x = y; length vs1 = length vs2\<rbrakk> \<Longrightarrow> vs1 = vs2; \<forall>(x, y)\<in>set (zip (a # vs1) vs2). x = y; length (a # vs1) = length vs2; vs2 = []\<rbrakk> \<Longrightarrow> a # vs1 = vs2
 2. \<And>a vs1 vs2 aa list. \<lbrakk>\<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip vs1 vs2). x = y; length vs1 = length vs2\<rbrakk> \<Longrightarrow> vs1 = vs2; \<forall>(x, y)\<in>set (zip (a # vs1) vs2). x = y; length (a # vs1) = length vs2; vs2 = aa # list\<rbrakk> \<Longrightarrow> a # vs1 = vs2
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a vs1 vs2 aa list. \<lbrakk>\<And>vs2. \<lbrakk>\<forall>(x, y)\<in>set (zip vs1 vs2). x = y; length vs1 = length vs2\<rbrakk> \<Longrightarrow> vs1 = vs2; \<forall>(x, y)\<in>set (zip (a # vs1) vs2). x = y; length (a # vs1) = length vs2; vs2 = aa # list\<rbrakk> \<Longrightarrow> a # vs1 = vs2
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma neg_lc_dom_quad:
  fixes a:: "real"
  fixes b:: "real"
  fixes c:: "real"
  assumes alt: "a < 0"
  shows "\<exists>(w::real). \<forall>(y::real). (y > w \<longrightarrow> a*y^2 + b*y + c < 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
have "\<exists>(w::real). \<forall>(y::real). (y > w \<longrightarrow> y^2 > (-b/a)*y + (-c/a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. - b / a * y + - c / a < y\<^sup>2
[PROOF STEP]
using ysq_dom_y_plus_coeff_2[where b = "-b/a", where c = "-c/a"]
[PROOF STATE]
proof (prove)
using this:
\<exists>w. \<forall>y>w. - b / a * y + - c / a < y\<^sup>2

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. - b / a * y + - c / a < y\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w. \<forall>y>w. - b / a * y + - c / a < y\<^sup>2

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>w. \<forall>y>w. - b / a * y + - c / a < y\<^sup>2
[PROOF STEP]
have keyh: "\<exists>(w::real). \<forall>(y::real). (y > w \<longrightarrow> a*y^2 < a*((-b/a)*y + (-c/a)))"
[PROOF STATE]
proof (prove)
using this:
\<exists>w. \<forall>y>w. - b / a * y + - c / a < y\<^sup>2

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 < a * (- b / a * y + - c / a)
[PROOF STEP]
using alt
[PROOF STATE]
proof (prove)
using this:
\<exists>w. \<forall>y>w. - b / a * y + - c / a < y\<^sup>2
a < 0

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 < a * (- b / a * y + - c / a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w. \<forall>y>w. a * y\<^sup>2 < a * (- b / a * y + - c / a)

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
have simp1: "\<forall>y. a*((-b/a)*y + (-c/a)) = a*(-b/a)*y + a*(-c/a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. a * (- b / a * y + - c / a) = a * (- b / a) * y + a * (- c / a)
[PROOF STEP]
using diff_divide_eq_iff
[PROOF STATE]
proof (prove)
using this:
?z \<noteq> (0::?'a) \<Longrightarrow> ?x - ?y / ?z = (?x * ?z - ?y) / ?z

goal (1 subgoal):
 1. \<forall>y. a * (- b / a * y + - c / a) = a * (- b / a) * y + a * (- c / a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>y. a * (- b / a * y + - c / a) = a * (- b / a) * y + a * (- c / a)

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
have simp2: "\<forall>y. a*(-b/a)*y + a*(-c/a) = -b*y + a*(-c/a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. a * (- b / a) * y + a * (- c / a) = - b * y + a * (- c / a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < 0

goal (1 subgoal):
 1. \<forall>y. a * (- b / a) * y + a * (- c / a) = - b * y + a * (- c / a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>y. a * (- b / a) * y + a * (- c / a) = - b * y + a * (- c / a)

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
have simp3: "\<forall>y. -b*y + a*(-c/a) = -b*y - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. - b * y + a * (- c / a) = - b * y - c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < 0

goal (1 subgoal):
 1. \<forall>y. - b * y + a * (- c / a) = - b * y - c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>y. - b * y + a * (- c / a) = - b * y - c

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. - b * y + a * (- c / a) = - b * y - c
[PROOF STEP]
have "\<forall>y. a*((-b/a)*y + (-c/a)) = -b*y - c"
[PROOF STATE]
proof (prove)
using this:
\<forall>y. - b * y + a * (- c / a) = - b * y - c

goal (1 subgoal):
 1. \<forall>y. a * (- b / a * y + - c / a) = - b * y - c
[PROOF STEP]
using simp1 simp2 simp3
[PROOF STATE]
proof (prove)
using this:
\<forall>y. - b * y + a * (- c / a) = - b * y - c
\<forall>y. a * (- b / a * y + - c / a) = a * (- b / a) * y + a * (- c / a)
\<forall>y. a * (- b / a) * y + a * (- c / a) = - b * y + a * (- c / a)
\<forall>y. - b * y + a * (- c / a) = - b * y - c

goal (1 subgoal):
 1. \<forall>y. a * (- b / a * y + - c / a) = - b * y - c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>y. a * (- b / a * y + - c / a) = - b * y - c

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. a * (- b / a * y + - c / a) = - b * y - c
[PROOF STEP]
have keyh2: "\<exists>(w::real). \<forall>(y::real). (y > w \<longrightarrow> a*y^2 < -b*y-c)"
[PROOF STATE]
proof (prove)
using this:
\<forall>y. a * (- b / a * y + - c / a) = - b * y - c

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 < - b * y - c
[PROOF STEP]
using keyh
[PROOF STATE]
proof (prove)
using this:
\<forall>y. a * (- b / a * y + - c / a) = - b * y - c
\<exists>w. \<forall>y>w. a * y\<^sup>2 < a * (- b / a * y + - c / a)

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 < - b * y - c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w. \<forall>y>w. a * y\<^sup>2 < - b * y - c

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
have "\<forall>y. a*y^2 < -b*y-c \<longleftrightarrow> a*y^2 + b*y + c < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. (a * y\<^sup>2 < - b * y - c) = (a * y\<^sup>2 + b * y + c < 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>y. (a * y\<^sup>2 < - b * y - c) = (a * y\<^sup>2 + b * y + c < 0)

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. (a * y\<^sup>2 < - b * y - c) = (a * y\<^sup>2 + b * y + c < 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>y. (a * y\<^sup>2 < - b * y - c) = (a * y\<^sup>2 + b * y + c < 0)

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
using keyh2
[PROOF STATE]
proof (prove)
using this:
\<forall>y. (a * y\<^sup>2 < - b * y - c) = (a * y\<^sup>2 + b * y + c < 0)
\<exists>w. \<forall>y>w. a * y\<^sup>2 < - b * y - c

goal (1 subgoal):
 1. \<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w. \<forall>y>w. a * y\<^sup>2 + b * y + c < 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma separating_hyperplane_set_0:
  assumes "convex S" "(0::'a::euclidean_space) \<notin> S"
  shows "\<exists>a. a \<noteq> 0 \<and> (\<forall>x\<in>S. 0 \<le> inner a x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)
[PROOF STEP]
let ?k = "\<lambda>c. {x::'a. 0 \<le> inner c x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)
[PROOF STEP]
have *: "frontier (cball 0 1) \<inter> \<Inter>f \<noteq> {}" if as: "f \<subseteq> ?k ` S" "finite f" for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
obtain c where c: "f = ?k ` c" "c \<subseteq> S" "finite c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c; c \<subseteq> S; finite c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_subset_image[OF as(2,1)]
[PROOF STATE]
proof (prove)
using this:
\<exists>C\<subseteq>S. finite C \<and> f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` C

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c; c \<subseteq> S; finite c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c
c \<subseteq> S
finite c

goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c
c \<subseteq> S
finite c
[PROOF STEP]
obtain a b where ab: "a \<noteq> 0" "0 < b" "\<forall>x\<in>convex hull c. b < inner a x"
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c
c \<subseteq> S
finite c

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<noteq> (0::'a); 0 < b; \<forall>x\<in>convex hull c. b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using separating_hyperplane_closed_0[OF convex_convex_hull, of c]
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c
c \<subseteq> S
finite c
\<lbrakk>closed (convex hull c); (0::'a) \<notin> convex hull c\<rbrakk> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>convex hull c. b < a \<bullet> x)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<noteq> (0::'a); 0 < b; \<forall>x\<in>convex hull c. b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_imp_compact_convex_hull[OF c(3), THEN compact_imp_closed] and assms(2)
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c
c \<subseteq> S
finite c
\<lbrakk>closed (convex hull c); (0::'a) \<notin> convex hull c\<rbrakk> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>convex hull c. b < a \<bullet> x)
closed (convex hull c)
(0::'a) \<notin> S

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<noteq> (0::'a); 0 < b; \<forall>x\<in>convex hull c. b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using subset_hull[of convex, OF assms(1), symmetric, of c]
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` c
c \<subseteq> S
finite c
\<lbrakk>closed (convex hull c); (0::'a) \<notin> convex hull c\<rbrakk> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>convex hull c. b < a \<bullet> x)
closed (convex hull c)
(0::'a) \<notin> S
(c \<subseteq> S) = (convex hull c \<subseteq> S)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<noteq> (0::'a); 0 < b; \<forall>x\<in>convex hull c. b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)
0 < b
\<forall>x\<in>convex hull c. b < a \<bullet> x

goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
have "norm (a /\<^sub>R norm a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (a /\<^sub>R norm a) = 1
[PROOF STEP]
by (simp add: ab(1))
[PROOF STATE]
proof (state)
this:
norm (a /\<^sub>R norm a) = 1

goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
norm (a /\<^sub>R norm a) = 1

goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
have "(\<forall>y\<in>c. 0 \<le> y \<bullet> (a /\<^sub>R norm a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>c. 0 \<le> y \<bullet> (a /\<^sub>R norm a)
[PROOF STEP]
using hull_subset[of c convex] ab
[PROOF STATE]
proof (prove)
using this:
c \<subseteq> convex hull c
a \<noteq> (0::'a)
0 < b
\<forall>x\<in>convex hull c. b < a \<bullet> x

goal (1 subgoal):
 1. \<forall>y\<in>c. 0 \<le> y \<bullet> (a /\<^sub>R norm a)
[PROOF STEP]
by (force simp: inner_commute)
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>c. 0 \<le> y \<bullet> (a /\<^sub>R norm a)

goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
norm (a /\<^sub>R norm a) = 1
\<forall>y\<in>c. 0 \<le> y \<bullet> (a /\<^sub>R norm a)
[PROOF STEP]
have "\<exists>x. norm x = 1 \<and> (\<forall>y\<in>c. 0 \<le> inner y x)"
[PROOF STATE]
proof (prove)
using this:
norm (a /\<^sub>R norm a) = 1
\<forall>y\<in>c. 0 \<le> y \<bullet> (a /\<^sub>R norm a)

goal (1 subgoal):
 1. \<exists>x. norm x = 1 \<and> (\<forall>y\<in>c. 0 \<le> y \<bullet> x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x. norm x = 1 \<and> (\<forall>y\<in>c. 0 \<le> y \<bullet> x)

goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. norm x = 1 \<and> (\<forall>y\<in>c. 0 \<le> y \<bullet> x)
[PROOF STEP]
show "frontier (cball 0 1) \<inter> \<Inter>f \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. norm x = 1 \<and> (\<forall>y\<in>c. 0 \<le> y \<bullet> x)

goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}
[PROOF STEP]
unfolding c(1) frontier_cball sphere_def dist_norm
[PROOF STATE]
proof (prove)
using this:
\<exists>x. norm x = 1 \<and> (\<forall>y\<in>c. 0 \<le> y \<bullet> x)

goal (1 subgoal):
 1. {y. norm ((0::'a) - y) = 1} \<inter> (\<Inter>c\<in>c. {x. 0 \<le> c \<bullet> x}) \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
frontier (cball (0::'a) 1) \<inter> \<Inter> f \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?f \<subseteq> (\<lambda>c. {x. 0 \<le> c \<bullet> x}) ` S; finite ?f\<rbrakk> \<Longrightarrow> frontier (cball (0::'a) 1) \<inter> \<Inter> ?f \<noteq> {}

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)
[PROOF STEP]
have "frontier (cball 0 1) \<inter> (\<Inter>(?k ` S)) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (cball (0::'a) 1) \<inter> (\<Inter>c\<in>S. {x. 0 \<le> c \<bullet> x}) \<noteq> {}
[PROOF STEP]
by (rule compact_imp_fip) (use * closed_halfspace_ge in auto)
[PROOF STATE]
proof (state)
this:
frontier (cball (0::'a) 1) \<inter> (\<Inter>c\<in>S. {x. 0 \<le> c \<bullet> x}) \<noteq> {}

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
frontier (cball (0::'a) 1) \<inter> (\<Inter>c\<in>S. {x. 0 \<le> c \<bullet> x}) \<noteq> {}
[PROOF STEP]
obtain x where "norm x = 1" "\<forall>y\<in>S. x\<in>?k y"
[PROOF STATE]
proof (prove)
using this:
frontier (cball (0::'a) 1) \<inter> (\<Inter>c\<in>S. {x. 0 \<le> c \<bullet> x}) \<noteq> {}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>norm x = 1; \<forall>y\<in>S. x \<in> {x. 0 \<le> y \<bullet> x}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding frontier_cball dist_norm sphere_def
[PROOF STATE]
proof (prove)
using this:
{y. norm ((0::'a) - y) = 1} \<inter> (\<Inter>c\<in>S. {x. 0 \<le> c \<bullet> x}) \<noteq> {}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>norm x = 1; \<forall>y\<in>S. x \<in> {x. 0 \<le> y \<bullet> x}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm x = 1
\<forall>y\<in>S. x \<in> {x. 0 \<le> y \<bullet> x}

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm x = 1
\<forall>y\<in>S. x \<in> {x. 0 \<le> y \<bullet> x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm x = 1
\<forall>y\<in>S. x \<in> {x. 0 \<le> y \<bullet> x}

goal (1 subgoal):
 1. \<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)
[PROOF STEP]
by (metis inner_commute mem_Collect_eq norm_eq_zero zero_neq_one)
[PROOF STATE]
proof (state)
this:
\<exists>a. a \<noteq> (0::'a) \<and> (\<forall>x\<in>S. 0 \<le> a \<bullet> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enum_n_top: "a \<in> s \<Longrightarrow> a = enum n \<longleftrightarrow> (\<forall>a'\<in>s. a' \<le> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> s \<Longrightarrow> (a = enum n) = (\<forall>a'\<in>s. a' \<le> a)
[PROOF STEP]
unfolding s_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> enum ` {..n} \<Longrightarrow> (a = enum n) = (\<forall>a'\<in>enum ` {..n}. a' \<le> a)
[PROOF STEP]
by (auto simp: enum_mono Ball_def)


[STATEMENT]
lemma fmsubset_drop_set_mono: "m \<subseteq>\<^sub>f n \<Longrightarrow> fmdrop_set A m \<subseteq>\<^sub>f fmdrop_set A n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<subseteq>\<^sub>f n \<Longrightarrow> fmdrop_set A m \<subseteq>\<^sub>f fmdrop_set A n
[PROOF STEP]
unfolding fmfilter_alt_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<subseteq>\<^sub>f n \<Longrightarrow> fmfilter (\<lambda>a. a \<notin> A) m \<subseteq>\<^sub>f fmfilter (\<lambda>a. a \<notin> A) n
[PROOF STEP]
by (rule fmsubset_filter_mono)


[STATEMENT]
lemma ordinal_0_exp [simp]: "0 ** x = (if x = 0 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 ** x = (if x = 0 then 1 else 0)
[PROOF STEP]
by (simp add: exp_ordinal_def)


[STATEMENT]
lemma integrable_reflect_real[simp]: "(\<lambda>x. f(-x)) integrable_on {-b .. -a} \<longleftrightarrow> f integrable_on {a..b::real}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (- x)) integrable_on {- b..- a}) = (f integrable_on {a..b})
[PROOF STEP]
unfolding box_real[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (- x)) integrable_on cbox (- b) (- a)) = (f integrable_on cbox a b)
[PROOF STEP]
by (rule integrable_reflect)


[STATEMENT]
lemma matchs_app[simp]:
  assumes "length xs\<^sub>2 = length ys\<^sub>2"
  shows "matchs (xs\<^sub>1 @ xs\<^sub>2) (ys\<^sub>1 @ ys\<^sub>2) =
          matchs xs\<^sub>1 ys\<^sub>1 \<bind> (\<lambda>env\<^sub>1. matchs xs\<^sub>2 ys\<^sub>2 \<bind> (\<lambda>env\<^sub>2. Some (env\<^sub>1 ++\<^sub>f env\<^sub>2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matchs (xs\<^sub>1 @ xs\<^sub>2) (ys\<^sub>1 @ ys\<^sub>2) = matchs xs\<^sub>1 ys\<^sub>1 \<bind> (\<lambda>env\<^sub>1. matchs xs\<^sub>2 ys\<^sub>2 \<bind> (\<lambda>env\<^sub>2. Some (env\<^sub>1 ++\<^sub>f env\<^sub>2)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs\<^sub>2 = length ys\<^sub>2

goal (1 subgoal):
 1. matchs (xs\<^sub>1 @ xs\<^sub>2) (ys\<^sub>1 @ ys\<^sub>2) = matchs xs\<^sub>1 ys\<^sub>1 \<bind> (\<lambda>env\<^sub>1. matchs xs\<^sub>2 ys\<^sub>2 \<bind> (\<lambda>env\<^sub>2. Some (env\<^sub>1 ++\<^sub>f env\<^sub>2)))
[PROOF STEP]
by (induct xs\<^sub>1 ys\<^sub>1 rule: matchs.induct) fastforce+


[STATEMENT]
theorem desargues_3D :
  assumes "desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>"
  shows "rk {\<alpha>, \<beta>, \<gamma>} \<le> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {\<alpha>, \<beta>, \<gamma>} \<le> 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rk {\<alpha>, \<beta>, \<gamma>} \<le> 2
[PROOF STEP]
have "rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>} + rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>} + rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>}
[PROOF STEP]
using matroid_ax_3_alt[of "{\<alpha>, \<beta>, \<gamma>}" "{A, B, C, \<alpha>, \<beta>, \<gamma>}" "{A', B', C', \<alpha>, \<beta>, \<gamma>}"]
[PROOF STATE]
proof (prove)
using this:
{\<alpha>, \<beta>, \<gamma>} \<subseteq> {A, B, C, \<alpha>, \<beta>, \<gamma>} \<inter> {A', B', C', \<alpha>, \<beta>, \<gamma>} \<Longrightarrow> rk ({A, B, C, \<alpha>, \<beta>, \<gamma>} \<union> {A', B', C', \<alpha>, \<beta>, \<gamma>}) + rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>}

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>} + rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>} + rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>}

goal (1 subgoal):
 1. rk {\<alpha>, \<beta>, \<gamma>} \<le> 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>} + rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>}
[PROOF STEP]
have "rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>} - rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>}"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>} + rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>}

goal (1 subgoal):
 1. rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>} - rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>}
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>} - rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>}

goal (1 subgoal):
 1. rk {\<alpha>, \<beta>, \<gamma>} \<le> 2
[PROOF STEP]
thus "rk {\<alpha>, \<beta>, \<gamma>} \<le> 2"
[PROOF STATE]
proof (prove)
using this:
rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>} - rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>}

goal (1 subgoal):
 1. rk {\<alpha>, \<beta>, \<gamma>} \<le> 2
[PROOF STEP]
using assms desargues_config_3D_coplanar_6 desargues_config_3D_non_coplanar
[PROOF STATE]
proof (prove)
using this:
rk {\<alpha>, \<beta>, \<gamma>} \<le> rk {A, B, C, \<alpha>, \<beta>, \<gamma>} + rk {A', B', C', \<alpha>, \<beta>, \<gamma>} - rk {A, B, C, A', B', C', \<alpha>, \<beta>, \<gamma>}
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_3D ?A ?B ?C ?A' ?B' ?C' ?P ?\<alpha> ?\<beta> ?\<gamma> \<Longrightarrow> rk {?A, ?B, ?C, ?\<alpha>, ?\<beta>, ?\<gamma>} = 3
desargues_config_3D ?A ?B ?C ?A' ?B' ?C' ?P ?\<alpha> ?\<beta> ?\<gamma> \<Longrightarrow> rk {?A', ?B', ?C', ?\<alpha>, ?\<beta>, ?\<gamma>} = 3
desargues_config_3D ?A ?B ?C ?A' ?B' ?C' ?P ?\<alpha> ?\<beta> ?\<gamma> \<Longrightarrow> 4 \<le> rk {?A, ?B, ?C, ?A', ?B', ?C', ?\<alpha>, ?\<beta>, ?\<gamma>}

goal (1 subgoal):
 1. rk {\<alpha>, \<beta>, \<gamma>} \<le> 2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
rk {\<alpha>, \<beta>, \<gamma>} \<le> 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_Sigma_alt: "map_Sigma M1 F2 = Sigma (dom M1) (\<lambda>x.
  F2 (the (M1 x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_Sigma M1 F2 = (SIGMA x:dom M1. F2 (the (M1 x)))
[PROOF STEP]
unfolding map_Sigma_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). \<exists>v. M1 x = Some v \<and> y \<in> F2 v} = (SIGMA x:dom M1. F2 (the (M1 x)))
[PROOF STEP]
by auto


[STATEMENT]
lemma median_5_aux:
  assumes "x1 \<le> x2" "x4 \<le> x5" "x1 \<le> x4"
  shows   "median_5_aux x1 x2 x3 x4 x5 = median [x1,x2,x3,x4,x5]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. median_5_aux x1 x2 x3 x4 x5 = median [x1, x2, x3, x4, x5]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x1 \<le> x2
x4 \<le> x5
x1 \<le> x4

goal (1 subgoal):
 1. median_5_aux x1 x2 x3 x4 x5 = median [x1, x2, x3, x4, x5]
[PROOF STEP]
by (auto simp: median_5_aux_def median_def select_def min_def)


[STATEMENT]
lemma equal_pair_count_correct:"
  \<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i)
[PROOF STEP]
apply (induct ps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < equal_pair_count [] \<Longrightarrow> equal_pair ([] ! i)
 2. \<And>a ps i. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); i < equal_pair_count (a # ps)\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ps i. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); i < equal_pair_count (a # ps)\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ps i. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); i < (if fst a = snd a then Suc (equal_pair_count ps) else 0)\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
[PROOF STEP]
apply (split if_split_asm)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a ps i. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); fst a = snd a; i < Suc (equal_pair_count ps)\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
 2. \<And>a ps i. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); fst a \<noteq> snd a; i < 0\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
[PROOF STEP]
apply (case_tac i)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a ps i. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); fst a = snd a; i < Suc (equal_pair_count ps); i = 0\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
 2. \<And>a ps i nat. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); fst a = snd a; i < Suc (equal_pair_count ps); i = Suc nat\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
 3. \<And>a ps i. \<lbrakk>\<And>i. i < equal_pair_count ps \<Longrightarrow> equal_pair (ps ! i); fst a \<noteq> snd a; i < 0\<rbrakk> \<Longrightarrow> equal_pair ((a # ps) ! i)
[PROOF STEP]
apply (simp add: equal_pair_def)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_decomp_subset:
  "\<lbrakk> U = A\<union>B; A\<subseteq>X; B\<subseteq>Y; X\<subseteq>U; X\<inter>Y = {} \<rbrakk> \<Longrightarrow> A = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>U = A \<union> B; A \<subseteq> X; B \<subseteq> Y; X \<subseteq> U; X \<inter> Y = {}\<rbrakk> \<Longrightarrow> A = X
[PROOF STEP]
by auto


[STATEMENT]
lemma cong_scale:
  "k \<noteq> 0 \<Longrightarrow> [a = b] (mod c) \<longleftrightarrow> [k*a = k*b] (mod k*c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> (0::'a) \<Longrightarrow> [a = b] (mod c) = [k * a = k * b] (mod k * c)
[PROOF STEP]
unfolding cong_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> (0::'a) \<Longrightarrow> (a mod c = b mod c) = (k * a mod (k * c) = k * b mod (k * c))
[PROOF STEP]
by auto


[STATEMENT]
lemma emeasure_embed_measure_image:
    "inj f \<Longrightarrow> X \<in> sets M \<Longrightarrow> emeasure (embed_measure M f) (f`X) = emeasure M X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj f; X \<in> sets M\<rbrakk> \<Longrightarrow> emeasure (embed_measure M f) (f ` X) = emeasure M X
[PROOF STEP]
by (simp_all add: emeasure_embed_measure in_sets_embed_measure inj_vimage_image_eq)


[STATEMENT]
lemma vdisjnt_vinsert_left: "vdisjnt (vinsert a X) Y \<longleftrightarrow> a \<notin>\<^sub>\<circ> Y \<and> vdisjnt X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vdisjnt (vinsert a X) Y = (a \<notin>\<^sub>\<circ> Y \<and> vdisjnt X Y)
[PROOF STEP]
by (metis vdisjnt_iff vdisjnt_sym vinsertE1 vinsertI2 vinsert_iff)


[STATEMENT]
lemma mcs_conjunction_mult:
 assumes \<open>consistent A V\<close> and \<open>maximal A V\<close>
  shows \<open>(set (S :: ('i fm list)) \<subseteq> V \<and> finite (set S)) \<longrightarrow> (conjunct S) \<in> V\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V
[PROOF STEP]
proof(induct S)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> V \<and> finite (set []) \<longrightarrow> conjunct [] \<in> V
 2. \<And>a S. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V \<Longrightarrow> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. set [] \<subseteq> V \<and> finite (set []) \<longrightarrow> conjunct [] \<in> V
 2. \<And>a S. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V \<Longrightarrow> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set [] \<subseteq> V \<and> finite (set []) \<longrightarrow> conjunct [] \<in> V
[PROOF STEP]
by (metis K_Boole assms(1) assms(2) conjunct.simps(1) consistent_def inconsistent_subset maximal_def)
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> V \<and> finite (set []) \<longrightarrow> conjunct [] \<in> V

goal (1 subgoal):
 1. \<And>a S. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V \<Longrightarrow> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
case (Cons a S)
[PROOF STATE]
proof (state)
this:
set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V

goal (1 subgoal):
 1. \<And>a S. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V \<Longrightarrow> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V
[PROOF STEP]
have \<open>set S \<subseteq> set (a#S)\<close>
[PROOF STATE]
proof (prove)
using this:
set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V

goal (1 subgoal):
 1. set S \<subseteq> set (a # S)
[PROOF STEP]
by (meson set_subset_Cons)
[PROOF STATE]
proof (state)
this:
set S \<subseteq> set (a # S)

goal (1 subgoal):
 1. \<And>a S. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V \<Longrightarrow> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set S \<subseteq> set (a # S)
[PROOF STEP]
have c1: \<open> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (S) \<in> V \<and> a \<in> V\<close>
[PROOF STATE]
proof (prove)
using this:
set S \<subseteq> set (a # S)

goal (1 subgoal):
 1. set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct S \<in> V \<and> a \<in> V
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
set S \<subseteq> set (a # S)
set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V

goal (1 subgoal):
 1. set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct S \<in> V \<and> a \<in> V
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct S \<in> V \<and> a \<in> V

goal (1 subgoal):
 1. \<And>a S. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V \<Longrightarrow> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct S \<in> V \<and> a \<in> V
[PROOF STEP]
have \<open> conjunct (S) \<in> V \<and> a \<in> V \<longrightarrow> (conjunct (a#S)) \<in> V \<close>
[PROOF STATE]
proof (prove)
using this:
set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct S \<in> V \<and> a \<in> V

goal (1 subgoal):
 1. conjunct S \<in> V \<and> a \<in> V \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
using assms(1) assms(2) mcs_conjunction
[PROOF STATE]
proof (prove)
using this:
set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct S \<in> V \<and> a \<in> V
consistent A V
maximal A V
\<lbrakk>consistent ?A ?V; maximal ?A ?V\<rbrakk> \<Longrightarrow> ?p \<in> ?V \<and> ?q \<in> ?V \<longrightarrow> ?p \<^bold>\<and> ?q \<in> ?V

goal (1 subgoal):
 1. conjunct S \<in> V \<and> a \<in> V \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjunct S \<in> V \<and> a \<in> V \<longrightarrow> conjunct (a # S) \<in> V

goal (1 subgoal):
 1. \<And>a S. set S \<subseteq> V \<and> finite (set S) \<longrightarrow> conjunct S \<in> V \<Longrightarrow> set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
conjunct S \<in> V \<and> a \<in> V \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
conjunct S \<in> V \<and> a \<in> V \<longrightarrow> conjunct (a # S) \<in> V

goal (1 subgoal):
 1. set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
using c1
[PROOF STATE]
proof (prove)
using this:
conjunct S \<in> V \<and> a \<in> V \<longrightarrow> conjunct (a # S) \<in> V
set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct S \<in> V \<and> a \<in> V

goal (1 subgoal):
 1. set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
set (a # S) \<subseteq> V \<and> finite (set (a # S)) \<longrightarrow> conjunct (a # S) \<in> V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma choose_inj_right:
  assumes id: "(n choose l) = (k choose l)"
    and n0: "n choose l \<noteq> 0"
    and l0:  "l \<noteq> 0"
  shows "n = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = k
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
assume nk: "n \<noteq> k"
[PROOF STATE]
proof (state)
this:
n \<noteq> k

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
define m where "m = min n k"
[PROOF STATE]
proof (state)
this:
m = min n k

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
define M where "M = max n k"
[PROOF STATE]
proof (state)
this:
M = max n k

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
from nk
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> k
[PROOF STEP]
have mM: "m < M"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> k

goal (1 subgoal):
 1. m < M
[PROOF STEP]
unfolding m_def M_def
[PROOF STATE]
proof (prove)
using this:
n \<noteq> k

goal (1 subgoal):
 1. min n k < max n k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m < M

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
let ?new = "insert (M - 1) {0..< l - 1}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
let ?m = "{K \<in> Pow {0..<m}. card K = l}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
let ?M = "{K \<in> Pow {0..<M}. card K = l}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
from id n0
[PROOF STATE]
proof (chain)
picking this:
n choose l = k choose l
n choose l \<noteq> 0
[PROOF STEP]
have lM :"l \<le> M"
[PROOF STATE]
proof (prove)
using this:
n choose l = k choose l
n choose l \<noteq> 0

goal (1 subgoal):
 1. l \<le> M
[PROOF STEP]
unfolding m_def M_def
[PROOF STATE]
proof (prove)
using this:
n choose l = k choose l
n choose l \<noteq> 0

goal (1 subgoal):
 1. l \<le> max n k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l \<le> M

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
from id
[PROOF STATE]
proof (chain)
picking this:
n choose l = k choose l
[PROOF STEP]
have id: "(m choose l) = (M choose l)"
[PROOF STATE]
proof (prove)
using this:
n choose l = k choose l

goal (1 subgoal):
 1. m choose l = M choose l
[PROOF STEP]
unfolding m_def M_def
[PROOF STATE]
proof (prove)
using this:
n choose l = k choose l

goal (1 subgoal):
 1. min n k choose l = max n k choose l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m choose l = M choose l

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
from this[unfolded binomial_def]
[PROOF STATE]
proof (chain)
picking this:
card {K \<in> Pow {0..<m}. card K = l} = card {K \<in> Pow {0..<M}. card K = l}
[PROOF STEP]
have "card ?M < Suc (card ?m)"
[PROOF STATE]
proof (prove)
using this:
card {K \<in> Pow {0..<m}. card K = l} = card {K \<in> Pow {0..<M}. card K = l}

goal (1 subgoal):
 1. card {K \<in> Pow {0..<M}. card K = l} < Suc (card {K \<in> Pow {0..<m}. card K = l})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {K \<in> Pow {0..<M}. card K = l} < Suc (card {K \<in> Pow {0..<m}. card K = l})

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {K \<in> Pow {0..<M}. card K = l} < Suc (card {K \<in> Pow {0..<m}. card K = l})

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = card (insert ?new ?m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card {K \<in> Pow {0..<m}. card K = l}) = card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<m}. card K = l})
[PROOF STEP]
by (rule sym, rule card_insert_disjoint, force, insert mM, auto)
[PROOF STATE]
proof (state)
this:
Suc (card {K \<in> Pow {0..<m}. card K = l}) = card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<m}. card K = l})

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card {K \<in> Pow {0..<m}. card K = l}) = card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<m}. card K = l})

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
have "\<dots> \<le> card (insert ?new ?M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<m}. card K = l}) \<le> card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<M}. card K = l})
[PROOF STEP]
by (rule card_mono, insert mM, auto)
[PROOF STATE]
proof (state)
this:
card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<m}. card K = l}) \<le> card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<M}. card K = l})

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<m}. card K = l}) \<le> card (insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<M}. card K = l})

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
have "insert ?new ?M = ?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<M}. card K = l} = {K \<in> Pow {0..<M}. card K = l}
[PROOF STEP]
by (insert mM lM l0, auto)
[PROOF STATE]
proof (state)
this:
insert (insert (M - 1) {0..<l - 1}) {K \<in> Pow {0..<M}. card K = l} = {K \<in> Pow {0..<M}. card K = l}

goal (1 subgoal):
 1. n \<noteq> k \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {K \<in> Pow {0..<M}. card K = l} < card {K \<in> Pow {0..<M}. card K = l}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
card {K \<in> Pow {0..<M}. card K = l} < card {K \<in> Pow {0..<M}. card K = l}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lincomb_index:
  assumes i: "i < n"
    and X: "X \<subseteq> carrier_vec n"
  shows "lincomb a X $ i = sum (\<lambda>x. a x * x $ i) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a X $ i = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb a X $ i = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
let ?f = "\<lambda>x. a x \<cdot>\<^sub>v x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb a X $ i = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
have f: "?f : X \<rightarrow> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a x \<cdot>\<^sub>v x) \<in> X \<rightarrow> carrier_vec n
[PROOF STEP]
using X
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> carrier_vec n

goal (1 subgoal):
 1. (\<lambda>x. a x \<cdot>\<^sub>v x) \<in> X \<rightarrow> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a x \<cdot>\<^sub>v x) \<in> X \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. lincomb a X $ i = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
have point: "\<And>v. v \<in> X \<Longrightarrow> (a v \<cdot>\<^sub>v v) $ i = a v * v $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. v \<in> X \<Longrightarrow> (a v \<cdot>\<^sub>v v) $ i = a v * v $ i
[PROOF STEP]
using i X
[PROOF STATE]
proof (prove)
using this:
i < n
X \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<And>v. v \<in> X \<Longrightarrow> (a v \<cdot>\<^sub>v v) $ i = a v * v $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?v1 \<in> X \<Longrightarrow> (a ?v1 \<cdot>\<^sub>v ?v1) $ i = a ?v1 * ?v1 $ i

goal (1 subgoal):
 1. lincomb a X $ i = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a X $ i = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
unfolding lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>\<^bsub>V\<^esub>v\<in>X. a v \<cdot>\<^sub>v v) $ i = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
unfolding finsum_index[OF i f X]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>X. (a v \<cdot>\<^sub>v v) $ i) = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
using point X
[PROOF STATE]
proof (prove)
using this:
?v1 \<in> X \<Longrightarrow> (a ?v1 \<cdot>\<^sub>v ?v1) $ i = a ?v1 * ?v1 $ i
X \<subseteq> carrier_vec n

goal (1 subgoal):
 1. (\<Sum>v\<in>X. (a v \<cdot>\<^sub>v v) $ i) = (\<Sum>x\<in>X. a x * x $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lincomb a X $ i = (\<Sum>x\<in>X. a x * x $ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_st_cons: "to_st (a#B) = (to_st [a])@(to_st B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_st (a # B) = to_st [a] @ to_st B
[PROOF STEP]
using to_st_append[of "[a]" B]
[PROOF STATE]
proof (prove)
using this:
to_st ([a] @ B) = to_st [a] @ to_st B

goal (1 subgoal):
 1. to_st (a # B) = to_st [a] @ to_st B
[PROOF STEP]
by simp


[STATEMENT]
lemma of_rat_dense:
  fixes x y :: real
  assumes "x < y"
  shows "\<exists>q :: rat. x < of_rat q \<and> of_rat q < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q. x < real_of_rat q \<and> real_of_rat q < y
[PROOF STEP]
using Rats_dense_in_real [OF \<open>x < y\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>r\<in>\<rat>. x < r \<and> r < y

goal (1 subgoal):
 1. \<exists>q. x < real_of_rat q \<and> real_of_rat q < y
[PROOF STEP]
by (auto elim: Rats_cases)


[STATEMENT]
lemma convergent_diff_const_right_iff:
  "convergent (\<lambda>n. f n - c :: 'a::topological_ab_group_add) \<longleftrightarrow> convergent f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f n - c) = convergent f
[PROOF STEP]
using convergent_add_const_right_iff[of f "-c"]
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. f n + - c) = convergent f

goal (1 subgoal):
 1. convergent (\<lambda>n. f n - c) = convergent f
[PROOF STEP]
by (simp add: add_ac)


[STATEMENT]
lemma prod_rel_sv[relator_props]:
  "\<lbrakk>single_valued R1; single_valued R2\<rbrakk> \<Longrightarrow> single_valued (\<langle>R1,R2\<rangle>prod_rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued R1; single_valued R2\<rbrakk> \<Longrightarrow> single_valued (R1 \<times>\<^sub>r R2)
[PROOF STEP]
by (auto intro: single_valuedI dest: single_valuedD simp: prod_rel_def)


[STATEMENT]
lemma solution_set_rel:
fixes A::"'a::{field}^'n^'rows"
assumes p: "is_solution p A b"
shows "solution_set A b = {p} + (solution_set A 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solution_set A b = {p} + solution_set A 0
[PROOF STEP]
proof (unfold set_plus_def, auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
 2. \<And>ba. ba \<in> solution_set A 0 \<Longrightarrow> p + ba \<in> solution_set A b
[PROOF STEP]
fix ba
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
 2. \<And>ba. ba \<in> solution_set A 0 \<Longrightarrow> p + ba \<in> solution_set A b
[PROOF STEP]
assume ba: "ba \<in> solution_set A 0"
[PROOF STATE]
proof (state)
this:
ba \<in> solution_set A 0

goal (2 subgoals):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
 2. \<And>ba. ba \<in> solution_set A 0 \<Longrightarrow> p + ba \<in> solution_set A b
[PROOF STEP]
have "A *v (p + ba) = (A *v p) + (A *v ba)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v (p + ba) = A *v p + A *v ba
[PROOF STEP]
unfolding matrix_vector_right_distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v p + A *v ba = A *v p + A *v ba
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A *v (p + ba) = A *v p + A *v ba

goal (2 subgoals):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
 2. \<And>ba. ba \<in> solution_set A 0 \<Longrightarrow> p + ba \<in> solution_set A b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *v (p + ba) = A *v p + A *v ba

goal (2 subgoals):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
 2. \<And>ba. ba \<in> solution_set A 0 \<Longrightarrow> p + ba \<in> solution_set A b
[PROOF STEP]
have "... = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v p + A *v ba = b
[PROOF STEP]
using p ba
[PROOF STATE]
proof (prove)
using this:
is_solution p A b
ba \<in> solution_set A 0

goal (1 subgoal):
 1. A *v p + A *v ba = b
[PROOF STEP]
unfolding solution_set_def is_solution_def
[PROOF STATE]
proof (prove)
using this:
A *v p = b
ba \<in> {x. A *v x = 0}

goal (1 subgoal):
 1. A *v p + A *v ba = b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A *v p + A *v ba = b

goal (2 subgoals):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
 2. \<And>ba. ba \<in> solution_set A 0 \<Longrightarrow> p + ba \<in> solution_set A b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *v (p + ba) = b
[PROOF STEP]
show "p + ba \<in> solution_set A b"
[PROOF STATE]
proof (prove)
using this:
A *v (p + ba) = b

goal (1 subgoal):
 1. p + ba \<in> solution_set A b
[PROOF STEP]
unfolding solution_set_def is_solution_def
[PROOF STATE]
proof (prove)
using this:
A *v (p + ba) = b

goal (1 subgoal):
 1. p + ba \<in> {x. A *v x = b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p + ba \<in> solution_set A b

goal (1 subgoal):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
[PROOF STEP]
assume x: "x \<in> solution_set A b"
[PROOF STATE]
proof (state)
this:
x \<in> solution_set A b

goal (1 subgoal):
 1. \<And>x. x \<in> solution_set A b \<Longrightarrow> \<exists>b\<in>solution_set A 0. x = p + b
[PROOF STEP]
show "\<exists>b\<in>solution_set A 0. x = p + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b\<in>solution_set A 0. x = p + b
[PROOF STEP]
proof (rule bexI[of _ "x-p"], simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x - p \<in> solution_set A 0
[PROOF STEP]
have "A *v (x - p) = (A *v x) - (A *v p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v (x - p) = A *v x - A *v p
[PROOF STEP]
by (metis (no_types) add_diff_cancel diff_add_cancel matrix_vector_right_distrib)
[PROOF STATE]
proof (state)
this:
A *v (x - p) = A *v x - A *v p

goal (1 subgoal):
 1. x - p \<in> solution_set A 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *v (x - p) = A *v x - A *v p

goal (1 subgoal):
 1. x - p \<in> solution_set A 0
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v x - A *v p = 0
[PROOF STEP]
using x p
[PROOF STATE]
proof (prove)
using this:
x \<in> solution_set A b
is_solution p A b

goal (1 subgoal):
 1. A *v x - A *v p = 0
[PROOF STEP]
unfolding solution_set_def is_solution_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. A *v x = b}
A *v p = b

goal (1 subgoal):
 1. A *v x - A *v p = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A *v x - A *v p = 0

goal (1 subgoal):
 1. x - p \<in> solution_set A 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *v (x - p) = 0
[PROOF STEP]
show  "x - p \<in> solution_set A 0"
[PROOF STATE]
proof (prove)
using this:
A *v (x - p) = 0

goal (1 subgoal):
 1. x - p \<in> solution_set A 0
[PROOF STEP]
unfolding solution_set_def is_solution_def
[PROOF STATE]
proof (prove)
using this:
A *v (x - p) = 0

goal (1 subgoal):
 1. x - p \<in> {x. A *v x = 0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - p \<in> solution_set A 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>b\<in>solution_set A 0. x = p + b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma join_cont12:
  assumes "chain Y" and "chain Z"
  assumes compat: "\<And> i j. compatible (Y i) (Z j)"
  shows "(\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion> i. Y i  \<squnion> Z i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
have "(\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> (\<Squnion>j. Z j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> (\<Squnion>j. Z j))
[PROOF STEP]
by (rule join_cont1[OF \<open>chain Y\<close> admD[OF compatible_adm2 \<open>chain Z\<close> compat]])
[PROOF STATE]
proof (state)
this:
(\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> (\<Squnion>j. Z j))

goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> (\<Squnion>j. Z j))

goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
have "... = (\<Squnion>i j. Y i \<squnion> Z j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>i. Y i \<squnion> (\<Squnion>j. Z j)) = (\<Squnion>i j. Y i \<squnion> Z j)
[PROOF STEP]
by (subst join_cont2[OF \<open>chain Z\<close> compat], rule)
[PROOF STATE]
proof (state)
this:
(\<Squnion>i. Y i \<squnion> (\<Squnion>j. Z j)) = (\<Squnion>i j. Y i \<squnion> Z j)

goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>i. Y i \<squnion> (\<Squnion>j. Z j)) = (\<Squnion>i j. Y i \<squnion> Z j)

goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
have "... = (\<Squnion>i. Y i \<squnion> Z i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>i j. Y i \<squnion> Z j) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
apply (rule diag_lub)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. chain (\<lambda>i. Y i \<squnion> Z j)
 2. \<And>i. chain (\<lambda>j. Y i \<squnion> Z j)
[PROOF STEP]
apply (rule chainI, rule join_mono[OF compat compat chainE[OF \<open>chain Y\<close>] below_refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. chain (\<lambda>j. Y i \<squnion> Z j)
[PROOF STEP]
apply (rule chainI, rule join_mono[OF compat compat below_refl chainE[OF \<open>chain Z\<close>]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Squnion>i j. Y i \<squnion> Z j) = (\<Squnion>i. Y i \<squnion> Z i)

goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)

goal (1 subgoal):
 1. (\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Squnion>i. Y i) \<squnion> (\<Squnion>i. Z i) = (\<Squnion>i. Y i \<squnion> Z i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sconsts_list_comb:
   "consts (list_comb f xs) |\<subseteq>| S \<longleftrightarrow> consts f |\<subseteq>| S \<and> list_all (\<lambda>x. consts x |\<subseteq>| S) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (consts (list_comb f xs) |\<subseteq>| S) = (consts f |\<subseteq>| S \<and> list_all (\<lambda>x. consts x |\<subseteq>| S) xs)
[PROOF STEP]
by (induction xs arbitrary: f) auto


[STATEMENT]
lemma tsubstT_cong:
  "(\<forall>(v,S) \<in> tvsT \<sigma>. \<rho>1 v = \<rho>2 v) \<Longrightarrow> tsubstT \<sigma> \<rho>1 = tsubstT \<sigma> \<rho>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>(v, S)\<in>tvsT \<sigma>. \<rho>1 v = \<rho>2 v \<Longrightarrow> tsubstT \<sigma> \<rho>1 = tsubstT \<sigma> \<rho>2
[PROOF STEP]
by (induction \<sigma>) fastforce+


[STATEMENT]
lemma at_neg1:"\<Turnstile>(\<^bold>@c \<^bold>\<not> \<phi>) \<^bold>\<rightarrow> \<^bold>\<not> (\<^bold>@c \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ts v. (\<forall>v'. v = c > v' \<longrightarrow> \<not> \<phi> ts v') \<longrightarrow> \<not> (\<forall>v'. v = c > v' \<longrightarrow> \<phi> ts v')
[PROOF STEP]
using switch_unique
[PROOF STATE]
proof (prove)
using this:
?v = ?c > ?u \<and> ?v = ?c > ?w \<longrightarrow> ?u = ?w

goal (1 subgoal):
 1. \<forall>ts v. (\<forall>v'. v = c > v' \<longrightarrow> \<not> \<phi> ts v') \<longrightarrow> \<not> (\<forall>v'. v = c > v' \<longrightarrow> \<phi> ts v')
[PROOF STEP]
by (metis select_convs switch_def)


[STATEMENT]
lemma Polygamma_real_odd_pos:
  assumes "(x::real) \<notin> \<int>\<^sub>\<le>\<^sub>0" "odd n"
  shows   "Polygamma n x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Polygamma n x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < Polygamma n x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<notin> \<int>\<^sub>\<le>\<^sub>0
odd n
[PROOF STEP]
have "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<int>\<^sub>\<le>\<^sub>0
odd n

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

goal (1 subgoal):
 1. 0 < Polygamma n x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
x \<notin> \<int>\<^sub>\<le>\<^sub>0
odd n
x \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<int>\<^sub>\<le>\<^sub>0
odd n
x \<noteq> 0

goal (1 subgoal):
 1. 0 < Polygamma n x
[PROOF STEP]
unfolding Polygamma_def
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<int>\<^sub>\<le>\<^sub>0
odd n
x \<noteq> 0

goal (1 subgoal):
 1. 0 < (if n = 0 then (\<Sum>k. inverse (real (Suc k)) - inverse (x + real k)) - euler_mascheroni else (- 1) ^ Suc n * fact n * (\<Sum>k. inverse ((x + real k) ^ Suc n)))
[PROOF STEP]
using Polygamma_converges'[of x "Suc n"]
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<int>\<^sub>\<le>\<^sub>0
odd n
x \<noteq> 0
\<lbrakk>x \<noteq> 0; 2 \<le> Suc n\<rbrakk> \<Longrightarrow> summable (\<lambda>k. inverse ((x + real k) ^ Suc n))

goal (1 subgoal):
 1. 0 < (if n = 0 then (\<Sum>k. inverse (real (Suc k)) - inverse (x + real k)) - euler_mascheroni else (- 1) ^ Suc n * fact n * (\<Sum>k. inverse ((x + real k) ^ Suc n)))
[PROOF STEP]
by (auto simp: zero_less_power_eq simp del: power_Suc
             dest: plus_of_nat_eq_0_imp intro!: mult_pos_pos suminf_pos)
[PROOF STATE]
proof (state)
this:
0 < Polygamma n x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_add_nat_ivl_singleton:
  assumes less: "m < (n::nat)"
  shows "f m + sum f {m<..<n} = sum f {m..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f m + sum f {m<..<n} = sum f {m..<n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f m + sum f {m<..<n} = sum f {m..<n}
[PROOF STEP]
have "f m + sum f {m<..<n} = sum f ({m} \<union> {m<..<n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f m + sum f {m<..<n} = sum f ({m} \<union> {m<..<n})
[PROOF STEP]
by (simp add: sum.union_disjoint ivl_disj_int)
[PROOF STATE]
proof (state)
this:
f m + sum f {m<..<n} = sum f ({m} \<union> {m<..<n})

goal (1 subgoal):
 1. f m + sum f {m<..<n} = sum f {m..<n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f m + sum f {m<..<n} = sum f ({m} \<union> {m<..<n})

goal (1 subgoal):
 1. f m + sum f {m<..<n} = sum f {m..<n}
[PROOF STEP]
from less
[PROOF STATE]
proof (chain)
picking this:
m < n
[PROOF STEP]
have "... = sum f {m..<n}"
[PROOF STATE]
proof (prove)
using this:
m < n

goal (1 subgoal):
 1. sum f ({m} \<union> {m<..<n}) = sum f {m..<n}
[PROOF STEP]
by (simp only: ivl_disj_un)
[PROOF STATE]
proof (state)
this:
sum f ({m} \<union> {m<..<n}) = sum f {m..<n}

goal (1 subgoal):
 1. f m + sum f {m<..<n} = sum f {m..<n}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f m + sum f {m<..<n} = sum f {m..<n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f m + sum f {m<..<n} = sum f {m..<n}

goal (1 subgoal):
 1. f m + sum f {m<..<n} = sum f {m..<n}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f m + sum f {m<..<n} = sum f {m..<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_to_iarray_vector_matrix_mult[code_unfold]:
  fixes A::"'a::{semiring_1}^'m::{mod_type}^'n::{mod_type}" and x::"'a^'n::{mod_type}"
  shows "vec_to_iarray (x v* A) = (vec_to_iarray x) v*i (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (x v* A) = vec_to_iarray x v*i matrix_to_iarray A
[PROOF STEP]
unfolding vector_matrix_mult_def vector_matrix_mult_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (\<chi>j. \<Sum>i\<in>UNIV. A $ i $ j * x $ i) = IArray.of_fun (\<lambda>j. \<Sum>i = 0..<IArray.length (vec_to_iarray x). matrix_to_iarray A !! i !! j * vec_to_iarray x !! i) (ncols_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding o_def tabulate2_def nrows_iarray_def ncols_iarray_def matrix_to_iarray_def vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (\<chi>j. \<Sum>i\<in>UNIV. A $ i $ j * x $ i) $ mod_type_class.from_nat i) CARD('m) = IArray.of_fun (\<lambda>j. \<Sum>i = 0..<IArray.length (IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('n)). IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)]) !! i !! j * IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('n) !! i) (IArray.length (IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)]) !! 0))
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa < CARD('m) \<Longrightarrow> (\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)
[PROOF STEP]
fix xa
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa < CARD('m) \<Longrightarrow> (\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)
[PROOF STEP]
have "(UNIV::'n set) = from_nat `{0..<CARD('n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = mod_type_class.from_nat ` {0..<CARD('n)}
[PROOF STEP]
using bij_from_nat[where ?'a='n]
[PROOF STATE]
proof (prove)
using this:
bij_betw mod_type_class.from_nat {0..<CARD('n)} UNIV

goal (1 subgoal):
 1. UNIV = mod_type_class.from_nat ` {0..<CARD('n)}
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat {0..<CARD('n)} \<and> mod_type_class.from_nat ` {0..<CARD('n)} = UNIV

goal (1 subgoal):
 1. UNIV = mod_type_class.from_nat ` {0..<CARD('n)}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
UNIV = mod_type_class.from_nat ` {0..<CARD('n)}

goal (1 subgoal):
 1. \<And>xa. xa < CARD('m) \<Longrightarrow> (\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)
[PROOF STEP]
show "(\<Sum>i\<in>UNIV. A $ i $ from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ from_nat i $ from_nat xa * x $ from_nat i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)
[PROOF STEP]
using sum.reindex[of "from_nat::nat=>'n"]
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat ?A \<Longrightarrow> sum ?g (mod_type_class.from_nat ` ?A) = sum (?g \<circ> mod_type_class.from_nat) ?A

goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)
[PROOF STEP]
using bij_from_nat[where ?'a='n]
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat ?A \<Longrightarrow> sum ?g (mod_type_class.from_nat ` ?A) = sum (?g \<circ> mod_type_class.from_nat) ?A
bij_betw mod_type_class.from_nat {0..<CARD('n)} UNIV

goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat ?A \<Longrightarrow> sum ?g (mod_type_class.from_nat ` ?A) = sum (?g \<circ> mod_type_class.from_nat) ?A
inj_on mod_type_class.from_nat {0..<CARD('n)} \<and> mod_type_class.from_nat ` {0..<CARD('n)} = UNIV

goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. A $ i $ mod_type_class.from_nat xa * x $ i) = (\<Sum>i = 0..<CARD('n). A $ mod_type_class.from_nat i $ mod_type_class.from_nat xa * x $ mod_type_class.from_nat i)

goal:
No subgoals!
[PROOF STEP]
qed