[STATEMENT]
lemma partition_by_nth_greater:
  assumes "i < k" and "k < length zs" and "j < zs ! i"
    and "length xs = sum_list (take i zs) + j"
  shows "partition_by (xs @ y # ys) zs ! k =
    take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
have "partition_by (xs @ y # ys) zs ! k =
    take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < k
k < length zs
j < zs ! i
length xs = sum_list (take i zs) + j

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
[PROOF STEP]
by (auto simp: partition_by_nth)
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
have "sum_list (take k zs) > length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs < sum_list (take k zs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < k
k < length zs
j < zs ! i
length xs = sum_list (take i zs) + j

goal (1 subgoal):
 1. length xs < sum_list (take k zs)
[PROOF STEP]
by (auto simp: sum_list_take_eq)
[PROOF STATE]
proof (state)
this:
length xs < sum_list (take k zs)

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
length xs < sum_list (take k zs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
length xs < sum_list (take k zs)

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
by (auto) (metis Suc_diff_Suc drop_Suc_Cons)
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_interval_power: "real_interval (a ^ b) = real_interval a ^ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_interval (a ^ b) = real_interval a ^ b
[PROOF STEP]
by (induction b arbitrary: a)
    (auto simp: real_interval_times real_interval_one)


[STATEMENT]
lemma fsymsPB_Un[simp]: "fsymsPB (\<Phi>1 \<union> \<Phi>2) = fsymsPB \<Phi>1 \<union> fsymsPB \<Phi>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fsymsPB (\<Phi>1 \<union> \<Phi>2) = fsymsPB \<Phi>1 \<union> fsymsPB \<Phi>2
[PROOF STEP]
unfolding fsymsPB_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {fsymsC c |c. c \<in> \<Phi>1 \<union> \<Phi>2} = \<Union> {fsymsC c |c. c \<in> \<Phi>1} \<union> \<Union> {fsymsC c |c. c \<in> \<Phi>2}
[PROOF STEP]
by auto


[STATEMENT]
lemma Derives1_leftmost:
  assumes "Derives1 a i r b"
  shows "\<exists> j. leftmost j a \<and> j \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
let ?J = "{j . j < length a \<and> is_nonterminal (a ! j)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
let ?M = "Min ?J"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Derives1 a i r b
[PROOF STEP]
have J1:"i \<in> ?J"
[PROOF STATE]
proof (prove)
using this:
Derives1 a i r b

goal (1 subgoal):
 1. i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
[PROOF STEP]
apply (auto simp add: Derives1_def is_nonterminal_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y N \<alpha>. \<lbrakk>a = x @ N # y; b = x @ \<alpha> @ y; is_sentence x; is_sentence y; (N, \<alpha>) \<in> \<RR>; r = (N, \<alpha>); i = length x\<rbrakk> \<Longrightarrow> N \<in> \<NN>
[PROOF STEP]
by (metis (mono_tags, lifting) prod.simps(2) validRules)
[PROOF STATE]
proof (state)
this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
have J2:"finite ?J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {j. j < length a \<and> is_nonterminal (a ! j)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
note J = J1 J2
[PROOF STATE]
proof (state)
this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
finite {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
from J
[PROOF STATE]
proof (chain)
picking this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
finite {j. j < length a \<and> is_nonterminal (a ! j)}
[PROOF STEP]
have M1: "?M \<in> ?J"
[PROOF STATE]
proof (prove)
using this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
finite {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. Min {j. j < length a \<and> is_nonterminal (a ! j)} \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
[PROOF STEP]
by (rule_tac Min_in, auto)
[PROOF STATE]
proof (state)
this:
Min {j. j < length a \<and> is_nonterminal (a ! j)} \<in> {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Min {j. j < length a \<and> is_nonterminal (a ! j)} \<in> {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
assume "j \<in> ?J"
[PROOF STATE]
proof (state)
this:
j \<in> {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
with J
[PROOF STATE]
proof (chain)
picking this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
finite {j. j < length a \<and> is_nonterminal (a ! j)}
j \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
[PROOF STEP]
have "?M \<le> j"
[PROOF STATE]
proof (prove)
using this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
finite {j. j < length a \<and> is_nonterminal (a ! j)}
j \<in> {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. Min {j. j < length a \<and> is_nonterminal (a ! j)} \<le> j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min {j. j < length a \<and> is_nonterminal (a ! j)} \<le> j

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?j2 \<in> {j. j < length a \<and> is_nonterminal (a ! j)} \<Longrightarrow> Min {j. j < length a \<and> is_nonterminal (a ! j)} \<le> ?j2

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
note M3 = this[OF J1]
[PROOF STATE]
proof (state)
this:
Min {j. j < length a \<and> is_nonterminal (a ! j)} \<le> i

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Derives1 a i r b
[PROOF STEP]
have a_sentence: "is_sentence a"
[PROOF STATE]
proof (prove)
using this:
Derives1 a i r b

goal (1 subgoal):
 1. is_sentence a
[PROOF STEP]
by (simp add: Derives1_sentence1)
[PROOF STATE]
proof (state)
this:
is_sentence a

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
have is_word: "is_word (take ?M a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word (take (Min {j. j < length a \<and> is_nonterminal (a ! j)}) a)
[PROOF STEP]
apply (auto simp add: is_word_def list_all_take)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < Min {j. j < length a \<and> is_nonterminal (a ! j)}; i < length a\<rbrakk> \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < Min {j. j < length a \<and> is_nonterminal (a ! j)}; i < length a\<rbrakk> \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < Min {j. j < length a \<and> is_nonterminal (a ! j)}; i < length a\<rbrakk> \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
assume i_less_M: "i < ?M"
[PROOF STATE]
proof (state)
this:
i < Min {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < Min {j. j < length a \<and> is_nonterminal (a ! j)}; i < length a\<rbrakk> \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
assume i_inbounds: "i < length a"
[PROOF STATE]
proof (state)
this:
i < length a

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < Min {j. j < length a \<and> is_nonterminal (a ! j)}; i < length a\<rbrakk> \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
show "is_terminal (a ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_terminal (a ! i)
[PROOF STEP]
proof(cases "is_terminal (a ! i)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
 2. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
is_terminal (a ! i)

goal (2 subgoals):
 1. is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
 2. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_terminal (a ! i)

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

goal (1 subgoal):
 1. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> is_terminal (a ! i)

goal (1 subgoal):
 1. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> is_terminal (a ! i)
[PROOF STEP]
have "is_nonterminal (a ! i)"
[PROOF STATE]
proof (prove)
using this:
\<not> is_terminal (a ! i)

goal (1 subgoal):
 1. is_nonterminal (a ! i)
[PROOF STEP]
using i_inbounds a_sentence is_sentence_symbol is_symbol_distinct
[PROOF STATE]
proof (prove)
using this:
\<not> is_terminal (a ! i)
i < length a
is_sentence a
\<lbrakk>is_sentence ?a; ?i < length ?a\<rbrakk> \<Longrightarrow> is_symbol (?a ! ?i)
is_symbol ?x \<Longrightarrow> is_terminal ?x \<noteq> is_nonterminal ?x

goal (1 subgoal):
 1. is_nonterminal (a ! i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_nonterminal (a ! i)

goal (1 subgoal):
 1. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_nonterminal (a ! i)
[PROOF STEP]
have "i \<in> ?J"
[PROOF STATE]
proof (prove)
using this:
is_nonterminal (a ! i)

goal (1 subgoal):
 1. i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
[PROOF STEP]
by (metis i_inbounds mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}
[PROOF STEP]
have "?M < i"
[PROOF STATE]
proof (prove)
using this:
i \<in> {j. j < length a \<and> is_nonterminal (a ! j)}

goal (1 subgoal):
 1. Min {j. j < length a \<and> is_nonterminal (a ! j)} < i
[PROOF STEP]
by (metis J2 Min_le i_less_M leD)
[PROOF STATE]
proof (state)
this:
Min {j. j < length a \<and> is_nonterminal (a ! j)} < i

goal (1 subgoal):
 1. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Min {j. j < length a \<and> is_nonterminal (a ! j)} < i
[PROOF STEP]
have "False"
[PROOF STATE]
proof (prove)
using this:
Min {j. j < length a \<and> is_nonterminal (a ! j)} < i

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis i_less_M less_asym')
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<not> is_terminal (a ! i) \<Longrightarrow> is_terminal (a ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
False

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_word (take (Min {j. j < length a \<and> is_nonterminal (a ! j)}) a)

goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. leftmost j a \<and> j \<le> i
[PROOF STEP]
apply (rule_tac exI[where x="?M"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. leftmost (Min {j. j < length a \<and> is_nonterminal (a ! j)}) a \<and> Min {j. j < length a \<and> is_nonterminal (a ! j)} \<le> i
[PROOF STEP]
apply (simp add: leftmost_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {j. j < length a \<and> is_nonterminal (a ! j)} < length a \<and> is_word (take (Min {j. j < length a \<and> is_nonterminal (a ! j)}) a) \<and> is_nonterminal (a ! Min {j. j < length a \<and> is_nonterminal (a ! j)}) \<and> Min {j. j < length a \<and> is_nonterminal (a ! j)} \<le> i
[PROOF STEP]
by (metis (mono_tags, lifting) M1 M3 is_word mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
\<exists>j. leftmost j a \<and> j \<le> i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_mult: "summable f \<Longrightarrow> suminf (\<lambda>n. c * f n) = c * suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<Sum>n. c * f n) = c * suminf f
[PROOF STEP]
by (rule bounded_linear.suminf [OF bounded_linear_mult_right, symmetric])


[STATEMENT]
lemma permutations_of_set_aux_altdef:
  "permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. infinite A \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
assume "finite A"
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. infinite A \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
proof (induction A arbitrary: acc rule: finite_psubset_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A acc. \<lbrakk>finite A; \<And>B acc. B \<subset> A \<Longrightarrow> permutations_of_set_aux acc B = (\<lambda>xs. rev xs @ acc) ` permutations_of_set B\<rbrakk> \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
case (psubset A acc)
[PROOF STATE]
proof (state)
this:
finite A
?B \<subset> A \<Longrightarrow> permutations_of_set_aux ?acc ?B = (\<lambda>xs. rev xs @ ?acc) ` permutations_of_set ?B

goal (1 subgoal):
 1. \<And>A acc. \<lbrakk>finite A; \<And>B acc. B \<subset> A \<Longrightarrow> permutations_of_set_aux acc B = (\<lambda>xs. rev xs @ acc) ` permutations_of_set B\<rbrakk> \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
proof (cases "A = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
note [simp del] = permutations_of_set_aux.simps
[PROOF STATE]
proof (state)
this:
permutations_of_set_aux ?acc ?A = (if infinite ?A then {} else if ?A = {} then {?acc} else \<Union>x\<in>?A. permutations_of_set_aux (x # ?acc) (?A - {x}))

goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
from psubset.hyps False
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<noteq> {}
[PROOF STEP]
have "permutations_of_set_aux acc A =
                (\<Union>y\<in>A. permutations_of_set_aux (y#acc) (A - {y}))"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<noteq> {}

goal (1 subgoal):
 1. permutations_of_set_aux acc A = (\<Union>y\<in>A. permutations_of_set_aux (y # acc) (A - {y}))
[PROOF STEP]
by (subst permutations_of_set_aux.simps) simp_all
[PROOF STATE]
proof (state)
this:
permutations_of_set_aux acc A = (\<Union>y\<in>A. permutations_of_set_aux (y # acc) (A - {y}))

goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
permutations_of_set_aux acc A = (\<Union>y\<in>A. permutations_of_set_aux (y # acc) (A - {y}))

goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
have "\<dots> = (\<Union>y\<in>A. (\<lambda>xs. rev xs @ acc) ` (\<lambda>xs. y # xs) ` permutations_of_set (A - {y}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>y\<in>A. permutations_of_set_aux (y # acc) (A - {y})) = (\<Union>y\<in>A. (\<lambda>xs. rev xs @ acc) ` (#) y ` permutations_of_set (A - {y}))
[PROOF STEP]
apply (rule arg_cong [of _ _ Union], rule image_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A = A
 2. \<And>x. x \<in> A \<Longrightarrow> permutations_of_set_aux (x # acc) (A - {x}) = (\<lambda>xs. rev xs @ acc) ` (#) x ` permutations_of_set (A - {x})
[PROOF STEP]
apply (simp_all add: image_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> permutations_of_set_aux (x # acc) (A - {x}) = (\<lambda>xa. rev xa @ x # acc) ` permutations_of_set (A - {x})
[PROOF STEP]
apply (subst psubset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> A - {x} \<subset> A
 2. \<And>x. x \<in> A \<Longrightarrow> (\<lambda>xs. rev xs @ x # acc) ` permutations_of_set (A - {x}) = (\<lambda>xa. rev xa @ x # acc) ` permutations_of_set (A - {x})
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Union>y\<in>A. permutations_of_set_aux (y # acc) (A - {y})) = (\<Union>y\<in>A. (\<lambda>xs. rev xs @ acc) ` (#) y ` permutations_of_set (A - {y}))

goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>y\<in>A. permutations_of_set_aux (y # acc) (A - {y})) = (\<Union>y\<in>A. (\<lambda>xs. rev xs @ acc) ` (#) y ` permutations_of_set (A - {y}))

goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
[PROOF STEP]
have "\<dots> = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}

goal (1 subgoal):
 1. (\<Union>y\<in>A. (\<lambda>xs. rev xs @ acc) ` (#) y ` permutations_of_set (A - {y})) = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
by (subst (2) permutations_of_set_nonempty) (simp_all add: image_UN)
[PROOF STATE]
proof (state)
this:
(\<Union>y\<in>A. (\<lambda>xs. rev xs @ acc) ` (#) y ` permutations_of_set (A - {y})) = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A

goal (2 subgoals):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
 2. A \<noteq> {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A

goal (1 subgoal):
 1. permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A

goal (1 subgoal):
 1. A = {} \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> permutations_of_set_aux acc A = (\<lambda>xs. rev xs @ acc) ` permutations_of_set A
[PROOF STEP]
qed (simp_all add: permutations_of_set_infinite)


[STATEMENT]
lemma permutation_edge_pred: "permutation (edge_pred M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutation (edge_pred M)
[PROOF STEP]
by (metis edge_pred_permutes finite_arcs permutation_permutes)


[STATEMENT]
lemma count_of_empty: "x \<notin> fst ` set xs \<Longrightarrow> count_of xs x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> fst ` set xs \<Longrightarrow> count_of xs x = 0
[PROOF STEP]
by (induct xs) (simp_all add: count_of_def)


[STATEMENT]
lemma  height_i_max: " i < length x13 \<Longrightarrow>
       height (x13 ! i) \<le> max foo  (Max (height ` set x13))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length x13 \<Longrightarrow> height (x13 ! i) \<le> max foo (Max (height ` set x13))
[PROOF STEP]
by (meson List.finite_set Max_ge finite_imageI max.coboundedI2 nth_mem rev_image_eqI)


[STATEMENT]
lemma rbt_set_rbt_baliL: "set (RBT_Impl.keys (rbt_baliL l a b r)) =
  set (RBT_Impl.keys l) \<union> {a} \<union> set (RBT_Impl.keys r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (keys (rbt_baliL l a b r)) = set (keys l) \<union> {a} \<union> set (keys r)
[PROOF STEP]
by (cases "(l,a,b,r)" rule: rbt_baliL.cases) auto


[STATEMENT]
lemma mono_Union:
assumes "mono Retr"
shows "Union (Retr ` Theta) \<le> Retr (Union Theta)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (Retr ` Theta) \<subseteq> Retr (\<Union> Theta)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (Retr ` Theta) \<subseteq> Retr (\<Union> Theta)
[PROOF STEP]
have "\<forall> theta' \<in> Retr ` Theta. theta' \<subseteq> Retr (Union Theta)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>theta'\<in>Retr ` Theta. theta' \<subseteq> Retr (\<Union> Theta)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Bisim.mono Retr

goal (1 subgoal):
 1. \<forall>theta'\<in>Retr ` Theta. theta' \<subseteq> Retr (\<Union> Theta)
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>theta theta'. theta \<subseteq> theta' \<longrightarrow> Retr theta \<subseteq> Retr theta'

goal (1 subgoal):
 1. \<forall>theta'\<in>Retr ` Theta. theta' \<subseteq> Retr (\<Union> Theta)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>theta'\<in>Retr ` Theta. theta' \<subseteq> Retr (\<Union> Theta)

goal (1 subgoal):
 1. \<Union> (Retr ` Theta) \<subseteq> Retr (\<Union> Theta)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>theta'\<in>Retr ` Theta. theta' \<subseteq> Retr (\<Union> Theta)

goal (1 subgoal):
 1. \<Union> (Retr ` Theta) \<subseteq> Retr (\<Union> Theta)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> (Retr ` Theta) \<subseteq> Retr (\<Union> Theta)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sF: "wp\<^sub>3\<^sub>' (WHILE b DO c) Q s = ((\<lambda>(ps, n). vars b \<subseteq> dom ps \<and> (if pbval b ps then wp\<^sub>3\<^sub>' c (wp\<^sub>3\<^sub>' (WHILE b DO c) Q) (ps, n) else Q (ps, n))) \<and>* $ 1) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp\<^sub>3\<^sub>' (WHILE b DO c) Q s = ((\<lambda>(ps, n). vars b \<subseteq> dom ps \<and> (if pbval b ps then wp\<^sub>3\<^sub>' c (wp\<^sub>3\<^sub>' (WHILE b DO c) Q) (ps, n) else Q (ps, n))) \<and>* $ 1) s
[PROOF STEP]
using sF'
[PROOF STATE]
proof (prove)
using this:
wp\<^sub>3\<^sub>' (WHILE ?b DO ?c) ?Q (?ps, ?n) = ((\<lambda>(ps, n). vars ?b \<subseteq> dom ps \<and> (if pbval ?b ps then wp\<^sub>3\<^sub>' ?c (wp\<^sub>3\<^sub>' (WHILE ?b DO ?c) ?Q) (ps, n) else ?Q (ps, n))) \<and>* $ 1) (?ps, ?n)

goal (1 subgoal):
 1. wp\<^sub>3\<^sub>' (WHILE b DO c) Q s = ((\<lambda>(ps, n). vars b \<subseteq> dom ps \<and> (if pbval b ps then wp\<^sub>3\<^sub>' c (wp\<^sub>3\<^sub>' (WHILE b DO c) Q) (ps, n) else Q (ps, n))) \<and>* $ 1) s
[PROOF STEP]
by (metis (mono_tags, lifting) prod.case_eq_if prod.collapse sep_conj_impl1)


[STATEMENT]
lemma crel_vs_fun_app:
  "\<lbrakk>Transfer.Rel (crel_vs R0) x x\<^sub>T; Transfer.Rel (crel_vs (R0 ===>\<^sub>T R1)) f f\<^sub>T\<rbrakk> \<Longrightarrow> Transfer.Rel (crel_vs R1) (App f x) (f\<^sub>T . x\<^sub>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Rel (crel_vs R0) x x\<^sub>T; Rel (crel_vs (R0 ===>\<^sub>T R1)) f f\<^sub>T\<rbrakk> \<Longrightarrow> Rel (crel_vs R1) (App f x) (f\<^sub>T . x\<^sub>T)
[PROOF STEP]
unfolding Rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>crel_vs R0 x x\<^sub>T; crel_vs (R0 ===>\<^sub>T R1) f f\<^sub>T\<rbrakk> \<Longrightarrow> crel_vs R1 (App f x) (f\<^sub>T . x\<^sub>T)
[PROOF STEP]
using transfer_fun_app_lifted[THEN rel_funD, THEN rel_funD]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>crel_vs (?R0.2 ===>\<^sub>T ?R1.2) ?x1 ?y1; crel_vs ?R0.2 ?x ?y\<rbrakk> \<Longrightarrow> crel_vs ?R1.2 (App ?x1 ?x) (?y1 . ?y)

goal (1 subgoal):
 1. \<lbrakk>crel_vs R0 x x\<^sub>T; crel_vs (R0 ===>\<^sub>T R1) f f\<^sub>T\<rbrakk> \<Longrightarrow> crel_vs R1 (App f x) (f\<^sub>T . x\<^sub>T)
[PROOF STEP]
.


[STATEMENT]
lemma (in CLF) (*lubH_is_fixp:*)
     "H = {x. (x, f x) \<in> r & x \<in> A} ==> lub H cl \<in> fix f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H = {x. (x, f x) \<in> r \<and> x \<in> A} \<Longrightarrow> lub H cl \<in> fix f A
[PROOF STEP]
apply (simp add: fix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H = {x. (x, f x) \<in> r \<and> x \<in> A} \<Longrightarrow> lub {x. (x, f x) \<in> r \<and> x \<in> A} cl \<in> A \<and> f (lub {x. (x, f x) \<in> r \<and> x \<in> A} cl) = lub {x. (x, f x) \<in> r \<and> x \<in> A} cl
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. H = {x. (x, f x) \<in> r \<and> x \<in> A} \<Longrightarrow> lub {x. (x, f x) \<in> r \<and> x \<in> A} cl \<in> A
 2. H = {x. (x, f x) \<in> r \<and> x \<in> A} \<Longrightarrow> f (lub {x. (x, f x) \<in> r \<and> x \<in> A} cl) = lub {x. (x, f x) \<in> r \<and> x \<in> A} cl
[PROOF STEP]
apply (metis CO_refl_on lubH_le_flubH refl_onD1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H = {x. (x, f x) \<in> r \<and> x \<in> A} \<Longrightarrow> f (lub {x. (x, f x) \<in> r \<and> x \<in> A} cl) = lub {x. (x, f x) \<in> r \<and> x \<in> A} cl
[PROOF STEP]
apply (metis antisymE flubH_le_lubH lubH_le_flubH)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem (in Gromov_hyperbolic_space_geodesic) Morse_Gromov_theorem2:
  fixes c d::"real \<Rightarrow> 'a"
  assumes "lambda C-quasi_isometry_on {A..B} c"
          "lambda C-quasi_isometry_on {A..B} d"
          "c A = d A" "c B = d B"
  shows "hausdorff_distance (c`{A..B}) (d`{A..B}) \<le> 184 * lambda^2 * (C + deltaG(TYPE('a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
proof (cases "A \<le> B")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
 2. \<not> A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> A \<le> B

goal (2 subgoals):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
 2. \<not> A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> A \<le> B
[PROOF STEP]
have "hausdorff_distance (c`{A..B}) (d`{A..B}) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> A \<le> B

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) = 0

goal (2 subgoals):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
 2. \<not> A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) = 0

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
using quasi_isometry_onD[OF assms(1)] delta_nonneg
[PROOF STATE]
proof (prove)
using this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) = 0
\<lbrakk>?x \<in> {A..B}; ?y \<in> {A..B}\<rbrakk> \<Longrightarrow> dist (c ?x) (c ?y) \<le> lambda * dist ?x ?y + C
\<lbrakk>?x \<in> {A..B}; ?y \<in> {A..B}\<rbrakk> \<Longrightarrow> 1 / lambda * dist ?x ?y - C \<le> dist (c ?x) (c ?y)
1 \<le> lambda
0 \<le> C
0 \<le> deltaG TYPE('a)

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))

goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A \<le> B

goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
have "hausdorff_distance (c`{A..B}) {c A--c B} \<le> 92 * lambda^2 * (C + deltaG(TYPE('a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
by (rule Morse_Gromov_theorem[OF assms(1)], auto)
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))

goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))

goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
have "hausdorff_distance {c A--c B} (d`{A..B}) \<le> 92 * lambda^2 * (C + deltaG(TYPE('a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance {c A--c B} (d ` {A..B}) \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
unfolding \<open>c A = d A\<close> \<open>c B = d B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance {d A--d B} (d ` {A..B}) \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
apply (subst hausdorff_distance_sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (d ` {A..B}) {d A--d B} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
by (rule Morse_Gromov_theorem[OF assms(2)], auto)
[PROOF STATE]
proof (state)
this:
hausdorff_distance {c A--c B} (d ` {A..B}) \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))

goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
hausdorff_distance {c A--c B} (d ` {A..B}) \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))

goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
have "hausdorff_distance (c`{A..B}) (d`{A..B}) \<le> hausdorff_distance (c`{A..B}) {c A--c B} + hausdorff_distance {c A--c B} (d`{A..B})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> hausdorff_distance (c ` {A..B}) {c A--c B} + hausdorff_distance {c A--c B} (d ` {A..B})
[PROOF STEP]
apply (rule hausdorff_distance_triangle)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {c A--c B} \<noteq> {}
 2. bounded {c A--c B}
[PROOF STEP]
using True compact_imp_bounded[OF some_geodesic_compact]
[PROOF STATE]
proof (prove)
using this:
A \<le> B
bounded {?x1--?S1--?y1}

goal (2 subgoals):
 1. {c A--c B} \<noteq> {}
 2. bounded {c A--c B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> hausdorff_distance (c ` {A..B}) {c A--c B} + hausdorff_distance {c A--c B} (d ` {A..B})

goal (1 subgoal):
 1. A \<le> B \<Longrightarrow> hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
hausdorff_distance {c A--c B} (d ` {A..B}) \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> hausdorff_distance (c ` {A..B}) {c A--c B} + hausdorff_distance {c A--c B} (d ` {A..B})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hausdorff_distance (c ` {A..B}) {c A--c B} \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
hausdorff_distance {c A--c B} (d ` {A..B}) \<le> 92 * lambda\<^sup>2 * (C + deltaG TYPE('a))
hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> hausdorff_distance (c ` {A..B}) {c A--c B} + hausdorff_distance {c A--c B} (d ` {A..B})

goal (1 subgoal):
 1. hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance (c ` {A..B}) (d ` {A..B}) \<le> 184 * lambda\<^sup>2 * (C + deltaG TYPE('a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lucas_weak:
  fixes n :: nat
  assumes n: "n \<ge> 2"
    and an: "[a ^ (n - 1) = 1] (mod n)"
    and nm: "\<forall>m. 0 < m \<and> m < n - 1 \<longrightarrow> \<not> [a ^ m = 1] (mod n)"
  shows "prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime n
[PROOF STEP]
proof (rule totient_imp_prime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. totient n = n - 1
 2. 0 < n
[PROOF STEP]
show "totient n = n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient n = n - 1
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. totient n \<noteq> n - 1 \<Longrightarrow> False
[PROOF STEP]
have "[a ^ totient n = 1] (mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a ^ totient n = 1] (mod n)
[PROOF STEP]
by (rule euler_theorem, rule lucas_coprime_lemma [of "n - 1"]) (use n an in auto)
[PROOF STATE]
proof (state)
this:
[a ^ totient n = 1] (mod n)

goal (1 subgoal):
 1. totient n \<noteq> n - 1 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[a ^ totient n = 1] (mod n)

goal (1 subgoal):
 1. totient n \<noteq> n - 1 \<Longrightarrow> False
[PROOF STEP]
assume "totient n \<noteq> n - 1"
[PROOF STATE]
proof (state)
this:
totient n \<noteq> n - 1

goal (1 subgoal):
 1. totient n \<noteq> n - 1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
totient n \<noteq> n - 1
[PROOF STEP]
have "totient n > 0" "totient n < n - 1"
[PROOF STATE]
proof (prove)
using this:
totient n \<noteq> n - 1

goal (1 subgoal):
 1. 0 < totient n &&& totient n < n - 1
[PROOF STEP]
using \<open>n \<ge> 2\<close> and totient_less[of n]
[PROOF STATE]
proof (prove)
using this:
totient n \<noteq> n - 1
2 \<le> n
1 < n \<Longrightarrow> totient n < n

goal (1 subgoal):
 1. 0 < totient n &&& totient n < n - 1
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 < totient n
totient n < n - 1

goal (1 subgoal):
 1. totient n \<noteq> n - 1 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[a ^ totient n = 1] (mod n)
0 < totient n
totient n < n - 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
[a ^ totient n = 1] (mod n)
0 < totient n
totient n < n - 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using nm
[PROOF STATE]
proof (prove)
using this:
[a ^ totient n = 1] (mod n)
0 < totient n
totient n < n - 1
\<forall>m. 0 < m \<and> m < n - 1 \<longrightarrow> [a ^ m \<noteq> 1] (mod n)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
totient n = n - 1

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
qed (use n in auto)


[STATEMENT]
lemma first_t_fusion [simp]: "last x = first y \<Longrightarrow> first (t_fusion x y) = first x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dioid_Models_New.last x = first y \<Longrightarrow> first (t_fusion x y) = first x
[PROOF STEP]
by (simp add: first_def t_fusion_def)


[STATEMENT]
lemma reachableI_app_iso:
  assumes r: "u \<rightarrow>\<^sup>* v" and hom: "digraph_isomorphism hom"
  shows "(iso_verts hom u) \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> (iso_verts hom v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iso_verts hom u \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> iso_verts hom v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. iso_verts hom u \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> iso_verts hom v
[PROOF STEP]
interpret H: wf_digraph "app_iso hom G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_digraph (app_iso hom G)
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. wf_digraph (app_iso hom G)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. iso_verts hom u \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> iso_verts hom v
[PROOF STEP]
from r
[PROOF STATE]
proof (chain)
picking this:
u \<rightarrow>\<^sup>* v
[PROOF STEP]
obtain p where "awalk u p v"
[PROOF STATE]
proof (prove)
using this:
u \<rightarrow>\<^sup>* v

goal (1 subgoal):
 1. (\<And>p. awalk u p v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: reachable_awalk)
[PROOF STATE]
proof (state)
this:
awalk u p v

goal (1 subgoal):
 1. iso_verts hom u \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> iso_verts hom v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
awalk u p v
[PROOF STEP]
have "H.awalk (iso_verts hom u) (map (iso_arcs hom) p) (iso_verts hom v)"
[PROOF STATE]
proof (prove)
using this:
awalk u p v

goal (1 subgoal):
 1. H.awalk (iso_verts hom u) (map (iso_arcs hom) p) (iso_verts hom v)
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
awalk u p v
digraph_isomorphism hom

goal (1 subgoal):
 1. H.awalk (iso_verts hom u) (map (iso_arcs hom) p) (iso_verts hom v)
[PROOF STEP]
by (rule awalk_app_isoI)
[PROOF STATE]
proof (state)
this:
H.awalk (iso_verts hom u) (map (iso_arcs hom) p) (iso_verts hom v)

goal (1 subgoal):
 1. iso_verts hom u \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> iso_verts hom v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
H.awalk (iso_verts hom u) (map (iso_arcs hom) p) (iso_verts hom v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
H.awalk (iso_verts hom u) (map (iso_arcs hom) p) (iso_verts hom v)

goal (1 subgoal):
 1. iso_verts hom u \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> iso_verts hom v
[PROOF STEP]
by (auto simp: H.reachable_awalk)
[PROOF STATE]
proof (state)
this:
iso_verts hom u \<rightarrow>\<^sup>*\<^bsub>app_iso hom G\<^esub> iso_verts hom v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_iff_convergent': "summable f \<longleftrightarrow> convergent (\<lambda>n. sum f {..n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f = convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
by (simp add: convergent_def summable_def sums_def_le)


[STATEMENT]
lemma map_key_PP_minus:
  "Poly_Mapping.map_key PP (p - q) = Poly_Mapping.map_key PP p - Poly_Mapping.map_key PP q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly_Mapping.map_key PP (p - q) = Poly_Mapping.map_key PP p - Poly_Mapping.map_key PP q
[PROOF STEP]
by (rule poly_mapping_eqI) (simp add: lookup_map_key_PP lookup_minus)


[STATEMENT]
lemma padic_set_res_coherent:
  assumes "f \<in> padic_set p"
  assumes "n \<ge> m"
  assumes "prime p"
  shows "residue (p^m) (f n) = (f m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (p ^ m) (f n) = f m
[PROOF STEP]
proof(cases "n=m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = m \<Longrightarrow> residue (p ^ m) (f n) = f m
 2. n \<noteq> m \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = m

goal (2 subgoals):
 1. n = m \<Longrightarrow> residue (p ^ m) (f n) = f m
 2. n \<noteq> m \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
have "(f m) \<in> carrier (residue_ring (p^m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
using assms padic_set_res_closed
[PROOF STATE]
proof (prove)
using this:
f \<in> padic_set p
m \<le> n
prime p
?f \<in> padic_set ?p \<Longrightarrow> ?f ?m \<in> carrier (residue_ring (?p ^ ?m))

goal (1 subgoal):
 1. f m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f m \<in> carrier (residue_ring (p ^ m))

goal (2 subgoals):
 1. n = m \<Longrightarrow> residue (p ^ m) (f n) = f m
 2. n \<noteq> m \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f m \<in> carrier (residue_ring (p ^ m))
[PROOF STEP]
have "residue (p^m) (f m) = (f m)"
[PROOF STATE]
proof (prove)
using this:
f m \<in> carrier (residue_ring (p ^ m))

goal (1 subgoal):
 1. residue (p ^ m) (f m) = f m
[PROOF STEP]
by (simp add: residue_def residue_ring_def)
[PROOF STATE]
proof (state)
this:
residue (p ^ m) (f m) = f m

goal (2 subgoals):
 1. n = m \<Longrightarrow> residue (p ^ m) (f n) = f m
 2. n \<noteq> m \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
residue (p ^ m) (f m) = f m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
residue (p ^ m) (f m) = f m

goal (1 subgoal):
 1. residue (p ^ m) (f n) = f m
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
residue (p ^ m) (f m) = f m
n = m

goal (1 subgoal):
 1. residue (p ^ m) (f n) = f m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
residue (p ^ m) (f n) = f m

goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> m

goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<noteq> m

goal (1 subgoal):
 1. residue (p ^ m) (f n) = f m
[PROOF STEP]
using assms(1) assms(2) padic_set_def
[PROOF STATE]
proof (prove)
using this:
n \<noteq> m
f \<in> padic_set p
m \<le> n
padic_set ?p = {f. (\<forall>m. f m \<in> carrier (residue_ring (?p ^ m))) \<and> (\<forall>n m. m < n \<longrightarrow> residue (?p ^ m) (f n) = f m)}

goal (1 subgoal):
 1. residue (p ^ m) (f n) = f m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
residue (p ^ m) (f n) = f m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diag_elems_mem[simp]:
  assumes "i < dim_row B"
  shows "B $$(i,i) \<in> diag_elems B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B $$ (i, i) \<in> diag_elems B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row B

goal (1 subgoal):
 1. B $$ (i, i) \<in> diag_elems B
[PROOF STEP]
unfolding diag_elems_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row B

goal (1 subgoal):
 1. B $$ (i, i) \<in> {B $$ (i, i) |i. i < dim_row B}
[PROOF STEP]
by auto


[STATEMENT]
lemma BseqE: "Bseq X \<Longrightarrow> (\<And>K. 0 < K \<Longrightarrow> \<forall>n. norm (X n) \<le> K \<Longrightarrow> Q) \<Longrightarrow> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Bseq X; \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q
[PROOF STEP]
unfolding Bseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>K>0. \<forall>n. norm (X n) \<le> K; \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_in_varI:
  assumes "finite (monomials_of R P)"
  assumes "\<exists>m. m \<in> monomials_of R P \<and> count m i = n"
  assumes "\<And>c. c \<in> monomials_of R P \<Longrightarrow> count c i \<le> n"
  shows "n = degree_in_var R P i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = degree_in_var R P i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = degree_in_var R P i
[PROOF STEP]
obtain l where l_def: "l \<in> monomials_of R P \<and> count l i = degree_in_var R P i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l. l \<in> monomials_of R P \<and> count l i = degree_in_var R P i \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms(1) assms(2) degree_in_var_in_monomials_of equals0D)
[PROOF STATE]
proof (state)
this:
l \<in> monomials_of R P \<and> count l i = degree_in_var R P i

goal (1 subgoal):
 1. n = degree_in_var R P i
[PROOF STEP]
have "degree_in_var R P i \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_in_var R P i \<le> n
[PROOF STEP]
using assms(3) l_def
[PROOF STATE]
proof (prove)
using this:
?c20 \<in> monomials_of R P \<Longrightarrow> count ?c20 i \<le> n
l \<in> monomials_of R P \<and> count l i = degree_in_var R P i

goal (1 subgoal):
 1. degree_in_var R P i \<le> n
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
degree_in_var R P i \<le> n

goal (1 subgoal):
 1. n = degree_in_var R P i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree_in_var R P i \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree_in_var R P i \<le> n

goal (1 subgoal):
 1. n = degree_in_var R P i
[PROOF STEP]
using assms(1) assms(2) dual_order.antisym degree_in_var_ineq
[PROOF STATE]
proof (prove)
using this:
degree_in_var R P i \<le> n
finite (monomials_of R P)
\<exists>m. m \<in> monomials_of R P \<and> count m i = n
\<lbrakk>?b \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> ?a = ?b
\<lbrakk>?m \<in> monomials_of R ?P; finite (monomials_of R ?P)\<rbrakk> \<Longrightarrow> count ?m ?i \<le> degree_in_var R ?P ?i

goal (1 subgoal):
 1. n = degree_in_var R P i
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
n = degree_in_var R P i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm05: assumes "\<not> trivial X" "trivial T"
            shows   "X - T  \<noteq>  {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X - T \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> trivial X
trivial T

goal (1 subgoal):
 1. X - T \<noteq> {}
[PROOF STEP]
by (metis Diff_iff empty_iff subsetI trivial_subset)


[STATEMENT]
lemma [intro!]: "finite (nodes G) \<Longrightarrow> finite (odd_nodes_set G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (nodes G) \<Longrightarrow> finite (odd_nodes_set G)
[PROOF STEP]
by (metis (lifting) mem_Collect_eq odd_nodes_set_def rev_finite_subset subsetI)


[STATEMENT]
lemma suminf_mult: "summable f \<Longrightarrow> suminf (\<lambda>n. c * f n) = c * suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<Sum>n. c * f n) = c * suminf f
[PROOF STEP]
by (rule bounded_linear.suminf [OF bounded_linear_mult_right, symmetric])


[STATEMENT]
lemma ltakes_one_iterates:
  "ltake (enat (Suc 0)) (iterates f p) = LCons p LNil"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ltake (enat (Suc 0)) (iterates f p) = LCons p LNil
[PROOF STEP]
by (metis One_nat_def iterates_lmap ltake_eSuc_LCons ltake_zero one_eSuc one_enat_def zero_enat_def)


[STATEMENT]
lemma ordinal_exp_monoR:
"\<lbrakk>0 < x; y \<le> y'\<rbrakk> \<Longrightarrow> x ** y \<le> x ** (y'::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; y \<le> y'\<rbrakk> \<Longrightarrow> x ** y \<le> x ** y'
[PROOF STEP]
by (rule continuous.monoD[OF continuous_exp])


[STATEMENT]
lemma fls_X_power_conv_shift_1: "fls_X ^ n = fls_shift (-n) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_X ^ n = fls_shift (- int n) 1
[PROOF STEP]
by (simp add: fls_X_conv_shift_1 fls_shifted_pow)


[STATEMENT]
lemma  orthogonal_matrix_transpose [simp]:
     "orthogonal_matrix(transpose A) \<longleftrightarrow> orthogonal_matrix A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_matrix (Finite_Cartesian_Product.transpose A) = orthogonal_matrix A
[PROOF STEP]
by (auto simp: orthogonal_matrix_def)


[STATEMENT]
lemma unat_less_word_bits:
  fixes y :: machine_word
  shows "x < unat y \<Longrightarrow> x < 2 ^ word_bits"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < unat y \<Longrightarrow> x < 2 ^ word_bits
[PROOF STEP]
unfolding word_bits_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < unat y \<Longrightarrow> x < 2 ^ LENGTH(32)
[PROOF STEP]
by (rule order_less_trans [OF _ unat_lt2p])


[STATEMENT]
lemma isotone_utp_orderI: "Monotonic H \<Longrightarrow> isotone (utp_order X) (utp_order Y) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Monotonic H \<Longrightarrow> isotone (utp_order X) (utp_order Y) H
[PROOF STEP]
by (auto simp add: mono_def isotone_def utp_weak_partial_order)


[STATEMENT]
lemma not_less_eq_funI:
  assumes "\<And>c n. c > 0 \<Longrightarrow> \<exists>m>n. c * g m < f m"
  shows "\<not> f \<lesssim> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f \<lesssim> g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < ?c \<Longrightarrow> \<exists>m>?n. ?c * g m < f m

goal (1 subgoal):
 1. \<not> f \<lesssim> g
[PROOF STEP]
unfolding less_eq_fun_def linorder_not_le [symmetric]
[PROOF STATE]
proof (prove)
using this:
\<not> ?c \<le> 0 \<Longrightarrow> \<exists>m. \<not> m \<le> ?n \<and> \<not> f m \<le> ?c * g m

goal (1 subgoal):
 1. \<nexists>c. \<not> c \<le> 0 \<and> (\<exists>n. \<forall>m. \<not> m \<le> n \<longrightarrow> f m \<le> c * g m)
[PROOF STEP]
by blast


[STATEMENT]
lemma lformula_nFEx:
  "lformula (FEx b \<phi>) \<Longrightarrow> lformula (nFEx b \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lformula (FEx b \<phi>) \<Longrightarrow> lformula (nFEx b \<phi>)
[PROOF STEP]
by (induct \<phi> rule: nFEx.induct)
    (auto simp: lformula_nFOr lformula0_decr0 lformula_decr)


[STATEMENT]
lemma integrable_on_powr2_from_0_general:
  fixes a c :: real
  assumes a_pos: "a > 0" and c_nneg: "c \<ge> 0"
  shows "(\<lambda>x. a.^x) integrable_on {0..c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (.^) a integrable_on {0..c}
[PROOF STEP]
proof (cases "a = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 1 \<Longrightarrow> (.^) a integrable_on {0..c}
 2. a \<noteq> 1 \<Longrightarrow> (.^) a integrable_on {0..c}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 1

goal (2 subgoals):
 1. a = 1 \<Longrightarrow> (.^) a integrable_on {0..c}
 2. a \<noteq> 1 \<Longrightarrow> (.^) a integrable_on {0..c}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 1

goal (1 subgoal):
 1. (.^) a integrable_on {0..c}
[PROOF STEP]
using has_integral_const_real
[PROOF STATE]
proof (prove)
using this:
a = 1
((\<lambda>x. ?c) has_integral content {?a..?b} *\<^sub>R ?c) {?a..?b}

goal (1 subgoal):
 1. (.^) a integrable_on {0..c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(.^) a integrable_on {0..c}

goal (1 subgoal):
 1. a \<noteq> 1 \<Longrightarrow> (.^) a integrable_on {0..c}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 1 \<Longrightarrow> (.^) a integrable_on {0..c}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 1

goal (1 subgoal):
 1. a \<noteq> 1 \<Longrightarrow> (.^) a integrable_on {0..c}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 1

goal (1 subgoal):
 1. (.^) a integrable_on {0..c}
[PROOF STEP]
using has_integral_powr2_from_0 False assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 1
\<lbrakk>0 < ?a; ?a \<noteq> 1; 0 \<le> ?c\<rbrakk> \<Longrightarrow> ((.^) ?a has_integral (?a .^ ?c - 1) / ln ?a) {0..?c}
a \<noteq> 1
0 < a
0 \<le> c

goal (1 subgoal):
 1. (.^) a integrable_on {0..c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(.^) a integrable_on {0..c}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_matI[intro]: "(\<And> i j . i < dim_row B \<Longrightarrow> j < dim_col B \<Longrightarrow> A $$ (i,j) = B $$ (i,j))
  \<Longrightarrow> dim_row A = dim_row B
  \<Longrightarrow> dim_col A = dim_col B
  \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i j. \<lbrakk>i < dim_row B; j < dim_col B\<rbrakk> \<Longrightarrow> A $$ (i, j) = B $$ (i, j); dim_row A = dim_row B; dim_col A = dim_col B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
by (transfer, auto intro!: cong_mk_mat, auto simp: mk_mat_def)


[STATEMENT]
lemma card_complex_roots_unity: "1 \<le> n \<Longrightarrow> card {z::complex. z^n = 1} = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> n \<Longrightarrow> card {z. z ^ n = 1} = n
[PROOF STEP]
by (simp add: card_complex_roots_unity_explicit complex_roots_unity)


[STATEMENT]
lemma Inf_to_Sup_var: "\<Sqinter>X = \<partial> (\<Squnion>(\<partial> ` X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> X = \<partial> (\<Squnion> (\<partial> ` X))
[PROOF STEP]
using Inf_dual_var dual_iff
[PROOF STATE]
proof (prove)
using this:
\<partial> (\<Sqinter> ?X) = \<Squnion> (\<partial> ` ?X)
(\<partial> ?x = ?y) = (?x = \<partial> ?y)

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


[STATEMENT]
lemma wordinterval_UNIV_set_eq[simp]: "wordinterval_to_set wordinterval_UNIV = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set wordinterval_UNIV = UNIV
[PROOF STEP]
unfolding wordinterval_UNIV_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (WordInterval 0 (- 1)) = UNIV
[PROOF STEP]
using max_word_max
[PROOF STATE]
proof (prove)
using this:
?n \<le> - 1

goal (1 subgoal):
 1. wordinterval_to_set (WordInterval 0 (- 1)) = UNIV
[PROOF STEP]
by fastforce


[STATEMENT]
lemma BseqE: "Bseq X \<Longrightarrow> (\<And>K. 0 < K \<Longrightarrow> \<forall>n. norm (X n) \<le> K \<Longrightarrow> Q) \<Longrightarrow> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Bseq X; \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q
[PROOF STEP]
unfolding Bseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>K>0. \<forall>n. norm (X n) \<le> K; \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q
[PROOF STEP]
by auto


[STATEMENT]
lemma monoseq_realpow: "0 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> monoseq (\<lambda>n. x ^ n)"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> monoseq ((^) x)
[PROOF STEP]
using monoseq_def power_decreasing
[PROOF STATE]
proof (prove)
using this:
monoseq ?X = ((\<forall>m n. m \<le> n \<longrightarrow> ?X m \<le> ?X n) \<or> (\<forall>m n. m \<le> n \<longrightarrow> ?X n \<le> ?X m))
\<lbrakk>?n \<le> ?N; (0::?'a) \<le> ?a; ?a \<le> (1::?'a)\<rbrakk> \<Longrightarrow> ?a ^ ?N \<le> ?a ^ ?n

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> monoseq ((^) x)
[PROOF STEP]
by blast


[STATEMENT]
lemma inf_distribD'[simp]:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "inf_distrib f \<Longrightarrow> f (Sup C) = Sup (f`C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_distrib f \<Longrightarrow> f (Sup C) = Sup (f ` C)
[PROOF STEP]
apply (cases "C={}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>inf_distrib f; C = {}\<rbrakk> \<Longrightarrow> f (Sup C) = Sup (f ` C)
 2. \<lbrakk>inf_distrib f; C \<noteq> {}\<rbrakk> \<Longrightarrow> f (Sup C) = Sup (f ` C)
[PROOF STEP]
apply (auto dest: inf_distribD contD')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma zip_mirror[rule_format]: "
  \<lbrakk> i < min (length xs) (length ys);
    p1 = (zip xs ys) ! i; p2 = (zip ys xs) ! i \<rbrakk> \<Longrightarrow>
  mirror_pair p1 = p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < min (length xs) (length ys); p1 = zip xs ys ! i; p2 = zip ys xs ! i\<rbrakk> \<Longrightarrow> mirror_pair p1 = p2
[PROOF STEP]
by (simp add: mirror_pair_def)


[STATEMENT]
lemma higher_pderiv_pcompose_linear:
   "(pderiv ^^ n) (pcompose p [:0, c:]) =
    Polynomial.smult (c ^ n) (pcompose ((pderiv ^^ n) p) [:0, c:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pderiv ^^ n) (p \<circ>\<^sub>p [:0::'a, c:]) = Polynomial.smult (c ^ n) ((pderiv ^^ n) p \<circ>\<^sub>p [:0::'a, c:])
[PROOF STEP]
by (induction n)  (simp_all add: pderiv_pcompose pderiv_smult pderiv_pCons pcompose_smult mult_ac)


[STATEMENT]
lemma UINF_list_conv:
  "(\<Sqinter> i \<in> {0..<length(xs)} \<bullet> f (xs ! i)) = foldr (\<or>) (map f xs) false"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> i \<in> dom\<^sub>l xs \<bullet> f (xs ! i)) = foldr (\<or>) (map f xs) false
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<Sqinter> i \<in> dom\<^sub>l [] \<bullet> f ([] ! i)) = foldr (\<or>) (map f []) false
 2. \<And>a xs. (\<Sqinter> i \<in> dom\<^sub>l xs \<bullet> f (xs ! i)) = foldr (\<or>) (map f xs) false \<Longrightarrow> (\<Sqinter> i \<in> dom\<^sub>l (a # xs) \<bullet> f ((a # xs) ! i)) = foldr (\<or>) (map f (a # xs)) false
[PROOF STEP]
apply (rel_auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. (\<Sqinter> i \<in> dom\<^sub>l xs \<bullet> f (xs ! i)) = foldr (\<or>) (map f xs) false \<Longrightarrow> (\<Sqinter> i \<in> dom\<^sub>l (a # xs) \<bullet> f ((a # xs) ! i)) = foldr (\<or>) (map f (a # xs)) false
[PROOF STEP]
apply (simp add: UINF_upto_expand_first UINF_Suc_shift)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_invar_empty:
    assumes "ppath s = Some (vs,v)"
    and "vs = []"
    shows "v \<in> V0" "path E v vs v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> V0 &&& path E v vs v
[PROOF STEP]
using assms path_invar
[PROOF STATE]
proof (prove)
using this:
ppath s = Some (vs, v)
vs = []
ppath s = Some (?vs, ?v) \<Longrightarrow> (?vs \<noteq> [] \<longrightarrow> hd ?vs \<in> V0 \<and> path E (hd ?vs) ?vs ?v) \<and> (?vs = [] \<longrightarrow> ?v \<in> V0 \<and> path E ?v ?vs ?v) \<and> distinct (?vs @ [?v])

goal (1 subgoal):
 1. v \<in> V0 &&& path E v vs v
[PROOF STEP]
by auto


[STATEMENT]
lemma veqpoll_omega_vcard[intro, simp]:
  assumes "n \<in>\<^sub>\<circ> \<omega>" and "n \<approx>\<^sub>\<circ> A"
  shows "vcard A = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard A = n
[PROOF STEP]
using
    nat_into_Card[OF assms(1), unfolded Card_def]
    cardinal_cong[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
n = vcard n
vcard n = vcard A

goal (1 subgoal):
 1. vcard A = n
[PROOF STEP]
by simp


[STATEMENT]
lemma length_map2 [simp]: "length (map2 f xs ys) = min (length xs) (length ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map2 f xs ys) = min (length xs) (length ys)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in finite_comm_group) restrict_char_image:
  assumes "subgroup H G"
  shows "restrict_char H ` (carrier (Characters G)) = carrier (Characters (G\<lparr>carrier := H\<rparr>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
interpret H: subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
interpret H: finite_comm_group "G\<lparr>carrier := H\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
using subgroup_imp_finite_comm_group[OF assms]
[PROOF STATE]
proof (prove)
using this:
finite_comm_group (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. finite_comm_group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
interpret r: group_hom "Characters G" "Characters (G\<lparr>carrier := H\<rparr>)" "restrict_char H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
using restrict_char_hom[OF assms]
[PROOF STATE]
proof (prove)
using this:
group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)

goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
interpret Mod: finite_comm_group "G Mod H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (G Mod H)
[PROOF STEP]
using finite_comm_FactGroup[OF assms]
[PROOF STATE]
proof (prove)
using this:
finite_comm_group (G Mod H)

goal (1 subgoal):
 1. finite_comm_group (G Mod H)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
interpret CG: finite_comm_group "Characters G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
using finite_comm_group_Characters
[PROOF STATE]
proof (prove)
using this:
finite_comm_group (Characters G)

goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
have c1: "order (Characters (G\<lparr>carrier := H\<rparr>)) = card H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (Characters (G\<lparr>carrier := H\<rparr>)) = card H
[PROOF STEP]
using H.order_Characters
[PROOF STATE]
proof (prove)
using this:
order (Characters (G\<lparr>carrier := H\<rparr>)) = order (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. order (Characters (G\<lparr>carrier := H\<rparr>)) = card H
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
card (carrier (Characters (G\<lparr>carrier := H\<rparr>))) = card (carrier (G\<lparr>carrier := H\<rparr>))

goal (1 subgoal):
 1. card (carrier (Characters (G\<lparr>carrier := H\<rparr>))) = card H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
order (Characters (G\<lparr>carrier := H\<rparr>)) = card H

goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
have "card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H))
      = order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G
[PROOF STEP]
using restrict_char_kernel[OF assms] iso_same_card[OF is_iso_Characters_FactGroup[OF assms]]
          Mod.order_Characters lagrange[OF assms]
[PROOF STATE]
proof (prove)
using this:
kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H) = {\<chi> \<in> characters G. \<forall>x\<in>H. \<chi> x = 1}
card (carrier (Characters (G Mod H))) = card (carrier (Characters G\<lparr>carrier := {\<chi> \<in> characters G. \<forall>x\<in>H. \<chi> x = 1}\<rparr>))
order (Characters (G Mod H)) = order (G Mod H)
card (rcosets H) * card H = order G

goal (1 subgoal):
 1. card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G
[PROOF STEP]
unfolding order_def FactGroup_def
[PROOF STATE]
proof (prove)
using this:
kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H) = {\<chi> \<in> characters G. \<forall>x\<in>H. \<chi> x = 1}
card (carrier (Characters \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>)) = card (carrier (Characters G\<lparr>carrier := {\<chi> \<in> characters G. \<forall>x\<in>H. \<chi> x = 1}\<rparr>))
card (carrier (Characters \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>)) = card (carrier \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>)
card (rcosets H) * card H = card (carrier G)

goal (1 subgoal):
 1. card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = card (carrier G)
[PROOF STEP]
by (force simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G

goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G

goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
have "card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) \<noteq> 0
[PROOF STEP]
using r.one_in_kernel
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>Characters G\<^esub> \<in> kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)

goal (1 subgoal):
 1. card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) \<noteq> 0
[PROOF STEP]
unfolding kernel_def CG.fin
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>Characters G\<^esub> \<in> {x \<in> carrier (Characters G). restrict_char H x = \<one>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub>}

goal (1 subgoal):
 1. card {x \<in> carrier (Characters G). restrict_char H x = \<one>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub>} \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) \<noteq> 0

goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G
card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) \<noteq> 0
[PROOF STEP]
have c2: "card H = card (restrict_char H ` carrier (Characters G))"
[PROOF STATE]
proof (prove)
using this:
card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G
card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) \<noteq> 0

goal (1 subgoal):
 1. card H = card (restrict_char H ` carrier (Characters G))
[PROOF STEP]
using r.image_kernel_product[unfolded order_Characters]
[PROOF STATE]
proof (prove)
using this:
card H * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G
card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) \<noteq> 0
card (restrict_char H ` carrier (Characters G)) * card (kernel (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)) = order G

goal (1 subgoal):
 1. card H = card (restrict_char H ` carrier (Characters G))
[PROOF STEP]
by (metis mult_right_cancel)
[PROOF STATE]
proof (state)
this:
card H = card (restrict_char H ` carrier (Characters G))

goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
have "restrict_char H ` (carrier (Characters G)) \<subseteq> carrier (Characters (G\<lparr>carrier := H\<rparr>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) \<subseteq> carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
restrict_char H ` carrier (Characters G) \<subseteq> carrier (Characters (G\<lparr>carrier := H\<rparr>))

goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
with c2 H.fin
[PROOF STATE]
proof (chain)
picking this:
card H = card (restrict_char H ` carrier (Characters G))
finite (carrier (G\<lparr>carrier := H\<rparr>))
restrict_char H ` carrier (Characters G) \<subseteq> carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card H = card (restrict_char H ` carrier (Characters G))
finite (carrier (G\<lparr>carrier := H\<rparr>))
restrict_char H ` carrier (Characters G) \<subseteq> carrier (Characters (G\<lparr>carrier := H\<rparr>))

goal (1 subgoal):
 1. restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
by (auto, metis H.finite_imp_card_positive c1 card_subset_eq fin_gen
                    order_def r.H.order_gt_0_iff_finite)
[PROOF STATE]
proof (state)
this:
restrict_char H ` carrier (Characters G) = carrier (Characters (G\<lparr>carrier := H\<rparr>))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in PolynRg) pol_deg_le_n:"\<lbrakk>p \<in> carrier R; pol_coeff S c;
       p = polyn_expr R X (fst c) c\<rbrakk> \<Longrightarrow> deg_n R S X p \<le> (fst c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c\<rbrakk> \<Longrightarrow> deg_n R S X p \<le> fst c
[PROOF STEP]
apply (frule  pol_deg_eq_c_max[of p c], assumption+,
       frule  coeff_max_bddTr[of c])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c; deg_n R S X p = c_max S c; c_max S c \<le> fst c\<rbrakk> \<Longrightarrow> deg_n R S X p \<le> fst c
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_of_real [simp]: "norm (of_real r :: 'a::real_normed_algebra_1) = \<bar>r\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (of_real r) = \<bar>r\<bar>
[PROOF STEP]
by (simp add: of_real_def)


[STATEMENT]
lemma subset_filter_fset:
  "filter_fset P xs |\<subseteq>| filter_fset Q xs = (\<forall> x. x |\<in>| xs \<longrightarrow> P x \<longrightarrow> Q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (filter_fset P xs |\<subseteq>| filter_fset Q xs) = (\<forall>x. x |\<in>| xs \<longrightarrow> P x \<longrightarrow> Q x)
[PROOF STEP]
by descending auto


[STATEMENT]
lemma ord_mod [simp]: "ord n (k mod n) = ord n k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord n (k mod n) = ord n k
[PROOF STEP]
by (cases "n = 0") (auto simp add: ord_def cong_def power_mod)


[STATEMENT]
lemma word_rot_logs:
  "word_rotl n (NOT v) = NOT (word_rotl n v)"
  "word_rotr n (NOT v) = NOT (word_rotr n v)"
  "word_rotl n (x AND y) = word_rotl n x AND word_rotl n y"
  "word_rotr n (x AND y) = word_rotr n x AND word_rotr n y"
  "word_rotl n (x OR y) = word_rotl n x OR word_rotl n y"
  "word_rotr n (x OR y) = word_rotr n x OR word_rotr n y"
  "word_rotl n (x XOR y) = word_rotl n x XOR word_rotl n y"
  "word_rotr n (x XOR y) = word_rotr n x XOR word_rotr n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((word_rotl n (NOT v) = NOT (word_rotl n v) &&& word_rotr n (NOT v) = NOT (word_rotr n v)) &&& word_rotl n (x AND y) = word_rotl n x AND word_rotl n y &&& word_rotr n (x AND y) = word_rotr n x AND word_rotr n y) &&& (word_rotl n (x OR y) = word_rotl n x OR word_rotl n y &&& word_rotr n (x OR y) = word_rotr n x OR word_rotr n y) &&& word_rotl n (x XOR y) = word_rotl n x XOR word_rotl n y &&& word_rotr n (x XOR y) = word_rotr n x XOR word_rotr n y
[PROOF STEP]
by (rule bit_word_eqI, auto simp add: bit_word_rotl_iff bit_word_rotr_iff bit_and_iff bit_or_iff bit_xor_iff bit_not_iff algebra_simps not_le)+


[STATEMENT]
lemma conjunctiveD: "x \<in> conjunctive \<Longrightarrow> times_abc x (inf_b y z) = inf_c (times_abc x y) (times_abc x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> conjunctive \<Longrightarrow> times_abc x (inf_b y z) = inf_c (times_abc x y) (times_abc x z)
[PROOF STEP]
by (simp add: conjunctive_def)


[STATEMENT]
lemma sum_inner_Basis_one: "i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>Basis. x \<bullet> i) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>Basis. x \<bullet> i) = 1
[PROOF STEP]
by (subst sum.mono_neutral_right[where S="{i}"])
    (auto simp: inner_not_same_Basis)


[STATEMENT]
lemma 23: \<open>\<turnstile> ((q \<rightarrow> p \<rightarrow> r) \<rightarrow> s) \<rightarrow> (p \<rightarrow> q \<rightarrow> r) \<rightarrow> s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> ((q \<rightarrow> p \<rightarrow> r) \<rightarrow> s) \<rightarrow> (p \<rightarrow> q \<rightarrow> r) \<rightarrow> s
[PROOF STEP]
using MP 01 21
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<turnstile> ?p \<rightarrow> ?q; \<turnstile> ?p\<rbrakk> \<Longrightarrow> \<turnstile> ?q
\<turnstile> (?p \<rightarrow> ?q) \<rightarrow> (?q \<rightarrow> ?r) \<rightarrow> ?p \<rightarrow> ?r
\<turnstile> (?p \<rightarrow> ?q \<rightarrow> ?r) \<rightarrow> ?q \<rightarrow> ?p \<rightarrow> ?r

goal (1 subgoal):
 1. \<turnstile> ((q \<rightarrow> p \<rightarrow> r) \<rightarrow> s) \<rightarrow> (p \<rightarrow> q \<rightarrow> r) \<rightarrow> s
[PROOF STEP]
.


[STATEMENT]
lemma bigo_useful_intro: "A \<subseteq> O(f) \<Longrightarrow> B \<subseteq> O(f) \<Longrightarrow> A + B \<subseteq> O(f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> A + B \<subseteq> O(f)
[PROOF STEP]
apply (subst bigo_plus_idemp [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> A + B \<subseteq> O(f) + O(f)
[PROOF STEP]
apply (rule set_plus_mono2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> A \<subseteq> O(f)
 2. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> B \<subseteq> O(f)
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Constrains_Int:
    "[| F \<in> A Co A'; F \<in> B Co B' |] ==> F \<in> (A \<inter> B) Co (A' \<inter> B')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A Co A'; F \<in> B Co B'\<rbrakk> \<Longrightarrow> F \<in> A \<inter> B Co A' \<inter> B'
[PROOF STEP]
apply (unfold Constrains_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> {F. F \<in> reachable F \<inter> A co A'}; F \<in> {F. F \<in> reachable F \<inter> B co B'}\<rbrakk> \<Longrightarrow> F \<in> {F. F \<in> reachable F \<inter> (A \<inter> B) co A' \<inter> B'}
[PROOF STEP]
apply (blast intro: constrains_Int [THEN constrains_weaken])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma filter_mset_sum_list: "filter_mset P (sum_list xs) = sum_list (map (filter_mset P) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P (sum_list xs) = sum_list (map (filter_mset P) xs)
[PROOF STEP]
by (induction xs) simp_all


[STATEMENT]
lemma res_carrier_eq: "carrier R = {0..m - 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier R = {0..m - 1}
[PROOF STEP]
by (auto simp: R_m_def residue_ring_def)


[STATEMENT]
lemma hull_unique: "s \<subseteq> t \<Longrightarrow> S t \<Longrightarrow> (\<And>t'. s \<subseteq> t' \<Longrightarrow> S t' \<Longrightarrow> t \<subseteq> t') \<Longrightarrow> (S hull s = t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<subseteq> t; S t; \<And>t'. \<lbrakk>s \<subseteq> t'; S t'\<rbrakk> \<Longrightarrow> t \<subseteq> t'\<rbrakk> \<Longrightarrow> S hull s = t
[PROOF STEP]
unfolding hull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<subseteq> t; S t; \<And>t'. \<lbrakk>s \<subseteq> t'; S t'\<rbrakk> \<Longrightarrow> t \<subseteq> t'\<rbrakk> \<Longrightarrow> \<Inter> {t. S t \<and> s \<subseteq> t} = t
[PROOF STEP]
by auto


[STATEMENT]
lemma td_ext_uint:
  "td_ext (uint :: 'a word \<Rightarrow> int) word_of_int (uints (LENGTH('a::len)))
    (\<lambda>w::int. w mod 2 ^ LENGTH('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. td_ext uint word_of_int (uints LENGTH('a)) (\<lambda>w. w mod 2 ^ LENGTH('a))
[PROOF STEP]
apply (unfold td_ext_def')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>x. uint x \<in> uints LENGTH('a)) \<and> (\<forall>x. word_of_int (uint x) = x) \<and> (\<forall>y. y \<in> uints LENGTH('a) \<longrightarrow> uint (word_of_int y) = y)) \<and> (\<forall>x. uint (word_of_int x) = x mod 2 ^ LENGTH('a))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>x. take_bit LENGTH('a) x \<in> uints LENGTH('a)) \<and> (\<forall>x. take_bit LENGTH('a) (take_bit LENGTH('a) x) = take_bit LENGTH('a) x) \<and> (\<forall>y. y \<in> uints LENGTH('a) \<longrightarrow> take_bit LENGTH('a) y = y)) \<and> (\<forall>x. take_bit LENGTH('a) x = x mod 2 ^ LENGTH('a))
[PROOF STEP]
apply (simp add: uints_num take_bit_eq_mod)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cross_ratio_S_S_hyp2_hyp2_positive:
  assumes "are_endpoints_in_S p q a b"
  shows "cross_ratio p q a b > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < cross_ratio p q a b
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 < cross_ratio p q a b
 2. \<not> ?P \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
assume "B\<^sub>\<real> (cart2_pt p) (cart2_pt b) (cart2_pt a)"
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a

goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 < cross_ratio p q a b
 2. \<not> ?P \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
hence "B\<^sub>\<real> (cart2_pt a) (cart2_pt b) (cart2_pt p)"
[PROOF STATE]
proof (prove)
using this:
B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt a cart2_pt b cart2_pt p
[PROOF STEP]
by (rule real_euclid.th3_2)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt a cart2_pt b cart2_pt p

goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 < cross_ratio p q a b
 2. \<not> ?P \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
are_endpoints_in_S p q a b
B\<^sub>\<real> cart2_pt a cart2_pt b cart2_pt p
[PROOF STEP]
have "cross_ratio p q a b \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
are_endpoints_in_S p q a b
B\<^sub>\<real> cart2_pt a cart2_pt b cart2_pt p

goal (1 subgoal):
 1. 1 \<le> cross_ratio p q a b
[PROOF STEP]
by (rule are_endpoints_in_S_ordered_cross_ratio)
[PROOF STATE]
proof (state)
this:
1 \<le> cross_ratio p q a b

goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 < cross_ratio p q a b
 2. \<not> ?P \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
thus "cross_ratio p q a b > 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> cross_ratio p q a b

goal (1 subgoal):
 1. 0 < cross_ratio p q a b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < cross_ratio p q a b

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
assume "\<not> B\<^sub>\<real> (cart2_pt p) (cart2_pt b) (cart2_pt a)" (is "\<not> B\<^sub>\<real> ?cp ?cb ?ca")
[PROOF STATE]
proof (state)
this:
\<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
from \<open>are_endpoints_in_S p q a b\<close>
[PROOF STATE]
proof (chain)
picking this:
are_endpoints_in_S p q a b
[PROOF STEP]
have "are_endpoints_in_S p q b a"
[PROOF STATE]
proof (prove)
using this:
are_endpoints_in_S p q a b

goal (1 subgoal):
 1. are_endpoints_in_S p q b a
[PROOF STEP]
by (rule are_endpoints_in_S_swap_34)
[PROOF STATE]
proof (state)
this:
are_endpoints_in_S p q b a

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
from \<open>are_endpoints_in_S p q a b\<close>
[PROOF STATE]
proof (chain)
picking this:
are_endpoints_in_S p q a b
[PROOF STEP]
have "p \<in> S" and "a \<in> hyp2" and "b \<in> hyp2" and "proj2_set_Col {p,q,a,b}"
[PROOF STATE]
proof (prove)
using this:
are_endpoints_in_S p q a b

goal (1 subgoal):
 1. (p \<in> S &&& a \<in> hyp2) &&& b \<in> hyp2 &&& proj2_set_Col {p, q, a, b}
[PROOF STEP]
by (unfold are_endpoints_in_S_def) simp_all
[PROOF STATE]
proof (state)
this:
p \<in> S
a \<in> hyp2
b \<in> hyp2
proj2_set_Col {p, q, a, b}

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
from \<open>proj2_set_Col {p,q,a,b}\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_set_Col {p, q, a, b}
[PROOF STEP]
have "proj2_set_Col {p,a,b}"
[PROOF STATE]
proof (prove)
using this:
proj2_set_Col {p, q, a, b}

goal (1 subgoal):
 1. proj2_set_Col {p, a, b}
[PROOF STEP]
by (simp add: proj2_subset_Col [of "{p,a,b}" "{p,q,a,b}"])
[PROOF STATE]
proof (state)
this:
proj2_set_Col {p, a, b}

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
hence "proj2_Col p a b"
[PROOF STATE]
proof (prove)
using this:
proj2_set_Col {p, a, b}

goal (1 subgoal):
 1. proj2_Col p a b
[PROOF STEP]
by (subst proj2_Col_iff_set_Col)
[PROOF STATE]
proof (state)
this:
proj2_Col p a b

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
with \<open>p \<in> S\<close> and \<open>a \<in> hyp2\<close> and \<open>b \<in> hyp2\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<in> S
a \<in> hyp2
b \<in> hyp2
proj2_Col p a b
[PROOF STEP]
have "B\<^sub>\<real> ?cp ?ca ?cb \<or> B\<^sub>\<real> ?cp ?cb ?ca"
[PROOF STATE]
proof (prove)
using this:
p \<in> S
a \<in> hyp2
b \<in> hyp2
proj2_Col p a b

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt p cart2_pt a cart2_pt b \<or> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a
[PROOF STEP]
by (simp add: S_at_edge)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt p cart2_pt a cart2_pt b \<or> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
with \<open>\<not> B\<^sub>\<real> ?cp ?cb ?ca\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a
B\<^sub>\<real> cart2_pt p cart2_pt a cart2_pt b \<or> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a
[PROOF STEP]
have "B\<^sub>\<real> ?cp ?ca ?cb"
[PROOF STATE]
proof (prove)
using this:
\<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a
B\<^sub>\<real> cart2_pt p cart2_pt a cart2_pt b \<or> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt p cart2_pt a cart2_pt b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt p cart2_pt a cart2_pt b

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
hence "B\<^sub>\<real> ?cb ?ca ?cp"
[PROOF STATE]
proof (prove)
using this:
B\<^sub>\<real> cart2_pt p cart2_pt a cart2_pt b

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt b cart2_pt a cart2_pt p
[PROOF STEP]
by (rule real_euclid.th3_2)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt b cart2_pt a cart2_pt p

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
with \<open>are_endpoints_in_S p q b a\<close>
[PROOF STATE]
proof (chain)
picking this:
are_endpoints_in_S p q b a
B\<^sub>\<real> cart2_pt b cart2_pt a cart2_pt p
[PROOF STEP]
have "cross_ratio p q b a \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
are_endpoints_in_S p q b a
B\<^sub>\<real> cart2_pt b cart2_pt a cart2_pt p

goal (1 subgoal):
 1. 1 \<le> cross_ratio p q b a
[PROOF STEP]
by (rule are_endpoints_in_S_ordered_cross_ratio)
[PROOF STATE]
proof (state)
this:
1 \<le> cross_ratio p q b a

goal (1 subgoal):
 1. \<not> B\<^sub>\<real> cart2_pt p cart2_pt b cart2_pt a \<Longrightarrow> 0 < cross_ratio p q a b
[PROOF STEP]
thus "cross_ratio p q a b > 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> cross_ratio p q b a

goal (1 subgoal):
 1. 0 < cross_ratio p q a b
[PROOF STEP]
by (subst cross_ratio_swap_34) simp
[PROOF STATE]
proof (state)
this:
0 < cross_ratio p q a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_bind_commute [monad_rule]:
  fixes A :: "'a set" and B :: "'b set"
  shows "A \<bind> (\<lambda>x. B \<bind> C x) = B \<bind> (\<lambda>y. A \<bind> (\<lambda>x. C x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<bind> (\<lambda>x. B \<bind> C x) = B \<bind> (\<lambda>y. A \<bind> (\<lambda>x. C x y))
[PROOF STEP]
unfolding Set.bind_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. Bex ((\<lambda>x. {xa. Bex (C x ` B) ((\<in>) xa)}) ` A) ((\<in>) x)} = {x. Bex ((\<lambda>y. {x. Bex ((\<lambda>x. C x y) ` A) ((\<in>) x)}) ` B) ((\<in>) x)}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in idom_hom) hom_prod_root_unity: "map_poly hom (prod_root_unity n) = prod_root_unity n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly hom (prod_root_unity n) = prod_root_unity n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_poly hom (prod_root_unity n) = prod_root_unity n
[PROOF STEP]
interpret p: map_poly_comm_ring_hom hom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_comm_ring_hom hom
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_poly hom (prod_root_unity n) = prod_root_unity n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly hom (prod_root_unity n) = prod_root_unity n
[PROOF STEP]
unfolding prod_root_unity_def p.hom_prod_list map_map o_def hom_root_unity
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map root_unity n) = prod_list (map root_unity n)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
map_poly hom (prod_root_unity n) = prod_root_unity n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_to_iarray_invertible[code_unfold]:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
shows "invertible A = invertible_iarray (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible A = invertible_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding invertible_iarray_def invertible_eq_full_rank[of A] matrix_to_iarray_rank matrix_to_iarray_nrows
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rank_iarray (matrix_to_iarray A) = nrows_iarray (matrix_to_iarray A)) = (rank_iarray (matrix_to_iarray A) = nrows_iarray (matrix_to_iarray A))
[PROOF STEP]
..