[STATEMENT]
lemma Pi_pmf_geometric_filter':
  assumes "finite A" "p \<in> {0<..1}"
  shows "Pi_pmf A 0 (\<lambda>_. geometric_pmf p) =
       do {
         fb \<leftarrow> Pi_pmf A dflt (\<lambda>_. bernoulli_pmf (1 - p));
         Pi_pmf {x \<in> A. fb x} 0 (\<lambda>_. map_pmf Suc (geometric_pmf p)) }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi_pmf.Pi_pmf A 0 (\<lambda>_. geometric_pmf p) = Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf (1 - p)) \<bind> (\<lambda>fb. Pi_pmf.Pi_pmf {x \<in> A. fb x} 0 (\<lambda>_. map_pmf Suc (geometric_pmf p)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
p \<in> {0<..1}

goal (1 subgoal):
 1. Pi_pmf.Pi_pmf A 0 (\<lambda>_. geometric_pmf p) = Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf (1 - p)) \<bind> (\<lambda>fb. Pi_pmf.Pi_pmf {x \<in> A. fb x} 0 (\<lambda>_. map_pmf Suc (geometric_pmf p)))
[PROOF STEP]
by (auto simp add: Pi_pmf_geometric_filter[of _ _ "\<not> dflt"] bernoulli_pmf_Not[of p]
      Pi_pmf_map[of _ _ dflt] map_pmf_def[of "((\<circ>) Not)"])


[STATEMENT]
lemma tau_add [simp]: "\<tau> (x + y) = \<tau> x + \<tau> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> (x + y) = \<tau> x + \<tau> y
[PROOF STEP]
by (simp add: tau_def x_zero_add_closed)


[STATEMENT]
lemma sp_append_one :
  "subpath g v1 (es @ [e]) v2 subs \<longleftrightarrow> subpath g v1 es (src e) subs
                                     \<and> e \<in> edges g
                                     \<and> (tgt e = v2 \<or> (tgt e, v2) \<in> subs\<^sup>+)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SubRel.subpath g v1 (es @ [e]) v2 subs = (SubRel.subpath g v1 es (src e) subs \<and> e \<in> edges g \<and> (tgt e = v2 \<or> (tgt e, v2) \<in> subs\<^sup>+))
[PROOF STEP]
unfolding subpath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sub_rel_of g subs \<and> v1 \<in> Graph.vertices g \<and> SubRel.ces v1 (es @ [e]) v2 subs \<and> set (es @ [e]) \<subseteq> edges g) = ((sub_rel_of g subs \<and> v1 \<in> Graph.vertices g \<and> SubRel.ces v1 es (src e) subs \<and> set es \<subseteq> edges g) \<and> e \<in> edges g \<and> (tgt e = v2 \<or> (tgt e, v2) \<in> subs\<^sup>+))
[PROOF STEP]
by (auto simp add :  ces_append_one)


[STATEMENT]
lemma isomorphic_trans :
  "isomorphic smult' W \<Longrightarrow> FGModule.isomorphic G smult' W smult'' X
        \<Longrightarrow> isomorphic smult'' X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isomorphic smult' W; \<exists>T. FGModuleIso G smult' W smult'' T X\<rbrakk> \<Longrightarrow> isomorphic smult'' X
[PROOF STEP]
using FGModuleIso.FGModIso_composite_left
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>FGModuleIso ?G ?smult ?V ?smult' ?T ?W; FGModuleIso ?G ?smult' ?W ?smult'' ?S ?X\<rbrakk> \<Longrightarrow> FGModuleIso ?G ?smult ?V ?smult'' (?S \<circ> ?T) ?X

goal (1 subgoal):
 1. \<lbrakk>isomorphic smult' W; \<exists>T. FGModuleIso G smult' W smult'' T X\<rbrakk> \<Longrightarrow> isomorphic smult'' X
[PROOF STEP]
by fast


[STATEMENT]
lemma unit_disc_fix_preserve_poincare_collinear3 [simp]:
  assumes "unit_disc_fix M"
  shows "poincare_collinear {moebius_pt M u, moebius_pt M v, moebius_pt M w} \<longleftrightarrow>
         poincare_collinear {u, v, w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_collinear {moebius_pt M u, moebius_pt M v, moebius_pt M w} = poincare_collinear {u, v, w}
[PROOF STEP]
using assms unit_disc_fix_preserve_poincare_collinear_iff[of M "{u, v, w}"]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
unit_circle_fix M \<Longrightarrow> poincare_collinear (moebius_pt M ` {u, v, w}) = poincare_collinear {u, v, w}

goal (1 subgoal):
 1. poincare_collinear {moebius_pt M u, moebius_pt M v, moebius_pt M w} = poincare_collinear {u, v, w}
[PROOF STEP]
by simp


[STATEMENT]
lemma setPair1: "{a,b} = {d,a} \<Longrightarrow> b = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a, b} = {d, a} \<Longrightarrow> b = d
[PROOF STEP]
by (metis Un_empty_right Un_insert_right insert_absorb2 setPaireq)


[STATEMENT]
lemma range_subset_card:
  "\<lbrakk> {a :: 'a :: len word .. b} \<subseteq> {c .. d}; b \<ge> a \<rbrakk> \<Longrightarrow> d \<ge> c \<and> d - c \<ge> b - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{a..b} \<subseteq> {c..d}; a \<le> b\<rbrakk> \<Longrightarrow> c \<le> d \<and> b - a \<le> d - c
[PROOF STEP]
using word_sub_le word_sub_mono
[PROOF STATE]
proof (prove)
using this:
?y \<le> ?x \<Longrightarrow> ?x - ?y \<le> ?x
\<lbrakk>?a \<le> ?c; ?d \<le> ?b; ?a - ?b \<le> ?a; ?c - ?d \<le> ?c\<rbrakk> \<Longrightarrow> ?a - ?b \<le> ?c - ?d

goal (1 subgoal):
 1. \<lbrakk>{a..b} \<subseteq> {c..d}; a \<le> b\<rbrakk> \<Longrightarrow> c \<le> d \<and> b - a \<le> d - c
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Diagonal_to_Smith_row_i_PQ:
  assumes P'B'Q': "(P',B',Q') = Diagonal_to_Smith_row_i_PQ i bezout (P,B,Q)"
    and diag: "isDiagonal B" and i: "i < min (nrows A) (ncols A)"
  shows "B' = P'**A**Q' \<and> invertible P' \<and> invertible Q' \<and> B' = Diagonal_to_Smith_row_i B i bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = Diagonal_to_Smith_row_i B i bezout
[PROOF STEP]
using assms Diagonal_to_Smith_row_i_PQ' Diagonal_to_Smith_row_i_PQ_eq
[PROOF STATE]
proof (prove)
using this:
(P', B', Q') = Diagonal_to_Smith_row_i_PQ i bezout (P, B, Q)
isDiagonal B
i < min (nrows A) (ncols A)
\<lbrakk>(?P', ?B', ?Q') = Diagonal_to_Smith_row_i_PQ ?i bezout (P, B, Q); isDiagonal B; ?i < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> ?B' = ?P' ** A ** ?Q' \<and> invertible ?P' \<and> invertible ?Q'
\<lbrakk>(?P', ?B', ?Q') = Diagonal_to_Smith_row_i_PQ ?i bezout (P, B, Q); isDiagonal B; ?i < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> ?B' = Diagonal_to_Smith_row_i B ?i bezout

goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = Diagonal_to_Smith_row_i B i bezout
[PROOF STEP]
by presburger


[STATEMENT]
lemma no_meet1:"A \<inter> B = {}\<Longrightarrow> \<forall>a \<in> A. a \<notin> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B = {} \<Longrightarrow> \<forall>a\<in>A. a \<notin> B
[PROOF STEP]
by blast


[STATEMENT]
lemma projection_orthogonal:
  fixes M :: \<open>'a::chilbert_space set\<close>
  assumes "closed_csubspace M" and \<open>m \<in> M\<close>
  shows \<open>is_orthogonal (h - projection M h) m\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_orthogonal (h - projection M h) m
[PROOF STEP]
by (metis assms(1) assms(2) closed_csubspace.closed closed_csubspace.subspace csubspace_is_convex empty_iff is_projection_on_iff_orthog orthogonal_complement_orthoI projection_is_projection_on)


[STATEMENT]
lemma finiteSupgroup: "finite H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite H
[PROOF STEP]
using good_ordSupgrp good_card_imp_finite
[PROOF STATE]
proof (prove)
using this:
ordH \<noteq> (0::'f)
of_nat (card ?A) \<noteq> (0::?'a) \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite H
[PROOF STEP]
by fast


[STATEMENT]
lemma EM_remainder_eqI:
  fixes L
  assumes "((\<lambda>x. EM_remainder' n f b (of_int x)) \<longlongrightarrow> L) at_top"
  shows   "EM_remainder n f b = L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EM_remainder n f b = L
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. EM_remainder' n f (real_of_int b) (real_of_int x)) \<longlongrightarrow> L) at_top

goal (1 subgoal):
 1. EM_remainder n f b = L
[PROOF STEP]
by (auto simp: EM_remainder_def EM_remainder_converges_def intro!: tendsto_Lim)


[STATEMENT]
lemma bind_fv2_subst_bv1_eq_subst_term:
  assumes "\<not>loose_bvar t n" "is_closed b"
  shows "subst_term [((idn,T),b)] t = subst_bv1 (bind_fv2 (idn, T) n t) n b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term [((idn, T), b)] t = subst_bv1 (bind_fv2 (idn, T) n t) n b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> loose_bvar t n
is_closed b

goal (1 subgoal):
 1. subst_term [((idn, T), b)] t = subst_bv1 (bind_fv2 (idn, T) n t) n b
[PROOF STEP]
by (induction t arbitrary: n idn T b) (auto simp add: is_open_def incr_boundvars_def)


[STATEMENT]
lemma divide_right:
  assumes "eventually (\<lambda>x. h x \<noteq> 0) F"
  assumes "f \<in> L F (g)"
  shows   "(\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x / h x) \<in> L F (\<lambda>x. g x / h x)
[PROOF STEP]
by (subst (1 2) divide_inverse) (intro mult_right inverse assms)


[STATEMENT]
lemma chain_tllist_terminal:
  assumes "Complete_Partial_Order.chain tllist_ord A"
  shows "Complete_Partial_Order.chain (flat_ord b) {terminal xs|xs. xs \<in> A \<and> tfinite xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complete_Partial_Order.chain (flat_ord b) {terminal xs |xs. xs \<in> A \<and> tfinite xs}
[PROOF STEP]
by(rule chainI)(auto simp add: tllist_ord.rep_eq flat_ord_def dest: chainD[OF assms])


[STATEMENT]
lemma converse_nreachable_induct[consumes 1, case_names base step, induct pred: reachable]:
  assumes major: "u \<rightarrow>\<^bsup>n\<^esup>\<^bsub>G\<^esub> v"
    and cases: "v \<in> verts G \<Longrightarrow> P 0 v"
       "\<And>n x y. \<lbrakk>x \<rightarrow>\<^bsub>G\<^esub> y; y \<rightarrow>\<^bsup>n\<^esup>\<^bsub>G\<^esub> v; P n y\<rbrakk> \<Longrightarrow> P (Suc n) x"
  shows "P n u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<rightarrow>\<^bsup>n\<^esup> v
v \<in> verts G \<Longrightarrow> P 0 v
\<lbrakk>?x2 \<rightarrow> ?y2; ?y2 \<rightarrow>\<^bsup>?n2\<^esup> v; P ?n2 ?y2\<rbrakk> \<Longrightarrow> P (Suc ?n2) ?x2

goal (1 subgoal):
 1. P n u
[PROOF STEP]
unfolding nreachable_def
[PROOF STATE]
proof (prove)
using this:
ntrancl_onp (verts G) (arcs_ends G) n u v
v \<in> verts G \<Longrightarrow> P 0 v
\<lbrakk>?x2 \<rightarrow> ?y2; ntrancl_onp (verts G) (arcs_ends G) ?n2 ?y2 v; P ?n2 ?y2\<rbrakk> \<Longrightarrow> P (Suc ?n2) ?x2

goal (1 subgoal):
 1. P n u
[PROOF STEP]
by induct auto


[STATEMENT]
lemma knights_path_max2: "knights_path (board n m) ps \<Longrightarrow> max2 ps = int m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> max2 ps = int m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> max2 ps = int m
[PROOF STEP]
assume assms: "knights_path (board n m) ps"
[PROOF STATE]
proof (state)
this:
knights_path (board n m) ps

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> max2 ps = int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
knights_path (board n m) ps
[PROOF STEP]
have "min n m \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
knights_path (board n m) ps

goal (1 subgoal):
 1. 1 \<le> min n m
[PROOF STEP]
using knights_path_board_m_n_geq_1
[PROOF STATE]
proof (prove)
using this:
knights_path (board n m) ps
knights_path (board ?n ?m) ?ps \<Longrightarrow> 1 \<le> min ?n ?m

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

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> max2 ps = int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> min n m
[PROOF STEP]
have "(1,int m) \<in> board n m" and leq_m: "\<forall>(i,j) \<in> board n m. j \<le> int m"
[PROOF STATE]
proof (prove)
using this:
1 \<le> min n m

goal (1 subgoal):
 1. (1, int m) \<in> board n m &&& \<forall>(i, j)\<in>board n m. j \<le> int m
[PROOF STEP]
unfolding board_def
[PROOF STATE]
proof (prove)
using this:
1 \<le> min n m

goal (1 subgoal):
 1. (1, int m) \<in> {(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m} &&& \<forall>(i, j)\<in>{(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m}. j \<le> int m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1, int m) \<in> board n m
\<forall>(i, j)\<in>board n m. j \<le> int m

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> max2 ps = int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1, int m) \<in> board n m
\<forall>(i, j)\<in>board n m. j \<le> int m
[PROOF STEP]
have finite: "finite ((snd) ` board n m)" and
          non_empty: "(snd) ` board n m \<noteq> {}" and
          mem_1: "int m \<in> (snd) ` board n m"
[PROOF STATE]
proof (prove)
using this:
(1, int m) \<in> board n m
\<forall>(i, j)\<in>board n m. j \<le> int m

goal (1 subgoal):
 1. finite (snd ` board n m) &&& snd ` board n m \<noteq> {} &&& int m \<in> snd ` board n m
[PROOF STEP]
using board_finite
[PROOF STATE]
proof (prove)
using this:
(1, int m) \<in> board n m
\<forall>(i, j)\<in>board n m. j \<le> int m
finite (board ?n ?m)

goal (1 subgoal):
 1. finite (snd ` board n m) &&& snd ` board n m \<noteq> {} &&& int m \<in> snd ` board n m
[PROOF STEP]
by auto (metis sndI image_eqI)
[PROOF STATE]
proof (state)
this:
finite (snd ` board n m)
snd ` board n m \<noteq> {}
int m \<in> snd ` board n m

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> max2 ps = int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (snd ` board n m)
snd ` board n m \<noteq> {}
int m \<in> snd ` board n m
[PROOF STEP]
have "Max ((snd) ` board n m) = int m"
[PROOF STATE]
proof (prove)
using this:
finite (snd ` board n m)
snd ` board n m \<noteq> {}
int m \<in> snd ` board n m

goal (1 subgoal):
 1. Max (snd ` board n m) = int m
[PROOF STEP]
using leq_m
[PROOF STATE]
proof (prove)
using this:
finite (snd ` board n m)
snd ` board n m \<noteq> {}
int m \<in> snd ` board n m
\<forall>(i, j)\<in>board n m. j \<le> int m

goal (1 subgoal):
 1. Max (snd ` board n m) = int m
[PROOF STEP]
by (auto simp: Max_eq_iff)
[PROOF STATE]
proof (state)
this:
Max (snd ` board n m) = int m

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> max2 ps = int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Max (snd ` board n m) = int m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Max (snd ` board n m) = int m

goal (1 subgoal):
 1. max2 ps = int m
[PROOF STEP]
using assms knights_path_set_eq
[PROOF STATE]
proof (prove)
using this:
Max (snd ` board n m) = int m
knights_path (board n m) ps
knights_path ?b ?ps \<Longrightarrow> set ?ps = ?b

goal (1 subgoal):
 1. max2 ps = int m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max2 ps = int m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma epis_compose [intro]:
     assumes "epi e" and "epi e'" and "seq e' e"
     shows "epi (e' \<cdot> e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. epi (e' \<cdot> e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. epi (e' \<cdot> e)
[PROOF STEP]
have "inj_on (\<lambda>g. g \<cdot> (e' \<cdot> e)) {g. seq g (e' \<cdot> e)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>g. g \<cdot> e' \<cdot> e) {g. seq g (e' \<cdot> e)}
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{g. seq g (e' \<cdot> e)}. \<forall>y\<in>{g. seq g (e' \<cdot> e)}. x \<cdot> e' \<cdot> e = y \<cdot> e' \<cdot> e \<longrightarrow> x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
epi e
epi e'
seq e' e

goal (1 subgoal):
 1. \<forall>x\<in>{g. seq g (e' \<cdot> e)}. \<forall>y\<in>{g. seq g (e' \<cdot> e)}. x \<cdot> e' \<cdot> e = y \<cdot> e' \<cdot> e \<longrightarrow> x = y
[PROOF STEP]
by (metis CollectD epiE match_2 comp_assoc)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>g. g \<cdot> e' \<cdot> e) {g. seq g (e' \<cdot> e)}

goal (1 subgoal):
 1. epi (e' \<cdot> e)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>g. g \<cdot> e' \<cdot> e) {g. seq g (e' \<cdot> e)}

goal (1 subgoal):
 1. epi (e' \<cdot> e)
[PROOF STEP]
using assms(3) epi_def
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>g. g \<cdot> e' \<cdot> e) {g. seq g (e' \<cdot> e)}
seq e' e
epi ?f = (arr ?f \<and> inj_on (\<lambda>g. g \<cdot> ?f) {g. seq g ?f})

goal (1 subgoal):
 1. epi (e' \<cdot> e)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
epi (e' \<cdot> e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_mult_right_mono:
  fixes a b c :: ereal
  assumes "a \<le> b" "0 \<le> c"
  shows "a * c \<le> b * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c \<le> b * c
[PROOF STEP]
proof (cases "c = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> a * c \<le> b * c
 2. c \<noteq> 0 \<Longrightarrow> a * c \<le> b * c
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> a * c \<le> b * c
 2. c \<noteq> 0 \<Longrightarrow> a * c \<le> b * c
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<le> b
0 \<le> c
c \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<le> b
0 \<le> c
c \<noteq> 0

goal (1 subgoal):
 1. a * c \<le> b * c
[PROOF STEP]
by (cases rule: ereal3_cases[of a b c]) auto
[PROOF STATE]
proof (state)
this:
a * c \<le> b * c

goal (1 subgoal):
 1. c = 0 \<Longrightarrow> a * c \<le> b * c
[PROOF STEP]
qed auto


[STATEMENT]
lemma mix_in_lot:
  assumes "x \<in> lotteries_on outcomes"
    and "y \<in> lotteries_on outcomes"
    and "\<alpha> \<in> {0..1}"
  shows "(mix_pmf \<alpha> x y) \<in> lotteries_on outcomes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mix_pmf \<alpha> x y \<in> lotteries_on outcomes
[PROOF STEP]
using assms(1) assms(2) assms(3) less_eq_real_def mix_pmf_in_lotteries
[PROOF STATE]
proof (prove)
using this:
x \<in> lotteries_on outcomes
y \<in> lotteries_on outcomes
\<alpha> \<in> {0..1}
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
\<lbrakk>?p \<in> lotteries_on ?A; ?q \<in> lotteries_on ?A; ?a \<in> {0<..<1}\<rbrakk> \<Longrightarrow> mix_pmf ?a ?p ?q \<in> lotteries_on ?A

goal (1 subgoal):
 1. mix_pmf \<alpha> x y \<in> lotteries_on outcomes
[PROOF STEP]
by fastforce


[STATEMENT]
lemma pointwise_natUnion_swap:
  assumes pointwise_f: "pointwise f"
  shows "f (natUnion G) = natUnion (\<lambda> u. f (G u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (natUnion G) = natUnion (\<lambda>u. f (G u))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (natUnion G) = natUnion (\<lambda>u. f (G u))
[PROOF STEP]
note f_simp = pointwise_simp[OF pointwise_f]
[PROOF STATE]
proof (state)
this:
f ?X = \<Union> {f {x} |x. x \<in> ?X}

goal (1 subgoal):
 1. f (natUnion G) = natUnion (\<lambda>u. f (G u))
[PROOF STEP]
have h1: "f (natUnion G) = \<Union> {f {x} |x. x \<in> (natUnion G)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (natUnion G) = \<Union> {f {x} |x. x \<in> natUnion G}
[PROOF STEP]
using f_simp
[PROOF STATE]
proof (prove)
using this:
f ?X = \<Union> {f {x} |x. x \<in> ?X}

goal (1 subgoal):
 1. f (natUnion G) = \<Union> {f {x} |x. x \<in> natUnion G}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f (natUnion G) = \<Union> {f {x} |x. x \<in> natUnion G}

goal (1 subgoal):
 1. f (natUnion G) = natUnion (\<lambda>u. f (G u))
[PROOF STEP]
have h2: "\<And> x. f (G x) =  \<Union> {f {y} |y. y \<in> G x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f (G x) = \<Union> {f {y} |y. y \<in> G x}
[PROOF STEP]
using f_simp
[PROOF STATE]
proof (prove)
using this:
f ?X = \<Union> {f {x} |x. x \<in> ?X}

goal (1 subgoal):
 1. \<And>x. f (G x) = \<Union> {f {y} |y. y \<in> G x}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
f (G ?x) = \<Union> {f {y} |y. y \<in> G ?x}

goal (1 subgoal):
 1. f (natUnion G) = natUnion (\<lambda>u. f (G u))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (natUnion G) = natUnion (\<lambda>u. f (G u))
[PROOF STEP]
apply (subst h1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {f {x} |x. x \<in> natUnion G} = natUnion (\<lambda>u. f (G u))
[PROOF STEP]
apply (subst h2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {f {x} |x. x \<in> natUnion G} = natUnion (\<lambda>u. \<Union> {f {y} |y. y \<in> G u})
[PROOF STEP]
apply (simp add: natUnion_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {f {x} |x. \<exists>xa. (\<exists>n. xa = G n) \<and> x \<in> xa} = \<Union> {uu_. \<exists>n. uu_ = \<Union> {f {y} |y. y \<in> G n}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f (natUnion G) = natUnion (\<lambda>u. f (G u))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DirProds_finite_imp_finite_groups:
  assumes "finite_group (DirProds G I)" "finite I"
  shows "\<And>i. i\<in>I \<Longrightarrow> finite_group (G i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> finite_group (G i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> finite_group (G i)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> finite_group (G i)
[PROOF STEP]
assume i: "i \<in> I"
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> finite_group (G i)
[PROOF STEP]
interpret DP: finite_group "DirProds G I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_group (DirProds G I)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> finite_group (G i)
[PROOF STEP]
interpret group "G i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G i)
[PROOF STEP]
by (rule DirProds_group_imp_groups[OF DP.is_group i])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> finite_group (G i)
[PROOF STEP]
show "finite_group (G i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_group (G i)
[PROOF STEP]
proof(unfold_locales)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (carrier (G i))
[PROOF STEP]
have oDP: "order (DirProds G I) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (DirProds G I) \<noteq> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
order (DirProds G I) \<noteq> 0

goal (1 subgoal):
 1. finite (carrier (G i))
[PROOF STEP]
with DirProds_order[OF assms(2), of G]
[PROOF STATE]
proof (chain)
picking this:
order (DirProds G I) = prod (order \<circ> G) I
order (DirProds G I) \<noteq> 0
[PROOF STEP]
have "order (G i) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
order (DirProds G I) = prod (order \<circ> G) I
order (DirProds G I) \<noteq> 0

goal (1 subgoal):
 1. order (G i) \<noteq> 0
[PROOF STEP]
using i assms(2)
[PROOF STATE]
proof (prove)
using this:
order (DirProds G I) = prod (order \<circ> G) I
order (DirProds G I) \<noteq> 0
i \<in> I
finite I

goal (1 subgoal):
 1. order (G i) \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
order (G i) \<noteq> 0

goal (1 subgoal):
 1. finite (carrier (G i))
[PROOF STEP]
thus "finite (carrier (G i))"
[PROOF STATE]
proof (prove)
using this:
order (G i) \<noteq> 0

goal (1 subgoal):
 1. finite (carrier (G i))
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
card (carrier (G i)) \<noteq> 0

goal (1 subgoal):
 1. finite (carrier (G i))
[PROOF STEP]
by (meson card_eq_0_iff)
[PROOF STATE]
proof (state)
this:
finite (carrier (G i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite_group (G i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_indets_injI:
  assumes "inj f"
  shows "inj (map_indets f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (map_indets f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj (map_indets f)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
inj f
[PROOF STEP]
have "inj_on (map_indets f) P[UNIV]"
[PROOF STATE]
proof (prove)
using this:
inj f

goal (1 subgoal):
 1. inj_on (map_indets f) P[UNIV]
[PROOF STEP]
by (rule map_indets_inj_on_PolysI)
[PROOF STATE]
proof (state)
this:
inj_on (map_indets f) P[UNIV]

goal (1 subgoal):
 1. inj (map_indets f)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (map_indets f) P[UNIV]

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma analz_synth [simp]: "analz (synth H) = analz H \<union> synth H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (synth H) = analz H \<union> synth H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. analz (synth H) = analz H \<union> synth H
[PROOF STEP]
have "\<forall>x\<^sub>2 x\<^sub>1. synth x\<^sub>1 \<union> analz (x\<^sub>1 \<union> x\<^sub>2) = analz (synth x\<^sub>1 \<union> x\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<^sub>2 x\<^sub>1. synth x\<^sub>1 \<union> analz (x\<^sub>1 \<union> x\<^sub>2) = analz (synth x\<^sub>1 \<union> x\<^sub>2)
[PROOF STEP]
by (metis Un_commute analz_synth_Un)
[PROOF STATE]
proof (state)
this:
\<forall>x\<^sub>2 x\<^sub>1. synth x\<^sub>1 \<union> analz (x\<^sub>1 \<union> x\<^sub>2) = analz (synth x\<^sub>1 \<union> x\<^sub>2)

goal (1 subgoal):
 1. analz (synth H) = analz H \<union> synth H
[PROOF STEP]
hence "\<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1 \<union> {})"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<^sub>2 x\<^sub>1. synth x\<^sub>1 \<union> analz (x\<^sub>1 \<union> x\<^sub>2) = analz (synth x\<^sub>1 \<union> x\<^sub>2)

goal (1 subgoal):
 1. \<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1 \<union> {})
[PROOF STEP]
by (metis Un_empty_right)
[PROOF STATE]
proof (state)
this:
\<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1 \<union> {})

goal (1 subgoal):
 1. analz (synth H) = analz H \<union> synth H
[PROOF STEP]
hence "\<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1 \<union> {})

goal (1 subgoal):
 1. \<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1)
[PROOF STEP]
by (metis Un_empty_right)
[PROOF STATE]
proof (state)
this:
\<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1)

goal (1 subgoal):
 1. analz (synth H) = analz H \<union> synth H
[PROOF STEP]
hence "\<forall>x\<^sub>1. analz x\<^sub>1 \<union> synth x\<^sub>1 = analz (synth x\<^sub>1)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<^sub>1. synth x\<^sub>1 \<union> analz x\<^sub>1 = analz (synth x\<^sub>1)

goal (1 subgoal):
 1. \<forall>x\<^sub>1. analz x\<^sub>1 \<union> synth x\<^sub>1 = analz (synth x\<^sub>1)
[PROOF STEP]
by (metis Un_commute)
[PROOF STATE]
proof (state)
this:
\<forall>x\<^sub>1. analz x\<^sub>1 \<union> synth x\<^sub>1 = analz (synth x\<^sub>1)

goal (1 subgoal):
 1. analz (synth H) = analz H \<union> synth H
[PROOF STEP]
thus "analz (synth H) = analz H \<union> synth H"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<^sub>1. analz x\<^sub>1 \<union> synth x\<^sub>1 = analz (synth x\<^sub>1)

goal (1 subgoal):
 1. analz (synth H) = analz H \<union> synth H
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
analz (synth H) = analz H \<union> synth H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integrable_subinterval:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  assumes "integrable (lebesgue_on {a..b}) f"
    and "{c..d} \<subseteq> {a..b}"
  shows "integrable (lebesgue_on {c..d}) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {c..d}) f
[PROOF STEP]
proof (rule absolutely_integrable_imp_integrable)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f absolutely_integrable_on {c..d}
 2. {c..d} \<in> sets lebesgue
[PROOF STEP]
show "f absolutely_integrable_on {c..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f absolutely_integrable_on {c..d}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f absolutely_integrable_on {c..d}
[PROOF STEP]
have "f integrable_on {c..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on {c..d}
[PROOF STEP]
using assms integrable_on_lebesgue_on integrable_on_subinterval
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on {a..b}) f
{c..d} \<subseteq> {a..b}
\<lbrakk>integrable (lebesgue_on ?S) ?f; ?S \<in> sets lebesgue\<rbrakk> \<Longrightarrow> ?f integrable_on ?S
\<lbrakk>?f integrable_on ?S; {?a..?b} \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f integrable_on {?a..?b}

goal (1 subgoal):
 1. f integrable_on {c..d}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f integrable_on {c..d}

goal (1 subgoal):
 1. f absolutely_integrable_on {c..d}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f integrable_on {c..d}

goal (1 subgoal):
 1. f absolutely_integrable_on {c..d}
[PROOF STEP]
have "(\<lambda>x. norm (f x)) integrable_on {c..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (f x)) integrable_on {c..d}
[PROOF STEP]
proof (rule integrable_on_subinterval)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. norm (f x)) integrable_on ?S
 2. {c..d} \<subseteq> ?S
[PROOF STEP]
show "(\<lambda>x. norm (f x)) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (f x)) integrable_on {a..b}
[PROOF STEP]
by (simp add: assms integrable_on_lebesgue_on)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. norm (f x)) integrable_on {a..b}

goal (1 subgoal):
 1. {c..d} \<subseteq> {a..b}
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. norm (f x)) integrable_on {c..d}

goal (1 subgoal):
 1. f absolutely_integrable_on {c..d}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f integrable_on {c..d}
(\<lambda>x. norm (f x)) integrable_on {c..d}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f integrable_on {c..d}
(\<lambda>x. norm (f x)) integrable_on {c..d}

goal (1 subgoal):
 1. f absolutely_integrable_on {c..d}
[PROOF STEP]
by (auto simp: absolutely_integrable_on_def)
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on {c..d}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on {c..d}

goal (1 subgoal):
 1. {c..d} \<in> sets lebesgue
[PROOF STEP]
qed auto


[STATEMENT]
lemma finite_set_min_param_ex :
  assumes "finite XS"
  and     "\<And> x . x \<in> XS \<Longrightarrow> \<exists> k . \<forall> k' . k \<le> k' \<longrightarrow> P x k'"
shows "\<exists> (k::nat) . \<forall> x \<in> XS . P x k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. \<forall>x\<in>XS. P x k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k. \<forall>x\<in>XS. P x k
[PROOF STEP]
obtain f where f_def : "\<And> x . x \<in> XS \<Longrightarrow> \<forall> k' . (f x) \<le> k' \<longrightarrow> P x k'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. (\<And>x. x \<in> XS \<Longrightarrow> \<forall>k'\<ge>f x. P x k') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
?x \<in> XS \<Longrightarrow> \<exists>k. \<forall>k'\<ge>k. P ?x k'

goal (1 subgoal):
 1. (\<And>f. (\<And>x. x \<in> XS \<Longrightarrow> \<forall>k'\<ge>f x. P x k') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
?x \<in> XS \<Longrightarrow> \<forall>k'\<ge>f ?x. P ?x k'

goal (1 subgoal):
 1. \<exists>k. \<forall>x\<in>XS. P x k
[PROOF STEP]
let ?k = "Max (image f XS)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k. \<forall>x\<in>XS. P x k
[PROOF STEP]
have "\<forall> x \<in> XS . P x ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>XS. P x (Max (f ` XS))
[PROOF STEP]
using f_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> XS \<Longrightarrow> \<forall>k'\<ge>f ?x. P ?x k'

goal (1 subgoal):
 1. \<forall>x\<in>XS. P x (Max (f ` XS))
[PROOF STEP]
by (simp add: assms(1))
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>XS. P x (Max (f ` XS))

goal (1 subgoal):
 1. \<exists>k. \<forall>x\<in>XS. P x k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>XS. P x (Max (f ` XS))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>XS. P x (Max (f ` XS))

goal (1 subgoal):
 1. \<exists>k. \<forall>x\<in>XS. P x k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. \<forall>x\<in>XS. P x k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma estimate_by_abs:
  fixes a b c :: "'a::lattice_ab_group_add_abs"
  assumes "a + b \<le> c"
  shows "a \<le> c + \<bar>b\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> c + \<bar>b\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<le> c + \<bar>b\<bar>
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a + b \<le> c
[PROOF STEP]
have "a \<le> c + (- b)"
[PROOF STATE]
proof (prove)
using this:
a + b \<le> c

goal (1 subgoal):
 1. a \<le> c + - b
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
a \<le> c + - b

goal (1 subgoal):
 1. a \<le> c + \<bar>b\<bar>
[PROOF STEP]
have "- b \<le> \<bar>b\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - b \<le> \<bar>b\<bar>
[PROOF STEP]
by (rule abs_ge_minus_self)
[PROOF STATE]
proof (state)
this:
- b \<le> \<bar>b\<bar>

goal (1 subgoal):
 1. a \<le> c + \<bar>b\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- b \<le> \<bar>b\<bar>
[PROOF STEP]
have "c + (- b) \<le> c + \<bar>b\<bar>"
[PROOF STATE]
proof (prove)
using this:
- b \<le> \<bar>b\<bar>

goal (1 subgoal):
 1. c + - b \<le> c + \<bar>b\<bar>
[PROOF STEP]
by (rule add_left_mono)
[PROOF STATE]
proof (state)
this:
c + - b \<le> c + \<bar>b\<bar>

goal (1 subgoal):
 1. a \<le> c + \<bar>b\<bar>
[PROOF STEP]
with \<open>a \<le> c + (- b)\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<le> c + - b
c + - b \<le> c + \<bar>b\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<le> c + - b
c + - b \<le> c + \<bar>b\<bar>

goal (1 subgoal):
 1. a \<le> c + \<bar>b\<bar>
[PROOF STEP]
by (rule order_trans)
[PROOF STATE]
proof (state)
this:
a \<le> c + \<bar>b\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_rat_eq_1_iff [simp]: "of_rat a = 1 \<longleftrightarrow> a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat a = (1::'a)) = (a = 1)
[PROOF STEP]
using of_rat_eq_iff [of _ 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat ?a = of_rat 1) = (?a = 1)

goal (1 subgoal):
 1. (of_rat a = (1::'a)) = (a = 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma listt_update_in_list [simp, intro!]:
  "\<lbrakk> xs \<in> list n A; x\<in> A \<rbrakk> \<Longrightarrow> xs[i := x] \<in> list n A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> list n A; x \<in> A\<rbrakk> \<Longrightarrow> xs[i := x] \<in> list n A
[PROOF STEP]
apply (unfold list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> {xs. length xs = n \<and> set xs \<subseteq> A}; x \<in> A\<rbrakk> \<Longrightarrow> xs[i := x] \<in> {xs. length xs = n \<and> set xs \<subseteq> A}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma aboveS_Field: "aboveS r a \<le> Field r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aboveS r a \<subseteq> Field r
[PROOF STEP]
by(unfold aboveS_def Field_def, auto)


[STATEMENT]
lemma ideal_Inter:
  assumes "\<forall>I\<in>S. ideal I"
  shows "ideal (\<Inter>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal (\<Inter> S)
[PROOF STEP]
proof (unfold ideal_def left_ideal_def right_ideal_def, auto)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. subgroup (\<Inter> S)
 2. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> r * x \<in> xa
 3. subgroup (\<Inter> S)
 4. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
show "subgroup (\<Inter>S)" and "subgroup (\<Inter>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (\<Inter> S) &&& subgroup (\<Inter> S)
[PROOF STEP]
using subgroup_Inter assms
[PROOF STATE]
proof (prove)
using this:
\<forall>I\<in>?S. subgroup I \<Longrightarrow> subgroup (\<Inter> ?S)
\<forall>I\<in>S. ideal I

goal (1 subgoal):
 1. subgroup (\<Inter> S) &&& subgroup (\<Inter> S)
[PROOF STEP]
unfolding ideal_def left_ideal_def
[PROOF STATE]
proof (prove)
using this:
\<forall>I\<in>?S. subgroup I \<Longrightarrow> subgroup (\<Inter> ?S)
\<forall>I\<in>S. (subgroup I \<and> (\<forall>x\<in>I. \<forall>r. r * x \<in> I)) \<and> right_ideal I

goal (1 subgoal):
 1. subgroup (\<Inter> S) &&& subgroup (\<Inter> S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subgroup (\<Inter> S)
subgroup (\<Inter> S)

goal (2 subgoals):
 1. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> r * x \<in> xa
 2. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
fix x r xa
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> r * x \<in> xa
 2. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
assume X: "\<forall>X\<in>S. x \<in> X" and xa: "xa \<in> S"
[PROOF STATE]
proof (state)
this:
\<forall>X\<in>S. x \<in> X
xa \<in> S

goal (2 subgoals):
 1. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> r * x \<in> xa
 2. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
show "r * x \<in> xa"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * x \<in> xa
[PROOF STEP]
by (metis X assms ideal_def left_ideal_def xa)
[PROOF STATE]
proof (state)
this:
r * x \<in> xa

goal (1 subgoal):
 1. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
fix x r xa
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
assume X: "\<forall>X\<in>S. x \<in> X" and xa: "xa \<in> S"
[PROOF STATE]
proof (state)
this:
\<forall>X\<in>S. x \<in> X
xa \<in> S

goal (1 subgoal):
 1. \<And>x r xa. \<lbrakk>\<forall>X\<in>S. x \<in> X; xa \<in> S\<rbrakk> \<Longrightarrow> x * r \<in> xa
[PROOF STEP]
show "x * r \<in> xa"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * r \<in> xa
[PROOF STEP]
by (metis X assms ideal_def right_ideal_def xa)
[PROOF STATE]
proof (state)
this:
x * r \<in> xa

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma clamp_continuous_on:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::metric_space"
  assumes f_cont: "continuous_on (cbox a b) f"
  shows "continuous_on S (\<lambda>x. f (clamp a b x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f (clamp a b x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) f

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f (clamp a b x))
[PROOF STEP]
by (auto intro: continuous_at_imp_continuous_on clamp_continuous_at)


[STATEMENT]
lemma tftf_4: assumes dx: "dim_vec x = 4"
  and be: "x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = False"
  shows "ceros_of_boolean_input x = {1,3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {1, 3}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = False

goal (1 subgoal):
 1. ceros_of_boolean_input x = {1, 3}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = False

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {1, 3}
[PROOF STEP]
using less_4_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = False
?n < 4 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2 \<or> ?n = 3

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {1, 3}
[PROOF STEP]
by auto


[STATEMENT]
lemma basis_enum_of_vec_unit_vec:
  defines "basis \<equiv> (canonical_basis::'a::basis_enum list)"
    and "n \<equiv> length (canonical_basis :: 'a list)"
  assumes a3: "i < n"
  shows "basis_enum_of_vec (unit_vec n i) = basis!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
define L::"complex list" where "L = list_of_vec (unit_vec n i)"
[PROOF STATE]
proof (state)
this:
L = list_of_vec (unit_vec n i)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
define I::"nat list" where "I = [0..<n]"
[PROOF STATE]
proof (state)
this:
I = [0..<n]

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
have "length L = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length L = n
[PROOF STEP]
by (simp add: L_def)
[PROOF STATE]
proof (state)
this:
length L = n

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length L = n

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
have "length basis = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length basis = n
[PROOF STEP]
by (simp add: basis_def n_def)
[PROOF STATE]
proof (state)
this:
length basis = n

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length L = n
length basis = n
[PROOF STEP]
have "map2 (*\<^sub>C) L basis = map (\<lambda>j. L!j *\<^sub>C basis!j) I"
[PROOF STATE]
proof (prove)
using this:
length L = n
length basis = n

goal (1 subgoal):
 1. map2 (*\<^sub>C) L basis = map (\<lambda>j. L ! j *\<^sub>C basis ! j) I
[PROOF STEP]
by (simp add: I_def list_eq_iff_nth_eq)
[PROOF STATE]
proof (state)
this:
map2 (*\<^sub>C) L basis = map (\<lambda>j. L ! j *\<^sub>C basis ! j) I

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
hence "sum_list (map2 (*\<^sub>C) L basis) = sum_list (map (\<lambda>j. L!j *\<^sub>C basis!j) I)"
[PROOF STATE]
proof (prove)
using this:
map2 (*\<^sub>C) L basis = map (\<lambda>j. L ! j *\<^sub>C basis ! j) I

goal (1 subgoal):
 1. sum_list (map2 (*\<^sub>C) L basis) = (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (map2 (*\<^sub>C) L basis) = (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map2 (*\<^sub>C) L basis) = (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
have "\<dots> = sum (\<lambda>j. L!j *\<^sub>C basis!j) {0..n-1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)
[PROOF STEP]
have "set I = {0..n-1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set I = {0..n - 1}
[PROOF STEP]
using I_def a3
[PROOF STATE]
proof (prove)
using this:
I = [0..<n]
i < n

goal (1 subgoal):
 1. set I = {0..n - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set I = {0..n - 1}

goal (1 subgoal):
 1. (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
set I = {0..n - 1}

goal (1 subgoal):
 1. (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)
[PROOF STEP]
using Groups_List.sum_code[where xs = I and g = "(\<lambda>j. L!j *\<^sub>C basis!j)"]
[PROOF STATE]
proof (prove)
using this:
set I = {0..n - 1}
(\<Sum>j\<in>set I. L ! j *\<^sub>C basis ! j) = (\<Sum>j\<leftarrow>remdups I. L ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. (\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)
[PROOF STEP]
by (simp add: I_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<leftarrow>I. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
have "\<dots> = sum (\<lambda>j. (list_of_vec (unit_vec n i))!j *\<^sub>C basis!j) {0..n-1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
unfolding L_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. L ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (map2 (*\<^sub>C) L basis) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
have "sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis)
       = sum (\<lambda>j. (list_of_vec (unit_vec n i))!j *\<^sub>C basis!j) {0..n-1}"
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (*\<^sub>C) L basis) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
using L_def
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (*\<^sub>C) L basis) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
L = list_of_vec (unit_vec n i)

goal (1 subgoal):
 1. sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
have "\<dots> = basis ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
have "(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) =
          (\<Sum>j \<in> {0..n - 1}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
have "\<dots> = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
               + (\<Sum>j \<in> {0..n - 1}-{i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
define a where "a j = list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j" for j
[PROOF STATE]
proof (state)
this:
a ?j = list_of_vec (unit_vec n i) ! ?j *\<^sub>C basis ! ?j

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
define S where "S = {0..n - 1}"
[PROOF STATE]
proof (state)
this:
S = {0..n - 1}

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
have "finite S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S
[PROOF STEP]
by (simp add: S_def)
[PROOF STATE]
proof (state)
this:
finite S

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
hence "(\<Sum>j \<in> insert i S. a j) = a i + (\<Sum>j\<in>S-{i}. a j)"
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. sum a (insert i S) = a i + sum a (S - {i})
[PROOF STEP]
using Groups_Big.comm_monoid_add_class.sum.insert_remove
[PROOF STATE]
proof (prove)
using this:
finite S
finite ?A \<Longrightarrow> sum ?g (insert ?x ?A) = ?g ?x + sum ?g (?A - {?x})

goal (1 subgoal):
 1. sum a (insert i S) = a i + sum a (S - {i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum a (insert i S) = a i + sum a (S - {i})

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum a (insert i S) = a i + sum a (S - {i})

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
have "S-{i} = {0..n-1}-{i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S - {i} = {0..n - 1} - {i}
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..n - 1} - {i} = {0..n - 1} - {i}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S - {i} = {0..n - 1} - {i}

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S - {i} = {0..n - 1} - {i}

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
have "insert i S = {0..n-1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert i S = {0..n - 1}
[PROOF STEP]
using S_def Suc_diff_1 a3 atLeastAtMost_iff diff_is_0_eq' le_SucE le_numeral_extra(4)
          less_imp_le not_gr_zero
[PROOF STATE]
proof (prove)
using this:
S = {0..n - 1}
0 < ?n \<Longrightarrow> Suc (?n - 1) = ?n
i < n
(?i \<in> {?l..?u}) = (?l \<le> ?i \<and> ?i \<le> ?u)
?m \<le> ?n \<Longrightarrow> ?m - ?n = 0
\<lbrakk>?m \<le> Suc ?n; ?m \<le> ?n \<Longrightarrow> ?R; ?m = Suc ?n \<Longrightarrow> ?R\<rbrakk> \<Longrightarrow> ?R
(1::?'a) \<le> (1::?'a)
?x < ?y \<Longrightarrow> ?x \<le> ?y
(\<not> (0::?'a) < ?n) = (?n = (0::?'a))

goal (1 subgoal):
 1. insert i S = {0..n - 1}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
insert i S = {0..n - 1}

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum a (insert i S) = a i + sum a (S - {i})
S - {i} = {0..n - 1} - {i}
insert i S = {0..n - 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum a (insert i S) = a i + sum a (S - {i})
S - {i} = {0..n - 1} - {i}
insert i S = {0..n - 1}

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
using \<open>a \<equiv> \<lambda>j. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j\<close>
[PROOF STATE]
proof (prove)
using this:
sum a (insert i S) = a i + sum a (S - {i})
S - {i} = {0..n - 1} - {i}
insert i S = {0..n - 1}
a \<equiv> \<lambda>j. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
have "\<dots> = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
[PROOF STEP]
have "j \<in> {0..n - 1}-{i} \<Longrightarrow> list_of_vec (unit_vec n i) ! j = 0"
        for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! j = (0::'b)
[PROOF STEP]
using a3 atMost_atLeast0 atMost_iff diff_Suc_less index_unit_vec(1) le_less_trans
          list_of_vec_index member_remove zero_le
[PROOF STATE]
proof (prove)
using this:
i < n
{..?n} = {0..?n}
(?i \<in> {..?k}) = (?i \<le> ?k)
0 < ?n \<Longrightarrow> ?n - Suc ?i < ?n
\<lbrakk>?i < ?n; ?j < ?n\<rbrakk> \<Longrightarrow> unit_vec ?n ?i $ ?j = (if ?j = ?i then 1::?'a else (0::?'a))
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z
list_of_vec ?v ! ?j = ?v $ ?j
(?x \<in> Set.remove ?y ?A) = (?x \<in> ?A \<and> ?x \<noteq> ?y)
(0::?'a) \<le> ?x

goal (1 subgoal):
 1. j \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! j = (0::'b)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?j1 \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! ?j1 = (0::?'b2)

goal (1 subgoal):
 1. list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
[PROOF STEP]
hence "j \<in> {0..n - 1}-{i} \<Longrightarrow> list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j = 0"
        for j
[PROOF STATE]
proof (prove)
using this:
?j1 \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! ?j1 = (0::?'b2)

goal (1 subgoal):
 1. j \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?j1 \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! ?j1 *\<^sub>C basis ! ?j1 = (0::'a)

goal (1 subgoal):
 1. list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
[PROOF STEP]
hence "(\<Sum>j \<in> {0..n - 1}-{i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = 0"
[PROOF STATE]
proof (prove)
using this:
?j1 \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! ?j1 *\<^sub>C basis ! ?j1 = (0::'a)

goal (1 subgoal):
 1. (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = (0::'a)
[PROOF STEP]
by (simp add: \<open>\<And>j. j \<in> {0..n - 1} - {i} \<Longrightarrow> list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j = 0\<close>)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = (0::'a)

goal (1 subgoal):
 1. list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = (0::'a)

goal (1 subgoal):
 1. list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
have "\<dots> = basis ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i = basis ! i
[PROOF STEP]
by (simp add: a3)
[PROOF STATE]
proof (state)
this:
list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i = basis ! i

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
basis ! i = basis ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
basis ! i = basis ! i

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
using \<open>(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
             = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)\<close>
        \<open>list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
           = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i\<close>
        \<open>list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i = basis ! i\<close>
[PROOF STATE]
proof (prove)
using this:
basis ! i = basis ! i
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j)
list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i + (\<Sum>j\<in>{0..n - 1} - {i}. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i
list_of_vec (unit_vec n i) ! i *\<^sub>C basis ! i = basis ! i

goal (1 subgoal):
 1. (\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n - 1. list_of_vec (unit_vec n i) ! j *\<^sub>C basis ! j) = basis ! i

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = basis ! i
[PROOF STEP]
have "sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis)
      = basis ! i"
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = basis ! i

goal (1 subgoal):
 1. sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = basis ! i
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = basis ! i

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
hence "sum_list (map2 scaleC (list_of_vec (unit_vec n i)) (canonical_basis::'a list))
      = (canonical_basis::'a list) ! i"
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) basis) = basis ! i

goal (1 subgoal):
 1. sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) canonical_basis) = canonical_basis ! i
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) canonical_basis) = canonical_basis ! i

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) canonical_basis) = canonical_basis ! i

goal (1 subgoal):
 1. basis_enum_of_vec (unit_vec n i) = basis ! i
[PROOF STEP]
unfolding basis_enum_of_vec_def
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) canonical_basis) = canonical_basis ! i

goal (1 subgoal):
 1. (if dim_vec (unit_vec n i) = length canonical_basis then sum_list (map2 (*\<^sub>C) (list_of_vec (unit_vec n i)) canonical_basis) else (0::'a)) = basis ! i
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
basis_enum_of_vec (unit_vec n i) = basis ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r_distinguishable_k_intersection_paths :
  assumes "\<not>(\<exists> k . r_distinguishable_k M q1 q2 k)"
  and "q1 \<in> states M"
  and "q2 \<in> states M"
  shows "\<forall> xs . set xs \<subseteq> (inputs M) \<longrightarrow> (\<exists> p . path (product (from_FSM M q1) (from_FSM M q2)) (q1,q2) p \<and> map fst (p_io p) = xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall> xs . set xs \<subseteq> (inputs M) \<longrightarrow> (\<exists> p . path (product (from_FSM M q1) (from_FSM M q2)) (q1,q2) p \<and> map fst (p_io p) = xs))"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs))

goal (1 subgoal):
 1. \<not> (\<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs))
[PROOF STEP]
obtain xs where "set xs \<subseteq> (inputs M)"
                   and "\<not> (\<exists> p . path (product (from_FSM M q1) (from_FSM M q2)) (q1,q2) p \<and> map fst (p_io p) = xs)"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs))

goal (1 subgoal):
 1. (\<And>xs. \<lbrakk>set xs \<subseteq> FSM.inputs M; \<nexists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> FSM.inputs M
\<nexists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs

goal (1 subgoal):
 1. \<not> (\<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs)) \<Longrightarrow> False
[PROOF STEP]
have "\<not> r_distinguishable_k M q1 q2 (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> r_distinguishable_k M q1 q2 (length xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<nexists>k. r_distinguishable_k M q1 q2 k
q1 \<in> FSM.states M
q2 \<in> FSM.states M

goal (1 subgoal):
 1. \<not> r_distinguishable_k M q1 q2 (length xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> r_distinguishable_k M q1 q2 (length xs)

goal (1 subgoal):
 1. \<not> (\<forall>xs. set xs \<subseteq> FSM.inputs M \<longrightarrow> (\<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs)) \<Longrightarrow> False
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using r_distinguishable_k_intersection_path[OF \<open>\<not> r_distinguishable_k M q1 q2 (length xs)\<close> _ \<open>set xs \<subseteq> (inputs M)\<close> assms(2,3)]
          \<open>\<not> (\<exists> p . path (product (from_FSM M q1) (from_FSM M q2)) (q1,q2) p \<and> map fst (p_io p) = xs)\<close>
[PROOF STATE]
proof (prove)
using this:
length xs \<le> Suc (length xs) \<Longrightarrow> \<exists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs
\<nexists>p. path (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) (q1, q2) p \<and> map fst (p_io p) = xs

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inc_vec_index_zero_iff: "i < length Vs \<Longrightarrow> inc_vec_of Vs bl $ i = 0 \<longleftrightarrow> Vs ! i \<notin> bl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length Vs \<Longrightarrow> (inc_vec_of Vs bl $ i = (0::'b)) = (Vs ! i \<notin> bl)
[PROOF STEP]
by (auto simp add: inc_vec_of_def)


[STATEMENT]
lemma sums_mult2_iff:
  fixes f :: "nat \<Rightarrow> 'a::{real_normed_algebra,field}"
  assumes "c \<noteq> 0"
  shows   "(\<lambda>n. f n * c) sums (d * c) \<longleftrightarrow> f sums d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f n * c) sums (d * c) = f sums d
[PROOF STEP]
using sums_mult_iff[OF assms, of f d]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. c * f n) sums (c * d) = f sums d

goal (1 subgoal):
 1. (\<lambda>n. f n * c) sums (d * c) = f sums d
[PROOF STEP]
by (simp add: mult.commute)


[STATEMENT]
lemma Ana_subterm: assumes "Ana t = (K,T)" shows "set T \<subset> subterms t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set T \<subset> subterms t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Ana t = (K, T)

goal (1 subgoal):
 1. set T \<subset> subterms t
[PROOF STEP]
by (cases t)
   (simp add: psubsetI,
    metis Ana_fun_subterm Fun_gt_params UN_I term.order_refl
          params_subterms psubsetI subset_antisym subset_trans)


[STATEMENT]
theorem Done_Sbis[simp]:
"Done \<approx>s Done"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Done \<approx>s Done
[PROOF STEP]
using thetaSDone_Sbis
[PROOF STATE]
proof (prove)
using this:
thetaSDone \<subseteq> Sbis

goal (1 subgoal):
 1. Done \<approx>s Done
[PROOF STEP]
unfolding thetaSDone_def
[PROOF STATE]
proof (prove)
using this:
{(Done, Done)} \<subseteq> Sbis

goal (1 subgoal):
 1. Done \<approx>s Done
[PROOF STEP]
by auto


[STATEMENT]
lemma succ_rel_set_fst:
  shows "fst ` (succ_rel xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` succ_rel xs = set xs
[PROOF STEP]
by (induction xs rule: succ_rel.induct, auto)


[STATEMENT]
lemma slice_append_iff_take_drop1: "u \<noteq> [] \<Longrightarrow> v \<noteq> [] \<Longrightarrow>
  slice w i j = u @ v \<longleftrightarrow> (\<exists>k. 1 \<le> k \<and> k \<le> j-i-1 \<and> slice w i (i + k) = u \<and> slice w (i + k) j = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<noteq> []; v \<noteq> []\<rbrakk> \<Longrightarrow> (map w [i..<j] = u @ v) = (\<exists>k\<ge>1. k \<le> j - i - 1 \<and> map w [i..<i + k] = u \<and> map w [i + k..<j] = v)
[PROOF STEP]
by(subst append_iff_take_drop1) (auto simp: take_map drop_map Bex_def)


[STATEMENT]
lemma Qp_2I:
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "b \<in> carrier Q\<^sub>p"
  shows "[a,b] \<in> carrier (Q\<^sub>p\<^bsup>2\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a, b] \<in> carrier (Q\<^sub>p\<^bsup>2\<^esup>)
[PROOF STEP]
apply(rule cartesian_power_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length [a, b] = 2
 2. set [a, b] \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (2 subgoals):
 1. length [a, b] = 2
 2. set [a, b] \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
apply (simp add: assms(1) assms(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set [a, b] \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. set [a, b] \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
by (simp add: assms(1) assms(2))


[STATEMENT]
lemma SUP_eq_LIMSEQ:
  assumes "mono f"
  shows "(SUP n. ereal (f n)) = ereal x \<longleftrightarrow> f \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((SUP n. ereal (f n)) = ereal x) = f \<longlonglongrightarrow> x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
 2. f \<longlonglongrightarrow> x \<Longrightarrow> (SUP n. ereal (f n)) = ereal x
[PROOF STEP]
have inc: "incseq (\<lambda>i. ereal (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>i. ereal (f i))
[PROOF STEP]
using \<open>mono f\<close>
[PROOF STATE]
proof (prove)
using this:
incseq f

goal (1 subgoal):
 1. incseq (\<lambda>i. ereal (f i))
[PROOF STEP]
unfolding mono_def incseq_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x \<le> y \<longrightarrow> f x \<le> f y

goal (1 subgoal):
 1. \<forall>x y. x \<le> y \<longrightarrow> ereal (f x) \<le> ereal (f y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>i. ereal (f i))

goal (2 subgoals):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
 2. f \<longlonglongrightarrow> x \<Longrightarrow> (SUP n. ereal (f n)) = ereal x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>i. ereal (f i))

goal (2 subgoals):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
 2. f \<longlonglongrightarrow> x \<Longrightarrow> (SUP n. ereal (f n)) = ereal x
[PROOF STEP]
assume "f \<longlonglongrightarrow> x"
[PROOF STATE]
proof (state)
this:
f \<longlonglongrightarrow> x

goal (2 subgoals):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
 2. f \<longlonglongrightarrow> x \<Longrightarrow> (SUP n. ereal (f n)) = ereal x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<longlonglongrightarrow> x
[PROOF STEP]
have "(\<lambda>i. ereal (f i)) \<longlonglongrightarrow> ereal x"
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. (\<lambda>i. ereal (f i)) \<longlonglongrightarrow> ereal x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>i. ereal (f i)) \<longlonglongrightarrow> ereal x

goal (2 subgoals):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
 2. f \<longlonglongrightarrow> x \<Longrightarrow> (SUP n. ereal (f n)) = ereal x
[PROOF STEP]
from SUP_Lim[OF inc this]
[PROOF STATE]
proof (chain)
picking this:
(SUP n. ereal (f n)) = ereal x
[PROOF STEP]
show "(SUP n. ereal (f n)) = ereal x"
[PROOF STATE]
proof (prove)
using this:
(SUP n. ereal (f n)) = ereal x

goal (1 subgoal):
 1. (SUP n. ereal (f n)) = ereal x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(SUP n. ereal (f n)) = ereal x

goal (1 subgoal):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
[PROOF STEP]
assume "(SUP n. ereal (f n)) = ereal x"
[PROOF STATE]
proof (state)
this:
(SUP n. ereal (f n)) = ereal x

goal (1 subgoal):
 1. (SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x
[PROOF STEP]
with LIMSEQ_SUP[OF inc]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. ereal (f i)) \<longlonglongrightarrow> (SUP i. ereal (f i))
(SUP n. ereal (f n)) = ereal x
[PROOF STEP]
show "f \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. ereal (f i)) \<longlonglongrightarrow> (SUP i. ereal (f i))
(SUP n. ereal (f n)) = ereal x

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

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(SUP n. ereal (f n)) = ereal x \<Longrightarrow> f \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed