[STATEMENT]
lemma condensation_condense2: "(\<Sum>k=1..<2^n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2^k * f (2 ^ Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k))

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
have "{1..<2^Suc n} = {1..<2^n} \<union> {2^n..<(2^Suc n :: nat)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1..<2 ^ Suc n} = {1..<2 ^ n} \<union> {2 ^ n..<2 ^ Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1..<2 ^ Suc n} = {1..<2 ^ n} \<union> {2 ^ n..<2 ^ Suc n}

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{1..<2 ^ Suc n} = {1..<2 ^ n} \<union> {2 ^ n..<2 ^ Suc n}

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
have "(\<Sum>k\<in>\<dots>. f (2 * 2 ^ Discrete.log k)) =
                 (\<Sum>k<n. 2^k * f (2^Suc k)) + (\<Sum>k = 2^n..<2^Suc n. f (2 * 2^Discrete.log k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>{1..<2 ^ n} \<union> {2 ^ n..<2 ^ Suc n}. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) + (\<Sum>k = 2 ^ n..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k))
[PROOF STEP]
by (subst sum.union_disjoint) (insert Suc, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{1..<2 ^ n} \<union> {2 ^ n..<2 ^ Suc n}. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) + (\<Sum>k = 2 ^ n..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k))

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{1..<2 ^ n} \<union> {2 ^ n..<2 ^ Suc n}. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) + (\<Sum>k = 2 ^ n..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k))

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
have "Discrete.log k = n" if "k \<in> {2^n..<2^Suc n}" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Discrete.log k = n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
k \<in> {2 ^ n..<2 ^ Suc n}

goal (1 subgoal):
 1. Discrete.log k = n
[PROOF STEP]
by (intro Discrete.log_eqI) simp_all
[PROOF STATE]
proof (state)
this:
?k \<in> {2 ^ n..<2 ^ Suc n} \<Longrightarrow> Discrete.log ?k = n

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
hence "(\<Sum>k = 2^n..<2^Suc n. f (2*2^Discrete.log k)) = (\<Sum>(_::nat) = 2^n..<2^Suc n. f (2^Suc n))"
[PROOF STATE]
proof (prove)
using this:
?k \<in> {2 ^ n..<2 ^ Suc n} \<Longrightarrow> Discrete.log ?k = n

goal (1 subgoal):
 1. (\<Sum>k = 2 ^ n..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>_ = 2 ^ n..<2 ^ Suc n. f (2 ^ Suc n))
[PROOF STEP]
by (intro sum.cong) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 2 ^ n..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>_ = 2 ^ n..<2 ^ Suc n. f (2 ^ Suc n))

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 2 ^ n..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>_ = 2 ^ n..<2 ^ Suc n. f (2 ^ Suc n))

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
have "\<dots> = 2^n * f (2^Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>_ = 2 ^ n..<2 ^ Suc n. f (2 ^ Suc n)) = 2 ^ n * f (2 ^ Suc n)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>_ = 2 ^ n..<2 ^ Suc n. f (2 ^ Suc n)) = 2 ^ n * f (2 ^ Suc n)

goal (2 subgoals):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
 2. \<And>n. (\<Sum>k = 1..<2 ^ n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) \<Longrightarrow> (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) + 2 ^ n * f (2 ^ Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<n. 2 ^ k * f (2 ^ Suc k)) + 2 ^ n * f (2 ^ Suc n)

goal (1 subgoal):
 1. (\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..<2 ^ Suc n. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<Suc n. 2 ^ k * f (2 ^ Suc k))

goal (1 subgoal):
 1. (\<Sum>k = 1..<2 ^ 0. f (2 * 2 ^ Discrete.log k)) = (\<Sum>k<0. 2 ^ k * f (2 ^ Suc k))
[PROOF STEP]
qed simp


[STATEMENT]
lemma compute_adds_pp[code]:
  "adds_pp_add_linorder (Pm_fmap xs) (Pm_fmap ys) =
    (fmpred (\<lambda>k v. lookup0 xs k \<le> lookup0 ys k) (xs ++\<^sub>f ys))"
  for xs ys::"('a, 'b::add_linorder_min) fmap"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adds_pp_add_linorder (Pm_fmap xs) (Pm_fmap ys) = fmpred (\<lambda>k v. lookup0 xs k \<le> lookup0 ys k) (xs ++\<^sub>f ys)
[PROOF STEP]
unfolding adds_pp_add_linorder_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Pm_fmap xs adds Pm_fmap ys) = fmpred (\<lambda>k v. lookup0 xs k \<le> lookup0 ys k) (xs ++\<^sub>f ys)
[PROOF STEP]
unfolding adds_poly_mapping
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lookup (Pm_fmap xs) \<le> lookup (Pm_fmap ys)) = fmpred (\<lambda>k v. lookup0 xs k \<le> lookup0 ys k) (xs ++\<^sub>f ys)
[PROOF STEP]
using fmdom_notI
[PROOF STATE]
proof (prove)
using this:
fmlookup ?m ?x = None \<Longrightarrow> ?x |\<notin>| fmdom ?m

goal (1 subgoal):
 1. (lookup (Pm_fmap xs) \<le> lookup (Pm_fmap ys)) = fmpred (\<lambda>k v. lookup0 xs k \<le> lookup0 ys k) (xs ++\<^sub>f ys)
[PROOF STEP]
by (force simp: fmlookup_dom_iff le_fun_def
      split: option.splits if_splits)


[STATEMENT]
lemma tendsto_zero_mult_left_iff [simp]:
  fixes c::"'a::{topological_semigroup_mult,field}" assumes "c \<noteq> 0" shows "(\<lambda>n. c * a n)\<longlonglongrightarrow> 0 \<longleftrightarrow> a \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. c * a n) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using assms tendsto_mult_left tendsto_mult_left_iff
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
(?f \<longlongrightarrow> ?l) ?F \<Longrightarrow> ((\<lambda>x. ?c * ?f x) \<longlongrightarrow> ?c * ?l) ?F
?c \<noteq> (0::?'a) \<Longrightarrow> ((\<lambda>x. ?c * ?f x) \<longlongrightarrow> ?c * ?l) ?F = (?f \<longlongrightarrow> ?l) ?F

goal (1 subgoal):
 1. (\<lambda>n. c * a n) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma coarser_partitions_inv_without:
  fixes elem::'a
    and P::"'a set set"
  assumes non_overlapping: "is_non_overlapping P"
      and elem: "elem \<in> \<Union> P"
  shows "P \<in> coarser_partitions_with elem (partition_without elem P)"
    (is "P \<in> coarser_partitions_with elem ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
let ?remove_elem = "\<lambda>X . X - {elem}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
(* function that removes elem out of a set *)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
obtain Y (* the equivalence class of elem *)
    where elem_eq_class: "elem \<in> Y" and elem_eq_class': "Y \<in> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Y. \<lbrakk>elem \<in> Y; Y \<in> P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using elem
[PROOF STATE]
proof (prove)
using this:
elem \<in> \<Union> P

goal (1 subgoal):
 1. (\<And>Y. \<lbrakk>elem \<in> Y; Y \<in> P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
elem \<in> Y
Y \<in> P

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
let ?elem_neq_classes = "P - {Y}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
(* those equivalence classes of which elem is not a member *)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have P_wrt_elem: "P = ?elem_neq_classes \<union> {Y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = P - {Y} \<union> {Y}
[PROOF STEP]
using elem_eq_class'
[PROOF STATE]
proof (prove)
using this:
Y \<in> P

goal (1 subgoal):
 1. P = P - {Y} \<union> {Y}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P = P - {Y} \<union> {Y}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
let ?elem_eq = "Y - {elem}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
(* other elements equivalent to elem *)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have Y_elem_eq: "?remove_elem ` {Y} = {?elem_eq}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` {Y} = {Y - {elem}}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
(\<lambda>X. X - {elem}) ` {Y} = {Y - {elem}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
(* those classes,of which elem is not a member, form a partition *)
[PROOF STATE]
proof (state)
this:
(\<lambda>X. X - {elem}) ` {Y} = {Y - {elem}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have elem_neq_classes_part: "is_non_overlapping ?elem_neq_classes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_non_overlapping (P - {Y})
[PROOF STEP]
using subset_is_non_overlapping non_overlapping
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?P \<subseteq> ?Q; is_non_overlapping ?Q\<rbrakk> \<Longrightarrow> is_non_overlapping ?P
is_non_overlapping P

goal (1 subgoal):
 1. is_non_overlapping (P - {Y})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_non_overlapping (P - {Y})

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have elem_eq_wrt_P: "?elem_eq \<in> ?remove_elem ` P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y - {elem} \<in> (\<lambda>X. X - {elem}) ` P
[PROOF STEP]
using elem_eq_class'
[PROOF STATE]
proof (prove)
using this:
Y \<in> P

goal (1 subgoal):
 1. Y - {elem} \<in> (\<lambda>X. X - {elem}) ` P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Y - {elem} \<in> (\<lambda>X. X - {elem}) ` P

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Y - {elem} \<in> (\<lambda>X. X - {elem}) ` P

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
(* consider a class W, of which elem is not a member *)
[PROOF STATE]
proof (state)
this:
Y - {elem} \<in> (\<lambda>X. X - {elem}) ` P

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
fix W
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
assume W_eq_class: "W \<in> ?elem_neq_classes"
[PROOF STATE]
proof (state)
this:
W \<in> P - {Y}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
W \<in> P - {Y}
[PROOF STEP]
have "elem \<notin> W"
[PROOF STATE]
proof (prove)
using this:
W \<in> P - {Y}

goal (1 subgoal):
 1. elem \<notin> W
[PROOF STEP]
using elem_eq_class elem_eq_class' non_overlapping is_non_overlapping_def
[PROOF STATE]
proof (prove)
using this:
W \<in> P - {Y}
elem \<in> Y
Y \<in> P
is_non_overlapping P
is_non_overlapping ?P = (\<forall>X\<in>?P. \<forall>Y\<in>?P. (X \<inter> Y \<noteq> {}) = (X = Y))

goal (1 subgoal):
 1. elem \<notin> W
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
elem \<notin> W

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
elem \<notin> W
[PROOF STEP]
have "?remove_elem W = W"
[PROOF STATE]
proof (prove)
using this:
elem \<notin> W

goal (1 subgoal):
 1. W - {elem} = W
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
W - {elem} = W

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?W2 \<in> P - {Y} \<Longrightarrow> ?W2 - {elem} = ?W2

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?W2 \<in> P - {Y} \<Longrightarrow> ?W2 - {elem} = ?W2
[PROOF STEP]
have elem_neq_classes_id: "?remove_elem ` ?elem_neq_classes = ?elem_neq_classes"
[PROOF STATE]
proof (prove)
using this:
?W2 \<in> P - {Y} \<Longrightarrow> ?W2 - {elem} = ?W2

goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` (P - {Y}) = P - {Y}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>X. X - {elem}) ` (P - {Y}) = P - {Y}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have Q_unfolded: "?Q = ?remove_elem ` P - {{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_without elem P = (\<lambda>X. X - {elem}) ` P - {{}}
[PROOF STEP]
unfolding partition_without_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` P - {{}} = (\<lambda>X. X - {elem}) ` P - {{}}
[PROOF STEP]
using image_Collect_mem
[PROOF STATE]
proof (prove)
using this:
{?f x |x. x \<in> ?S} = ?f ` ?S

goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` P - {{}} = (\<lambda>X. X - {elem}) ` P - {{}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
partition_without elem P = (\<lambda>X. X - {elem}) ` P - {{}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
partition_without elem P = (\<lambda>X. X - {elem}) ` P - {{}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have "\<dots> = ?remove_elem ` (?elem_neq_classes \<union> {Y}) - {{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` P - {{}} = (\<lambda>X. X - {elem}) ` (P - {Y} \<union> {Y}) - {{}}
[PROOF STEP]
using P_wrt_elem
[PROOF STATE]
proof (prove)
using this:
P = P - {Y} \<union> {Y}

goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` P - {{}} = (\<lambda>X. X - {elem}) ` (P - {Y} \<union> {Y}) - {{}}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(\<lambda>X. X - {elem}) ` P - {{}} = (\<lambda>X. X - {elem}) ` (P - {Y} \<union> {Y}) - {{}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>X. X - {elem}) ` P - {{}} = (\<lambda>X. X - {elem}) ` (P - {Y} \<union> {Y}) - {{}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have "\<dots> = ?elem_neq_classes \<union> {?elem_eq} - {{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` (P - {Y} \<union> {Y}) - {{}} = P - {Y} \<union> {Y - {elem}} - {{}}
[PROOF STEP]
using Y_elem_eq elem_neq_classes_id image_Un
[PROOF STATE]
proof (prove)
using this:
(\<lambda>X. X - {elem}) ` {Y} = {Y - {elem}}
(\<lambda>X. X - {elem}) ` (P - {Y}) = P - {Y}
?f ` (?A \<union> ?B) = ?f ` ?A \<union> ?f ` ?B

goal (1 subgoal):
 1. (\<lambda>X. X - {elem}) ` (P - {Y} \<union> {Y}) - {{}} = P - {Y} \<union> {Y - {elem}} - {{}}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<lambda>X. X - {elem}) ` (P - {Y} \<union> {Y}) - {{}} = P - {Y} \<union> {Y - {elem}} - {{}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
partition_without elem P = P - {Y} \<union> {Y - {elem}} - {{}}
[PROOF STEP]
have Q_wrt_elem: "?Q = ?elem_neq_classes \<union> {?elem_eq} - {{}}"
[PROOF STATE]
proof (prove)
using this:
partition_without elem P = P - {Y} \<union> {Y - {elem}} - {{}}

goal (1 subgoal):
 1. partition_without elem P = P - {Y} \<union> {Y - {elem}} - {{}}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
partition_without elem P = P - {Y} \<union> {Y - {elem}} - {{}}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have "?elem_eq = {} \<or> ?elem_eq \<notin> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y - {elem} = {} \<or> Y - {elem} \<notin> P
[PROOF STEP]
using elem_eq_class elem_eq_class' non_overlapping Diff_Int_distrib2 Diff_iff empty_Diff insert_iff
[PROOF STATE]
proof (prove)
using this:
elem \<in> Y
Y \<in> P
is_non_overlapping P
(?A - ?B) \<inter> ?C = ?A \<inter> ?C - ?B \<inter> ?C
(?c \<in> ?A - ?B) = (?c \<in> ?A \<and> ?c \<notin> ?B)
{} - ?A = {}
(?a \<in> insert ?b ?A) = (?a = ?b \<or> ?a \<in> ?A)

goal (1 subgoal):
 1. Y - {elem} = {} \<or> Y - {elem} \<notin> P
[PROOF STEP]
unfolding is_non_overlapping_def
[PROOF STATE]
proof (prove)
using this:
elem \<in> Y
Y \<in> P
\<forall>X\<in>P. \<forall>Y\<in>P. (X \<inter> Y \<noteq> {}) = (X = Y)
(?A - ?B) \<inter> ?C = ?A \<inter> ?C - ?B \<inter> ?C
(?c \<in> ?A - ?B) = (?c \<in> ?A \<and> ?c \<notin> ?B)
{} - ?A = {}
(?a \<in> insert ?b ?A) = (?a = ?b \<or> ?a \<in> ?A)

goal (1 subgoal):
 1. Y - {elem} = {} \<or> Y - {elem} \<notin> P
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Y - {elem} = {} \<or> Y - {elem} \<notin> P

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y - {elem} = {} \<or> Y - {elem} \<notin> P
[PROOF STEP]
have "?elem_eq \<notin> P"
[PROOF STATE]
proof (prove)
using this:
Y - {elem} = {} \<or> Y - {elem} \<notin> P

goal (1 subgoal):
 1. Y - {elem} \<notin> P
[PROOF STEP]
using non_overlapping no_empty_in_non_overlapping
[PROOF STATE]
proof (prove)
using this:
Y - {elem} = {} \<or> Y - {elem} \<notin> P
is_non_overlapping P
is_non_overlapping ?p \<Longrightarrow> {} \<notin> ?p

goal (1 subgoal):
 1. Y - {elem} \<notin> P
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Y - {elem} \<notin> P

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y - {elem} \<notin> P
[PROOF STEP]
have elem_neq_classes: "?elem_neq_classes - {?elem_eq} = ?elem_neq_classes"
[PROOF STATE]
proof (prove)
using this:
Y - {elem} \<notin> P

goal (1 subgoal):
 1. P - {Y} - {Y - {elem}} = P - {Y}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
P - {Y} - {Y - {elem}} = P - {Y}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
assume "?elem_eq \<notin> ?Q"
[PROOF STATE]
proof (state)
this:
Y - {elem} \<notin> partition_without elem P

goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
(* the class of elem is not a member of ?Q = partition_without elem P *)
[PROOF STATE]
proof (state)
this:
Y - {elem} \<notin> partition_without elem P

goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y - {elem} \<notin> partition_without elem P
[PROOF STEP]
have "?elem_eq \<in> {{}}"
[PROOF STATE]
proof (prove)
using this:
Y - {elem} \<notin> partition_without elem P

goal (1 subgoal):
 1. Y - {elem} \<in> {{}}
[PROOF STEP]
using elem_eq_wrt_P Q_unfolded
[PROOF STATE]
proof (prove)
using this:
Y - {elem} \<notin> partition_without elem P
Y - {elem} \<in> (\<lambda>X. X - {elem}) ` P
partition_without elem P = (\<lambda>X. X - {elem}) ` P - {{}}

goal (1 subgoal):
 1. Y - {elem} \<in> {{}}
[PROOF STEP]
by (metis DiffI)
[PROOF STATE]
proof (state)
this:
Y - {elem} \<in> {{}}

goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y - {elem} \<in> {{}}
[PROOF STEP]
have Y_singleton: "Y = {elem}"
[PROOF STATE]
proof (prove)
using this:
Y - {elem} \<in> {{}}

goal (1 subgoal):
 1. Y = {elem}
[PROOF STEP]
using elem_eq_class
[PROOF STATE]
proof (prove)
using this:
Y - {elem} \<in> {{}}
elem \<in> Y

goal (1 subgoal):
 1. Y = {elem}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Y = {elem}

goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y = {elem}
[PROOF STEP]
have "?Q = ?elem_neq_classes - {{}}"
[PROOF STATE]
proof (prove)
using this:
Y = {elem}

goal (1 subgoal):
 1. partition_without elem P = P - {Y} - {{}}
[PROOF STEP]
using Q_wrt_elem
[PROOF STATE]
proof (prove)
using this:
Y = {elem}
partition_without elem P = P - {Y} \<union> {Y - {elem}} - {{}}

goal (1 subgoal):
 1. partition_without elem P = P - {Y} - {{}}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
partition_without elem P = P - {Y} - {{}}

goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
partition_without elem P = P - {Y} - {{}}
[PROOF STEP]
have "?Q = ?elem_neq_classes"
[PROOF STATE]
proof (prove)
using this:
partition_without elem P = P - {Y} - {{}}

goal (1 subgoal):
 1. partition_without elem P = P - {Y}
[PROOF STEP]
using no_empty_in_non_overlapping elem_neq_classes_part
[PROOF STATE]
proof (prove)
using this:
partition_without elem P = P - {Y} - {{}}
is_non_overlapping ?p \<Longrightarrow> {} \<notin> ?p
is_non_overlapping (P - {Y})

goal (1 subgoal):
 1. partition_without elem P = P - {Y}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
partition_without elem P = P - {Y}

goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
partition_without elem P = P - {Y}
[PROOF STEP]
have "insert {elem} ?Q = P"
[PROOF STATE]
proof (prove)
using this:
partition_without elem P = P - {Y}

goal (1 subgoal):
 1. insert {elem} (partition_without elem P) = P
[PROOF STEP]
using Y_singleton elem_eq_class'
[PROOF STATE]
proof (prove)
using this:
partition_without elem P = P - {Y}
Y = {elem}
Y \<in> P

goal (1 subgoal):
 1. insert {elem} (partition_without elem P) = P
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
insert {elem} (partition_without elem P) = P

goal (2 subgoals):
 1. ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
 2. \<not> ?P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
insert {elem} (partition_without elem P) = P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
insert {elem} (partition_without elem P) = P

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
unfolding coarser_partitions_with_def
[PROOF STATE]
proof (prove)
using this:
insert {elem} (partition_without elem P) = P

goal (1 subgoal):
 1. P \<in> insert (insert {elem} (partition_without elem P)) (insert_into_member elem (partition_without elem P) ` partition_without elem P)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<in> coarser_partitions_with elem (partition_without elem P)

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
assume True: "\<not> ?elem_eq \<notin> ?Q"
[PROOF STATE]
proof (state)
this:
\<not> Y - {elem} \<notin> partition_without elem P

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
hence Y': "?elem_neq_classes \<union> {?elem_eq} - {{}} = ?elem_neq_classes \<union> {?elem_eq}"
[PROOF STATE]
proof (prove)
using this:
\<not> Y - {elem} \<notin> partition_without elem P

goal (1 subgoal):
 1. P - {Y} \<union> {Y - {elem}} - {{}} = P - {Y} \<union> {Y - {elem}}
[PROOF STEP]
using no_empty_in_non_overlapping non_overlapping non_overlapping_without_is_non_overlapping
[PROOF STATE]
proof (prove)
using this:
\<not> Y - {elem} \<notin> partition_without elem P
is_non_overlapping ?p \<Longrightarrow> {} \<notin> ?p
is_non_overlapping P
is_non_overlapping ?P \<Longrightarrow> is_non_overlapping (partition_without ?elem ?P)

goal (1 subgoal):
 1. P - {Y} \<union> {Y - {elem}} - {{}} = P - {Y} \<union> {Y - {elem}}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
P - {Y} \<union> {Y - {elem}} - {{}} = P - {Y} \<union> {Y - {elem}}

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have "insert_into_member elem ({?elem_eq} \<union> ?elem_neq_classes) ?elem_eq = insert (?elem_eq \<union> {elem}) (({?elem_eq} \<union> ?elem_neq_classes) - {?elem_eq})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}})
[PROOF STEP]
unfolding insert_into_member_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}}) = insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}})
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}})

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}})

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have "\<dots> = ({} \<union> ?elem_neq_classes) \<union> {?elem_eq \<union> {elem}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}}) = {} \<union> (P - {Y}) \<union> {Y - {elem} \<union> {elem}}
[PROOF STEP]
using elem_neq_classes
[PROOF STATE]
proof (prove)
using this:
P - {Y} - {Y - {elem}} = P - {Y}

goal (1 subgoal):
 1. insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}}) = {} \<union> (P - {Y}) \<union> {Y - {elem} \<union> {elem}}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}}) = {} \<union> (P - {Y}) \<union> {Y - {elem} \<union> {elem}}

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
insert (Y - {elem} \<union> {elem}) ({Y - {elem}} \<union> (P - {Y}) - {Y - {elem}}) = {} \<union> (P - {Y}) \<union> {Y - {elem} \<union> {elem}}

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
have "\<dots> = ?elem_neq_classes \<union> {Y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<union> (P - {Y}) \<union> {Y - {elem} \<union> {elem}} = P - {Y} \<union> {Y}
[PROOF STEP]
using elem_eq_class
[PROOF STATE]
proof (prove)
using this:
elem \<in> Y

goal (1 subgoal):
 1. {} \<union> (P - {Y}) \<union> {Y - {elem} \<union> {elem}} = P - {Y} \<union> {Y}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{} \<union> (P - {Y}) \<union> {Y - {elem} \<union> {elem}} = P - {Y} \<union> {Y}

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = P - {Y} \<union> {Y}
[PROOF STEP]
have "insert_into_member elem ({?elem_eq} \<union> ?elem_neq_classes) ?elem_eq = ?elem_neq_classes \<union> {Y}"
[PROOF STATE]
proof (prove)
using this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = P - {Y} \<union> {Y}

goal (1 subgoal):
 1. insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = P - {Y} \<union> {Y}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = P - {Y} \<union> {Y}

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = P - {Y} \<union> {Y}
[PROOF STEP]
have "?elem_neq_classes \<union> {Y} = insert_into_member elem ?Q ?elem_eq"
[PROOF STATE]
proof (prove)
using this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = P - {Y} \<union> {Y}

goal (1 subgoal):
 1. P - {Y} \<union> {Y} = insert_into_member elem (partition_without elem P) (Y - {elem})
[PROOF STEP]
using Q_wrt_elem Y' partition_without_def
[PROOF STATE]
proof (prove)
using this:
insert_into_member elem ({Y - {elem}} \<union> (P - {Y})) (Y - {elem}) = P - {Y} \<union> {Y}
partition_without elem P = P - {Y} \<union> {Y - {elem}} - {{}}
P - {Y} \<union> {Y - {elem}} - {{}} = P - {Y} \<union> {Y - {elem}}
partition_without ?elem ?P = (\<lambda>X. X - {?elem}) ` ?P - {{}}

goal (1 subgoal):
 1. P - {Y} \<union> {Y} = insert_into_member elem (partition_without elem P) (Y - {elem})
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
P - {Y} \<union> {Y} = insert_into_member elem (partition_without elem P) (Y - {elem})

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P - {Y} \<union> {Y} = insert_into_member elem (partition_without elem P) (Y - {elem})
[PROOF STEP]
have "{Y} \<union> ?elem_neq_classes \<in> insert_into_member elem ?Q ` ?Q"
[PROOF STATE]
proof (prove)
using this:
P - {Y} \<union> {Y} = insert_into_member elem (partition_without elem P) (Y - {elem})

goal (1 subgoal):
 1. {Y} \<union> (P - {Y}) \<in> insert_into_member elem (partition_without elem P) ` partition_without elem P
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
P - {Y} \<union> {Y} = insert_into_member elem (partition_without elem P) (Y - {elem})
\<not> Y - {elem} \<notin> partition_without elem P

goal (1 subgoal):
 1. {Y} \<union> (P - {Y}) \<in> insert_into_member elem (partition_without elem P) ` partition_without elem P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{Y} \<union> (P - {Y}) \<in> insert_into_member elem (partition_without elem P) ` partition_without elem P

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{Y} \<union> (P - {Y}) \<in> insert_into_member elem (partition_without elem P) ` partition_without elem P
[PROOF STEP]
have "{Y} \<union> ?elem_neq_classes \<in> coarser_partitions_with elem ?Q"
[PROOF STATE]
proof (prove)
using this:
{Y} \<union> (P - {Y}) \<in> insert_into_member elem (partition_without elem P) ` partition_without elem P

goal (1 subgoal):
 1. {Y} \<union> (P - {Y}) \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
unfolding coarser_partitions_with_def
[PROOF STATE]
proof (prove)
using this:
{Y} \<union> (P - {Y}) \<in> insert_into_member elem (partition_without elem P) ` partition_without elem P

goal (1 subgoal):
 1. {Y} \<union> (P - {Y}) \<in> insert (insert {elem} (partition_without elem P)) (insert_into_member elem (partition_without elem P) ` partition_without elem P)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{Y} \<union> (P - {Y}) \<in> coarser_partitions_with elem (partition_without elem P)

goal (1 subgoal):
 1. \<not> Y - {elem} \<notin> partition_without elem P \<Longrightarrow> P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{Y} \<union> (P - {Y}) \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{Y} \<union> (P - {Y}) \<in> coarser_partitions_with elem (partition_without elem P)

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
using P_wrt_elem
[PROOF STATE]
proof (prove)
using this:
{Y} \<union> (P - {Y}) \<in> coarser_partitions_with elem (partition_without elem P)
P = P - {Y} \<union> {Y}

goal (1 subgoal):
 1. P \<in> coarser_partitions_with elem (partition_without elem P)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P \<in> coarser_partitions_with elem (partition_without elem P)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P \<in> coarser_partitions_with elem (partition_without elem P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cpx_sq_mat) sum_eigen_projector_trace_dist:
  assumes "hermitian B"
and "A\<in> fc_mats"
and "B\<in> fc_mats"
and "R\<in> fc_mats"
  shows "(\<Sum> b \<in> spectrum B. (b *
    Complex_Matrix.trace(A * (eigen_projector B b) * R))) = Complex_Matrix.trace(A * B * R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
have "(\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) =
       (\<Sum>b\<in>spectrum B. Complex_Matrix.trace (A * (b \<cdot>\<^sub>m (eigen_projector B b)) * R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = (\<Sum>b\<in>spectrum B. Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R))
[PROOF STEP]
proof (rule sum.cong, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> spectrum B \<Longrightarrow> x * Complex_Matrix.trace (A * eigen_projector B x * R) = Complex_Matrix.trace (A * (x \<cdot>\<^sub>m eigen_projector B x) * R)
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> spectrum B \<Longrightarrow> x * Complex_Matrix.trace (A * eigen_projector B x * R) = Complex_Matrix.trace (A * (x \<cdot>\<^sub>m eigen_projector B x) * R)
[PROOF STEP]
assume "b\<in> spectrum B"
[PROOF STATE]
proof (state)
this:
b \<in> spectrum B

goal (1 subgoal):
 1. \<And>x. x \<in> spectrum B \<Longrightarrow> x * Complex_Matrix.trace (A * eigen_projector B x * R) = Complex_Matrix.trace (A * (x \<cdot>\<^sub>m eigen_projector B x) * R)
[PROOF STEP]
have "b * Complex_Matrix.trace (A * eigen_projector B b * R) =
      Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * Complex_Matrix.trace (A * eigen_projector B b * R) = Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R))
[PROOF STEP]
proof (rule trace_smult[symmetric])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * eigen_projector B b * R \<in> carrier_mat ?n ?n
[PROOF STEP]
show "A * eigen_projector B b * R \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * eigen_projector B b * R \<in> carrier_mat dimR dimR
[PROOF STEP]
using eigen_projector_carrier
          assms fc_mats_carrier dim_eq  \<open>b \<in> spectrum B\<close> cpx_sq_mat_mult
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> fc_mats; ?a \<in> spectrum ?A; hermitian ?A\<rbrakk> \<Longrightarrow> eigen_projector ?A ?a \<in> fc_mats
hermitian B
A \<in> fc_mats
B \<in> fc_mats
R \<in> fc_mats
fc_mats = carrier_mat dimR dimC
dimR = dimC
b \<in> spectrum B
\<lbrakk>?A \<in> fc_mats; ?B \<in> fc_mats\<rbrakk> \<Longrightarrow> ?A * ?B \<in> fc_mats

goal (1 subgoal):
 1. A * eigen_projector B b * R \<in> carrier_mat dimR dimR
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
A * eigen_projector B b * R \<in> carrier_mat dimR dimR

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b * Complex_Matrix.trace (A * eigen_projector B b * R) = Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R))

goal (1 subgoal):
 1. \<And>x. x \<in> spectrum B \<Longrightarrow> x * Complex_Matrix.trace (A * eigen_projector B x * R) = Complex_Matrix.trace (A * (x \<cdot>\<^sub>m eigen_projector B x) * R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b * Complex_Matrix.trace (A * eigen_projector B b * R) = Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R))

goal (1 subgoal):
 1. \<And>x. x \<in> spectrum B \<Longrightarrow> x * Complex_Matrix.trace (A * eigen_projector B x * R) = Complex_Matrix.trace (A * (x \<cdot>\<^sub>m eigen_projector B x) * R)
[PROOF STEP]
have "... = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
have "b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))
[PROOF STEP]
have "A * eigen_projector B b * R = A * (eigen_projector B b * R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * eigen_projector B b * R = A * (eigen_projector B b * R)
[PROOF STEP]
by (metis \<open>b \<in> spectrum B\<close> assms(1) assms(2) assms(3) assms(4) assoc_mult_mat dim_eq
              fc_mats_carrier eigen_projector_carrier)
[PROOF STATE]
proof (state)
this:
A * eigen_projector B b * R = A * (eigen_projector B b * R)

goal (1 subgoal):
 1. b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A * eigen_projector B b * R = A * (eigen_projector B b * R)

goal (1 subgoal):
 1. b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = b \<cdot>\<^sub>m (A * (eigen_projector B b * R))

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
have "... = A * (b \<cdot>\<^sub>m (eigen_projector B b * R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<cdot>\<^sub>m (A * (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m (eigen_projector B b * R))
[PROOF STEP]
proof (rule mult_smult_distrib[symmetric])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> carrier_mat ?nr ?n
 2. eigen_projector B b * R \<in> carrier_mat ?n ?nc
[PROOF STEP]
show "A \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat dimR dimR
[PROOF STEP]
using eigen_projector_carrier  assms
            fc_mats_carrier dim_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> fc_mats; ?a \<in> spectrum ?A; hermitian ?A\<rbrakk> \<Longrightarrow> eigen_projector ?A ?a \<in> fc_mats
hermitian B
A \<in> fc_mats
B \<in> fc_mats
R \<in> fc_mats
fc_mats = carrier_mat dimR dimC
dimR = dimC

goal (1 subgoal):
 1. A \<in> carrier_mat dimR dimR
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat dimR dimR

goal (1 subgoal):
 1. eigen_projector B b * R \<in> carrier_mat dimR ?nc
[PROOF STEP]
show "eigen_projector B b * R \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_projector B b * R \<in> carrier_mat dimR dimR
[PROOF STEP]
using eigen_projector_carrier
            \<open>b \<in> spectrum B\<close> assms fc_mats_carrier dim_eq cpx_sq_mat_mult
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> fc_mats; ?a \<in> spectrum ?A; hermitian ?A\<rbrakk> \<Longrightarrow> eigen_projector ?A ?a \<in> fc_mats
b \<in> spectrum B
hermitian B
A \<in> fc_mats
B \<in> fc_mats
R \<in> fc_mats
fc_mats = carrier_mat dimR dimC
dimR = dimC
\<lbrakk>?A \<in> fc_mats; ?B \<in> fc_mats\<rbrakk> \<Longrightarrow> ?A * ?B \<in> fc_mats

goal (1 subgoal):
 1. eigen_projector B b * R \<in> carrier_mat dimR dimR
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
eigen_projector B b * R \<in> carrier_mat dimR dimR

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m (A * (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m (eigen_projector B b * R))

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m (A * (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m (eigen_projector B b * R))

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
have "... = A * ((b \<cdot>\<^sub>m eigen_projector B b) * R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (b \<cdot>\<^sub>m (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m eigen_projector B b * R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * (b \<cdot>\<^sub>m (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m eigen_projector B b * R)
[PROOF STEP]
have "b \<cdot>\<^sub>m (eigen_projector B b * R) = (b \<cdot>\<^sub>m eigen_projector B b) * R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<cdot>\<^sub>m (eigen_projector B b * R) = b \<cdot>\<^sub>m eigen_projector B b * R
[PROOF STEP]
proof (rule mult_smult_assoc_mat[symmetric])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eigen_projector B b \<in> carrier_mat ?nr ?n
 2. R \<in> carrier_mat ?n ?nc
[PROOF STEP]
show "eigen_projector B b \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_projector B b \<in> carrier_mat dimR dimR
[PROOF STEP]
using eigen_projector_carrier
              \<open>b \<in> spectrum B\<close> assms fc_mats_carrier dim_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> fc_mats; ?a \<in> spectrum ?A; hermitian ?A\<rbrakk> \<Longrightarrow> eigen_projector ?A ?a \<in> fc_mats
b \<in> spectrum B
hermitian B
A \<in> fc_mats
B \<in> fc_mats
R \<in> fc_mats
fc_mats = carrier_mat dimR dimC
dimR = dimC

goal (1 subgoal):
 1. eigen_projector B b \<in> carrier_mat dimR dimR
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eigen_projector B b \<in> carrier_mat dimR dimR

goal (1 subgoal):
 1. R \<in> carrier_mat dimR ?nc
[PROOF STEP]
show "R \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<in> carrier_mat dimR dimR
[PROOF STEP]
using assms fc_mats_carrier dim_eq
[PROOF STATE]
proof (prove)
using this:
hermitian B
A \<in> fc_mats
B \<in> fc_mats
R \<in> fc_mats
fc_mats = carrier_mat dimR dimC
dimR = dimC

goal (1 subgoal):
 1. R \<in> carrier_mat dimR dimR
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R \<in> carrier_mat dimR dimR

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m (eigen_projector B b * R) = b \<cdot>\<^sub>m eigen_projector B b * R

goal (1 subgoal):
 1. A * (b \<cdot>\<^sub>m (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m eigen_projector B b * R)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<cdot>\<^sub>m (eigen_projector B b * R) = b \<cdot>\<^sub>m eigen_projector B b * R

goal (1 subgoal):
 1. A * (b \<cdot>\<^sub>m (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m eigen_projector B b * R)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * (b \<cdot>\<^sub>m (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m eigen_projector B b * R)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A * (b \<cdot>\<^sub>m (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m eigen_projector B b * R)

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A * (b \<cdot>\<^sub>m (eigen_projector B b * R)) = A * (b \<cdot>\<^sub>m eigen_projector B b * R)

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
have "... = A * (b \<cdot>\<^sub>m eigen_projector B b) * R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (b \<cdot>\<^sub>m eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R
[PROOF STEP]
by (metis \<open>b \<in> spectrum B\<close> assms(1) assms(2) assms(3) assms(4) assoc_mult_mat
            cpx_sq_mat_smult dim_eq fc_mats_carrier eigen_projector_carrier)
[PROOF STATE]
proof (state)
this:
A * (b \<cdot>\<^sub>m eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R
[PROOF STEP]
have "b \<cdot>\<^sub>m (A * eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R"
[PROOF STATE]
proof (prove)
using this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R

goal (1 subgoal):
 1. b \<cdot>\<^sub>m (A * eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<cdot>\<^sub>m (A * eigen_projector B b * R) = A * (b \<cdot>\<^sub>m eigen_projector B b) * R

goal (1 subgoal):
 1. Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (b \<cdot>\<^sub>m (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)

goal (1 subgoal):
 1. \<And>x. x \<in> spectrum B \<Longrightarrow> x * Complex_Matrix.trace (A * eigen_projector B x * R) = Complex_Matrix.trace (A * (x \<cdot>\<^sub>m eigen_projector B x) * R)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
b * Complex_Matrix.trace (A * eigen_projector B b * R) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
show "b * Complex_Matrix.trace (A * eigen_projector B b * R) =
      Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)"
[PROOF STATE]
proof (prove)
using this:
b * Complex_Matrix.trace (A * eigen_projector B b * R) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)

goal (1 subgoal):
 1. b * Complex_Matrix.trace (A * eigen_projector B b * R) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
b * Complex_Matrix.trace (A * eigen_projector B b * R) = Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = (\<Sum>b\<in>spectrum B. Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R))

goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = (\<Sum>b\<in>spectrum B. Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R))

goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
have "... = Complex_Matrix.trace (A *
    (sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B)) * R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)) = Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R)
[PROOF STEP]
proof (rule trace_sum_mat_mat_distrib, (auto simp add: assms))
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (spectrum B)
 2. \<And>b. b \<in> spectrum B \<Longrightarrow> b \<cdot>\<^sub>m eigen_projector B b \<in> fc_mats
[PROOF STEP]
show "finite (spectrum B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (spectrum B)
[PROOF STEP]
using spectrum_finite[of B]
[PROOF STATE]
proof (prove)
using this:
finite (spectrum B)

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

goal (1 subgoal):
 1. \<And>b. b \<in> spectrum B \<Longrightarrow> b \<cdot>\<^sub>m eigen_projector B b \<in> fc_mats
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> spectrum B \<Longrightarrow> b \<cdot>\<^sub>m eigen_projector B b \<in> fc_mats
[PROOF STEP]
assume "b\<in> spectrum B"
[PROOF STATE]
proof (state)
this:
b \<in> spectrum B

goal (1 subgoal):
 1. \<And>b. b \<in> spectrum B \<Longrightarrow> b \<cdot>\<^sub>m eigen_projector B b \<in> fc_mats
[PROOF STEP]
show "b \<cdot>\<^sub>m eigen_projector B b \<in> fc_mats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<cdot>\<^sub>m eigen_projector B b \<in> fc_mats
[PROOF STEP]
by (simp add: \<open>b \<in> spectrum B\<close> assms(1) assms(3) cpx_sq_mat_smult eigen_projector_carrier)
[PROOF STATE]
proof (state)
this:
b \<cdot>\<^sub>m eigen_projector B b \<in> fc_mats

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>spectrum B. Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)) = Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R)

goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>spectrum B. Complex_Matrix.trace (A * (b \<cdot>\<^sub>m eigen_projector B b) * R)) = Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R)

goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
have "... = Complex_Matrix.trace (A * B * R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
have "sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) = B
[PROOF STEP]
using make_pm_sum' assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> fc_mats; hermitian ?A\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>a. a \<cdot>\<^sub>m eigen_projector ?A a) (spectrum ?A) = ?A
hermitian B
A \<in> fc_mats
B \<in> fc_mats
R \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) = B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) = B

goal (1 subgoal):
 1. Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) = B

goal (1 subgoal):
 1. Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R) = Complex_Matrix.trace (A * B * R)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (A * local.sum_mat (\<lambda>b. b \<cdot>\<^sub>m eigen_projector B b) (spectrum B) * R) = Complex_Matrix.trace (A * B * R)

goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)

goal (1 subgoal):
 1. (\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>spectrum B. b * Complex_Matrix.trace (A * eigen_projector B b * R)) = Complex_Matrix.trace (A * B * R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_pos_neg2: "0 < a \<Longrightarrow> b < 0 \<Longrightarrow> b * a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) < a; b < (0::'a)\<rbrakk> \<Longrightarrow> b * a < (0::'a)
[PROOF STEP]
by (drule mult_strict_right_mono [of b 0], auto)


[STATEMENT]
lemma (in ab_group_add) sum_list_subtractf:
  "(\<Sum>x\<leftarrow>xs. f x - g x) = sum_list (map f xs) - sum_list (map g xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>xs. f x - g x) = sum_list (map f xs) - sum_list (map g xs)
[PROOF STEP]
by (induct xs) (simp_all add: algebra_simps)


[STATEMENT]
lemma wfp_on_iff_minimal:
  "wfp_on P A \<longleftrightarrow> (\<forall>Q x.
     x \<in> Q \<and> Q \<subseteq> A \<longrightarrow>
     (\<exists>z\<in>Q. \<forall>y. P y z \<longrightarrow> y \<notin> Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfp_on P A = (\<forall>Q x. x \<in> Q \<and> Q \<subseteq> A \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. P y z \<longrightarrow> y \<notin> Q))
[PROOF STEP]
using wfp_on_imp_minimal [of P A]
    and minimal_imp_inductive_on [of A P]
    and inductive_on_imp_wfp_on [of P A]
[PROOF STATE]
proof (prove)
using this:
wfp_on P A \<Longrightarrow> \<forall>Q x. x \<in> Q \<and> Q \<subseteq> A \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. P y z \<longrightarrow> y \<notin> Q)
\<forall>Q x. x \<in> Q \<and> Q \<subseteq> A \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. P y z \<longrightarrow> y \<notin> Q) \<Longrightarrow> inductive_on P A
inductive_on P A \<Longrightarrow> wfp_on P A

goal (1 subgoal):
 1. wfp_on P A = (\<forall>Q x. x \<in> Q \<and> Q \<subseteq> A \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. P y z \<longrightarrow> y \<notin> Q))
[PROOF STEP]
by blast


[STATEMENT]
theorem Snd: "Snd (Opair x y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Snd (Opair x y) = y
[PROOF STEP]
apply (simp add: Snd_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME ya. \<exists>xa. Opair x y = Opair xa ya) = y
[PROOF STEP]
apply (rule someI2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>xa. Opair x y = Opair xa ?a
 2. \<And>xa. \<exists>xb. Opair x y = Opair xb xa \<Longrightarrow> xa = y
[PROOF STEP]
apply (simp_all add: Opair)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_lemma_xy: assumes "\<bar>b\<bar> + 1 \<le> norm(y) - a" "norm(x) \<le> a" shows "b \<le> norm(x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> norm (x + y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<le> norm (x + y)
[PROOF STEP]
have "b \<le> norm y - norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> norm y - norm x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>b\<bar> + 1 \<le> norm y - a
norm x \<le> a

goal (1 subgoal):
 1. b \<le> norm y - norm x
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
b \<le> norm y - norm x

goal (1 subgoal):
 1. b \<le> norm (x + y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<le> norm y - norm x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<le> norm y - norm x

goal (1 subgoal):
 1. b \<le> norm (x + y)
[PROOF STEP]
by (metis (no_types) add.commute norm_diff_ineq order_trans)
[PROOF STATE]
proof (state)
this:
b \<le> norm (x + y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma akra_bazzi_p_mono:
  assumes "x \<le> y"
  shows "(\<Sum>i<k. as!i * bs!i powr y) \<le> (\<Sum>i<k. as!i * bs!i powr x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. as ! i * bs ! i powr y) \<le> (\<Sum>i<k. as ! i * bs ! i powr x)
[PROOF STEP]
apply (cases "x < y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x < y \<Longrightarrow> (\<Sum>i<k. as ! i * bs ! i powr y) \<le> (\<Sum>i<k. as ! i * bs ! i powr x)
 2. \<not> x < y \<Longrightarrow> (\<Sum>i<k. as ! i * bs ! i powr y) \<le> (\<Sum>i<k. as ! i * bs ! i powr x)
[PROOF STEP]
using akra_bazzi_p_strict_mono[of x y] assms
[PROOF STATE]
proof (prove)
using this:
x < y \<Longrightarrow> (\<Sum>i<k. as ! i * bs ! i powr y) < (\<Sum>i<k. as ! i * bs ! i powr x)
x \<le> y

goal (2 subgoals):
 1. x < y \<Longrightarrow> (\<Sum>i<k. as ! i * bs ! i powr y) \<le> (\<Sum>i<k. as ! i * bs ! i powr x)
 2. \<not> x < y \<Longrightarrow> (\<Sum>i<k. as ! i * bs ! i powr y) \<le> (\<Sum>i<k. as ! i * bs ! i powr x)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(\<Union> i \<in> set (non_wildcard_ifaces n). internal_iface_name_to_set i) = {s::string. length s = n \<and> \<not> iface_name_is_wildcard s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (internal_iface_name_to_set ` set (non_wildcard_ifaces n)) = {s. length s = n \<and> \<not> iface_name_is_wildcard s}
[PROOF STEP]
by(simp add: non_wildcard_ifaces)


[STATEMENT]
lemma degree_linear_power_neg[simp]:
  fixes a :: "'a::{idom,comm_ring_1}"
  shows "degree ([:a, -1:] ^ n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree ([:a, - (1::'a):] ^ n) = n
[PROOF STEP]
apply (rule order_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. degree ([:a, - (1::'a):] ^ n) \<le> n
 2. n \<le> degree ([:a, - (1::'a):] ^ n)
[PROOF STEP]
apply (rule ord_le_eq_trans [OF degree_power_le], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> degree ([:a, - (1::'a):] ^ n)
[PROOF STEP]
apply (rule le_degree)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff ([:a, - (1::'a):] ^ n) n \<noteq> (0::'a)
[PROOF STEP]
unfolding coeff_linear_power_neg
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ n \<noteq> (0::'a)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma aprimedivisor_gt_Suc_0:
  assumes "n \<noteq> Suc 0"
  shows   "aprimedivisor n > Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < aprimedivisor n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc 0 < aprimedivisor n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> Suc 0
[PROOF STEP]
have "prime (aprimedivisor n)"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> Suc 0

goal (1 subgoal):
 1. prime (aprimedivisor n)
[PROOF STEP]
by (rule aprimedivisor_nat)
[PROOF STATE]
proof (state)
this:
prime (aprimedivisor n)

goal (1 subgoal):
 1. Suc 0 < aprimedivisor n
[PROOF STEP]
thus "aprimedivisor n > Suc 0"
[PROOF STATE]
proof (prove)
using this:
prime (aprimedivisor n)

goal (1 subgoal):
 1. Suc 0 < aprimedivisor n
[PROOF STEP]
by (simp add: prime_nat_iff)
[PROOF STATE]
proof (state)
this:
Suc 0 < aprimedivisor n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma WHILEIT_to_monadic: "WHILEIT I b f s = monadic_WHILEIT I (\<lambda>s. RETURN (b s)) f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. WHILE\<^sub>T\<^bsup>I\<^esup> b f s = monadic_WHILEIT I (\<lambda>s. RETURN (b s)) f s
[PROOF STEP]
unfolding WHILEIT_def monadic_WHILEIT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. REC\<^sub>T (WHILEI_body (\<bind>) RETURN I b f) s = REC\<^sub>T (\<lambda>D s. ASSERT (I s) \<bind> (\<lambda>_. RETURN (b s) \<bind> (\<lambda>bv. if bv then f s \<bind> D else RETURN s))) s
[PROOF STEP]
unfolding WHILEI_body_def bind_ASSERT_eq_if
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. REC\<^sub>T (\<lambda>W s. if I s then if b s then f s \<bind> W else RETURN s else FAIL) s = REC\<^sub>T (\<lambda>D s. if I s then RETURN (b s) \<bind> (\<lambda>bv. if bv then f s \<bind> D else RETURN s) else FAIL) s
[PROOF STEP]
by (simp cong: if_cong)


[STATEMENT]
lemma filterlim_tendsto_neg_mult_at_bot_iff:
  fixes c :: real
  assumes "(f \<longlongrightarrow> c) F" "0 > c"
  shows "(LIM x F. f x * g x :> at_bot) \<longleftrightarrow> filterlim g at_top F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LIM x F. f x * g x :> at_bot) = filterlim g at_top F
[PROOF STEP]
using filterlim_tendsto_neg_mult_at_top_iff[OF assms(1,2), of "\<lambda>x. - g x"]
[PROOF STATE]
proof (prove)
using this:
(LIM x F. f x * - g x :> at_top) = (LIM x F. - g x :> at_bot)

goal (1 subgoal):
 1. (LIM x F. f x * g x :> at_bot) = filterlim g at_top F
[PROOF STEP]
unfolding filterlim_uminus_at_top
[PROOF STATE]
proof (prove)
using this:
(LIM x F. - (f x * - g x) :> at_bot) = (LIM x F. - g x :> at_bot)

goal (1 subgoal):
 1. (LIM x F. f x * g x :> at_bot) = (LIM x F. - g x :> at_bot)
[PROOF STEP]
by simp


[STATEMENT]
lemma dep_iff_supset_circuit:
  assumes "X \<subseteq> carrier"
  shows "\<not> indep X \<longleftrightarrow> (\<exists>C. circuit C \<and> C \<subseteq> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> indep X) = (\<exists>C. circuit C \<and> C \<subseteq> X)
[PROOF STEP]
using assms dep_imp_supset_circuit supset_circuit_imp_dep
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> carrier
\<lbrakk>?X \<subseteq> carrier; \<not> indep ?X\<rbrakk> \<Longrightarrow> \<exists>C. circuit C \<and> C \<subseteq> ?X
circuit ?C \<and> ?C \<subseteq> ?X \<Longrightarrow> \<not> indep ?X

goal (1 subgoal):
 1. (\<not> indep X) = (\<exists>C. circuit C \<and> C \<subseteq> X)
[PROOF STEP]
by auto


[STATEMENT]
lemma Lim_cong_within:
  assumes "a = b"
    and "x = y"
    and "S = T"
    and "\<And>x. x \<noteq> b \<Longrightarrow> x \<in> T \<Longrightarrow> f x = g x"
  shows "(f \<longlongrightarrow> x) (at a within S) \<longleftrightarrow> (g \<longlongrightarrow> y) (at b within T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> x) (at a within S) = (g \<longlongrightarrow> y) (at b within T)
[PROOF STEP]
unfolding tendsto_def eventually_at_topological
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>Sa. open Sa \<longrightarrow> x \<in> Sa \<longrightarrow> (\<exists>Sb. open Sb \<and> a \<in> Sb \<and> (\<forall>x\<in>Sb. x \<noteq> a \<longrightarrow> x \<in> S \<longrightarrow> f x \<in> Sa))) = (\<forall>S. open S \<longrightarrow> y \<in> S \<longrightarrow> (\<exists>Sa. open Sa \<and> b \<in> Sa \<and> (\<forall>x\<in>Sa. x \<noteq> b \<longrightarrow> x \<in> T \<longrightarrow> g x \<in> S)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a = b
x = y
S = T
\<lbrakk>?x \<noteq> b; ?x \<in> T\<rbrakk> \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. (\<forall>Sa. open Sa \<longrightarrow> x \<in> Sa \<longrightarrow> (\<exists>Sb. open Sb \<and> a \<in> Sb \<and> (\<forall>x\<in>Sb. x \<noteq> a \<longrightarrow> x \<in> S \<longrightarrow> f x \<in> Sa))) = (\<forall>S. open S \<longrightarrow> y \<in> S \<longrightarrow> (\<exists>Sa. open Sa \<and> b \<in> Sa \<and> (\<forall>x\<in>Sa. x \<noteq> b \<longrightarrow> x \<in> T \<longrightarrow> g x \<in> S)))
[PROOF STEP]
by simp


[STATEMENT]
lemma conjugate_char_1:
  "conjugate f g \<longleftrightarrow> (\<forall>x y . f(x \<sqinter> -(g y)) \<le> f x \<sqinter> -y \<and> g(y \<sqinter> -(f x)) \<le> g y \<sqinter> -x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate f g = (\<forall>x y. f (x \<sqinter> - g y) \<le> f x \<sqinter> - y \<and> g (y \<sqinter> - f x) \<le> g y \<sqinter> - x)
[PROOF STEP]
by (simp add: conjugate_char_1_pp)


[STATEMENT]
theorem permutation_ghc_sort:
  "mset (ghc_sort xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (ghc_sort xs) = mset xs
[PROOF STEP]
unfolding ghc_sort_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (merge_list [] (map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs))) = mset xs
[PROOF STEP]
apply (subst merge_list_correct[THEN conjunct2])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>l. l \<in> set (map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs)) \<Longrightarrow> sorted l
 2. \<And>l. l \<in> set [] \<Longrightarrow> sorted l
 3. mset (concat ([] @ map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs))) = mset xs
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_ \<in> set (map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs)) \<Longrightarrow> sorted l_
[PROOF STEP]
using reverse_phase_sorted
[PROOF STATE]
proof (prove)
using this:
Ball (set (map (\<lambda>ys. if decr ys then rev ys else ys) (cuts ?xs))) sorted

goal (1 subgoal):
 1. l_ \<in> set (map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs)) \<Longrightarrow> sorted l_
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l. l \<in> set [] \<Longrightarrow> sorted l
 2. mset (concat ([] @ map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs))) = mset xs
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_ \<in> set [] \<Longrightarrow> sorted l_
[PROOF STEP]
using reverse_phase_sorted
[PROOF STATE]
proof (prove)
using this:
Ball (set (map (\<lambda>ys. if decr ys then rev ys else ys) (cuts ?xs))) sorted

goal (1 subgoal):
 1. l_ \<in> set [] \<Longrightarrow> sorted l_
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (concat ([] @ map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs))) = mset xs
[PROOF STEP]
apply (subst (2) reverse_phase_permutation[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (concat ([] @ map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs))) = mset (concat (map (\<lambda>ys. if decr ys then rev ys else ys) (cuts xs)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma connected_component_of_nonoverlap:
   "connected_component_of_set X x \<inter> connected_component_of_set X y = {} \<longleftrightarrow>
     (x \<notin> topspace X) \<or> (y \<notin> topspace X) \<or>
     ~(connected_component_of_set X x = connected_component_of_set X y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_component_of_set X x \<inter> connected_component_of_set X y = {}) = (x \<notin> topspace X \<or> y \<notin> topspace X \<or> connected_component_of_set X x \<noteq> connected_component_of_set X y)
[PROOF STEP]
by (metis connected_component_of_eq_empty connected_component_of_eq_overlap inf.idem)


[STATEMENT]
theorem IF2map_id: "IF2map id = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IF2map id = id
[PROOF STEP]
apply (rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id = IF2map id
[PROOF STEP]
apply (rule conjunct2[OF IFmap_unique])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ?u3 \<circ> ctor1 = ctor1 \<circ> F1map id ?u3 id
 2. id \<circ> ctor2 = ctor2 \<circ> F2map id ?u3 id
[PROOF STEP]
apply (rule trans[OF id_o])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ctor1 = ctor1 \<circ> F1map id id id
 2. id \<circ> ctor2 = ctor2 \<circ> F2map id id id
[PROOF STEP]
apply (rule trans[OF sym[OF o_id]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ctor1 \<circ> id = ctor1 \<circ> F1map id id id
 2. id \<circ> ctor2 = ctor2 \<circ> F2map id id id
[PROOF STEP]
apply (rule arg_cong[OF sym[OF F1.map_id0]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id \<circ> ctor2 = ctor2 \<circ> F2map id id id
[PROOF STEP]
apply (rule trans[OF id_o])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ctor2 = ctor2 \<circ> F2map id id id
[PROOF STEP]
apply (rule trans[OF sym[OF o_id]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ctor2 \<circ> id = ctor2 \<circ> F2map id id id
[PROOF STEP]
apply (rule arg_cong[OF sym[OF F2.map_id0]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma deMorgan2: "not(X or Y) = ((not X) and (not Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not (X or Y) = (not X and not Y)
[PROOF STEP]
by(simp add: OclOr_def)


[STATEMENT]
lemma all_iff_abs: "(\<forall>x::'a. P x) \<longleftrightarrow> (\<forall>n::nat. P (abs_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x) = (\<forall>n. P (abs_nat n))
[PROOF STEP]
by (metis rep_inverse)


[STATEMENT]
lemma min_int_poly_content [simp]:
  fixes x :: "'a :: {field_char_0, field_gcd}"
  shows "content (min_int_poly x) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (min_int_poly x) = 1
[PROOF STEP]
using min_int_poly_primitive[of x]
[PROOF STATE]
proof (prove)
using this:
primitive (min_int_poly x)

goal (1 subgoal):
 1. content (min_int_poly x) = 1
[PROOF STEP]
by (simp add: primitive_def)


[STATEMENT]
lemma transpose_column:
  fixes xs :: "'a list list"
  assumes sorted: "sorted (rev (map length xs))" and "i < length xs"
  shows "map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))
    = xs ! i" (is "?R = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) = xs ! i
[PROOF STEP]
proof (rule nth_equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) = length (xs ! i)
 2. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
show length: "length ?R = length (xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) = length (xs ! i)
[PROOF STEP]
using transpose_column_length[OF assms]
[PROOF STATE]
proof (prove)
using this:
length (filter (\<lambda>ys. i < length ys) (transpose xs)) = length (xs ! i)

goal (1 subgoal):
 1. length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) = length (xs ! i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) = length (xs ! i)

goal (1 subgoal):
 1. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
assume j: "j < length ?R"
[PROOF STATE]
proof (state)
this:
j < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)))

goal (1 subgoal):
 1. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
note * = less_le_trans[OF this, unfolded length_map, OF length_filter_le]
[PROOF STATE]
proof (state)
this:
j < length (transpose xs)

goal (1 subgoal):
 1. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
from j
[PROOF STATE]
proof (chain)
picking this:
j < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)))
[PROOF STEP]
have j_less: "j < length (xs ! i)"
[PROOF STATE]
proof (prove)
using this:
j < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)))

goal (1 subgoal):
 1. j < length (xs ! i)
[PROOF STEP]
using length
[PROOF STATE]
proof (prove)
using this:
j < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)))
length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) = length (xs ! i)

goal (1 subgoal):
 1. j < length (xs ! i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
j < length (xs ! i)

goal (1 subgoal):
 1. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
have i_less_tW: "Suc i \<le> length (takeWhile (\<lambda>ys. Suc j \<le> length ys) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc i \<le> length (takeWhile (\<lambda>ys. Suc j \<le> length ys) xs)
[PROOF STEP]
proof (rule length_takeWhile_less_P_nth)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ia. ia < Suc i \<Longrightarrow> Suc j \<le> length (xs ! ia)
 2. Suc i \<le> length xs
[PROOF STEP]
show "Suc i \<le> length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc i \<le> length xs
[PROOF STEP]
using \<open>i < length xs\<close>
[PROOF STATE]
proof (prove)
using this:
i < length xs

goal (1 subgoal):
 1. Suc i \<le> length xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc i \<le> length xs

goal (1 subgoal):
 1. \<And>ia. ia < Suc i \<Longrightarrow> Suc j \<le> length (xs ! ia)
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. ia < Suc i \<Longrightarrow> Suc j \<le> length (xs ! ia)
[PROOF STEP]
assume "k < Suc i"
[PROOF STATE]
proof (state)
this:
k < Suc i

goal (1 subgoal):
 1. \<And>ia. ia < Suc i \<Longrightarrow> Suc j \<le> length (xs ! ia)
[PROOF STEP]
hence "k \<le> i"
[PROOF STATE]
proof (prove)
using this:
k < Suc i

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

goal (1 subgoal):
 1. \<And>ia. ia < Suc i \<Longrightarrow> Suc j \<le> length (xs ! ia)
[PROOF STEP]
with sorted_rev_nth_mono[OF sorted this] \<open>i < length xs\<close>
[PROOF STATE]
proof (chain)
picking this:
i < length (map length xs) \<Longrightarrow> map length xs ! i \<le> map length xs ! k
i < length xs
k \<le> i
[PROOF STEP]
have "length (xs ! i) \<le> length (xs ! k)"
[PROOF STATE]
proof (prove)
using this:
i < length (map length xs) \<Longrightarrow> map length xs ! i \<le> map length xs ! k
i < length xs
k \<le> i

goal (1 subgoal):
 1. length (xs ! i) \<le> length (xs ! k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (xs ! i) \<le> length (xs ! k)

goal (1 subgoal):
 1. \<And>ia. ia < Suc i \<Longrightarrow> Suc j \<le> length (xs ! ia)
[PROOF STEP]
thus "Suc j \<le> length (xs ! k)"
[PROOF STATE]
proof (prove)
using this:
length (xs ! i) \<le> length (xs ! k)

goal (1 subgoal):
 1. Suc j \<le> length (xs ! k)
[PROOF STEP]
using j_less
[PROOF STATE]
proof (prove)
using this:
length (xs ! i) \<le> length (xs ! k)
j < length (xs ! i)

goal (1 subgoal):
 1. Suc j \<le> length (xs ! k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc j \<le> length (xs ! k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Suc i \<le> length (takeWhile (\<lambda>ys. Suc j \<le> length ys) xs)

goal (1 subgoal):
 1. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
have i_less_filter: "i < length (filter (\<lambda>ys. j < length ys) xs) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (filter (\<lambda>ys. j < length ys) xs)
[PROOF STEP]
unfolding filter_equals_takeWhile_sorted_rev[OF sorted, of j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (takeWhile (\<lambda>ys. j < length ys) xs)
[PROOF STEP]
using i_less_tW
[PROOF STATE]
proof (prove)
using this:
Suc i \<le> length (takeWhile (\<lambda>ys. Suc j \<le> length ys) xs)

goal (1 subgoal):
 1. i < length (takeWhile (\<lambda>ys. j < length ys) xs)
[PROOF STEP]
by (simp_all add: Suc_le_eq)
[PROOF STATE]
proof (state)
this:
i < length (filter (\<lambda>ys. j < length ys) xs)

goal (1 subgoal):
 1. \<And>ia. ia < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs))) \<Longrightarrow> map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! ia = xs ! i ! ia
[PROOF STEP]
from j
[PROOF STATE]
proof (chain)
picking this:
j < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)))
[PROOF STEP]
show "?R ! j = xs ! i ! j"
[PROOF STATE]
proof (prove)
using this:
j < length (map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)))

goal (1 subgoal):
 1. map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! j = xs ! i ! j
[PROOF STEP]
unfolding filter_equals_takeWhile_sorted_rev[OF sorted_transpose, of i]
[PROOF STATE]
proof (prove)
using this:
j < length (map (\<lambda>ys. ys ! i) (takeWhile (\<lambda>ys. i < length ys) (transpose xs)))

goal (1 subgoal):
 1. map (\<lambda>ys. ys ! i) (takeWhile (\<lambda>ys. i < length ys) (transpose xs)) ! j = xs ! i ! j
[PROOF STEP]
by (simp add: takeWhile_nth nth_nth_transpose_sorted[OF sorted * i_less_filter])
[PROOF STATE]
proof (state)
this:
map (\<lambda>ys. ys ! i) (filter (\<lambda>ys. i < length ys) (transpose xs)) ! j = xs ! i ! j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_finite:
  assumes N: "finite N"
    and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 0"
  shows "suminf f = (\<Sum>n\<in>N. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf f = sum f N
[PROOF STEP]
using sums_finite[OF assms, THEN sums_unique]
[PROOF STATE]
proof (prove)
using this:
(\<And>n. n \<notin> N \<Longrightarrow> n \<notin> N) \<Longrightarrow> sum f N = suminf f

goal (1 subgoal):
 1. suminf f = sum f N
[PROOF STEP]
by simp


[STATEMENT]
lemma epi_iso_compose_rev:
  assumes "f \<in> epi G H" "g \<in> hom H K" "(g \<circ> f) \<in> iso G K"
  shows "f \<in> iso G H \<and> g \<in> iso H K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> Group.iso G H \<and> g \<in> Group.iso H K
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> Group.iso G H
 2. g \<in> Group.iso H K
[PROOF STEP]
show "f \<in> iso G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> Group.iso G H
[PROOF STEP]
by (metis (no_types, lifting) assms epi_def iso_compose_rev iso_iff_mon_epi mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
f \<in> Group.iso G H

goal (1 subgoal):
 1. g \<in> Group.iso H K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> Group.iso G H
[PROOF STEP]
have "f \<in> hom G H \<and> bij_betw f (carrier G) (carrier H)"
[PROOF STATE]
proof (prove)
using this:
f \<in> Group.iso G H

goal (1 subgoal):
 1. f \<in> hom G H \<and> bij_betw f (carrier G) (carrier H)
[PROOF STEP]
using Group.iso_def \<open>f \<in> Group.iso G H\<close>
[PROOF STATE]
proof (prove)
using this:
f \<in> Group.iso G H
Group.iso ?G ?H = {h \<in> hom ?G ?H. bij_betw h (carrier ?G) (carrier ?H)}
f \<in> Group.iso G H

goal (1 subgoal):
 1. f \<in> hom G H \<and> bij_betw f (carrier G) (carrier H)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<in> hom G H \<and> bij_betw f (carrier G) (carrier H)

goal (1 subgoal):
 1. g \<in> Group.iso H K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> hom G H \<and> bij_betw f (carrier G) (carrier H)
[PROOF STEP]
have "bij_betw g (carrier H) (carrier K)"
[PROOF STATE]
proof (prove)
using this:
f \<in> hom G H \<and> bij_betw f (carrier G) (carrier H)

goal (1 subgoal):
 1. bij_betw g (carrier H) (carrier K)
[PROOF STEP]
using Group.iso_def assms(3) bij_betw_comp_iff
[PROOF STATE]
proof (prove)
using this:
f \<in> hom G H \<and> bij_betw f (carrier G) (carrier H)
Group.iso ?G ?H = {h \<in> hom ?G ?H. bij_betw h (carrier ?G) (carrier ?H)}
g \<circ> f \<in> Group.iso G K
bij_betw ?f ?A ?A' \<Longrightarrow> bij_betw ?f' ?A' ?A'' = bij_betw (?f' \<circ> ?f) ?A ?A''

goal (1 subgoal):
 1. bij_betw g (carrier H) (carrier K)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw g (carrier H) (carrier K)

goal (1 subgoal):
 1. g \<in> Group.iso H K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw g (carrier H) (carrier K)
[PROOF STEP]
show "g \<in> iso H K"
[PROOF STATE]
proof (prove)
using this:
bij_betw g (carrier H) (carrier K)

goal (1 subgoal):
 1. g \<in> Group.iso H K
[PROOF STEP]
using Group.iso_def assms(2)
[PROOF STATE]
proof (prove)
using this:
bij_betw g (carrier H) (carrier K)
Group.iso ?G ?H = {h \<in> hom ?G ?H. bij_betw h (carrier ?G) (carrier ?H)}
g \<in> hom H K

goal (1 subgoal):
 1. g \<in> Group.iso H K
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
g \<in> Group.iso H K

goal:
No subgoals!
[PROOF STEP]
qed