[STATEMENT]
lemma is_orthogonal_sgn_right[simp]: \<open>is_orthogonal e (sgn f) \<longleftrightarrow> is_orthogonal e f\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
proof (cases \<open>f = 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f = (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
 2. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f = (0::'a)

goal (2 subgoals):
 1. f = (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
 2. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f = (0::'a)

goal (1 subgoal):
 1. is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_orthogonal e (sgn f) = is_orthogonal e f

goal (1 subgoal):
 1. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<noteq> (0::'a)

goal (1 subgoal):
 1. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
have \<open>cinner e (sgn f) = cinner e f / norm f\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<bullet>\<^sub>C sgn f = e \<bullet>\<^sub>C f / complex_of_real (norm f)
[PROOF STEP]
by (simp add: sgn_div_norm divide_inverse scaleR_scaleC)
[PROOF STATE]
proof (state)
this:
e \<bullet>\<^sub>C sgn f = e \<bullet>\<^sub>C f / complex_of_real (norm f)

goal (1 subgoal):
 1. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
e \<bullet>\<^sub>C sgn f = e \<bullet>\<^sub>C f / complex_of_real (norm f)

goal (1 subgoal):
 1. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
have \<open>norm f \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm f \<noteq> 0
[PROOF STEP]
by (simp add: False)
[PROOF STATE]
proof (state)
this:
norm f \<noteq> 0

goal (1 subgoal):
 1. f \<noteq> (0::'a) \<Longrightarrow> is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
e \<bullet>\<^sub>C sgn f = e \<bullet>\<^sub>C f / complex_of_real (norm f)
norm f \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
e \<bullet>\<^sub>C sgn f = e \<bullet>\<^sub>C f / complex_of_real (norm f)
norm f \<noteq> 0

goal (1 subgoal):
 1. is_orthogonal e (sgn f) = is_orthogonal e f
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
is_orthogonal e (sgn f) = is_orthogonal e f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fresh_finite_insert:
  fixes S::"('a::fs) set"
  assumes fin:  "finite S"
  shows "a \<sharp> (insert x S) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sharp> insert x S = (a \<sharp> x \<and> a \<sharp> S)
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. a \<sharp> insert x S = (a \<sharp> x \<and> a \<sharp> S)
[PROOF STEP]
unfolding fresh_def
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. (a \<notin> supp (insert x S)) = (a \<notin> supp x \<and> a \<notin> supp S)
[PROOF STEP]
by (simp add: supp_of_finite_insert)


[STATEMENT]
lemma asymp_equiv_sandwich_real:
  fixes f g l u :: "'a \<Rightarrow> real"
  assumes "l \<sim>[F] g" "u \<sim>[F] g" "eventually (\<lambda>x. f x \<in> {l x..u x}) F"
  shows   "f \<sim>[F] g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<sim>[F] g
[PROOF STEP]
unfolding asymp_equiv_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - g x) \<in> o[F](g)
[PROOF STEP]
proof (rule landau_o.smallI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
fix c :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
assume c: "c > 0"
[PROOF STATE]
proof (state)
this:
0 < c

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
have "eventually (\<lambda>x. norm (f x - g x) \<le> max (norm (l x - g x)) (norm (u x - g x))) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x - g x) \<le> max (norm (l x - g x)) (norm (u x - g x))
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<in> {l x..u x}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x - g x) \<le> max (norm (l x - g x)) (norm (u x - g x))
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x - g x) \<le> max (norm (l x - g x)) (norm (u x - g x))

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x - g x) \<le> max (norm (l x - g x)) (norm (u x - g x))

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
have "eventually (\<lambda>x. norm (l x - g x) \<le> c * norm (g x)) F"
                "eventually (\<lambda>x. norm (u x - g x) \<le> c * norm (g x)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (l x - g x) \<le> c * norm (g x) &&& \<forall>\<^sub>F x in F. norm (u x - g x) \<le> c * norm (g x)
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
l \<sim>[F] g
u \<sim>[F] g

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (l x - g x) \<le> c * norm (g x) &&& \<forall>\<^sub>F x in F. norm (u x - g x) \<le> c * norm (g x)
[PROOF STEP]
by (auto simp: asymp_equiv_altdef dest: landau_o.smallD[OF _ c])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (l x - g x) \<le> c * norm (g x)
\<forall>\<^sub>F x in F. norm (u x - g x) \<le> c * norm (g x)

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
hence "eventually (\<lambda>x. max (norm (l x - g x)) (norm (u x - g x)) \<le> c * norm (g x)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (l x - g x) \<le> c * norm (g x)
\<forall>\<^sub>F x in F. norm (u x - g x) \<le> c * norm (g x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. max (norm (l x - g x)) (norm (u x - g x)) \<le> c * norm (g x)
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. max (norm (l x - g x)) (norm (u x - g x)) \<le> c * norm (g x)

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. norm (f x - g x) \<le> max (norm (l x - g x)) (norm (u x - g x))
\<forall>\<^sub>F x in F. max (norm (l x - g x)) (norm (u x - g x)) \<le> c * norm (g x)
[PROOF STEP]
show "eventually (\<lambda>x. norm (f x - g x) \<le> c * norm (g x)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x - g x) \<le> max (norm (l x - g x)) (norm (u x - g x))
\<forall>\<^sub>F x in F. max (norm (l x - g x)) (norm (u x - g x)) \<le> c * norm (g x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)
[PROOF STEP]
by eventually_elim (rule order.trans)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x - g x) \<le> c * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in monoid_add) foldl_absorb0:
shows "x + (foldl (+) 0 zs) = foldl (+) x zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + foldl (+) (0::'a) zs = foldl (+) x zs
[PROOF STEP]
by (induct zs) (simp_all add:foldl_assoc)


[STATEMENT]
lemma mult_one_right [simp]:
  shows "z *\<^sub>h 1\<^sub>h = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z *\<^sub>h 1\<^sub>h = z
[PROOF STEP]
using mult_one_left[of z]
[PROOF STATE]
proof (prove)
using this:
1\<^sub>h *\<^sub>h z = z

goal (1 subgoal):
 1. z *\<^sub>h 1\<^sub>h = z
[PROOF STEP]
by (simp add: mult_commute)


[STATEMENT]
lemma mins_nonempty: "i < j \<Longrightarrow> mins i j \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < j \<Longrightarrow> mins i j \<noteq> {}
[PROOF STEP]
using ex_is_arg_min_on_if_finite[OF finite_atLeastAtMost_int, of "i+1" j "c_k i j"]
[PROOF STATE]
proof (prove)
using this:
{i + 1..j} \<noteq> {} \<Longrightarrow> \<exists>x. is_arg_min_on (c_k i j) {i + 1..j} x

goal (1 subgoal):
 1. i < j \<Longrightarrow> mins i j \<noteq> {}
[PROOF STEP]
by(auto simp: Args_min_simps)


[STATEMENT]
lemma gauss2complex_eq_0_iff [simp]: "gauss2complex x = 0 \<longleftrightarrow> x = 0"
  and gauss2complex_eq_1_iff [simp]: "gauss2complex x = 1 \<longleftrightarrow> x = 1"
  and zero_eq_gauss2complex_iff [simp]: "0 = gauss2complex x \<longleftrightarrow> x = 0"
  and one_eq_gauss2complex_iff [simp]: "1 = gauss2complex x \<longleftrightarrow> x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((gauss2complex x = 0) = (x = 0) &&& (gauss2complex x = 1) = (x = 1)) &&& (0 = gauss2complex x) = (x = 0) &&& (1 = gauss2complex x) = (x = 1)
[PROOF STEP]
by (simp_all add: complex_eq_iff gauss_int_eq_iff)


[STATEMENT]
lemma diag_elem_indices_union:
  assumes "B\<in> carrier_mat dimR dimC"
  shows "(\<Union> i \<in> {..< dist_el_card B}. diag_elem_indices (diag_idx_to_el B i) B) =
    {..< dimR}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) = {..<dimR}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<subseteq> {..<dimR}
 2. {..<dimR} \<subseteq> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
show "(\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<subseteq> {..<dimR}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<subseteq> {..<dimR}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<Longrightarrow> x \<in> {..<dimR}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<Longrightarrow> x \<in> {..<dimR}
[PROOF STEP]
assume "x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)"
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<Longrightarrow> x \<in> {..<dimR}
[PROOF STEP]
hence "\<exists>i < dist_el_card B. x\<in> diag_elem_indices (diag_idx_to_el B i) B"
[PROOF STATE]
proof (prove)
using this:
x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)

goal (1 subgoal):
 1. \<exists>i<dist_el_card B. x \<in> diag_elem_indices (diag_idx_to_el B i) B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>i<dist_el_card B. x \<in> diag_elem_indices (diag_idx_to_el B i) B

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<Longrightarrow> x \<in> {..<dimR}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>i<dist_el_card B. x \<in> diag_elem_indices (diag_idx_to_el B i) B
[PROOF STEP]
obtain i where "i < dist_el_card B"
      "x\<in> diag_elem_indices (diag_idx_to_el B i) B"
[PROOF STATE]
proof (prove)
using this:
\<exists>i<dist_el_card B. x \<in> diag_elem_indices (diag_idx_to_el B i) B

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < dist_el_card B; x \<in> diag_elem_indices (diag_idx_to_el B i) B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < dist_el_card B
x \<in> diag_elem_indices (diag_idx_to_el B i) B

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<Longrightarrow> x \<in> {..<dimR}
[PROOF STEP]
hence "x < dimR"
[PROOF STATE]
proof (prove)
using this:
i < dist_el_card B
x \<in> diag_elem_indices (diag_idx_to_el B i) B

goal (1 subgoal):
 1. x < dimR
[PROOF STEP]
using diag_elem_indices_elem[of x _ B] assms
[PROOF STATE]
proof (prove)
using this:
i < dist_el_card B
x \<in> diag_elem_indices (diag_idx_to_el B i) B
x \<in> diag_elem_indices ?x B \<Longrightarrow> x < dim_row B \<and> B $$ (x, x) = ?x
B \<in> carrier_mat dimR dimC

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

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<Longrightarrow> x \<in> {..<dimR}
[PROOF STEP]
thus "x \<in> {..< dimR}"
[PROOF STATE]
proof (prove)
using this:
x < dimR

goal (1 subgoal):
 1. x \<in> {..<dimR}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {..<dimR}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B) \<subseteq> {..<dimR}

goal (1 subgoal):
 1. {..<dimR} \<subseteq> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {..<dimR} \<subseteq> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
show "{..<dimR} \<subseteq> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<dimR} \<subseteq> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
assume "j\<in> {..< dimR}"
[PROOF STATE]
proof (state)
this:
j \<in> {..<dimR}

goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
hence "j < dim_row B"
[PROOF STATE]
proof (prove)
using this:
j \<in> {..<dimR}

goal (1 subgoal):
 1. j < dim_row B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
j \<in> {..<dimR}
B \<in> carrier_mat dimR dimC

goal (1 subgoal):
 1. j < dim_row B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
j < dim_row B

goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
hence "B$$(j,j) \<in> diag_elems B"
[PROOF STATE]
proof (prove)
using this:
j < dim_row B

goal (1 subgoal):
 1. B $$ (j, j) \<in> diag_elems B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B $$ (j, j) \<in> diag_elems B

goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
hence "\<exists>k \<in> {..< dist_el_card B}. B$$(j,j) = diag_idx_to_el B k"
[PROOF STATE]
proof (prove)
using this:
B $$ (j, j) \<in> diag_elems B

goal (1 subgoal):
 1. \<exists>k\<in>{..<dist_el_card B}. B $$ (j, j) = diag_idx_to_el B k
[PROOF STEP]
using diag_idx_to_el_less_surj[of "B $$(j,j)"]
[PROOF STATE]
proof (prove)
using this:
B $$ (j, j) \<in> diag_elems B
B $$ (j, j) \<in> diag_elems ?B \<Longrightarrow> \<exists>k\<in>{..<dist_el_card ?B}. B $$ (j, j) = diag_idx_to_el ?B k

goal (1 subgoal):
 1. \<exists>k\<in>{..<dist_el_card B}. B $$ (j, j) = diag_idx_to_el B k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>k\<in>{..<dist_el_card B}. B $$ (j, j) = diag_idx_to_el B k

goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>k\<in>{..<dist_el_card B}. B $$ (j, j) = diag_idx_to_el B k
[PROOF STEP]
obtain k where kprop: "k \<in> {..< dist_el_card B}"
      "B$$(j,j) = diag_idx_to_el B k"
[PROOF STATE]
proof (prove)
using this:
\<exists>k\<in>{..<dist_el_card B}. B $$ (j, j) = diag_idx_to_el B k

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<in> {..<dist_el_card B}; B $$ (j, j) = diag_idx_to_el B k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<in> {..<dist_el_card B}
B $$ (j, j) = diag_idx_to_el B k

goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
hence "j \<in> diag_elem_indices (diag_idx_to_el B k) B"
[PROOF STATE]
proof (prove)
using this:
k \<in> {..<dist_el_card B}
B $$ (j, j) = diag_idx_to_el B k

goal (1 subgoal):
 1. j \<in> diag_elem_indices (diag_idx_to_el B k) B
[PROOF STEP]
using \<open>j < dim_row B\<close>
        diag_elem_indices_itself
[PROOF STATE]
proof (prove)
using this:
k \<in> {..<dist_el_card B}
B $$ (j, j) = diag_idx_to_el B k
j < dim_row B
?i < dim_row ?B \<Longrightarrow> ?i \<in> diag_elem_indices (?B $$ (?i, ?i)) ?B

goal (1 subgoal):
 1. j \<in> diag_elem_indices (diag_idx_to_el B k) B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
j \<in> diag_elem_indices (diag_idx_to_el B k) B

goal (1 subgoal):
 1. \<And>x. x \<in> {..<dimR} \<Longrightarrow> x \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
thus "j \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)"
[PROOF STATE]
proof (prove)
using this:
j \<in> diag_elem_indices (diag_idx_to_el B k) B

goal (1 subgoal):
 1. j \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
using kprop
[PROOF STATE]
proof (prove)
using this:
j \<in> diag_elem_indices (diag_idx_to_el B k) B
k \<in> {..<dist_el_card B}
B $$ (j, j) = diag_idx_to_el B k

goal (1 subgoal):
 1. j \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j \<in> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{..<dimR} \<subseteq> (\<Union>i<dist_el_card B. diag_elem_indices (diag_idx_to_el B i) B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_deriv_eq_0_iff:
  "fls_deriv f = 0 \<longleftrightarrow> f = fls_const (f$$0 :: 'a::{ring_1_no_zero_divisors,ring_char_0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fls_deriv f = 0) = (f = fls_const (f $$ 0))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fls_deriv f = 0 \<Longrightarrow> f = fls_const (f $$ 0)
 2. f = fls_const (f $$ 0) \<Longrightarrow> fls_deriv f = 0
[PROOF STEP]
assume f: "fls_deriv f = 0"
[PROOF STATE]
proof (state)
this:
fls_deriv f = 0

goal (2 subgoals):
 1. fls_deriv f = 0 \<Longrightarrow> f = fls_const (f $$ 0)
 2. f = fls_const (f $$ 0) \<Longrightarrow> fls_deriv f = 0
[PROOF STEP]
show "f = fls_const (f$$0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = fls_const (f $$ 0)
[PROOF STEP]
proof (intro fls_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f $$ x = fls_const (f $$ 0) $$ x
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f $$ x = fls_const (f $$ 0) $$ x
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
fls_deriv f = 0
[PROOF STEP]
have "of_int n * f$$ n = 0"
[PROOF STATE]
proof (prove)
using this:
fls_deriv f = 0

goal (1 subgoal):
 1. of_int n * f $$ n = (0::'a)
[PROOF STEP]
using fls_deriv_nth[of f "n-1"]
[PROOF STATE]
proof (prove)
using this:
fls_deriv f = 0
fls_deriv f $$ (n - 1) = of_int (n - 1 + 1) * f $$ (n - 1 + 1)

goal (1 subgoal):
 1. of_int n * f $$ n = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int n * f $$ n = (0::'a)

goal (1 subgoal):
 1. \<And>x. f $$ x = fls_const (f $$ 0) $$ x
[PROOF STEP]
thus "f$$n = fls_const (f$$0) $$ n"
[PROOF STATE]
proof (prove)
using this:
of_int n * f $$ n = (0::'a)

goal (1 subgoal):
 1. f $$ n = fls_const (f $$ 0) $$ n
[PROOF STEP]
by (cases "n=0") auto
[PROOF STATE]
proof (state)
this:
f $$ n = fls_const (f $$ 0) $$ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f = fls_const (f $$ 0)

goal (1 subgoal):
 1. f = fls_const (f $$ 0) \<Longrightarrow> fls_deriv f = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f = fls_const (f $$ 0) \<Longrightarrow> fls_deriv f = 0
[PROOF STEP]
show "f = fls_const (f$$0) \<Longrightarrow> fls_deriv f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = fls_const (f $$ 0) \<Longrightarrow> fls_deriv f = 0
[PROOF STEP]
using fls_deriv_const[of "f$$0"]
[PROOF STATE]
proof (prove)
using this:
fls_deriv (fls_const (f $$ 0)) = 0

goal (1 subgoal):
 1. f = fls_const (f $$ 0) \<Longrightarrow> fls_deriv f = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f = fls_const (f $$ 0) \<Longrightarrow> fls_deriv f = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem pick_eqv' [intro?, simp]: "a \<in> domain \<Longrightarrow> pick \<lfloor>a\<rfloor> \<sim> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> domain \<Longrightarrow> pick \<lfloor>a\<rfloor> \<sim> a
[PROOF STEP]
proof (unfold pick_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> domain \<Longrightarrow> (SOME aa. \<lfloor>a\<rfloor> = \<lfloor>aa\<rfloor>) \<sim> a
[PROOF STEP]
assume a: "a \<in> domain"
[PROOF STATE]
proof (state)
this:
a \<in> domain

goal (1 subgoal):
 1. a \<in> domain \<Longrightarrow> (SOME aa. \<lfloor>a\<rfloor> = \<lfloor>aa\<rfloor>) \<sim> a
[PROOF STEP]
show "(SOME x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor>) \<sim> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor>) \<sim> a
[PROOF STEP]
proof (rule someI2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lfloor>a\<rfloor> = \<lfloor>?a\<rfloor>
 2. \<And>x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor> \<Longrightarrow> x \<sim> a
[PROOF STEP]
show "\<lfloor>a\<rfloor> = \<lfloor>a\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>a\<rfloor> = \<lfloor>a\<rfloor>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<lfloor>a\<rfloor> = \<lfloor>a\<rfloor>

goal (1 subgoal):
 1. \<And>x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor> \<Longrightarrow> x \<sim> a
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor> \<Longrightarrow> x \<sim> a
[PROOF STEP]
assume "\<lfloor>a\<rfloor> = \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (state)
this:
\<lfloor>a\<rfloor> = \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. \<And>x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor> \<Longrightarrow> x \<sim> a
[PROOF STEP]
from this and a
[PROOF STATE]
proof (chain)
picking this:
\<lfloor>a\<rfloor> = \<lfloor>x\<rfloor>
a \<in> domain
[PROOF STEP]
have "a \<sim> x"
[PROOF STATE]
proof (prove)
using this:
\<lfloor>a\<rfloor> = \<lfloor>x\<rfloor>
a \<in> domain

goal (1 subgoal):
 1. a \<sim> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a \<sim> x

goal (1 subgoal):
 1. \<And>x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor> \<Longrightarrow> x \<sim> a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<sim> x
[PROOF STEP]
show "x \<sim> a"
[PROOF STATE]
proof (prove)
using this:
a \<sim> x

goal (1 subgoal):
 1. x \<sim> a
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sim> a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(SOME x. \<lfloor>a\<rfloor> = \<lfloor>x\<rfloor>) \<sim> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SPEC_rule_leof_conjI:
    assumes "m \<le>\<^sub>n SPEC \<Phi>" "m \<le>\<^sub>n SPEC \<Psi>"
    shows "m \<le>\<^sub>n SPEC (\<lambda>x. \<Phi> x \<and> \<Psi> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le>\<^sub>n SPEC (\<lambda>x. \<Phi> x \<and> \<Psi> x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<le>\<^sub>n SPEC \<Phi>
m \<le>\<^sub>n SPEC \<Psi>

goal (1 subgoal):
 1. m \<le>\<^sub>n SPEC (\<lambda>x. \<Phi> x \<and> \<Psi> x)
[PROOF STEP]
by (auto simp: pw_leof_iff)


[STATEMENT]
lemma add_rat [simp]:
  assumes "b \<noteq> 0" and "d \<noteq> 0"
  shows "Fract a b + Fract c d = Fract (a * d + c * b) (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract a b + Fract c d = Fract (a * d + c * b) (b * d)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0
d \<noteq> 0

goal (1 subgoal):
 1. Fract a b + Fract c d = Fract (a * d + c * b) (b * d)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma totatives_less:
  assumes "x \<in> totatives n" "n > 1"
  shows   "x < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x < n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> totatives n
1 < n
[PROOF STEP]
have "x \<noteq> n"
[PROOF STATE]
proof (prove)
using this:
x \<in> totatives n
1 < n

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

goal (1 subgoal):
 1. x < n
[PROOF STEP]
with totatives_le[OF assms(1)]
[PROOF STATE]
proof (chain)
picking this:
x \<le> n
x \<noteq> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<le> n
x \<noteq> n

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma feasible_unitaryD[dest]:
  assumes ft: "feasible t" and uP: "unitary P"
  shows "unitary (t P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (t P)
[PROOF STEP]
proof(rule unitaryI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sound (t P)
 2. bounded_by 1 (t P)
[PROOF STEP]
from uP
[PROOF STATE]
proof (chain)
picking this:
unitary P
[PROOF STEP]
have "sound P"
[PROOF STATE]
proof (prove)
using this:
unitary P

goal (1 subgoal):
 1. sound P
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
sound P

goal (2 subgoals):
 1. sound (t P)
 2. bounded_by 1 (t P)
[PROOF STEP]
with ft
[PROOF STATE]
proof (chain)
picking this:
feasible t
sound P
[PROOF STEP]
show "sound (t P)"
[PROOF STATE]
proof (prove)
using this:
feasible t
sound P

goal (1 subgoal):
 1. sound (t P)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
sound (t P)

goal (1 subgoal):
 1. bounded_by 1 (t P)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
feasible t
unitary P
[PROOF STEP]
show "bounded_by 1 (t P)"
[PROOF STATE]
proof (prove)
using this:
feasible t
unitary P

goal (1 subgoal):
 1. bounded_by 1 (t P)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
bounded_by 1 (t P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in field) zeromaximalideal: "maximalideal {\<zero>} R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maximalideal {\<zero>} R
[PROOF STEP]
proof (intro maximalidealI zeroideal)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. carrier R \<noteq> {\<zero>}
 2. \<And>J. \<lbrakk>ideal J R; {\<zero>} \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
from one_not_zero
[PROOF STATE]
proof (chain)
picking this:
\<one> \<noteq> \<zero>
[PROOF STEP]
have "\<one> \<notin> {\<zero>}"
[PROOF STATE]
proof (prove)
using this:
\<one> \<noteq> \<zero>

goal (1 subgoal):
 1. \<one> \<notin> {\<zero>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<one> \<notin> {\<zero>}

goal (2 subgoals):
 1. carrier R \<noteq> {\<zero>}
 2. \<And>J. \<lbrakk>ideal J R; {\<zero>} \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
with one_closed
[PROOF STATE]
proof (chain)
picking this:
\<one> \<in> carrier R
\<one> \<notin> {\<zero>}
[PROOF STEP]
show "carrier R \<noteq> {\<zero>}"
[PROOF STATE]
proof (prove)
using this:
\<one> \<in> carrier R
\<one> \<notin> {\<zero>}

goal (1 subgoal):
 1. carrier R \<noteq> {\<zero>}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
carrier R \<noteq> {\<zero>}

goal (1 subgoal):
 1. \<And>J. \<lbrakk>ideal J R; {\<zero>} \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>J. \<lbrakk>ideal J R; {\<zero>} \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
fix J
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>J. \<lbrakk>ideal J R; {\<zero>} \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
assume Jideal: "ideal J R"
[PROOF STATE]
proof (state)
this:
ideal J R

goal (1 subgoal):
 1. \<And>J. \<lbrakk>ideal J R; {\<zero>} \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ideal J R
[PROOF STEP]
have "J \<in> {I. ideal I R}"
[PROOF STATE]
proof (prove)
using this:
ideal J R

goal (1 subgoal):
 1. J \<in> {I. ideal I R}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
J \<in> {I. ideal I R}

goal (1 subgoal):
 1. \<And>J. \<lbrakk>ideal J R; {\<zero>} \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
with all_ideals
[PROOF STATE]
proof (chain)
picking this:
{I. ideal I R} = {{\<zero>}, carrier R}
J \<in> {I. ideal I R}
[PROOF STEP]
show "J = {\<zero>} \<or> J = carrier R"
[PROOF STATE]
proof (prove)
using this:
{I. ideal I R} = {{\<zero>}, carrier R}
J \<in> {I. ideal I R}

goal (1 subgoal):
 1. J = {\<zero>} \<or> J = carrier R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
J = {\<zero>} \<or> J = carrier R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_exp_not_0 [simp]: "(0 < x ** y) = (0 < x \<or> y = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < x ** y) = (0 < x \<or> y = 0)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < x ** y; 0 < y\<rbrakk> \<Longrightarrow> 0 < x
 2. 0 < x \<Longrightarrow> 0 < x ** y
[PROOF STEP]
apply (erule contrapos_pp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> 0 < x ** y
[PROOF STEP]
apply (rule_tac a=y in oLimit_induct, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>0 < x; OrdinalInduct.strict_mono f; \<forall>n. 0 < x ** f n\<rbrakk> \<Longrightarrow> 0 < oLimit (\<lambda>n. x ** f n)
[PROOF STEP]
apply (rule less_oLimitI, erule spec)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bisimilar_equivp: "equivp bisimilar"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivp (\<sim>\<cdot>)
[PROOF STEP]
by (metis bisimilar_reflp bisimilar_symp bisimilar_transp equivp_reflp_symp_transp)


[STATEMENT]
theorem infinite_UNIV_real [simp]:
"infinite (UNIV :: real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
by (rule infinite_UNIV_char_0)


[STATEMENT]
lemma unique_arc:
  shows "u \<rightarrow>\<^bsub>T\<^esub> v \<Longrightarrow> \<exists>!e \<in> arcs T. tail T e = u \<and> head T e = v"
    and "(\<nexists>e. e \<in> arcs T \<and> tail T e = u \<and> head T e = v) \<Longrightarrow> \<not> u \<rightarrow>\<^bsub>T\<^esub> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<rightarrow>\<^bsub>T\<^esub> v \<Longrightarrow> \<exists>!e. e \<in> arcs T \<and> tail T e = u \<and> head T e = v) &&& (\<nexists>e. e \<in> arcs T \<and> tail T e = u \<and> head T e = v \<Longrightarrow> (u, v) \<notin> arcs_ends T)
[PROOF STEP]
using unique_awalk_All nomulti.no_multi_arcs
[PROOF STATE]
proof (prove)
using this:
\<exists>p. awalk ?u p ?v \<Longrightarrow> \<exists>!p. awalk ?u p ?v
\<lbrakk>?e1.0 \<in> arcs T; ?e2.0 \<in> arcs T; arc_to_ends T ?e1.0 = arc_to_ends T ?e2.0\<rbrakk> \<Longrightarrow> ?e1.0 = ?e2.0

goal (1 subgoal):
 1. (u \<rightarrow>\<^bsub>T\<^esub> v \<Longrightarrow> \<exists>!e. e \<in> arcs T \<and> tail T e = u \<and> head T e = v) &&& (\<nexists>e. e \<in> arcs T \<and> tail T e = u \<and> head T e = v \<Longrightarrow> (u, v) \<notin> arcs_ends T)
[PROOF STEP]
unfolding arc_to_ends_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p. awalk ?u p ?v \<Longrightarrow> \<exists>!p. awalk ?u p ?v
\<lbrakk>?e1.0 \<in> arcs T; ?e2.0 \<in> arcs T; (tail T ?e1.0, head T ?e1.0) = (tail T ?e2.0, head T ?e2.0)\<rbrakk> \<Longrightarrow> ?e1.0 = ?e2.0

goal (1 subgoal):
 1. (u \<rightarrow>\<^bsub>T\<^esub> v \<Longrightarrow> \<exists>!e. e \<in> arcs T \<and> tail T e = u \<and> head T e = v) &&& (\<nexists>e. e \<in> arcs T \<and> tail T e = u \<and> head T e = v \<Longrightarrow> (u, v) \<notin> arcs_ends T)
[PROOF STEP]
by auto


[STATEMENT]
lemma "P(n::nat) ==> \<not>P(0) ==> n \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P n; \<not> P 0\<rbrakk> \<Longrightarrow> n \<noteq> 0
[PROOF STEP]
by metis


[STATEMENT]
lemma refine_trans_using_invariants:
  "\<lbrakk> {R \<inter> I \<times> J} (trans Ta), (trans Tc) {> R};
     {I \<inter> Domain (R \<inter> UNIV \<times> J)} (trans Ta) {> I};
     {J \<inter> Range (R \<inter> I \<times> UNIV)} (trans Tc) {> J} \<rbrakk>
  \<Longrightarrow> {R \<inter> I \<times> J} (trans Ta), (trans Tc) {> R  \<inter> I \<times> J}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{R \<inter> I \<times> J} TS.trans Ta, TS.trans Tc {> R}; {I \<inter> Domain (R \<inter> UNIV \<times> J)} TS.trans Ta {> I}; {J \<inter> Range (R \<inter> I \<times> UNIV)} TS.trans Tc {> J}\<rbrakk> \<Longrightarrow> {R \<inter> I \<times> J} TS.trans Ta, TS.trans Tc {> R \<inter> I \<times> J}
[PROOF STEP]
by (rule relhoare_conj_right_cartesian) (auto)


[STATEMENT]
lemma step_4_push_big_size_ok_4: "\<lbrakk>
  invar (States dir big small);
  4 \<le> remaining_steps (States dir big small);
  (step^^4) (States dir (Big.push x big) small) = States dir' big' small';
  size_new big + remaining_steps (States dir big small) + 2 \<le> 3 * size_new small
\<rbrakk> \<Longrightarrow> size_new big' + remaining_steps (States dir' big' small') + 2 \<le> 3 * size_new small'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); 4 \<le> remaining_steps (States dir big small); (step ^^ 4) (States dir (Big.push x big) small) = States dir' big' small'; size_new big + remaining_steps (States dir big small) + 2 \<le> 3 * size_new small\<rbrakk> \<Longrightarrow> size_new big' + remaining_steps (States dir' big' small') + 2 \<le> 3 * size_new small'
[PROOF STEP]
by (metis invar_push_big remaining_steps_n_steps_sub remaining_steps_push_big step_4_push_big_size_ok_4_aux step_n_push_size_new_big step_n_size_new_small)


[STATEMENT]
lemma unhindered_criterion [rule_format]:
  assumes "\<not> hindered \<Gamma>"
  shows "\<forall>X \<subseteq> A \<Gamma>. finite X \<longrightarrow> (\<Sum>\<^sup>+ x\<in>X. weight \<Gamma> x) \<le> (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. weight \<Gamma> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> hindered \<Gamma>

goal (1 subgoal):
 1. \<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)
[PROOF STEP]
proof(rule contrapos_np)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>))

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>))
[PROOF STEP]
obtain X where "X \<in> {X. X \<subseteq> A \<Gamma> \<and> finite X \<and> (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. weight \<Gamma> y) < (\<Sum>\<^sup>+ x\<in>X. weight \<Gamma> x)}" (is "_ \<in> Collect ?P")
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>))

goal (1 subgoal):
 1. (\<And>X. X \<in> {X. X \<subseteq> A \<Gamma> \<and> finite X \<and> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>)} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: not_le)
[PROOF STATE]
proof (state)
this:
X \<in> {X. X \<subseteq> A \<Gamma> \<and> finite X \<and> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>)}

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
from wf_eq_minimal[THEN iffD1, OF wf_finite_psubset, rule_format, OF this, simplified]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z\<subseteq>A \<Gamma>. finite z \<and> integral\<^sup>N (count_space {y. \<exists>x\<in>z. edge \<Gamma> x y}) (weight \<Gamma>) < integral\<^sup>N (count_space z) (weight \<Gamma>) \<and> (\<forall>y\<subset>z. finite y \<longrightarrow> y \<subseteq> A \<Gamma> \<longrightarrow> \<not> integral\<^sup>N (count_space {ya. \<exists>x\<in>y. edge \<Gamma> x ya}) (weight \<Gamma>) < integral\<^sup>N (count_space y) (weight \<Gamma>))
[PROOF STEP]
obtain X where X_A: "X \<subseteq> A \<Gamma>" and fin_X [simp]: "finite X"
    and less: "(\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. weight \<Gamma> y) < (\<Sum>\<^sup>+ x\<in>X. weight \<Gamma> x)"
    and minimal: "\<And>X'. X' \<subset> X \<Longrightarrow> (\<Sum>\<^sup>+ x\<in>X'. weight \<Gamma> x) \<le> (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X'. weight \<Gamma> y)"
[PROOF STATE]
proof (prove)
using this:
\<exists>z\<subseteq>A \<Gamma>. finite z \<and> integral\<^sup>N (count_space {y. \<exists>x\<in>z. edge \<Gamma> x y}) (weight \<Gamma>) < integral\<^sup>N (count_space z) (weight \<Gamma>) \<and> (\<forall>y\<subset>z. finite y \<longrightarrow> y \<subseteq> A \<Gamma> \<longrightarrow> \<not> integral\<^sup>N (count_space {ya. \<exists>x\<in>y. edge \<Gamma> x ya}) (weight \<Gamma>) < integral\<^sup>N (count_space y) (weight \<Gamma>))

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>X \<subseteq> A \<Gamma>; finite X; integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>); \<And>X'. X' \<subset> X \<Longrightarrow> integral\<^sup>N (count_space X') (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(clarsimp simp add: not_less)(meson finite_subset order_trans psubset_imp_subset)
[PROOF STATE]
proof (state)
this:
X \<subseteq> A \<Gamma>
finite X
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>)
?X' \<subset> X \<Longrightarrow> integral\<^sup>N (count_space ?X') (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` ?X')) (weight \<Gamma>)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have nonempty: "X \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<noteq> {}
[PROOF STEP]
using less
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>)

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

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X \<noteq> {}
[PROOF STEP]
obtain xx where xx: "xx \<in> X"
[PROOF STATE]
proof (prove)
using this:
X \<noteq> {}

goal (1 subgoal):
 1. (\<And>xx. xx \<in> X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xx \<in> X

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
define f where
    "f x = (if x = xx then (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. weight \<Gamma> y) - (\<Sum>\<^sup>+ x\<in>X - {xx}. weight \<Gamma> x) else if x \<in> X then weight \<Gamma> x else 0)" for x
[PROOF STATE]
proof (state)
this:
f ?x = (if ?x = xx then integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) else if ?x \<in> X then weight \<Gamma> ?x else 0)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
define g where
    "g y = (if y \<in> \<^bold>E `` X then weight \<Gamma> y else 0)" for y
[PROOF STATE]
proof (state)
this:
g ?y = (if ?y \<in> \<^bold>E `` X then weight \<Gamma> ?y else 0)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
define E' where "E' \<equiv> \<^bold>E \<inter> X \<times> UNIV"
[PROOF STATE]
proof (state)
this:
E' \<equiv> \<^bold>E \<inter> X \<times> UNIV

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have Xxx: "X - {xx} \<subset> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X - {xx} \<subset> X
[PROOF STEP]
using xx
[PROOF STATE]
proof (prove)
using this:
xx \<in> X

goal (1 subgoal):
 1. X - {xx} \<subset> X
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
X - {xx} \<subset> X

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have E [simp]: "E' `` X' = \<^bold>E `` X'" if "X' \<subseteq> X" for X'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E' `` X' = \<^bold>E `` X'
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
X' \<subseteq> X

goal (1 subgoal):
 1. E' `` X' = \<^bold>E `` X'
[PROOF STEP]
by(auto simp add: E'_def)
[PROOF STATE]
proof (state)
this:
?X' \<subseteq> X \<Longrightarrow> E' `` ?X' = \<^bold>E `` ?X'

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have in_E': "(x, y) \<in> E' \<longleftrightarrow> x \<in> X \<and> (x, y) \<in> \<^bold>E" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> E') = (x \<in> X \<and> (x, y) \<in> \<^bold>E)
[PROOF STEP]
by(auto simp add: E'_def)
[PROOF STATE]
proof (state)
this:
((?x, ?y) \<in> E') = (?x \<in> X \<and> (?x, ?y) \<in> \<^bold>E)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "(\<Sum>\<^sup>+ x\<in>X. f x) = (\<Sum>\<^sup>+ x\<in>X - {xx}. f x) + (\<Sum>\<^sup>+ x\<in>{xx}. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (X - {xx})) f + integral\<^sup>N (count_space {xx}) f
[PROOF STEP]
using xx
[PROOF STATE]
proof (prove)
using this:
xx \<in> X

goal (1 subgoal):
 1. integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (X - {xx})) f + integral\<^sup>N (count_space {xx}) f
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator nn_integral_add[symmetric] simp del: nn_integral_indicator_singleton intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (X - {xx})) f + integral\<^sup>N (count_space {xx}) f

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (X - {xx})) f + integral\<^sup>N (count_space {xx}) f

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ x\<in>X - {xx}. weight \<Gamma> x) + ((\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. weight \<Gamma> y) - (\<Sum>\<^sup>+ x\<in>X - {xx}. weight \<Gamma> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (X - {xx})) f + integral\<^sup>N (count_space {xx}) f = integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) + (integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>))
[PROOF STEP]
by(rule arg_cong2[where f="(+)"])(auto simp add: f_def xx nn_integral_count_space_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (X - {xx})) f + integral\<^sup>N (count_space {xx}) f = integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) + (integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>))

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (X - {xx})) f + integral\<^sup>N (count_space {xx}) f = integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) + (integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>))

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) + (integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)) = integral\<^sup>N (count_space (\<^bold>E `` X)) g
[PROOF STEP]
using minimal[OF Xxx] xx
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` (X - {xx}))) (weight \<Gamma>)
xx \<in> X

goal (1 subgoal):
 1. integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) + (integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)) = integral\<^sup>N (count_space (\<^bold>E `` X)) g
[PROOF STEP]
by(subst add_diff_eq_iff_ennreal[THEN iffD2])(fastforce simp add: g_def[abs_def] nn_integral_count_space_indicator intro!: nn_integral_cong intro: nn_integral_mono elim: order_trans split: split_indicator)+
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) + (integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)) = integral\<^sup>N (count_space (\<^bold>E `` X)) g

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (\<^bold>E `` X)) g
[PROOF STEP]
have sum_eq: "(\<Sum>\<^sup>+ x\<in>X. f x) = (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. g y)"
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (\<^bold>E `` X)) g

goal (1 subgoal):
 1. integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (\<^bold>E `` X)) g
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (\<^bold>E `` X)) g

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "(\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. weight \<Gamma> y) = (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X)) g
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator g_def intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X)) g

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X)) g
[PROOF STEP]
have fin: "\<dots> \<noteq> \<top>"
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X)) g

goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X)) g \<noteq> \<top>
[PROOF STEP]
using less
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X)) g
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>)

goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X)) g \<noteq> \<top>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (\<^bold>E `` X)) g \<noteq> \<top>

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have fin2: "(\<Sum>\<^sup>+ x\<in>X'. weight \<Gamma> x) \<noteq> \<top>" if "X' \<subset> X" for X'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X') (weight \<Gamma>) \<noteq> \<top>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X') (weight \<Gamma>) \<noteq> \<top>
[PROOF STEP]
have "(\<Sum>\<^sup>+ x\<in>\<^bold>E `` X'. weight \<Gamma> x) \<le> (\<Sum>\<^sup>+ x\<in>\<^bold>E `` X. weight \<Gamma> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
X' \<subset> X

goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)
[PROOF STEP]
by(auto 4 3 simp add: nn_integral_count_space_indicator intro!: nn_integral_mono split: split_indicator split_indicator_asm)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)

goal (1 subgoal):
 1. integral\<^sup>N (count_space X') (weight \<Gamma>) \<noteq> \<top>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)

goal (1 subgoal):
 1. integral\<^sup>N (count_space X') (weight \<Gamma>) \<noteq> \<top>
[PROOF STEP]
using minimal[OF that] less
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)
integral\<^sup>N (count_space X') (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>)
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>)

goal (1 subgoal):
 1. integral\<^sup>N (count_space X') (weight \<Gamma>) \<noteq> \<top>
[PROOF STEP]
by(auto simp add: top_unique)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X') (weight \<Gamma>) \<noteq> \<top>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?X' \<subset> X \<Longrightarrow> integral\<^sup>N (count_space ?X') (weight \<Gamma>) \<noteq> \<top>

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "f xx = (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X. weight \<Gamma> y) - (\<Sum>\<^sup>+ x\<in>X - {xx}. weight \<Gamma> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f xx = integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)
[PROOF STEP]
by (simp add: f_def)
[PROOF STATE]
proof (state)
this:
f xx = integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f xx = integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "\<dots> < (\<Sum>\<^sup>+ x\<in>X. weight \<Gamma> x) - (\<Sum>\<^sup>+ x\<in>X - {xx}. weight \<Gamma> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)
[PROOF STEP]
using less fin2[OF Xxx] minimal[OF Xxx]
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>)
integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) \<noteq> \<top>
integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` (X - {xx}))) (weight \<Gamma>)

goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)
[PROOF STEP]
by(subst minus_less_iff_ennreal)(fastforce simp add: less_top[symmetric] nn_integral_count_space_indicator diff_add_self_ennreal intro: nn_integral_mono elim: order_trans split: split_indicator)+
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) < integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) = integral\<^sup>N (count_space {xx}) (weight \<Gamma>)
[PROOF STEP]
using fin2[OF Xxx] xx
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) \<noteq> \<top>
xx \<in> X

goal (1 subgoal):
 1. integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) = integral\<^sup>N (count_space {xx}) (weight \<Gamma>)
[PROOF STEP]
apply(simp add: nn_integral_count_space_indicator del: nn_integral_indicator_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) \<noteq> \<top>; xx \<in> X\<rbrakk> \<Longrightarrow> set_nn_integral (count_space UNIV) X (weight \<Gamma>) - set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) = set_nn_integral (count_space UNIV) {xx} (weight \<Gamma>)
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) \<noteq> \<top>; xx \<in> X\<rbrakk> \<Longrightarrow> (\<lambda>x. weight \<Gamma> x * indicator X x) \<in> borel_measurable (count_space UNIV)
 2. \<lbrakk>set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) \<noteq> \<top>; xx \<in> X\<rbrakk> \<Longrightarrow> (\<lambda>x. weight \<Gamma> x * indicator (X - {xx}) x) \<in> borel_measurable (count_space UNIV)
 3. \<lbrakk>set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) \<noteq> \<top>; xx \<in> X\<rbrakk> \<Longrightarrow> set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) \<noteq> \<infinity>
 4. \<lbrakk>set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) \<noteq> \<top>; xx \<in> X\<rbrakk> \<Longrightarrow> AE x in count_space UNIV. weight \<Gamma> x * indicator (X - {xx}) x \<le> weight \<Gamma> x * indicator X x
 5. \<lbrakk>set_nn_integral (count_space UNIV) (X - {xx}) (weight \<Gamma>) \<noteq> \<top>; xx \<in> X\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ x. weight \<Gamma> x * indicator X x - weight \<Gamma> x * indicator (X - {xx}) x) = set_nn_integral (count_space UNIV) {xx} (weight \<Gamma>)
[PROOF STEP]
apply(auto simp add: AE_count_space split: split_indicator simp del: nn_integral_indicator_singleton intro!: nn_integral_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) = integral\<^sup>N (count_space {xx}) (weight \<Gamma>)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X) (weight \<Gamma>) - integral\<^sup>N (count_space (X - {xx})) (weight \<Gamma>) = integral\<^sup>N (count_space {xx}) (weight \<Gamma>)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "\<dots> = weight \<Gamma> xx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space {xx}) (weight \<Gamma>) = weight \<Gamma> xx
[PROOF STEP]
by(simp add: nn_integral_count_space_indicator)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space {xx}) (weight \<Gamma>) = weight \<Gamma> xx

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f xx < weight \<Gamma> xx
[PROOF STEP]
have fxx: "f xx < weight \<Gamma> xx"
[PROOF STATE]
proof (prove)
using this:
f xx < weight \<Gamma> xx

goal (1 subgoal):
 1. f xx < weight \<Gamma> xx
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f xx < weight \<Gamma> xx

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have le: "(\<Sum>\<^sup>+ x\<in>X'. f x) \<le> (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X'. g y)" if "X' \<subseteq> X" for X'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
proof(cases "X' = X")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. X' = X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
 2. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
X' = X

goal (2 subgoals):
 1. X' = X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
 2. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X' = X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X' = X

goal (1 subgoal):
 1. integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
using sum_eq
[PROOF STATE]
proof (prove)
using this:
X' = X
integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (\<^bold>E `` X)) g

goal (1 subgoal):
 1. integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
X' \<noteq> X

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
hence X': "X' \<subset> X"
[PROOF STATE]
proof (prove)
using this:
X' \<noteq> X

goal (1 subgoal):
 1. X' \<subset> X
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
X' \<noteq> X
X' \<subseteq> X

goal (1 subgoal):
 1. X' \<subset> X
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
X' \<subset> X

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
have "(\<Sum>\<^sup>+ x\<in>X'. f x) = (\<Sum>\<^sup>+ x\<in>X' - {xx}. f x) + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X') f = integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx)
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator nn_integral_add[symmetric] simp del: nn_integral_indicator_singleton intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X') f = integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X') f = integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
have "\<dots> \<le> (\<Sum>\<^sup>+ x\<in>X' - {xx}. f x) + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx) \<le> integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx)
[PROOF STEP]
using fxx
[PROOF STATE]
proof (prove)
using this:
f xx < weight \<Gamma> xx

goal (1 subgoal):
 1. integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx) \<le> integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx)
[PROOF STEP]
by(intro add_mono)(auto split: split_indicator simp add: nn_integral_count_space_indicator)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx) \<le> integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. f x * indicator X' xx) \<le> integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ x\<in>X'. weight \<Gamma> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx) = integral\<^sup>N (count_space X') (weight \<Gamma>)
[PROOF STEP]
using xx that
[PROOF STATE]
proof (prove)
using this:
xx \<in> X
X' \<subseteq> X

goal (1 subgoal):
 1. integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx) = integral\<^sup>N (count_space X') (weight \<Gamma>)
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator nn_integral_add[symmetric] f_def simp del: nn_integral_indicator_singleton intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx) = integral\<^sup>N (count_space X') (weight \<Gamma>)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (X' - {xx})) f + (\<Sum>\<^sup>+ x\<in>{xx}. weight \<Gamma> x * indicator X' xx) = integral\<^sup>N (count_space X') (weight \<Gamma>)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
have "\<dots> \<le> (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X'. weight \<Gamma> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X') (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>)
[PROOF STEP]
by(rule minimal[OF X'])
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X') (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X') (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>)

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>E `` X'. g y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
X' \<subseteq> X

goal (1 subgoal):
 1. integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
by(auto 4 3 intro!: nn_integral_cong simp add: g_def Image_iff)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space (\<^bold>E `` X')) (weight \<Gamma>) = integral\<^sup>N (count_space (\<^bold>E `` X')) g

goal (1 subgoal):
 1. X' \<noteq> X \<Longrightarrow> integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g

goal (1 subgoal):
 1. integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (count_space X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` X')) g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?X' \<subseteq> X \<Longrightarrow> integral\<^sup>N (count_space ?X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` ?X')) g

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "countable X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable X
[PROOF STEP]
using X_A A_vertex countable_V
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> A \<Gamma>
A \<Gamma> \<subseteq> \<^bold>V
countable \<^bold>V

goal (1 subgoal):
 1. countable X
[PROOF STEP]
by(blast intro: countable_subset)
[PROOF STATE]
proof (state)
this:
countable X

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable X

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "\<^bold>E `` X \<subseteq> \<^bold>V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>E `` X \<subseteq> \<^bold>V
[PROOF STEP]
by(auto simp add: vertex_def)
[PROOF STATE]
proof (state)
this:
\<^bold>E `` X \<subseteq> \<^bold>V

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
with countable_V
[PROOF STATE]
proof (chain)
picking this:
countable \<^bold>V
\<^bold>E `` X \<subseteq> \<^bold>V
[PROOF STEP]
have "countable (\<^bold>E `` X)"
[PROOF STATE]
proof (prove)
using this:
countable \<^bold>V
\<^bold>E `` X \<subseteq> \<^bold>V

goal (1 subgoal):
 1. countable (\<^bold>E `` X)
[PROOF STEP]
by(blast intro: countable_subset)
[PROOF STATE]
proof (state)
this:
countable (\<^bold>E `` X)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable (\<^bold>E `` X)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "E' \<subseteq> X \<times> \<^bold>E `` X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E' \<subseteq> X \<times> \<^bold>E `` X
[PROOF STEP]
by(auto simp add: E'_def)
[PROOF STATE]
proof (state)
this:
E' \<subseteq> X \<times> \<^bold>E `` X

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
countable X
countable (\<^bold>E `` X)
E' \<subseteq> X \<times> \<^bold>E `` X
[PROOF STEP]
obtain h' where h'_dom: "\<And>x y. 0 < h' x y \<Longrightarrow> (x, y) \<in> E'"
    and h'_fin: "\<And>x y. h' x y \<noteq> \<top>"
    and h'_f: "\<And>x. x \<in> X \<Longrightarrow> (\<Sum>\<^sup>+ y\<in>E' `` X. h' x y) = f x"
    and h'_g: "\<And>y. y \<in> E' `` X \<Longrightarrow> (\<Sum>\<^sup>+ x\<in>X. h' x y) = g y"
[PROOF STATE]
proof (prove)
using this:
countable X
countable (\<^bold>E `` X)
E' \<subseteq> X \<times> \<^bold>E `` X

goal (1 subgoal):
 1. (\<And>h'. \<lbrakk>\<And>x y. 0 < h' x y \<Longrightarrow> (x, y) \<in> E'; \<And>x y. h' x y \<noteq> \<top>; \<And>x. x \<in> X \<Longrightarrow> integral\<^sup>N (count_space (E' `` X)) (h' x) = f x; \<And>y. y \<in> E' `` X \<Longrightarrow> (\<Sum>\<^sup>+ x\<in>X. h' x y) = g y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using bounded_matrix_for_marginals_ennreal[where f=f and g=g and A=X and B="E' `` X" and R=E' and thesis=thesis] sum_eq fin le
[PROOF STATE]
proof (prove)
using this:
countable X
countable (\<^bold>E `` X)
E' \<subseteq> X \<times> \<^bold>E `` X
\<lbrakk>integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (E' `` X)) g; integral\<^sup>N (count_space (E' `` X)) g \<noteq> \<top>; \<And>X. X \<subseteq> X \<Longrightarrow> integral\<^sup>N (count_space X) f \<le> integral\<^sup>N (count_space (E' `` X)) g; countable X; countable (E' `` X); E' \<subseteq> X \<times> E' `` X; \<And>h. \<lbrakk>\<And>x y. 0 < h x y \<Longrightarrow> (x, y) \<in> E'; \<And>x y. h x y \<noteq> \<top>; \<And>x. x \<in> X \<Longrightarrow> integral\<^sup>N (count_space (E' `` X)) (h x) = f x; \<And>y. y \<in> E' `` X \<Longrightarrow> (\<Sum>\<^sup>+ x\<in>X. h x y) = g y\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
integral\<^sup>N (count_space X) f = integral\<^sup>N (count_space (\<^bold>E `` X)) g
integral\<^sup>N (count_space (\<^bold>E `` X)) g \<noteq> \<top>
?X' \<subseteq> X \<Longrightarrow> integral\<^sup>N (count_space ?X') f \<le> integral\<^sup>N (count_space (\<^bold>E `` ?X')) g

goal (1 subgoal):
 1. (\<And>h'. \<lbrakk>\<And>x y. 0 < h' x y \<Longrightarrow> (x, y) \<in> E'; \<And>x y. h' x y \<noteq> \<top>; \<And>x. x \<in> X \<Longrightarrow> integral\<^sup>N (count_space (E' `` X)) (h' x) = f x; \<And>y. y \<in> E' `` X \<Longrightarrow> (\<Sum>\<^sup>+ x\<in>X. h' x y) = g y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
0 < h' ?x ?y \<Longrightarrow> (?x, ?y) \<in> E'
h' ?x ?y \<noteq> \<top>
?x \<in> X \<Longrightarrow> integral\<^sup>N (count_space (E' `` X)) (h' ?x) = f ?x
?y \<in> E' `` X \<Longrightarrow> (\<Sum>\<^sup>+ x\<in>X. h' x ?y) = g ?y

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have h'_outside: "(x, y) \<notin> E' \<Longrightarrow> h' x y = 0" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<notin> E' \<Longrightarrow> h' x y = 0
[PROOF STEP]
using h'_dom[of x y] not_gr_zero
[PROOF STATE]
proof (prove)
using this:
0 < h' x y \<Longrightarrow> (x, y) \<in> E'
(\<not> (0::?'a) < ?n) = (?n = (0::?'a))

goal (1 subgoal):
 1. (x, y) \<notin> E' \<Longrightarrow> h' x y = 0
[PROOF STEP]
by(fastforce)
[PROOF STATE]
proof (state)
this:
(?x, ?y) \<notin> E' \<Longrightarrow> h' ?x ?y = 0

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
define h where "h = (\<lambda>(x, y). if x \<in> X \<and> edge \<Gamma> x y then h' x y else 0)"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>(x, y). if x \<in> X \<and> edge \<Gamma> x y then h' x y else 0)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have h_OUT: "d_OUT h x = (if x \<in> X then f x else 0)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h x = (if x \<in> X then f x else 0)
[PROOF STEP]
by(auto 4 3 simp add: h_def d_OUT_def h'_f[symmetric] E'_def nn_integral_count_space_indicator intro!: nn_integral_cong intro: h'_outside split: split_indicator)
[PROOF STATE]
proof (state)
this:
d_OUT h ?x = (if ?x \<in> X then f ?x else 0)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have h_IN: "d_IN h y = (if y \<in> \<^bold>E `` X then weight \<Gamma> y else 0)" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h y = (if y \<in> \<^bold>E `` X then weight \<Gamma> y else 0)
[PROOF STEP]
using h'_g[of y, symmetric]
[PROOF STATE]
proof (prove)
using this:
y \<in> E' `` X \<Longrightarrow> g y = (\<Sum>\<^sup>+ x\<in>X. h' x y)

goal (1 subgoal):
 1. d_IN h y = (if y \<in> \<^bold>E `` X then weight \<Gamma> y else 0)
[PROOF STEP]
by(auto 4 3 simp add: h_def d_IN_def g_def nn_integral_count_space_indicator nn_integral_0_iff_AE  in_E' intro!: nn_integral_cong intro: h'_outside split: split_indicator split_indicator_asm)
[PROOF STATE]
proof (state)
this:
d_IN h ?y = (if ?y \<in> \<^bold>E `` X then weight \<Gamma> ?y else 0)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have h: "current \<Gamma> h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. current \<Gamma> h
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. d_OUT h x \<le> weight \<Gamma> x
 2. \<And>x. d_IN h x \<le> weight \<Gamma> x
 3. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> h e = 0
[PROOF STEP]
show "d_OUT h x \<le> weight \<Gamma> x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h x \<le> weight \<Gamma> x
[PROOF STEP]
using fxx
[PROOF STATE]
proof (prove)
using this:
f xx < weight \<Gamma> xx

goal (1 subgoal):
 1. d_OUT h x \<le> weight \<Gamma> x
[PROOF STEP]
by(auto simp add: h_OUT f_def)
[PROOF STATE]
proof (state)
this:
d_OUT h ?x \<le> weight \<Gamma> ?x

goal (2 subgoals):
 1. \<And>x. d_IN h x \<le> weight \<Gamma> x
 2. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> h e = 0
[PROOF STEP]
show "d_IN h y \<le> weight \<Gamma> y" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h y \<le> weight \<Gamma> y
[PROOF STEP]
by(simp add: h_IN)
[PROOF STATE]
proof (state)
this:
d_IN h ?y \<le> weight \<Gamma> ?y

goal (1 subgoal):
 1. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> h e = 0
[PROOF STEP]
show "h e = 0" if "e \<notin> \<^bold>E" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h e = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
e \<notin> \<^bold>E

goal (1 subgoal):
 1. h e = 0
[PROOF STEP]
by(cases e)(auto simp add: h_def)
[PROOF STATE]
proof (state)
this:
?e \<notin> \<^bold>E \<Longrightarrow> h ?e = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
current \<Gamma> h

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "separating \<Gamma> (TER h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. separating \<Gamma> (TER h)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> TER h) \<or> x \<in> TER h
[PROOF STEP]
fix x y p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> TER h) \<or> x \<in> TER h
[PROOF STEP]
assume x: "x \<in> A \<Gamma>" and y: "y \<in> B \<Gamma>" and p: "path \<Gamma> x p y"
[PROOF STATE]
proof (state)
this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y

goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> TER h) \<or> x \<in> TER h
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y
[PROOF STEP]
obtain [simp]: "p = [y]" and xy: "(x, y) \<in> \<^bold>E"
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y

goal (1 subgoal):
 1. (\<lbrakk>p = [y]; (x, y) \<in> \<^bold>E\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<lbrakk>p = [y]; (x, y) \<in> \<^bold>E\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by -(erule rtrancl_path.cases; auto dest: bipartite_E)+
[PROOF STATE]
proof (state)
this:
p = [y]
(x, y) \<in> \<^bold>E

goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> TER h) \<or> x \<in> TER h
[PROOF STEP]
show "(\<exists>z\<in>set p. z \<in> TER h) \<or> x \<in> TER h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>z\<in>set p. z \<in> TER h) \<or> x \<in> TER h
[PROOF STEP]
proof(rule disjCI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> TER h \<Longrightarrow> \<exists>z\<in>set p. z \<in> TER h
[PROOF STEP]
assume "x \<notin> TER h"
[PROOF STATE]
proof (state)
this:
x \<notin> TER h

goal (1 subgoal):
 1. x \<notin> TER h \<Longrightarrow> \<exists>z\<in>set p. z \<in> TER h
[PROOF STEP]
hence "x \<in> X"
[PROOF STATE]
proof (prove)
using this:
x \<notin> TER h

goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<notin> TER h
x \<in> A \<Gamma>

goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
by(auto simp add: SAT.simps SINK.simps h_OUT split: if_split_asm)
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (1 subgoal):
 1. x \<notin> TER h \<Longrightarrow> \<exists>z\<in>set p. z \<in> TER h
[PROOF STEP]
hence "y \<in> TER h"
[PROOF STATE]
proof (prove)
using this:
x \<in> X

goal (1 subgoal):
 1. y \<in> TER h
[PROOF STEP]
using xy currentD_OUT[OF h y]
[PROOF STATE]
proof (prove)
using this:
x \<in> X
(x, y) \<in> \<^bold>E
d_OUT h y = 0

goal (1 subgoal):
 1. y \<in> TER h
[PROOF STEP]
by(auto simp add: SAT.simps h_IN SINK.simps)
[PROOF STATE]
proof (state)
this:
y \<in> TER h

goal (1 subgoal):
 1. x \<notin> TER h \<Longrightarrow> \<exists>z\<in>set p. z \<in> TER h
[PROOF STEP]
thus "\<exists>z\<in>set p. z \<in> TER h"
[PROOF STATE]
proof (prove)
using this:
y \<in> TER h

goal (1 subgoal):
 1. \<exists>z\<in>set p. z \<in> TER h
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>z\<in>set p. z \<in> TER h

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>z\<in>set p. z \<in> TER h) \<or> x \<in> TER h

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
separating \<Gamma> (TER h)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
separating \<Gamma> (TER h)
[PROOF STEP]
have w: "wave \<Gamma> h"
[PROOF STATE]
proof (prove)
using this:
separating \<Gamma> (TER h)

goal (1 subgoal):
 1. wave \<Gamma> h
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
separating \<Gamma> (TER h)
current \<Gamma> h

goal (1 subgoal):
 1. wave \<Gamma> h
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
wave \<Gamma> h

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "xx \<in> A \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xx \<in> A \<Gamma>
[PROOF STEP]
using xx X_A
[PROOF STATE]
proof (prove)
using this:
xx \<in> X
X \<subseteq> A \<Gamma>

goal (1 subgoal):
 1. xx \<in> A \<Gamma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
xx \<in> A \<Gamma>

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
xx \<in> A \<Gamma>

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "xx \<notin> \<E> (TER h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xx \<notin> \<E> (TER h)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xx \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
assume "xx \<in> \<E> (TER h)"
[PROOF STATE]
proof (state)
this:
xx \<in> \<E> (TER h)

goal (1 subgoal):
 1. xx \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xx \<in> \<E> (TER h)
[PROOF STEP]
obtain p y where y: "y \<in> B \<Gamma>" and p: "path \<Gamma> xx p y"
      and bypass: "\<And>z. \<lbrakk> xx \<noteq> y; z \<in> set p \<rbrakk> \<Longrightarrow> z = xx \<or> z \<notin> TER h"
[PROOF STATE]
proof (prove)
using this:
xx \<in> \<E> (TER h)

goal (1 subgoal):
 1. (\<And>y p. \<lbrakk>y \<in> B \<Gamma>; path \<Gamma> xx p y; \<And>z. \<lbrakk>xx \<noteq> y; z \<in> set p\<rbrakk> \<Longrightarrow> z = xx \<or> z \<notin> TER h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(rule \<E>_E) auto
[PROOF STATE]
proof (state)
this:
y \<in> B \<Gamma>
path \<Gamma> xx p y
\<lbrakk>xx \<noteq> y; ?z \<in> set p\<rbrakk> \<Longrightarrow> ?z = xx \<or> ?z \<notin> TER h

goal (1 subgoal):
 1. xx \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
path \<Gamma> xx p y
[PROOF STEP]
obtain [simp]: "p = [y]" and xy: "edge \<Gamma> xx y" and neq: "xx \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
path \<Gamma> xx p y

goal (1 subgoal):
 1. (\<lbrakk>p = [y]; edge \<Gamma> xx y; xx \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using disjoint X_A xx y
[PROOF STATE]
proof (prove)
using this:
path \<Gamma> xx p y
A \<Gamma> \<inter> B \<Gamma> = {}
X \<subseteq> A \<Gamma>
xx \<in> X
y \<in> B \<Gamma>

goal (1 subgoal):
 1. (\<lbrakk>p = [y]; edge \<Gamma> xx y; xx \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by -(erule rtrancl_path.cases; auto dest: bipartite_E)+
[PROOF STATE]
proof (state)
this:
p = [y]
edge \<Gamma> xx y
xx \<noteq> y

goal (1 subgoal):
 1. xx \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
from neq bypass[of y]
[PROOF STATE]
proof (chain)
picking this:
xx \<noteq> y
\<lbrakk>xx \<noteq> y; y \<in> set p\<rbrakk> \<Longrightarrow> y = xx \<or> y \<notin> TER h
[PROOF STEP]
have "y \<notin> TER h"
[PROOF STATE]
proof (prove)
using this:
xx \<noteq> y
\<lbrakk>xx \<noteq> y; y \<in> set p\<rbrakk> \<Longrightarrow> y = xx \<or> y \<notin> TER h

goal (1 subgoal):
 1. y \<notin> TER h
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<notin> TER h

goal (1 subgoal):
 1. xx \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y \<notin> TER h

goal (1 subgoal):
 1. xx \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
from xy xx currentD_OUT[OF h y]
[PROOF STATE]
proof (chain)
picking this:
edge \<Gamma> xx y
xx \<in> X
d_OUT h y = 0
[PROOF STEP]
have "y \<in> TER h"
[PROOF STATE]
proof (prove)
using this:
edge \<Gamma> xx y
xx \<in> X
d_OUT h y = 0

goal (1 subgoal):
 1. y \<in> TER h
[PROOF STEP]
by(auto simp add: SAT.simps h_IN SINK.simps)
[PROOF STATE]
proof (state)
this:
y \<in> TER h

goal (1 subgoal):
 1. xx \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y \<notin> TER h
y \<in> TER h
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y \<notin> TER h
y \<in> TER h

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
xx \<notin> \<E> (TER h)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
xx \<notin> \<E> (TER h)

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
have "d_OUT h xx < weight \<Gamma> xx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h xx < weight \<Gamma> xx
[PROOF STEP]
using fxx xx
[PROOF STATE]
proof (prove)
using this:
f xx < weight \<Gamma> xx
xx \<in> X

goal (1 subgoal):
 1. d_OUT h xx < weight \<Gamma> xx
[PROOF STEP]
by(simp add: h_OUT)
[PROOF STATE]
proof (state)
this:
d_OUT h xx < weight \<Gamma> xx

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
xx \<in> A \<Gamma>
xx \<notin> \<E> (TER h)
d_OUT h xx < weight \<Gamma> xx
[PROOF STEP]
have "hindrance \<Gamma> h"
[PROOF STATE]
proof (prove)
using this:
xx \<in> A \<Gamma>
xx \<notin> \<E> (TER h)
d_OUT h xx < weight \<Gamma> xx

goal (1 subgoal):
 1. hindrance \<Gamma> h
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
hindrance \<Gamma> h

goal (1 subgoal):
 1. \<not> (\<forall>X\<subseteq>A \<Gamma>. finite X \<longrightarrow> integral\<^sup>N (count_space X) (weight \<Gamma>) \<le> integral\<^sup>N (count_space (\<^bold>E `` X)) (weight \<Gamma>)) \<Longrightarrow> hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hindrance \<Gamma> h
[PROOF STEP]
show "hindered \<Gamma>"
[PROOF STATE]
proof (prove)
using this:
hindrance \<Gamma> h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
using h w
[PROOF STATE]
proof (prove)
using this:
hindrance \<Gamma> h
current \<Gamma> h
wave \<Gamma> h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
hindered \<Gamma>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(973646::nat) + 6475 = 980121"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 973646 + 6475 = 980121
[PROOF STEP]
by simp


[STATEMENT]
lemma basis_row_space_iarrays_eq:
fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
shows "basis_row_space_iarrays (matrix_to_iarray A) = set (map (\<lambda>i. row_iarray i (Gauss_Jordan_iarrays (matrix_to_iarray A))) [0..<(rank_iarray (matrix_to_iarray A))])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_row_space_iarrays (matrix_to_iarray A) = set (map (\<lambda>i. row_iarray i (Gauss_Jordan_iarrays (matrix_to_iarray A))) [0..<rank_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding basis_row_space_iarrays_def Let_def rank_iarrays_code
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (Gauss_Jordan_iarrays (matrix_to_iarray A))) [0..<length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays (matrix_to_iarray A))))]) = set (map (\<lambda>i. row_iarray i (Gauss_Jordan_iarrays (matrix_to_iarray A))) [0..<length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays (matrix_to_iarray A))))])
[PROOF STEP]
..