[STATEMENT]
lemma product_nodes_finite[intro]:
      assumes "finite (a.nodes A)" "finite (b.nodes B)"
      shows "finite (c.nodes (product A B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (c.nodes' (product A B))
[PROOF STEP]
proof (rule finite_subset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c.nodes' (product A B) \<subseteq> ?B
 2. finite ?B
[PROOF STEP]
show "c.nodes (product A B) \<subseteq> a.nodes A \<times> b.nodes B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c.nodes' (product A B) \<subseteq> a.nodes' A \<times> b.nodes' B
[PROOF STEP]
using product_nodes
[PROOF STATE]
proof (prove)
using this:
c.nodes' (product ?A ?B) \<subseteq> a.nodes' ?A \<times> b.nodes' ?B

goal (1 subgoal):
 1. c.nodes' (product A B) \<subseteq> a.nodes' A \<times> b.nodes' B
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
c.nodes' (product A B) \<subseteq> a.nodes' A \<times> b.nodes' B

goal (1 subgoal):
 1. finite (a.nodes' A \<times> b.nodes' B)
[PROOF STEP]
show "finite (a.nodes A \<times> b.nodes B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (a.nodes' A \<times> b.nodes' B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (a.nodes' A)
finite (b.nodes' B)

goal (1 subgoal):
 1. finite (a.nodes' A \<times> b.nodes' B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (a.nodes' A \<times> b.nodes' B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_edges_sym: "\<exists>E. E\<inter>E\<inverse> = {} \<and> edges g = E \<union> E\<inverse>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>E. E \<inter> E\<inverse> = {} \<and> edges g = E \<union> E\<inverse>
[PROOF STEP]
using split_sym_rel[OF edges_sym edges_irrefl, of g]
[PROOF STATE]
proof (prove)
using this:
(\<And>E. \<lbrakk>E \<inter> E\<inverse> = {}; edges g = E \<union> E\<inverse>\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>E. E \<inter> E\<inverse> = {} \<and> edges g = E \<union> E\<inverse>
[PROOF STEP]
by metis


[STATEMENT]
lemma real_root_ge_1_iff [simp]: "0 < n \<Longrightarrow> 1 \<le> root n y \<longleftrightarrow> 1 \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (1 \<le> root n y) = (1 \<le> y)
[PROOF STEP]
using real_root_le_iff [where x=1]
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> (root ?n 1 \<le> root ?n ?y) = (1 \<le> ?y)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (1 \<le> root n y) = (1 \<le> y)
[PROOF STEP]
by simp


[STATEMENT]
lemma orbit_perm_rem_eq:
  assumes "bij f" shows "orbit (perm_rem y f) x = (if x = y then {y} else orbit f x - {y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit (perm_rem y f) x = (if x = y then {y} else orbit f x - {y})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij f

goal (1 subgoal):
 1. orbit (perm_rem y f) x = (if x = y then {y} else orbit f x - {y})
[PROOF STEP]
by (simp add: orbit_eq_singleton_iff orbit_perm_rem perm_rem_simps)


[STATEMENT]
lemma card_ge_dim_independent:
  assumes BV: "B \<subseteq> V"
    and iB: "independent B"
    and dVB: "dim V \<le> card B"
  shows "V \<subseteq> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<subseteq> span B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
assume aV: "a \<in> V"
[PROOF STATE]
proof (state)
this:
a \<in> V

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a \<in> V

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
assume aB: "a \<notin> span B"
[PROOF STATE]
proof (state)
this:
a \<notin> span B

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<notin> span B
[PROOF STEP]
have iaB: "independent (insert a B)"
[PROOF STATE]
proof (prove)
using this:
a \<notin> span B

goal (1 subgoal):
 1. independent (insert a B)
[PROOF STEP]
using iB aV BV
[PROOF STATE]
proof (prove)
using this:
a \<notin> span B
independent B
a \<in> V
B \<subseteq> V

goal (1 subgoal):
 1. independent (insert a B)
[PROOF STEP]
by (simp add: independent_insert)
[PROOF STATE]
proof (state)
this:
independent (insert a B)

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
from aV BV
[PROOF STATE]
proof (chain)
picking this:
a \<in> V
B \<subseteq> V
[PROOF STEP]
have th0: "insert a B \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
a \<in> V
B \<subseteq> V

goal (1 subgoal):
 1. insert a B \<subseteq> V
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
insert a B \<subseteq> V

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
from aB
[PROOF STATE]
proof (chain)
picking this:
a \<notin> span B
[PROOF STEP]
have "a \<notin>B"
[PROOF STATE]
proof (prove)
using this:
a \<notin> span B

goal (1 subgoal):
 1. a \<notin> B
[PROOF STEP]
by (auto simp add: span_base)
[PROOF STATE]
proof (state)
this:
a \<notin> B

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
with independent_card_le_dim[OF th0 iaB] dVB finiteI_independent[OF iB]
[PROOF STATE]
proof (chain)
picking this:
card (insert a B) \<le> dim V
dim V \<le> card B
finite B
a \<notin> B
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
card (insert a B) \<le> dim V
dim V \<le> card B
finite B
a \<notin> B

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

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a \<notin> span B \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> span B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<notin> span B \<Longrightarrow> False
[PROOF STEP]
show "a \<in> span B"
[PROOF STATE]
proof (prove)
using this:
a \<notin> span B \<Longrightarrow> False

goal (1 subgoal):
 1. a \<in> span B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> span B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_ereal_1[simp]: "real_of_ereal (1::ereal) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal 1 = 1
[PROOF STEP]
unfolding one_ereal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal (ereal 1) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma float_val_gt_threshold:
  fixes a::"('e,'f)float"
  assumes "LENGTH('e) > 1" "is_finite a"
  shows "valof a > - threshold TYPE(('e,'f)float)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - threshold TYPE(('e, 'f) IEEE.float) < valof a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - threshold TYPE(('e, 'f) IEEE.float) < valof a
[PROOF STEP]
have largest: "valof a \<ge> -largest TYPE(('e,'f)float)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - largest TYPE(('e, 'f) IEEE.float) \<le> valof a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < LENGTH('e)
is_finite a

goal (1 subgoal):
 1. - largest TYPE(('e, 'f) IEEE.float) \<le> valof a
[PROOF STEP]
by (metis float_val_ge_largest)
[PROOF STATE]
proof (state)
this:
- largest TYPE(('e, 'f) IEEE.float) \<le> valof a

goal (1 subgoal):
 1. - threshold TYPE(('e, 'f) IEEE.float) < valof a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- largest TYPE(('e, 'f) IEEE.float) \<le> valof a
[PROOF STEP]
have "-largest TYPE(('e,'f)float) > - threshold TYPE(('e,'f)float)"
[PROOF STATE]
proof (prove)
using this:
- largest TYPE(('e, 'f) IEEE.float) \<le> valof a

goal (1 subgoal):
 1. - threshold TYPE(('e, 'f) IEEE.float) < - largest TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
by (auto simp: bias_def threshold_def largest_def divide_simps)
[PROOF STATE]
proof (state)
this:
- threshold TYPE(('e, 'f) IEEE.float) < - largest TYPE(('e, 'f) IEEE.float)

goal (1 subgoal):
 1. - threshold TYPE(('e, 'f) IEEE.float) < valof a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- threshold TYPE(('e, 'f) IEEE.float) < - largest TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- threshold TYPE(('e, 'f) IEEE.float) < - largest TYPE(('e, 'f) IEEE.float)

goal (1 subgoal):
 1. - threshold TYPE(('e, 'f) IEEE.float) < valof a
[PROOF STEP]
by (metis largest less_le_trans)
[PROOF STATE]
proof (state)
this:
- threshold TYPE(('e, 'f) IEEE.float) < valof a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_mono_image_endpoints:
  fixes f :: "'a::linear_continuum_topology \<Rightarrow> 'b::linorder_topology"
  assumes "strict_mono_on {a..b} f" and f: "continuous_on {a..b} f" and "a \<le> b"
  shows "f ` {a..b} = {f a..f b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` {a..b} = {f a..f b}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` {a..b} \<subseteq> {f a..f b}
 2. {f a..f b} \<subseteq> f ` {a..b}
[PROOF STEP]
show "f ` {a..b} \<subseteq> {f a..f b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` {a..b} \<subseteq> {f a..f b}
[PROOF STEP]
using assms(1) strict_mono_on_leD
[PROOF STATE]
proof (prove)
using this:
strict_mono_on {a..b} f
\<lbrakk>strict_mono_on ?A ?f; ?x \<in> ?A; ?y \<in> ?A; ?x \<le> ?y\<rbrakk> \<Longrightarrow> ?f ?x \<le> ?f ?y

goal (1 subgoal):
 1. f ` {a..b} \<subseteq> {f a..f b}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f ` {a..b} \<subseteq> {f a..f b}

goal (1 subgoal):
 1. {f a..f b} \<subseteq> f ` {a..b}
[PROOF STEP]
show "{f a..f b} \<subseteq> f ` {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f a..f b} \<subseteq> f ` {a..b}
[PROOF STEP]
using assms IVT'[OF _ _ _ f]
[PROOF STATE]
proof (prove)
using this:
strict_mono_on {a..b} f
continuous_on {a..b} f
a \<le> b
\<lbrakk>f a \<le> ?y; ?y \<le> f b; a \<le> b\<rbrakk> \<Longrightarrow> \<exists>x\<ge>a. x \<le> b \<and> f x = ?y

goal (1 subgoal):
 1. {f a..f b} \<subseteq> f ` {a..b}
[PROOF STEP]
by (force simp: Bex_def)
[PROOF STATE]
proof (state)
this:
{f a..f b} \<subseteq> f ` {a..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_imp_Collect_image: "{x. P (f x)} = Hilbert_Choice.inv f ` {y. P y}" (is "?l = ?g ` _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
have "?l = ?g ` f ` ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. P (f x)} = inv f ` f ` {x. P (f x)}
[PROOF STEP]
by (simp add: image_comp inv_o_cancel[OF bij_is_inj[OF bij]])
[PROOF STATE]
proof (state)
this:
{x. P (f x)} = inv f ` f ` {x. P (f x)}

goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x. P (f x)} = inv f ` f ` {x. P (f x)}

goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
have "f ` ?l = {f x | x. P (f x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` {x. P (f x)} = {f x |x. P (f x)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` {x. P (f x)} = {f x |x. P (f x)}

goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f ` {x. P (f x)} = {f x |x. P (f x)}

goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
have "\<dots> = {y. P y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f x |x. P (f x)} = {y. P y}
[PROOF STEP]
by (metis bij bij_iff)
[PROOF STATE]
proof (state)
this:
{f x |x. P (f x)} = {y. P y}

goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. P (f x)} = inv f ` {y. P y}

goal (1 subgoal):
 1. {x. P (f x)} = inv f ` {y. P y}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{x. P (f x)} = inv f ` {y. P y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det_swap_initial_cols: assumes A: "A \<in> carrier_mat m m"
  and lt: "k + n \<le> m"
  shows "det A = (- 1) ^ (k * n) *
    det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
have "det A = det (A\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A = det A\<^sup>T
[PROOF STEP]
unfolding det_transpose[OF A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A = det A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det A = det A\<^sup>T

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det A = det A\<^sup>T

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
have "\<dots> = (- 1) ^ (k * n) *
    det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j,i)))"
    (is "_ = _ * det ?M")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A\<^sup>T = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))
[PROOF STEP]
by (rule det_swap_initial_rows[OF _ lt], insert A, auto)
[PROOF STATE]
proof (state)
this:
det A\<^sup>T = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det A\<^sup>T = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
have "det ?M = det (?M\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i))) = det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))\<^sup>T
[PROOF STEP]
by (subst det_transpose, auto)
[PROOF STATE]
proof (state)
this:
det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i))) = det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))\<^sup>T

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i))) = det (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))\<^sup>T

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
have "?M\<^sup>T = mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))\<^sup>T = mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j))
[PROOF STEP]
unfolding transpose_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (dim_col (mat m m (\<lambda>(j, i). mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i)) $$ (if j < n then j + k else if j < k + n then j - n else j, i)))) (dim_row (mat m m (\<lambda>(j, i). mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i)) $$ (if j < n then j + k else if j < k + n then j - n else j, i)))) (\<lambda>(i, j). mat m m (\<lambda>(j, i). mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i)) $$ (if j < n then j + k else if j < k + n then j - n else j, i)) $$ (j, i)) = mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j))
[PROOF STEP]
using A lt
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m m
k + n \<le> m

goal (1 subgoal):
 1. mat (dim_col (mat m m (\<lambda>(j, i). mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i)) $$ (if j < n then j + k else if j < k + n then j - n else j, i)))) (dim_row (mat m m (\<lambda>(j, i). mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i)) $$ (if j < n then j + k else if j < k + n then j - n else j, i)))) (\<lambda>(i, j). mat m m (\<lambda>(j, i). mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i)) $$ (if j < n then j + k else if j < k + n then j - n else j, i)) $$ (j, i)) = mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j))
[PROOF STEP]
by (intro eq_matI, auto)
[PROOF STATE]
proof (state)
this:
(mat m m (\<lambda>(j, i). A\<^sup>T $$ (if j < n then j + k else if j < k + n then j - n else j, i)))\<^sup>T = mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j))

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))

goal (1 subgoal):
 1. det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det A = (- (1::'a)) ^ (k * n) * det (mat m m (\<lambda>(i, j). A $$ (i, if j < n then j + k else if j < k + n then j - n else j)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma atoms_closed:
  assumes "finite Xs"
  assumes "A \<in> atoms_of (gen_boolean_algebra S Xs)"
  assumes "S = \<Union> Xs"
  shows "A \<in> (gen_boolean_algebra S Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
have 1: "A = \<Union> {A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = \<Union> {A}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A = \<Union> {A}

goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
have 2: "A \<in> atoms_of Xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> atoms_of Xs
[PROOF STEP]
using assms atoms_of_sets_eq_atoms_of_algebra
[PROOF STATE]
proof (prove)
using this:
finite Xs
A \<in> atoms_of (gen_boolean_algebra S Xs)
S = \<Union> Xs
\<lbrakk>finite ?Xs; ?S = \<Union> ?Xs\<rbrakk> \<Longrightarrow> atoms_of ?Xs = atoms_of (gen_boolean_algebra ?S ?Xs)

goal (1 subgoal):
 1. A \<in> atoms_of Xs
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<in> atoms_of Xs

goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
using gen_boolean_algebra_generated_by_atoms[of Xs S]
        assms 1 2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite Xs; S = \<Union> Xs\<rbrakk> \<Longrightarrow> gen_boolean_algebra S Xs = \<Union> ` Pow (atoms_of Xs)
finite Xs
A \<in> atoms_of (gen_boolean_algebra S Xs)
S = \<Union> Xs
A = \<Union> {A}
A \<in> atoms_of Xs

goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
unfolding Pow_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite Xs; S = \<Union> Xs\<rbrakk> \<Longrightarrow> gen_boolean_algebra S Xs = \<Union> ` {B. B \<subseteq> atoms_of Xs}
finite Xs
A \<in> atoms_of (gen_boolean_algebra S Xs)
S = \<Union> Xs
A = \<Union> {A}
A \<in> atoms_of Xs

goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Xs
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<in> gen_boolean_algebra S Xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UN_set_permutations_of_set [simp]:
  "finite A \<Longrightarrow> (\<Union>xs\<in>permutations_of_set A. set xs) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> \<Union> (set ` permutations_of_set A) = A
[PROOF STEP]
using finite_distinct_list
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> \<exists>xs. set xs = ?A \<and> distinct xs

goal (1 subgoal):
 1. finite A \<Longrightarrow> \<Union> (set ` permutations_of_set A) = A
[PROOF STEP]
by (auto simp: permutations_of_set_def)


[STATEMENT]
lemma composition_invertible [simp, intro]:
  "\<lbrakk> invertible x; invertible y; x \<in> M; y \<in> M \<rbrakk> \<Longrightarrow> invertible (x \<cdot> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invertible x; invertible y; x \<in> M; y \<in> M\<rbrakk> \<Longrightarrow> invertible (x \<cdot> y)
[PROOF STEP]
using mem_UnitsD mem_UnitsI
[PROOF STATE]
proof (prove)
using this:
?u \<in> Units \<Longrightarrow> invertible ?u \<and> ?u \<in> M
\<lbrakk>invertible ?u; ?u \<in> M\<rbrakk> \<Longrightarrow> ?u \<in> Units

goal (1 subgoal):
 1. \<lbrakk>invertible x; invertible y; x \<in> M; y \<in> M\<rbrakk> \<Longrightarrow> invertible (x \<cdot> y)
[PROOF STEP]
by blast


[STATEMENT]
lemma pointwise_le_antisym: "\<lbrakk>x \<unlhd> y; y \<unlhd> x\<rbrakk> \<Longrightarrow> x=y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<unlhd> y; y \<unlhd> x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis antisym list_all2_antisym pointwise_le_def)


[STATEMENT]
lemma ev_eq_suntil: "ev P \<omega> \<longleftrightarrow> (not P suntil P) \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ev P \<omega> = ((\<lambda>xs. \<not> P xs) suntil P) \<omega>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ev P \<omega> \<Longrightarrow> ((\<lambda>xs. \<not> P xs) suntil P) \<omega>
 2. ((\<lambda>xs. \<not> P xs) suntil P) \<omega> \<Longrightarrow> ev P \<omega>
[PROOF STEP]
assume "ev P \<omega>"
[PROOF STATE]
proof (state)
this:
ev P \<omega>

goal (2 subgoals):
 1. ev P \<omega> \<Longrightarrow> ((\<lambda>xs. \<not> P xs) suntil P) \<omega>
 2. ((\<lambda>xs. \<not> P xs) suntil P) \<omega> \<Longrightarrow> ev P \<omega>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ev P \<omega>
[PROOF STEP]
show "((\<lambda>xs. \<not> P xs) suntil P) \<omega>"
[PROOF STATE]
proof (prove)
using this:
ev P \<omega>

goal (1 subgoal):
 1. ((\<lambda>xs. \<not> P xs) suntil P) \<omega>
[PROOF STEP]
by (induction rule: ev_induct_strong) (auto intro: suntil.intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>xs. \<not> P xs) suntil P) \<omega>

goal (1 subgoal):
 1. ((\<lambda>xs. \<not> P xs) suntil P) \<omega> \<Longrightarrow> ev P \<omega>
[PROOF STEP]
qed (auto simp: ev_suntil)


[STATEMENT]
lemma signed_measure_disj_sum:
  shows "finite I \<Longrightarrow> signed_measure M \<mu> \<Longrightarrow> disjoint_family_on A I \<Longrightarrow>
    (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets M) \<Longrightarrow> \<mu> (\<Union> i\<in> I. A i) = (\<Sum> i\<in> I. \<mu> (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; signed_measure M \<mu>; disjoint_family_on A I; \<And>i. i \<in> I \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` I)) = (\<Sum>i\<in>I. \<mu> (A i))
[PROOF STEP]
proof (induct rule:finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>signed_measure M \<mu>; disjoint_family_on A {}; \<And>i. i \<in> {} \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` {})) = (\<Sum>i\<in>{}. \<mu> (A i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
signed_measure M \<mu>
disjoint_family_on A {}
?i \<in> {} \<Longrightarrow> A ?i \<in> sets M

goal (2 subgoals):
 1. \<lbrakk>signed_measure M \<mu>; disjoint_family_on A {}; \<And>i. i \<in> {} \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` {})) = (\<Sum>i\<in>{}. \<mu> (A i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
signed_measure M \<mu>
disjoint_family_on A {}
?i \<in> {} \<Longrightarrow> A ?i \<in> sets M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
signed_measure M \<mu>
disjoint_family_on A {}
?i \<in> {} \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` {})) = (\<Sum>i\<in>{}. \<mu> (A i))
[PROOF STEP]
unfolding signed_measure_def
[PROOF STATE]
proof (prove)
using this:
\<mu> {} = 0 \<and> (- \<infinity> \<notin> range \<mu> \<or> \<infinity> \<notin> range \<mu>) \<and> (\<forall>A. range A \<subseteq> sets M \<longrightarrow> disjoint_family A \<longrightarrow> \<Union> (range A) \<in> sets M \<longrightarrow> (\<lambda>i. \<mu> (A i)) sums \<mu> (\<Union> (range A))) \<and> (\<forall>A. range A \<subseteq> sets M \<longrightarrow> disjoint_family A \<longrightarrow> \<Union> (range A) \<in> sets M \<longrightarrow> \<bar>\<mu> (\<Union> (range A))\<bar> < \<infinity> \<longrightarrow> summable (\<lambda>i. real_of_ereal \<bar>\<mu> (A i)\<bar>))
disjoint_family_on A {}
?i \<in> {} \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` {})) = (\<Sum>i\<in>{}. \<mu> (A i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` {})) = (\<Sum>i\<in>{}. \<mu> (A i))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i))
signed_measure M \<mu>
disjoint_family_on A (insert x F)
?i \<in> insert x F \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
have "\<mu> (\<Union> (A ` insert x F)) = \<mu> ((\<Union> (A `F)) \<union> A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu> (\<Union> (A ` insert x F)) = \<mu> (\<Union> (A ` F) \<union> A x)
[PROOF STEP]
by (simp add: Un_commute)
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` insert x F)) = \<mu> (\<Union> (A ` F) \<union> A x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` insert x F)) = \<mu> (\<Union> (A ` F) \<union> A x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
have "... = \<mu> (\<Union> (A `F)) + \<mu> (A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
have "(\<Union> (A `F)) \<inter> (A x) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (A ` F) \<inter> A x = {}
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i))
signed_measure M \<mu>
disjoint_family_on A (insert x F)
?i \<in> insert x F \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. \<Union> (A ` F) \<inter> A x = {}
[PROOF STEP]
by (metis disjoint_family_on_insert inf_commute)
[PROOF STATE]
proof (state)
this:
\<Union> (A ` F) \<inter> A x = {}

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Union> (A ` F) \<inter> A x = {}

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
have "\<Union> (A `F) \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (A ` F) \<in> sets M
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i))
signed_measure M \<mu>
disjoint_family_on A (insert x F)
?i \<in> insert x F \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. \<Union> (A ` F) \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (A ` F) \<in> sets M

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Union> (A ` F) \<in> sets M

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
have "A x \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x \<in> sets M
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i))
signed_measure M \<mu>
disjoint_family_on A (insert x F)
?i \<in> insert x F \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. A x \<in> sets M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A x \<in> sets M

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Union> (A ` F) \<inter> A x = {}
\<Union> (A ` F) \<in> sets M
A x \<in> sets M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> (A ` F) \<inter> A x = {}
\<Union> (A ` F) \<in> sets M
A x \<in> sets M

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)
[PROOF STEP]
by (meson insert.prems(1) signed_measure_add)
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` F) \<union> A x) = \<mu> (\<Union> (A ` F)) + \<mu> (A x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
have "... = (\<Sum> i\<in> F. \<mu> (A i)) + \<mu> (A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F)) + \<mu> (A x) = (\<Sum>i\<in>F. \<mu> (A i)) + \<mu> (A x)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i))
signed_measure M \<mu>
disjoint_family_on A (insert x F)
?i \<in> insert x F \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` F)) + \<mu> (A x) = (\<Sum>i\<in>F. \<mu> (A i)) + \<mu> (A x)
[PROOF STEP]
by (metis disjoint_family_on_insert insert_iff)
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` F)) + \<mu> (A x) = (\<Sum>i\<in>F. \<mu> (A i)) + \<mu> (A x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` F)) + \<mu> (A x) = (\<Sum>i\<in>F. \<mu> (A i)) + \<mu> (A x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
have "... = (\<Sum>i\<in>insert x F. \<mu> (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>F. \<mu> (A i)) + \<mu> (A x) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
by (simp add: add.commute insert.hyps(1) insert.hyps(2))
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>F. \<mu> (A i)) + \<mu> (A x) = (\<Sum>i\<in>insert x F. \<mu> (A i))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>signed_measure M \<mu>; disjoint_family_on A F; \<And>i. i \<in> F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` F)) = (\<Sum>i\<in>F. \<mu> (A i)); signed_measure M \<mu>; disjoint_family_on A (insert x F); \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> sets M\<rbrakk> \<Longrightarrow> \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))

goal (1 subgoal):
 1. \<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<mu> (\<Union> (A ` insert x F)) = (\<Sum>i\<in>insert x F. \<mu> (A i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma left_right_inverse_matrix_unique:
  assumes "left_inverse_matrix A Y" "right_inverse_matrix A X"
  shows "X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X = Y
[PROOF STEP]
have "Y = Y * one_matrix (nrows A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y = Y * one_matrix (nrows A)
[PROOF STEP]
apply (subst one_matrix_mult_right)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ncols Y \<le> nrows A
 2. Y = Y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
left_inverse_matrix A Y
right_inverse_matrix A X

goal (2 subgoals):
 1. ncols Y \<le> nrows A
 2. Y = Y
[PROOF STEP]
apply (simp_all add: left_inverse_matrix_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Y = Y * one_matrix (nrows A)

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Y = Y * one_matrix (nrows A)

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
have "\<dots> = Y * (A * X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y * one_matrix (nrows A) = Y * (A * X)
[PROOF STEP]
apply (insert assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>left_inverse_matrix A Y; right_inverse_matrix A X\<rbrakk> \<Longrightarrow> Y * one_matrix (nrows A) = Y * (A * X)
[PROOF STEP]
apply (frule right_inverse_matrix_dim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>left_inverse_matrix A Y; right_inverse_matrix A X; nrows A = ncols X\<rbrakk> \<Longrightarrow> Y * one_matrix (nrows A) = Y * (A * X)
[PROOF STEP]
by (simp add: right_inverse_matrix_def)
[PROOF STATE]
proof (state)
this:
Y * one_matrix (nrows A) = Y * (A * X)

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Y * one_matrix (nrows A) = Y * (A * X)

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
have "\<dots> = (Y * A) * X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y * (A * X) = Y * A * X
[PROOF STEP]
by (simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
Y * (A * X) = Y * A * X

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Y * (A * X) = Y * A * X

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
have "\<dots> = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y * A * X = X
[PROOF STEP]
apply (insert assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>left_inverse_matrix A Y; right_inverse_matrix A X\<rbrakk> \<Longrightarrow> Y * A * X = X
[PROOF STEP]
apply (frule left_inverse_matrix_dim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>left_inverse_matrix A Y; right_inverse_matrix A X; ncols A = nrows Y\<rbrakk> \<Longrightarrow> Y * A * X = X
[PROOF STEP]
apply (simp_all add:  left_inverse_matrix_def right_inverse_matrix_def one_matrix_mult_left)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Y * A * X = X

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Y = Y * A * X
Y * A * X = X
[PROOF STEP]
show "X = Y"
[PROOF STATE]
proof (prove)
using this:
Y = Y * A * X
Y * A * X = X

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_equiv_trans1 [trans]: "\<not> x \<sim> y \<Longrightarrow> y \<sim> z \<Longrightarrow> \<not> x \<sim> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> x \<sim> y; y \<sim> z\<rbrakk> \<Longrightarrow> \<not> x \<sim> z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> x \<sim> y; y \<sim> z\<rbrakk> \<Longrightarrow> \<not> x \<sim> z
[PROOF STEP]
assume "\<not> x \<sim> y" and "y \<sim> z"
[PROOF STATE]
proof (state)
this:
\<not> x \<sim> y
y \<sim> z

goal (1 subgoal):
 1. \<lbrakk>\<not> x \<sim> y; y \<sim> z\<rbrakk> \<Longrightarrow> \<not> x \<sim> z
[PROOF STEP]
show "\<not> x \<sim> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> x \<sim> z
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sim> z \<Longrightarrow> False
[PROOF STEP]
assume "x \<sim> z"
[PROOF STATE]
proof (state)
this:
x \<sim> z

goal (1 subgoal):
 1. x \<sim> z \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sim> z

goal (1 subgoal):
 1. x \<sim> z \<Longrightarrow> False
[PROOF STEP]
from \<open>y \<sim> z\<close>
[PROOF STATE]
proof (chain)
picking this:
y \<sim> z
[PROOF STEP]
have "z \<sim> y"
[PROOF STATE]
proof (prove)
using this:
y \<sim> z

goal (1 subgoal):
 1. z \<sim> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
z \<sim> y

goal (1 subgoal):
 1. x \<sim> z \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sim> y
[PROOF STEP]
have "x \<sim> y"
[PROOF STATE]
proof (prove)
using this:
x \<sim> y

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

goal (1 subgoal):
 1. x \<sim> z \<Longrightarrow> False
[PROOF STEP]
with \<open>\<not> x \<sim> y\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> x \<sim> y
x \<sim> y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> x \<sim> y
x \<sim> y

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> x \<sim> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coprime_power2:
  fixes n::nat
  assumes \<open>n \<noteq> 0\<close> and \<open>\<And> x. x < n \<Longrightarrow> (coprime x n \<longleftrightarrow> odd x)\<close>
  shows \<open>\<exists> k. n = (2::nat)^k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. n = 2 ^ k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k. n = 2 ^ k
[PROOF STEP]
have \<open>x dvd n \<Longrightarrow> odd x \<Longrightarrow> x = 1\<close>
    for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x dvd n; odd x\<rbrakk> \<Longrightarrow> x = 1
[PROOF STEP]
by (metis neq0_conv One_nat_def Suc_1 Suc_lessI assms(1) assms(2) coprime_left_2_iff_odd
        dvd_refl linorder_neqE_nat nat_dvd_1_iff_1 nat_dvd_not_less not_coprimeI)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x dvd n; odd ?x\<rbrakk> \<Longrightarrow> ?x = 1

goal (1 subgoal):
 1. \<exists>k. n = 2 ^ k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x dvd n; odd ?x\<rbrakk> \<Longrightarrow> ?x = 1

goal (1 subgoal):
 1. \<exists>k. n = 2 ^ k
[PROOF STEP]
using assms(1) only_one_odd_div_power2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x dvd n; odd ?x\<rbrakk> \<Longrightarrow> ?x = 1
n \<noteq> 0
\<lbrakk>?n \<noteq> 0; \<And>x. \<lbrakk>x dvd ?n; odd x\<rbrakk> \<Longrightarrow> x = 1\<rbrakk> \<Longrightarrow> \<exists>k. ?n = 2 ^ k

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_mult_le_mult_iff:
  fixes a b c :: ereal
  shows "\<bar>c\<bar> \<noteq> \<infinity> \<Longrightarrow> c * a \<le> c * b \<longleftrightarrow> (0 < c \<longrightarrow> a \<le> b) \<and> (c < 0 \<longrightarrow> b \<le> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>c\<bar> \<noteq> \<infinity> \<Longrightarrow> (c * a \<le> c * b) = ((0 < c \<longrightarrow> a \<le> b) \<and> (c < 0 \<longrightarrow> b \<le> a))
[PROOF STEP]
by (cases rule: ereal3_cases[of a b c]) (simp_all add: mult_le_cancel_left)


[STATEMENT]
lemma mk_dimvec_inj: "inj_on (mk_dimvec :: 'n list \<Rightarrow> ('n::ring_1, 'd::enum) dimvec) {xs. length xs = CARD('d)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on mk_dimvec {xs. length xs = CARD('d)}
[PROOF STEP]
proof (rule inj_onI, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>mk_dimvec x = mk_dimvec y; length x = CARD('d); length y = CARD('d)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y :: "'n list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>mk_dimvec x = mk_dimvec y; length x = CARD('d); length y = CARD('d)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume a: "(mk_dimvec x :: ('n, 'd) dimvec) = mk_dimvec y" "length x = CARD('d)" "length y = CARD('d)"
[PROOF STATE]
proof (state)
this:
mk_dimvec x = mk_dimvec y
length x = CARD('d)
length y = CARD('d)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>mk_dimvec x = mk_dimvec y; length x = CARD('d); length y = CARD('d)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "\<And>i. i < length x \<Longrightarrow> x ! i = y ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < length x \<Longrightarrow> x ! i = y ! i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length x \<Longrightarrow> x ! i = y ! i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length x \<Longrightarrow> x ! i = y ! i
[PROOF STEP]
assume "i < length x"
[PROOF STATE]
proof (state)
this:
i < length x

goal (1 subgoal):
 1. \<And>i. i < length x \<Longrightarrow> x ! i = y ! i
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
mk_dimvec x = mk_dimvec y
length x = CARD('d)
length y = CARD('d)
i < length x
[PROOF STEP]
have "enum_ind (ENUM('d) ! i) = i"
[PROOF STATE]
proof (prove)
using this:
mk_dimvec x = mk_dimvec y
length x = CARD('d)
length y = CARD('d)
i < length x

goal (1 subgoal):
 1. enum_ind (enum_class.enum ! i) = i
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
enum_ind (enum_class.enum ! i) = i

goal (1 subgoal):
 1. \<And>i. i < length x \<Longrightarrow> x ! i = y ! i
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
mk_dimvec x = mk_dimvec y
length x = CARD('d)
length y = CARD('d)
enum_ind (enum_class.enum ! i) = i
[PROOF STEP]
show "x ! i = y ! i"
[PROOF STATE]
proof (prove)
using this:
mk_dimvec x = mk_dimvec y
length x = CARD('d)
length y = CARD('d)
enum_ind (enum_class.enum ! i) = i

goal (1 subgoal):
 1. x ! i = y ! i
[PROOF STEP]
by (auto simp add: mk_dimvec_def fun_eq_iff, metis)
[PROOF STATE]
proof (state)
this:
x ! i = y ! i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i < length x \<Longrightarrow> x ! ?i = y ! ?i

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>mk_dimvec x = mk_dimvec y; length x = CARD('d); length y = CARD('d)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i < length x \<Longrightarrow> x ! ?i = y ! ?i
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
?i < length x \<Longrightarrow> x ! ?i = y ! ?i

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (metis a(2) a(3) nth_equalityI)
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ord_ultrametric':
  assumes "x \<in> nonzero Q\<^sub>p"
  assumes "y \<in> nonzero Q\<^sub>p"
  assumes "x \<ominus>\<^bsub>Q\<^sub>p\<^esub> y \<in> nonzero Q\<^sub>p"
  shows "ord (x \<ominus>\<^bsub>Q\<^sub>p\<^esub> y) \<ge> min (ord x) (ord y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (ord x) (ord y) \<le> ord (x \<ominus> y)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. min (ord x) (ord y) \<le> ord (x \<ominus> y)
[PROOF STEP]
have "ord y = ord (\<ominus>y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord y = ord (\<ominus> y)
[PROOF STEP]
using assms(2) ord_minus
[PROOF STATE]
proof (prove)
using this:
y \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ord ?a = ord (\<ominus> ?a)

goal (1 subgoal):
 1. ord y = ord (\<ominus> y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ord y = ord (\<ominus> y)

goal (1 subgoal):
 1. min (ord x) (ord y) \<le> ord (x \<ominus> y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord y = ord (\<ominus> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ord y = ord (\<ominus> y)

goal (1 subgoal):
 1. min (ord x) (ord y) \<le> ord (x \<ominus> y)
[PROOF STEP]
using assms ord_ultrametric[of x "\<ominus>y"]
[PROOF STATE]
proof (prove)
using this:
ord y = ord (\<ominus> y)
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p
x \<ominus> y \<in> nonzero Q\<^sub>p
\<lbrakk>x \<in> nonzero Q\<^sub>p; \<ominus> y \<in> nonzero Q\<^sub>p; x \<oplus> \<ominus> y \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> min (ord x) (ord (\<ominus> y)) \<le> ord (x \<oplus> \<ominus> y)

goal (1 subgoal):
 1. min (ord x) (ord y) \<le> ord (x \<ominus> y)
[PROOF STEP]
unfolding a_minus_def
[PROOF STATE]
proof (prove)
using this:
ord y = ord (\<ominus> y)
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p
x \<oplus> \<ominus> y \<in> nonzero Q\<^sub>p
\<lbrakk>x \<in> nonzero Q\<^sub>p; \<ominus> y \<in> nonzero Q\<^sub>p; x \<oplus> \<ominus> y \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> min (ord x) (ord (\<ominus> y)) \<le> ord (x \<oplus> \<ominus> y)

goal (1 subgoal):
 1. min (ord x) (ord y) \<le> ord (x \<oplus> \<ominus> y)
[PROOF STEP]
using Qp.add.inv_closed Qp.add.inv_eq_1_iff Qp.nonzero_closed Qp.nonzero_memE(2) Qp.nonzero_memI
[PROOF STATE]
proof (prove)
using this:
ord y = ord (\<ominus> y)
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p
x \<oplus> \<ominus> y \<in> nonzero Q\<^sub>p
\<lbrakk>x \<in> nonzero Q\<^sub>p; \<ominus> y \<in> nonzero Q\<^sub>p; x \<oplus> \<ominus> y \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> min (ord x) (ord (\<ominus> y)) \<le> ord (x \<oplus> \<ominus> y)
?x \<in> carrier Q\<^sub>p \<Longrightarrow> \<ominus> ?x \<in> carrier Q\<^sub>p
?x \<in> carrier Q\<^sub>p \<Longrightarrow> (\<ominus> ?x = \<zero>) = (?x = \<zero>)
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<noteq> \<zero>
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> ?a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. min (ord x) (ord y) \<le> ord (x \<oplus> \<ominus> y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
min (ord x) (ord y) \<le> ord (x \<ominus> y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iMODb_iprev_nth: "
  a \<le> c \<Longrightarrow> [r, mod m, c] \<leftarrow> a = r + m * (c - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> c \<Longrightarrow> [ r, mod m, c ] \<leftarrow> a = r + m * (c - a)
[PROOF STEP]
apply (case_tac "m = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> c; m = 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> a = r + m * (c - a)
 2. \<lbrakk>a \<le> c; m \<noteq> 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> a = r + m * (c - a)
[PROOF STEP]
apply (simp add: iMODb_mod_0 iIN_0 iprev_nth_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> c; m \<noteq> 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> a = r + m * (c - a)
[PROOF STEP]
apply (induct a)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 \<le> c; m \<noteq> 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> 0 = r + m * (c - 0)
 2. \<And>a. \<lbrakk>\<lbrakk>a \<le> c; m \<noteq> 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> a = r + m * (c - a); Suc a \<le> c; m \<noteq> 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> Suc a = r + m * (c - Suc a)
[PROOF STEP]
apply (simp add: iMODb_Max)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>\<lbrakk>a \<le> c; m \<noteq> 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> a = r + m * (c - a); Suc a \<le> c; m \<noteq> 0\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<leftarrow> Suc a = r + m * (c - Suc a)
[PROOF STEP]
apply (simp add: iMODb_iprev_if iT_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>[ r, mod m, c ] \<leftarrow> a = r + m * (c - a); Suc a \<le> c; 0 < m\<rbrakk> \<Longrightarrow> r + m * (c - a) - m = r + m * (c - Suc a)
[PROOF STEP]
apply (frule mult_left_mono[of _ _ m], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>[ r, mod m, c ] \<leftarrow> a = r + m * (c - a); Suc a \<le> c; 0 < m; m * Suc a \<le> m * c\<rbrakk> \<Longrightarrow> r + m * (c - a) - m = r + m * (c - Suc a)
[PROOF STEP]
apply (simp add: diff_mult_distrib2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma E_finite_sum_fun: "finite (set_pmf X) \<Longrightarrow>
    E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
assume finite: "finite (set_pmf X)"
[PROOF STATE]
proof (state)
this:
finite (set_pmf X)

goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
have "E (map_pmf f X) = (\<integral>x. f x \<partial>measure_pmf X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E (map_pmf f X) = measure_pmf.expectation X f
[PROOF STEP]
unfolding E_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (map_pmf f X) (\<lambda>x. x) = measure_pmf.expectation X f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
E (map_pmf f X) = measure_pmf.expectation X f

goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
E (map_pmf f X) = measure_pmf.expectation X f

goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>set_pmf X. pmf X x * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation X f = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
by (subst integral_measure_pmf) (auto simp add: finite)
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation X f = (\<Sum>x\<in>set_pmf X. pmf X x * f x)

goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)

goal (1 subgoal):
 1. E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
E (map_pmf f X) = (\<Sum>x\<in>set_pmf X. pmf X x * f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aform_val_mult_exact:
  "aform_val e x * aform_val e y =
    fst x * fst y +
    pdevs_val e (add_pdevs (scaleR_pdevs (fst y) (snd x)) (scaleR_pdevs (fst x) (snd y))) +
    (\<Sum>i<d. e i *\<^sub>R pdevs_apply (snd x) i)*(\<Sum>i<d. e i *\<^sub>R pdevs_apply (snd y) i)"
   if "degree (snd x) \<le> d" "degree (snd y) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aform_val e x * aform_val e y = fst x * fst y + pdevs_val e (add_pdevs (scaleR_pdevs (fst y) (snd x)) (scaleR_pdevs (fst x) (snd y))) + (\<Sum>i<d. e i *\<^sub>R pdevs_apply (snd x) i) * (\<Sum>i<d. e i *\<^sub>R pdevs_apply (snd y) i)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
degree_aform x \<le> d
degree_aform y \<le> d

goal (1 subgoal):
 1. aform_val e x * aform_val e y = fst x * fst y + pdevs_val e (add_pdevs (scaleR_pdevs (fst y) (snd x)) (scaleR_pdevs (fst x) (snd y))) + (\<Sum>i<d. e i *\<^sub>R pdevs_apply (snd x) i) * (\<Sum>i<d. e i *\<^sub>R pdevs_apply (snd y) i)
[PROOF STEP]
by (auto simp: pdevs_val_sum_less_degree[where d=d] aform_val_def algebra_simps)


[STATEMENT]
theorem "\<forall>(x::int) y. x < y \<longrightarrow> 2 * x + 1 < 2 * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> 2 * x + 1 < 2 * y
[PROOF STEP]
by cooper


[STATEMENT]
lemma sp_equiv_list_comm: "sp_equiv_list xs ys \<Longrightarrow> sp_equiv_list ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sp_equiv_list xs ys \<Longrightarrow> sp_equiv_list ys xs
[PROOF STEP]
unfolding sp_equiv_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<and> pairwise sp_equiv_pair (set (zip xs ys)) \<Longrightarrow> length ys = length xs \<and> pairwise sp_equiv_pair (set (zip ys xs))
[PROOF STEP]
using set_zip_comm
[PROOF STATE]
proof (prove)
using this:
(?x, ?y) \<in> set (zip ?xs ?ys) \<Longrightarrow> (?y, ?x) \<in> set (zip ?ys ?xs)

goal (1 subgoal):
 1. length xs = length ys \<and> pairwise sp_equiv_pair (set (zip xs ys)) \<Longrightarrow> length ys = length xs \<and> pairwise sp_equiv_pair (set (zip ys xs))
[PROOF STEP]
by (auto simp: pairwise_def) force+


[STATEMENT]
lemma inorder_del: "\<lbrakk> bal t ; sorted(inorder t) \<rbrakk> \<Longrightarrow>
  inorder(tree\<^sub>d (del x t)) = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bal t; Sorted_Less.sorted (inorder t)\<rbrakk> \<Longrightarrow> inorder (tree\<^sub>d (del x t)) = del_list x (inorder t)
[PROOF STEP]
by(induction t rule: del.induct)
  (auto simp: inorder_nodes del_list_simps split_minD split!: if_split prod.splits)


[STATEMENT]
lemma wordinterval_intersection_set_eq[simp]:
    "wordinterval_to_set (wordinterval_intersection r1 r2) =
      wordinterval_to_set r1 \<inter> wordinterval_to_set r2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (wordinterval_intersection r1 r2) = wordinterval_to_set r1 \<inter> wordinterval_to_set r2
[PROOF STEP]
by(simp add: wordinterval_intersection_def
                 wordinterval_compress wordinterval_intersection'_set_eq)


[STATEMENT]
lemma ideal_generated_eq_left_ideal: "ideal_generated A = left_ideal_generated A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated A = left_ideal_generated A
[PROOF STEP]
unfolding ideal_generated_def ideal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> {I. (left_ideal I \<and> right_ideal I) \<and> A \<subseteq> I} = left_ideal_generated A
[PROOF STEP]
by (metis (no_types, lifting) Collect_cong left_ideal_eq_right_ideal left_ideal_generated_def)


[STATEMENT]
lemma card_T_bound: "card ((t\<circ>OB)`msgs) \<le> (n+1)^card observations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
have "(t\<circ>OB)`msgs \<subseteq> extensionalD 0 observations \<inter> (observations \<rightarrow> {.. n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<circ> OB) ` msgs \<subseteq> extensionalD 0 observations \<inter> (observations \<rightarrow> {..n})
[PROOF STEP]
unfolding observations_def extensionalD_def OB_def msgs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<circ> (\<lambda>(k, y). map (observe k) y)) ` (keys \<times> {ms. set ms \<subseteq> messages \<and> length ms = n}) \<subseteq> {f. \<forall>x. x \<notin> (\<Union>f\<in>observe ` keys. f ` messages) \<longrightarrow> f x = 0} \<inter> ((\<Union>f\<in>observe ` keys. f ` messages) \<rightarrow> {..n})
[PROOF STEP]
by (auto simp add: t_def comp_def image_iff subset_eq)
[PROOF STATE]
proof (state)
this:
(t \<circ> OB) ` msgs \<subseteq> extensionalD 0 observations \<inter> (observations \<rightarrow> {..n})

goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
with finite_extensionalD_funcset
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> finite (extensionalD ?d ?A \<inter> (?A \<rightarrow> ?B))
(t \<circ> OB) ` msgs \<subseteq> extensionalD 0 observations \<inter> (observations \<rightarrow> {..n})
[PROOF STEP]
have "card ((t\<circ>OB)`msgs) \<le> card (extensionalD 0 observations \<inter> (observations \<rightarrow> {.. n}))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> finite (extensionalD ?d ?A \<inter> (?A \<rightarrow> ?B))
(t \<circ> OB) ` msgs \<subseteq> extensionalD 0 observations \<inter> (observations \<rightarrow> {..n})

goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> card (extensionalD 0 observations \<inter> (observations \<rightarrow> {..n}))
[PROOF STEP]
by (rule card_mono) auto
[PROOF STATE]
proof (state)
this:
card ((t \<circ> OB) ` msgs) \<le> card (extensionalD 0 observations \<inter> (observations \<rightarrow> {..n}))

goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ((t \<circ> OB) ` msgs) \<le> card (extensionalD 0 observations \<inter> (observations \<rightarrow> {..n}))

goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
have "\<dots> = (n + 1) ^ card observations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (extensionalD 0 observations \<inter> (observations \<rightarrow> {..n})) = (n + 1) ^ card observations
[PROOF STEP]
by (subst card_funcset) auto
[PROOF STATE]
proof (state)
this:
card (extensionalD 0 observations \<inter> (observations \<rightarrow> {..n})) = (n + 1) ^ card observations

goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations

goal (1 subgoal):
 1. card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card ((t \<circ> OB) ` msgs) \<le> (n + 1) ^ card observations

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma psign_diff_alt:
  assumes "coprime p q"
  shows "psign_diff p q x = \<bar>sign (poly p x) - sign (poly q x)\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psign_diff p q x = \<bar>sign (poly p x) - sign (poly q x)\<bar>
[PROOF STEP]
unfolding psign_diff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if poly p x = 0 \<and> poly q x = 0 then 1 else \<bar>sign (poly p x) - sign (poly q x)\<bar>) = \<bar>sign (poly p x) - sign (poly q x)\<bar>
[PROOF STEP]
by (meson assms coprime_poly_0)


[STATEMENT]
lemma fact_not_neg [simp]: "\<not> fact n < (0 :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> fact n < (0::'a)
[PROOF STEP]
by (simp add: not_less_iff_gr_or_eq)


[STATEMENT]
lemma affine_hull_span_gen:
  assumes "a \<in> affine hull s"
  shows "affine hull s = (\<lambda>x. a+x) ` span ((\<lambda>x. -a+x) ` s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull s = (+) a ` span ((+) (- a) ` s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. affine hull s = (+) a ` span ((+) (- a) ` s)
[PROOF STEP]
have "affine hull (insert a s) = affine hull s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull insert a s = affine hull s
[PROOF STEP]
using hull_redundant[of a affine s] assms
[PROOF STATE]
proof (prove)
using this:
a \<in> affine hull s \<Longrightarrow> affine hull insert a s = affine hull s
a \<in> affine hull s

goal (1 subgoal):
 1. affine hull insert a s = affine hull s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine hull insert a s = affine hull s

goal (1 subgoal):
 1. affine hull s = (+) a ` span ((+) (- a) ` s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine hull insert a s = affine hull s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
affine hull insert a s = affine hull s

goal (1 subgoal):
 1. affine hull s = (+) a ` span ((+) (- a) ` s)
[PROOF STEP]
using affine_hull_insert_span_gen[of a "s"]
[PROOF STATE]
proof (prove)
using this:
affine hull insert a s = affine hull s
affine hull insert a s = (+) a ` span ((+) (- a) ` s)

goal (1 subgoal):
 1. affine hull s = (+) a ` span ((+) (- a) ` s)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine hull s = (+) a ` span ((+) (- a) ` s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_deriv_compose:
  assumes "\<exists>S. f field_differentiable_on S \<and> x \<in> interior S"
      and "g twice_field_differentiable_at (f x)"
    shows "\<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
obtain S S'
   where Df_on_S:  "f field_differentiable_on S" and x_int_S: "x \<in> interior S"
     and Dg_on_S': "g field_differentiable_on S'" and fx_int_S': "f x \<in> interior S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S S'. \<lbrakk>f field_differentiable_on S; x \<in> interior S; g field_differentiable_on S'; f x \<in> interior S'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms twice_field_differentiable_at_def
[PROOF STATE]
proof (prove)
using this:
\<exists>S. f field_differentiable_on S \<and> x \<in> interior S
g twice_field_differentiable_at f x
?f twice_field_differentiable_at ?x \<equiv> \<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S \<and> deriv ?f field_differentiable at ?x

goal (1 subgoal):
 1. (\<And>S S'. \<lbrakk>f field_differentiable_on S; x \<in> interior S; g field_differentiable_on S'; f x \<in> interior S'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f field_differentiable_on S
x \<in> interior S
g field_differentiable_on S'
f x \<in> interior S'

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
let ?T = "{x \<in> interior S. f x \<in> interior S'}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
have "continuous_on (interior S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (interior S) f
[PROOF STEP]
by (meson Df_on_S continuous_on_eq_continuous_within continuous_on_subset field_differentiable_imp_continuous_at
         field_differentiable_on_def interior_subset)
[PROOF STATE]
proof (state)
this:
continuous_on (interior S) f

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (interior S) f
[PROOF STEP]
have "open (interior S \<inter> {x. f x \<in> interior S'})"
[PROOF STATE]
proof (prove)
using this:
continuous_on (interior S) f

goal (1 subgoal):
 1. open (interior S \<inter> {x. f x \<in> interior S'})
[PROOF STEP]
by (metis continuous_open_preimage open_interior vimage_def)
[PROOF STATE]
proof (state)
this:
open (interior S \<inter> {x. f x \<in> interior S'})

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open (interior S \<inter> {x. f x \<in> interior S'})
[PROOF STEP]
have x_int_T: "x \<in> interior ?T"
[PROOF STATE]
proof (prove)
using this:
open (interior S \<inter> {x. f x \<in> interior S'})

goal (1 subgoal):
 1. x \<in> interior {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
by (metis (no_types) Collect_conj_eq Collect_mem_eq Int_Collect fx_int_S' interior_eq x_int_S)
[PROOF STATE]
proof (state)
this:
x \<in> interior {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> interior {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
have  Dg_on_fT: "g field_differentiable_on f`?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
by (metis (no_types, lifting) Dg_on_S' field_differentiable_on_subset image_Collect_subsetI interior_subset)
[PROOF STATE]
proof (state)
this:
g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
have Df_on_T: "f field_differentiable_on ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
using  field_differentiable_on_subset Df_on_S
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f field_differentiable_on ?S; ?T \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f field_differentiable_on ?T
f field_differentiable_on S

goal (1 subgoal):
 1. f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
by (metis Collect_subset interior_subset)
[PROOF STATE]
proof (state)
this:
f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
have "\<forall>x \<in> interior ?T. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>interior {x \<in> interior S. f x \<in> interior S'}. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
assume x_int_T: "x \<in> interior ?T"
[PROOF STATE]
proof (state)
this:
x \<in> interior {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<And>x. x \<in> interior {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
have "f field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f field_differentiable at x
[PROOF STEP]
by (metis (no_types, lifting) Df_on_T at_within_interior field_differentiable_on_def
          interior_subset subsetD x_int_T)
[PROOF STATE]
proof (state)
this:
f field_differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> interior {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f field_differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> interior {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
have "g field_differentiable at (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g field_differentiable at (f x)
[PROOF STEP]
by (metis (no_types, lifting) Dg_on_S' at_within_interior field_differentiable_on_def
          interior_subset mem_Collect_eq subsetD x_int_T)
[PROOF STATE]
proof (state)
this:
g field_differentiable at (f x)

goal (1 subgoal):
 1. \<And>x. x \<in> interior {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f field_differentiable at x
g field_differentiable at (f x)
[PROOF STEP]
have "deriv (g \<circ> f) x = deriv g (f x) * deriv f x"
[PROOF STATE]
proof (prove)
using this:
f field_differentiable at x
g field_differentiable at (f x)

goal (1 subgoal):
 1. deriv (g \<circ> f) x = deriv g (f x) * deriv f x
[PROOF STEP]
using deriv_chain[of f x g]
[PROOF STATE]
proof (prove)
using this:
f field_differentiable at x
g field_differentiable at (f x)
\<lbrakk>f field_differentiable at x; g field_differentiable at (f x)\<rbrakk> \<Longrightarrow> deriv (g \<circ> f) x = deriv g (f x) * deriv f x

goal (1 subgoal):
 1. deriv (g \<circ> f) x = deriv g (f x) * deriv f x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
deriv (g \<circ> f) x = deriv g (f x) * deriv f x

goal (1 subgoal):
 1. \<And>x. x \<in> interior {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (g \<circ> f) x = deriv g (f x) * deriv f x
[PROOF STEP]
show "deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x"
[PROOF STATE]
proof (prove)
using this:
deriv (g \<circ> f) x = deriv g (f x) * deriv f x

goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
by (simp add: comp_def)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>interior {x \<in> interior S. f x \<in> interior S'}. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<in> interior {x \<in> interior S. f x \<in> interior S'}
g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}
f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
\<forall>x\<in>interior {x \<in> interior S. f x \<in> interior S'}. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> interior {x \<in> interior S. f x \<in> interior S'}
g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}
f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
\<forall>x\<in>interior {x \<in> interior S. f x \<in> interior S'}. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
using eventually_nhds
[PROOF STATE]
proof (prove)
using this:
x \<in> interior {x \<in> interior S. f x \<in> interior S'}
g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}
f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
\<forall>x\<in>interior {x \<in> interior S. f x \<in> interior S'}. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
eventually ?P (nhds ?a) = (\<exists>S. open S \<and> ?a \<in> S \<and> (\<forall>x\<in>S. ?P x))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma topology_finer_closed_id:
    "(\<forall>S. closedin X S \<longrightarrow> closedin X' S) \<longleftrightarrow> closed_map X X' id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>S. closedin X S \<longrightarrow> closedin X' S) = closed_map X X' id
[PROOF STEP]
by (simp add: closed_map_def)


[STATEMENT]
lemma (in normal_set) less_next: "x < (LEAST z. z \<in> A \<and> x < z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < (LEAST z. z \<in> A \<and> x < z)
[PROOF STEP]
apply (rule LeastI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>a. a \<in> A \<and> x < a
 2. \<And>xa. xa \<in> A \<and> x < xa \<Longrightarrow> x < xa
[PROOF STEP]
apply (fold Bex_def, rule unbounded)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> A \<and> x < xa \<Longrightarrow> x < xa
[PROOF STEP]
apply (erule conjunct2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma jordan_matrix_concat_diag_block_mat: "jordan_matrix (concat jbs) = diag_block_mat (map jordan_matrix jbs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jordan_matrix (concat jbs) = diag_block_mat (map jordan_matrix jbs)
[PROOF STEP]
unfolding jordan_matrix_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (map (\<lambda>(x, y). jordan_block x y) (concat jbs)) = diag_block_mat (map (\<lambda>n_as. diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) jbs)
[PROOF STEP]
by (induct jbs, auto simp: diag_block_mat_append Let_def)


[STATEMENT]
theorem wls_vsubstEnv_substEnv_compose1:
assumes "wlsEnv rho" and "wls (asSort ys) Y"
shows "((rho &[Y / y]_ys) &[y1 // y]_ys) = (rho &[(Y #[y1 // y]_ys) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[Y / y]_ys &[y1 // y]_ys = rho &[Y #[y1 // y]_ys / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho
wls (asSort ys) Y

goal (1 subgoal):
 1. rho &[Y / y]_ys &[y1 // y]_ys = rho &[Y #[y1 // y]_ys / y]_ys
[PROOF STEP]
by(simp add: vsubstEnv_substEnv_compose1)


[STATEMENT]
lemma eval_dioph_replicate_0: "eval_dioph ks (replicate n 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_dioph ks (replicate n 0) = 0
[PROOF STEP]
apply (induct n arbitrary: ks)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ks. eval_dioph ks (replicate 0 0) = 0
 2. \<And>n ks. (\<And>ks. eval_dioph ks (replicate n 0) = 0) \<Longrightarrow> eval_dioph ks (replicate (Suc n) 0) = 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n ks. (\<And>ks. eval_dioph ks (replicate n 0) = 0) \<Longrightarrow> eval_dioph ks (replicate (Suc n) 0) = 0
[PROOF STEP]
apply (case_tac ks)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n ks. \<lbrakk>\<And>ks. eval_dioph ks (replicate n 0) = 0; ks = []\<rbrakk> \<Longrightarrow> eval_dioph ks (replicate (Suc n) 0) = 0
 2. \<And>n ks a list. \<lbrakk>\<And>ks. eval_dioph ks (replicate n 0) = 0; ks = a # list\<rbrakk> \<Longrightarrow> eval_dioph ks (replicate (Suc n) 0) = 0
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma reverse_arc_in_G:
  assumes "graph G" and "e1 \<in> arcs T"
  shows "\<exists>e2 \<in> arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e2\<in>arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e2\<in>arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2
[PROOF STEP]
interpret graph G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph G
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
graph G

goal (1 subgoal):
 1. graph G
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e2\<in>arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2
[PROOF STEP]
have "e1 \<in> arcs G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e1 \<in> arcs G
[PROOF STEP]
using assms(2) sub_G
[PROOF STATE]
proof (prove)
using this:
e1 \<in> arcs T
Digraph_Component.subgraph T G

goal (1 subgoal):
 1. e1 \<in> arcs G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
e1 \<in> arcs G

goal (1 subgoal):
 1. \<exists>e2\<in>arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e1 \<in> arcs G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
e1 \<in> arcs G

goal (1 subgoal):
 1. \<exists>e2\<in>arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2
[PROOF STEP]
using sym_arcs symmetric_conv
[PROOF STATE]
proof (prove)
using this:
e1 \<in> arcs G
symmetric G
symmetric ?G = (\<forall>e1\<in>arcs ?G. \<exists>e2\<in>arcs ?G. tail ?G e1 = head ?G e2 \<and> head ?G e1 = tail ?G e2)

goal (1 subgoal):
 1. \<exists>e2\<in>arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>e2\<in>arcs G. head G e2 = tail G e1 \<and> head G e1 = tail G e2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_derivative_exists:
  "\<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and>
    f' h = nth_derivative (Suc i) f x h"
  if "higher_differentiable_on X f (Suc i)" "open X" "x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h
[PROOF STEP]
using that(1)
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on X f (Suc i)

goal (1 subgoal):
 1. \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h
[PROOF STEP]
proof (induction i arbitrary: f)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. higher_differentiable_on X f (Suc 0) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative 0 f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc 0) f x h
 2. \<And>i f. \<lbrakk>\<And>f. higher_differentiable_on X f (Suc i) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h; higher_differentiable_on X f (Suc (Suc i))\<rbrakk> \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
higher_differentiable_on X f (Suc 0)

goal (2 subgoals):
 1. \<And>f. higher_differentiable_on X f (Suc 0) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative 0 f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc 0) f x h
 2. \<And>i f. \<lbrakk>\<And>f. higher_differentiable_on X f (Suc i) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h; higher_differentiable_on X f (Suc (Suc i))\<rbrakk> \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
higher_differentiable_on X f (Suc i)
open X
x \<in> X
higher_differentiable_on X f (Suc 0)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on X f (Suc i)
open X
x \<in> X
higher_differentiable_on X f (Suc 0)

goal (1 subgoal):
 1. \<exists>f'. ((\<lambda>x. nth_derivative 0 f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc 0) f x h
[PROOF STEP]
by (auto simp: higher_differentiable_on.simps that dest!: frechet_derivative_worksI)
[PROOF STATE]
proof (state)
this:
\<exists>f'. ((\<lambda>x. nth_derivative 0 f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc 0) f x h

goal (1 subgoal):
 1. \<And>i f. \<lbrakk>\<And>f. higher_differentiable_on X f (Suc i) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h; higher_differentiable_on X f (Suc (Suc i))\<rbrakk> \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i f. \<lbrakk>\<And>f. higher_differentiable_on X f (Suc i) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h; higher_differentiable_on X f (Suc (Suc i))\<rbrakk> \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
higher_differentiable_on X ?f (Suc i) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative i ?f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) ?f x h
higher_differentiable_on X f (Suc (Suc i))

goal (1 subgoal):
 1. \<And>i f. \<lbrakk>\<And>f. higher_differentiable_on X f (Suc i) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h; higher_differentiable_on X f (Suc (Suc i))\<rbrakk> \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h
[PROOF STEP]
from Suc.prems
[PROOF STATE]
proof (chain)
picking this:
higher_differentiable_on X f (Suc (Suc i))
[PROOF STEP]
have "\<And>x. x \<in> X \<Longrightarrow> f differentiable at x" "higher_differentiable_on X (\<lambda>x. frechet_derivative f (at x) h) (Suc i)"
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on X f (Suc (Suc i))

goal (1 subgoal):
 1. (\<And>x. x \<in> X \<Longrightarrow> f differentiable at x) &&& higher_differentiable_on X (\<lambda>x. frechet_derivative f (at x) h) (Suc i)
[PROOF STEP]
unfolding higher_differentiable_on.simps(2)[where n = "Suc i"]
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>X. f differentiable at x) \<and> (\<forall>v. higher_differentiable_on X (\<lambda>x. frechet_derivative f (at x) v) (Suc i))

goal (1 subgoal):
 1. (\<And>x. x \<in> X \<Longrightarrow> f differentiable at x) &&& higher_differentiable_on X (\<lambda>x. frechet_derivative f (at x) h) (Suc i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> X \<Longrightarrow> f differentiable at ?x
higher_differentiable_on X (\<lambda>x. frechet_derivative f (at x) h) (Suc i)

goal (1 subgoal):
 1. \<And>i f. \<lbrakk>\<And>f. higher_differentiable_on X f (Suc i) \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative i f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) f x h; higher_differentiable_on X f (Suc (Suc i))\<rbrakk> \<Longrightarrow> \<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h
[PROOF STEP]
from Suc.IH[OF this(2)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>f'. ((\<lambda>x. nth_derivative i (\<lambda>a. frechet_derivative f (at a) h) x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) (\<lambda>a. frechet_derivative f (at a) h) x h
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>f'. ((\<lambda>x. nth_derivative i (\<lambda>a. frechet_derivative f (at a) h) x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc i) (\<lambda>a. frechet_derivative f (at a) h) x h

goal (1 subgoal):
 1. \<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f'. ((\<lambda>x. nth_derivative (Suc i) f x h) has_derivative f') (at x) \<and> f' h = nth_derivative (Suc (Suc i)) f x h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_matrix_vector_mul_left:
  assumes i: "invertible A"
  shows "(A *v x = A *v y) = (x=y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *v x = A *v y) = (x = y)
[PROOF STEP]
by (metis i invertible_def matrix_vector_mul_assoc matrix_vector_mul_lid)


[STATEMENT]
lemma snd_poly_pfd_simple:
  "map (map (\<lambda>c. [:c :: 'a :: field_gcd:])) (snd (poly_pfd_simple x cs)) =
      (snd (partial_fraction_decomposition x (map (\<lambda>(c,n). ([:1,-c:],n)) cs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))
[PROOF STEP]
have "snd (poly_pfd_simple x cs) = map (map (\<lambda>p. coeff p 0))
          (snd (partial_fraction_decomposition x (map (\<lambda>(c,n). ([:1,-c:],n)) cs)))"
       (is "_ = map ?f ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (poly_pfd_simple x cs) = map (map (\<lambda>p. coeff p 0)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
[PROOF STEP]
by (auto simp: poly_pfd_simple_def partial_fraction_decomposition_def o_def
               case_prod_unfold Let_def sum_list_sum_nth intro!: sum.cong)
[PROOF STATE]
proof (state)
this:
snd (poly_pfd_simple x cs) = map (map (\<lambda>p. coeff p 0)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))

goal (1 subgoal):
 1. map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
snd (poly_pfd_simple x cs) = map (map (\<lambda>p. coeff p 0)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))

goal (1 subgoal):
 1. map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))
[PROOF STEP]
have "map (map (\<lambda>c. [:c:])) (map ?f ?B) = map (map (\<lambda>x. x)) ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (map (\<lambda>c. [:c:])) (map (map (\<lambda>p. coeff p 0)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))) = map (map (\<lambda>x. x)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
[PROOF STEP]
unfolding map_map o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (map (\<lambda>x. [:coeff x 0:])) (snd (partial_fraction_decomposition x (map (\<lambda>(c, y). ([:1::'a, - c:], y)) cs))) = map (map (\<lambda>x. x)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
[PROOF STEP]
proof (intro map_cong refl const_polyI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))); xaa \<in> set xa\<rbrakk> \<Longrightarrow> degree xaa = 0
[PROOF STEP]
case (1 ys y)
[PROOF STATE]
proof (state)
this:
ys \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
y \<in> set ys

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))); xaa \<in> set xa\<rbrakk> \<Longrightarrow> degree xaa = 0
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
ys \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
y \<in> set ys
[PROOF STEP]
obtain i where i: "i < length cs"
      "ys = snd (partial_fraction_decomposition x (map (\<lambda>(c,n). ([:1,-c:],n)) cs)) ! i"
[PROOF STATE]
proof (prove)
using this:
ys \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
y \<in> set ys

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < length cs; ys = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)) ! i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: in_set_conv_nth)
[PROOF STATE]
proof (state)
this:
i < length cs
ys = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)) ! i

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))); xaa \<in> set xa\<rbrakk> \<Longrightarrow> degree xaa = 0
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
ys \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
y \<in> set ys
i < length cs
ys = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)) ! i
[PROOF STEP]
have "euclidean_size y < euclidean_size (fst (map (\<lambda>(c,n). ([:1,-c:],n)) cs ! i))"
[PROOF STATE]
proof (prove)
using this:
ys \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))
y \<in> set ys
i < length cs
ys = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)) ! i

goal (1 subgoal):
 1. euclidean_size y < euclidean_size (fst (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs ! i))
[PROOF STEP]
by (intro size_partial_fraction_decomposition[of i _ _ x])
         (auto simp: case_prod_unfold Let_def)
[PROOF STATE]
proof (state)
this:
euclidean_size y < euclidean_size (fst (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs ! i))

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))); xaa \<in> set xa\<rbrakk> \<Longrightarrow> degree xaa = 0
[PROOF STEP]
with i(1)
[PROOF STATE]
proof (chain)
picking this:
i < length cs
euclidean_size y < euclidean_size (fst (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs ! i))
[PROOF STEP]
have "euclidean_size y < 2"
[PROOF STATE]
proof (prove)
using this:
i < length cs
euclidean_size y < euclidean_size (fst (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs ! i))

goal (1 subgoal):
 1. euclidean_size y < 2
[PROOF STEP]
by (auto simp: case_prod_unfold Let_def euclidean_size_poly_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
euclidean_size y < 2

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))); xaa \<in> set xa\<rbrakk> \<Longrightarrow> degree xaa = 0
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
euclidean_size y < 2

goal (1 subgoal):
 1. degree y = 0
[PROOF STEP]
by (cases y rule: pCons_cases) (auto simp: euclidean_size_poly_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
degree y = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map (map (\<lambda>c. [:c:])) (map (map (\<lambda>p. coeff p 0)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))) = map (map (\<lambda>x. x)) (snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs)))

goal (1 subgoal):
 1. map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = map (map (\<lambda>x. x)) (snd (partial_fraction_decomposition x (map (\<lambda>a. case a of (c, n) \<Rightarrow> ([:1::'a, - c:], n)) cs)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = map (map (\<lambda>x. x)) (snd (partial_fraction_decomposition x (map (\<lambda>a. case a of (c, n) \<Rightarrow> ([:1::'a, - c:], n)) cs)))

goal (1 subgoal):
 1. map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map (map (\<lambda>c. [:c:])) (snd (poly_pfd_simple x cs)) = snd (partial_fraction_decomposition x (map (\<lambda>(c, n). ([:1::'a, - c:], n)) cs))

goal:
No subgoals!
[PROOF STEP]
qed