[STATEMENT]
lemma Cauchy_Pair:
  assumes "Cauchy X" and "Cauchy Y"
  shows "Cauchy (\<lambda>n. (X n :: 'a::metric_space, Y n :: 'a::metric_space))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy (\<lambda>n. (X n, Y n))
[PROOF STEP]
proof (rule metric_CauchyI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m, Y m) (X n, Y n) < e
[PROOF STEP]
fix r :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m, Y m) (X n, Y n) < e
[PROOF STEP]
assume "0 < r"
[PROOF STATE]
proof (state)
this:
0 < r

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m, Y m) (X n, Y n) < e
[PROOF STEP]
hence "0 < r / sqrt 2" (is "0 < ?s")
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. 0 < r / sqrt 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < r / sqrt 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m, Y m) (X n, Y n) < e
[PROOF STEP]
obtain M where M: "\<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < ?s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < r / sqrt 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using metric_CauchyD [OF \<open>Cauchy X\<close> \<open>0 < ?s\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < r / sqrt 2

goal (1 subgoal):
 1. (\<And>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < r / sqrt 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < r / sqrt 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m, Y m) (X n, Y n) < e
[PROOF STEP]
obtain N where N: "\<forall>m\<ge>N. \<forall>n\<ge>N. dist (Y m) (Y n) < ?s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. \<forall>m\<ge>N. \<forall>n\<ge>N. dist (Y m) (Y n) < r / sqrt 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using metric_CauchyD [OF \<open>Cauchy Y\<close> \<open>0 < ?s\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (Y m) (Y n) < r / sqrt 2

goal (1 subgoal):
 1. (\<And>N. \<forall>m\<ge>N. \<forall>n\<ge>N. dist (Y m) (Y n) < r / sqrt 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>m\<ge>N. \<forall>n\<ge>N. dist (Y m) (Y n) < r / sqrt 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m, Y m) (X n, Y n) < e
[PROOF STEP]
have "\<forall>m\<ge>max M N. \<forall>n\<ge>max M N. dist (X m, Y m) (X n, Y n) < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m\<ge>max M N. \<forall>n\<ge>max M N. dist (X m, Y m) (X n, Y n) < r
[PROOF STEP]
using M N
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < r / sqrt 2
\<forall>m\<ge>N. \<forall>n\<ge>N. dist (Y m) (Y n) < r / sqrt 2

goal (1 subgoal):
 1. \<forall>m\<ge>max M N. \<forall>n\<ge>max M N. dist (X m, Y m) (X n, Y n) < r
[PROOF STEP]
by (simp add: real_sqrt_sum_squares_less dist_Pair_Pair)
[PROOF STATE]
proof (state)
this:
\<forall>m\<ge>max M N. \<forall>n\<ge>max M N. dist (X m, Y m) (X n, Y n) < r

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m, Y m) (X n, Y n) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m\<ge>max M N. \<forall>n\<ge>max M N. dist (X m, Y m) (X n, Y n) < r
[PROOF STEP]
show "\<exists>n0. \<forall>m\<ge>n0. \<forall>n\<ge>n0. dist (X m, Y m) (X n, Y n) < r"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<ge>max M N. \<forall>n\<ge>max M N. dist (X m, Y m) (X n, Y n) < r

goal (1 subgoal):
 1. \<exists>n0. \<forall>m\<ge>n0. \<forall>n\<ge>n0. dist (X m, Y m) (X n, Y n) < r
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>n0. \<forall>m\<ge>n0. \<forall>n\<ge>n0. dist (X m, Y m) (X n, Y n) < r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_mult_le_iff:
  fixes i :: "'a :: len word"
  assumes knz: "0 < k"
  and     uik: "unat i * unat k < 2 ^ len_of TYPE ('a)"
  and     ujk: "unat j * unat k < 2 ^ len_of TYPE ('a)"
  shows  "(i * k \<le> j * k) = (i \<le> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i * k \<le> j * k) = (i \<le> j)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i * k \<le> j * k \<Longrightarrow> i \<le> j
 2. i \<le> j \<Longrightarrow> i * k \<le> j * k
[PROOF STEP]
assume "i \<le> j"
[PROOF STATE]
proof (state)
this:
i \<le> j

goal (2 subgoals):
 1. i * k \<le> j * k \<Longrightarrow> i \<le> j
 2. i \<le> j \<Longrightarrow> i * k \<le> j * k
[PROOF STEP]
show "i * k \<le> j * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i * k \<le> j * k
[PROOF STEP]
by (rule word_mult_le_mono1) fact+
[PROOF STATE]
proof (state)
this:
i * k \<le> j * k

goal (1 subgoal):
 1. i * k \<le> j * k \<Longrightarrow> i \<le> j
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i * k \<le> j * k \<Longrightarrow> i \<le> j
[PROOF STEP]
assume p: "i * k \<le> j * k"
[PROOF STATE]
proof (state)
this:
i * k \<le> j * k

goal (1 subgoal):
 1. i * k \<le> j * k \<Longrightarrow> i \<le> j
[PROOF STEP]
have "0 < unat k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < unat k
[PROOF STEP]
using knz
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. 0 < unat k
[PROOF STEP]
by (simp add: word_less_nat_alt)
[PROOF STATE]
proof (state)
this:
0 < unat k

goal (1 subgoal):
 1. i * k \<le> j * k \<Longrightarrow> i \<le> j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < unat k
[PROOF STEP]
show "i \<le> j"
[PROOF STATE]
proof (prove)
using this:
0 < unat k

goal (1 subgoal):
 1. i \<le> j
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
0 < unat k
i * k \<le> j * k

goal (1 subgoal):
 1. i \<le> j
[PROOF STEP]
by (clarsimp simp: word_le_nat_alt iffD1 [OF unat_mult_lem uik]
      iffD1 [OF unat_mult_lem ujk])
[PROOF STATE]
proof (state)
this:
i \<le> j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sup_inf_distrib2:
 "((y :: 'a :: distrib_lattice) \<sqinter> z) \<squnion> x = (y \<squnion> x) \<sqinter> (z \<squnion> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> z \<squnion> x = (y \<squnion> x) \<sqinter> (z \<squnion> x)
[PROOF STEP]
quickcheck[expect = no_counterexample]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> z \<squnion> x = (y \<squnion> x) \<sqinter> (z \<squnion> x)
[PROOF STEP]
by(simp add: inf_sup_aci sup_inf_distrib1)


[STATEMENT]
lemma linord_of_listP_append:
  "linord_of_listP x y (xs @ ys) \<longleftrightarrow> linord_of_listP x y xs \<or> linord_of_listP x y ys \<or> (y \<in> set xs \<and> x \<in> set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linord_of_listP x y (xs @ ys) = (linord_of_listP x y xs \<or> linord_of_listP x y ys \<or> y \<in> set xs \<and> x \<in> set ys)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma find_fst_non0_in_row:
  assumes A: "A \<in> carrier_mat m n"
  and res: "find_fst_non0_in_row l A = Some j"
  shows "A $$ (l,j) \<noteq> 0" "l \<le> j" "j < dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (l, j) \<noteq> 0 &&& l \<le> j &&& j < dim_col A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. A $$ (l, j) \<noteq> 0
 2. l \<le> j
 3. j < dim_col A
[PROOF STEP]
let ?xs = "filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l ..< dim_col A]"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. A $$ (l, j) \<noteq> 0
 2. l \<le> j
 3. j < dim_col A
[PROOF STEP]
from res[unfolded find_fst_non0_in_row_def Let_def]
[PROOF STATE]
proof (chain)
picking this:
(case filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] of [] \<Rightarrow> None | a # list \<Rightarrow> Some (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] ! 0)) = Some j
[PROOF STEP]
have xs: "?xs \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
(case filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] of [] \<Rightarrow> None | a # list \<Rightarrow> Some (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] ! 0)) = Some j

goal (1 subgoal):
 1. filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] \<noteq> []
[PROOF STEP]
by (cases ?xs, auto)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] \<noteq> []

goal (3 subgoals):
 1. A $$ (l, j) \<noteq> 0
 2. l \<le> j
 3. j < dim_col A
[PROOF STEP]
have j_in_xs: "j \<in> set ?xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<in> set (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A])
[PROOF STEP]
using res
[PROOF STATE]
proof (prove)
using this:
find_fst_non0_in_row l A = Some j

goal (1 subgoal):
 1. j \<in> set (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A])
[PROOF STEP]
unfolding find_fst_non0_in_row_def Let_def
[PROOF STATE]
proof (prove)
using this:
(case filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] of [] \<Rightarrow> None | a # list \<Rightarrow> Some (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A] ! 0)) = Some j

goal (1 subgoal):
 1. j \<in> set (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A])
[PROOF STEP]
by (metis (no_types, lifting) length_greater_0_conv list.case(2) list.exhaust nth_mem option.simps(1) xs)
[PROOF STATE]
proof (state)
this:
j \<in> set (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A])

goal (3 subgoals):
 1. A $$ (l, j) \<noteq> 0
 2. l \<le> j
 3. j < dim_col A
[PROOF STEP]
show "A $$ (l,j) \<noteq> 0" "l \<le> j" "j < dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (l, j) \<noteq> 0 &&& l \<le> j &&& j < dim_col A
[PROOF STEP]
using j_in_xs
[PROOF STATE]
proof (prove)
using this:
j \<in> set (filter (\<lambda>j. A $$ (l, j) \<noteq> 0) [l..<dim_col A])

goal (1 subgoal):
 1. A $$ (l, j) \<noteq> 0 &&& l \<le> j &&& j < dim_col A
[PROOF STEP]
by auto+
[PROOF STATE]
proof (state)
this:
A $$ (l, j) \<noteq> 0
l \<le> j
j < dim_col A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ran_map_upd_Some:
  "\<lbrakk> m x = Some y; inj_on m (dom m); z \<notin> ran m \<rbrakk> \<Longrightarrow> ran(m(x := Some z)) = ran m - {y} \<union> {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m x = Some y; inj_on m (dom m); z \<notin> ran m\<rbrakk> \<Longrightarrow> ran (m(x \<mapsto> z)) = ran m - {y} \<union> {z}
[PROOF STEP]
by(force simp add: ran_def domI inj_onD)


[STATEMENT]
lemma subsetAllocation:
  assumes "a \<in> allocationsUniverse" "c \<subseteq> a"
  shows "c \<in> allocationsUniverse"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> allocationsUniverse
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<in> allocationsUniverse
[PROOF STEP]
have "c=a-(a-c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c = a - (a - c)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
c \<subseteq> a

goal (1 subgoal):
 1. c = a - (a - c)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c = a - (a - c)

goal (1 subgoal):
 1. c \<in> allocationsUniverse
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
c = a - (a - c)

goal (1 subgoal):
 1. c \<in> allocationsUniverse
[PROOF STEP]
using assms(1) reducedAllocation
[PROOF STATE]
proof (prove)
using this:
c = a - (a - c)
a \<in> allocationsUniverse
?a \<in> allocationsUniverse \<Longrightarrow> ?a - ?b \<in> allocationsUniverse

goal (1 subgoal):
 1. c \<in> allocationsUniverse
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
c \<in> allocationsUniverse

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UINF_atLeast_first:
  "P(n) \<sqinter> (\<Sqinter> i \<in> {Suc n..} \<bullet> P(i)) = (\<Sqinter> i \<in> {n..} \<bullet> P(i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n \<sqinter> (\<Sqinter> i \<in> {Suc n..} \<bullet> P i) = (\<Sqinter> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P n \<sqinter> (\<Sqinter> i \<in> {Suc n..} \<bullet> P i) = (\<Sqinter> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
have "insert n {Suc n..} = {n..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert n {Suc n..} = {n..}
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
insert n {Suc n..} = {n..}

goal (1 subgoal):
 1. P n \<sqinter> (\<Sqinter> i \<in> {Suc n..} \<bullet> P i) = (\<Sqinter> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
insert n {Suc n..} = {n..}

goal (1 subgoal):
 1. P n \<sqinter> (\<Sqinter> i \<in> {Suc n..} \<bullet> P i) = (\<Sqinter> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
by (metis UINF_insert)
[PROOF STATE]
proof (state)
this:
P n \<sqinter> (\<Sqinter> i \<in> {Suc n..} \<bullet> P i) = (\<Sqinter> i \<in> {n..} \<bullet> P i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma properfactor_hom:
  assumes "h \<in> ring_iso R S"
  assumes "domain R" "domain S"
  assumes "x \<in> carrier R" "b \<in> carrier R"
  shows "properfactor R b x \<longleftrightarrow> properfactor S (h b) (h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properfactor R b x = properfactor S (h b) (h x)
[PROOF STEP]
using divides_hom[OF assms(1,2,3)] assms(4,5)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> ?x divides\<^bsub>R\<^esub> ?y = h ?x divides\<^bsub>S\<^esub> h ?y
x \<in> carrier R
b \<in> carrier R

goal (1 subgoal):
 1. properfactor R b x = properfactor S (h b) (h x)
[PROOF STEP]
unfolding properfactor_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> ?x divides\<^bsub>R\<^esub> ?y = h ?x divides\<^bsub>S\<^esub> h ?y
x \<in> carrier R
b \<in> carrier R

goal (1 subgoal):
 1. (b divides\<^bsub>R\<^esub> x \<and> \<not> x divides\<^bsub>R\<^esub> b) = (h b divides\<^bsub>S\<^esub> h x \<and> \<not> h x divides\<^bsub>S\<^esub> h b)
[PROOF STEP]
by simp


[STATEMENT]
lemma generate_topology_on_eq:
  "generate_topology_on S = arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate_topology_on S = arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)
[PROOF STEP]
proof (intro ext iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. generate_topology_on S x \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x
 2. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. generate_topology_on S x \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x
 2. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
assume "?lhs A"
[PROOF STATE]
proof (state)
this:
generate_topology_on S A

goal (2 subgoals):
 1. \<And>x. generate_topology_on S x \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x
 2. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
generate_topology_on S A
[PROOF STEP]
show "?rhs A"
[PROOF STATE]
proof (prove)
using this:
generate_topology_on S A

goal (1 subgoal):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) A
[PROOF STEP]
proof induction
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>a b. \<lbrakk>generate_topology_on S a; (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) a; generate_topology_on S b; (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) b\<rbrakk> \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (a \<inter> b)
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology_on S k; \<And>k. k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) k\<rbrakk> \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (\<Union> K)
 4. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
case (Int a b)
[PROOF STATE]
proof (state)
this:
generate_topology_on S a
generate_topology_on S b
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) a
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) b

goal (4 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>a b. \<lbrakk>generate_topology_on S a; (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) a; generate_topology_on S b; (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) b\<rbrakk> \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (a \<inter> b)
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology_on S k; \<And>k. k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) k\<rbrakk> \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (\<Union> K)
 4. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
generate_topology_on S a
generate_topology_on S b
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) a
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
generate_topology_on S a
generate_topology_on S b
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) a
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) b

goal (1 subgoal):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (a \<inter> b)
[PROOF STEP]
by (metis (mono_tags, lifting) istopology_base_alt finite'_intersection_of_Int istopology_base)
[PROOF STATE]
proof (state)
this:
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (a \<inter> b)

goal (3 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology_on S k; \<And>k. k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) k\<rbrakk> \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (\<Union> K)
 3. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology_on S k; \<And>k. k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) k\<rbrakk> \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (\<Union> K)
 3. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
case (UN K)
[PROOF STATE]
proof (state)
this:
?k \<in> K \<Longrightarrow> generate_topology_on S ?k
?k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) ?k

goal (3 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology_on S k; \<And>k. k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) k\<rbrakk> \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (\<Union> K)
 3. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k \<in> K \<Longrightarrow> generate_topology_on S ?k
?k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) ?k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?k \<in> K \<Longrightarrow> generate_topology_on S ?k
?k \<in> K \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) ?k

goal (1 subgoal):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (\<Union> K)
[PROOF STEP]
by (simp add: arbitrary_union_of_Union)
[PROOF STATE]
proof (state)
this:
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) (\<Union> K)

goal (2 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
case (Basis s)
[PROOF STATE]
proof (state)
this:
s \<in> S

goal (2 subgoals):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
 2. \<And>s. s \<in> S \<Longrightarrow> (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<in> S
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
s \<in> S

goal (1 subgoal):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s
[PROOF STEP]
by (simp add: Sup_upper arbitrary_union_of_inc finite'_intersection_of_inc relative_to_subset)
[PROOF STATE]
proof (state)
this:
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) s

goal (1 subgoal):
 1. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) {}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) A

goal (1 subgoal):
 1. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
assume "?rhs A"
[PROOF STATE]
proof (state)
this:
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) A

goal (1 subgoal):
 1. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) A
[PROOF STEP]
obtain \<U> where \<U>: "\<And>T. T \<in> \<U> \<Longrightarrow> \<exists>\<F>. finite' \<F> \<and> \<F> \<subseteq> S \<and> \<Inter>\<F> = T" and eq: "A = \<Union>\<U>"
[PROOF STATE]
proof (prove)
using this:
(arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) A

goal (1 subgoal):
 1. (\<And>\<U>. \<lbrakk>\<And>T. T \<in> \<U> \<Longrightarrow> \<exists>\<F>. finite' \<F> \<and> \<F> \<subseteq> S \<and> \<Inter> \<F> = T; A = \<Union> \<U>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding union_of_def intersection_of_def
[PROOF STATE]
proof (prove)
using this:
\<exists>\<U>. arbitrary \<U> \<and> \<U> \<subseteq> {Sa. \<exists>\<U>. finite' \<U> \<and> \<U> \<subseteq> {x. x \<in> S} \<and> \<Inter> \<U> = Sa} \<and> \<Union> \<U> = A

goal (1 subgoal):
 1. (\<And>\<U>. \<lbrakk>\<And>T. T \<in> \<U> \<Longrightarrow> \<exists>\<F>. finite' \<F> \<and> \<F> \<subseteq> S \<and> \<Inter> \<F> = T; A = \<Union> \<U>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?T \<in> \<U> \<Longrightarrow> \<exists>\<F>. finite' \<F> \<and> \<F> \<subseteq> S \<and> \<Inter> \<F> = ?T
A = \<Union> \<U>

goal (1 subgoal):
 1. \<And>x. (arbitrary union_of finite' intersection_of (\<lambda>x. x \<in> S)) x \<Longrightarrow> generate_topology_on S x
[PROOF STEP]
show "?lhs A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate_topology_on S A
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate_topology_on S (\<Union> \<U>)
[PROOF STEP]
proof (rule generate_topology_on.UN)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. k \<in> \<U> \<Longrightarrow> generate_topology_on S k
[PROOF STEP]
fix T
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. k \<in> \<U> \<Longrightarrow> generate_topology_on S k
[PROOF STEP]
assume "T \<in> \<U>"
[PROOF STATE]
proof (state)
this:
T \<in> \<U>

goal (1 subgoal):
 1. \<And>k. k \<in> \<U> \<Longrightarrow> generate_topology_on S k
[PROOF STEP]
with \<U>
[PROOF STATE]
proof (chain)
picking this:
?T \<in> \<U> \<Longrightarrow> \<exists>\<F>. finite' \<F> \<and> \<F> \<subseteq> S \<and> \<Inter> \<F> = ?T
T \<in> \<U>
[PROOF STEP]
obtain \<F> where "finite' \<F>" "\<F> \<subseteq> S" "\<Inter>\<F> = T"
[PROOF STATE]
proof (prove)
using this:
?T \<in> \<U> \<Longrightarrow> \<exists>\<F>. finite' \<F> \<and> \<F> \<subseteq> S \<and> \<Inter> \<F> = ?T
T \<in> \<U>

goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite' \<F>; \<F> \<subseteq> S; \<Inter> \<F> = T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite' \<F>
\<F> \<subseteq> S
\<Inter> \<F> = T

goal (1 subgoal):
 1. \<And>k. k \<in> \<U> \<Longrightarrow> generate_topology_on S k
[PROOF STEP]
have "generate_topology_on S (\<Inter>\<F>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate_topology_on S (\<Inter> \<F>)
[PROOF STEP]
proof (rule generate_topology_on_Inter)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite \<F>
 2. \<And>K. K \<in> \<F> \<Longrightarrow> generate_topology_on S K
 3. \<F> \<noteq> {}
[PROOF STEP]
show "finite \<F>" "\<F> \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite \<F> &&& \<F> \<noteq> {}
[PROOF STEP]
by (auto simp: \<open>finite' \<F>\<close>)
[PROOF STATE]
proof (state)
this:
finite \<F>
\<F> \<noteq> {}

goal (1 subgoal):
 1. \<And>K. K \<in> \<F> \<Longrightarrow> generate_topology_on S K
[PROOF STEP]
show "\<And>K. K \<in> \<F> \<Longrightarrow> generate_topology_on S K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>K. K \<in> \<F> \<Longrightarrow> generate_topology_on S K
[PROOF STEP]
by (metis \<open>\<F> \<subseteq> S\<close> generate_topology_on.simps subset_iff)
[PROOF STATE]
proof (state)
this:
?K \<in> \<F> \<Longrightarrow> generate_topology_on S ?K

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
generate_topology_on S (\<Inter> \<F>)

goal (1 subgoal):
 1. \<And>k. k \<in> \<U> \<Longrightarrow> generate_topology_on S k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
generate_topology_on S (\<Inter> \<F>)
[PROOF STEP]
show "generate_topology_on S T"
[PROOF STATE]
proof (prove)
using this:
generate_topology_on S (\<Inter> \<F>)

goal (1 subgoal):
 1. generate_topology_on S T
[PROOF STEP]
using \<open>\<Inter>\<F> = T\<close>
[PROOF STATE]
proof (prove)
using this:
generate_topology_on S (\<Inter> \<F>)
\<Inter> \<F> = T

goal (1 subgoal):
 1. generate_topology_on S T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
generate_topology_on S T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
generate_topology_on S A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_connected_continuous_image:
  assumes contf: "continuous_on S f"
    and "path_connected S"
  shows "path_connected (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (f ` S)
[PROOF STEP]
unfolding path_connected_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>f ` S. \<forall>y\<in>f ` S. \<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
proof (rule, rule)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> f ` S; y \<in> f ` S\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
fix x' y'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> f ` S; y \<in> f ` S\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
assume "x' \<in> f ` S" "y' \<in> f ` S"
[PROOF STATE]
proof (state)
this:
x' \<in> f ` S
y' \<in> f ` S

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> f ` S; y \<in> f ` S\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x' \<in> f ` S
y' \<in> f ` S
[PROOF STEP]
obtain x y where x: "x \<in> S" and y: "y \<in> S" and x': "x' = f x" and y': "y' = f y"
[PROOF STATE]
proof (prove)
using this:
x' \<in> f ` S
y' \<in> f ` S

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> S; y \<in> S; x' = f x; y' = f y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> S
y \<in> S
x' = f x
y' = f y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> f ` S; y \<in> f ` S\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
from x y
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
y \<in> S
[PROOF STEP]
obtain g where "path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> S
y \<in> S

goal (1 subgoal):
 1. (\<And>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)[unfolded path_connected_def]
[PROOF STATE]
proof (prove)
using this:
x \<in> S
y \<in> S
\<forall>x\<in>S. \<forall>y\<in>S. \<exists>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y

goal (1 subgoal):
 1. (\<And>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> f ` S; y \<in> f ` S\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
show "\<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x' \<and> pathfinish g = y'"
[PROOF STATE]
proof (prove)
using this:
path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y

goal (1 subgoal):
 1. \<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x' \<and> pathfinish g = y'
[PROOF STEP]
unfolding x' y' path_defs
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g \<and> g ` {0..1} \<subseteq> S \<and> g 0 = x \<and> g 1 = y

goal (1 subgoal):
 1. \<exists>g. continuous_on {0..1} g \<and> g ` {0..1} \<subseteq> f ` S \<and> g 0 = f x \<and> g 1 = f y
[PROOF STEP]
by (fastforce intro: continuous_on_compose continuous_on_subset[OF contf])
[PROOF STATE]
proof (state)
this:
\<exists>g. path g \<and> path_image g \<subseteq> f ` S \<and> pathstart g = x' \<and> pathfinish g = y'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_minimal_antichain[simp]: "finite A \<Longrightarrow> finite (minimal_antichain A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> finite (minimal_antichain A)
[PROOF STEP]
unfolding minimal_antichain_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> finite {x \<in> A. \<not> (\<exists>y\<in>A. y < x)}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in cpx_sq_mat) meas_outcome_prob_sum:
  assumes "density_operator R"
  and "R\<in> fc_mats"
  and" proj_measurement n M"
shows "(\<Sum> j \<in> {..< n}. meas_outcome_prob R M j) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
have "(\<Sum> j \<in> {..< n}. Complex_Matrix.trace (R* (meas_outcome_prj (M j)))) =
    Complex_Matrix.trace (sum_mat (\<lambda>j. R* (meas_outcome_prj (M j))) {..< n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. Complex_Matrix.trace (R * meas_outcome_prj (M j))) = Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n})
[PROOF STEP]
proof (rule trace_sum_mat[symmetric], auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. j < n \<Longrightarrow> R * meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. j < n \<Longrightarrow> R * meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
assume "j < n"
[PROOF STATE]
proof (state)
this:
j < n

goal (1 subgoal):
 1. \<And>j. j < n \<Longrightarrow> R * meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
thus "R * meas_outcome_prj (M j) \<in> fc_mats"
[PROOF STATE]
proof (prove)
using this:
j < n

goal (1 subgoal):
 1. R * meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
using cpx_sq_mat_mult assms
[PROOF STATE]
proof (prove)
using this:
j < n
\<lbrakk>?A \<in> fc_mats; ?B \<in> fc_mats\<rbrakk> \<Longrightarrow> ?A * ?B \<in> fc_mats
density_operator R
R \<in> fc_mats
proj_measurement n M

goal (1 subgoal):
 1. R * meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
unfolding proj_measurement_def
[PROOF STATE]
proof (prove)
using this:
j < n
\<lbrakk>?A \<in> fc_mats; ?B \<in> fc_mats\<rbrakk> \<Longrightarrow> ?A * ?B \<in> fc_mats
density_operator R
R \<in> fc_mats
inj_on (\<lambda>i. meas_outcome_val (M i)) {..<n} \<and> (\<forall>j<n. meas_outcome_prj (M j) \<in> fc_mats \<and> projector (meas_outcome_prj (M j))) \<and> (\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> meas_outcome_prj (M i) * meas_outcome_prj (M j) = 0\<^sub>m dimR dimR) \<and> local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n} = 1\<^sub>m dimR

goal (1 subgoal):
 1. R * meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R * meas_outcome_prj (M j) \<in> fc_mats

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. Complex_Matrix.trace (R * meas_outcome_prj (M j))) = Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n})

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. Complex_Matrix.trace (R * meas_outcome_prj (M j))) = Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n})

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
have "... = Complex_Matrix.trace (R * (sum_mat (\<lambda>j. (meas_outcome_prj (M j))) {..< n}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n})
[PROOF STEP]
have "sum_mat (\<lambda>j. R* (meas_outcome_prj (M j))) {..< n} =
      R * (sum_mat (\<lambda>j. (meas_outcome_prj (M j))) {..< n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n} = R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}
[PROOF STEP]
proof (rule mult_sum_mat_distrib_left, (auto simp add: assms))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. j < n \<Longrightarrow> meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j. j < n \<Longrightarrow> meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
assume "j < n"
[PROOF STATE]
proof (state)
this:
j < n

goal (1 subgoal):
 1. \<And>j. j < n \<Longrightarrow> meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
thus "meas_outcome_prj (M j) \<in> fc_mats"
[PROOF STATE]
proof (prove)
using this:
j < n

goal (1 subgoal):
 1. meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
j < n
density_operator R
R \<in> fc_mats
proj_measurement n M

goal (1 subgoal):
 1. meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
unfolding proj_measurement_def
[PROOF STATE]
proof (prove)
using this:
j < n
density_operator R
R \<in> fc_mats
inj_on (\<lambda>i. meas_outcome_val (M i)) {..<n} \<and> (\<forall>j<n. meas_outcome_prj (M j) \<in> fc_mats \<and> projector (meas_outcome_prj (M j))) \<and> (\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> meas_outcome_prj (M i) * meas_outcome_prj (M j) = 0\<^sub>m dimR dimR) \<and> local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n} = 1\<^sub>m dimR

goal (1 subgoal):
 1. meas_outcome_prj (M j) \<in> fc_mats
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
meas_outcome_prj (M j) \<in> fc_mats

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n} = R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}

goal (1 subgoal):
 1. Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n} = R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}

goal (1 subgoal):
 1. Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n})

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (local.sum_mat (\<lambda>j. R * meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n})

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
have "... = Complex_Matrix.trace (R * 1\<^sub>m dimR)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * 1\<^sub>m dimR)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
density_operator R
R \<in> fc_mats
proj_measurement n M

goal (1 subgoal):
 1. Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * 1\<^sub>m dimR)
[PROOF STEP]
unfolding proj_measurement_def
[PROOF STATE]
proof (prove)
using this:
density_operator R
R \<in> fc_mats
inj_on (\<lambda>i. meas_outcome_val (M i)) {..<n} \<and> (\<forall>j<n. meas_outcome_prj (M j) \<in> fc_mats \<and> projector (meas_outcome_prj (M j))) \<and> (\<forall>i<n. \<forall>j<n. i \<noteq> j \<longrightarrow> meas_outcome_prj (M i) * meas_outcome_prj (M j) = 0\<^sub>m dimR dimR) \<and> local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n} = 1\<^sub>m dimR

goal (1 subgoal):
 1. Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * 1\<^sub>m dimR)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * 1\<^sub>m dimR)

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (R * local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<n}) = Complex_Matrix.trace (R * 1\<^sub>m dimR)

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
have "... = Complex_Matrix.trace R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (R * 1\<^sub>m dimR) = Complex_Matrix.trace R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
density_operator R
R \<in> fc_mats
proj_measurement n M

goal (1 subgoal):
 1. Complex_Matrix.trace (R * 1\<^sub>m dimR) = Complex_Matrix.trace R
[PROOF STEP]
by (simp add: fc_mats_carrier dim_eq)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (R * 1\<^sub>m dimR) = Complex_Matrix.trace R

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (R * 1\<^sub>m dimR) = Complex_Matrix.trace R

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace R = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
density_operator R
R \<in> fc_mats
proj_measurement n M

goal (1 subgoal):
 1. Complex_Matrix.trace R = 1
[PROOF STEP]
unfolding density_operator_def
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.positive R \<and> Complex_Matrix.trace R = 1
R \<in> fc_mats
proj_measurement n M

goal (1 subgoal):
 1. Complex_Matrix.trace R = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace R = 1

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j<n. Complex_Matrix.trace (R * meas_outcome_prj (M j))) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<n. Complex_Matrix.trace (R * meas_outcome_prj (M j))) = 1

goal (1 subgoal):
 1. sum (meas_outcome_prob R M) {..<n} = 1
[PROOF STEP]
unfolding meas_outcome_prob_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<n. Complex_Matrix.trace (R * meas_outcome_prj (M j))) = 1

goal (1 subgoal):
 1. (\<Sum>j<n. Complex_Matrix.trace (R * meas_outcome_prj (M j))) = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum (meas_outcome_prob R M) {..<n} = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma per_mid_per:
  assumes (*"A \<noteq> B" and*)
    "Per X A B" and
    "M Midpoint A B" and
    "M Midpoint X Y"
  shows "Cong A X B Y \<and> Per Y B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong A X B Y \<and> Per Y B A
[PROOF STEP]
by (meson Cong3_def Mid_perm assms(1) assms(2) assms(3) l7_13 l8_10)


[STATEMENT]
lemma neg_meas_setI:
  assumes "E \<in> sets M"
    and "\<And>A. A \<in> sets M \<Longrightarrow> A \<subseteq> E \<Longrightarrow> \<mu> A \<le> 0"
  shows "neg_meas_set E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neg_meas_set E
[PROOF STEP]
unfolding neg_meas_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> E \<longrightarrow> \<mu> A \<le> 0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
E \<in> sets M
\<lbrakk>?A \<in> sets M; ?A \<subseteq> E\<rbrakk> \<Longrightarrow> \<mu> ?A \<le> 0

goal (1 subgoal):
 1. E \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> E \<longrightarrow> \<mu> A \<le> 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma quasi_transI[intro]:
  "(\<And>x y z. \<lbrakk> x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z \<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z) \<Longrightarrow> quasi_trans r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z) \<Longrightarrow> quasi_trans r
[PROOF STEP]
unfolding quasi_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z) \<Longrightarrow> \<forall>x y z. x \<^bsub>r\<^esub>\<prec> y \<and> y \<^bsub>r\<^esub>\<prec> z \<longrightarrow> x \<^bsub>r\<^esub>\<prec> z
[PROOF STEP]
by blast


[STATEMENT]
lemma sorted_list_of_set_split:
  assumes "finite X"
  shows "sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
proof (induction "card X" arbitrary: X)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}; Suc x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
case (Suc n X)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X

goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}; Suc x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "sorted_list_of_set X = Min X # sorted_list_of_set (X - {Min X})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set X = Min X # sorted_list_of_set (X - {Min X})
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X

goal (1 subgoal):
 1. sorted_list_of_set X = Min X # sorted_list_of_set (X - {Min X})
[PROOF STEP]
by (auto intro: sorted_list_of_set_nonempty)
[PROOF STATE]
proof (state)
this:
sorted_list_of_set X = Min X # sorted_list_of_set (X - {Min X})

goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}; Suc x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sorted_list_of_set X = Min X # sorted_list_of_set (X - {Min X})

goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}; Suc x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "\<dots> = Min X # sorted_list_of_set {x \<in> (X - {Min X}). x < y} @ sorted_list_of_set {x \<in> (X - {Min X}). y \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min X # sorted_list_of_set (X - {Min X}) = Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}
[PROOF STEP]
using Suc card.remove[OF Suc(3) Min_in] card.empty
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X
\<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> card X = Suc (card (X - {Min X}))
card {} = 0

goal (1 subgoal):
 1. Min X # sorted_list_of_set (X - {Min X}) = Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}
[PROOF STEP]
by (fastforce simp: Suc(1))+
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set (X - {Min X}) = Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}

goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}; Suc x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set (X - {Min X}) = Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}

goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}; Suc x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "\<dots> = sorted_list_of_set ({x \<in> X. x < y}) @ sorted_list_of_set {x \<in> X. y \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
proof (cases "Min X < y")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Min X < y

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
hence Min_eq: "Min X = Min {x \<in> X. x < y}"
[PROOF STATE]
proof (prove)
using this:
Min X < y

goal (1 subgoal):
 1. Min X = Min {x \<in> X. x < y}
[PROOF STEP]
using True Suc Min_in
[PROOF STATE]
proof (prove)
using this:
Min X < y
Min X < y
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A

goal (1 subgoal):
 1. Min X = Min {x \<in> X. x < y}
[PROOF STEP]
by (subst eq_Min_iff) fastforce+
[PROOF STATE]
proof (state)
this:
Min X = Min {x \<in> X. x < y}

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "{x \<in> (X - {Min X}). x < y} = {x \<in> X. x < y} - {Min {x \<in> X. x < y}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> X - {Min X}. x < y} = {x \<in> X. x < y} - {Min {x \<in> X. x < y}}
[PROOF STEP]
using Min_eq
[PROOF STATE]
proof (prove)
using this:
Min X = Min {x \<in> X. x < y}

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

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
hence "Min X # sorted_list_of_set {x \<in> (X - {Min X}). x < y} =
      Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}})"
[PROOF STATE]
proof (prove)
using this:
{x \<in> X - {Min X}. x < y} = {x \<in> X. x < y} - {Min {x \<in> X. x < y}}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}})
[PROOF STEP]
using Min_eq
[PROOF STATE]
proof (prove)
using this:
{x \<in> X - {Min X}. x < y} = {x \<in> X. x < y} - {Min {x \<in> X. x < y}}
Min X = Min {x \<in> X. x < y}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}})

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}})

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "\<dots> = sorted_list_of_set ({x \<in> X. x < y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}}) = sorted_list_of_set {x \<in> X. x < y}
[PROOF STEP]
using Suc True Min_in Min_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X
Min X < y
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A
Min X = Min {x \<in> X. x < y}

goal (1 subgoal):
 1. Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}}) = sorted_list_of_set {x \<in> X. x < y}
[PROOF STEP]
by (subst sorted_list_of_set_nonempty[symmetric]) fastforce+
[PROOF STATE]
proof (state)
this:
Min {x \<in> X. x < y} # sorted_list_of_set ({x \<in> X. x < y} - {Min {x \<in> X. x < y}}) = sorted_list_of_set {x \<in> X. x < y}

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = sorted_list_of_set {x \<in> X. x < y}
[PROOF STEP]
have "Min X # sorted_list_of_set {x \<in> (X - {Min X}). x < y} = sorted_list_of_set ({x \<in> X. x < y})"
[PROOF STATE]
proof (prove)
using this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = sorted_list_of_set {x \<in> X. x < y}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = sorted_list_of_set {x \<in> X. x < y}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = sorted_list_of_set {x \<in> X. x < y}

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
hence "Min X # sorted_list_of_set {x \<in> (X - {Min X}). x < y} @ sorted_list_of_set {x \<in> (X - {Min X}). y \<le> x} =
      sorted_list_of_set ({x \<in> X. x < y}) @ sorted_list_of_set {x \<in> (X - {Min X}). y \<le> x}"
[PROOF STATE]
proof (prove)
using this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} = sorted_list_of_set {x \<in> X. x < y}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}

goal (2 subgoals):
 1. Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}
Min X < y

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
by (auto simp: append_Cons[symmetric] simp del: append_Cons dest!: leD intro: arg_cong)
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> Min X < y

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have Min_eq: "Min X = Min {x \<in> X. y \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min X = Min {x \<in> X. y \<le> x}
[PROOF STEP]
using False Suc Min_in
[PROOF STATE]
proof (prove)
using this:
\<not> Min X < y
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A

goal (1 subgoal):
 1. Min X = Min {x \<in> X. y \<le> x}
[PROOF STEP]
by (subst eq_Min_iff) (fastforce simp: linorder_class.not_less)+
[PROOF STATE]
proof (state)
this:
Min X = Min {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have 2: "{x \<in> (X - {Min X}). y \<le> x} = {x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> X - {Min X}. y \<le> x} = {x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}
[PROOF STEP]
using Min_eq
[PROOF STATE]
proof (prove)
using this:
Min X = Min {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. {x \<in> X - {Min X}. y \<le> x} = {x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> X - {Min X}. y \<le> x} = {x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "x \<in> X \<Longrightarrow> \<not> x < y" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> X \<Longrightarrow> \<not> x < y
[PROOF STEP]
using False Min_less_iff Suc(3)
[PROOF STATE]
proof (prove)
using this:
\<not> Min X < y
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> (Min ?A < ?x) = (\<exists>a\<in>?A. a < ?x)
finite X

goal (1 subgoal):
 1. x \<in> X \<Longrightarrow> \<not> x < y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x3 \<in> X \<Longrightarrow> \<not> ?x3 < y

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
hence "{x \<in> X. x < y} = {}"
[PROOF STATE]
proof (prove)
using this:
?x3 \<in> X \<Longrightarrow> \<not> ?x3 < y

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

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
hence "Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} =
      Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}"
[PROOF STATE]
proof (prove)
using this:
{x \<in> X. x < y} = {}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
{x \<in> X. x < y} = {}
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "\<dots> = Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}})
[PROOF STEP]
using Min_eq 2
[PROOF STATE]
proof (prove)
using this:
Min X = Min {x \<in> X. y \<le> x}
{x \<in> X - {Min X}. y \<le> x} = {x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}})

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}})

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "\<dots> = sorted_list_of_set ({x \<in> X. y \<le> x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}) = sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
using Suc False Min_in Min_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?X3; finite ?X3\<rbrakk> \<Longrightarrow> sorted_list_of_set ?X3 = sorted_list_of_set {x \<in> ?X3. x < y} @ sorted_list_of_set {x \<in> ?X3. y \<le> x}
Suc n = card X
finite X
\<not> Min X < y
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A
Min X = Min {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}) = sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
by (subst sorted_list_of_set_nonempty[symmetric]) fastforce+
[PROOF STATE]
proof (state)
this:
Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}) = sorted_list_of_set {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Min {x \<in> X. y \<le> x} # sorted_list_of_set ({x \<in> X. y \<le> x} - {Min {x \<in> X. y \<le> x}}) = sorted_list_of_set {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
have "\<dots> = sorted_list_of_set ({x \<in> X. x < y})@ sorted_list_of_set ({x \<in> X. y \<le> x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set {x \<in> X. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
by (simp add: \<open>{x \<in> X. x < y} = {}\<close>)
[PROOF STATE]
proof (state)
this:
sorted_list_of_set {x \<in> X. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. \<not> Min X < y \<Longrightarrow> Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Min X # sorted_list_of_set {x \<in> X - {Min X}. x < y} @ sorted_list_of_set {x \<in> X - {Min X}. y \<le> x} = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}

goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}; Suc x = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}

goal (1 subgoal):
 1. \<And>X. \<lbrakk>0 = card X; finite X\<rbrakk> \<Longrightarrow> sorted_list_of_set X = sorted_list_of_set {x \<in> X. x < y} @ sorted_list_of_set {x \<in> X. y \<le> x}
[PROOF STEP]
qed auto


[STATEMENT]
lemma coprimeI_primes:
  fixes a b :: "'a :: factorial_semiring"
  assumes "a \<noteq> 0 \<or> b \<noteq> 0"
  assumes "\<And>p. prime p \<Longrightarrow> p dvd a \<Longrightarrow> p dvd b \<Longrightarrow> False"
  shows   "coprime a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a b
[PROOF STEP]
proof (rule coprimeI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>c dvd a; c dvd b\<rbrakk> \<Longrightarrow> is_unit c
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>c dvd a; c dvd b\<rbrakk> \<Longrightarrow> is_unit c
[PROOF STEP]
assume d: "d dvd a" "d dvd b"
[PROOF STATE]
proof (state)
this:
d dvd a
d dvd b

goal (1 subgoal):
 1. \<And>c. \<lbrakk>c dvd a; c dvd b\<rbrakk> \<Longrightarrow> is_unit c
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a) \<or> b \<noteq> (0::'a)
d dvd a
d dvd b
[PROOF STEP]
have [simp]: "d \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a) \<or> b \<noteq> (0::'a)
d dvd a
d dvd b

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

goal (1 subgoal):
 1. \<And>c. \<lbrakk>c dvd a; c dvd b\<rbrakk> \<Longrightarrow> is_unit c
[PROOF STEP]
show "is_unit d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit d
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_unit d \<Longrightarrow> False
[PROOF STEP]
assume "\<not>is_unit d"
[PROOF STATE]
proof (state)
this:
\<not> is_unit d

goal (1 subgoal):
 1. \<not> is_unit d \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> is_unit d
[PROOF STEP]
obtain p where p: "prime p" "p dvd d"
[PROOF STATE]
proof (prove)
using this:
\<not> is_unit d

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; p dvd d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using prime_divisor_exists[of d]
[PROOF STATE]
proof (prove)
using this:
\<not> is_unit d
\<lbrakk>d \<noteq> (0::'a); \<not> is_unit d\<rbrakk> \<Longrightarrow> \<exists>b. b dvd d \<and> prime b

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; p dvd d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime p
p dvd d

goal (1 subgoal):
 1. \<not> is_unit d \<Longrightarrow> False
[PROOF STEP]
from assms(2)[of p] and p and d
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>prime p; p dvd a; p dvd b\<rbrakk> \<Longrightarrow> False
prime p
p dvd d
d dvd a
d dvd b
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime p; p dvd a; p dvd b\<rbrakk> \<Longrightarrow> False
prime p
p dvd d
d dvd a
d dvd b

goal (1 subgoal):
 1. False
[PROOF STEP]
using dvd_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime p; p dvd a; p dvd b\<rbrakk> \<Longrightarrow> False
prime p
p dvd d
d dvd a
d dvd b
\<lbrakk>?a dvd ?b; ?b dvd ?c\<rbrakk> \<Longrightarrow> ?a dvd ?c

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_unit d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvd_smult_cancel: "p dvd smult a q \<Longrightarrow> a \<noteq> 0 \<Longrightarrow> p dvd q"
  for a :: "'a::field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p dvd smult a q; a \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> p dvd q
[PROOF STEP]
by (drule dvd_smult [where a="inverse a"]) simp


[STATEMENT]
lemma in_uminus_image_iff[simp]: "x \<in> uminus ` S \<longleftrightarrow> - x \<in> S"
  for S::"'r::ab_group_add set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> uminus ` S) = (- x \<in> S)
[PROOF STEP]
by force


[STATEMENT]
lemma Sup_dual_def_var: "\<partial> (\<Squnion>X) = \<Sqinter> (\<partial> ` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<partial> (\<Squnion> X) = \<Sqinter> (\<partial> ` X)
[PROOF STEP]
using comp_eq_dest Sups_dual_def
[PROOF STATE]
proof (prove)
using this:
?a \<circ> ?b = ?c \<circ> ?d \<Longrightarrow> ?a (?b ?v) = ?c (?d ?v)
\<partial> \<circ> Sup = Inf \<circ> (`) \<partial>

goal (1 subgoal):
 1. \<partial> (\<Squnion> X) = \<Sqinter> (\<partial> ` X)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sum_list_Basis_list[simp]: "sum_list (map f Basis_list) = (\<Sum>b\<in>Basis. f b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map f Basis_list) = sum f Basis
[PROOF STEP]
by (subst sum_list_distinct_conv_sum_set) (auto simp: Basis_list distinct_Basis_list)


[STATEMENT]
lemma pair_return_return:
  assumes "l \<in> space M"
      and "r \<in> space N"
    shows "return M l \<Otimes>\<^sub>M return N r = return (M \<Otimes>\<^sub>M N) (l,r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. return M l \<Otimes>\<^sub>M return N r = return (M \<Otimes>\<^sub>M N) (l, r)
[PROOF STEP]
proof(auto intro!: measure_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. A \<in> sets (M \<Otimes>\<^sub>M N) \<Longrightarrow> emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. A \<in> sets (M \<Otimes>\<^sub>M N) \<Longrightarrow> emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
assume h:"A \<in> sets (M \<Otimes>\<^sub>M N)"
[PROOF STATE]
proof (state)
this:
A \<in> sets (M \<Otimes>\<^sub>M N)

goal (1 subgoal):
 1. \<And>A. A \<in> sets (M \<Otimes>\<^sub>M N) \<Longrightarrow> emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
show "emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)"
       (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
have "?lhs = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l
[PROOF STEP]
by(auto intro!: sigma_finite_measure.emeasure_pair_measure prob_space_imp_sigma_finite simp: h prob_space_return assms)
[PROOF STATE]
proof (state)
this:
emeasure (return M l \<Otimes>\<^sub>M return N r) A = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l

goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (return M l \<Otimes>\<^sub>M return N r) A = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l

goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
have "... = (\<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l = \<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (M \<Otimes>\<^sub>M N)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l = \<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l
[PROOF STEP]
by(auto intro!: nn_integral_cong nn_integral_return simp: assms(2))
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l = \<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l

goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>return N r \<partial>return M l = \<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l

goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l = indicator A (l, r)
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (M \<Otimes>\<^sub>M N)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l = indicator A (l, r)
[PROOF STEP]
by(auto intro!: nn_integral_return simp: assms)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A (x, r) \<partial>return M l = indicator A (l, r)

goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)

goal (1 subgoal):
 1. emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
emeasure (return M l \<Otimes>\<^sub>M return N r) A = indicator A (l, r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zip_rev:
  "length xs = length ys \<Longrightarrow> zip (rev xs) (rev ys) = rev (zip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> zip (rev xs) (rev ys) = rev (zip xs ys)
[PROOF STEP]
by (induct rule:list_induct2, simp_all)


[STATEMENT]
lemma distproj_le:
  assumes "y \<in> A"
  shows "dist x (distproj x A) \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x (distproj x A) \<le> dist x y
[PROOF STEP]
proof (cases "proj_set x A \<noteq> {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. proj_set x A \<noteq> {} \<Longrightarrow> dist x (distproj x A) \<le> dist x y
 2. \<not> proj_set x A \<noteq> {} \<Longrightarrow> dist x (distproj x A) \<le> dist x y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
proj_set x A \<noteq> {}

goal (2 subgoals):
 1. proj_set x A \<noteq> {} \<Longrightarrow> dist x (distproj x A) \<le> dist x y
 2. \<not> proj_set x A \<noteq> {} \<Longrightarrow> dist x (distproj x A) \<le> dist x y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x (distproj x A) \<le> dist x y
[PROOF STEP]
using distproj_in_proj_set(3)[OF True] infdist_le[OF assms]
[PROOF STATE]
proof (prove)
using this:
dist x (distproj x A) = infdist x A
infdist ?x A \<le> dist ?x y

goal (1 subgoal):
 1. dist x (distproj x A) \<le> dist x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist x (distproj x A) \<le> dist x y

goal (1 subgoal):
 1. \<not> proj_set x A \<noteq> {} \<Longrightarrow> dist x (distproj x A) \<le> dist x y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> proj_set x A \<noteq> {} \<Longrightarrow> dist x (distproj x A) \<le> dist x y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> proj_set x A \<noteq> {}

goal (1 subgoal):
 1. \<not> proj_set x A \<noteq> {} \<Longrightarrow> dist x (distproj x A) \<le> dist x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> proj_set x A \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> proj_set x A \<noteq> {}

goal (1 subgoal):
 1. dist x (distproj x A) \<le> dist x y
[PROOF STEP]
unfolding distproj_def
[PROOF STATE]
proof (prove)
using this:
\<not> proj_set x A \<noteq> {}

goal (1 subgoal):
 1. dist x (if proj_set x A \<noteq> {} then SOME y. y \<in> proj_set x A else x) \<le> dist x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist x (distproj x A) \<le> dist x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma limit_upperbound:
  "(\<And> I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G) \<Longrightarrow> I \<subseteq> G \<Longrightarrow> limit f I \<subseteq> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> limit f I \<subseteq> G
[PROOF STEP]
by (simp add: funpower_upperbound limit_def natUnion_upperbound)


[STATEMENT]
lemma "(2::real) \<le> x \<and> x \<le> 4 \<and> 2 \<le> y \<and> y \<le> 4 \<and> 2 \<le> z \<and> z \<le> 4 \<longrightarrow>
    0 \<le> 2 * (x * z + x * y + y * z) - (x * x + y * y + z * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> x \<and> x \<le> 4 \<and> 2 \<le> y \<and> y \<le> 4 \<and> 2 \<le> z \<and> z \<le> 4 \<longrightarrow> 0 \<le> 2 * (x * z + x * y + y * z) - (x * x + y * y + z * z)
[PROOF STEP]
by sos


[STATEMENT]
lemma p_not_div_choose_lemma:
  fixes p :: nat
  assumes eeq: "\<And>i. Suc i < K \<Longrightarrow> multiplicity p (Suc i) = multiplicity p (Suc (j + i))"
      and "k < K" and p: "prime p"
    shows "multiplicity p (j + k choose k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (j + k choose k) = 0
[PROOF STEP]
using \<open>k < K\<close>
[PROOF STATE]
proof (prove)
using this:
k < K

goal (1 subgoal):
 1. multiplicity p (j + k choose k) = 0
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < K \<Longrightarrow> multiplicity p (j + 0 choose 0) = 0
 2. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < K

goal (2 subgoals):
 1. 0 < K \<Longrightarrow> multiplicity p (j + 0 choose 0) = 0
 2. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < K
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < K

goal (1 subgoal):
 1. multiplicity p (j + 0 choose 0) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
multiplicity p (j + 0 choose 0) = 0

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K
[PROOF STEP]
have *: "(Suc (j+k) choose Suc k) > 0"
[PROOF STATE]
proof (prove)
using this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K

goal (1 subgoal):
 1. 0 < Suc (j + k) choose Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < Suc (j + k) choose Suc k

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < Suc (j + k) choose Suc k
[PROOF STEP]
have "multiplicity p ((Suc (j+k) choose Suc k) * Suc k) = multiplicity p (Suc k)"
[PROOF STATE]
proof (prove)
using this:
0 < Suc (j + k) choose Suc k

goal (1 subgoal):
 1. multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)
[PROOF STEP]
by (subst Suc_times_binomial_eq [symmetric], subst prime_elem_multiplicity_mult_distrib)
       (insert p Suc.prems, simp_all add: eeq [symmetric] Suc.IH)
[PROOF STATE]
proof (state)
this:
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
with p *
[PROOF STATE]
proof (chain)
picking this:
prime p
0 < Suc (j + k) choose Suc k
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
prime p
0 < Suc (j + k) choose Suc k
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)

goal (1 subgoal):
 1. multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
by (subst (asm) prime_elem_multiplicity_mult_distrib) simp_all
[PROOF STATE]
proof (state)
this:
multiplicity p (j + Suc k choose Suc k) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sf_strict_mono: "x < y \<Longrightarrow> sf x < sf y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> sf x < sf y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x < y \<Longrightarrow> sf x < sf y
[PROOF STEP]
assume A1: "x < y"
[PROOF STATE]
proof (state)
this:
x < y

goal (1 subgoal):
 1. x < y \<Longrightarrow> sf x < sf y
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
x < y
[PROOF STEP]
have S1: "x+1 \<le> y"
[PROOF STATE]
proof (prove)
using this:
x < y

goal (1 subgoal):
 1. x + 1 \<le> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x + 1 \<le> y

goal (1 subgoal):
 1. x < y \<Longrightarrow> sf x < sf y
[PROOF STEP]
from S1 sf_mono
[PROOF STATE]
proof (chain)
picking this:
x + 1 \<le> y
?x \<le> ?y \<Longrightarrow> sf ?x \<le> sf ?y
[PROOF STEP]
have S2: "sf (x+1) \<le> sf y"
[PROOF STATE]
proof (prove)
using this:
x + 1 \<le> y
?x \<le> ?y \<Longrightarrow> sf ?x \<le> sf ?y

goal (1 subgoal):
 1. sf (x + 1) \<le> sf y
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
sf (x + 1) \<le> sf y

goal (1 subgoal):
 1. x < y \<Longrightarrow> sf x < sf y
[PROOF STEP]
from sf_at_Suc
[PROOF STATE]
proof (chain)
picking this:
sf (?x + 1) = sf ?x + ?x + 1
[PROOF STEP]
have S3: "sf x < sf (x+1)"
[PROOF STATE]
proof (prove)
using this:
sf (?x + 1) = sf ?x + ?x + 1

goal (1 subgoal):
 1. sf x < sf (x + 1)
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
sf x < sf (x + 1)

goal (1 subgoal):
 1. x < y \<Longrightarrow> sf x < sf y
[PROOF STEP]
from S2 S3
[PROOF STATE]
proof (chain)
picking this:
sf (x + 1) \<le> sf y
sf x < sf (x + 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sf (x + 1) \<le> sf y
sf x < sf (x + 1)

goal (1 subgoal):
 1. sf x < sf y
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
sf x < sf y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isomTr1:"\<lbrakk>Group F; Group G; F \<cong>  G \<rbrakk> \<Longrightarrow> G \<cong> F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; F \<cong> G\<rbrakk> \<Longrightarrow> G \<cong> F
[PROOF STEP]
apply (simp add:isomorphic_def, erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>Group F; Group G; gbij\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> \<exists>f. gbij\<^bsub>G,F\<^esub> f
[PROOF STEP]
apply (frule_tac f = f in inv_gbijec_gbijec[of "F" "G"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>Group F; Group G; gbij\<^bsub>F,G\<^esub> f; gbij\<^bsub>G,F\<^esub> (f\<inverse>\<^bsub>carrier G,carrier F\<^esub>)\<rbrakk> \<Longrightarrow> \<exists>f. gbij\<^bsub>G,F\<^esub> f
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done