[STATEMENT]
lemma raw_has_prod_Suc_iff: "raw_has_prod f M (a * f M) \<longleftrightarrow> raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
have "raw_has_prod f M (a * f M) \<longleftrightarrow> (\<lambda>i. \<Prod>j\<le>Suc i. f (j+M)) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = ((\<lambda>i. \<Prod>j\<le>Suc i. f (j + M)) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a))
[PROOF STEP]
by (subst filterlim_sequentially_Suc) (simp add: raw_has_prod_def)
[PROOF STATE]
proof (state)
this:
raw_has_prod f M (a * f M) = ((\<lambda>i. \<Prod>j\<le>Suc i. f (j + M)) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a))

goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
raw_has_prod f M (a * f M) = ((\<lambda>i. \<Prod>j\<le>Suc i. f (j + M)) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a))

goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. \<Prod>j\<le>Suc i. f (j + M)) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a)) = ((\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a))
[PROOF STEP]
by (simp add: ac_simps atMost_Suc_eq_insert_0 image_Suc_atMost prod.atLeast1_atMost_eq lessThan_Suc_atMost
                  del: prod.cl_ivl_Suc)
[PROOF STATE]
proof (state)
this:
((\<lambda>i. \<Prod>j\<le>Suc i. f (j + M)) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a)) = ((\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a))

goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>i. \<Prod>j\<le>Suc i. f (j + M)) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a)) = ((\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a))

goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a)) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M; a * f M \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> raw_has_prod (\<lambda>n. f (Suc n)) M a
 2. \<lbrakk>(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M; a * f M \<noteq> (0::'a); f M = (0::'a)\<rbrakk> \<Longrightarrow> False
 3. \<lbrakk>raw_has_prod (\<lambda>n. f (Suc n)) M a; f M \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M
 4. \<lbrakk>raw_has_prod (\<lambda>n. f (Suc n)) M a; f M \<noteq> (0::'a); a * f M = (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume tends: "(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M" and 0: "a * f M \<noteq> 0"
[PROOF STATE]
proof (state)
this:
(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M
a * f M \<noteq> (0::'a)

goal (4 subgoals):
 1. \<lbrakk>(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M; a * f M \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> raw_has_prod (\<lambda>n. f (Suc n)) M a
 2. \<lbrakk>(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M; a * f M \<noteq> (0::'a); f M = (0::'a)\<rbrakk> \<Longrightarrow> False
 3. \<lbrakk>raw_has_prod (\<lambda>n. f (Suc n)) M a; f M \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M
 4. \<lbrakk>raw_has_prod (\<lambda>n. f (Suc n)) M a; f M \<noteq> (0::'a); a * f M = (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with tendsto_divide[OF tends tendsto_const, of "f M"]
[PROOF STATE]
proof (chain)
picking this:
f M \<noteq> (0::'a) \<Longrightarrow> (\<lambda>x. (\<Prod>j\<le>x. f (Suc j + M)) * f M / f M) \<longlonglongrightarrow> a * f M / f M
(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M
a * f M \<noteq> (0::'a)
[PROOF STEP]
show "raw_has_prod (\<lambda>n. f (Suc n)) M a"
[PROOF STATE]
proof (prove)
using this:
f M \<noteq> (0::'a) \<Longrightarrow> (\<lambda>x. (\<Prod>j\<le>x. f (Suc j + M)) * f M / f M) \<longlonglongrightarrow> a * f M / f M
(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M
a * f M \<noteq> (0::'a)

goal (1 subgoal):
 1. raw_has_prod (\<lambda>n. f (Suc n)) M a
[PROOF STEP]
by (simp add: raw_has_prod_def)
[PROOF STATE]
proof (state)
this:
raw_has_prod (\<lambda>n. f (Suc n)) M a

goal (3 subgoals):
 1. \<lbrakk>(\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M; a * f M \<noteq> (0::'a); f M = (0::'a)\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>raw_has_prod (\<lambda>n. f (Suc n)) M a; f M \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M
 3. \<lbrakk>raw_has_prod (\<lambda>n. f (Suc n)) M a; f M \<noteq> (0::'a); a * f M = (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
qed (auto intro: tendsto_mult_right simp:  raw_has_prod_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>i. (\<Prod>j\<le>i. f (Suc j + M)) * f M) \<longlonglongrightarrow> a * f M \<and> a * f M \<noteq> (0::'a)) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))

goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))

goal (1 subgoal):
 1. raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
raw_has_prod f M (a * f M) = (raw_has_prod (\<lambda>n. f (Suc n)) M a \<and> f M \<noteq> (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_int_round_ge: "of_int (round x) \<ge> x - 1/2"
  and of_int_round_le: "of_int (round x) \<le> x + 1/2"
  and of_int_round_abs_le: "\<bar>of_int (round x) - x\<bar> \<le> 1/2"
  and of_int_round_gt: "of_int (round x) > x - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (1::'a) / (2::'a) \<le> of_int (round x) &&& of_int (round x) \<le> x + (1::'a) / (2::'a)) &&& \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a) &&& x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
 2. of_int (round x) \<le> x + (1::'a) / (2::'a)
 3. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
 4. x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
from floor_correct[of "x + 1/2"]
[PROOF STATE]
proof (chain)
picking this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)
[PROOF STEP]
have "x + 1/2 < of_int (round x) + 1"
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)

goal (1 subgoal):
 1. x + (1::'a) / (2::'a) < of_int (round x) + (1::'a)
[PROOF STEP]
by (simp add: round_def)
[PROOF STATE]
proof (state)
this:
x + (1::'a) / (2::'a) < of_int (round x) + (1::'a)

goal (4 subgoals):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
 2. of_int (round x) \<le> x + (1::'a) / (2::'a)
 3. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
 4. x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
from add_strict_right_mono[OF this, of "-1"]
[PROOF STATE]
proof (chain)
picking this:
x + (1::'a) / (2::'a) + - (1::'a) < of_int (round x) + (1::'a) + - (1::'a)
[PROOF STEP]
show A: "of_int (round x) > x - 1/2"
[PROOF STATE]
proof (prove)
using this:
x + (1::'a) / (2::'a) + - (1::'a) < of_int (round x) + (1::'a) + - (1::'a)

goal (1 subgoal):
 1. x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - (1::'a) / (2::'a) < of_int (round x)

goal (3 subgoals):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
 2. of_int (round x) \<le> x + (1::'a) / (2::'a)
 3. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
show "of_int (round x) \<ge> x - 1/2"
[PROOF STATE]
proof (prove)
using this:
x - (1::'a) / (2::'a) < of_int (round x)

goal (1 subgoal):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - (1::'a) / (2::'a) \<le> of_int (round x)

goal (2 subgoals):
 1. of_int (round x) \<le> x + (1::'a) / (2::'a)
 2. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
from floor_correct[of "x + 1/2"]
[PROOF STATE]
proof (chain)
picking this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)
[PROOF STEP]
show "of_int (round x) \<le> x + 1/2"
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)

goal (1 subgoal):
 1. of_int (round x) \<le> x + (1::'a) / (2::'a)
[PROOF STEP]
by (simp add: round_def)
[PROOF STATE]
proof (state)
this:
of_int (round x) \<le> x + (1::'a) / (2::'a)

goal (1 subgoal):
 1. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
x - (1::'a) / (2::'a) < of_int (round x)
of_int (round x) \<le> x + (1::'a) / (2::'a)
[PROOF STEP]
show "\<bar>of_int (round x) - x\<bar> \<le> 1/2"
[PROOF STATE]
proof (prove)
using this:
x - (1::'a) / (2::'a) < of_int (round x)
of_int (round x) \<le> x + (1::'a) / (2::'a)

goal (1 subgoal):
 1. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in \<Z>)
  M\<alpha>_Rel_arrow_lr_is_cat_Set_iso_arr'[cat_rel_par_Set_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "A' = (A \<times>\<^sub>\<circ> B) \<times>\<^sub>\<circ> C"
    and "B' = A \<times>\<^sub>\<circ> (B \<times>\<^sub>\<circ> C)"
    and "\<CC>' = cat_Set \<alpha>"
  shows "M\<alpha>_Rel_arrow_lr A B C : A' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_lr A B C : A' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_lr A B C : A' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
unfolding assms(4-6)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_lr A B C : (A \<times>\<^sub>\<circ> B) \<times>\<^sub>\<circ> C \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_Set \<alpha>\<^esub> A \<times>\<^sub>\<circ> B \<times>\<^sub>\<circ> C
[PROOF STEP]
by (rule M\<alpha>_Rel_arrow_lr_is_cat_Set_iso_arr)


[STATEMENT]
lemma map_iterator_dom_filter_correct :
  assumes it_OK: "map_iterator it m"
  shows "set_iterator (map_iterator_dom_filter P it) {k. \<exists>v. m k = Some v \<and> P (k, v)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator (map_iterator_dom_filter P it) {k. \<exists>v. m k = Some v \<and> P (k, v)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
map_iterator it m

goal (1 subgoal):
 1. set_iterator (map_iterator_dom_filter P it) {k. \<exists>v. m k = Some v \<and> P (k, v)}
[PROOF STEP]
unfolding set_iterator_def
[PROOF STATE]
proof (prove)
using this:
map_iterator_genord it m (\<lambda>_ _. True)

goal (1 subgoal):
 1. set_iterator_genord (map_iterator_dom_filter P it) {k. \<exists>v. m k = Some v \<and> P (k, v)} (\<lambda>_ _. True)
[PROOF STEP]
apply (rule_tac map_iterator_genord_dom_filter_correct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map_iterator_genord it m (\<lambda>_ _. True) \<Longrightarrow> map_iterator_genord it m ?R1
 2. \<And>k1 v1 k2 v2. \<lbrakk>map_iterator_genord it m (\<lambda>_ _. True); m k1 = Some v1; P (k1, v1); m k2 = Some v2; P (k2, v2); ?R1 (k1, v1) (k2, v2)\<rbrakk> \<Longrightarrow> True
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma commutes_sub: "commutes A \<Longrightarrow> B \<subseteq> A \<Longrightarrow> commutes B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>commutes A; B \<subseteq> A\<rbrakk> \<Longrightarrow> commutes B
[PROOF STEP]
by (simp add: commutes_def subsetD)


[STATEMENT]
lemma ladj_prop:
  fixes g :: "'b::Inf \<Rightarrow> 'a::ord_with_dual"
  shows "ladj g = Inf \<circ> (-`) g \<circ> \<up>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladj g = Inf \<circ> (-`) g \<circ> \<up>
[PROOF STEP]
unfolding ladj_def vimage_def upset_prop fun_eq_iff comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<Sqinter> {y. x \<le> g y} = \<Sqinter> {xa. g xa \<in> Collect ((\<le>) x)}
[PROOF STEP]
by simp


[STATEMENT]
lemma trans_def: "trans r = ((Id \<union> r) O r = r)" "trans r = (r O (Id \<union> r) = r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans r = ((Id \<union> r) O r = r) &&& trans r = (r O (Id \<union> r) = r)
[PROOF STEP]
by(auto simp:trans_def)


[STATEMENT]
lemma trans_less_add1_hmset: "i < j \<Longrightarrow> i < j + m" for i j m :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < j \<Longrightarrow> i < j + m
[PROOF STEP]
by (metis add_increasing2 leD le_less not_gr_zero_hmset)


[STATEMENT]
lemma cong_r_symmetric: "F \<in> filters \<Longrightarrow> (cong_r F a b) = (cong_r F b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<in> filters \<Longrightarrow> cong_r F a b = cong_r F b a
[PROOF STEP]
apply (simp add: cong_r_filter)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<in> filters \<Longrightarrow> (a l\<rightarrow> b \<in> F \<and> b l\<rightarrow> a \<in> F) = (b l\<rightarrow> a \<in> F \<and> a l\<rightarrow> b \<in> F)
[PROOF STEP]
by blast


[STATEMENT]
lemma component_le_onorm:
  fixes f :: "real^'m \<Rightarrow> real^'n"
  shows "linear f \<Longrightarrow> \<bar>matrix f $ i $ j\<bar> \<le> onorm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f \<Longrightarrow> \<bar>matrix f $ i $ j\<bar> \<le> onorm f
[PROOF STEP]
by (metis matrix_component_le_onorm matrix_vector_mul(2))


[STATEMENT]
lemma map_of_distinct_upd3:
  assumes "x \<notin> set(map fst xs)"
  "x \<notin> set (map fst ys)"
  shows "map_of (xs @ (x,y) # ys) = (map_of (xs @ (x,y') # ys))(x \<mapsto> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (xs @ (x, y) # ys) = map_of (xs @ (x, y') # ys)(x \<mapsto> y)
[PROOF STEP]
apply(insert assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> set (map fst xs); x \<notin> set (map fst ys)\<rbrakk> \<Longrightarrow> map_of (xs @ (x, y) # ys) = map_of (xs @ (x, y') # ys)(x \<mapsto> y)
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<notin> set (map fst []); x \<notin> set (map fst ys)\<rbrakk> \<Longrightarrow> map_of ([] @ (x, y) # ys) = map_of ([] @ (x, y') # ys)(x \<mapsto> y)
 2. \<And>a xs. \<lbrakk>\<lbrakk>x \<notin> set (map fst xs); x \<notin> set (map fst ys)\<rbrakk> \<Longrightarrow> map_of (xs @ (x, y) # ys) = map_of (xs @ (x, y') # ys)(x \<mapsto> y); x \<notin> set (map fst (a # xs)); x \<notin> set (map fst ys)\<rbrakk> \<Longrightarrow> map_of ((a # xs) @ (x, y) # ys) = map_of ((a # xs) @ (x, y') # ys)(x \<mapsto> y)
[PROOF STEP]
apply (auto intro: ext)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma list_nth_append7:
assumes "i - length x < Suc (length y)"
       and "i - Suc (length x) < Suc (length y)"
shows    "i < Suc (Suc (length x + length y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < Suc (Suc (length x + length y))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i - length x < Suc (length y)
i - Suc (length x) < Suc (length y)

goal (1 subgoal):
 1. i < Suc (Suc (length x + length y))
[PROOF STEP]
by arith


[STATEMENT]
lemma ALGxy_det_alternativ: "ALGxy_det A qs init x y
   =  (\<Sum>i\<in>{i. i<length qs \<and> (qs!i \<in> {y,x})}. ALG'_det A qs init i y + ALG'_det A qs init i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
have f: "{i. i<length qs} = {..<length qs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < length qs} = {..<length qs}
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
{i. i < length qs} = {..<length qs}

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
have e: "{i. i<length qs \<and> (qs!i \<in> {y,x})} = {i. i<length qs} \<inter> {i. (qs!i \<in> {y,x})}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < length qs \<and> qs ! i \<in> {y, x}} = {i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < length qs \<and> qs ! i \<in> {y, x}} = {i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
have "(\<Sum>i\<in>{i. i<length qs \<and> (qs!i \<in> {y,x})}. ALG'_det A qs init i y + ALG'_det A qs init i x)
    = (\<Sum>i\<in>{i. i<length qs} \<inter> {i. (qs!i \<in> {y,x})}. ALG'_det A qs init i y + ALG'_det A qs init i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x) = (\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
unfolding e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x) = (\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x) = (\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x)

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x) = (\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x)

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{i. i<length qs}. (if i \<in> {i. (qs!i \<in> {y,x})} then ALG'_det A qs init i y + ALG'_det A qs init i x
                                                    else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x) = (\<Sum>i | i < length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)
[PROOF STEP]
apply(rule sum.inter_restrict)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i < length qs}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x) = (\<Sum>i | i < length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{i. i < length qs} \<inter> {i. qs ! i \<in> {y, x}}. ALG'_det A qs init i y + ALG'_det A qs init i x) = (\<Sum>i | i < length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{..<length qs}. (if i \<in> {i. (qs!i \<in> {y,x})} then ALG'_det A qs init i y + ALG'_det A qs init i x
                                                    else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i | i < length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0) = (\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)
[PROOF STEP]
unfolding f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0) = (\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i | i < length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0) = (\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i | i < length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0) = (\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
have "\<dots> = ALGxy_det A qs init x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0) = ALGxy_det A qs init x y
[PROOF STEP]
unfolding ALGxy_det_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0) = (\<Sum>i<length qs. if qs ! i \<in> {y, x} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length qs. if i \<in> {i. qs ! i \<in> {y, x}} then ALG'_det A qs init i y + ALG'_det A qs init i x else 0) = ALGxy_det A qs init x y

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x) = ALGxy_det A qs init x y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x) = ALGxy_det A qs init x y

goal (1 subgoal):
 1. ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ALGxy_det A qs init x y = (\<Sum>i | i < length qs \<and> qs ! i \<in> {y, x}. ALG'_det A qs init i y + ALG'_det A qs init i x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_tensor_prod_2_col [simp]:
  assumes "state 1 v" and "state 1 w"
  shows "Matrix.col (v \<Otimes> w) 0 = Matrix.col v 0 \<otimes> Matrix.col w 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.col (v \<Otimes> w) 0 = Matrix.col v 0 \<otimes> Matrix.col w 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
 2. dim_vec (Matrix.col (v \<Otimes> w) 0) = dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0)
[PROOF STEP]
show f1:"dim_vec (Matrix.col (v \<Otimes> w) 0) = dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (Matrix.col (v \<Otimes> w) 0) = dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0)
[PROOF STEP]
using assms vec_tensor_prod_2_bis
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w
\<lbrakk>?v \<in> state_qbit 1; ?w \<in> state_qbit 1\<rbrakk> \<Longrightarrow> ?v \<otimes> ?w = Matrix.vec 4 (\<lambda>i. if i = 0 then ?v $ 0 * ?w $ 0 else if i = 3 then ?v $ 1 * ?w $ 1 else if i = 1 then ?v $ 0 * ?w $ 1 else ?v $ 1 * ?w $ 0)

goal (1 subgoal):
 1. dim_vec (Matrix.col (v \<Otimes> w) 0) = dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0)
[PROOF STEP]
by (smt Tensor.mat_of_cols_list_def dim_col dim_row_mat(1) dim_vec mat_tensor_prod_2_prelim state.state_to_state_qbit)
[PROOF STATE]
proof (state)
this:
dim_vec (Matrix.col (v \<Otimes> w) 0) = dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
show "\<And>i. i<dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) = 4
[PROOF STEP]
by (metis (no_types, lifting) assms(1) assms(2) dim_vec state.state_to_state_qbit vec_tensor_prod_2_bis)
[PROOF STATE]
proof (state)
this:
dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) = 4

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) = 4

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0,0) * w $$ (0,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0, 0) * w $$ (0, 0)
[PROOF STEP]
using assms vec_tensor_prod_2 state.state_to_state_qbit col_index_of_mat_col
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w
\<lbrakk>?v \<in> state_qbit 1; ?w \<in> state_qbit 1\<rbrakk> \<Longrightarrow> ?v \<otimes> ?w = vec_of_list [?v $ 0 * ?w $ 0, ?v $ 0 * ?w $ 1, ?v $ 1 * ?w $ 0, ?v $ 1 * ?w $ 1]
state ?n ?v \<Longrightarrow> Matrix.col ?v 0 \<in> state_qbit ?n
\<lbrakk>dim_col ?v = 1; ?i < dim_row ?v\<rbrakk> \<Longrightarrow> Matrix.col ?v 0 $ ?i = ?v $$ (?i, 0)

goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0, 0) * w $$ (0, 0)
[PROOF STEP]
by (smt nth_Cons_0 power_one_right state_def vec_of_list_index zero_less_numeral)
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0, 0) * w $$ (0, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0, 0) * w $$ (0, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "\<dots> = Matrix.col (v \<Otimes> w) 0 $ 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $$ (0, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w

goal (1 subgoal):
 1. v $$ (0, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v $$ (0, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 0

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v $$ (0, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 0

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0,0) * w $$ (1,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0, 0) * w $$ (1, 0)
[PROOF STEP]
using assms vec_tensor_prod_2 state.state_to_state_qbit col_index_of_mat_col
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w
\<lbrakk>?v \<in> state_qbit 1; ?w \<in> state_qbit 1\<rbrakk> \<Longrightarrow> ?v \<otimes> ?w = vec_of_list [?v $ 0 * ?w $ 0, ?v $ 0 * ?w $ 1, ?v $ 1 * ?w $ 0, ?v $ 1 * ?w $ 1]
state ?n ?v \<Longrightarrow> Matrix.col ?v 0 \<in> state_qbit ?n
\<lbrakk>dim_col ?v = 1; ?i < dim_row ?v\<rbrakk> \<Longrightarrow> Matrix.col ?v 0 $ ?i = ?v $$ (?i, 0)

goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0, 0) * w $$ (1, 0)
[PROOF STEP]
by (smt One_nat_def Suc_1 lessI nth_Cons_0 power_one_right state_def vec_index_vCons_Suc
vec_of_list_Cons vec_of_list_index zero_less_numeral)
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0, 0) * w $$ (1, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0, 0) * w $$ (1, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "\<dots> = Matrix.col (v \<Otimes> w) 0 $ 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $$ (0, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w

goal (1 subgoal):
 1. v $$ (0, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v $$ (0, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 1

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v $$ (0, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 1

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1,0) * w $$ (0,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1, 0) * w $$ (0, 0)
[PROOF STEP]
using assms vec_tensor_prod_2 state.state_to_state_qbit col_index_of_mat_col
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w
\<lbrakk>?v \<in> state_qbit 1; ?w \<in> state_qbit 1\<rbrakk> \<Longrightarrow> ?v \<otimes> ?w = vec_of_list [?v $ 0 * ?w $ 0, ?v $ 0 * ?w $ 1, ?v $ 1 * ?w $ 0, ?v $ 1 * ?w $ 1]
state ?n ?v \<Longrightarrow> Matrix.col ?v 0 \<in> state_qbit ?n
\<lbrakk>dim_col ?v = 1; ?i < dim_row ?v\<rbrakk> \<Longrightarrow> Matrix.col ?v 0 $ ?i = ?v $$ (?i, 0)

goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1, 0) * w $$ (0, 0)
[PROOF STEP]
by (smt One_nat_def Suc_1 lessI nth_Cons_0 power_one_right state_def vec_index_vCons_Suc
vec_of_list_Cons vec_of_list_index zero_less_numeral)
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1, 0) * w $$ (0, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1, 0) * w $$ (0, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "\<dots> = Matrix.col (v \<Otimes> w) 0 $ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $$ (1, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w

goal (1 subgoal):
 1. v $$ (1, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v $$ (1, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 2

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v $$ (1, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 2

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1,0) * w $$ (1,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1, 0) * w $$ (1, 0)
[PROOF STEP]
using assms vec_tensor_prod_2 state.state_to_state_qbit col_index_of_mat_col numeral_3_eq_3
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w
\<lbrakk>?v \<in> state_qbit 1; ?w \<in> state_qbit 1\<rbrakk> \<Longrightarrow> ?v \<otimes> ?w = vec_of_list [?v $ 0 * ?w $ 0, ?v $ 0 * ?w $ 1, ?v $ 1 * ?w $ 0, ?v $ 1 * ?w $ 1]
state ?n ?v \<Longrightarrow> Matrix.col ?v 0 \<in> state_qbit ?n
\<lbrakk>dim_col ?v = 1; ?i < dim_row ?v\<rbrakk> \<Longrightarrow> Matrix.col ?v 0 $ ?i = ?v $$ (?i, 0)
3 = Suc (Suc (Suc 0))

goal (1 subgoal):
 1. (Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1, 0) * w $$ (1, 0)
[PROOF STEP]
by (smt One_nat_def Suc_1 lessI nth_Cons_0 power_one_right state_def vec_index_vCons_Suc
vec_of_list_Cons vec_of_list_index zero_less_numeral)
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1, 0) * w $$ (1, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1, 0) * w $$ (1, 0)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
have "\<dots> = Matrix.col (v \<Otimes> w) 0 $ 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $$ (1, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w

goal (1 subgoal):
 1. v $$ (1, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v $$ (1, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 3

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) = 4
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0, 0) * w $$ (0, 0)
v $$ (0, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 0
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0, 0) * w $$ (1, 0)
v $$ (0, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 1
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1, 0) * w $$ (0, 0)
v $$ (1, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 2
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1, 0) * w $$ (1, 0)
v $$ (1, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 3
[PROOF STEP]
show "\<And>i. i<dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i"
[PROOF STATE]
proof (prove)
using this:
dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) = 4
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0, 0) * w $$ (0, 0)
v $$ (0, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 0
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0, 0) * w $$ (1, 0)
v $$ (0, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 1
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1, 0) * w $$ (0, 0)
v $$ (1, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 2
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1, 0) * w $$ (1, 0)
v $$ (1, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 3

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
using index_sl_four
[PROOF STATE]
proof (prove)
using this:
dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) = 4
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 0 = v $$ (0, 0) * w $$ (0, 0)
v $$ (0, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 0
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 1 = v $$ (0, 0) * w $$ (1, 0)
v $$ (0, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 1
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 2 = v $$ (1, 0) * w $$ (0, 0)
v $$ (1, 0) * w $$ (0, 0) = Matrix.col (v \<Otimes> w) 0 $ 2
(Matrix.col v 0 \<otimes> Matrix.col w 0) $ 3 = v $$ (1, 0) * w $$ (1, 0)
v $$ (1, 0) * w $$ (1, 0) = Matrix.col (v \<Otimes> w) 0 $ 3
\<forall>i<4. i = 0 \<or> i = 1 \<or> i = 2 \<or> i = 3

goal (1 subgoal):
 1. \<And>i. i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ ?i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ ?i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i < dim_vec (Matrix.col v 0 \<otimes> Matrix.col w 0) \<Longrightarrow> Matrix.col (v \<Otimes> w) 0 $ ?i = (Matrix.col v 0 \<otimes> Matrix.col w 0) $ ?i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma v_eq: "cfg \<in> valid_cfg \<Longrightarrow>
    v cfg = emeasure (T cfg) {x\<in>space St. (HLD S1 suntil HLD S2) (state cfg ## x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cfg \<in> valid_cfg \<Longrightarrow> v cfg = emeasure (T cfg) {x \<in> space St. (HLD S1 suntil HLD S2) (state cfg ## x)}
[PROOF STEP]
by (auto simp add: v_def)


[STATEMENT]
lemma all_edges_between_Un1:
  "all_edges_between (X \<union> Y) Z G = all_edges_between X Z G \<union> all_edges_between Y Z G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between (X \<union> Y) Z G = all_edges_between X Z G \<union> all_edges_between Y Z G
[PROOF STEP]
by (auto simp: all_edges_between_def)


[STATEMENT]
lemma ANR_imp_absolute_neighbourhood_extensor:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "ANR S" and contf: "continuous_on T f" and "f ` T \<subseteq> S"
      and cloUT: "closedin (top_of_set U) T"
  obtains V g where "T \<subseteq> V" "openin (top_of_set U) V"
                    "continuous_on V g"
                    "g ` V \<subseteq> S" "\<And>x. x \<in> T \<Longrightarrow> g x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "aff_dim S < int (DIM('b \<times> real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S < int DIM('b \<times> real)
[PROOF STEP]
using aff_dim_le_DIM [of S]
[PROOF STATE]
proof (prove)
using this:
aff_dim S \<le> int DIM('b)

goal (1 subgoal):
 1. aff_dim S < int DIM('b \<times> real)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
aff_dim S < int DIM('b \<times> real)

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim S < int DIM('b \<times> real)
[PROOF STEP]
obtain C and S' :: "('b * real) set"
          where C: "convex C" "C \<noteq> {}"
            and cloCS: "closedin (top_of_set C) S'"
            and hom: "S homeomorphic S'"
[PROOF STATE]
proof (prove)
using this:
aff_dim S < int DIM('b \<times> real)

goal (1 subgoal):
 1. (\<And>C S'. \<lbrakk>convex C; C \<noteq> {}; closedin (top_of_set C) S'; S homeomorphic S'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis that homeomorphic_closedin_convex)
[PROOF STATE]
proof (state)
this:
convex C
C \<noteq> {}
closedin (top_of_set C) S'
S homeomorphic S'

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convex C
C \<noteq> {}
closedin (top_of_set C) S'
S homeomorphic S'
[PROOF STEP]
obtain D where opD: "openin (top_of_set C) D" and "S' retract_of D"
[PROOF STATE]
proof (prove)
using this:
convex C
C \<noteq> {}
closedin (top_of_set C) S'
S homeomorphic S'

goal (1 subgoal):
 1. (\<And>D. \<lbrakk>openin (top_of_set C) D; S' retract_of D\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>ANR S\<close>
[PROOF STATE]
proof (prove)
using this:
convex C
C \<noteq> {}
closedin (top_of_set C) S'
S homeomorphic S'
ANR S

goal (1 subgoal):
 1. (\<And>D. \<lbrakk>openin (top_of_set C) D; S' retract_of D\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: ANR_def)
[PROOF STATE]
proof (state)
this:
openin (top_of_set C) D
S' retract_of D

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set C) D
S' retract_of D
[PROOF STEP]
obtain r where "S' \<subseteq> D" and contr: "continuous_on D r"
                  and "r ` D \<subseteq> S'" and rid: "\<And>x. x \<in> S' \<Longrightarrow> r x = x"
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set C) D
S' retract_of D

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>S' \<subseteq> D; continuous_on D r; r ` D \<subseteq> S'; \<And>x. x \<in> S' \<Longrightarrow> r x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: retraction_def retract_of_def)
[PROOF STATE]
proof (state)
this:
S' \<subseteq> D
continuous_on D r
r ` D \<subseteq> S'
?x \<in> S' \<Longrightarrow> r ?x = ?x

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain g h where homgh: "homeomorphism S S' g h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g h. homeomorphism S S' g h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
S homeomorphic S'

goal (1 subgoal):
 1. (\<And>g h. homeomorphism S S' g h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: homeomorphic_def)
[PROOF STATE]
proof (state)
this:
homeomorphism S S' g h

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "continuous_on (f ` T) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (f ` T) g
[PROOF STEP]
by (meson \<open>f ` T \<subseteq> S\<close> continuous_on_subset homeomorphism_def homgh)
[PROOF STATE]
proof (state)
this:
continuous_on (f ` T) g

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (f ` T) g
[PROOF STEP]
have contgf: "continuous_on T (g \<circ> f)"
[PROOF STATE]
proof (prove)
using this:
continuous_on (f ` T) g

goal (1 subgoal):
 1. continuous_on T (g \<circ> f)
[PROOF STEP]
by (intro continuous_on_compose contf)
[PROOF STATE]
proof (state)
this:
continuous_on T (g \<circ> f)

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have gfTC: "(g \<circ> f) ` T \<subseteq> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ> f) ` T \<subseteq> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g \<circ> f) ` T \<subseteq> C
[PROOF STEP]
have "g ` S = S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` S = S'
[PROOF STEP]
by (metis (no_types) homeomorphism_def homgh)
[PROOF STATE]
proof (state)
this:
g ` S = S'

goal (1 subgoal):
 1. (g \<circ> f) ` T \<subseteq> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g ` S = S'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g ` S = S'

goal (1 subgoal):
 1. (g \<circ> f) ` T \<subseteq> C
[PROOF STEP]
by (metis (no_types) assms(3) cloCS closedin_def image_comp image_mono order.trans topspace_euclidean_subtopology)
[PROOF STATE]
proof (state)
this:
(g \<circ> f) ` T \<subseteq> C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(g \<circ> f) ` T \<subseteq> C

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain f' where contf': "continuous_on U f'"
              and "f' ` U \<subseteq> C"
              and eq: "\<And>x. x \<in> T \<Longrightarrow> f' x = (g \<circ> f) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f'. \<lbrakk>continuous_on U f'; f' ` U \<subseteq> C; \<And>x. x \<in> T \<Longrightarrow> f' x = (g \<circ> f) x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Dugundji [OF C cloUT contgf gfTC])
[PROOF STATE]
proof (state)
this:
continuous_on U f'
f' ` U \<subseteq> C
?x \<in> T \<Longrightarrow> f' ?x = (g \<circ> f) ?x

goal (1 subgoal):
 1. (\<And>V g. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V g; g ` V \<subseteq> S; \<And>x. x \<in> T \<Longrightarrow> g x = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof (rule_tac V = "U \<inter> f' -` D" and g = "h \<circ> r \<circ> f'" in that)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. T \<subseteq> U \<inter> f' -` D
 2. openin (top_of_set U) (U \<inter> f' -` D)
 3. continuous_on (U \<inter> f' -` D) (h \<circ> r \<circ> f')
 4. (h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S
 5. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
show "T \<subseteq> U \<inter> f' -` D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<subseteq> U \<inter> f' -` D
[PROOF STEP]
using cloUT closedin_imp_subset \<open>S' \<subseteq> D\<close> \<open>f ` T \<subseteq> S\<close> eq homeomorphism_image1 homgh
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set U) T
closedin (subtopology ?U ?S) ?T \<Longrightarrow> ?T \<subseteq> ?S
S' \<subseteq> D
f ` T \<subseteq> S
?x \<in> T \<Longrightarrow> f' ?x = (g \<circ> f) ?x
homeomorphism ?S ?T ?f ?g \<Longrightarrow> ?f ` ?S = ?T
homeomorphism S S' g h

goal (1 subgoal):
 1. T \<subseteq> U \<inter> f' -` D
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
T \<subseteq> U \<inter> f' -` D

goal (4 subgoals):
 1. openin (top_of_set U) (U \<inter> f' -` D)
 2. continuous_on (U \<inter> f' -` D) (h \<circ> r \<circ> f')
 3. (h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S
 4. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
show ope: "openin (top_of_set U) (U \<inter> f' -` D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set U) (U \<inter> f' -` D)
[PROOF STEP]
using  \<open>f' ` U \<subseteq> C\<close>
[PROOF STATE]
proof (prove)
using this:
f' ` U \<subseteq> C

goal (1 subgoal):
 1. openin (top_of_set U) (U \<inter> f' -` D)
[PROOF STEP]
by (auto simp: opD contf' continuous_openin_preimage)
[PROOF STATE]
proof (state)
this:
openin (top_of_set U) (U \<inter> f' -` D)

goal (3 subgoals):
 1. continuous_on (U \<inter> f' -` D) (h \<circ> r \<circ> f')
 2. (h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S
 3. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
have conth: "continuous_on (r ` f' ` (U \<inter> f' -` D)) h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (r ` f' ` (U \<inter> f' -` D)) h
[PROOF STEP]
proof (rule continuous_on_subset [of S'])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on S' h
 2. r ` f' ` (U \<inter> f' -` D) \<subseteq> S'
[PROOF STEP]
show "continuous_on S' h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S' h
[PROOF STEP]
using homeomorphism_def homgh
[PROOF STATE]
proof (prove)
using this:
homeomorphism ?s ?t ?f ?g = ((\<forall>x\<in>?s. ?g (?f x) = x) \<and> ?f ` ?s = ?t \<and> continuous_on ?s ?f \<and> (\<forall>y\<in>?t. ?f (?g y) = y) \<and> ?g ` ?t = ?s \<and> continuous_on ?t ?g)
homeomorphism S S' g h

goal (1 subgoal):
 1. continuous_on S' h
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on S' h

goal (1 subgoal):
 1. r ` f' ` (U \<inter> f' -` D) \<subseteq> S'
[PROOF STEP]
qed (use \<open>r ` D \<subseteq> S'\<close> in blast)
[PROOF STATE]
proof (state)
this:
continuous_on (r ` f' ` (U \<inter> f' -` D)) h

goal (3 subgoals):
 1. continuous_on (U \<inter> f' -` D) (h \<circ> r \<circ> f')
 2. (h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S
 3. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
show "continuous_on (U \<inter> f' -` D) (h \<circ> r \<circ> f')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (U \<inter> f' -` D) (h \<circ> r \<circ> f')
[PROOF STEP]
by (blast intro: continuous_on_compose conth continuous_on_subset [OF contr] continuous_on_subset [OF contf'])
[PROOF STATE]
proof (state)
this:
continuous_on (U \<inter> f' -` D) (h \<circ> r \<circ> f')

goal (2 subgoals):
 1. (h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S
 2. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
show "(h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S
[PROOF STEP]
using \<open>homeomorphism S S' g h\<close>  \<open>f' ` U \<subseteq> C\<close>  \<open>r ` D \<subseteq> S'\<close>
[PROOF STATE]
proof (prove)
using this:
homeomorphism S S' g h
f' ` U \<subseteq> C
r ` D \<subseteq> S'

goal (1 subgoal):
 1. (h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S
[PROOF STEP]
by (auto simp: homeomorphism_def)
[PROOF STATE]
proof (state)
this:
(h \<circ> r \<circ> f') ` (U \<inter> f' -` D) \<subseteq> S

goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
show "\<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
using \<open>homeomorphism S S' g h\<close> \<open>f ` T \<subseteq> S\<close> eq
[PROOF STATE]
proof (prove)
using this:
homeomorphism S S' g h
f ` T \<subseteq> S
?x \<in> T \<Longrightarrow> f' ?x = (g \<circ> f) ?x

goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') x = f x
[PROOF STEP]
by (auto simp: rid homeomorphism_def)
[PROOF STATE]
proof (state)
this:
?x \<in> T \<Longrightarrow> (h \<circ> r \<circ> f') ?x = f ?x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Ch_siso_ZObis[simp]:
assumes "compatCh ch" and "c1 \<approx>01 d1" and "c2 \<approx>01 d2"
shows "Ch ch c1 c2 \<approx>01 Ch ch d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ch ch c1 c2 \<approx>01 Ch ch d1 d2
[PROOF STEP]
using thetaZOCh_ZObis[OF assms]
[PROOF STATE]
proof (prove)
using this:
thetaZOCh ch c1 c2 d1 d2 \<subseteq> ZObis

goal (1 subgoal):
 1. Ch ch c1 c2 \<approx>01 Ch ch d1 d2
[PROOF STEP]
unfolding thetaZOCh_def
[PROOF STATE]
proof (prove)
using this:
{(Ch ch c1 c2, Ch ch d1 d2)} \<subseteq> ZObis

goal (1 subgoal):
 1. Ch ch c1 c2 \<approx>01 Ch ch d1 d2
[PROOF STEP]
by auto


[STATEMENT]
lemma sets_point_measure_count_space[measurable_cong]: "sets (point_measure A f) = sets (count_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (point_measure A f) = sets (count_space A)
[PROOF STEP]
by (simp add: sets_point_measure)


[STATEMENT]
lemma powrat_less_mono:
  assumes "r < s" and "1 < x"
  shows "x  pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
proof (cases r)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
case (Fract a b)
[PROOF STATE]
proof (state)
this:
r = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
assume r_assms: "r = Fract a b" "0 < b" "coprime a b"
[PROOF STATE]
proof (state)
this:
r = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r = Fract a b
0 < b
coprime a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
proof (cases s)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa ba. \<lbrakk>r = Fract a b; 0 < b; coprime a b; s = Fract aa ba; 0 < ba; coprime aa ba\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
case (Fract c d)
[PROOF STATE]
proof (state)
this:
s = Fract c d
0 < d
coprime c d

goal (1 subgoal):
 1. \<And>aa ba. \<lbrakk>r = Fract a b; 0 < b; coprime a b; s = Fract aa ba; 0 < ba; coprime aa ba\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
assume s_assms: "s = Fract c d" "0 < d" "coprime c d"
[PROOF STATE]
proof (state)
this:
s = Fract c d
0 < d
coprime c d

goal (1 subgoal):
 1. \<And>aa ba. \<lbrakk>r = Fract a b; 0 < b; coprime a b; s = Fract aa ba; 0 < ba; coprime aa ba\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
have adcb: "a * d < c * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * d < c * b
[PROOF STEP]
using assms r_assms s_assms
[PROOF STATE]
proof (prove)
using this:
r < s
1 < x
r = Fract a b
0 < b
coprime a b
s = Fract c d
0 < d
coprime c d

goal (1 subgoal):
 1. a * d < c * b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * d < c * b

goal (1 subgoal):
 1. \<And>aa ba. \<lbrakk>r = Fract a b; 0 < b; coprime a b; s = Fract aa ba; 0 < ba; coprime aa ba\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
have b_ba: "0 < nat (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < nat (b * d)
[PROOF STEP]
by (simp add: r_assms(2) s_assms(2))
[PROOF STATE]
proof (state)
this:
0 < nat (b * d)

goal (1 subgoal):
 1. \<And>aa ba. \<lbrakk>r = Fract a b; 0 < b; coprime a b; s = Fract aa ba; 0 < ba; coprime aa ba\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
have root0: "0 \<le> root (nat d) (x ^ nat c)"
                "0 \<le> root (nat d) (1 / x ^ nat (- c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> root (nat d) (x ^ nat c) &&& 0 \<le> root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
using assms(2) real_root_pos_pos_le
[PROOF STATE]
proof (prove)
using this:
1 < x
0 \<le> ?x \<Longrightarrow> 0 \<le> root ?n ?x

goal (1 subgoal):
 1. 0 \<le> root (nat d) (x ^ nat c) &&& 0 \<le> root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> root (nat d) (x ^ nat c)
0 \<le> root (nat d) (1 / x ^ nat (- c))

goal (1 subgoal):
 1. \<And>aa ba. \<lbrakk>r = Fract a b; 0 < b; coprime a b; s = Fract aa ba; 0 < ba; coprime aa ba\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> root (nat d) (x ^ nat c)
0 \<le> root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> root (nat d) (x ^ nat c)
0 \<le> root (nat d) (1 / x ^ nat (- c))

goal (1 subgoal):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
proof (auto simp add: powrat_def quotient_of_Fract zero_less_Fract_iff
                          s_assms r_assms)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
 3. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 4. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
assume ac0: "0 < a" "0 < c"
[PROOF STATE]
proof (state)
this:
0 < a
0 < c

goal (4 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
 3. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 4. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a
0 < c
[PROOF STEP]
have "(x ^ nat a) ^ nat d < (x ^ nat c) ^ nat b"
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < c

goal (1 subgoal):
 1. (x ^ nat a) ^ nat d < (x ^ nat c) ^ nat b
[PROOF STEP]
using adcb assms(2) r_assms(2) less_imp_le mult_pos_pos
              nat_mono_iff nat_mult_distrib power_mult
              power_strict_increasing
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < c
a * d < c * b
1 < x
0 < b
?x < ?y \<Longrightarrow> ?x \<le> ?y
\<lbrakk>(0::?'a) < ?a; (0::?'a) < ?b\<rbrakk> \<Longrightarrow> (0::?'a) < ?a * ?b
0 < ?z \<Longrightarrow> (nat ?w < nat ?z) = (?w < ?z)
0 \<le> ?z \<Longrightarrow> nat (?z * ?z') = nat ?z * nat ?z'
?a ^ (?m * ?n) = (?a ^ ?m) ^ ?n
\<lbrakk>?n < ?N; (1::?'a) < ?a\<rbrakk> \<Longrightarrow> ?a ^ ?n < ?a ^ ?N

goal (1 subgoal):
 1. (x ^ nat a) ^ nat d < (x ^ nat c) ^ nat b
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(x ^ nat a) ^ nat d < (x ^ nat c) ^ nat b

goal (4 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
 3. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 4. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x ^ nat a) ^ nat d < (x ^ nat c) ^ nat b
[PROOF STEP]
have "root (nat b) (x ^ nat a) ^ nat (b * d) <
                  root (nat d) (x ^ nat c) ^ nat (b * d)"
[PROOF STATE]
proof (prove)
using this:
(x ^ nat a) ^ nat d < (x ^ nat c) ^ nat b

goal (1 subgoal):
 1. root (nat b) (x ^ nat a) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
[PROOF STEP]
using assms r_assms s_assms ac0 real_root_power
              [symmetric] nat_mult_distrib
[PROOF STATE]
proof (prove)
using this:
(x ^ nat a) ^ nat d < (x ^ nat c) ^ nat b
r < s
1 < x
r = Fract a b
0 < b
coprime a b
s = Fract c d
0 < d
coprime c d
0 < a
0 < c
0 < ?n \<Longrightarrow> root ?n ?x ^ ?k = root ?n (?x ^ ?k)
0 \<le> ?z \<Longrightarrow> nat (?z * ?z') = nat ?z * nat ?z'

goal (1 subgoal):
 1. root (nat b) (x ^ nat a) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
[PROOF STEP]
by (auto simp add:  power_mult)
[PROOF STATE]
proof (state)
this:
root (nat b) (x ^ nat a) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)

goal (4 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
 3. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 4. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
root (nat b) (x ^ nat a) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
[PROOF STEP]
show "root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)"
[PROOF STATE]
proof (prove)
using this:
root (nat b) (x ^ nat a) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)

goal (1 subgoal):
 1. root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)
[PROOF STEP]
using power_less_imp_less_base root0(1)
[PROOF STATE]
proof (prove)
using this:
root (nat b) (x ^ nat a) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
\<lbrakk>?a ^ ?n < ?b ^ ?n; (0::?'a) \<le> ?b\<rbrakk> \<Longrightarrow> ?a < ?b
0 \<le> root (nat d) (x ^ nat c)

goal (1 subgoal):
 1. root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
root (nat b) (x ^ nat a) < root (nat d) (x ^ nat c)

goal (3 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat (- c); 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
 2. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 3. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat (- c); 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
 2. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 3. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
assume "0 < a" "\<not> 0 < c"
[PROOF STATE]
proof (state)
this:
0 < a
\<not> 0 < c

goal (3 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat (- c); 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
 2. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 3. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a
\<not> 0 < c
[PROOF STEP]
show "root (nat b) (x ^ nat a) <
                  root (nat d) (1 / x ^ nat (- c))"
[PROOF STATE]
proof (prove)
using this:
0 < a
\<not> 0 < c

goal (1 subgoal):
 1. root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
using assms(1) less_trans r_assms(1) r_assms(2) s_assms(1)
              s_assms(2) zero_less_Fract_iff
[PROOF STATE]
proof (prove)
using this:
0 < a
\<not> 0 < c
r < s
\<lbrakk>?x < ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z
r = Fract a b
0 < b
s = Fract c d
0 < d
0 < ?b \<Longrightarrow> (0 < Fract ?a ?b) = (0 < ?a)

goal (1 subgoal):
 1. root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
root (nat b) (x ^ nat a) < root (nat d) (1 / x ^ nat (- c))

goal (2 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
assume ac0: "\<not> 0 < a" "0 < c"
[PROOF STATE]
proof (state)
this:
\<not> 0 < a
0 < c

goal (2 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < a
0 < c
[PROOF STEP]
have "a = 0 \<or> a < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < a
0 < c

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

goal (2 subgoals):
 1. \<lbrakk>0 \<le> x ^ nat c; \<not> 0 < a; 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 2. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0 \<or> a < 0
[PROOF STEP]
show "root (nat b) (1 / x ^ nat (- a)) <
                  root (nat d) (x ^ nat c)"
[PROOF STATE]
proof (prove)
using this:
a = 0 \<or> a < 0

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 2. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
assume "a = 0"
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
 2. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
by (simp add: ac0(2) assms(2) r_assms(2) s_assms(2))
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)

goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
assume a0: "a < 0"
[PROOF STATE]
proof (state)
this:
a < 0

goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
have "(1 / x ^ nat (- a)) ^ nat d < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / x ^ nat (- a)) ^ nat d < 1
[PROOF STEP]
using a0 s_assms(2) assms(2) adcb power_mult [symmetric]
                power_one_over nat_mult_distrib [symmetric]
[PROOF STATE]
proof (prove)
using this:
a < 0
0 < d
1 < x
a * d < c * b
(?a ^ ?m) ^ ?n = ?a ^ (?m * ?n)
((1::?'a) / ?a) ^ ?n = (1::?'a) / ?a ^ ?n
0 \<le> ?z \<Longrightarrow> nat ?z * nat ?z' = nat (?z * ?z')

goal (1 subgoal):
 1. (1 / x ^ nat (- a)) ^ nat d < 1
[PROOF STEP]
by (metis (no_types) eq_divide_eq_1 inverse_eq_divide inverse_le_1_iff
              le_less neg_0_less_iff_less one_less_power power_one_over
              zero_less_nat_eq)
[PROOF STATE]
proof (state)
this:
(1 / x ^ nat (- a)) ^ nat d < 1

goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(1 / x ^ nat (- a)) ^ nat d < 1

goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
have "1 < (x ^ nat c) ^ nat b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < (x ^ nat c) ^ nat b
[PROOF STEP]
by (simp add: ac0(2) assms(2) r_assms(2))
[PROOF STATE]
proof (state)
this:
1 < (x ^ nat c) ^ nat b

goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(1 / x ^ nat (- a)) ^ nat d < 1
1 < (x ^ nat c) ^ nat b
[PROOF STEP]
have "(1 / x ^ nat (- a)) ^ nat d < (x ^ nat c) ^ nat b"
[PROOF STATE]
proof (prove)
using this:
(1 / x ^ nat (- a)) ^ nat d < 1
1 < (x ^ nat c) ^ nat b

goal (1 subgoal):
 1. (1 / x ^ nat (- a)) ^ nat d < (x ^ nat c) ^ nat b
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(1 / x ^ nat (- a)) ^ nat d < (x ^ nat c) ^ nat b

goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 / x ^ nat (- a)) ^ nat d < (x ^ nat c) ^ nat b
[PROOF STEP]
have "root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d)
                    < root (nat d) (x ^ nat c) ^ nat (b * d)"
[PROOF STATE]
proof (prove)
using this:
(1 / x ^ nat (- a)) ^ nat d < (x ^ nat c) ^ nat b

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
[PROOF STEP]
using  assms r_assms s_assms ac0 real_root_power [symmetric] nat_mult_distrib
[PROOF STATE]
proof (prove)
using this:
(1 / x ^ nat (- a)) ^ nat d < (x ^ nat c) ^ nat b
r < s
1 < x
r = Fract a b
0 < b
coprime a b
s = Fract c d
0 < d
coprime c d
\<not> 0 < a
0 < c
0 < ?n \<Longrightarrow> root ?n ?x ^ ?k = root ?n (?x ^ ?k)
0 \<le> ?z \<Longrightarrow> nat (?z * ?z') = nat ?z * nat ?z'

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
[PROOF STEP]
by (auto simp add:  power_mult)
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)

goal (1 subgoal):
 1. a < 0 \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
using power_less_imp_less_base root0(1)
[PROOF STATE]
proof (prove)
using this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (x ^ nat c) ^ nat (b * d)
\<lbrakk>?a ^ ?n < ?b ^ ?n; (0::?'a) \<le> ?b\<rbrakk> \<Longrightarrow> ?a < ?b
0 \<le> root (nat d) (x ^ nat c)

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) < root (nat d) (x ^ nat c)

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
assume ac0: "\<not> 0 < a" "\<not> 0 < c"
[PROOF STATE]
proof (state)
this:
\<not> 0 < a
\<not> 0 < c

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x ^ nat (- c); \<not> 0 < a; \<not> 0 < c\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < a
\<not> 0 < c
[PROOF STEP]
show "root (nat b) (1 / x ^ nat (- a)) <
                  root (nat d) (1 / x ^ nat (- c))"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < a
\<not> 0 < c

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
proof (cases "a = 0 \<or> c = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; a = 0 \<or> c = 0\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
 2. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
assume "a = 0 \<or> c = 0"
[PROOF STATE]
proof (state)
this:
a = 0 \<or> c = 0

goal (2 subgoals):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; a = 0 \<or> c = 0\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
 2. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0 \<or> c = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0 \<or> c = 0

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
using assms r_assms s_assms adcb ac0
[PROOF STATE]
proof (prove)
using this:
a = 0 \<or> c = 0
r < s
1 < x
r = Fract a b
0 < b
coprime a b
s = Fract c d
0 < d
coprime c d
a * d < c * b
\<not> 0 < a
\<not> 0 < c

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
by (auto simp add: not_less le_less)
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))

goal (1 subgoal):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
assume "\<not> (a = 0 \<or> c = 0)"
[PROOF STATE]
proof (state)
this:
\<not> (a = 0 \<or> c = 0)

goal (1 subgoal):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (a = 0 \<or> c = 0)
[PROOF STEP]
have ac00: "a < 0" "c < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<or> c = 0)

goal (1 subgoal):
 1. a < 0 &&& c < 0
[PROOF STEP]
using ac0
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<or> c = 0)
\<not> 0 < a
\<not> 0 < c

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

goal (1 subgoal):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < 0
c < 0
[PROOF STEP]
have "1 / x ^ nat (- (a * d)) <
                    1 / x ^ nat (- (c * b))"
[PROOF STATE]
proof (prove)
using this:
a < 0
c < 0

goal (1 subgoal):
 1. 1 / x ^ nat (- (a * d)) < 1 / x ^ nat (- (c * b))
[PROOF STEP]
using ac00 r_assms s_assms assms
[PROOF STATE]
proof (prove)
using this:
a < 0
c < 0
a < 0
c < 0
r = Fract a b
0 < b
coprime a b
s = Fract c d
0 < d
coprime c d
r < s
1 < x

goal (1 subgoal):
 1. 1 / x ^ nat (- (a * d)) < 1 / x ^ nat (- (c * b))
[PROOF STEP]
by (simp add: divide_inverse mult_pos_neg2)
[PROOF STATE]
proof (state)
this:
1 / x ^ nat (- (a * d)) < 1 / x ^ nat (- (c * b))

goal (1 subgoal):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 / x ^ nat (- (a * d)) < 1 / x ^ nat (- (c * b))
[PROOF STEP]
have "(1 / x ^ nat (- a)) ^ nat d <
                    (1 / x ^ nat (- c)) ^ nat b"
[PROOF STATE]
proof (prove)
using this:
1 / x ^ nat (- (a * d)) < 1 / x ^ nat (- (c * b))

goal (1 subgoal):
 1. (1 / x ^ nat (- a)) ^ nat d < (1 / x ^ nat (- c)) ^ nat b
[PROOF STEP]
using s_assms r_assms  ac00
[PROOF STATE]
proof (prove)
using this:
1 / x ^ nat (- (a * d)) < 1 / x ^ nat (- (c * b))
s = Fract c d
0 < d
coprime c d
r = Fract a b
0 < b
coprime a b
a < 0
c < 0

goal (1 subgoal):
 1. (1 / x ^ nat (- a)) ^ nat d < (1 / x ^ nat (- c)) ^ nat b
[PROOF STEP]
by (auto simp add: power_mult [symmetric]
                power_one_over nat_mult_distrib [symmetric])
[PROOF STATE]
proof (state)
this:
(1 / x ^ nat (- a)) ^ nat d < (1 / x ^ nat (- c)) ^ nat b

goal (1 subgoal):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 / x ^ nat (- a)) ^ nat d < (1 / x ^ nat (- c)) ^ nat b
[PROOF STEP]
have "root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d)
                   < root (nat d) (1 / x ^ nat (- c)) ^ nat (b * d)"
[PROOF STATE]
proof (prove)
using this:
(1 / x ^ nat (- a)) ^ nat d < (1 / x ^ nat (- c)) ^ nat b

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (1 / x ^ nat (- c)) ^ nat (b * d)
[PROOF STEP]
using assms r_assms s_assms ac0 real_root_power [symmetric]
                nat_mult_distrib
[PROOF STATE]
proof (prove)
using this:
(1 / x ^ nat (- a)) ^ nat d < (1 / x ^ nat (- c)) ^ nat b
r < s
1 < x
r = Fract a b
0 < b
coprime a b
s = Fract c d
0 < d
coprime c d
\<not> 0 < a
\<not> 0 < c
0 < ?n \<Longrightarrow> root ?n ?x ^ ?k = root ?n (?x ^ ?k)
0 \<le> ?z \<Longrightarrow> nat (?z * ?z') = nat ?z * nat ?z'

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (1 / x ^ nat (- c)) ^ nat (b * d)
[PROOF STEP]
by (auto simp add:  power_mult)
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (1 / x ^ nat (- c)) ^ nat (b * d)

goal (1 subgoal):
 1. \<lbrakk>\<not> 0 < a; \<not> 0 < c; \<not> (a = 0 \<or> c = 0)\<rbrakk> \<Longrightarrow> root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (1 / x ^ nat (- c)) ^ nat (b * d)
[PROOF STEP]
show "root (nat b) (1 / x ^ nat (- a)) <
                  root (nat d) (1 / x ^ nat (- c))"
[PROOF STATE]
proof (prove)
using this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (1 / x ^ nat (- c)) ^ nat (b * d)

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
using power_less_imp_less_base root0(2)
[PROOF STATE]
proof (prove)
using this:
root (nat b) (1 / x ^ nat (- a)) ^ nat (b * d) < root (nat d) (1 / x ^ nat (- c)) ^ nat (b * d)
\<lbrakk>?a ^ ?n < ?b ^ ?n; (0::?'a) \<le> ?b\<rbrakk> \<Longrightarrow> ?a < ?b
0 \<le> root (nat d) (1 / x ^ nat (- c))

goal (1 subgoal):
 1. root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
root (nat b) (1 / x ^ nat (- a)) < root (nat d) (1 / x ^ nat (- c))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lexord_eq_fusion_code:
  "lexord_eq_fusion g1 g2 s1 s2 \<longleftrightarrow>
  (case generator g1 s1 of
     Done \<Rightarrow> True
   | Skip s1' \<Rightarrow> lexord_eq_fusion g1 g2 s1' s2
   | Yield x s1' \<Rightarrow>
     (case force g2 s2 of
        None \<Rightarrow> False
      | Some (y, s2') \<Rightarrow> x < y \<or> \<not> y < x \<and> lexord_eq_fusion g1 g2 s1' s2'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lexord_eq_fusion g1 g2 s1 s2 = (case generator g1 s1 of Done \<Rightarrow> True | Skip s1' \<Rightarrow> lexord_eq_fusion g1 g2 s1' s2 | Yield x s1' \<Rightarrow> case force g2 s2 of None \<Rightarrow> False | Some (y, s2') \<Rightarrow> x < y \<or> \<not> y < x \<and> lexord_eq_fusion g1 g2 s1' s2')
[PROOF STEP]
unfolding lexord_eq_fusion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lexordp_eq (unstream g1 s1) (unstream g2 s2) = (case generator g1 s1 of Done \<Rightarrow> True | Skip s1' \<Rightarrow> lexordp_eq (unstream g1 s1') (unstream g2 s2) | Yield x s1' \<Rightarrow> case force g2 s2 of None \<Rightarrow> False | Some (y, s2') \<Rightarrow> x < y \<or> \<not> y < x \<and> lexordp_eq (unstream g1 s1') (unstream g2 s2'))
[PROOF STEP]
by(cases "generator g1 s1" "force g2 s2" rule: step.exhaust[case_product option.exhaust]) auto


[STATEMENT]
lemma balance_right_in_tree:
  assumes "inv1 l" "inv1l r" "bheight l = bheight r + 1" "inv2 l" "inv2 r"
  shows "entry_in_tree x y (balance_right l k v r) = (entry_in_tree x y l \<or> x = k \<and> y = v \<or> entry_in_tree x y r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> set (entries (balance_right l k v r))) = ((x, y) \<in> set (entries l) \<or> x = k \<and> y = v \<or> (x, y) \<in> set (entries r))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inv1 l
inv1l r
bheight l = bheight r + 1
inv2 l
inv2 r

goal (1 subgoal):
 1. ((x, y) \<in> set (entries (balance_right l k v r))) = ((x, y) \<in> set (entries l) \<or> x = k \<and> y = v \<or> (x, y) \<in> set (entries r))
[PROOF STEP]
by (induct l k v r rule: balance_right.induct) (auto simp: balance_in_tree)


[STATEMENT]
lemma ntrs_is_trss: "((s,c),w,(s',c'))\<in>trcl (ntrs fg)
  \<Longrightarrow> ((s,c),foldl (@) [] w,(s',c'))\<in>trcl (trss fg)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((s, c), w, s', c') \<in> trcl (ntrs fg) \<Longrightarrow> ((s, c), foldl (@) [] w, s', c') \<in> trcl (trss fg)
[PROOF STEP]
proof (induct rule: trcl_pair_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. ((a, b), foldl (@) [] [], a, b) \<in> trcl (trss fg)
 2. \<And>a b aa ab ba w ac bb. \<lbrakk>((a, b), aa, ab, ba) \<in> ntrs fg; ((ab, ba), w, ac, bb) \<in> trcl (ntrs fg); ((ab, ba), foldl (@) [] w, ac, bb) \<in> trcl (trss fg)\<rbrakk> \<Longrightarrow> ((a, b), foldl (@) [] (aa # w), ac, bb) \<in> trcl (trss fg)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a b. ((a, b), foldl (@) [] [], a, b) \<in> trcl (trss fg)
 2. \<And>a b aa ab ba w ac bb. \<lbrakk>((a, b), aa, ab, ba) \<in> ntrs fg; ((ab, ba), w, ac, bb) \<in> trcl (ntrs fg); ((ab, ba), foldl (@) [] w, ac, bb) \<in> trcl (trss fg)\<rbrakk> \<Longrightarrow> ((a, b), foldl (@) [] (aa # w), ac, bb) \<in> trcl (trss fg)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a_, b_), foldl (@) [] [], a_, b_) \<in> trcl (trss fg)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((a_, b_), foldl (@) [] [], a_, b_) \<in> trcl (trss fg)

goal (1 subgoal):
 1. \<And>a b aa ab ba w ac bb. \<lbrakk>((a, b), aa, ab, ba) \<in> ntrs fg; ((ab, ba), w, ac, bb) \<in> trcl (ntrs fg); ((ab, ba), foldl (@) [] w, ac, bb) \<in> trcl (trss fg)\<rbrakk> \<Longrightarrow> ((a, b), foldl (@) [] (aa # w), ac, bb) \<in> trcl (trss fg)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b aa ab ba w ac bb. \<lbrakk>((a, b), aa, ab, ba) \<in> ntrs fg; ((ab, ba), w, ac, bb) \<in> trcl (ntrs fg); ((ab, ba), foldl (@) [] w, ac, bb) \<in> trcl (trss fg)\<rbrakk> \<Longrightarrow> ((a, b), foldl (@) [] (aa # w), ac, bb) \<in> trcl (trss fg)
[PROOF STEP]
case (cons s c e sh ch w s' c')
[PROOF STATE]
proof (state)
this:
((s, c), e, sh, ch) \<in> ntrs fg
((sh, ch), w, s', c') \<in> trcl (ntrs fg)
((sh, ch), foldl (@) [] w, s', c') \<in> trcl (trss fg)

goal (1 subgoal):
 1. \<And>a b aa ab ba w ac bb. \<lbrakk>((a, b), aa, ab, ba) \<in> ntrs fg; ((ab, ba), w, ac, bb) \<in> trcl (ntrs fg); ((ab, ba), foldl (@) [] w, ac, bb) \<in> trcl (trss fg)\<rbrakk> \<Longrightarrow> ((a, b), foldl (@) [] (aa # w), ac, bb) \<in> trcl (trss fg)
[PROOF STEP]
note IHP=this
[PROOF STATE]
proof (state)
this:
((s, c), e, sh, ch) \<in> ntrs fg
((sh, ch), w, s', c') \<in> trcl (ntrs fg)
((sh, ch), foldl (@) [] w, s', c') \<in> trcl (trss fg)

goal (1 subgoal):
 1. \<And>a b aa ab ba w ac bb. \<lbrakk>((a, b), aa, ab, ba) \<in> ntrs fg; ((ab, ba), w, ac, bb) \<in> trcl (ntrs fg); ((ab, ba), foldl (@) [] w, ac, bb) \<in> trcl (trss fg)\<rbrakk> \<Longrightarrow> ((a, b), foldl (@) [] (aa # w), ac, bb) \<in> trcl (trss fg)
[PROOF STEP]
from trcl_concat[OF ntrs_is_trss_s[OF IHP(1)] IHP(3)] foldl_conc_empty_eq[of e w]
[PROOF STATE]
proof (chain)
picking this:
((s, c), e @ foldl (@) [] w, s', c') \<in> trcl (trss fg)
foldl (@) e w = e @ foldl (@) [] w
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
((s, c), e @ foldl (@) [] w, s', c') \<in> trcl (trss fg)
foldl (@) e w = e @ foldl (@) [] w

goal (1 subgoal):
 1. ((s, c), foldl (@) [] (e # w), s', c') \<in> trcl (trss fg)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((s, c), foldl (@) [] (e # w), s', c') \<in> trcl (trss fg)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wlog_sym_element:
  assumes symmetric_rel: "\<And>a b I. Q I a b \<Longrightarrow> Q I b a"
      and one_endpoint: "\<And>a b x I. \<lbrakk>Q I a b; x=a\<rbrakk> \<Longrightarrow> P x I"
    shows other_endpoint: "\<And>a b x I. \<lbrakk>Q I a b; x=b\<rbrakk> \<Longrightarrow> P x I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x I. \<lbrakk>Q I a b; x = b\<rbrakk> \<Longrightarrow> P x I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Q ?I ?a ?b \<Longrightarrow> Q ?I ?b ?a
\<lbrakk>Q ?I ?a ?b; ?x = ?a\<rbrakk> \<Longrightarrow> P ?x ?I

goal (1 subgoal):
 1. \<And>a b x I. \<lbrakk>Q I a b; x = b\<rbrakk> \<Longrightarrow> P x I
[PROOF STEP]
by fastforce


[STATEMENT]
lemma safe_regex_mono:
  "(\<And>g x. x \<in> atms r \<Longrightarrow> safe g x \<Longrightarrow> safe' g x) \<Longrightarrow>
  Regex.safe_regex fv safe m g r \<Longrightarrow> Regex.safe_regex fv safe' m g r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>g x. \<lbrakk>x \<in> atms r; safe g x\<rbrakk> \<Longrightarrow> safe' g x; Regex.safe_regex fv safe m g r\<rbrakk> \<Longrightarrow> Regex.safe_regex fv safe' m g r
[PROOF STEP]
by (induct m g r rule: safe_regex.induct) auto


[STATEMENT]
lemma path_component_unique:
  assumes "x \<in> c" "c \<subseteq> S" "path_connected c"
          "\<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; path_connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c"
   shows "path_component_set S x = c"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_set S x = c
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_component_set S x \<subseteq> c
 2. c \<subseteq> path_component_set S x
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_set S x \<subseteq> c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> c
c \<subseteq> S
path_connected c
\<lbrakk>x \<in> ?c'; ?c' \<subseteq> S; path_connected ?c'\<rbrakk> \<Longrightarrow> ?c' \<subseteq> c

goal (1 subgoal):
 1. path_component_set S x \<subseteq> c
[PROOF STEP]
by (metis mem_Collect_eq path_component_refl path_component_subset path_connected_path_component subsetD)
[PROOF STATE]
proof (state)
this:
path_component_set S x \<subseteq> c

goal (1 subgoal):
 1. c \<subseteq> path_component_set S x
[PROOF STEP]
qed (simp add: assms path_component_maximal)


[STATEMENT]
lemma bigo_lesso5: "f <o g =o O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x <= g x + C * \<bar>h x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f <o g \<in> O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>
[PROOF STEP]
apply (simp only: lesso_def bigo_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. max (f x - g x) (0::'b)) \<in> {ha. \<exists>c>0::'b. \<forall>x. \<bar>ha x\<bar> \<le> c * \<bar>h x\<bar>} \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>(0::'b) < c; \<forall>x. f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>
[PROOF STEP]
by (metis add.commute diff_le_eq)


[STATEMENT]
lemma (in PolynRg) polyn_minus:"\<lbrakk>pol_coeff S c; k \<le> (fst c)\<rbrakk> \<Longrightarrow>
       -\<^sub>a (polyn_expr R X k c) =
                    polyn_expr R X k (fst c, (\<lambda>j. (-\<^sub>a\<^bsub>S\<^esub> ((snd c) j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pol_coeff S c; k \<le> fst c\<rbrakk> \<Longrightarrow> -\<^sub>a polyn_expr R X k c = polyn_expr R X k (fst c, \<lambda>j. -\<^sub>a\<^bsub>S\<^esub> snd c j)
[PROOF STEP]
apply (cases c)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>pol_coeff S c; k \<le> fst c; c = (a, b)\<rbrakk> \<Longrightarrow> -\<^sub>a polyn_expr R X k c = polyn_expr R X k (fst c, \<lambda>j. -\<^sub>a\<^bsub>S\<^esub> snd c j)
[PROOF STEP]
apply (subst polyn_minus_nsum)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b. \<lbrakk>pol_coeff S c; k \<le> fst c; c = (a, b)\<rbrakk> \<Longrightarrow> pol_coeff S c
 2. \<And>a b. \<lbrakk>pol_coeff S c; k \<le> fst c; c = (a, b)\<rbrakk> \<Longrightarrow> k \<le> fst c
 3. \<And>a b. \<lbrakk>pol_coeff S c; k \<le> fst c; c = (a, b)\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R (\<lambda>j. (-\<^sub>a\<^bsub>S\<^esub> snd c j) \<cdot>\<^sub>r X^\<^bsup>R j\<^esup>) k = polyn_expr R X k (fst c, \<lambda>j. -\<^sub>a\<^bsub>S\<^esub> snd c j)
[PROOF STEP]
apply (simp_all add: polyn_expr_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma monomials_of_add_finite:
  assumes "finite (monomials_of R P)"
  assumes "finite (monomials_of R Q)"
  shows "finite (monomials_of R (P \<Oplus> Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (monomials_of R (P \<Oplus> Q))
[PROOF STEP]
by (meson assms(1) assms(2) finite_Un finite_subset monomials_of_add)