[STATEMENT]
lemma swap_nth[simp]: "\<lbrakk>i < length l; j<length l; k<length l\<rbrakk> \<Longrightarrow>
  swap l i j!k = (
    if k=i then l!j
    else if k=j then l!i
    else l!k
  )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length l; j < length l; k < length l\<rbrakk> \<Longrightarrow> swap l i j ! k = (if k = i then l ! j else if k = j then l ! i else l ! k)
[PROOF STEP]
unfolding swap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length l; j < length l; k < length l\<rbrakk> \<Longrightarrow> l[i := l ! j, j := l ! i] ! k = (if k = i then l ! j else if k = j then l ! i else l ! k)
[PROOF STEP]
by auto


[STATEMENT]
lemma free_group_over_one_gen: "\<exists>h. h \<in> iso \<F>\<^bsub>{()}\<^esub> int_group"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
interpret int: group int_group
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group int_group
[PROOF STEP]
using int.a_group
[PROOF STATE]
proof (prove)
using this:
Group.group \<lparr>carrier = UNIV, monoid.mult = (+), one = 0, \<dots> = undefined\<rparr>

goal (1 subgoal):
 1. Group.group int_group
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
define f :: "unit \<Rightarrow> int" where "f x = 1" for x
[PROOF STATE]
proof (state)
this:
f ?x = 1

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
have "f \<in> {()} \<rightarrow> carrier int_group"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> {()} \<rightarrow> carrier int_group
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> {()} \<rightarrow> carrier int_group

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
hence "int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group"
[PROOF STATE]
proof (prove)
using this:
f \<in> {()} \<rightarrow> carrier int_group

goal (1 subgoal):
 1. int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
by (rule int.lift_is_hom)
[PROOF STATE]
proof (state)
this:
int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
interpret hom: group_hom "\<F>\<^bsub>{()}\<^esub>" int_group "int.lift f"
[PROOF STATE]
proof (prove)
using this:
int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group

goal (1 subgoal):
 1. group_hom \<F>\<^bsub>{()}\<^esub> int_group (int.lift f)
[PROOF STEP]
unfolding group_hom_def group_hom_axioms_def
[PROOF STATE]
proof (prove)
using this:
int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group

goal (1 subgoal):
 1. Group.group \<F>\<^bsub>{()}\<^esub> \<and> Group.group int_group \<and> int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
using int.a_group
[PROOF STATE]
proof (prove)
using this:
int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group
Group.group \<lparr>carrier = UNIV, monoid.mult = (+), one = 0, \<dots> = undefined\<rparr>

goal (1 subgoal):
 1. Group.group \<F>\<^bsub>{()}\<^esub> \<and> Group.group int_group \<and> int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
by(auto intro: free_group_is_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
(* This shows injectiveness of the given map *)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
assume "x \<in> carrier \<F>\<^bsub>{()}\<^esub>"
[PROOF STATE]
proof (state)
this:
x \<in> carrier \<F>\<^bsub>{()}\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
hence "canceled x"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier \<F>\<^bsub>{()}\<^esub>

goal (1 subgoal):
 1. canceled x
[PROOF STEP]
by (auto simp add:free_group_def)
[PROOF STATE]
proof (state)
this:
canceled x

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
assume "int.lift f x = (0::int)"
[PROOF STATE]
proof (state)
this:
int.lift f x = 0

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
have "x = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = []
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
assume "x \<noteq> []"
[PROOF STATE]
proof (state)
this:
x \<noteq> []

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> []
[PROOF STEP]
obtain a and xs where "x = a # xs"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> []

goal (1 subgoal):
 1. (\<And>a xs. x = a # xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases x, auto)
[PROOF STATE]
proof (state)
this:
x = a # xs

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "length (takeWhile (\<lambda>y. y = a) x) > 0"
[PROOF STATE]
proof (prove)
using this:
x = a # xs

goal (1 subgoal):
 1. 0 < length (takeWhile (\<lambda>y. y = a) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < length (takeWhile (\<lambda>y. y = a) x)

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < length (takeWhile (\<lambda>y. y = a) x)
[PROOF STEP]
obtain i where i: "length (takeWhile (\<lambda>y. y = a) x) = Suc i"
[PROOF STATE]
proof (prove)
using this:
0 < length (takeWhile (\<lambda>y. y = a) x)

goal (1 subgoal):
 1. (\<And>i. length (takeWhile (\<lambda>y. y = a) x) = Suc i \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "length (takeWhile (\<lambda>y. y = a) x)", auto)
[PROOF STATE]
proof (state)
this:
length (takeWhile (\<lambda>y. y = a) x) = Suc i

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
have "Suc i \<ge> length x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length x \<le> Suc i
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
assume "\<not> length x \<le> Suc i"
[PROOF STATE]
proof (state)
this:
\<not> length x \<le> Suc i

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "length (takeWhile (\<lambda>y. y = a) x) < length x"
[PROOF STATE]
proof (prove)
using this:
\<not> length x \<le> Suc i

goal (1 subgoal):
 1. length (takeWhile (\<lambda>y. y = a) x) < length x
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
\<not> length x \<le> Suc i
length (takeWhile (\<lambda>y. y = a) x) = Suc i

goal (1 subgoal):
 1. length (takeWhile (\<lambda>y. y = a) x) < length x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (takeWhile (\<lambda>y. y = a) x) < length x

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "\<not> (\<lambda>y. y = a) (x ! length (takeWhile (\<lambda>y. y = a) x))"
[PROOF STATE]
proof (prove)
using this:
length (takeWhile (\<lambda>y. y = a) x) < length x

goal (1 subgoal):
 1. x ! length (takeWhile (\<lambda>y. y = a) x) \<noteq> a
[PROOF STEP]
by (rule nth_length_takeWhile)
[PROOF STATE]
proof (state)
this:
x ! length (takeWhile (\<lambda>y. y = a) x) \<noteq> a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "\<not> (\<lambda>y. y = a) (x ! Suc i)"
[PROOF STATE]
proof (prove)
using this:
x ! length (takeWhile (\<lambda>y. y = a) x) \<noteq> a

goal (1 subgoal):
 1. x ! Suc i \<noteq> a
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
x ! length (takeWhile (\<lambda>y. y = a) x) \<noteq> a
length (takeWhile (\<lambda>y. y = a) x) = Suc i

goal (1 subgoal):
 1. x ! Suc i \<noteq> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x ! Suc i \<noteq> a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "fst (x ! Suc i) \<noteq> fst a"
[PROOF STATE]
proof (prove)
using this:
x ! Suc i \<noteq> a

goal (1 subgoal):
 1. fst (x ! Suc i) \<noteq> fst a
[PROOF STEP]
by (cases "x ! Suc i", cases "a", auto)
[PROOF STATE]
proof (state)
this:
fst (x ! Suc i) \<noteq> fst a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (x ! Suc i) \<noteq> fst a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
fst (x ! Suc i) \<noteq> fst a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
have "takeWhile (\<lambda>y. y = a) x ! i = x ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. takeWhile (\<lambda>y. y = a) x ! i = x ! i
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
length (takeWhile (\<lambda>y. y = a) x) = Suc i

goal (1 subgoal):
 1. takeWhile (\<lambda>y. y = a) x ! i = x ! i
[PROOF STEP]
by (auto intro: takeWhile_nth)
[PROOF STATE]
proof (state)
this:
takeWhile (\<lambda>y. y = a) x ! i = x ! i

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
takeWhile (\<lambda>y. y = a) x ! i = x ! i

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
have "(takeWhile (\<lambda>y. y = a) x) ! i \<in> set (takeWhile (\<lambda>y. y = a) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. takeWhile (\<lambda>y. y = a) x ! i \<in> set (takeWhile (\<lambda>y. y = a) x)
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
length (takeWhile (\<lambda>y. y = a) x) = Suc i

goal (1 subgoal):
 1. takeWhile (\<lambda>y. y = a) x ! i \<in> set (takeWhile (\<lambda>y. y = a) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
takeWhile (\<lambda>y. y = a) x ! i \<in> set (takeWhile (\<lambda>y. y = a) x)

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
takeWhile (\<lambda>y. y = a) x ! i = x ! i
takeWhile (\<lambda>y. y = a) x ! i \<in> set (takeWhile (\<lambda>y. y = a) x)
[PROOF STEP]
have "(\<lambda>y. y = a) (x ! i)"
[PROOF STATE]
proof (prove)
using this:
takeWhile (\<lambda>y. y = a) x ! i = x ! i
takeWhile (\<lambda>y. y = a) x ! i \<in> set (takeWhile (\<lambda>y. y = a) x)

goal (1 subgoal):
 1. x ! i = a
[PROOF STEP]
by (auto dest:set_takeWhileD)
[PROOF STATE]
proof (state)
this:
x ! i = a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
x ! i = a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "fst (x ! i) = fst a"
[PROOF STATE]
proof (prove)
using this:
x ! i = a

goal (1 subgoal):
 1. fst (x ! i) = fst a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst (x ! i) = fst a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (x ! i) = fst a

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
have "snd (x ! i) = snd (x ! Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (x ! i) = snd (x ! Suc i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
snd (x ! i) = snd (x ! Suc i)

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst (x ! Suc i) \<noteq> fst a
fst (x ! i) = fst a
snd (x ! i) = snd (x ! Suc i)
[PROOF STEP]
have "canceling (x ! i) (x ! Suc i)"
[PROOF STATE]
proof (prove)
using this:
fst (x ! Suc i) \<noteq> fst a
fst (x ! i) = fst a
snd (x ! i) = snd (x ! Suc i)

goal (1 subgoal):
 1. canceling (x ! i) (x ! Suc i)
[PROOF STEP]
unfolding canceling_def
[PROOF STATE]
proof (prove)
using this:
fst (x ! Suc i) \<noteq> fst a
fst (x ! i) = fst a
snd (x ! i) = snd (x ! Suc i)

goal (1 subgoal):
 1. snd (x ! i) = snd (x ! Suc i) \<and> fst (x ! i) \<noteq> fst (x ! Suc i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
canceling (x ! i) (x ! Suc i)

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "cancels_to_1_at i x (cancel_at i x)"
[PROOF STATE]
proof (prove)
using this:
canceling (x ! i) (x ! Suc i)

goal (1 subgoal):
 1. cancels_to_1_at i x (cancel_at i x)
[PROOF STEP]
using \<open>\<not> length x \<le> Suc i\<close>
[PROOF STATE]
proof (prove)
using this:
canceling (x ! i) (x ! Suc i)
\<not> length x \<le> Suc i

goal (1 subgoal):
 1. cancels_to_1_at i x (cancel_at i x)
[PROOF STEP]
unfolding cancels_to_1_at_def
[PROOF STATE]
proof (prove)
using this:
canceling (x ! i) (x ! Suc i)
\<not> length x \<le> Suc i

goal (1 subgoal):
 1. 0 \<le> i \<and> 1 + i < length x \<and> canceling (x ! i) (x ! (1 + i)) \<and> cancel_at i x = cancel_at i x
[PROOF STEP]
by (auto simp add:length_takeWhile_le)
[PROOF STATE]
proof (state)
this:
cancels_to_1_at i x (cancel_at i x)

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "cancels_to_1 x (cancel_at i x)"
[PROOF STATE]
proof (prove)
using this:
cancels_to_1_at i x (cancel_at i x)

goal (1 subgoal):
 1. cancels_to_1 x (cancel_at i x)
[PROOF STEP]
unfolding cancels_to_1_def
[PROOF STATE]
proof (prove)
using this:
cancels_to_1_at i x (cancel_at i x)

goal (1 subgoal):
 1. \<exists>ia. cancels_to_1_at ia x (cancel_at i x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cancels_to_1 x (cancel_at i x)

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
hence "\<not> canceled x"
[PROOF STATE]
proof (prove)
using this:
cancels_to_1 x (cancel_at i x)

goal (1 subgoal):
 1. \<not> canceled x
[PROOF STEP]
unfolding canceled_def
[PROOF STATE]
proof (prove)
using this:
cancels_to_1 x (cancel_at i x)

goal (1 subgoal):
 1. \<not> \<not> Domainp cancels_to_1 x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> canceled x

goal (1 subgoal):
 1. \<not> length x \<le> Suc i \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
\<not> canceled x

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>canceled x\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> canceled x
canceled x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
length x \<le> Suc i

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "length (takeWhile (\<lambda>y. y = a) x) = length x"
[PROOF STATE]
proof (prove)
using this:
length x \<le> Suc i

goal (1 subgoal):
 1. length (takeWhile (\<lambda>y. y = a) x) = length x
[PROOF STEP]
using i[THEN sym]
[PROOF STATE]
proof (prove)
using this:
length x \<le> Suc i
Suc i = length (takeWhile (\<lambda>y. y = a) x)

goal (1 subgoal):
 1. length (takeWhile (\<lambda>y. y = a) x) = length x
[PROOF STEP]
by (auto dest:le_antisym simp add:length_takeWhile_le)
[PROOF STATE]
proof (state)
this:
length (takeWhile (\<lambda>y. y = a) x) = length x

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "takeWhile (\<lambda>y. y = a) x = x"
[PROOF STATE]
proof (prove)
using this:
length (takeWhile (\<lambda>y. y = a) x) = length x

goal (1 subgoal):
 1. takeWhile (\<lambda>y. y = a) x = x
[PROOF STEP]
by (subst takeWhile_eq_take, simp)
[PROOF STATE]
proof (state)
this:
takeWhile (\<lambda>y. y = a) x = x

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
takeWhile (\<lambda>y. y = a) x = x

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
have "\<forall>y \<in> set (takeWhile (\<lambda>y. y = a) x). y = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>set (takeWhile (\<lambda>y. y = a) x). y = a
[PROOF STEP]
by (auto dest: set_takeWhileD)
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>set (takeWhile (\<lambda>y. y = a) x). y = a

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
takeWhile (\<lambda>y. y = a) x = x
\<forall>y\<in>set (takeWhile (\<lambda>y. y = a) x). y = a
[PROOF STEP]
have "\<forall>y \<in> set x. y = a"
[PROOF STATE]
proof (prove)
using this:
takeWhile (\<lambda>y. y = a) x = x
\<forall>y\<in>set (takeWhile (\<lambda>y. y = a) x). y = a

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

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "x = replicate (length x) a"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>set x. y = a

goal (1 subgoal):
 1. x = replicate (length x) a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = replicate (length x) a

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "int.lift f x = int.lift f (replicate (length x) a)"
[PROOF STATE]
proof (prove)
using this:
x = replicate (length x) a

goal (1 subgoal):
 1. int.lift f x = int.lift f (replicate (length x) a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int.lift f x = int.lift f (replicate (length x) a)

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int.lift f x = int.lift f (replicate (length x) a)

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
have "... = pow int_group (int.lift_gi f a) (length x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int.lift f (replicate (length x) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x
[PROOF STEP]
apply (induct x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. int.lift f (replicate (length []) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length []
 2. \<And>aa x. int.lift f (replicate (length x) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x \<Longrightarrow> int.lift f (replicate (length (aa # x)) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length (aa # x)
[PROOF STEP]
using local.int.nat_pow_Suc local.int.nat_pow_0
[PROOF STATE]
proof (prove)
using this:
?x [^]\<^bsub>int_group\<^esub> Suc ?n = ?x [^]\<^bsub>int_group\<^esub> ?n \<otimes>\<^bsub>int_group\<^esub> ?x
?x [^]\<^bsub>int_group\<^esub> 0 = \<one>\<^bsub>int_group\<^esub>

goal (2 subgoals):
 1. int.lift f (replicate (length []) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length []
 2. \<And>aa x. int.lift f (replicate (length x) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x \<Longrightarrow> int.lift f (replicate (length (aa # x)) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length (aa # x)
[PROOF STEP]
apply (auto simp: int.lift_def [simplified])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
int.lift f (replicate (length x) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int.lift f (replicate (length x) a) = int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
have "... = (int.lift_gi f a) * int (length x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x = int.lift_gi f a * int (length x)
[PROOF STEP]
apply (induct x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. int.lift_gi f a [^]\<^bsub>int_group\<^esub> length [] = int.lift_gi f a * int (length [])
 2. \<And>aa x. int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x = int.lift_gi f a * int (length x) \<Longrightarrow> int.lift_gi f a [^]\<^bsub>int_group\<^esub> length (aa # x) = int.lift_gi f a * int (length (aa # x))
[PROOF STEP]
using local.int.nat_pow_Suc local.int.nat_pow_0
[PROOF STATE]
proof (prove)
using this:
?x [^]\<^bsub>int_group\<^esub> Suc ?n = ?x [^]\<^bsub>int_group\<^esub> ?n \<otimes>\<^bsub>int_group\<^esub> ?x
?x [^]\<^bsub>int_group\<^esub> 0 = \<one>\<^bsub>int_group\<^esub>

goal (2 subgoals):
 1. int.lift_gi f a [^]\<^bsub>int_group\<^esub> length [] = int.lift_gi f a * int (length [])
 2. \<And>aa x. int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x = int.lift_gi f a * int (length x) \<Longrightarrow> int.lift_gi f a [^]\<^bsub>int_group\<^esub> length (aa # x) = int.lift_gi f a * int (length (aa # x))
[PROOF STEP]
by (auto simp: int_distrib)
[PROOF STATE]
proof (state)
this:
int.lift_gi f a [^]\<^bsub>int_group\<^esub> length x = int.lift_gi f a * int (length x)

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
int.lift f x = int.lift_gi f a * int (length x)
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
using this:
int.lift f x = int.lift_gi f a * int (length x)

goal (1 subgoal):
 1. int.lift_gi f a * int (length x) = 0
[PROOF STEP]
using \<open>int.lift f x = 0\<close>
[PROOF STATE]
proof (prove)
using this:
int.lift f x = int.lift_gi f a * int (length x)
int.lift f x = 0

goal (1 subgoal):
 1. int.lift_gi f a * int (length x) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int.lift_gi f a * int (length x) = 0

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "nat (abs (group.lift_gi int_group f a * int (length x))) = 0"
[PROOF STATE]
proof (prove)
using this:
int.lift_gi f a * int (length x) = 0

goal (1 subgoal):
 1. nat \<bar>int.lift_gi f a * int (length x)\<bar> = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat \<bar>int.lift_gi f a * int (length x)\<bar> = 0

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "nat (abs (group.lift_gi int_group f a)) * length x = 0"
[PROOF STATE]
proof (prove)
using this:
nat \<bar>int.lift_gi f a * int (length x)\<bar> = 0

goal (1 subgoal):
 1. nat \<bar>int.lift_gi f a\<bar> * length x = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat \<bar>int.lift_gi f a\<bar> * length x = 0

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "nat (abs (group.lift_gi int_group f a)) = 0"
[PROOF STATE]
proof (prove)
using this:
nat \<bar>int.lift_gi f a\<bar> * length x = 0

goal (1 subgoal):
 1. nat \<bar>int.lift_gi f a\<bar> = 0
[PROOF STEP]
using \<open>x \<noteq> []\<close>
[PROOF STATE]
proof (prove)
using this:
nat \<bar>int.lift_gi f a\<bar> * length x = 0
x \<noteq> []

goal (1 subgoal):
 1. nat \<bar>int.lift_gi f a\<bar> = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat \<bar>int.lift_gi f a\<bar> = 0

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
nat \<bar>int.lift_gi f a\<bar> = 0

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
have "inv\<^bsub>int_group\<^esub> 1 = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>int_group\<^esub> 1 = - 1
[PROOF STEP]
using int.inv_equality
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<otimes>\<^bsub>int_group\<^esub> ?x = \<one>\<^bsub>int_group\<^esub>; ?x \<in> carrier int_group; ?y \<in> carrier int_group\<rbrakk> \<Longrightarrow> inv\<^bsub>int_group\<^esub> ?x = ?y

goal (1 subgoal):
 1. inv\<^bsub>int_group\<^esub> 1 = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>int_group\<^esub> 1 = - 1

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
hence "abs (group.lift_gi int_group f a) = 1"
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>int_group\<^esub> 1 = - 1

goal (1 subgoal):
 1. \<bar>int.lift_gi f a\<bar> = 1
[PROOF STEP]
using int.is_group
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>int_group\<^esub> 1 = - 1
Group.group int_group

goal (1 subgoal):
 1. \<bar>int.lift_gi f a\<bar> = 1
[PROOF STEP]
by(auto simp add: group.lift_gi_def f_def)
[PROOF STATE]
proof (state)
this:
\<bar>int.lift_gi f a\<bar> = 1

goal (1 subgoal):
 1. x \<noteq> [] \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
nat \<bar>int.lift_gi f a\<bar> = 0
\<bar>int.lift_gi f a\<bar> = 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
nat \<bar>int.lift_gi f a\<bar> = 0
\<bar>int.lift_gi f a\<bar> = 1

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

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

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x3 \<in> carrier \<F>\<^bsub>{()}\<^esub>; int.lift f ?x3 = 0\<rbrakk> \<Longrightarrow> ?x3 = []

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
hence "\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x3 \<in> carrier \<F>\<^bsub>{()}\<^esub>; int.lift f ?x3 = 0\<rbrakk> \<Longrightarrow> ?x3 = []

goal (1 subgoal):
 1. \<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
[PROOF STEP]
by (auto simp add:free_group_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
have "carrier \<F>\<^bsub>{()}\<^esub> = \<langle>insert`{()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier \<F>\<^bsub>{()}\<^esub> = \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
[PROOF STEP]
by (rule gens_span_free_group[THEN sym])
[PROOF STATE]
proof (state)
this:
carrier \<F>\<^bsub>{()}\<^esub> = \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
carrier \<F>\<^bsub>{()}\<^esub> = \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
have "carrier int_group = \<langle>{1}\<rangle>\<^bsub>int_group\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier int_group = \<langle>{1}\<rangle>\<^bsub>int_group\<^esub>
[PROOF STEP]
by (rule int_group_gen_by_one[THEN sym])
[PROOF STATE]
proof (state)
this:
carrier int_group = \<langle>{1}\<rangle>\<^bsub>int_group\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
carrier int_group = \<langle>{1}\<rangle>\<^bsub>int_group\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
have "int.lift f ` insert ` {()} = {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int.lift f ` \<iota> ` {()} = {1}
[PROOF STEP]
by (auto simp add: int.lift_def [simplified] insert_def f_def int.lift_gi_def [simplified])
[PROOF STATE]
proof (state)
this:
int.lift f ` \<iota> ` {()} = {1}

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int.lift f ` \<iota> ` {()} = {1}

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
have  "int.lift f ` \<langle>insert`{()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub> = \<langle>int.lift f ` (insert `{()})\<rangle>\<^bsub>int_group\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int.lift f ` \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub> = \<langle>int.lift f ` \<iota> ` {()}\<rangle>\<^bsub>int_group\<^esub>
[PROOF STEP]
by (rule hom.hom_span, auto intro:insert_closed)
[PROOF STATE]
proof (state)
this:
int.lift f ` \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub> = \<langle>int.lift f ` \<iota> ` {()}\<rangle>\<^bsub>int_group\<^esub>

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
carrier \<F>\<^bsub>{()}\<^esub> = \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
carrier int_group = \<langle>{1}\<rangle>\<^bsub>int_group\<^esub>
int.lift f ` \<iota> ` {()} = {1}
int.lift f ` \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub> = \<langle>int.lift f ` \<iota> ` {()}\<rangle>\<^bsub>int_group\<^esub>
[PROOF STEP]
have "int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group"
[PROOF STATE]
proof (prove)
using this:
carrier \<F>\<^bsub>{()}\<^esub> = \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
carrier int_group = \<langle>{1}\<rangle>\<^bsub>int_group\<^esub>
int.lift f ` \<iota> ` {()} = {1}
int.lift f ` \<langle>\<iota> ` {()}\<rangle>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub> = \<langle>int.lift f ` \<iota> ` {()}\<rangle>\<^bsub>int_group\<^esub>

goal (1 subgoal):
 1. int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group
[PROOF STEP]
have "int.lift f \<in> iso \<F>\<^bsub>{()}\<^esub> int_group"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group

goal (1 subgoal):
 1. int.lift f \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
using \<open>int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group
int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group

goal (1 subgoal):
 1. int.lift f \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
using hom.hom_mult int.is_group
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>carrier \<F>\<^bsub>{()}\<^esub>. int.lift f x = \<one>\<^bsub>int_group\<^esub> \<longrightarrow> x = \<one>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub>
int.lift f ` carrier \<F>\<^bsub>{()}\<^esub> = carrier int_group
int.lift f \<in> hom \<F>\<^bsub>{()}\<^esub> int_group
\<lbrakk>?x \<in> carrier \<F>\<^bsub>{()}\<^esub>; ?y \<in> carrier \<F>\<^bsub>{()}\<^esub>\<rbrakk> \<Longrightarrow> int.lift f (?x \<otimes>\<^bsub>\<F>\<^bsub>{()}\<^esub>\<^esub> ?y) = int.lift f ?x \<otimes>\<^bsub>int_group\<^esub> int.lift f ?y
Group.group int_group

goal (1 subgoal):
 1. int.lift f \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
by (auto intro:group_isoI simp add: free_group_is_group)
[PROOF STATE]
proof (state)
this:
int.lift f \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
int.lift f \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group

goal (1 subgoal):
 1. \<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>h. h \<in> Group.iso \<F>\<^bsub>{()}\<^esub> int_group

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Levy_uniqueness:
  fixes M1 M2 :: "real measure"
  assumes "real_distribution M1" "real_distribution M2" and
    "char M1 = char M2"
  shows "M1 = M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
interpret M1: real_distribution M1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_distribution M1
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
interpret M2: real_distribution M2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_distribution M2
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
have "countable ({x. measure M1 {x} \<noteq> 0} \<union> {x. measure M2 {x} \<noteq> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})
[PROOF STEP]
by (intro countable_Un M2.countable_support M1.countable_support)
[PROOF STATE]
proof (state)
this:
countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})
[PROOF STEP]
have count: "countable {x. measure M1 {x} \<noteq> 0 \<or> measure M2 {x} \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})

goal (1 subgoal):
 1. countable {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
[PROOF STEP]
by (simp add: Un_def)
[PROOF STATE]
proof (state)
this:
countable {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
have "cdf M1 = cdf M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cdf M1 = cdf M2
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
let ?D = "\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
fix \<epsilon> :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
assume "\<epsilon> > 0"
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "(?D \<longlongrightarrow> 0) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
[PROOF STEP]
using M1.cdf_lim_at_bot M2.cdf_lim_at_bot
[PROOF STATE]
proof (prove)
using this:
(cdf M1 \<longlongrightarrow> 0) at_bot
(cdf M2 \<longlongrightarrow> 0) at_bot

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
[PROOF STEP]
by (intro tendsto_eq_intros) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
[PROOF STEP]
have "eventually (\<lambda>y. ?D y < \<epsilon> / 2 \<and> y \<le> x) at_bot"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x
[PROOF STEP]
using \<open>\<epsilon> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x
[PROOF STEP]
by (simp only: tendsto_iff dist_real_def diff_0_right eventually_conj eventually_le_at_bot abs_idempotent)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x
[PROOF STEP]
obtain M where "\<And>y. y \<le> M \<Longrightarrow> ?D y < \<epsilon> / 2" "M \<le> x"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>\<And>y. y \<le> M \<Longrightarrow> \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2; M \<le> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_at_bot_linorder
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<le>N. \<bar>cdf M1 n - cdf M2 n\<bar> < \<epsilon> / 2 \<and> n \<le> x

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>\<And>y. y \<le> M \<Longrightarrow> \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2; M \<le> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y1 \<le> M \<Longrightarrow> \<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> < \<epsilon> / 2
M \<le> x

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
with open_minus_countable[OF count, of "{..< M}"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>{..<M} \<noteq> {}; open {..<M}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<M}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
?y1 \<le> M \<Longrightarrow> \<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> < \<epsilon> / 2
M \<le> x
[PROOF STEP]
obtain a where
        "measure M1 {a} = 0" "measure M2 {a} = 0" "a < M" "a \<le> x" and 1: "?D a < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{..<M} \<noteq> {}; open {..<M}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<M}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
?y1 \<le> M \<Longrightarrow> \<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> < \<epsilon> / 2
M \<le> x

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>M1.prob {a} = 0; M2.prob {a} = 0; a < M; a \<le> x; \<bar>cdf M1 a - cdf M2 a\<bar> < \<epsilon> / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M1.prob {a} = 0
M2.prob {a} = 0
a < M
a \<le> x
\<bar>cdf M1 a - cdf M2 a\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "(?D \<longlongrightarrow> ?D x) (at_right x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
[PROOF STEP]
using M1.cdf_is_right_cont [of x] M2.cdf_is_right_cont [of x]
[PROOF STATE]
proof (prove)
using this:
continuous (at_right x) (cdf M1)
continuous (at_right x) (cdf M2)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
[PROOF STEP]
by (intro tendsto_intros) (auto simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
[PROOF STEP]
have "eventually (\<lambda>y. \<bar>?D y - ?D x\<bar> < \<epsilon> / 2) (at_right x)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
using \<open>\<epsilon> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
by (simp only: tendsto_iff dist_real_def eventually_conj eventually_at_right_less)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
obtain N where "N > x" "\<And>y. x < y \<Longrightarrow> y < N \<Longrightarrow> \<bar>?D y - ?D x\<bar> < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>x < N; \<And>y. \<lbrakk>x < y; y < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: eventually_at_right[OF less_add_one])
[PROOF STATE]
proof (state)
this:
x < N
\<lbrakk>x < ?y1; ?y1 < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
with open_minus_countable[OF count, of "{x <..< N}"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>{x<..<N} \<noteq> {}; open {x<..<N}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{x<..<N}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
x < N
\<lbrakk>x < ?y1; ?y1 < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
obtain b where "x < b" "b < N"
          "measure M1 {b} = 0" "measure M2 {b} = 0" and 2: "\<bar>?D b - ?D x\<bar> < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{x<..<N} \<noteq> {}; open {x<..<N}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{x<..<N}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
x < N
\<lbrakk>x < ?y1; ?y1 < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>x < b; b < N; M1.prob {b} = 0; M2.prob {b} = 0; \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: abs_minus_commute)
[PROOF STATE]
proof (state)
this:
x < b
b < N
M1.prob {b} = 0
M2.prob {b} = 0
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
from \<open>a \<le> x\<close> \<open>x < b\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<le> x
x < b
[PROOF STEP]
have "a < b" "a \<le> b"
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x < b

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

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
from \<open>char M1 = char M2\<close>
        M1.Levy_Inversion [OF \<open>a \<le> b\<close> \<open>measure M1 {a} = 0\<close> \<open>measure M1 {b} = 0\<close>]
        M2.Levy_Inversion [OF \<open>a \<le> b\<close> \<open>measure M2 {a} = 0\<close> \<open>measure M2 {b} = 0\<close>]
[PROOF STATE]
proof (chain)
picking this:
char M1 = char M2
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M1 t)) \<longlonglongrightarrow> complex_of_real (M1.prob {a<..b})
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M2 t)) \<longlonglongrightarrow> complex_of_real (M2.prob {a<..b})
[PROOF STEP]
have "complex_of_real (measure M1 {a<..b}) = complex_of_real (measure M2 {a<..b})"
[PROOF STATE]
proof (prove)
using this:
char M1 = char M2
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M1 t)) \<longlonglongrightarrow> complex_of_real (M1.prob {a<..b})
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M2 t)) \<longlonglongrightarrow> complex_of_real (M2.prob {a<..b})

goal (1 subgoal):
 1. complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})
[PROOF STEP]
by (intro LIMSEQ_unique) auto
[PROOF STATE]
proof (state)
this:
complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})
[PROOF STEP]
have "?D a = ?D b"
[PROOF STATE]
proof (prove)
using this:
complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})

goal (1 subgoal):
 1. \<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>
[PROOF STEP]
unfolding of_real_eq_iff M1.cdf_diff_eq [OF \<open>a < b\<close>, symmetric] M2.cdf_diff_eq [OF \<open>a < b\<close>, symmetric]
[PROOF STATE]
proof (prove)
using this:
cdf M1 b - cdf M1 a = cdf M2 b - cdf M2 a

goal (1 subgoal):
 1. \<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>
[PROOF STEP]
have "?D x = \<bar>(?D b - ?D x) - ?D a\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>

goal (1 subgoal):
 1. \<bar>cdf M1 x - cdf M2 x\<bar> = \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 x - cdf M2 x\<bar> = \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 x - cdf M2 x\<bar> = \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "\<dots> \<le> \<bar>?D b - ?D x\<bar> + \<bar>?D a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar>
[PROOF STEP]
by (rule abs_triangle_ineq4)
[PROOF STATE]
proof (state)
this:
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "\<dots> \<le> \<epsilon> / 2 + \<epsilon> / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
\<bar>cdf M1 a - cdf M2 a\<bar> < \<epsilon> / 2
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2
[PROOF STEP]
by (intro add_mono) auto
[PROOF STATE]
proof (state)
this:
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2
[PROOF STEP]
have "?D x \<le> \<epsilon>"
[PROOF STATE]
proof (prove)
using this:
\<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2

goal (1 subgoal):
 1. \<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?\<epsilon>3 \<Longrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar> \<le> ?\<epsilon>3

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?\<epsilon>3 \<Longrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar> \<le> ?\<epsilon>3
[PROOF STEP]
show "cdf M1 x = cdf M2 x"
[PROOF STATE]
proof (prove)
using this:
0 < ?\<epsilon>3 \<Longrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar> \<le> ?\<epsilon>3

goal (1 subgoal):
 1. cdf M1 x = cdf M2 x
[PROOF STEP]
by (metis abs_le_zero_iff dense_ge eq_iff_diff_eq_0)
[PROOF STATE]
proof (state)
this:
cdf M1 x = cdf M2 x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cdf M1 = cdf M2

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cdf M1 = cdf M2

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
by (rule cdf_unique [OF \<open>real_distribution M1\<close> \<open>real_distribution M2\<close>])
[PROOF STATE]
proof (state)
this:
M1 = M2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_upto_alt: "(a :: ('l :: len) word) \<le> b \<Longrightarrow>
  word_upto a b = map of_nat (upt (unat a) (Suc (unat b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
let ?mmw = "- 1 :: 'l word"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
assume le: "a \<le> b"
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
hence nle: "unat a \<le> unat b"
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. unat a \<le> unat b
[PROOF STEP]
by(unat_arith)
[PROOF STATE]
proof (state)
this:
unat a \<le> unat b

goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
have lem: "unat b \<le> unat ?mmw"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat b \<le> unat (- 1)
[PROOF STEP]
by (simp add: word_unat_less_le)
[PROOF STATE]
proof (state)
this:
unat b \<le> unat (- 1)

goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unat b \<le> unat (- 1)
[PROOF STEP]
show "word_upto a b = map of_nat [unat a..<Suc (unat b)]"
[PROOF STATE]
proof (prove)
using this:
unat b \<le> unat (- 1)

goal (1 subgoal):
 1. word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
using word_upto_eq_upto [OF nle lem]
[PROOF STATE]
proof (prove)
using this:
unat b \<le> unat (- 1)
word_upto (word_of_nat (unat a)) (word_of_nat (unat b)) = map word_of_nat [unat a..<Suc (unat b)]

goal (1 subgoal):
 1. word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
word_upto a b = map word_of_nat [unat a..<Suc (unat b)]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_swapEnv_preserves_freshEnv_distinct:
assumes "wlsEnv rho"
       "xs \<noteq> ys \<or> x \<notin> {y1,y2}"
shows "freshEnv xs x (rho &[y1 \<and> y2]_ys) = freshEnv xs x rho"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshEnv xs x (rho &[y1 \<and> y2]_ys) = freshEnv xs x rho
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho
xs \<noteq> ys \<or> x \<notin> {y1, y2}

goal (1 subgoal):
 1. freshEnv xs x (rho &[y1 \<and> y2]_ys) = freshEnv xs x rho
[PROOF STEP]
by (intro swapEnv_preserves_freshEnv_distinct) auto


[STATEMENT]
lemma (in group_hom) vimage_subset_generate_kern:
  assumes "A \<subseteq> carrier G"
  shows "{x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> kernel G H h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> kernel G H h)
[PROOF STEP]
using vimage_eq_set_mult_kern_right[of A] G.set_mult_subset_generate[of "A" "kernel G H h"] assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier G \<Longrightarrow> {x \<in> carrier G. h x \<in> h ` A} = A <#> kernel G H h
\<lbrakk>A \<subseteq> carrier G; kernel G H h \<subseteq> carrier G\<rbrakk> \<Longrightarrow> A <#> kernel G H h \<subseteq> generate G (A \<union> kernel G H h)
A \<subseteq> carrier G

goal (1 subgoal):
 1. {x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> kernel G H h)
[PROOF STEP]
unfolding kernel_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier G \<Longrightarrow> {x \<in> carrier G. h x \<in> h ` A} = A <#> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>}
\<lbrakk>A \<subseteq> carrier G; {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>} \<subseteq> carrier G\<rbrakk> \<Longrightarrow> A <#> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>} \<subseteq> generate G (A \<union> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>})
A \<subseteq> carrier G

goal (1 subgoal):
 1. {x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>})
[PROOF STEP]
by blast


[STATEMENT]
lemma one_zeroD:
  assumes onezero: "\<one> = \<zero>"
  shows "carrier R = {\<zero>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier R = {\<zero>}
[PROOF STEP]
proof (rule, rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
assume xcarr: "x \<in> carrier R"
[PROOF STATE]
proof (state)
this:
x \<in> carrier R

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
from xcarr
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
[PROOF STEP]
have "x = x \<otimes> \<one>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R

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

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
with onezero
[PROOF STATE]
proof (chain)
picking this:
\<one> = \<zero>
x = x \<otimes> \<one>
[PROOF STEP]
have "x = x \<otimes> \<zero>"
[PROOF STATE]
proof (prove)
using this:
\<one> = \<zero>
x = x \<otimes> \<one>

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

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
with xcarr
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
x = x \<otimes> \<zero>
[PROOF STEP]
have "x = \<zero>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
x = x \<otimes> \<zero>

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

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = \<zero>
[PROOF STEP]
show "x \<in> {\<zero>}"
[PROOF STATE]
proof (prove)
using this:
x = \<zero>

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

goal (1 subgoal):
 1. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
qed fast


[STATEMENT]
lemma ord_isom_Ssegment_mem:"\<lbrakk>Order D; Order E;
      ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a\<rbrakk> \<Longrightarrow>
                     (f x) \<in> Ssegment E (f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (frule Ssegment_inc_if[of "D" "a" "x"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (frule Order.ord_isom_less[of "D" "E" "f" "x" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> x \<in> carrier D
 2. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> a \<in> carrier D
 3. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a; x \<prec>\<^bsub>D\<^esub> a = f x \<prec>\<^bsub>E\<^esub> f a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (simp add:Ssegment_def, assumption, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; f x \<prec>\<^bsub>E\<^esub> f a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (frule Order.ord_isom_mem[of "D" "E" "f" "x"], assumption+,
       simp add:Ssegment_def,
       frule Order.ord_isom_mem[of "D" "E" "f" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; f x \<prec>\<^bsub>E\<^esub> f a; x \<prec>\<^bsub>D\<^esub> a; f x \<in> carrier E; f a \<in> carrier E\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (simp add:Ssegment_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma older_seniors_monotonic:
  "x \<le> n \<Longrightarrow> older_seniors x n \<supseteq> older_seniors x (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> n \<Longrightarrow> older_seniors x (n + m) \<subseteq> older_seniors x n
[PROOF STEP]
by (induction m) (simp, metis older_seniors_monotonic_Suc add_Suc_right dual_order.trans trans_le_add1)


[STATEMENT]
lemma imbal_split_min:
  "split_min t = (x,t') \<Longrightarrow> t \<noteq> Leaf \<Longrightarrow> real(imbal t') - imbal t \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Root_Balanced_Tree.split_min t = (x, t'); t \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t) \<le> 1
[PROOF STEP]
proof(induction t arbitrary: t')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t'); \<langle>\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1
 2. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
case Leaf
[PROOF STATE]
proof (state)
this:
Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t')
\<langle>\<rangle> \<noteq> \<langle>\<rangle>

goal (2 subgoals):
 1. \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t'); \<langle>\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1
 2. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t')
\<langle>\<rangle> \<noteq> \<langle>\<rangle>

goal (1 subgoal):
 1. real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1

goal (1 subgoal):
 1. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
case (Node l y r)
[PROOF STATE]
proof (state)
this:
\<lbrakk>Root_Balanced_Tree.split_min l = (x, ?t'); l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal l) \<le> 1
\<lbrakk>Root_Balanced_Tree.split_min r = (x, ?t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal r) \<le> 1
Root_Balanced_Tree.split_min \<langle>l, y, r\<rangle> = (x, t')
\<langle>l, y, r\<rangle> \<noteq> \<langle>\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Root_Balanced_Tree.split_min l = (x, ?t'); l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal l) \<le> 1
\<lbrakk>Root_Balanced_Tree.split_min r = (x, ?t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal r) \<le> 1
Root_Balanced_Tree.split_min \<langle>l, y, r\<rangle> = (x, t')
\<langle>l, y, r\<rangle> \<noteq> \<langle>\<rangle>

goal (1 subgoal):
 1. real (imbal t') - real (imbal \<langle>l, y, r\<rangle>) \<le> 1
[PROOF STEP]
using size_split_min[OF Node.prems]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Root_Balanced_Tree.split_min l = (x, ?t'); l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal l) \<le> 1
\<lbrakk>Root_Balanced_Tree.split_min r = (x, ?t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal r) \<le> 1
Root_Balanced_Tree.split_min \<langle>l, y, r\<rangle> = (x, t')
\<langle>l, y, r\<rangle> \<noteq> \<langle>\<rangle>
size t' = size \<langle>l, y, r\<rangle> - 1

goal (1 subgoal):
 1. real (imbal t') - real (imbal \<langle>l, y, r\<rangle>) \<le> 1
[PROOF STEP]
apply(auto split: if_splits option.splits prod.splits)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>\<langle>\<rangle>, x, t'\<rangle>) \<le> 1
 2. \<And>x2. \<lbrakk>Suc (size x2) = size l; real (imbal x2) - real (imbal l) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min r = (x, t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal r) \<le> 1; l \<noteq> \<langle>\<rangle>; Root_Balanced_Tree.split_min l = (x, x2); t' = \<langle>x2, y, r\<rangle>\<rbrakk> \<Longrightarrow> real (imbal \<langle>x2, y, r\<rangle>) - real (imbal \<langle>l, y, r\<rangle>) \<le> 1
[PROOF STEP]
apply(auto simp: imbal.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
[PROOF STEP]
apply(cases t')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'; t' = \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
 2. \<And>x21 x22 x23. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'; t' = \<langle>x21, x22, x23\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
[PROOF STEP]
apply (simp add: imbal.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x21 x22 x23. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'; t' = \<langle>x21, x22, x23\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
[PROOF STEP]
apply (simp add: imbal.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
real (imbal t') - real (imbal \<langle>l, y, r\<rangle>) \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed