[STATEMENT]
lemma Gromov_converging_at_infinity_isometry:
  fixes f::"'a::Gromov_hyperbolic_space \<Rightarrow> 'b::Gromov_hyperbolic_space"
  assumes "isometry_on UNIV f"
  shows "Gromov_converging_at_boundary (\<lambda>n. f (u n)) \<longleftrightarrow> Gromov_converging_at_boundary u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n)) = Gromov_converging_at_boundary u
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n)) \<Longrightarrow> Gromov_converging_at_boundary u
 2. Gromov_converging_at_boundary u \<Longrightarrow> Gromov_converging_at_boundary (\<lambda>n. f (u n))
[PROOF STEP]
assume *: "Gromov_converging_at_boundary u"
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary u

goal (2 subgoals):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n)) \<Longrightarrow> Gromov_converging_at_boundary u
 2. Gromov_converging_at_boundary u \<Longrightarrow> Gromov_converging_at_boundary (\<lambda>n. f (u n))
[PROOF STEP]
show "Gromov_converging_at_boundary (\<lambda>n. f (u n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n))
[PROOF STEP]
apply (rule Gromov_converging_at_boundaryI[of "f (basepoint)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
Gromov_converging_at_boundary u

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))
[PROOF STEP]
unfolding Gromov_converging_at_boundary_def Gromov_product_isometry[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<forall>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (u m) (u n)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at basepoint (u m) (u n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary (\<lambda>n. f (u n))

goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n)) \<Longrightarrow> Gromov_converging_at_boundary u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n)) \<Longrightarrow> Gromov_converging_at_boundary u
[PROOF STEP]
assume *: "Gromov_converging_at_boundary (\<lambda>n. f (u n))"
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary (\<lambda>n. f (u n))

goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n)) \<Longrightarrow> Gromov_converging_at_boundary u
[PROOF STEP]
have **: "\<exists>N. \<forall>n \<ge> N. \<forall>m \<ge> N. M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))" for M
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
Gromov_converging_at_boundary (\<lambda>n. f (u n))

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))
[PROOF STEP]
unfolding Gromov_converging_at_boundary_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (f (u m)) (f (u n))

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. ?M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))

goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (u n)) \<Longrightarrow> Gromov_converging_at_boundary u
[PROOF STEP]
show "Gromov_converging_at_boundary u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u
[PROOF STEP]
apply (rule Gromov_converging_at_boundaryI[of "basepoint"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at basepoint (u m) (u n)
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. ?M \<le> Gromov_product_at (f basepoint) (f (u m)) (f (u n))

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at basepoint (u m) (u n)
[PROOF STEP]
unfolding Gromov_converging_at_boundary_def Gromov_product_isometry[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. ?M \<le> Gromov_product_at basepoint (u m) (u n)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at basepoint (u m) (u n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma residual_block_size [simp]:
  assumes "b \<in># \<B>\<^sup>R"
  shows "card b = \<k> - \<Lambda>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card b = \<k> - \<Lambda>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card b = \<k> - \<Lambda>
[PROOF STEP]
obtain bl2 where sub: "b = bl2 - bl" and mem: "bl2 \<in># remove1_mset bl \<B>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>bl2. \<lbrakk>b = bl2 - bl; bl2 \<in># remove1_mset bl \<B>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms residual_blocks_def
[PROOF STATE]
proof (prove)
using this:
b \<in># \<B>\<^sup>R
\<B>\<^sup>R \<equiv> {#b - bl. b \<in># remove1_mset bl \<B>#}

goal (1 subgoal):
 1. (\<And>bl2. \<lbrakk>b = bl2 - bl; bl2 \<in># remove1_mset bl \<B>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = bl2 - bl
bl2 \<in># remove1_mset bl \<B>

goal (1 subgoal):
 1. card b = \<k> - \<Lambda>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = bl2 - bl
bl2 \<in># remove1_mset bl \<B>
[PROOF STEP]
have "card b = card bl2 - card (bl2 \<inter> bl)"
[PROOF STATE]
proof (prove)
using this:
b = bl2 - bl
bl2 \<in># remove1_mset bl \<B>

goal (1 subgoal):
 1. card b = card bl2 - card (bl2 \<inter> bl)
[PROOF STEP]
using card_Diff_subset_Int valid_block finite_blocks
[PROOF STATE]
proof (prove)
using this:
b = bl2 - bl
bl2 \<in># remove1_mset bl \<B>
finite (?A \<inter> ?B) \<Longrightarrow> card (?A - ?B) = card ?A - card (?A \<inter> ?B)
bl \<in># \<B>
?b \<in># \<B> \<Longrightarrow> finite ?b

goal (1 subgoal):
 1. card b = card bl2 - card (bl2 \<inter> bl)
[PROOF STEP]
by (simp add: card_Diff_subset_Int)
[PROOF STATE]
proof (state)
this:
card b = card bl2 - card (bl2 \<inter> bl)

goal (1 subgoal):
 1. card b = \<k> - \<Lambda>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card b = card bl2 - card (bl2 \<inter> bl)
[PROOF STEP]
have "card b = card bl2 - bl2 |\<inter>| bl"
[PROOF STATE]
proof (prove)
using this:
card b = card bl2 - card (bl2 \<inter> bl)

goal (1 subgoal):
 1. card b = card bl2 - bl2 |\<inter>| bl
[PROOF STEP]
using finite_blocks card_inter_lt_single
[PROOF STATE]
proof (prove)
using this:
card b = card bl2 - card (bl2 \<inter> bl)
?b \<in># \<B> \<Longrightarrow> finite ?b
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> card (?A \<inter> ?B) \<le> card ?A

goal (1 subgoal):
 1. card b = card bl2 - bl2 |\<inter>| bl
[PROOF STEP]
by (simp add: intersection_number_def)
[PROOF STATE]
proof (state)
this:
card b = card bl2 - bl2 |\<inter>| bl

goal (1 subgoal):
 1. card b = \<k> - \<Lambda>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card b = card bl2 - bl2 |\<inter>| bl

goal (1 subgoal):
 1. card b = \<k> - \<Lambda>
[PROOF STEP]
using sym_block_intersections_index uniform
[PROOF STATE]
proof (prove)
using this:
card b = card bl2 - bl2 |\<inter>| bl
\<lbrakk>?b1.0 \<in># \<B>; ?b2.0 \<in># remove1_mset ?b1.0 \<B>\<rbrakk> \<Longrightarrow> ?b1.0 |\<inter>| ?b2.0 = \<Lambda>
?bl \<in># \<B> \<Longrightarrow> card ?bl = \<k>

goal (1 subgoal):
 1. card b = \<k> - \<Lambda>
[PROOF STEP]
by (metis valid_block in_diffD intersect_num_commute mem)
[PROOF STATE]
proof (state)
this:
card b = \<k> - \<Lambda>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma x1_gt_1: "x\<^sub>1 > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < x\<^sub>1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < x\<^sub>1
[PROOF STEP]
from bs_nonempty
[PROOF STATE]
proof (chain)
picking this:
bs \<noteq> []
[PROOF STEP]
obtain b where "b \<in> set bs"
[PROOF STATE]
proof (prove)
using this:
bs \<noteq> []

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

goal (1 subgoal):
 1. 1 < x\<^sub>1
[PROOF STEP]
from b_pos[OF this] b_less_1[OF this] x0_ge_1
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
1 \<le> x\<^sub>0
[PROOF STEP]
have "1 < 2 * x\<^sub>0 * inverse b"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
1 \<le> x\<^sub>0

goal (1 subgoal):
 1. 1 < 2 * x\<^sub>0 * inverse b
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
1 < 2 * x\<^sub>0 * inverse b

goal (1 subgoal):
 1. 1 < x\<^sub>1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 < 2 * x\<^sub>0 * inverse b

goal (1 subgoal):
 1. 1 < x\<^sub>1
[PROOF STEP]
from x1_ge and \<open>b \<in> set bs\<close>
[PROOF STATE]
proof (chain)
picking this:
?b \<in> set bs \<Longrightarrow> 2 * x\<^sub>0 * inverse ?b \<le> x\<^sub>1
b \<in> set bs
[PROOF STEP]
have "... \<le> x\<^sub>1"
[PROOF STATE]
proof (prove)
using this:
?b \<in> set bs \<Longrightarrow> 2 * x\<^sub>0 * inverse ?b \<le> x\<^sub>1
b \<in> set bs

goal (1 subgoal):
 1. 2 * x\<^sub>0 * inverse b \<le> x\<^sub>1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * x\<^sub>0 * inverse b \<le> x\<^sub>1

goal (1 subgoal):
 1. 1 < x\<^sub>1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < x\<^sub>1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < x\<^sub>1

goal (1 subgoal):
 1. 1 < x\<^sub>1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 < x\<^sub>1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all2_o: "list_all2 (P o f) al bl = list_all2 P (map f al) bl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (P \<circ> f) al bl = list_all2 P (map f al) bl
[PROOF STEP]
unfolding list_all2_map1 comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (\<lambda>x. P (f x)) al bl = list_all2 (\<lambda>x. P (f x)) al bl
[PROOF STEP]
..


[STATEMENT]
lemma formulaEntailsItsClauses:
  fixes clause :: Clause and formula :: Formula
  assumes "clause el formula"
  shows "formulaEntailsClause formula clause"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. formulaEntailsClause formula clause
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
clause el formula

goal (1 subgoal):
 1. formulaEntailsClause formula clause
[PROOF STEP]
by (simp add: formulaEntailsClause_def formulaTrueIffAllClausesAreTrue)


[STATEMENT]
lemma is_subgraphI[intro]: "V' \<subseteq> V \<Longrightarrow> E' \<subseteq> E \<Longrightarrow> graph_system V' E' \<Longrightarrow> graph_system V E \<Longrightarrow> subgraph V' E' V E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>V' \<subseteq> V; E' \<subseteq> E; graph_system V' E'; graph_system V E\<rbrakk> \<Longrightarrow> subgraph V' E' V E
[PROOF STEP]
using graph_system_def
[PROOF STATE]
proof (prove)
using this:
graph_system ?vertices ?edges \<equiv> \<forall>e. e \<in> ?edges \<longrightarrow> e \<subseteq> ?vertices

goal (1 subgoal):
 1. \<lbrakk>V' \<subseteq> V; E' \<subseteq> E; graph_system V' E'; graph_system V E\<rbrakk> \<Longrightarrow> subgraph V' E' V E
[PROOF STEP]
by (unfold_locales)
    (auto simp add: graph_system.incident_def graph_system.incident_edge_in_wf)


[STATEMENT]
lemma kernel_of_under_inj_map:
  assumes "inj_on f (set x)"
  shows "kernel_of x = kernel_of (map f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kernel_of x = kernel_of (map f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. kernel_of x = kernel_of (map f x)
[PROOF STEP]
have "\<And>i j. i < length x \<Longrightarrow> j < length x
    \<Longrightarrow> (map f x) ! i = (map f x) ! j \<Longrightarrow> x ! i = x ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length x; j < length x; map f x ! i = map f x ! j\<rbrakk> \<Longrightarrow> x ! i = x ! j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on f (set x)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length x; j < length x; map f x ! i = map f x ! j\<rbrakk> \<Longrightarrow> x ! i = x ! j
[PROOF STEP]
by (simp add: inj_on_eq_iff)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < length x; ?j < length x; map f x ! ?i = map f x ! ?j\<rbrakk> \<Longrightarrow> x ! ?i = x ! ?j

goal (1 subgoal):
 1. kernel_of x = kernel_of (map f x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < length x; ?j < length x; map f x ! ?i = map f x ! ?j\<rbrakk> \<Longrightarrow> x ! ?i = x ! ?j

goal (1 subgoal):
 1. kernel_of x = kernel_of (map f x)
[PROOF STEP]
unfolding kernel_of_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < length x; ?j < length x; map f x ! ?i = map f x ! ?j\<rbrakk> \<Longrightarrow> x ! ?i = x ! ?j

goal (1 subgoal):
 1. {(i, j). i < length x \<and> j < length x \<and> x ! i = x ! j} = {(i, j). i < length (map f x) \<and> j < length (map f x) \<and> map f x ! i = map f x ! j}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
kernel_of x = kernel_of (map f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem ipath_mkTree_Saturated:
  assumes "s \<in> S" and "fair rs" and "ipath (mkTree rs s) steps"
  shows "Saturated steps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Saturated steps
[PROOF STEP]
unfolding Saturated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r\<in>R. saturated r steps
[PROOF STEP]
using ipath_mkTree_saturated[OF assms]
[PROOF STATE]
proof (prove)
using this:
?r \<in> R \<Longrightarrow> saturated ?r steps

goal (1 subgoal):
 1. \<forall>r\<in>R. saturated r steps
[PROOF STEP]
by blast


[STATEMENT]
lemma boundedBy0: "boundedBy 0 A = (A = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boundedBy 0 A = (A = {})
[PROOF STEP]
apply(simp add: boundedBy_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a b. (a, b) \<notin> A) = (A = {})
[PROOF STEP]
apply(auto simp add: boundedBy_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mat1_mult_right: assumes wf: "mat nr nc m"
  shows "mat_mult nr m (mat1 nc) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mult nr m (mat1 nc) = m
[PROOF STEP]
proof (rule mat_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_mult nr m (mat1 nc))
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_mult nr m (mat1 nc) ! i ! j = m ! i ! j
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_mult nr m (mat1 nc))
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_mult nr m (mat1 nc) ! i ! j = m ! i ! j
[PROOF STEP]
assume i: "i < nc" and j: "j < nr"
[PROOF STATE]
proof (state)
this:
i < nc
j < nr

goal (3 subgoals):
 1. mat ?nr ?nc (mat_mult nr m (mat1 nc))
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_mult nr m (mat1 nc) ! i ! j = m ! i ! j
[PROOF STEP]
show "mat_mult nr m (mat1 nc) ! i ! j = m ! i ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mult nr m (mat1 nc) ! i ! j = m ! i ! j
[PROOF STEP]
by (unfold mat_mult_index[OF wf mat1 j i]
     col_mat1[OF i]
     scalar_right_one[OF row[OF wf j] i]
     row_col[OF wf j i],
     unfold col_def, simp)
[PROOF STATE]
proof (state)
this:
mat_mult nr m (mat1 nc) ! i ! j = m ! i ! j

goal (2 subgoals):
 1. mat nr nc (mat_mult nr m (mat1 nc))
 2. mat nr nc m
[PROOF STEP]
qed (insert wf, auto)


[STATEMENT]
lemma llength_drop_take:
  "t\<up>i \<noteq> LNil \<Longrightarrow> llength (t\<down>i) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<up> i \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> i) = i
[PROOF STEP]
proof (induct i arbitrary: t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t. t \<up> 0 \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> 0) = 0
 2. \<And>i t. \<lbrakk>\<And>t. t \<up> i \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> i) = i; t \<up> Suc i \<noteq> LNil\<rbrakk> \<Longrightarrow> LList2.llength (t \<down> Suc i) = Suc i
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
t \<up> 0 \<noteq> LNil

goal (2 subgoals):
 1. \<And>t. t \<up> 0 \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> 0) = 0
 2. \<And>i t. \<lbrakk>\<And>t. t \<up> i \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> i) = i; t \<up> Suc i \<noteq> LNil\<rbrakk> \<Longrightarrow> LList2.llength (t \<down> Suc i) = Suc i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LList2.llength (t \<down> 0) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LList2.llength (t \<down> 0) = 0

goal (1 subgoal):
 1. \<And>i t. \<lbrakk>\<And>t. t \<up> i \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> i) = i; t \<up> Suc i \<noteq> LNil\<rbrakk> \<Longrightarrow> LList2.llength (t \<down> Suc i) = Suc i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i t. \<lbrakk>\<And>t. t \<up> i \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> i) = i; t \<up> Suc i \<noteq> LNil\<rbrakk> \<Longrightarrow> LList2.llength (t \<down> Suc i) = Suc i
[PROOF STEP]
case (Suc j)
[PROOF STATE]
proof (state)
this:
?t \<up> j \<noteq> LNil \<Longrightarrow> LList2.llength (?t \<down> j) = j
t \<up> Suc j \<noteq> LNil

goal (1 subgoal):
 1. \<And>i t. \<lbrakk>\<And>t. t \<up> i \<noteq> LNil \<Longrightarrow> LList2.llength (t \<down> i) = i; t \<up> Suc i \<noteq> LNil\<rbrakk> \<Longrightarrow> LList2.llength (t \<down> Suc i) = Suc i
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?t \<up> j \<noteq> LNil \<Longrightarrow> LList2.llength (?t \<down> j) = j
t \<up> Suc j \<noteq> LNil

goal (1 subgoal):
 1. LList2.llength (t \<down> Suc j) = Suc j
[PROOF STEP]
by (cases t) (auto simp: llength_LCons [of _ UNIV])
[PROOF STATE]
proof (state)
this:
LList2.llength (t \<down> Suc j) = Suc j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sophomores_dream_aux_integral:
  "((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..}
[PROOF STEP]
using Gamma_integral_real[of "n + 1"]
[PROOF STATE]
proof (prove)
using this:
0 < real (n + 1) \<Longrightarrow> ((\<lambda>t. t powr (real (n + 1) - 1) / exp t) has_integral Gamma (real (n + 1))) {0..}

goal (1 subgoal):
 1. ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..}
[PROOF STEP]
by (auto simp: Gamma_fact powr_realpow)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "?this \<longleftrightarrow> ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..} = ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0<..}
[PROOF STEP]
proof (rule has_integral_spike_set_eq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}
 2. negligible {x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
have eq: "{x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0} = {}

goal (2 subgoals):
 1. negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}
 2. negligible {x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
thus "negligible {x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
{x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0} = {}

goal (1 subgoal):
 1. negligible {x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
by (subst eq) auto
[PROOF STATE]
proof (state)
this:
negligible {x \<in> {0<..} - {0..}. x powr real n / exp x \<noteq> 0}

goal (1 subgoal):
 1. negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
have "{x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0} \<subseteq> {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0} \<subseteq> {0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0} \<subseteq> {0}

goal (1 subgoal):
 1. negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0} \<subseteq> {0}

goal (1 subgoal):
 1. negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
have "negligible {0::real}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible {0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
negligible {0}

goal (1 subgoal):
 1. negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0} \<subseteq> {0}
negligible {0}
[PROOF STEP]
show "negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
{x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0} \<subseteq> {0}
negligible {0}

goal (1 subgoal):
 1. negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}
[PROOF STEP]
by (meson negligible_subset)
[PROOF STATE]
proof (state)
this:
negligible {x \<in> {0..} - {0<..}. x powr real n / exp x \<noteq> 0}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..} = ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr real n / exp t) has_integral fact n) {0..} = ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>t::real. t ^ n / exp t) has_integral fact n) {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t powr real n / exp t) has_integral fact n) {0<..} = ((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}
[PROOF STEP]
by (intro has_integral_spike_eq) (auto simp: powr_realpow)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr real n / exp t) has_integral fact n) {0<..} = ((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}
[PROOF STEP]
have 1: "((\<lambda>t::real. t ^ n / exp t) has_integral fact n) {0<..}"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}

goal (1 subgoal):
 1. ((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "(\<lambda>x::real. \<bar>x\<bar> ^ n / exp x) integrable_on {0<..} \<longleftrightarrow>
        (\<lambda>x::real. x ^ n / exp x) integrable_on {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>x\<bar> ^ n / exp x) integrable_on {0<..}) = ((\<lambda>x. x ^ n / exp x) integrable_on {0<..})
[PROOF STEP]
by (intro integrable_cong) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>x\<bar> ^ n / exp x) integrable_on {0<..}) = ((\<lambda>x. x ^ n / exp x) integrable_on {0<..})

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
hence 2: "(\<lambda>t::real. t ^ n / exp t) absolutely_integrable_on {0<..}"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>x\<bar> ^ n / exp x) integrable_on {0<..}) = ((\<lambda>x. x ^ n / exp x) integrable_on {0<..})

goal (1 subgoal):
 1. (\<lambda>t. t ^ n / exp t) absolutely_integrable_on {0<..}
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>x\<bar> ^ n / exp x) integrable_on {0<..}) = ((\<lambda>x. x ^ n / exp x) integrable_on {0<..})
((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}

goal (1 subgoal):
 1. (\<lambda>t. t ^ n / exp t) absolutely_integrable_on {0<..}
[PROOF STEP]
by (simp add: absolutely_integrable_on_def power_abs has_integral_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t ^ n / exp t) absolutely_integrable_on {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
define g :: "real \<Rightarrow> real" where "g = (\<lambda>x. -ln x * (n + 1))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>x. - ln x * real (n + 1))

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
define g' :: "real \<Rightarrow> real" where "g' = (\<lambda>x. -(n + 1) / x)"
[PROOF STATE]
proof (state)
this:
g' = (/) (real_of_int (- int (n + 1)))

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
define h :: "real \<Rightarrow> real" where "h = (\<lambda>u. exp (-u / (n + 1)))"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>u. exp (- u / real (n + 1)))

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have bij: "bij_betw g {0<..<1} {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw g {0<..<1} {0<..}
[PROOF STEP]
by (rule bij_betwI[of _ _ _ h]) (auto simp: g_def h_def mult_neg_pos)
[PROOF STATE]
proof (state)
this:
bij_betw g {0<..<1} {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have deriv: "(g has_real_derivative g' x) (at x within {0<..<1})"
    if "x \<in> {0<..<1}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_real_derivative g' x) (at x within {0<..<1})
[PROOF STEP]
unfolding g_def g'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - ln x * real (n + 1)) has_real_derivative real_of_int (- int (n + 1)) / x) (at x within {0<..<1})
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. - ln x * real (n + 1)) has_real_derivative real_of_int (- int (n + 1)) / x) (at x within {0<..<1})
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: field_simps)
[PROOF STATE]
proof (state)
this:
?x \<in> {0<..<1} \<Longrightarrow> (g has_real_derivative g' ?x) (at ?x within {0<..<1})

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "(\<lambda>t::real. t ^ n / exp t) absolutely_integrable_on g ` {0<..<1} \<and>
        integral (g ` {0<..<1}) (\<lambda>t::real. t ^ n / exp t) = fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. t ^ n / exp t) absolutely_integrable_on g ` {0<..<1} \<and> integral (g ` {0<..<1}) (\<lambda>t. t ^ n / exp t) = fact n
[PROOF STEP]
using 1 2 bij
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. t ^ n / exp t) has_integral fact n) {0<..}
(\<lambda>t. t ^ n / exp t) absolutely_integrable_on {0<..}
bij_betw g {0<..<1} {0<..}

goal (1 subgoal):
 1. (\<lambda>t. t ^ n / exp t) absolutely_integrable_on g ` {0<..<1} \<and> integral (g ` {0<..<1}) (\<lambda>t. t ^ n / exp t) = fact n
[PROOF STEP]
by (simp add: bij_betw_def has_integral_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t ^ n / exp t) absolutely_integrable_on g ` {0<..<1} \<and> integral (g ` {0<..<1}) (\<lambda>t. t ^ n / exp t) = fact n

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t ^ n / exp t) absolutely_integrable_on g ` {0<..<1} \<and> integral (g ` {0<..<1}) (\<lambda>t. t ^ n / exp t) = fact n

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "?this \<longleftrightarrow> ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) absolutely_integrable_on {0<..<1} \<and>
                       integral {0<..<1} (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) = fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t ^ n / exp t) absolutely_integrable_on g ` {0<..<1} \<and> integral (g ` {0<..<1}) (\<lambda>t. t ^ n / exp t) = fact n) = ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) absolutely_integrable_on {0<..<1} \<and> integral {0<..<1} (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) = fact n)
[PROOF STEP]
by (intro has_absolute_integral_change_of_variables_1' [symmetric] deriv)
       (auto simp: inj_on_def g_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t ^ n / exp t) absolutely_integrable_on g ` {0<..<1} \<and> integral (g ` {0<..<1}) (\<lambda>t. t ^ n / exp t) = fact n) = ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) absolutely_integrable_on {0<..<1} \<and> integral {0<..<1} (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) = fact n)

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) absolutely_integrable_on {0<..<1} \<and> integral {0<..<1} (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) = fact n
[PROOF STEP]
have "((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) absolutely_integrable_on {0<..<1} \<and> integral {0<..<1} (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) = fact n

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1}
[PROOF STEP]
using eq_integralD set_lebesgue_integral_eq_integral(1)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) absolutely_integrable_on {0<..<1} \<and> integral {0<..<1} (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) = fact n
integral ?k ?f = ?y \<Longrightarrow> (?f has_integral ?y) ?k \<or> \<not> ?f integrable_on ?k \<and> ?y = (0::?'a)
?f absolutely_integrable_on ?S \<Longrightarrow> ?f integrable_on ?S

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "?this \<longleftrightarrow>
     ((\<lambda>x::real. ((-1)^n*(n+1)^(n+1)) *\<^sub>R (ln x ^ n * x ^ n)) has_integral fact n) {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1} = ((\<lambda>x. real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)) has_integral fact n) {0<..<1}
[PROOF STEP]
proof (rule has_integral_cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
assume x: "x \<in> {0<..<1}"
[PROOF STATE]
proof (state)
this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
have "\<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) =
            (-1) ^ n * (real n + 1) ^ (n + 1) * ln x ^ n * (exp (ln x * (n + 1)) / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = (- 1) ^ n * (real n + 1) ^ (n + 1) * ln x ^ n * (exp (ln x * real (n + 1)) / x)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = (- 1) ^ n * (real n + 1) ^ (n + 1) * ln x ^ n * (exp (ln x * real (n + 1)) / x)
[PROOF STEP]
by (simp add: g_def g'_def exp_minus power_minus' divide_simps add_ac)
[PROOF STATE]
proof (state)
this:
\<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = (- 1) ^ n * (real n + 1) ^ (n + 1) * ln x ^ n * (exp (ln x * real (n + 1)) / x)

goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = (- 1) ^ n * (real n + 1) ^ (n + 1) * ln x ^ n * (exp (ln x * real (n + 1)) / x)

goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
have "exp (ln x * (n + 1)) = x powr real (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (ln x * real (n + 1)) = x powr real (n + 1)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. exp (ln x * real (n + 1)) = x powr real (n + 1)
[PROOF STEP]
by (simp add: powr_def)
[PROOF STATE]
proof (state)
this:
exp (ln x * real (n + 1)) = x powr real (n + 1)

goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (ln x * real (n + 1)) = x powr real (n + 1)

goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
have "\<dots> / x = x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr real (n + 1) / x = x ^ n
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. x powr real (n + 1) / x = x ^ n
[PROOF STEP]
by (subst powr_realpow) auto
[PROOF STATE]
proof (state)
this:
x powr real (n + 1) / x = x ^ n

goal (1 subgoal):
 1. \<And>x. x \<in> {0<..<1} \<Longrightarrow> \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = (- 1) ^ n * (real n + 1) ^ (n + 1) * ln x ^ n * x ^ n
[PROOF STEP]
show "\<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) =
                    ((-1)^n*(n+1)^(n+1)) *\<^sub>R (ln x ^ n * x ^ n)"
[PROOF STATE]
proof (prove)
using this:
\<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = (- 1) ^ n * (real n + 1) ^ (n + 1) * ln x ^ n * x ^ n

goal (1 subgoal):
 1. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x)) = real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1} = ((\<lambda>x. real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)) has_integral fact n) {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R (g x ^ n / exp (g x))) has_integral fact n) {0<..<1} = ((\<lambda>x. real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)) has_integral fact n) {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>x::real. ln x ^ n * x ^ n) has_integral
                      fact n /\<^sub>R real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1)))) {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)) has_integral fact n) {0<..<1} = ((\<lambda>x. ln x ^ n * x ^ n) has_integral fact n /\<^sub>R real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1)))) {0<..<1}
[PROOF STEP]
by (intro has_integral_cmul_iff') (auto simp del: power_Suc)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)) has_integral fact n) {0<..<1} = ((\<lambda>x. ln x ^ n * x ^ n) has_integral fact n /\<^sub>R real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1)))) {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) *\<^sub>R (ln x ^ n * x ^ n)) has_integral fact n) {0<..<1} = ((\<lambda>x. ln x ^ n * x ^ n) has_integral fact n /\<^sub>R real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1)))) {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
have "fact n /\<^sub>R real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) =
             (-1) ^ n * fact n / (n+1) ^ (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n /\<^sub>R real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) = (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))
[PROOF STEP]
by (auto simp: divide_simps)
[PROOF STATE]
proof (state)
this:
fact n /\<^sub>R real_of_int ((- 1) ^ n * int ((n + 1) ^ (n + 1))) = (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. ln x ^ n * x ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. ln x ^ n * x ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}

goal (1 subgoal):
 1. ((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}
[PROOF STEP]
by (simp add: power_mult_distrib mult_ac)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (x * ln x) ^ n) has_integral (- 1) ^ n * fact n / real ((n + 1) ^ (n + 1))) {0<..<1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coplanar_perm_6:
  assumes "Coplanar A B C D"
  shows "Coplanar B A C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar B A C D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Coplanar B A C D
[PROOF STEP]
obtain X where P1: "(Col A B X \<and> Col C D X) \<or> (Col A C X \<and> Col B D X) \<or> (Col A D X \<and> Col B C X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Coplanar_def assms
[PROOF STATE]
proof (prove)
using this:
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Coplanar A B C D

goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar B A C D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar B A C D
[PROOF STEP]
using Coplanar_def col_permutation_4
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Col ?A ?B ?C \<Longrightarrow> Col ?B ?A ?C

goal (1 subgoal):
 1. Coplanar B A C D
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Coplanar B A C D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_Collect_neg: "closed {x. P x} \<Longrightarrow> open {x. \<not> P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x} \<Longrightarrow> open {x. \<not> P x}
[PROOF STEP]
unfolding Collect_neg_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x} \<Longrightarrow> open (- {x. P x})
[PROOF STEP]
by (rule open_Compl)


[STATEMENT]
lemma set_update_with_aux:
  "distinct (map fst xs)
  \<Longrightarrow> set (update_with_aux v k f xs) = (set xs - {k} \<times> UNIV \<union> {(k, f (case map_of xs k of None \<Rightarrow> v | Some v \<Rightarrow> v))})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst xs) \<Longrightarrow> set (update_with_aux v k f xs) = set xs - {k} \<times> UNIV \<union> {(k, f (case map_of xs k of None \<Rightarrow> v | Some v \<Rightarrow> v))}
[PROOF STEP]
by(induct xs)(auto intro: rev_image_eqI)


[STATEMENT]
lemma eval_at_point_mult:
  assumes "a \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "A \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "B \<in> carrier ((R[\<X>\<^bsub>n\<^esub>]))"
  shows "eval_at_point R a (A \<otimes>\<^bsub>R[\<X>\<^bsub>n\<^esub>]\<^esub> B) =
          eval_at_point R a A \<otimes>\<^bsub>R\<^esub> eval_at_point R a B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_at_point R a (A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> B) = eval_at_point R a A \<otimes> eval_at_point R a B
[PROOF STEP]
unfolding eval_at_point_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) (A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> B) = total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) A \<otimes> total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) B
[PROOF STEP]
using R.total_eval_mult[of A "{..<n}" B]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier (Pring R {..<n}); B \<in> carrier (Pring R {..<n}); ?g \<in> UNIV \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> total_eval R ?g (A \<otimes>\<^bsub>Pring R {..<n}\<^esub> B) = total_eval R ?g A \<otimes> total_eval R ?g B

goal (1 subgoal):
 1. total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) (A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> B) = total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) A \<otimes> total_eval R (\<lambda>i. if i < length a then a ! i else \<zero>) B
[PROOF STEP]
by (smt assms(1) assms(2) assms(3) cartesian_power_car_memE cartesian_power_car_memE' R.closed_funI coord_ring_def R.zero_closed)


[STATEMENT]
lemma inorder_lookup_ran_eq:
  "\<lbrakk>inv m; sorted1 (inorder m)\<rbrakk> \<Longrightarrow> ran (lookup m) = snd ` set (inorder m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inv m; sorted1 (inorder m)\<rbrakk> \<Longrightarrow> ran (lookup m) = snd ` set (inorder m)
[PROOF STEP]
using inorder_lookup[of m]
[PROOF STATE]
proof (prove)
using this:
inv m \<and> sorted1 (inorder m) \<Longrightarrow> lookup m ?a = map_of (inorder m) ?a

goal (1 subgoal):
 1. \<lbrakk>inv m; sorted1 (inorder m)\<rbrakk> \<Longrightarrow> ran (lookup m) = snd ` set (inorder m)
[PROOF STEP]
unfolding ran_def
[PROOF STATE]
proof (prove)
using this:
inv m \<and> sorted1 (inorder m) \<Longrightarrow> lookup m ?a = map_of (inorder m) ?a

goal (1 subgoal):
 1. \<lbrakk>inv m; sorted1 (inorder m)\<rbrakk> \<Longrightarrow> {b. \<exists>a. lookup m a = Some b} = snd ` set (inorder m)
[PROOF STEP]
by (force simp: sorted_map_of_Some_eq)


[STATEMENT]
lemma lUnionM_Cons [simp]: "lUnionM (x # M) = lunionM x (lUnionM M)" for x M
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lUnionM (x # M) = lunionM x (lUnionM M)
[PROOF STEP]
by(simp add: lUnionM_def)


[STATEMENT]
lemma finite_Init_rhs:
  fixes CS::"(('a::finite) lang) set"
  assumes finite: "finite CS"
  shows "finite (Init_rhs CS X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Init_rhs CS X)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite CS

goal (1 subgoal):
 1. finite (Init_rhs CS X)
[PROOF STEP]
unfolding Init_rhs_def transition_def
[PROOF STATE]
proof (prove)
using this:
finite CS

goal (1 subgoal):
 1. finite (if [] \<in> X then {Lam One} \<union> {Trn Y (Atom c) |Y c. Y \<in> CS \<and> Y \<cdot> {[c]} \<subseteq> X} else {Trn Y (Atom c) |Y c. Y \<in> CS \<and> Y \<cdot> {[c]} \<subseteq> X})
[PROOF STEP]
by simp


[STATEMENT]
lemma differentiable_imp_continuous_on:
  "f differentiable_on s \<Longrightarrow> continuous_on s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f differentiable_on s \<Longrightarrow> continuous_on s f
[PROOF STEP]
unfolding differentiable_on_def continuous_on_eq_continuous_within
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s. f differentiable at x within s \<Longrightarrow> \<forall>x\<in>s. continuous (at x within s) f
[PROOF STEP]
using differentiable_imp_continuous_within
[PROOF STATE]
proof (prove)
using this:
?f differentiable at ?x within ?s \<Longrightarrow> continuous (at ?x within ?s) ?f

goal (1 subgoal):
 1. \<forall>x\<in>s. f differentiable at x within s \<Longrightarrow> \<forall>x\<in>s. continuous (at x within s) f
[PROOF STEP]
by blast


[STATEMENT]
lemma Limit_plus_omega_vsubset_Limit:
  assumes "Limit \<alpha>" and "Limit \<beta>" and "\<alpha> \<in>\<^sub>\<circ> \<beta>"
  shows "\<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
Limit \<alpha>
[PROOF STEP]
have L\<alpha>\<omega>: "Limit (\<alpha> + \<omega>)"
[PROOF STATE]
proof (prove)
using this:
Limit \<alpha>

goal (1 subgoal):
 1. Limit (\<alpha> + \<omega>)
[PROOF STEP]
by (simp add: Limit_is_Ord)
[PROOF STATE]
proof (state)
this:
Limit (\<alpha> + \<omega>)

goal (1 subgoal):
 1. \<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>
[PROOF STEP]
from not_Limit_if_in_Limit_plus_omega[OF assms(1,3)] assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<beta> \<in>\<^sub>\<circ> \<alpha> + \<omega> \<Longrightarrow> \<not> Limit \<beta>
Limit \<beta>
[PROOF STEP]
have
    "\<beta> \<notin>\<^sub>\<circ> \<alpha> + \<omega>"
[PROOF STATE]
proof (prove)
using this:
\<beta> \<in>\<^sub>\<circ> \<alpha> + \<omega> \<Longrightarrow> \<not> Limit \<beta>
Limit \<beta>

goal (1 subgoal):
 1. \<beta> \<notin>\<^sub>\<circ> \<alpha> + \<omega>
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
\<beta> \<notin>\<^sub>\<circ> \<alpha> + \<omega>

goal (1 subgoal):
 1. \<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
Limit \<beta>
\<beta> \<notin>\<^sub>\<circ> \<alpha> + \<omega>
[PROOF STEP]
have "~\<beta> \<subset>\<^sub>\<circ> \<alpha> + \<omega>"
[PROOF STATE]
proof (prove)
using this:
Limit \<beta>
\<beta> \<notin>\<^sub>\<circ> \<alpha> + \<omega>

goal (1 subgoal):
 1. \<not> \<beta> \<subset>\<^sub>\<circ> \<alpha> + \<omega>
[PROOF STEP]
by (blast intro: L\<alpha>\<omega> dest: Ord_mem_iff_lt Limit_is_Ord)
[PROOF STATE]
proof (state)
this:
\<not> \<beta> \<subset>\<^sub>\<circ> \<alpha> + \<omega>

goal (1 subgoal):
 1. \<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> \<beta> \<subset>\<^sub>\<circ> \<alpha> + \<omega>
[PROOF STEP]
show "\<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>"
[PROOF STATE]
proof (prove)
using this:
\<not> \<beta> \<subset>\<^sub>\<circ> \<alpha> + \<omega>

goal (1 subgoal):
 1. \<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>
[PROOF STEP]
by (meson assms L\<alpha>\<omega> Limit_is_Ord Ord_linear2)
[PROOF STATE]
proof (state)
this:
\<alpha> + \<omega> \<subseteq>\<^sub>\<circ> \<beta>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_sel_eq_foldl: "list_sel f x y = foldl (\<lambda>a b. a * list_sel_aux f b y) 1 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_sel f x y = foldl (\<lambda>a b. a * list_sel_aux f b y) 1 x
[PROOF STEP]
apply(induction x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. list_sel f [] y = foldl (\<lambda>a b. a * list_sel_aux f b y) 1 []
 2. \<And>a x. list_sel f x y = foldl (\<lambda>a b. a * list_sel_aux f b y) 1 x \<Longrightarrow> list_sel f (a # x) y = foldl (\<lambda>a b. a * list_sel_aux f b y) 1 (a # x)
[PROOF STEP]
apply(auto)[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x. list_sel f x y = foldl (\<lambda>a b. a * list_sel_aux f b y) 1 x \<Longrightarrow> list_sel_aux f a y * foldl (\<lambda>a b. a * list_sel_aux f b y) 1 x = foldl (\<lambda>a b. a * list_sel_aux f b y) (list_sel_aux f a y) x
[PROOF STEP]
using foldl_acc_extr
[PROOF STATE]
proof (prove)
using this:
foldl (\<lambda>a b. a * ?f ?x b) ?z ?y = ?z * foldl (\<lambda>a b. a * ?f ?x b) 1 ?y

goal (1 subgoal):
 1. \<And>a x. list_sel f x y = foldl (\<lambda>a b. a * list_sel_aux f b y) 1 x \<Longrightarrow> list_sel_aux f a y * foldl (\<lambda>a b. a * list_sel_aux f b y) 1 x = foldl (\<lambda>a b. a * list_sel_aux f b y) (list_sel_aux f a y) x
[PROOF STEP]
by metis


[STATEMENT]
lemma lex_two_order_pair:
  assumes o1: "order_pair s1 ns1" and o2: "order_pair s2 ns2"
  shows "order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
interpret o1: order_pair s1 ns1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order_pair s1 ns1
[PROOF STEP]
using o1
[PROOF STATE]
proof (prove)
using this:
order_pair s1 ns1

goal (1 subgoal):
 1. order_pair s1 ns1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
interpret o2: order_pair s2 ns2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order_pair s2 ns2
[PROOF STEP]
using o2
[PROOF STATE]
proof (prove)
using this:
order_pair s2 ns2

goal (1 subgoal):
 1. order_pair s2 ns2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
note o1.trans_S o1.trans_NS o2.trans_S o2.trans_NS
    o1.compat_NS_S o2.compat_NS_S o1.compat_S_NS o2.compat_S_NS
[PROOF STATE]
proof (state)
this:
trans s1
trans ns1
trans s2
trans ns2
ns1 O s1 \<subseteq> s1
ns2 O s2 \<subseteq> s2
s1 O ns1 \<subseteq> s1
s2 O ns2 \<subseteq> s2

goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
note this [unfolded trans_O_iff]
[PROOF STATE]
proof (state)
this:
s1 O s1 \<subseteq> s1
ns1 O ns1 \<subseteq> ns1
s2 O s2 \<subseteq> s2
ns2 O ns2 \<subseteq> ns2
ns1 O s1 \<subseteq> s1
ns2 O s2 \<subseteq> s2
s1 O ns1 \<subseteq> s1
s2 O ns2 \<subseteq> s2

goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
note o1.refl_NS o2.refl_NS
[PROOF STATE]
proof (state)
this:
refl ns1
refl ns2

goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)
[PROOF STEP]
by (unfold_locales, intro lex_two_refl, fact+, unfold trans_O_iff)
      (rule lex_two_compat2 lex_two_compat'2;fact)+
[PROOF STATE]
proof (state)
this:
order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma carrier_polynomial [intro]: "polynomial K p \<Longrightarrow> polynomial (carrier R) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polynomial K p \<Longrightarrow> polynomial (carrier R) p
[PROOF STEP]
unfolding polynomial_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = [] \<or> set p \<subseteq> K \<and> lead_coeff p \<noteq> \<zero> \<Longrightarrow> p = [] \<or> set p \<subseteq> carrier R \<and> lead_coeff p \<noteq> \<zero>
[PROOF STEP]
using subringE(1)[OF K]
[PROOF STATE]
proof (prove)
using this:
K \<subseteq> carrier R

goal (1 subgoal):
 1. p = [] \<or> set p \<subseteq> K \<and> lead_coeff p \<noteq> \<zero> \<Longrightarrow> p = [] \<or> set p \<subseteq> carrier R \<and> lead_coeff p \<noteq> \<zero>
[PROOF STEP]
by auto


[STATEMENT]
lemma img_mult_closed:"\<lbrakk>Group F; Group G; f \<in> gHom F G; u \<in> f `(carrier F);
v \<in> f `(carrier F)\<rbrakk> \<Longrightarrow> u \<cdot>\<^bsub>G\<^esub> v \<in> f `(carrier F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; u \<in> f ` carrier F; v \<in> f ` carrier F\<rbrakk> \<Longrightarrow> u \<cdot>\<^bsub>G\<^esub> v \<in> f ` carrier F
[PROOF STEP]
apply (simp add:image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; \<exists>x\<in>carrier F. u = f x; \<exists>x\<in>carrier F. v = f x\<rbrakk> \<Longrightarrow> \<exists>x\<in>carrier F. u \<cdot>\<^bsub>G\<^esub> v = f x
[PROOF STEP]
apply ((erule bexE)+, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; u = f x; xa \<in> carrier F; v = f xa\<rbrakk> \<Longrightarrow> \<exists>xb\<in>carrier F. f x \<cdot>\<^bsub>G\<^esub> f xa = f xb
[PROOF STEP]
apply (subst gHom [of "F" "G" "f", THEN sym], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; u = f x; xa \<in> carrier F; v = f xa\<rbrakk> \<Longrightarrow> \<exists>xb\<in>carrier F. f (x \<cdot>\<^bsub>F\<^esub> xa) = f xb
[PROOF STEP]
apply (frule_tac a = x and b = xa in Group.mult_closed [of "F"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; u = f x; xa \<in> carrier F; v = f xa; x \<cdot>\<^bsub>F\<^esub> xa \<in> carrier F\<rbrakk> \<Longrightarrow> \<exists>xb\<in>carrier F. f (x \<cdot>\<^bsub>F\<^esub> xa) = f xb
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma drop_prefix_eq_Some_conv: "drop_prefix xs ys = Some zs \<longleftrightarrow> ys = xs @ zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (drop_prefix xs ys = Some zs) = (ys = xs @ zs)
[PROOF STEP]
by (induction xs ys arbitrary: zs rule: drop_prefix.induct)
    (auto simp: if_split_eq1)


[STATEMENT]
lemma fv_subst_subset: "fv (e[y ::= x]) \<subseteq> (fv e - {y}) \<union> {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv e[y::=x] \<subseteq> fv e - {y} \<union> {x}
[PROOF STEP]
using fv_subst_eq
[PROOF STATE]
proof (prove)
using this:
fv ?e[?y::=?x] = fv ?e - {?y} \<union> (if ?y \<in> fv ?e then {?x} else {})

goal (1 subgoal):
 1. fv e[y::=x] \<subseteq> fv e - {y} \<union> {x}
[PROOF STEP]
by auto


[STATEMENT]
lemma WR_iff_eq_W: "Ord x \<Longrightarrow> WR x y \<longleftrightarrow> y = \<lbrakk>W x\<rbrakk>e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord x \<Longrightarrow> WR x y = (y = \<lbrakk>W x\<rbrakk>e)
[PROOF STEP]
proof (induct x arbitrary: y rule: Ord_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. WR 0 y = (y = \<lbrakk>W 0\<rbrakk>e)
 2. \<And>k y. \<lbrakk>Ord k; \<And>y. WR k y = (y = \<lbrakk>W k\<rbrakk>e)\<rbrakk> \<Longrightarrow> WR (succ k) y = (y = \<lbrakk>W (succ k)\<rbrakk>e)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>y. WR 0 y = (y = \<lbrakk>W 0\<rbrakk>e)
 2. \<And>k y. \<lbrakk>Ord k; \<And>y. WR k y = (y = \<lbrakk>W k\<rbrakk>e)\<rbrakk> \<Longrightarrow> WR (succ k) y = (y = \<lbrakk>W (succ k)\<rbrakk>e)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. WR 0 y = (y = \<lbrakk>W 0\<rbrakk>e)
[PROOF STEP]
by (metis W0 WR0_iff eval_tm.simps(1))
[PROOF STATE]
proof (state)
this:
WR 0 y = (y = \<lbrakk>W 0\<rbrakk>e)

goal (1 subgoal):
 1. \<And>k y. \<lbrakk>Ord k; \<And>y. WR k y = (y = \<lbrakk>W k\<rbrakk>e)\<rbrakk> \<Longrightarrow> WR (succ k) y = (y = \<lbrakk>W (succ k)\<rbrakk>e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k y. \<lbrakk>Ord k; \<And>y. WR k y = (y = \<lbrakk>W k\<rbrakk>e)\<rbrakk> \<Longrightarrow> WR (succ k) y = (y = \<lbrakk>W (succ k)\<rbrakk>e)
[PROOF STEP]
case (succ k)
[PROOF STATE]
proof (state)
this:
Ord k
WR k ?y = (?y = \<lbrakk>W k\<rbrakk>e)

goal (1 subgoal):
 1. \<And>k y. \<lbrakk>Ord k; \<And>y. WR k y = (y = \<lbrakk>W k\<rbrakk>e)\<rbrakk> \<Longrightarrow> WR (succ k) y = (y = \<lbrakk>W (succ k)\<rbrakk>e)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Ord k
WR k ?y = (?y = \<lbrakk>W k\<rbrakk>e)

goal (1 subgoal):
 1. WR (succ k) y = (y = \<lbrakk>W (succ k)\<rbrakk>e)
[PROOF STEP]
by (auto simp: WR_succ_iff q_Eats_def)
[PROOF STATE]
proof (state)
this:
WR (succ k) y = (y = \<lbrakk>W (succ k)\<rbrakk>e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma choose_1:
  assumes "card S = 1"
  shows "\<exists> x. S = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. S = {x}
[PROOF STEP]
using \<open>card S = 1\<close> and card_eq_SucD [of S 0]
[PROOF STATE]
proof (prove)
using this:
card S = 1
card S = Suc 0 \<Longrightarrow> \<exists>b B. S = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {})

goal (1 subgoal):
 1. \<exists>x. S = {x}
[PROOF STEP]
by simp


[STATEMENT]
lemma zip_map_map:
  "zip (map f xs) (map g ys) = map (\<lambda> (x, y). (f x, g y)) (zip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (map f xs) (map g ys) = map2 (\<lambda>x y. (f x, g y)) xs ys
[PROOF STEP]
proof (induct xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. zip (map f []) (map g ys) = map2 (\<lambda>x y. (f x, g y)) [] ys
 2. \<And>a xs ys. (\<And>ys. zip (map f xs) (map g ys) = map2 (\<lambda>x y. (f x, g y)) xs ys) \<Longrightarrow> zip (map f (a # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (a # xs) ys
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
zip (map f xs) (map g ?ys) = map2 (\<lambda>x y. (f x, g y)) xs ?ys

goal (2 subgoals):
 1. \<And>ys. zip (map f []) (map g ys) = map2 (\<lambda>x y. (f x, g y)) [] ys
 2. \<And>a xs ys. (\<And>ys. zip (map f xs) (map g ys) = map2 (\<lambda>x y. (f x, g y)) xs ys) \<Longrightarrow> zip (map f (a # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (a # xs) ys
[PROOF STEP]
note Cons_x_xs = Cons.hyps
[PROOF STATE]
proof (state)
this:
zip (map f xs) (map g ?ys) = map2 (\<lambda>x y. (f x, g y)) xs ?ys

goal (2 subgoals):
 1. \<And>ys. zip (map f []) (map g ys) = map2 (\<lambda>x y. (f x, g y)) [] ys
 2. \<And>a xs ys. (\<And>ys. zip (map f xs) (map g ys) = map2 (\<lambda>x y. (f x, g y)) xs ys) \<Longrightarrow> zip (map f (a # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (a # xs) ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys
[PROOF STEP]
proof (cases ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ys = [] \<Longrightarrow> zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys
 2. \<And>a list. ys = a # list \<Longrightarrow> zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys
[PROOF STEP]
case (Cons y ys')
[PROOF STATE]
proof (state)
this:
ys = y # ys'

goal (2 subgoals):
 1. ys = [] \<Longrightarrow> zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys
 2. \<And>a list. ys = a # list \<Longrightarrow> zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys
[PROOF STEP]
unfolding Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (map f (x # xs)) (map g (y # ys')) = map2 (\<lambda>x y. (f x, g y)) (x # xs) (y # ys')
[PROOF STEP]
using Cons_x_xs
[PROOF STATE]
proof (prove)
using this:
zip (map f xs) (map g ?ys) = map2 (\<lambda>x y. (f x, g y)) xs ?ys

goal (1 subgoal):
 1. zip (map f (x # xs)) (map g (y # ys')) = map2 (\<lambda>x y. (f x, g y)) (x # xs) (y # ys')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys

goal (1 subgoal):
 1. ys = [] \<Longrightarrow> zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
zip (map f (x # xs)) (map g ys) = map2 (\<lambda>x y. (f x, g y)) (x # xs) ys

goal (1 subgoal):
 1. \<And>ys. zip (map f []) (map g ys) = map2 (\<lambda>x y. (f x, g y)) [] ys
[PROOF STEP]
qed simp


[STATEMENT]
lemma length_list_of_mset[simp]: "length (list_of_mset A) = size A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_of_mset A) = size A
[PROOF STEP]
unfolding list_of_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (SOME l. A = mset l) = size A
[PROOF STEP]
by (metis (mono_tags) ex_mset size_mset someI_ex)


[STATEMENT]
lemma n_min1_gr2:
  assumes "n > 2"
  shows "\<omega>^(n div 2) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> ^ (n div 2) = - 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<omega> ^ (n div 2) = - 1
[PROOF STEP]
have "\<omega>^(n div 2) \<noteq> -1 \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> ^ (n div 2) \<noteq> - 1 \<Longrightarrow> False
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<omega> ^ (n div 2) \<noteq> - 1 \<Longrightarrow> False
[PROOF STEP]
assume "\<omega>^(n div 2) \<noteq> -1"
[PROOF STATE]
proof (state)
this:
\<omega> ^ (n div 2) \<noteq> - 1

goal (1 subgoal):
 1. \<omega> ^ (n div 2) \<noteq> - 1 \<Longrightarrow> False
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
\<omega> ^ (n div 2) \<noteq> - 1

goal (1 subgoal):
 1. False
[PROOF STEP]
proof(cases "\<omega>^(n div 2) = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) = 1\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<omega> ^ (n div 2) = 1

goal (2 subgoals):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) = 1\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<omega> ^ (n div 2) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<omega> ^ (n div 2) = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using  omega_properties(3)
[PROOF STATE]
proof (prove)
using this:
\<omega> ^ (n div 2) = 1
\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis Euclidean_Division.div_eq_0_iff div_less_dividend leD less_le_trans n_lst2 one_less_numeral_iff pos2 semiring_norm(76) zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<omega> ^ (n div 2) \<noteq> 1

goal (1 subgoal):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "(\<omega>^(n div 2)) ^ (2::nat) \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
\<omega> ^ (n div 2) \<noteq> 1

goal (1 subgoal):
 1. (\<omega> ^ (n div 2))\<^sup>2 \<noteq> 1
[PROOF STEP]
by (smt (verit, ccfv_threshold) n_two_pot One_nat_def \<open>\<omega> ^ (n div 2) \<noteq> - 1\<close> diff_zero leD n_lst2 not_less_eq omega_properties(1) one_less_numeral_iff one_power2 power2_eq_square power_mult power_one_right power_strict_increasing_iff semiring_norm(76) square_eq_iff two_powr_div two_powrs_div)
[PROOF STATE]
proof (state)
this:
(\<omega> ^ (n div 2))\<^sup>2 \<noteq> 1

goal (1 subgoal):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<omega> ^ (n div 2))\<^sup>2 \<noteq> 1

goal (1 subgoal):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "(n div 2) * 2  = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n div 2 * 2 = n
[PROOF STEP]
using n_two_pot n_lst2
[PROOF STATE]
proof (prove)
using this:
n = 2 ^ N
2 \<le> n

goal (1 subgoal):
 1. n div 2 * 2 = n
[PROOF STEP]
by (metis One_nat_def Suc_lessD assms div_by_Suc_0 one_less_numeral_iff power_0 power_one_right power_strict_increasing_iff semiring_norm(76) two_powrs_div)
[PROOF STATE]
proof (state)
this:
n div 2 * 2 = n

goal (1 subgoal):
 1. \<lbrakk>\<omega> ^ (n div 2) \<noteq> - 1; \<omega> ^ (n div 2) \<noteq> 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<omega> ^ (n div 2))\<^sup>2 \<noteq> 1
n div 2 * 2 = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<omega> ^ (n div 2))\<^sup>2 \<noteq> 1
n div 2 * 2 = n

goal (1 subgoal):
 1. False
[PROOF STEP]
using omega_properties(1)
[PROOF STATE]
proof (prove)
using this:
(\<omega> ^ (n div 2))\<^sup>2 \<noteq> 1
n div 2 * 2 = n
\<omega> ^ n = 1

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

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

goal (1 subgoal):
 1. \<omega> ^ (n div 2) \<noteq> - 1 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<omega> ^ (n div 2) \<noteq> - 1 \<Longrightarrow> False

goal (1 subgoal):
 1. \<omega> ^ (n div 2) = - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<omega> ^ (n div 2) \<noteq> - 1 \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<omega> ^ (n div 2) \<noteq> - 1 \<Longrightarrow> False

goal (1 subgoal):
 1. \<omega> ^ (n div 2) = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<omega> ^ (n div 2) = - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_base_factor_to_fps_conv_fps_shift:
  assumes "fls_subdegree f \<ge> 0"
  shows   "fls_base_factor_to_fps f = fps_shift (nat (fls_subdegree f)) (fls_regpart f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor_to_fps f = fps_shift (nat (fls_subdegree f)) (fls_regpart f)
[PROOF STEP]
by (simp add: assms fls_regpart_shift_conv_fps_shift)


[STATEMENT]
lemma "exists_subterm (\<lambda>t. t=Fv idx T) t \<longleftrightarrow> (idx, T) \<in> fv t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exists_subterm (\<lambda>t. t = Fv idx T) t = ((idx, T) \<in> fv t)
[PROOF STEP]
by (induction t) auto


[STATEMENT]
lemma cfs_add_nat_pow:
  assumes "p \<in> carrier P"
  shows "([(n::nat)]\<cdot>\<^bsub>P\<^esub>p) k = [n]\<cdot>(p k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([n] \<cdot>\<^bsub>P\<^esub> p) k = [n] \<cdot> p k
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ([0] \<cdot>\<^bsub>P\<^esub> p) k = [0] \<cdot> p k
 2. \<And>n. ([n] \<cdot>\<^bsub>P\<^esub> p) k = [n] \<cdot> p k \<Longrightarrow> ([Suc n] \<cdot>\<^bsub>P\<^esub> p) k = [Suc n] \<cdot> p k
[PROOF STEP]
by (auto simp: assms)


[STATEMENT]
lemma cong_diff_iff_cong_0_nat':
  "[nat \<bar>int a - int b\<bar> = 0] (mod m) \<longleftrightarrow> [a = b] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
proof (cases "b \<le> a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
 2. \<not> b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b \<le> a

goal (2 subgoals):
 1. b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
 2. \<not> b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<le> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<le> a

goal (1 subgoal):
 1. [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
by (simp add: nat_diff_distrib' cong_diff_iff_cong_0_nat [of b a m])
[PROOF STATE]
proof (state)
this:
[nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)

goal (1 subgoal):
 1. \<not> b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> b \<le> a

goal (1 subgoal):
 1. \<not> b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> b \<le> a
[PROOF STEP]
have "a \<le> b"
[PROOF STATE]
proof (prove)
using this:
\<not> b \<le> a

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

goal (1 subgoal):
 1. \<not> b \<le> a \<Longrightarrow> [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<le> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. [nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)
[PROOF STEP]
by (simp add: nat_diff_distrib' cong_diff_iff_cong_0_nat [of a b m])
      (auto simp add: cong_def)
[PROOF STATE]
proof (state)
this:
[nat \<bar>int a - int b\<bar> = 0] (mod m) = [a = b] (mod m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filter_mset_image_mset:
  "filter_mset P (image_mset f A) = image_mset f (filter_mset (\<lambda>x. P (f x)) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P (image_mset f A) = image_mset f {#x \<in># A. P (f x)#}
[PROOF STEP]
by (induction A) auto


[STATEMENT]
lemma continuous_on_inverse: "continuous_on S f \<Longrightarrow> 0 \<notin> f ` S \<Longrightarrow> continuous_on S (\<lambda>x. inverse (f x))"
  for f::"_\<Rightarrow>_::real_normed_div_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on S f; (0::'d) \<notin> f ` S\<rbrakk> \<Longrightarrow> continuous_on S (\<lambda>x. inverse (f x))
[PROOF STEP]
by (auto simp: continuous_on_def intro!: tendsto_inverse)


[STATEMENT]
lemma zero_search: "VARS A i
 {True}
 i := 0;
 WHILE i < length A & A!i \<noteq> key
 INV {\<forall>j. j<i --> A!j \<noteq> key}
 DO i := i+1 OD
 {(i < length A --> A!i = key) &
  (i = length A --> (\<forall>j. j < length A \<longrightarrow> A!j \<noteq> key))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {True}
i := 0; WHILE i < length A \<and> A ! i \<noteq> key INV {\<forall>j<i. A ! j \<noteq> key}  VAR {0}
DO i := i + 1 OD
{(i < length A \<longrightarrow> A ! i = key) \<and> (i = length A \<longrightarrow> (\<forall>j<length A. A ! j \<noteq> key))}
[PROOF STEP]
apply vcg_simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A i. (\<forall>j<i. A ! j \<noteq> key) \<and> i < length A \<and> A ! i \<noteq> key \<Longrightarrow> \<forall>j<Suc i. A ! j \<noteq> key
[PROOF STEP]
apply(blast elim!: less_SucE)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem aval_afold_N:
assumes "approx t s"
shows "afold a t = N n \<Longrightarrow> aval a s = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. afold a t = N n \<Longrightarrow> aval a s = n
[PROOF STEP]
by (metis assms aval.simps(1) aval_afold)


[STATEMENT]
lemma ennreal_power: "0 \<le> r \<Longrightarrow> ennreal r ^ n = ennreal (r ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> r \<Longrightarrow> ennreal r ^ n = ennreal (r ^ n)
[PROOF STEP]
by (induction n) (auto simp: ennreal_mult)


[STATEMENT]
lemma ran_map_upd_Some:
  "\<lbrakk> m x = Some y; inj_on m (dom m); z \<notin> ran m \<rbrakk> \<Longrightarrow> ran(m(x := Some z)) = ran m - {y} \<union> {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m x = Some y; inj_on m (dom m); z \<notin> ran m\<rbrakk> \<Longrightarrow> ran (m(x \<mapsto> z)) = ran m - {y} \<union> {z}
[PROOF STEP]
by(force simp add: ran_def domI inj_onD)


[STATEMENT]
lemma floor_uminus_of_int [simp]: "\<lfloor>- (of_int z)\<rfloor> = - z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>- of_int z\<rfloor> = - z
[PROOF STEP]
by (metis floor_diff_of_int [of 0] diff_0 floor_zero)


[STATEMENT]
lemma meet_comm:
  fixes L (structure)
  shows "x \<sqinter> y = y \<sqinter> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y = y \<sqinter> x
[PROOF STEP]
by (unfold meet_def) (simp add: insert_commute)


[STATEMENT]
lemma continuous_map_real_mult_right_eq:
   "continuous_map X euclideanreal (\<lambda>x. f x * c) \<longleftrightarrow> c = 0 \<or> continuous_map X euclideanreal f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X euclideanreal (\<lambda>x. f x * c) = (c = 0 \<or> continuous_map X euclideanreal f)
[PROOF STEP]
by (simp add: mult.commute flip: continuous_map_real_mult_left_eq)


[STATEMENT]
lemma take_drop_update_first: assumes "j < length ds" and "length cs = length ds"
  shows "(take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
j < length ds
length cs = length ds

goal (1 subgoal):
 1. (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs
[PROOF STEP]
proof (induct j arbitrary: ds cs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ds cs. \<lbrakk>0 < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take 0 ds @ drop 0 cs)[0 := ds ! 0] = take (Suc 0) ds @ drop (Suc 0) cs
 2. \<And>j ds cs. \<lbrakk>\<And>ds cs. \<lbrakk>j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs; Suc j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < length ds
length cs = length ds

goal (2 subgoals):
 1. \<And>ds cs. \<lbrakk>0 < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take 0 ds @ drop 0 cs)[0 := ds ! 0] = take (Suc 0) ds @ drop (Suc 0) cs
 2. \<And>j ds cs. \<lbrakk>\<And>ds cs. \<lbrakk>j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs; Suc j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < length ds
length cs = length ds
[PROOF STEP]
obtain d dds c ccs where ds: "ds = d # dds" and cs: "cs = c # ccs"
[PROOF STATE]
proof (prove)
using this:
0 < length ds
length cs = length ds

goal (1 subgoal):
 1. (\<And>d dds c ccs. \<lbrakk>ds = d # dds; cs = c # ccs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases ds, simp, cases cs, auto)
[PROOF STATE]
proof (state)
this:
ds = d # dds
cs = c # ccs

goal (2 subgoals):
 1. \<And>ds cs. \<lbrakk>0 < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take 0 ds @ drop 0 cs)[0 := ds ! 0] = take (Suc 0) ds @ drop (Suc 0) cs
 2. \<And>j ds cs. \<lbrakk>\<And>ds cs. \<lbrakk>j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs; Suc j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take 0 ds @ drop 0 cs)[0 := ds ! 0] = take (Suc 0) ds @ drop (Suc 0) cs
[PROOF STEP]
unfolding ds cs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take 0 (d # dds) @ drop 0 (c # ccs))[0 := (d # dds) ! 0] = take (Suc 0) (d # dds) @ drop (Suc 0) (c # ccs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(take 0 ds @ drop 0 cs)[0 := ds ! 0] = take (Suc 0) ds @ drop (Suc 0) cs

goal (1 subgoal):
 1. \<And>j ds cs. \<lbrakk>\<And>ds cs. \<lbrakk>j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs; Suc j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j ds cs. \<lbrakk>\<And>ds cs. \<lbrakk>j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs; Suc j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
case (Suc j)
[PROOF STATE]
proof (state)
this:
\<lbrakk>j < length ?ds; length ?cs = length ?ds\<rbrakk> \<Longrightarrow> (take j ?ds @ drop j ?cs)[j := ?ds ! j] = take (Suc j) ?ds @ drop (Suc j) ?cs
Suc j < length ds
length cs = length ds

goal (1 subgoal):
 1. \<And>j ds cs. \<lbrakk>\<And>ds cs. \<lbrakk>j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs; Suc j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>j < length ?ds; length ?cs = length ?ds\<rbrakk> \<Longrightarrow> (take j ?ds @ drop j ?cs)[j := ?ds ! j] = take (Suc j) ?ds @ drop (Suc j) ?cs
Suc j < length ds
length cs = length ds
[PROOF STEP]
obtain d dds c ccs where ds: "ds = d # dds" and cs: "cs = c # ccs"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>j < length ?ds; length ?cs = length ?ds\<rbrakk> \<Longrightarrow> (take j ?ds @ drop j ?cs)[j := ?ds ! j] = take (Suc j) ?ds @ drop (Suc j) ?cs
Suc j < length ds
length cs = length ds

goal (1 subgoal):
 1. (\<And>d dds c ccs. \<lbrakk>ds = d # dds; cs = c # ccs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases ds, simp, cases cs, auto)
[PROOF STATE]
proof (state)
this:
ds = d # dds
cs = c # ccs

goal (1 subgoal):
 1. \<And>j ds cs. \<lbrakk>\<And>ds cs. \<lbrakk>j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take j ds @ drop j cs)[j := ds ! j] = take (Suc j) ds @ drop (Suc j) cs; Suc j < length ds; length cs = length ds\<rbrakk> \<Longrightarrow> (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
from Suc(1)[of dds ccs] Suc(2) Suc(3)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>j < length dds; length ccs = length dds\<rbrakk> \<Longrightarrow> (take j dds @ drop j ccs)[j := dds ! j] = take (Suc j) dds @ drop (Suc j) ccs
Suc j < length ds
length cs = length ds
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>j < length dds; length ccs = length dds\<rbrakk> \<Longrightarrow> (take j dds @ drop j ccs)[j := dds ! j] = take (Suc j) dds @ drop (Suc j) ccs
Suc j < length ds
length cs = length ds

goal (1 subgoal):
 1. (take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs
[PROOF STEP]
unfolding ds cs
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>j < length dds; length ccs = length dds\<rbrakk> \<Longrightarrow> (take j dds @ drop j ccs)[j := dds ! j] = take (Suc j) dds @ drop (Suc j) ccs
Suc j < length (d # dds)
length (c # ccs) = length (d # dds)

goal (1 subgoal):
 1. (take (Suc j) (d # dds) @ drop (Suc j) (c # ccs))[Suc j := (d # dds) ! Suc j] = take (Suc (Suc j)) (d # dds) @ drop (Suc (Suc j)) (c # ccs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(take (Suc j) ds @ drop (Suc j) cs)[Suc j := ds ! Suc j] = take (Suc (Suc j)) ds @ drop (Suc (Suc j)) cs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bind_funionM: "bind (funionM m m') f = funionM (bind m f) (bind m' f)"
  if "\<And>A B. f (A |\<union>| B) = bind (f A) (\<lambda>x. bind (f B) (\<lambda>y. return (x |\<union>| y)))" for m m' f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bind (funionM m m') f = funionM (bind m f) (bind m' f)
[PROOF STEP]
apply(simp add: bind_assoc return_bind funionM_def that)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bind m (\<lambda>y. bind m' (\<lambda>ya. bind (f y) (\<lambda>x. bind (f ya) (\<lambda>y. return (x |\<union>| y))))) = bind m (\<lambda>y. bind (f y) (\<lambda>A. bind m' (\<lambda>y. bind (f y) (\<lambda>B. return (A |\<union>| B)))))
[PROOF STEP]
apply(subst (2) bind_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bind m (\<lambda>y. bind (f y) (\<lambda>y. bind m' (\<lambda>x. bind (f x) (\<lambda>ya. return (y |\<union>| ya))))) = bind m (\<lambda>y. bind (f y) (\<lambda>A. bind m' (\<lambda>y. bind (f y) (\<lambda>B. return (A |\<union>| B)))))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma unit_prod [intro]:
  shows "a dvd 1 \<Longrightarrow> b dvd 1 \<Longrightarrow> (a * b) dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a dvd (1::'a); b dvd (1::'a)\<rbrakk> \<Longrightarrow> a * b dvd (1::'a)
[PROOF STEP]
by (subst mult_1_left [of 1, symmetric]) (rule mult_dvd_mono)


[STATEMENT]
lemma diameter_empty [simp]: "diameter{} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diameter {} = 0
[PROOF STEP]
by (auto simp: diameter_def)


[STATEMENT]
lemma ord_spmf_reflI: "(\<And>x. x \<in> set_spmf p \<Longrightarrow> ord x x) \<Longrightarrow> p \<sqsubseteq> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set_spmf p \<Longrightarrow> _struct  x x) \<Longrightarrow> p \<sqsubseteq> p
[PROOF STEP]
by(rule rel_pmf_reflI ord_option_reflI)+(auto simp add: in_set_spmf)


[STATEMENT]
lemma llength_ltakeWhile_eq_infinity:
  "llength (ltakeWhile P xs) = \<infinity> \<longleftrightarrow> \<not> lfinite xs \<and> ltakeWhile P xs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (llength (ltakeWhile P xs) = \<infinity>) = (\<not> lfinite xs \<and> ltakeWhile P xs = xs)
[PROOF STEP]
unfolding llength_ltakeWhile_all[symmetric] llength_eq_infty_conv_lfinite[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (llength (ltakeWhile P xs) = \<infinity>) = (llength xs = \<infinity> \<and> llength (ltakeWhile P xs) = llength xs)
[PROOF STEP]
by(auto)(auto simp add: llength_eq_infty_conv_lfinite lfinite_ltakeWhile intro: sym)


[STATEMENT]
lemma inorder_del:
 "sorted(inorder t) \<Longrightarrow>  inorder(del x t) = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (del x t) = del_list x (Tree2.inorder t)
[PROOF STEP]
by(induction x t rule: del.induct)
  (auto simp: del_list_simps inorder_join inorder_baldL inorder_baldR)