[STATEMENT]
lemma iso_classes_iff:
  assumes "group G"
  assumes "group H"
  shows "(\<exists>\<phi>. \<phi> \<in> iso G H) = (group.iso_class G = group.iso_class H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
from assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
Group.group G
Group.group H
[PROOF STEP]
have groups:"group (monoid.truncate G)" "group (monoid.truncate H)"
[PROOF STATE]
proof (prove)
using this:
Group.group G
Group.group H

goal (1 subgoal):
 1. Group.group (monoid.truncate G) &&& Group.group (monoid.truncate H)
[PROOF STEP]
unfolding monoid.truncate_def group_def group_axioms_def Units_def monoid_def
[PROOF STATE]
proof (prove)
using this:
(((\<forall>x y. x \<in> carrier G \<longrightarrow> y \<in> carrier G \<longrightarrow> x \<otimes>\<^bsub>G\<^esub> y \<in> carrier G) \<and> (\<forall>x y z. x \<in> carrier G \<longrightarrow> y \<in> carrier G \<longrightarrow> z \<in> carrier G \<longrightarrow> x \<otimes>\<^bsub>G\<^esub> y \<otimes>\<^bsub>G\<^esub> z = x \<otimes>\<^bsub>G\<^esub> (y \<otimes>\<^bsub>G\<^esub> z))) \<and> \<one>\<^bsub>G\<^esub> \<in> carrier G \<and> (\<forall>x. x \<in> carrier G \<longrightarrow> \<one>\<^bsub>G\<^esub> \<otimes>\<^bsub>G\<^esub> x = x) \<and> (\<forall>x. x \<in> carrier G \<longrightarrow> x \<otimes>\<^bsub>G\<^esub> \<one>\<^bsub>G\<^esub> = x)) \<and> carrier G \<subseteq> {y \<in> carrier G. \<exists>x\<in>carrier G. x \<otimes>\<^bsub>G\<^esub> y = \<one>\<^bsub>G\<^esub> \<and> y \<otimes>\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub>}
(((\<forall>x y. x \<in> carrier H \<longrightarrow> y \<in> carrier H \<longrightarrow> x \<otimes>\<^bsub>H\<^esub> y \<in> carrier H) \<and> (\<forall>x y z. x \<in> carrier H \<longrightarrow> y \<in> carrier H \<longrightarrow> z \<in> carrier H \<longrightarrow> x \<otimes>\<^bsub>H\<^esub> y \<otimes>\<^bsub>H\<^esub> z = x \<otimes>\<^bsub>H\<^esub> (y \<otimes>\<^bsub>H\<^esub> z))) \<and> \<one>\<^bsub>H\<^esub> \<in> carrier H \<and> (\<forall>x. x \<in> carrier H \<longrightarrow> \<one>\<^bsub>H\<^esub> \<otimes>\<^bsub>H\<^esub> x = x) \<and> (\<forall>x. x \<in> carrier H \<longrightarrow> x \<otimes>\<^bsub>H\<^esub> \<one>\<^bsub>H\<^esub> = x)) \<and> carrier H \<subseteq> {y \<in> carrier H. \<exists>x\<in>carrier H. x \<otimes>\<^bsub>H\<^esub> y = \<one>\<^bsub>H\<^esub> \<and> y \<otimes>\<^bsub>H\<^esub> x = \<one>\<^bsub>H\<^esub>}

goal (1 subgoal):
 1. (((\<forall>x y. x \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> y \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>) \<and> (\<forall>x y z. x \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<longrightarrow> z \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> z = x \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> z))) \<and> \<one>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<and> (\<forall>x. x \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<longrightarrow> \<one>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> x = x) \<and> (\<forall>x. x \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> \<one>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> = x)) \<and> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<subseteq> {y \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>. \<exists>x\<in>carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> y = \<one>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> \<and> y \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub>} &&& (((\<forall>x y. x \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> y \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>) \<and> (\<forall>x y z. x \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<longrightarrow> y \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<longrightarrow> z \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> z = x \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> z))) \<and> \<one>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<and> (\<forall>x. x \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<longrightarrow> \<one>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> x = x) \<and> (\<forall>x. x \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> \<one>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> = x)) \<and> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr> \<subseteq> {y \<in> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>. \<exists>x\<in>carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> y = \<one>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> \<and> y \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Group.group (monoid.truncate G)
Group.group (monoid.truncate H)

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
have "(\<exists>\<phi>. \<phi> \<in> iso G H) = (\<exists>\<phi>. \<phi> \<in> iso (monoid.truncate G) (monoid.truncate H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H))
[PROOF STEP]
unfolding iso_def hom_def monoid.truncate_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> {h \<in> {h \<in> carrier G \<rightarrow> carrier H. \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y}. bij_betw h (carrier G) (carrier H)}) = (\<exists>\<phi>. \<phi> \<in> {h \<in> {h \<in> carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr> \<rightarrow> carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>. \<forall>x\<in>carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>. \<forall>y\<in>carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>. h (x \<otimes>\<^bsub>\<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> y) = h x \<otimes>\<^bsub>\<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>\<^esub> h y}. bij_betw h (carrier \<lparr>carrier = carrier G, mult = (\<otimes>\<^bsub>G\<^esub>), one = \<one>\<^bsub>G\<^esub>\<rparr>) (carrier \<lparr>carrier = carrier H, mult = (\<otimes>\<^bsub>H\<^esub>), one = \<one>\<^bsub>H\<^esub>\<rparr>)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H))

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H))

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
have "\<dots> = group_iso_rel (Abs_group (monoid.truncate G)) (Abs_group (monoid.truncate H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H)) = group_iso_rel (Abs_group (monoid.truncate G)) (Abs_group (monoid.truncate H))
[PROOF STEP]
unfolding group_iso_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H)) = (\<exists>\<phi>. \<phi> \<in> Group.iso (Rep_group (Abs_group (monoid.truncate G))) (Rep_group (Abs_group (monoid.truncate H))))
[PROOF STEP]
using groups group.Abs_group_inverse
[PROOF STATE]
proof (prove)
using this:
Group.group (monoid.truncate G)
Group.group (monoid.truncate H)
?y \<in> {G. Group.group G} \<Longrightarrow> Rep_group (Abs_group ?y) = ?y

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H)) = (\<exists>\<phi>. \<phi> \<in> Group.iso (Rep_group (Abs_group (monoid.truncate G))) (Rep_group (Abs_group (monoid.truncate H))))
[PROOF STEP]
by (metis mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
(\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H)) = group_iso_rel (Abs_group (monoid.truncate G)) (Abs_group (monoid.truncate H))

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>\<phi>. \<phi> \<in> Group.iso (monoid.truncate G) (monoid.truncate H)) = group_iso_rel (Abs_group (monoid.truncate G)) (Abs_group (monoid.truncate H))

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
have "\<dots> = (group.iso_class G = group.iso_class H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_iso_rel (Abs_group (monoid.truncate G)) (Abs_group (monoid.truncate H)) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
using group.iso_class_def assms group_iso_class.abs_eq_iff
[PROOF STATE]
proof (prove)
using this:
Group.group ?G \<Longrightarrow> group.iso_class ?G = Abs_group_iso (Abs_group (monoid.truncate ?G))
Group.group G
Group.group H
(Abs_group_iso ?x = Abs_group_iso ?y) = group_iso_rel ?x ?y

goal (1 subgoal):
 1. group_iso_rel (Abs_group (monoid.truncate G)) (Abs_group (monoid.truncate H)) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
group_iso_rel (Abs_group (monoid.truncate G)) (Abs_group (monoid.truncate H)) = (group.iso_class G = group.iso_class H)

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)

goal (1 subgoal):
 1. (\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<exists>\<phi>. \<phi> \<in> Group.iso G H) = (group.iso_class G = group.iso_class H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_mismatch_comm: "(bin_mismatch x y = bin_mismatch y x) \<longleftrightarrow> (x \<cdot> y = y \<cdot> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bin_mismatch x y = bin_mismatch y x) = (x \<cdot> y = y \<cdot> x)
[PROOF STEP]
unfolding bin_mismatch_def bin_lcp_def lcp_sym[of "y \<cdot> x"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x \<cdot> y) ! \<^bold>|x \<cdot> y \<and>\<^sub>p y \<cdot> x\<^bold>| = (y \<cdot> x) ! \<^bold>|x \<cdot> y \<and>\<^sub>p y \<cdot> x\<^bold>|) = (x \<cdot> y = y \<cdot> x)
[PROOF STEP]
using  lcp_mismatch'[of "x \<cdot> y" "y \<cdot> x", unfolded comm_comp_eq_conv[of x y]]
[PROOF STATE]
proof (prove)
using this:
x \<cdot> y \<noteq> y \<cdot> x \<Longrightarrow> (x \<cdot> y) ! \<^bold>|x \<cdot> y \<and>\<^sub>p y \<cdot> x\<^bold>| \<noteq> (y \<cdot> x) ! \<^bold>|x \<cdot> y \<and>\<^sub>p y \<cdot> x\<^bold>|

goal (1 subgoal):
 1. ((x \<cdot> y) ! \<^bold>|x \<cdot> y \<and>\<^sub>p y \<cdot> x\<^bold>| = (y \<cdot> x) ! \<^bold>|x \<cdot> y \<and>\<^sub>p y \<cdot> x\<^bold>|) = (x \<cdot> y = y \<cdot> x)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma erf_remainder_integral_bigo:
  "erf_remainder_integral n \<in> O(\<lambda>x. exp (-x\<^sup>2) / x ^ (2*n+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. erf_remainder_integral n \<in> O(\<lambda>x. exp (- x\<^sup>2) / x ^ (2 * n + 1))
[PROOF STEP]
using erf_remainder_integral_nonneg erf_remainder_integral_bound
[PROOF STATE]
proof (prove)
using this:
0 < ?x \<Longrightarrow> 0 \<le> erf_remainder_integral ?n ?x
0 < ?x \<Longrightarrow> erf_remainder_integral ?n ?x \<le> exp (- ?x\<^sup>2) / ?x ^ (2 * ?n + 1)

goal (1 subgoal):
 1. erf_remainder_integral n \<in> O(\<lambda>x. exp (- x\<^sup>2) / x ^ (2 * n + 1))
[PROOF STEP]
by (auto intro!: bigoI[of _ 1] eventually_mono [OF eventually_gt_at_top[of "0::real"]])


[STATEMENT]
lemma set_minus_finite:
  assumes fin: "finite Y"
  shows "set_minus X Y = Finite_Set.fold (\<lambda>a X. X - {a}) X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_minus X Y = Finite_Set.fold (\<lambda>a X. X - {a}) X Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_minus X Y = Finite_Set.fold (\<lambda>a X. X - {a}) X Y
[PROOF STEP]
interpret comp_fun_idem "\<lambda>a X. X - {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_idem (\<lambda>a X. X - {a})
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_minus X Y = Finite_Set.fold (\<lambda>a X. X - {a}) X Y
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite Y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite Y

goal (1 subgoal):
 1. set_minus X Y = Finite_Set.fold (\<lambda>a X. X - {a}) X Y
[PROOF STEP]
by (induction Y arbitrary: X rule: finite.induct) (auto simp add: set_minus_def)
[PROOF STATE]
proof (state)
this:
set_minus X Y = Finite_Set.fold (\<lambda>a X. X - {a}) X Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RSpan_zero_closed : "set ms \<subseteq> M \<Longrightarrow> 0 \<in> RSpan ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ms \<subseteq> M \<Longrightarrow> (0::'m) \<in> RSpan ms
[PROOF STEP]
using Group_RSpan Group.zero_closed
[PROOF STATE]
proof (prove)
using this:
set ?ms \<subseteq> M \<Longrightarrow> Group (RSpan ?ms)
Group ?G \<Longrightarrow> (0::?'g) \<in> ?G

goal (1 subgoal):
 1. set ms \<subseteq> M \<Longrightarrow> (0::'m) \<in> RSpan ms
[PROOF STEP]
by fast


[STATEMENT]
lemma (in gram_schmidt_fs_lin_indpt) Gramian_matrix_times_\<kappa> :
  assumes "i < m" "l \<le> i"
  shows "Gramian_matrix fs l *\<^sub>v (vec l (\<lambda>t. \<kappa> i l t)) = (vec l (\<lambda>j. - (fs ! i \<bullet> fs ! j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gramian_matrix fs l *\<^sub>v vec l (\<kappa> i l) = vec l (\<lambda>j. - (fs ! i \<bullet> fs ! j))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gramian_matrix fs l *\<^sub>v vec l (\<kappa> i l) = vec l (\<lambda>j. - (fs ! i \<bullet> fs ! j))
[PROOF STEP]
have "- (fs ! i \<bullet> fs ! j) = (\<Sum>t = 0..<l. fs ! t \<bullet> fs ! j * \<kappa> i l t)" if "j < l" for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (fs ! i \<bullet> fs ! j) = (\<Sum>t = 0..<l. fs ! t \<bullet> fs ! j * \<kappa> i l t)
[PROOF STEP]
using fs_i_fs_j_sum_\<kappa> assms that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < length fs; ?l \<le> ?i; ?j < ?l\<rbrakk> \<Longrightarrow> - (fs ! ?i \<bullet> fs ! ?j) = (\<Sum>t = 0..<?l. fs ! t \<bullet> fs ! ?j * \<kappa> ?i ?l t)
i < length fs
l \<le> i
j < l

goal (1 subgoal):
 1. - (fs ! i \<bullet> fs ! j) = (\<Sum>t = 0..<l. fs ! t \<bullet> fs ! j * \<kappa> i l t)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?j1 < l \<Longrightarrow> - (fs ! i \<bullet> fs ! ?j1) = (\<Sum>t = 0..<l. fs ! t \<bullet> fs ! ?j1 * \<kappa> i l t)

goal (1 subgoal):
 1. Gramian_matrix fs l *\<^sub>v vec l (\<kappa> i l) = vec l (\<lambda>j. - (fs ! i \<bullet> fs ! j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?j1 < l \<Longrightarrow> - (fs ! i \<bullet> fs ! ?j1) = (\<Sum>t = 0..<l. fs ! t \<bullet> fs ! ?j1 * \<kappa> i l t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?j1 < l \<Longrightarrow> - (fs ! i \<bullet> fs ! ?j1) = (\<Sum>t = 0..<l. fs ! t \<bullet> fs ! ?j1 * \<kappa> i l t)

goal (1 subgoal):
 1. Gramian_matrix fs l *\<^sub>v vec l (\<kappa> i l) = vec l (\<lambda>j. - (fs ! i \<bullet> fs ! j))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?j1 < l \<Longrightarrow> - (fs ! i \<bullet> fs ! ?j1) = (\<Sum>t = 0..<l. fs ! t \<bullet> fs ! ?j1 * \<kappa> i l t)
i < length fs
l \<le> i

goal (1 subgoal):
 1. Gramian_matrix fs l *\<^sub>v vec l (\<kappa> i l) = vec l (\<lambda>j. - (fs ! i \<bullet> fs ! j))
[PROOF STEP]
by (subst Gramian_matrix_alt_alt_def) (auto simp add: scalar_prod_def algebra_simps)
[PROOF STATE]
proof (state)
this:
Gramian_matrix fs l *\<^sub>v vec l (\<kappa> i l) = vec l (\<lambda>j. - (fs ! i \<bullet> fs ! j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma relcompp_in_rel: "in_rel R OO in_rel S = in_rel (R O S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. in_rel R OO in_rel S = in_rel (R O S)
[PROOF STEP]
unfolding fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x xa. (in_rel R OO in_rel S) x xa = in_rel (R O S) x xa
[PROOF STEP]
by auto


[STATEMENT]
lemma wf_tuple_Nil[simp]: "wf_tuple n A [] = (n = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_tuple n A [] = (n = 0)
[PROOF STEP]
unfolding wf_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length [] = n \<and> (\<forall>i<n. ([] ! i = None) = (i \<notin> A))) = (n = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma real_transfer_operator_abs:
  assumes [measurable]: "f \<in> borel_measurable M"
  shows "AE x in M. abs (real_transfer_operator f x) \<le> nn_transfer_operator (\<lambda>x. ennreal (abs(f x))) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
define fp where "fp = (\<lambda>x. ennreal (f x))"
[PROOF STATE]
proof (state)
this:
fp = (\<lambda>x. ennreal (f x))

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
define fm where "fm = (\<lambda>x. ennreal (- f x))"
[PROOF STATE]
proof (state)
this:
fm = (\<lambda>x. ennreal (- f x))

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
have [measurable]: "fp \<in> borel_measurable M" "fm \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fp \<in> borel_measurable M &&& fm \<in> borel_measurable M
[PROOF STEP]
unfolding fp_def fm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ennreal (f x)) \<in> borel_measurable M &&& (\<lambda>x. ennreal (- f x)) \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fp \<in> borel_measurable M
fm \<in> borel_measurable M

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
have eq: "\<And>x. ennreal \<bar>f x\<bar> = fp x + fm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ennreal \<bar>f x\<bar> = fp x + fm x
[PROOF STEP]
unfolding fp_def fm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ennreal \<bar>f x\<bar> = ennreal (f x) + ennreal (- f x)
[PROOF STEP]
by (simp add: abs_real_def ennreal_neg)
[PROOF STATE]
proof (state)
this:
ennreal \<bar>f ?x3\<bar> = fp ?x3 + fm ?x3

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
ennreal \<bar>f ?x3\<bar> = fp ?x3 + fm ?x3

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
assume H: "nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x"
[PROOF STATE]
proof (state)
this:
nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
have "\<bar>real_transfer_operator f x\<bar> \<le> \<bar>enn2real(nn_transfer_operator fp x)\<bar> + \<bar>enn2real(nn_transfer_operator fm x)\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>real_transfer_operator f x\<bar> \<le> \<bar>enn2real (nn_transfer_operator fp x)\<bar> + \<bar>enn2real (nn_transfer_operator fm x)\<bar>
[PROOF STEP]
unfolding real_transfer_operator_def fp_def fm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>enn2real (nn_transfer_operator (\<lambda>x. ennreal (f x)) x) - enn2real (nn_transfer_operator (\<lambda>x. ennreal (- f x)) x)\<bar> \<le> \<bar>enn2real (nn_transfer_operator (\<lambda>x. ennreal (f x)) x)\<bar> + \<bar>enn2real (nn_transfer_operator (\<lambda>x. ennreal (- f x)) x)\<bar>
[PROOF STEP]
by (auto intro: abs_triangle_ineq4 simp del: enn2real_nonneg)
[PROOF STATE]
proof (state)
this:
\<bar>real_transfer_operator f x\<bar> \<le> \<bar>enn2real (nn_transfer_operator fp x)\<bar> + \<bar>enn2real (nn_transfer_operator fm x)\<bar>

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
from ennreal_leI[OF this]
[PROOF STATE]
proof (chain)
picking this:
ennreal \<bar>real_transfer_operator f x\<bar> \<le> ennreal (\<bar>enn2real (nn_transfer_operator fp x)\<bar> + \<bar>enn2real (nn_transfer_operator fm x)\<bar>)
[PROOF STEP]
have "abs(real_transfer_operator f x) \<le> nn_transfer_operator fp x + nn_transfer_operator fm x"
[PROOF STATE]
proof (prove)
using this:
ennreal \<bar>real_transfer_operator f x\<bar> \<le> ennreal (\<bar>enn2real (nn_transfer_operator fp x)\<bar> + \<bar>enn2real (nn_transfer_operator fm x)\<bar>)

goal (1 subgoal):
 1. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator fp x + nn_transfer_operator fm x
[PROOF STEP]
by simp (metis add.commute ennreal_enn2real le_iff_add not_le top_unique)
[PROOF STATE]
proof (state)
this:
ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator fp x + nn_transfer_operator fm x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator fp x + nn_transfer_operator fm x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
have "... = nn_transfer_operator (\<lambda>x. fp x + fm x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nn_transfer_operator fp x + nn_transfer_operator fm x = nn_transfer_operator (\<lambda>x. fp x + fm x) x
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x

goal (1 subgoal):
 1. nn_transfer_operator fp x + nn_transfer_operator fm x = nn_transfer_operator (\<lambda>x. fp x + fm x) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nn_transfer_operator fp x + nn_transfer_operator fm x = nn_transfer_operator (\<lambda>x. fp x + fm x) x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x
[PROOF STEP]
have "abs(real_transfer_operator f x) \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x"
[PROOF STATE]
proof (prove)
using this:
ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x

goal (1 subgoal):
 1. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5 = nn_transfer_operator fp ?x5 + nn_transfer_operator fm ?x5 \<Longrightarrow> ennreal \<bar>real_transfer_operator f ?x5\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5 = nn_transfer_operator fp ?x5 + nn_transfer_operator fm ?x5 \<Longrightarrow> ennreal \<bar>real_transfer_operator f ?x5\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
have "AE x in M. nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x
[PROOF STEP]
by (rule nn_transfer_operator_sum) (auto simp add: fp_def fm_def)
[PROOF STATE]
proof (state)
this:
AE x in M. nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5 = nn_transfer_operator fp ?x5 + nn_transfer_operator fm ?x5 \<Longrightarrow> ennreal \<bar>real_transfer_operator f ?x5\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5
AE x in M. nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x
[PROOF STEP]
have "AE x in M. abs(real_transfer_operator f x) \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x"
[PROOF STATE]
proof (prove)
using this:
nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5 = nn_transfer_operator fp ?x5 + nn_transfer_operator fm ?x5 \<Longrightarrow> ennreal \<bar>real_transfer_operator f ?x5\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) ?x5
AE x in M. nn_transfer_operator (\<lambda>x. fp x + fm x) x = nn_transfer_operator fp x + nn_transfer_operator fm x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. fp x + fm x) x
ennreal \<bar>f ?x3\<bar> = fp ?x3 + fm ?x3

goal (1 subgoal):
 1. AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
AE x in M. ennreal \<bar>real_transfer_operator f x\<bar> \<le> nn_transfer_operator (\<lambda>x. ennreal \<bar>f x\<bar>) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma neighbourhood_base_of_with_subset:
   "neighbourhood_base_of P X \<longleftrightarrow> neighbourhood_base_of (\<lambda>t. t \<subseteq> topspace X \<and> P t) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neighbourhood_base_of P X = neighbourhood_base_of (\<lambda>t. t \<subseteq> topspace X \<and> P t) X
[PROOF STEP]
using neighbourhood_base_at_with_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>openin ?X ?U; ?x \<in> ?U\<rbrakk> \<Longrightarrow> neighbourhood_base_at ?x ?P ?X = neighbourhood_base_at ?x (\<lambda>T. T \<subseteq> ?U \<and> ?P T) ?X

goal (1 subgoal):
 1. neighbourhood_base_of P X = neighbourhood_base_of (\<lambda>t. t \<subseteq> topspace X \<and> P t) X
[PROOF STEP]
by (fastforce simp add: neighbourhood_base_of_def)


[STATEMENT]
lemma gf_F_nonneg:
  fixes z :: real
  shows "0 \<le> z \<Longrightarrow> z < 1 \<Longrightarrow> 0 \<le> gf_F x y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> z; z < 1\<rbrakk> \<Longrightarrow> 0 \<le> gf_F x y z
[PROOF STEP]
unfolding gf_F_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> z; z < 1\<rbrakk> \<Longrightarrow> 0 \<le> (\<Sum>n. f x y n * z ^ n)
[PROOF STEP]
using convergence_norm_F[OF convergence_G_less_1, of z x y]
[PROOF STATE]
proof (prove)
using this:
norm z < 1 \<Longrightarrow> summable (\<lambda>n. f x y n * norm z ^ n)

goal (1 subgoal):
 1. \<lbrakk>0 \<le> z; z < 1\<rbrakk> \<Longrightarrow> 0 \<le> (\<Sum>n. f x y n * z ^ n)
[PROOF STEP]
by (intro suminf_nonneg) (simp_all add: f_nonneg)


[STATEMENT]
lemma norm_triangle_eq:
  fixes x y :: "'a::real_inner"
  shows "norm (x + y) = norm x + norm y \<longleftrightarrow> norm x *\<^sub>R y = norm y *\<^sub>R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
proof (cases "x = 0 \<or> y = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = (0::'a) \<or> y = (0::'a) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
 2. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = (0::'a) \<or> y = (0::'a)

goal (2 subgoals):
 1. x = (0::'a) \<or> y = (0::'a) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
 2. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = (0::'a) \<or> y = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = (0::'a) \<or> y = (0::'a)

goal (1 subgoal):
 1. (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (x = (0::'a) \<or> y = (0::'a))

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (x = (0::'a) \<or> y = (0::'a))
[PROOF STEP]
have n: "norm x > 0" "norm y > 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (x = (0::'a) \<or> y = (0::'a))

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

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
have "norm (x + y) = norm x + norm y \<longleftrightarrow> (norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (x + y) = norm x + norm y) = ((norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(norm (x + y) = norm x + norm y) = ((norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2)

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (x + y) = norm x + norm y) = ((norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2)

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> norm x *\<^sub>R y = norm y *\<^sub>R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
unfolding norm_cauchy_schwarz_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2) = (x \<bullet> y = norm x * norm y)
[PROOF STEP]
unfolding power2_norm_eq_inner inner_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<bullet> x + y \<bullet> x + (x \<bullet> y + y \<bullet> y) = (norm x + norm y)\<^sup>2) = (x \<bullet> y = norm x * norm y)
[PROOF STEP]
by (simp add: power2_norm_eq_inner[symmetric] power2_eq_square inner_commute field_simps)
[PROOF STATE]
proof (state)
this:
((norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2) = (norm x *\<^sub>R y = norm y *\<^sub>R x)

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a)) \<Longrightarrow> (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)

goal (1 subgoal):
 1. (norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(norm (x + y) = norm x + norm y) = (norm x *\<^sub>R y = norm y *\<^sub>R x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Bmonoseq_NSLIMSEQ: "\<forall>\<^sub>F k in sequentially. X k = X m \<Longrightarrow> X \<longlonglongrightarrow>\<^sub>N\<^sub>S X m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F k in sequentially. X k = X m \<Longrightarrow> X \<longlonglongrightarrow>\<^sub>N\<^sub>S X m
[PROOF STEP]
unfolding LIMSEQ_NSLIMSEQ_iff[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F k in sequentially. X k = X m \<Longrightarrow> X \<longlonglongrightarrow> X m
[PROOF STEP]
by (simp add: eventually_mono eventually_nhds_x_imp_x filterlim_iff)


[STATEMENT]
lemma (in sym_digraph) graph_symmetric:
  shows "(u,v) \<in> arcs_ends G \<Longrightarrow> (v,u) \<in> arcs_ends G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<rightarrow> v \<Longrightarrow> v \<rightarrow> u
[PROOF STEP]
using sym_arcs
[PROOF STATE]
proof (prove)
using this:
symmetric G

goal (1 subgoal):
 1. u \<rightarrow> v \<Longrightarrow> v \<rightarrow> u
[PROOF STEP]
by (auto simp add: symmetric_def sym_def)


[STATEMENT]
lemma until_until_disj:
  assumes "(P \<U> Q \<U> R) \<sigma>"
  shows "((P \<^bold>\<or> Q) \<U> R) \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>s. P s \<or> Q s) \<U> R) \<sigma>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(P \<U> Q \<U> R) \<sigma>

goal (1 subgoal):
 1. ((\<lambda>s. P s \<or> Q s) \<U> R) \<sigma>
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
using this:
\<exists>i. (\<exists>ia. R (\<sigma> |\<^sub>s i |\<^sub>s ia) \<and> (\<forall>k<ia. Q (\<sigma> |\<^sub>s i |\<^sub>s k))) \<and> (\<forall>k<i. P (\<sigma> |\<^sub>s k))

goal (1 subgoal):
 1. \<exists>i. R (\<sigma> |\<^sub>s i) \<and> (\<forall>k<i. P (\<sigma> |\<^sub>s k) \<or> Q (\<sigma> |\<^sub>s k))
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. \<lbrakk>\<forall>k<i. P (\<sigma> |\<^sub>s k); R (\<sigma> |\<^sub>s i + ia); \<forall>k<ia. Q (\<sigma> |\<^sub>s i + k)\<rbrakk> \<Longrightarrow> \<exists>i. R (\<sigma> |\<^sub>s i) \<and> (\<forall>k<i. P (\<sigma> |\<^sub>s k) \<or> Q (\<sigma> |\<^sub>s k))
[PROOF STEP]
apply (metis (full_types) add_diff_inverse_nat nat_add_left_cancel_less)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma aff_dim_parallel_subspace:
  fixes V L :: "'n::euclidean_space set"
  assumes "V \<noteq> {}"
    and "subspace L"
    and "affine_parallel (affine hull V) L"
  shows "aff_dim V = int (dim L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
obtain B where
    B: "affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using aff_dim_basis_exists
[PROOF STATE]
proof (prove)
using this:
\<exists>B. affine hull B = affine hull ?V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim ?V + 1

goal (1 subgoal):
 1. (\<And>B. affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1
[PROOF STEP]
have "B \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1

goal (1 subgoal):
 1. B \<noteq> {}
[PROOF STEP]
using assms B
[PROOF STATE]
proof (prove)
using this:
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1
V \<noteq> {}
subspace L
affine_parallel (affine hull V) L
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1

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

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<noteq> {}
[PROOF STEP]
obtain a where a: "a \<in> B"
[PROOF STATE]
proof (prove)
using this:
B \<noteq> {}

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

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
define Lb where "Lb = span ((\<lambda>x. -a+x) ` (B-{a}))"
[PROOF STATE]
proof (state)
this:
Lb = span ((+) (- a) ` (B - {a}))

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Lb = span ((+) (- a) ` (B - {a}))

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
have "affine_parallel (affine hull B) Lb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_parallel (affine hull B) Lb
[PROOF STEP]
using Lb_def B assms affine_hull_span2[of a B] a
      affine_parallel_commut[of "Lb" "(affine hull B)"]
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1
V \<noteq> {}
subspace L
affine_parallel (affine hull V) L
a \<in> B \<Longrightarrow> affine hull B = (+) a ` span ((+) (- a) ` (B - {a}))
a \<in> B
affine_parallel Lb (affine hull B) \<Longrightarrow> affine_parallel (affine hull B) Lb

goal (1 subgoal):
 1. affine_parallel (affine hull B) Lb
[PROOF STEP]
unfolding affine_parallel_def
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1
V \<noteq> {}
subspace L
\<exists>a. L = (+) a ` (affine hull V)
a \<in> B \<Longrightarrow> affine hull B = (+) a ` span ((+) (- a) ` (B - {a}))
a \<in> B
\<exists>a. affine hull B = (+) a ` Lb \<Longrightarrow> \<exists>a. Lb = (+) a ` (affine hull B)

goal (1 subgoal):
 1. \<exists>a. Lb = (+) a ` (affine hull B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine_parallel (affine hull B) Lb

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
affine_parallel (affine hull B) Lb

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
have "subspace Lb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace Lb
[PROOF STEP]
using Lb_def subspace_span
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
subspace (span ?S)

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

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subspace Lb

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
have "affine hull B \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull B \<noteq> {}
[PROOF STEP]
using assms B
[PROOF STATE]
proof (prove)
using this:
V \<noteq> {}
subspace L
affine_parallel (affine hull V) L
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1

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

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Lb = span ((+) (- a) ` (B - {a}))
affine_parallel (affine hull B) Lb
subspace Lb
affine hull B \<noteq> {}
[PROOF STEP]
have "L = Lb"
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
affine_parallel (affine hull B) Lb
subspace Lb
affine hull B \<noteq> {}

goal (1 subgoal):
 1. L = Lb
[PROOF STEP]
using assms affine_parallel_subspace[of "affine hull B"] affine_affine_hull[of B] B
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
affine_parallel (affine hull B) Lb
subspace Lb
affine hull B \<noteq> {}
V \<noteq> {}
subspace L
affine_parallel (affine hull V) L
\<lbrakk>affine (affine hull B); affine hull B \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>!L. subspace L \<and> affine_parallel (affine hull B) L
affine (affine hull B)
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1

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

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
L = Lb
[PROOF STEP]
have "dim L = dim Lb"
[PROOF STATE]
proof (prove)
using this:
L = Lb

goal (1 subgoal):
 1. dim L = dim Lb
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim L = dim Lb

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim L = dim Lb

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
have "card B - 1 = dim Lb" and "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B - 1 = dim Lb &&& finite B
[PROOF STEP]
using Lb_def aff_dim_parallel_subspace_aux a B
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
\<lbrakk>\<not> affine_dependent ?B; ?a \<in> ?B\<rbrakk> \<Longrightarrow> finite ?B \<and> card ?B - 1 = dim (span ((+) (- ?a) ` (?B - {?a})))
a \<in> B
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1

goal (1 subgoal):
 1. card B - 1 = dim Lb &&& finite B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card B - 1 = dim Lb
finite B

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim L = dim Lb
card B - 1 = dim Lb
finite B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim L = dim Lb
card B - 1 = dim Lb
finite B

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
using B \<open>B \<noteq> {}\<close> card_gt_0_iff[of B]
[PROOF STATE]
proof (prove)
using this:
dim L = dim Lb
card B - 1 = dim Lb
finite B
affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1
B \<noteq> {}
(0 < card B) = (B \<noteq> {} \<and> finite B)

goal (1 subgoal):
 1. aff_dim V = int (dim L)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim V = int (dim L)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma expand_fls_eq: "f = g \<longleftrightarrow> (\<forall>n. f $$ n = g $$ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f = g) = (\<forall>n. f $$ n = g $$ n)
[PROOF STEP]
by (simp add: fls_nth_inject[symmetric] fun_eq_iff)


[STATEMENT]
lemma ChiStar_ChiPlus_noteq:
  "\<lbrakk> S \<noteq> T; (S,T) \<in> ChiStar A \<rbrakk> \<Longrightarrow> (S,T) \<in> ChiPlus A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> T; (S, T) \<in> ChiStar A\<rbrakk> \<Longrightarrow> (S, T) \<in> ChiPlus A
[PROOF STEP]
apply (unfold ChiPlus_def ChiStar_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> T; (S, T) \<in> (ChiRel A)\<^sup>*\<rbrakk> \<Longrightarrow> (S, T) \<in> (ChiRel A)\<^sup>+
[PROOF STEP]
apply (simp add: rtrancl_eq_or_trancl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pred_spmf_spmf_of_pmf [simp]: "pred_spmf P (spmf_of_pmf p) = pred_pmf P p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred_spmf P (spmf_of_pmf p) = pred_pmf P p
[PROOF STEP]
unfolding pred_spmf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball (set_spmf (spmf_of_pmf p)) P = pred_pmf P p
[PROOF STEP]
by(simp add: pred_pmf_def)


[STATEMENT]
lemma divide_cancel_right:
  assumes "f2 \<in> \<Theta>[F](g2)" and "eventually (\<lambda>x. g2 x \<noteq> 0) F"
  shows   "(\<lambda>x. f1 x / f2 x) \<in> L F (\<lambda>x. g1 x / g2 x) \<longleftrightarrow> f1 \<in> L F (g1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f1 x / f2 x) \<in> L F (\<lambda>x. g1 x / g2 x)) = (f1 \<in> L F g1)
[PROOF STEP]
by (subst (1 2) divide_inverse, intro mult_cancel_right bigtheta_inverse) (simp_all add: assms)


[STATEMENT]
lemma degree_power_eq: assumes p: "p \<noteq> 0"
  shows "degree (p ^ n) = degree (p :: 'a :: idom poly) * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p ^ n) = degree p * n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree (p ^ 0) = degree p * 0
 2. \<And>n. degree (p ^ n) = degree p * n \<Longrightarrow> degree (p ^ Suc n) = degree p * Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
degree (p ^ n) = degree p * n

goal (2 subgoals):
 1. degree (p ^ 0) = degree p * 0
 2. \<And>n. degree (p ^ n) = degree p * n \<Longrightarrow> degree (p ^ Suc n) = degree p * Suc n
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
have pn: "p ^ n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

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

goal (2 subgoals):
 1. degree (p ^ 0) = degree p * 0
 2. \<And>n. degree (p ^ n) = degree p * n \<Longrightarrow> degree (p ^ Suc n) = degree p * Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p ^ Suc n) = degree p * Suc n
[PROOF STEP]
using degree_mult_eq[OF p pn] Suc
[PROOF STATE]
proof (prove)
using this:
degree (p * p ^ n) = degree p + degree (p ^ n)
degree (p ^ n) = degree p * n

goal (1 subgoal):
 1. degree (p ^ Suc n) = degree p * Suc n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (p ^ Suc n) = degree p * Suc n

goal (1 subgoal):
 1. degree (p ^ 0) = degree p * 0
[PROOF STEP]
qed simp


[STATEMENT]
lemma (in ring) subalgebra_Span_incl:
  assumes "subfield K R" and "subalgebra K V R" "set Us \<subseteq> V" shows "Span K Us \<subseteq> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Span K Us \<subseteq> V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Span K Us \<subseteq> V
[PROOF STEP]
have "K <#> (set Us) \<subseteq> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K <#> set Us \<subseteq> V
[PROOF STEP]
using subalgebra.smult_closed[OF assms(2)] assms(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?k \<in> K; ?v \<in> V\<rbrakk> \<Longrightarrow> ?k \<otimes> ?v \<in> V
set Us \<subseteq> V

goal (1 subgoal):
 1. K <#> set Us \<subseteq> V
[PROOF STEP]
unfolding set_mult_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?k \<in> K; ?v \<in> V\<rbrakk> \<Longrightarrow> ?k \<otimes> ?v \<in> V
set Us \<subseteq> V

goal (1 subgoal):
 1. (\<Union>h\<in>K. \<Union>k\<in>set Us. {h \<otimes> k}) \<subseteq> V
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
K <#> set Us \<subseteq> V

goal (1 subgoal):
 1. Span K Us \<subseteq> V
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
K <#> set Us \<subseteq> V

goal (1 subgoal):
 1. Span K Us \<subseteq> V
[PROOF STEP]
have "set Us \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Us \<subseteq> carrier R
[PROOF STEP]
using subalgebra_in_carrier[OF assms(2)] assms(3)
[PROOF STATE]
proof (prove)
using this:
V \<subseteq> carrier R
set Us \<subseteq> V

goal (1 subgoal):
 1. set Us \<subseteq> carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. Span K Us \<subseteq> V
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
K <#> set Us \<subseteq> V
set Us \<subseteq> carrier R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
K <#> set Us \<subseteq> V
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. Span K Us \<subseteq> V
[PROOF STEP]
using subalgebra.axioms(1)[OF assms(2)] Span_min[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
K <#> set Us \<subseteq> V
set Us \<subseteq> carrier R
subgroup V (add_monoid R)
\<lbrakk>set ?Us \<subseteq> carrier R; subgroup ?E (add_monoid R); K <#> set ?Us \<subseteq> ?E\<rbrakk> \<Longrightarrow> Span K ?Us \<subseteq> ?E

goal (1 subgoal):
 1. Span K Us \<subseteq> V
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Span K Us \<subseteq> V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder_topology) tendsto_le:
  assumes F: "\<not> trivial_limit F"
    and x: "(f \<longlongrightarrow> x) F"
    and y: "(g \<longlongrightarrow> y) F"
    and ev: "eventually (\<lambda>x. g x \<le> f x) F"
  shows "y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
assume "\<not> y \<le> x"
[PROOF STATE]
proof (state)
this:
\<not> y \<le> x

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with less_separate[of x y]
[PROOF STATE]
proof (chain)
picking this:
x < y \<Longrightarrow> \<exists>a b. x \<in> {..<a} \<and> y \<in> {b<..} \<and> {..<a} \<inter> {b<..} = {}
\<not> y \<le> x
[PROOF STEP]
obtain a b where xy: "x < a" "b < y" "{..<a} \<inter> {b<..} = {}"
[PROOF STATE]
proof (prove)
using this:
x < y \<Longrightarrow> \<exists>a b. x \<in> {..<a} \<and> y \<in> {b<..} \<and> {..<a} \<inter> {b<..} = {}
\<not> y \<le> x

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x < a; b < y; {..<a} \<inter> {b<..} = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: not_le)
[PROOF STATE]
proof (state)
this:
x < a
b < y
{..<a} \<inter> {b<..} = {}

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < a
b < y
{..<a} \<inter> {b<..} = {}
[PROOF STEP]
have "eventually (\<lambda>x. f x < a) F" "eventually (\<lambda>x. b < g x) F"
[PROOF STATE]
proof (prove)
using this:
x < a
b < y
{..<a} \<inter> {b<..} = {}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < a &&& \<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
x < a
b < y
{..<a} \<inter> {b<..} = {}
(f \<longlongrightarrow> x) F
(g \<longlongrightarrow> y) F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < a &&& \<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
by (auto intro: order_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with ev
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. g x \<le> f x
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
have "eventually (\<lambda>x. False) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. g x \<le> f x
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. False
[PROOF STEP]
by eventually_elim (insert xy, fastforce)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. False

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with F
[PROOF STATE]
proof (chain)
picking this:
F \<noteq> bot
\<forall>\<^sub>F x in F. False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
F \<noteq> bot
\<forall>\<^sub>F x in F. False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Inf_exp_lower:
  "\<lbrakk> P \<in> S; \<forall>P\<in>S. nneg P \<rbrakk> \<Longrightarrow> Inf_exp S \<le> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<in> S; \<forall>P\<in>S. nneg P\<rbrakk> \<Longrightarrow> Inf_exp S \<tturnstile> P
[PROOF STEP]
unfolding Inf_exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<in> S; \<forall>P\<in>S. nneg P\<rbrakk> \<Longrightarrow> \<lambda>s. Inf {f s |f. f \<in> S} \<tturnstile> P
[PROOF STEP]
by(intro le_funI cInf_lower bdd_belowI[where m=0], auto)


[STATEMENT]
lemma is_walk_decomp:
  assumes "is_walk (xs@[y]@ys@[y]@zs)" (is "is_walk ?w")
  shows "is_walk (xs@[y]@zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_walk (xs @ [y] @ zs)
[PROOF STEP]
proof (intro is_walkI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. set (xs @ [y] @ zs) \<subseteq> V
 2. set (walk_edges (xs @ [y] @ zs)) \<subseteq> E
 3. xs @ [y] @ zs \<noteq> []
[PROOF STEP]
show "set (xs @ [y] @ zs) \<subseteq> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (xs @ [y] @ zs) \<subseteq> V
[PROOF STEP]
using assms is_walk_def
[PROOF STATE]
proof (prove)
using this:
is_walk (xs @ [y] @ ys @ [y] @ zs)
is_walk ?xs \<equiv> set ?xs \<subseteq> V \<and> set (walk_edges ?xs) \<subseteq> E \<and> ?xs \<noteq> []

goal (1 subgoal):
 1. set (xs @ [y] @ zs) \<subseteq> V
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (xs @ [y] @ zs) \<subseteq> V

goal (2 subgoals):
 1. set (walk_edges (xs @ [y] @ zs)) \<subseteq> E
 2. xs @ [y] @ zs \<noteq> []
[PROOF STEP]
show "xs @ [y] @ zs \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs @ [y] @ zs \<noteq> []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
xs @ [y] @ zs \<noteq> []

goal (1 subgoal):
 1. set (walk_edges (xs @ [y] @ zs)) \<subseteq> E
[PROOF STEP]
show "set (walk_edges (xs @ [y] @ zs)) \<subseteq> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (walk_edges (xs @ [y] @ zs)) \<subseteq> E
[PROOF STEP]
using walk_edges_decomp_ss assms(1) is_walk_def
[PROOF STATE]
proof (prove)
using this:
set (walk_edges (?xs @ [?y] @ ?zs)) \<subseteq> set (walk_edges (?xs @ [?y] @ ?ys @ [?y] @ ?zs))
is_walk (xs @ [y] @ ys @ [y] @ zs)
is_walk ?xs \<equiv> set ?xs \<subseteq> V \<and> set (walk_edges ?xs) \<subseteq> E \<and> ?xs \<noteq> []

goal (1 subgoal):
 1. set (walk_edges (xs @ [y] @ zs)) \<subseteq> E
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (walk_edges (xs @ [y] @ zs)) \<subseteq> E

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_of_Un_ordLess_infinite_Field[simp]:
assumes INF: "\<not>finite (Field r)" and r: "Card_order r" and
        LESS1: "|A| <o r" and LESS2: "|B| <o r"
shows "|A Un B| <o r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
let ?C  = "Field r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
have 1: "r =o |?C| \<and> |?C| =o r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r =o |Field r| \<and> |Field r| =o r
[PROOF STEP]
using r card_of_Field_ordIso
  ordIso_symmetric
[PROOF STATE]
proof (prove)
using this:
Card_order r
Card_order ?r \<Longrightarrow> |Field ?r| =o ?r
?r =o ?r' \<Longrightarrow> ?r' =o ?r

goal (1 subgoal):
 1. r =o |Field r| \<and> |Field r| =o r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
r =o |Field r| \<and> |Field r| =o r

goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
hence "|A| <o |?C|"  "|B| <o |?C|"
[PROOF STATE]
proof (prove)
using this:
r =o |Field r| \<and> |Field r| =o r

goal (1 subgoal):
 1. |A| <o |Field r| &&& |B| <o |Field r|
[PROOF STEP]
using LESS1 LESS2 ordLess_ordIso_trans
[PROOF STATE]
proof (prove)
using this:
r =o |Field r| \<and> |Field r| =o r
|A| <o r
|B| <o r
\<lbrakk>?r <o ?r'; ?r' =o ?r''\<rbrakk> \<Longrightarrow> ?r <o ?r''

goal (1 subgoal):
 1. |A| <o |Field r| &&& |B| <o |Field r|
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
|A| <o |Field r|
|B| <o |Field r|

goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
hence  "|A Un B| <o |?C|"
[PROOF STATE]
proof (prove)
using this:
|A| <o |Field r|
|B| <o |Field r|

goal (1 subgoal):
 1. |A \<union> B| <o |Field r|
[PROOF STEP]
using INF
  card_of_Un_ordLess_infinite
[PROOF STATE]
proof (prove)
using this:
|A| <o |Field r|
|B| <o |Field r|
infinite (Field r)
\<lbrakk>infinite ?C; |?A| <o |?C|; |?B| <o |?C|\<rbrakk> \<Longrightarrow> |?A \<union> ?B| <o |?C|

goal (1 subgoal):
 1. |A \<union> B| <o |Field r|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|A \<union> B| <o |Field r|

goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
|A \<union> B| <o |Field r|

goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
using 1 ordLess_ordIso_trans
[PROOF STATE]
proof (prove)
using this:
|A \<union> B| <o |Field r|
r =o |Field r| \<and> |Field r| =o r
\<lbrakk>?r <o ?r'; ?r' =o ?r''\<rbrakk> \<Longrightarrow> ?r <o ?r''

goal (1 subgoal):
 1. |A \<union> B| <o r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|A \<union> B| <o r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invariant3p_rtrancl3p:
  assumes inv: "invariant3p r I"
  and rtrancl: "rtrancl3p r a bs a'"
  and start: "a \<in> I"
  shows "a' \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a' \<in> I
[PROOF STEP]
using rtrancl start
[PROOF STATE]
proof (prove)
using this:
rtrancl3p r a bs a'
a \<in> I

goal (1 subgoal):
 1. a' \<in> I
[PROOF STEP]
by(induct)(auto dest: invariant3pD[OF inv])


[STATEMENT]
lemma balanced_Node_if_wbal1:
  assumes "balanced l" "balanced r" "size_kdt l = size_kdt r + 1"
  shows "balanced (Node k v l r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1
[PROOF STEP]
have [simp]: "size_kdt l = size_kdt r + 1"
[PROOF STATE]
proof (prove)
using this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1

goal (1 subgoal):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
have "nat \<lceil>log 2 (1 + size_kdt r)\<rceil> \<ge> nat \<lceil>log 2 (size_kdt r)\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<lceil>log 2 (real (KD_Tree.size_kdt r))\<rceil> \<le> nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil>
[PROOF STEP]
by(rule nat_mono[OF ceiling_mono]) simp
[PROOF STATE]
proof (state)
this:
nat \<lceil>log 2 (real (KD_Tree.size_kdt r))\<rceil> \<le> nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil>

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
hence 1: "height(Node k v l r) = nat \<lceil>log 2 (1 + size_kdt r)\<rceil> + 1"
[PROOF STATE]
proof (prove)
using this:
nat \<lceil>log 2 (real (KD_Tree.size_kdt r))\<rceil> \<le> nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil>

goal (1 subgoal):
 1. height (Node k v l r) = nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil> + 1
[PROOF STEP]
using height_balanced[OF assms(1)] height_balanced[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
nat \<lceil>log 2 (real (KD_Tree.size_kdt r))\<rceil> \<le> nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil>
height l = nat \<lceil>log 2 (real (KD_Tree.size_kdt l))\<rceil>
height r = nat \<lceil>log 2 (real (KD_Tree.size_kdt r))\<rceil>

goal (1 subgoal):
 1. height (Node k v l r) = nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil> + 1
[PROOF STEP]
by (simp del: nat_ceiling_le_eq add: max_def)
[PROOF STATE]
proof (state)
this:
height (Node k v l r) = nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil> + 1

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
have "nat \<lfloor>log 2 (1 + size_kdt r)\<rfloor> \<ge> nat \<lfloor>log 2 (size_kdt r)\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> \<le> nat \<lfloor>log 2 (real (1 + KD_Tree.size_kdt r))\<rfloor>
[PROOF STEP]
by(rule nat_mono[OF floor_mono]) simp
[PROOF STATE]
proof (state)
this:
nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> \<le> nat \<lfloor>log 2 (real (1 + KD_Tree.size_kdt r))\<rfloor>

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
hence 2: "min_height(Node k v l r) = nat \<lfloor>log 2 (size_kdt r)\<rfloor> + 1"
[PROOF STATE]
proof (prove)
using this:
nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> \<le> nat \<lfloor>log 2 (real (1 + KD_Tree.size_kdt r))\<rfloor>

goal (1 subgoal):
 1. min_height (Node k v l r) = nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> + 1
[PROOF STEP]
using min_height_balanced[OF assms(1)] min_height_balanced[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> \<le> nat \<lfloor>log 2 (real (1 + KD_Tree.size_kdt r))\<rfloor>
min_height l = nat \<lfloor>log 2 (real (KD_Tree.size_kdt l))\<rfloor>
min_height r = nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor>

goal (1 subgoal):
 1. min_height (Node k v l r) = nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> + 1
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
min_height (Node k v l r) = nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> + 1

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
have "size_kdt r \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> KD_Tree.size_kdt r
[PROOF STEP]
by (simp add: Suc_leI)
[PROOF STATE]
proof (state)
this:
1 \<le> KD_Tree.size_kdt r

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> KD_Tree.size_kdt r
[PROOF STEP]
obtain i where i: "2 ^ i \<le> size_kdt r" "size_kdt r < 2 ^ (i + 1)"
[PROOF STATE]
proof (prove)
using this:
1 \<le> KD_Tree.size_kdt r

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>2 ^ i \<le> KD_Tree.size_kdt r; KD_Tree.size_kdt r < 2 ^ (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_power_ivl1[of 2 "size_kdt r"]
[PROOF STATE]
proof (prove)
using this:
1 \<le> KD_Tree.size_kdt r
\<lbrakk>2 \<le> 2; 1 \<le> KD_Tree.size_kdt r\<rbrakk> \<Longrightarrow> \<exists>n. 2 ^ n \<le> KD_Tree.size_kdt r \<and> KD_Tree.size_kdt r < 2 ^ (n + 1)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>2 ^ i \<le> KD_Tree.size_kdt r; KD_Tree.size_kdt r < 2 ^ (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ i \<le> KD_Tree.size_kdt r
KD_Tree.size_kdt r < 2 ^ (i + 1)

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
hence i1: "2 ^ i < size_kdt r + 1" "size_kdt r + 1 \<le> 2 ^ (i + 1)"
[PROOF STATE]
proof (prove)
using this:
2 ^ i \<le> KD_Tree.size_kdt r
KD_Tree.size_kdt r < 2 ^ (i + 1)

goal (1 subgoal):
 1. 2 ^ i < KD_Tree.size_kdt r + 1 &&& KD_Tree.size_kdt r + 1 \<le> 2 ^ (i + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ i < KD_Tree.size_kdt r + 1
KD_Tree.size_kdt r + 1 \<le> 2 ^ (i + 1)

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
from 1 2 floor_log_nat_eq_if[OF i] ceiling_log_nat_eq_if[OF i1]
[PROOF STATE]
proof (chain)
picking this:
height (Node k v l r) = nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil> + 1
min_height (Node k v l r) = nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> + 1
2 \<le> 2 \<Longrightarrow> \<lfloor>log (real 2) (real (KD_Tree.size_kdt r))\<rfloor> = int i
2 \<le> 2 \<Longrightarrow> \<lceil>log (real 2) (real (KD_Tree.size_kdt r + 1))\<rceil> = int i + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
height (Node k v l r) = nat \<lceil>log 2 (real (1 + KD_Tree.size_kdt r))\<rceil> + 1
min_height (Node k v l r) = nat \<lfloor>log 2 (real (KD_Tree.size_kdt r))\<rfloor> + 1
2 \<le> 2 \<Longrightarrow> \<lfloor>log (real 2) (real (KD_Tree.size_kdt r))\<rfloor> = int i
2 \<le> 2 \<Longrightarrow> \<lceil>log (real 2) (real (KD_Tree.size_kdt r + 1))\<rceil> = int i + 1

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
by(simp add:balanced_def)
[PROOF STATE]
proof (state)
this:
balanced (Node k v l r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finlsts_induct
  [case_names LNil_fin LCons_fin, induct set: finlsts, consumes 1]:
  assumes xA: "x \<in> A\<^sup>\<star>"
  and lnil: "\<And>l. l = LNil \<Longrightarrow> P l"
  and lcons: "\<And>a l. \<lbrakk>l \<in> A\<^sup>\<star>; P l; a \<in> A\<rbrakk> \<Longrightarrow> P (a ## l)"
  shows "P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x
[PROOF STEP]
using xA
[PROOF STATE]
proof (prove)
using this:
x \<in> A\<^sup>\<star>

goal (1 subgoal):
 1. P x
[PROOF STEP]
by (induct "x") (auto intro: lnil lcons)


[STATEMENT]
lemma interchange_rows_code [code abstract]:
  "vec_nth (interchange_rows_row A a b i) = (%j. if i = a then A $ b $ j else if i = b then A $ a $ j else A $ i $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (interchange_rows_row A a b i) = (\<lambda>j. if i = a then A $ b $ j else if i = b then A $ a $ j else A $ i $ j)
[PROOF STEP]
unfolding interchange_rows_row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>j. if i = a then A $ b $ j else if i = b then A $ a $ j else A $ i $ j) = (\<lambda>j. if i = a then A $ b $ j else if i = b then A $ a $ j else A $ i $ j)
[PROOF STEP]
by auto


[STATEMENT]
lemma tanh_real_abs [simp]: "tanh (abs x :: real) = abs (tanh x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tanh \<bar>x\<bar> = \<bar>tanh x\<bar>
[PROOF STEP]
by (auto simp: abs_if)


[STATEMENT]
lemma Least_fin_cut_same: "(LEAST n. drop n xs = replicate (length xs - n) y) =
  length xs - length (takeWhile (\<lambda>x. x = y) (rev xs))"
  (is "Least ?P = ?min")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. drop n xs = replicate (length xs - n) y) = length xs - length (takeWhile (\<lambda>x. x = y) (rev xs))
[PROOF STEP]
proof (rule Least_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. drop (length xs - length (takeWhile (\<lambda>x. x = y) (rev xs))) xs = replicate (length xs - (length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)))) y
 2. \<And>ya. drop ya xs = replicate (length xs - ya) y \<Longrightarrow> length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> ya
[PROOF STEP]
show "?P ?min"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop (length xs - length (takeWhile (\<lambda>x. x = y) (rev xs))) xs = replicate (length xs - (length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)))) y
[PROOF STEP]
by (induct xs rule: rev_induct) (auto simp:  Suc_diff_le replicate_append_same)
[PROOF STATE]
proof (state)
this:
drop (length xs - length (takeWhile (\<lambda>x. x = y) (rev xs))) xs = replicate (length xs - (length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)))) y

goal (1 subgoal):
 1. \<And>ya. drop ya xs = replicate (length xs - ya) y \<Longrightarrow> length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> ya
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ya. drop ya xs = replicate (length xs - ya) y \<Longrightarrow> length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> ya
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ya. drop ya xs = replicate (length xs - ya) y \<Longrightarrow> length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> ya
[PROOF STEP]
assume "?P m"
[PROOF STATE]
proof (state)
this:
drop m xs = replicate (length xs - m) y

goal (1 subgoal):
 1. \<And>ya. drop ya xs = replicate (length xs - ya) y \<Longrightarrow> length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> ya
[PROOF STEP]
have "length xs - m \<le> length (takeWhile (\<lambda>x. x = y) (rev xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs - m \<le> length (takeWhile (\<lambda>x. x = y) (rev xs))
[PROOF STEP]
proof (intro length_takeWhile_less_P_nth)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < length xs - m \<Longrightarrow> rev xs ! i = y
 2. length xs - m \<le> length (rev xs)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < length xs - m \<Longrightarrow> rev xs ! i = y
 2. length xs - m \<le> length (rev xs)
[PROOF STEP]
assume "i < length xs - m"
[PROOF STATE]
proof (state)
this:
i < length xs - m

goal (2 subgoals):
 1. \<And>i. i < length xs - m \<Longrightarrow> rev xs ! i = y
 2. length xs - m \<le> length (rev xs)
[PROOF STEP]
hence "rev xs ! i \<in> set (drop m xs)"
[PROOF STATE]
proof (prove)
using this:
i < length xs - m

goal (1 subgoal):
 1. rev xs ! i \<in> set (drop m xs)
[PROOF STEP]
by (induct xs arbitrary: i rule: rev_induct) (auto simp: nth_Cons')
[PROOF STATE]
proof (state)
this:
rev xs ! i \<in> set (drop m xs)

goal (2 subgoals):
 1. \<And>i. i < length xs - m \<Longrightarrow> rev xs ! i = y
 2. length xs - m \<le> length (rev xs)
[PROOF STEP]
with \<open>?P m\<close>
[PROOF STATE]
proof (chain)
picking this:
drop m xs = replicate (length xs - m) y
rev xs ! i \<in> set (drop m xs)
[PROOF STEP]
show "rev xs ! i = y"
[PROOF STATE]
proof (prove)
using this:
drop m xs = replicate (length xs - m) y
rev xs ! i \<in> set (drop m xs)

goal (1 subgoal):
 1. rev xs ! i = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rev xs ! i = y

goal (1 subgoal):
 1. length xs - m \<le> length (rev xs)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
length xs - m \<le> length (takeWhile (\<lambda>x. x = y) (rev xs))

goal (1 subgoal):
 1. \<And>ya. drop ya xs = replicate (length xs - ya) y \<Longrightarrow> length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> ya
[PROOF STEP]
thus "?min \<le> m"
[PROOF STATE]
proof (prove)
using this:
length xs - m \<le> length (takeWhile (\<lambda>x. x = y) (rev xs))

goal (1 subgoal):
 1. length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> m
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
length xs - length (takeWhile (\<lambda>x. x = y) (rev xs)) \<le> m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonzero_imp_inverse_nonzero:
  assumes "a \<in> carrier R" and "a \<noteq> \<zero>"
  shows "inv a \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv a \<noteq> \<zero>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv a = \<zero> \<Longrightarrow> False
[PROOF STEP]
assume *: "inv a = \<zero>"
[PROOF STATE]
proof (state)
this:
inv a = \<zero>

goal (1 subgoal):
 1. inv a = \<zero> \<Longrightarrow> False
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier R
a \<noteq> \<zero>
[PROOF STEP]
have **: "\<one> = a \<otimes> inv a"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
a \<noteq> \<zero>

goal (1 subgoal):
 1. \<one> = a \<otimes> inv a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<one> = a \<otimes> inv a

goal (1 subgoal):
 1. inv a = \<zero> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<one> = a \<otimes> inv a

goal (1 subgoal):
 1. inv a = \<zero> \<Longrightarrow> False
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier R
a \<noteq> \<zero>
[PROOF STEP]
have "\<dots> = \<zero>"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
a \<noteq> \<zero>

goal (1 subgoal):
 1. a \<otimes> inv a = \<zero>
[PROOF STEP]
by (simp add: *)
[PROOF STATE]
proof (state)
this:
a \<otimes> inv a = \<zero>

goal (1 subgoal):
 1. inv a = \<zero> \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<one> = \<zero>
[PROOF STEP]
have "\<one> = \<zero>"
[PROOF STATE]
proof (prove)
using this:
\<one> = \<zero>

goal (1 subgoal):
 1. \<one> = \<zero>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<one> = \<zero>

goal (1 subgoal):
 1. inv a = \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<one> = \<zero>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<one> = \<zero>

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ffact_minus:
  fixes x :: "'a :: comm_ring_1"
  shows "ffact n (- x) = (- 1) ^ n * pochhammer x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
have "ffact n (- x) = pochhammer (- x + 1 - of_nat n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffact n (- x) = pochhammer (- x + (1::'a) - of_nat n) n
[PROOF STEP]
unfolding ffact_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (- x + (1::'a) - of_nat n) n = pochhammer (- x + (1::'a) - of_nat n) n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
ffact n (- x) = pochhammer (- x + (1::'a) - of_nat n) n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ffact n (- x) = pochhammer (- x + (1::'a) - of_nat n) n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
have "\<dots> = pochhammer (- x - of_nat n + 1) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (- x + (1::'a) - of_nat n) n = pochhammer (- x - of_nat n + (1::'a)) n
[PROOF STEP]
by (simp add: diff_add_eq)
[PROOF STATE]
proof (state)
this:
pochhammer (- x + (1::'a) - of_nat n) n = pochhammer (- x - of_nat n + (1::'a)) n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pochhammer (- x + (1::'a) - of_nat n) n = pochhammer (- x - of_nat n + (1::'a)) n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
have "\<dots> = (- 1) ^ n * pochhammer (- (- x)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (- x - of_nat n + (1::'a)) n = (- (1::'a)) ^ n * pochhammer (- (- x)) n
[PROOF STEP]
by (rule pochhammer_minus')
[PROOF STATE]
proof (state)
this:
pochhammer (- x - of_nat n + (1::'a)) n = (- (1::'a)) ^ n * pochhammer (- (- x)) n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pochhammer (- x - of_nat n + (1::'a)) n = (- (1::'a)) ^ n * pochhammer (- (- x)) n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
have "\<dots> = (- 1) ^ n * pochhammer x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ n * pochhammer (- (- x)) n = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ n * pochhammer (- (- x)) n = (- (1::'a)) ^ n * pochhammer x n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n

goal (1 subgoal):
 1. ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ffact n (- x) = (- (1::'a)) ^ n * pochhammer x n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_mset_diff:
  "sum_mset (M - N) = sum_mset M - sum_mset N" if "N \<subseteq># M" for M N :: "'a multiset"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (M - N) = \<Sum>\<^sub># M - \<Sum>\<^sub># N
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
N \<subseteq># M

goal (1 subgoal):
 1. \<Sum>\<^sub># (M - N) = \<Sum>\<^sub># M - \<Sum>\<^sub># N
[PROOF STEP]
by (auto simp add: subset_mset.le_iff_add)


[STATEMENT]
lemma \<Sigma>_factor:
  "\<Sigma> (\<lambda>k. c * f k) j l = (c::'a::ring) * \<Sigma> (\<lambda>k. f k) j l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sigma> (\<lambda>k. c * f k) j l = c * \<Sigma> f j l
[PROOF STEP]
by (simp add: \<Sigma>_def sum_distrib_left)


[STATEMENT]
lemma unique_factorization_mI: assumes "factorization_m f (c,fs)"
  and "\<And> d gs. factorization_m f (d,gs) \<Longrightarrow> Mf (d,gs) = Mf (c,fs)"
  shows "unique_factorization_m f (c,fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unique_factorization_m f (c, fs)
[PROOF STEP]
unfolding unique_factorization_m_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factorization_m f (c, fs) \<and> (\<forall>dgs. factorization_m f dgs \<longrightarrow> Mf dgs = Mf (c, fs))
[PROOF STEP]
by (intro conjI[OF assms(1)] allI impI, insert assms(2), auto)


[STATEMENT]
lemma de_Morgan:
  assumes "\<not> (\<forall>x. P x)"
  shows "\<exists>x. \<not> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. \<not> P x
[PROOF STEP]
proof (rule classical)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>x. \<not> P x \<Longrightarrow> \<exists>x. \<not> P x
[PROOF STEP]
assume "\<nexists>x. \<not> P x"
[PROOF STATE]
proof (state)
this:
\<nexists>x. \<not> P x

goal (1 subgoal):
 1. \<nexists>x. \<not> P x \<Longrightarrow> \<exists>x. \<not> P x
[PROOF STEP]
have "\<forall>x. P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. P x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. P x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. P x
[PROOF STEP]
show "P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x
[PROOF STEP]
proof (rule classical)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> P x \<Longrightarrow> P x
[PROOF STEP]
assume "\<not> P x"
[PROOF STATE]
proof (state)
this:
\<not> P x

goal (1 subgoal):
 1. \<not> P x \<Longrightarrow> P x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> P x
[PROOF STEP]
have "\<exists>x. \<not> P x"
[PROOF STATE]
proof (prove)
using this:
\<not> P x

goal (1 subgoal):
 1. \<exists>x. \<not> P x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>x. \<not> P x

goal (1 subgoal):
 1. \<not> P x \<Longrightarrow> P x
[PROOF STEP]
with \<open>\<nexists>x. \<not> P x\<close>
[PROOF STATE]
proof (chain)
picking this:
\<nexists>x. \<not> P x
\<exists>x. \<not> P x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<nexists>x. \<not> P x
\<exists>x. \<not> P x

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x. P x

goal (1 subgoal):
 1. \<nexists>x. \<not> P x \<Longrightarrow> \<exists>x. \<not> P x
[PROOF STEP]
with \<open>\<not> (\<forall>x. P x)\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>x. P x)
\<forall>x. P x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x. P x)
\<forall>x. P x

goal (1 subgoal):
 1. \<exists>x. \<not> P x
[PROOF STEP]
by contradiction
[PROOF STATE]
proof (state)
this:
\<exists>x. \<not> P x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PCF_consts_relI:
  "\<lbrakk> \<bottom> \<in> R;
     (\<lambda>i. ValTT) \<in> R;
     (\<lambda>i. ValFF) \<in> R;
     \<And>n. (\<lambda>i. ValN\<cdot>n) \<in> R \<rbrakk> \<Longrightarrow> PCF_consts_rel R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bottom> \<in> R; (\<lambda>i. ValTT) \<in> R; (\<lambda>i. ValFF) \<in> R; \<And>n. (\<lambda>i. ValN\<cdot>n) \<in> R\<rbrakk> \<Longrightarrow> PCF_consts_rel R
[PROOF STEP]
unfolding PCF_consts_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bottom> \<in> R; (\<lambda>i. ValTT) \<in> R; (\<lambda>i. ValFF) \<in> R; \<And>n. (\<lambda>i. ValN\<cdot>n) \<in> R\<rbrakk> \<Longrightarrow> \<bottom> \<in> R \<and> (\<lambda>i. ValTT) \<in> R \<and> (\<lambda>i. ValFF) \<in> R \<and> (\<forall>n. (\<lambda>i. ValN\<cdot>n) \<in> R)
[PROOF STEP]
by blast


[STATEMENT]
lemma funcset_eq:"\<lbrakk> f \<in> extensional A; g \<in> extensional A; \<forall>x\<in>A. f x = g x \<rbrakk> \<Longrightarrow>  f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> extensional A; g \<in> extensional A; \<forall>x\<in>A. f x = g x\<rbrakk> \<Longrightarrow> f = g
[PROOF STEP]
apply (simp add:extensionalityI)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma residue_neg:
  assumes "open s" "z \<in> s" and f_holo: "f holomorphic_on s - {z}"
  shows "residue (\<lambda>z. - (f z)) z= - residue f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. - f z) z = - residue f z
[PROOF STEP]
using residue_lmul[OF assms,of "-1"]
[PROOF STATE]
proof (prove)
using this:
residue (\<lambda>z. - 1 * f z) z = - 1 * residue f z

goal (1 subgoal):
 1. residue (\<lambda>z. - f z) z = - residue f z
[PROOF STEP]
by auto


[STATEMENT]
theorem correct:
    assumes "distinct (map fst ts)"
    assumes "\<forall>((r,c),_)\<in>set ts. r<n"
    shows "alg ts x = pr (\<alpha> ts) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alg ts x = local.pr (\<alpha> ts) x
[PROOF STEP]
using alg_by_fold correct_fold[OF assms]
[PROOF STATE]
proof (prove)
using this:
alg ?ts ?x = fold (\<lambda>((r, c), v) y. y(c := y c + ?x r * v)) ?ts (\<lambda>_. 0)
fold (\<lambda>((r, c), v) y. y(c := y c + ?x r * v)) ts (\<lambda>_. 0) = local.pr (\<alpha> ts) ?x

goal (1 subgoal):
 1. alg ts x = local.pr (\<alpha> ts) x
[PROOF STEP]
by simp


[STATEMENT]
lemma  Cart_lambda_cong: "(\<And>x. f x = g x) \<Longrightarrow> (vec_lambda f::'a^'n) = (vec_lambda g :: 'a^'n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. f x = g x) \<Longrightarrow> vec_lambda f = vec_lambda g
[PROOF STEP]
by auto


[STATEMENT]
lemma real_parts_3: assumes p: "p \<noteq> 0" and "ipoly p x = 0"
  shows "Re x \<in> real_of_3 ` set (real_parts_3 p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re x \<in> real_of_3 ` set (real_parts_3 p)
[PROOF STEP]
unfolding real_parts_3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re x \<in> real_of_3 ` set (roots_of_3 (root_poly_Re p))
[PROOF STEP]
using represents_root_poly(1)[OF assms(2,1)]
    roots_of_3(1)
[PROOF STATE]
proof (prove)
using this:
root_poly_Re p represents Re x
?p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 ?p) = {x. poly (real_of_int_poly ?p) x = 0}

goal (1 subgoal):
 1. Re x \<in> real_of_3 ` set (roots_of_3 (root_poly_Re p))
[PROOF STEP]
unfolding represents_def
[PROOF STATE]
proof (prove)
using this:
poly (real_of_int_poly (root_poly_Re p)) (Re x) = 0 \<and> root_poly_Re p \<noteq> 0
?p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 ?p) = {x. poly (real_of_int_poly ?p) x = 0}

goal (1 subgoal):
 1. Re x \<in> real_of_3 ` set (roots_of_3 (root_poly_Re p))
[PROOF STEP]
by auto


[STATEMENT]
lemma P_inf_True[simp]: "P_inf t (\<lambda>\<omega>. True) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P_inf t (\<lambda>\<omega>. True) = 1
[PROOF STEP]
using T.emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
emeasure (T ?cfg) (space (T ?cfg)) = 1

goal (1 subgoal):
 1. P_inf t (\<lambda>\<omega>. True) = 1
[PROOF STEP]
by (auto simp add: P_inf_def SUP_constant)


[STATEMENT]
lemma one_less_Log_cancel_iff[simp]:
  "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 1 < Log a x \<longleftrightarrow> a < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (1 < Log a x) = (a < x)
[PROOF STEP]
using Log_less_cancel_iff[of a a x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < a; 0 < x\<rbrakk> \<Longrightarrow> (Log a a < Log a x) = (a < x)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (1 < Log a x) = (a < x)
[PROOF STEP]
by simp