[STATEMENT]
lemma poly_det_cong: assumes A: "A \<in> carrier_mat n n"
  and B: "B \<in> carrier_mat n n"
  and poly: "\<And> i j. i < n \<Longrightarrow> j < n \<Longrightarrow> poly (B $$ (i,j)) k = A $$ (i,j)"
  shows "poly (det B) k = det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (det B) k = det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly (det B) k = det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (det B) k = det A
[PROOF STEP]
unfolding det_def'[OF A] det_def'[OF B] poly_sum poly_mult poly_prod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ka\<in>{p. p permutes {0..<n}}. poly (of_int (sign ka)) k * (\<Prod>kb = 0..<n. poly (B $$ (kb, ka kb)) k)) = (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. A $$ (i, p i)))
[PROOF STEP]
proof (rule sum.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
assume x: "x \<in> {p. p permutes {0..<n}}"
[PROOF STATE]
proof (state)
this:
x \<in> {p. p permutes {0..<n}}

goal (1 subgoal):
 1. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
let ?l = "\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
let ?r = "\<Prod>i = 0..<n. A $$ (i, x i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
have id: "?l = ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
by (rule prod.cong[OF refl poly], insert x, auto)
[PROOF STATE]
proof (state)
this:
(\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = (\<Prod>i = 0..<n. A $$ (i, x i))

goal (1 subgoal):
 1. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
show "poly (signof x) k * ?l = signof x * ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))
[PROOF STEP]
by (cases x rule: sign_cases) (simp_all add: id)
[PROOF STATE]
proof (state)
this:
poly (of_int (sign x)) k * (\<Prod>ka = 0..<n. poly (B $$ (ka, x ka)) k) = of_int (sign x) * (\<Prod>i = 0..<n. A $$ (i, x i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly (det B) k = det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cols_transpose[simp]: "cols A\<^sup>T = rows A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cols A\<^sup>T = rows A
[PROOF STEP]
unfolding cols_def rows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (col A\<^sup>T) [0..<dim_col A\<^sup>T] = map (row A) [0..<dim_row A]
[PROOF STEP]
by auto


[STATEMENT]
lemma length_upto_enum_step:
  fixes x :: "'a :: len word"
  shows "x \<le> z \<Longrightarrow> length [x , y .e. z] = (unat ((z - x) div (y - x))) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> z \<Longrightarrow> length [x , y .e. z] = unat ((z - x) div (y - x)) + 1
[PROOF STEP]
unfolding upto_enum_step_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> z \<Longrightarrow> length (if z < x then [] else map (\<lambda>xa. x + xa * (y - x)) [0 .e. (z - x) div (y - x)]) = unat ((z - x) div (y - x)) + 1
[PROOF STEP]
by (simp add: upto_enum_red)


[STATEMENT]
lemma finite_imageI''[intro]:
  assumes "finite (A \<times> B)"
  shows "finite {f x y | x y. x \<in> A \<and> y \<in> B \<and> R x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite (A \<times> B)
[PROOF STEP]
have "finite {f x y | x y. x \<in> A \<and> y \<in> B}"
[PROOF STATE]
proof (prove)
using this:
finite (A \<times> B)

goal (1 subgoal):
 1. finite {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {f x y |x y. x \<in> A \<and> y \<in> B}

goal (1 subgoal):
 1. finite {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {f x y |x y. x \<in> A \<and> y \<in> B}

goal (1 subgoal):
 1. finite {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y}
[PROOF STEP]
have "{f x y | x y. x \<in> A \<and> y \<in> B \<and> R x y} \<subseteq> {f x y | x y. x \<in> A \<and> y \<in> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y} \<subseteq> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y} \<subseteq> {f x y |x y. x \<in> A \<and> y \<in> B}

goal (1 subgoal):
 1. finite {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {f x y |x y. x \<in> A \<and> y \<in> B}
{f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y} \<subseteq> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {f x y |x y. x \<in> A \<and> y \<in> B}
{f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y} \<subseteq> {f x y |x y. x \<in> A \<and> y \<in> B}

goal (1 subgoal):
 1. finite {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y}
[PROOF STEP]
by (blast intro: finite_subset)
[PROOF STATE]
proof (state)
this:
finite {f x y |x y. x \<in> A \<and> y \<in> B \<and> R x y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat0_row[simp]: assumes "i < nr"
  shows "row (mat0I ze nr nc) i = vec0I ze nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat0I ze nr nc) i = vec0I ze nc
[PROOF STEP]
unfolding row_def mat0I_def vec0I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>w. w ! i) (replicate nc (replicate nr ze)) = replicate nc ze
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < nr

goal (1 subgoal):
 1. map (\<lambda>w. w ! i) (replicate nc (replicate nr ze)) = replicate nc ze
[PROOF STEP]
by auto


[STATEMENT]
lemma le_iff_le_annos: "C1 \<le> C2 \<longleftrightarrow>
  strip C1 = strip C2 \<and> (\<forall> i<size(annos C1). annos C1 ! i \<le> annos C2 ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (C1 \<le> C2) = (strip C1 = strip C2 \<and> (\<forall>i<length (annos C1). annos C1 ! i \<le> annos C2 ! i))
[PROOF STEP]
by(simp add: less_eq_acom_def anno_def)


[STATEMENT]
lemma bounded_clinear_of_complex: "bounded_clinear (\<lambda>r. of_complex r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear of_complex
[PROOF STEP]
unfolding of_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear (\<lambda>r. r *\<^sub>C (1::'a))
[PROOF STEP]
by (rule bounded_clinear_scaleC_left)


[STATEMENT]
lemma similar_triangle_aa:
  assumes "b1 \<noteq> c1" "b2 \<noteq> c2"
  assumes "angle a1 b1 c1 = angle a2 b2 c2"
  assumes "angle b1 c1 a1 = angle b2 c2 a2"
  shows   "angle b1 a1 c1 = angle b2 a2 c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. angle b1 a1 c1 = angle b2 a2 c2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. angle b1 a1 c1 = angle b2 a2 c2
[PROOF STEP]
from assms angle_sum_triangle[of a1 b1 c1] angle_sum_triangle[of a2 b2 c2, symmetric]
[PROOF STATE]
proof (chain)
picking this:
b1 \<noteq> c1
b2 \<noteq> c2
angle a1 b1 c1 = angle a2 b2 c2
angle b1 c1 a1 = angle b2 c2 a2
a1 \<noteq> b1 \<or> b1 \<noteq> c1 \<or> a1 \<noteq> c1 \<Longrightarrow> angle c1 a1 b1 + angle a1 b1 c1 + angle b1 c1 a1 = pi
a2 \<noteq> b2 \<or> b2 \<noteq> c2 \<or> a2 \<noteq> c2 \<Longrightarrow> pi = angle c2 a2 b2 + angle a2 b2 c2 + angle b2 c2 a2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b1 \<noteq> c1
b2 \<noteq> c2
angle a1 b1 c1 = angle a2 b2 c2
angle b1 c1 a1 = angle b2 c2 a2
a1 \<noteq> b1 \<or> b1 \<noteq> c1 \<or> a1 \<noteq> c1 \<Longrightarrow> angle c1 a1 b1 + angle a1 b1 c1 + angle b1 c1 a1 = pi
a2 \<noteq> b2 \<or> b2 \<noteq> c2 \<or> a2 \<noteq> c2 \<Longrightarrow> pi = angle c2 a2 b2 + angle a2 b2 c2 + angle b2 c2 a2

goal (1 subgoal):
 1. angle b1 a1 c1 = angle b2 a2 c2
[PROOF STEP]
by (auto simp: algebra_simps angle_commute)
[PROOF STATE]
proof (state)
this:
angle b1 a1 c1 = angle b2 a2 c2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rquot_well_formed_aut:
  assumes "wf_dfa M n"
  shows "wf_dfa (rquot M n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_dfa (rquot M n) n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wf_dfa M n

goal (1 subgoal):
 1. wf_dfa (rquot M n) n
[PROOF STEP]
by (simp add: rquot_def split_beta wf_dfa_def map_index_len dfa_is_node_def)


[STATEMENT]
lemma deleteMin_mset:
  assumes "queue_invar q"
    and "q \<noteq> Nil"
  shows "queue_to_multiset (deleteMin q) = queue_to_multiset q - {# (findMin q) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
from assms mintree_exists[of "q"]
[PROOF STATE]
proof (chain)
picking this:
queue_invar q
q \<noteq> []
(q \<noteq> []) = (getMinTree q \<in> set q)
[PROOF STEP]
have min_in_q: "getMinTree q \<in> set q"
[PROOF STATE]
proof (prove)
using this:
queue_invar q
q \<noteq> []
(q \<noteq> []) = (getMinTree q \<in> set q)

goal (1 subgoal):
 1. getMinTree q \<in> set q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
getMinTree q \<in> set q

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
queue_invar q
getMinTree q \<in> set q
[PROOF STEP]
have inv_min: "tree_invar (getMinTree q)"
[PROOF STATE]
proof (prove)
using this:
queue_invar q
getMinTree q \<in> set q

goal (1 subgoal):
 1. tree_invar (getMinTree q)
[PROOF STEP]
by (simp add: queue_invar_def)
[PROOF STATE]
proof (state)
this:
tree_invar (getMinTree q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> []
[PROOF STEP]
have q_ne: "q \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []

goal (1 subgoal):
 1. q \<noteq> []
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
q \<noteq> []

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_children = invar_children'[OF inv_min]
[PROOF STATE]
proof (state)
this:
queue_invar (children (getMinTree q))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_rev = queue_invar_rev[OF inv_children]
[PROOF STATE]
proof (state)
this:
queue_invar (rev (children (getMinTree q)))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_rem = queue_invar_remove1[OF assms(1), of "getMinTree q"]
[PROOF STATE]
proof (state)
this:
queue_invar (remove1 (getMinTree q) q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note m_meld = meld_mset[OF inv_rev inv_rem]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (meld (rev (children (getMinTree q))) (remove1 (getMinTree q) q)) = queue_to_multiset (rev (children (getMinTree q))) + queue_to_multiset (remove1 (getMinTree q) q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note m_rem = remove1_mset[OF min_in_q]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (remove1 (getMinTree q) q) = queue_to_multiset q - tree_to_multiset (getMinTree q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note m_rev = qtmset_rev[of "children (getMinTree q)"]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (rev (children (getMinTree q))) = queue_to_multiset (children (getMinTree q))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note m_children = children_mset[of "getMinTree q"]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (children (getMinTree q)) = tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#}

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note min_subset_q = qtm_in_set_subset[OF min_in_q]
[PROOF STATE]
proof (state)
this:
tree_to_multiset (getMinTree q) \<subseteq># queue_to_multiset q

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
let ?Q = "queue_to_multiset q"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
let ?MT = "tree_to_multiset (getMinTree q)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
from q_ne
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> []
[PROOF STEP]
have head_subset_min:
    "{# (val (getMinTree q), prio (getMinTree q)) #} \<subseteq># ?MT"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []

goal (1 subgoal):
 1. {#(val (getMinTree q), prio (getMinTree q))#} \<subseteq># tree_to_multiset (getMinTree q)
[PROOF STEP]
by(cases "getMinTree q") simp
[PROOF STATE]
proof (state)
this:
{#(val (getMinTree q), prio (getMinTree q))#} \<subseteq># tree_to_multiset (getMinTree q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
let ?Q = "queue_to_multiset q"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
let ?MT = "tree_to_multiset (getMinTree q)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
from m_meld m_rem m_rev m_children
    multiset_diff_union_assoc[OF head_subset_min, of "?Q - ?MT"]
    mset_subset_eq_multiset_union_diff_commute[OF min_subset_q, of "?MT"]
[PROOF STATE]
proof (chain)
picking this:
queue_to_multiset (meld (rev (children (getMinTree q))) (remove1 (getMinTree q) q)) = queue_to_multiset (rev (children (getMinTree q))) + queue_to_multiset (remove1 (getMinTree q) q)
queue_to_multiset (remove1 (getMinTree q) q) = queue_to_multiset q - tree_to_multiset (getMinTree q)
queue_to_multiset (rev (children (getMinTree q))) = queue_to_multiset (children (getMinTree q))
queue_to_multiset (children (getMinTree q)) = tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#}
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#} = queue_to_multiset q - tree_to_multiset (getMinTree q) + (tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#})
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) = queue_to_multiset q + tree_to_multiset (getMinTree q) - tree_to_multiset (getMinTree q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
queue_to_multiset (meld (rev (children (getMinTree q))) (remove1 (getMinTree q) q)) = queue_to_multiset (rev (children (getMinTree q))) + queue_to_multiset (remove1 (getMinTree q) q)
queue_to_multiset (remove1 (getMinTree q) q) = queue_to_multiset q - tree_to_multiset (getMinTree q)
queue_to_multiset (rev (children (getMinTree q))) = queue_to_multiset (children (getMinTree q))
queue_to_multiset (children (getMinTree q)) = tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#}
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#} = queue_to_multiset q - tree_to_multiset (getMinTree q) + (tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#})
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) = queue_to_multiset q + tree_to_multiset (getMinTree q) - tree_to_multiset (getMinTree q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
by (simp add: deleteMin_def union_ac Let_def findMin_def)
[PROOF STATE]
proof (state)
this:
queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_ring_1) poly_exp: "poly (p %^ n) x = (poly p x) ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (p %^ n) x = poly p x ^ n
[PROOF STEP]
by (induct n) (auto simp add: poly_cmult poly_mult)


[STATEMENT]
lemma append_eq_Cons_conv: "(ys@zs = x#xs) =
 (ys = [] \<and> zs = x#xs \<or> (\<exists>ys'. ys = x#ys' \<and> ys'@zs = xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ys @ zs = x # xs) = (ys = [] \<and> zs = x # xs \<or> (\<exists>ys'. ys = x # ys' \<and> ys' @ zs = xs))
[PROOF STEP]
by(cases ys) auto


[STATEMENT]
lemma antisymmetric:
  "-x \<le> -y \<Longrightarrow> -y \<le> -x \<Longrightarrow> -x = -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- x \<le> - y; - y \<le> - x\<rbrakk> \<Longrightarrow> - x = - y
[PROOF STEP]
by (simp add: sub_commutative sub_less_eq_def)


[STATEMENT]
lemma map_eq_map_list_take: "\<And>xs.
  \<lbrakk> length fs \<le> length xs; list_all (\<lambda>x. x = f) fs \<rbrakk> \<Longrightarrow>
  map_list fs xs = map f (xs \<down> length fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>length fs \<le> length xs; list_all (\<lambda>x. x = f) fs\<rbrakk> \<Longrightarrow> map_list fs xs = map f (xs \<down> length fs)
[PROOF STEP]
apply (induct fs, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>fs xs. \<lbrakk>\<And>xs. length fs \<le> length xs \<Longrightarrow> map_list fs xs = map f (xs \<down> length fs); Suc (length fs) \<le> length xs; list_all (\<lambda>x. x = f) fs\<rbrakk> \<Longrightarrow> f (hd xs) # map f (tl xs \<down> length fs) = map f (xs \<down> Suc (length fs))
[PROOF STEP]
apply (case_tac xs, simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dm_downset_var: "dm {x} = \<down>(x::'a::preorder)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dm (\<eta> x) = \<down> x
[PROOF STEP]
unfolding lb_set_def ub_set_def downset_def downset_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>X. {y. Ball X ((\<le>) y)}) \<circ> (\<lambda>X. {y. \<forall>x\<in>X. x \<le> y})) (\<eta> x) = ((\<lambda>X. {y. Bex X ((\<le>) y)}) \<circ> \<eta>) x
[PROOF STEP]
by (clarsimp, meson order_refl order_trans)


[STATEMENT]
lemma fst_sym_preproc:
  "fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs (fs::('t \<Rightarrow>\<^sub>0 'b::semiring_1_no_zero_divisors) list)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
let ?a = "fst (sym_preproc gs fs)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
let ?b = "Keys_to_list (snd (sym_preproc gs fs))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
have "antisymp (\<succ>\<^sub>t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. antisymp (\<succ>\<^sub>t)
[PROOF STEP]
unfolding antisymp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<succ>\<^sub>t y \<longrightarrow> y \<succ>\<^sub>t x \<longrightarrow> x = y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
antisymp (\<succ>\<^sub>t)

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
have "irreflp (\<succ>\<^sub>t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreflp (\<succ>\<^sub>t)
[PROOF STEP]
by (simp add: irreflp_def)
[PROOF STATE]
proof (state)
this:
irreflp (\<succ>\<^sub>t)

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
irreflp (\<succ>\<^sub>t)

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
have "transp (\<succ>\<^sub>t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transp (\<succ>\<^sub>t)
[PROOF STEP]
unfolding transp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. x \<succ>\<^sub>t y \<longrightarrow> y \<succ>\<^sub>t z \<longrightarrow> x \<succ>\<^sub>t z
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
transp (\<succ>\<^sub>t)

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
transp (\<succ>\<^sub>t)

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
have s1: "sorted_wrt (\<succ>\<^sub>t) ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (\<succ>\<^sub>t) (fst (sym_preproc gs fs))
[PROOF STEP]
unfolding sym_preproc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (\<succ>\<^sub>t) (fst (sym_preproc_aux gs [] (Keys_to_list fs, fs)))
[PROOF STEP]
by (rule fst_sym_preproc_aux_sorted_wrt, simp_all)
[PROOF STATE]
proof (state)
this:
sorted_wrt (\<succ>\<^sub>t) (fst (sym_preproc gs fs))

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
irreflp (\<succ>\<^sub>t)
transp (\<succ>\<^sub>t)
sorted_wrt (\<succ>\<^sub>t) (fst (sym_preproc gs fs))
[PROOF STEP]
have d1: "distinct ?a"
[PROOF STATE]
proof (prove)
using this:
irreflp (\<succ>\<^sub>t)
transp (\<succ>\<^sub>t)
sorted_wrt (\<succ>\<^sub>t) (fst (sym_preproc gs fs))

goal (1 subgoal):
 1. distinct (fst (sym_preproc gs fs))
[PROOF STEP]
by (rule distinct_sorted_wrt_irrefl)
[PROOF STATE]
proof (state)
this:
distinct (fst (sym_preproc gs fs))

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
have s2: "sorted_wrt (\<succ>\<^sub>t) ?b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (\<succ>\<^sub>t) (Keys_to_list (snd (sym_preproc gs fs)))
[PROOF STEP]
by (fact Keys_to_list_sorted_wrt)
[PROOF STATE]
proof (state)
this:
sorted_wrt (\<succ>\<^sub>t) (Keys_to_list (snd (sym_preproc gs fs)))

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
with \<open>irreflp (\<succ>\<^sub>t)\<close> \<open>transp (\<succ>\<^sub>t)\<close>
[PROOF STATE]
proof (chain)
picking this:
irreflp (\<succ>\<^sub>t)
transp (\<succ>\<^sub>t)
sorted_wrt (\<succ>\<^sub>t) (Keys_to_list (snd (sym_preproc gs fs)))
[PROOF STEP]
have d2: "distinct ?b"
[PROOF STATE]
proof (prove)
using this:
irreflp (\<succ>\<^sub>t)
transp (\<succ>\<^sub>t)
sorted_wrt (\<succ>\<^sub>t) (Keys_to_list (snd (sym_preproc gs fs)))

goal (1 subgoal):
 1. distinct (Keys_to_list (snd (sym_preproc gs fs)))
[PROOF STEP]
by (rule distinct_sorted_wrt_irrefl)
[PROOF STATE]
proof (state)
this:
distinct (Keys_to_list (snd (sym_preproc gs fs)))

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
from \<open>antisymp (\<succ>\<^sub>t)\<close> s1 d1 s2 d2
[PROOF STATE]
proof (chain)
picking this:
antisymp (\<succ>\<^sub>t)
sorted_wrt (\<succ>\<^sub>t) (fst (sym_preproc gs fs))
distinct (fst (sym_preproc gs fs))
sorted_wrt (\<succ>\<^sub>t) (Keys_to_list (snd (sym_preproc gs fs)))
distinct (Keys_to_list (snd (sym_preproc gs fs)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
antisymp (\<succ>\<^sub>t)
sorted_wrt (\<succ>\<^sub>t) (fst (sym_preproc gs fs))
distinct (fst (sym_preproc gs fs))
sorted_wrt (\<succ>\<^sub>t) (Keys_to_list (snd (sym_preproc gs fs)))
distinct (Keys_to_list (snd (sym_preproc gs fs)))

goal (1 subgoal):
 1. fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))
[PROOF STEP]
proof (rule sorted_wrt_distinct_set_unique)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (fst (sym_preproc gs fs)) = set (Keys_to_list (snd (sym_preproc gs fs)))
[PROOF STEP]
show "set ?a = set ?b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fst (sym_preproc gs fs)) = set (Keys_to_list (snd (sym_preproc gs fs)))
[PROOF STEP]
unfolding set_Keys_to_list sym_preproc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fst (sym_preproc_aux gs [] (Keys_to_list fs, fs))) = Keys (set (snd (sym_preproc_aux gs [] (Keys_to_list fs, fs))))
[PROOF STEP]
by (rule fst_sym_preproc_aux_complete, simp add: set_Keys_to_list)
[PROOF STATE]
proof (state)
this:
set (fst (sym_preproc gs fs)) = set (Keys_to_list (snd (sym_preproc gs fs)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fst (sym_preproc gs fs) = Keys_to_list (snd (sym_preproc gs fs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Gcd_eqI:
  assumes "normalize a = a"
  assumes "\<And>b. b \<in> A \<Longrightarrow> a dvd b"
    and "\<And>c. (\<And>b. b \<in> A \<Longrightarrow> c dvd b) \<Longrightarrow> c dvd a"
  shows "Gcd A = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gcd A = a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
normalize a = a
?b1 \<in> A \<Longrightarrow> a dvd ?b1
(\<And>b. b \<in> A \<Longrightarrow> ?c1 dvd b) \<Longrightarrow> ?c1 dvd a

goal (1 subgoal):
 1. Gcd A = a
[PROOF STEP]
by (blast intro: associated_eqI Gcd_greatest Gcd_dvd normalize_Gcd)


[STATEMENT]
theorem \<pi>_induct[rotated -2, consumes 2, case_names 0 Suc]:
  assumes "\<And>T i. i < ar T \<Longrightarrow> P T i 0"
    and "\<And>T i j. i < ar T \<Longrightarrow> j < ar (T !- i) \<Longrightarrow> P (T !- i) j 0 \<Longrightarrow>
       (\<forall>x < ar (T !- i !- j). P (T !- i) j (x + 1)) \<Longrightarrow> P T i (j + 1)"
  shows "i < ar T \<Longrightarrow> j \<le> ar (T !- i) \<Longrightarrow> P T i j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < ar T; j \<le> ar (T !- i)\<rbrakk> \<Longrightarrow> P T i j
[PROOF STEP]
by (induct T i j rule: \<pi>.induct) (auto intro: assms[simplified])


[STATEMENT]
lemma lfp_cadm_induct:
  "\<lbrakk>chain_admissible P; P (Sup {}); mono f; \<And>x. P x \<Longrightarrow> P (f x)\<rbrakk> \<Longrightarrow> P (lfp f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>chain_admissible P; P (Sup {}); mono f; \<And>x. P x \<Longrightarrow> P (f x)\<rbrakk> \<Longrightarrow> P (lfp f)
[PROOF STEP]
by (simp only:  ccpo_lfp_simp[symmetric])
     (rule ccpo.fixp_induct[OF is_ccpo])


[STATEMENT]
lemma functions_of_is_surj_on:
  assumes "finite A" "finite B"
  assumes "number_partition (card A) N" "size N = card B"
  shows "univ (\<lambda>f. f ` A = B) (functions_of A B N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)
[PROOF STEP]
have "functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Twelvefold_Way_Entry10.functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
[PROOF STEP]
using functions_of \<open>finite A\<close> \<open>finite B\<close> \<open>number_partition (card A) N \<close> \<open>size N = card B\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; finite ?B; number_partition (card ?A) ?N; size ?N \<le> card ?B\<rbrakk> \<Longrightarrow> Twelvefold_Way_Entry10.functions_of ?A ?B ?N \<in> (?A \<rightarrow>\<^sub>E ?B) // domain_and_range_permutation ?A ?B
finite A
finite B
number_partition (card A) N
size N = card B

goal (1 subgoal):
 1. Twelvefold_Way_Entry10.functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Twelvefold_Way_Entry10.functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
Twelvefold_Way_Entry10.functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
[PROOF STEP]
obtain f where eq_f: "functions_of A B N = domain_and_range_permutation A B `` {f}" and "f \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
using this:
Twelvefold_Way_Entry10.functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>Twelvefold_Way_Entry10.functions_of A B N = domain_and_range_permutation A B `` {f}; f \<in> A \<rightarrow>\<^sub>E B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using quotientE
[PROOF STATE]
proof (prove)
using this:
Twelvefold_Way_Entry10.functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
\<lbrakk>?X \<in> ?A // ?r; \<And>x. \<lbrakk>?X = ?r `` {x}; x \<in> ?A\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>Twelvefold_Way_Entry10.functions_of A B N = domain_and_range_permutation A B `` {f}; f \<in> A \<rightarrow>\<^sub>E B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Twelvefold_Way_Entry10.functions_of A B N = domain_and_range_permutation A B `` {f}
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)
[PROOF STEP]
from eq_f
[PROOF STATE]
proof (chain)
picking this:
Twelvefold_Way_Entry10.functions_of A B N = domain_and_range_permutation A B `` {f}
[PROOF STEP]
have "f \<in> functions_of A B N"
[PROOF STATE]
proof (prove)
using this:
Twelvefold_Way_Entry10.functions_of A B N = domain_and_range_permutation A B `` {f}

goal (1 subgoal):
 1. f \<in> Twelvefold_Way_Entry10.functions_of A B N
[PROOF STEP]
using \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> equiv_domain_and_range_permutation equiv_class_self
[PROOF STATE]
proof (prove)
using this:
Twelvefold_Way_Entry10.functions_of A B N = domain_and_range_permutation A B `` {f}
f \<in> A \<rightarrow>\<^sub>E B
equiv (?A \<rightarrow>\<^sub>E ?B) (domain_and_range_permutation ?A ?B)
\<lbrakk>equiv ?A ?r; ?a \<in> ?A\<rbrakk> \<Longrightarrow> ?a \<in> ?r `` {?a}

goal (1 subgoal):
 1. f \<in> Twelvefold_Way_Entry10.functions_of A B N
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f \<in> Twelvefold_Way_Entry10.functions_of A B N

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)
[PROOF STEP]
have "f ` A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
using \<open>f \<in> functions_of A B N\<close> assms size_eq_card_implies_surj_on
[PROOF STATE]
proof (prove)
using this:
f \<in> Twelvefold_Way_Entry10.functions_of A B N
finite A
finite B
number_partition (card A) N
size N = card B
\<lbrakk>finite ?A; finite ?B; size ?N = card ?B; ?f \<in> Twelvefold_Way_Entry10.functions_of ?A ?B ?N\<rbrakk> \<Longrightarrow> ?f ` ?A = ?B

goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f ` A = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)
[PROOF STEP]
unfolding eq_f
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (domain_and_range_permutation A B `` {f})
[PROOF STEP]
using equiv_domain_and_range_permutation surjective_respects_domain_and_range_permutation \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (prove)
using this:
f ` A = B
equiv (?A \<rightarrow>\<^sub>E ?B) (domain_and_range_permutation ?A ?B)
(\<lambda>f. f ` ?A = ?B) respects domain_and_range_permutation ?A ?B
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (domain_and_range_permutation A B `` {f})
[PROOF STEP]
by (subst univ_commute') assumption+
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. f ` A = B) (Twelvefold_Way_Entry10.functions_of A B N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma splus_mono_strict:
  assumes "v \<prec>\<^sub>t w"
  shows "t \<oplus> v \<prec>\<^sub>t t \<oplus> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
v \<prec>\<^sub>t w
[PROOF STEP]
have "v \<preceq>\<^sub>t w" and "v \<noteq> w"
[PROOF STATE]
proof (prove)
using this:
v \<prec>\<^sub>t w

goal (1 subgoal):
 1. v \<preceq>\<^sub>t w &&& v \<noteq> w
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
v \<preceq>\<^sub>t w
v \<noteq> w

goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
v \<preceq>\<^sub>t w
[PROOF STEP]
have "t \<oplus> v \<preceq>\<^sub>t t \<oplus> w"
[PROOF STATE]
proof (prove)
using this:
v \<preceq>\<^sub>t w

goal (1 subgoal):
 1. t \<oplus> v \<preceq>\<^sub>t t \<oplus> w
[PROOF STEP]
by (rule splus_mono)
[PROOF STATE]
proof (state)
this:
t \<oplus> v \<preceq>\<^sub>t t \<oplus> w

goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
t \<oplus> v \<preceq>\<^sub>t t \<oplus> w

goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
from \<open>v \<noteq> w\<close>
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> w
[PROOF STEP]
have "t \<oplus> v \<noteq> t \<oplus> w"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> w

goal (1 subgoal):
 1. t \<oplus> v \<noteq> t \<oplus> w
[PROOF STEP]
by (simp add: term_simps)
[PROOF STATE]
proof (state)
this:
t \<oplus> v \<noteq> t \<oplus> w

goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
t \<oplus> v \<preceq>\<^sub>t t \<oplus> w
t \<oplus> v \<noteq> t \<oplus> w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t \<oplus> v \<preceq>\<^sub>t t \<oplus> w
t \<oplus> v \<noteq> t \<oplus> w

goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
using ord_term_lin.antisym_conv1
[PROOF STATE]
proof (prove)
using this:
t \<oplus> v \<preceq>\<^sub>t t \<oplus> w
t \<oplus> v \<noteq> t \<oplus> w
\<not> ?x \<prec>\<^sub>t ?y \<Longrightarrow> (?x \<preceq>\<^sub>t ?y) = (?x = ?y)

goal (1 subgoal):
 1. t \<oplus> v \<prec>\<^sub>t t \<oplus> w
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t \<oplus> v \<prec>\<^sub>t t \<oplus> w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tft_3: assumes dx: "dim_vec x = 3"
  and be: "x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True"
  shows "ceros_of_boolean_input x = {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {1}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True

goal (1 subgoal):
 1. ceros_of_boolean_input x = {1}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {1}
[PROOF STEP]
using less_3_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = True
?n < 3 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {1}
[PROOF STEP]
by auto


[STATEMENT]
lemma id_power:
  "id^m = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id ^ m = id
[PROOF STEP]
apply (induct m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. id ^ 0 = id
 2. \<And>m. id ^ m = id \<Longrightarrow> id ^ Suc m = id
[PROOF STEP]
apply (simp add: one_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. id ^ m = id \<Longrightarrow> id ^ Suc m = id
[PROOF STEP]
by (simp add: times_fun_def)


[STATEMENT]
lemma map_carrier_vec[simp]: "map_vec h v \<in> carrier_vec n = (v \<in> carrier_vec n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_vec h v \<in> carrier_vec n) = (v \<in> carrier_vec n)
[PROOF STEP]
unfolding map_vec_def carrier_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec (dim_vec v) (\<lambda>i. h (v $ i)) \<in> {v. dim_vec v = n}) = (v \<in> {v. dim_vec v = n})
[PROOF STEP]
by auto


[STATEMENT]
lemma count_mset_set_leq:
  assumes "finite A"
  shows "count (mset_set A) x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (mset_set A) x \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. count (mset_set A) x \<le> 1
[PROOF STEP]
by (metis count_mset_set(1,3) eq_iff zero_le_one)


[STATEMENT]
lemma cong_dvd_modulus_nat: "[x = y] (mod m) \<Longrightarrow> n dvd m \<Longrightarrow> [x = y] (mod n)"
  for x y :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[x = y] (mod m); n dvd m\<rbrakk> \<Longrightarrow> [x = y] (mod n)
[PROOF STEP]
by (auto simp add: cong_altdef_nat')


[STATEMENT]
lemma lc_induct[consumes 1, case_names Fvar Call Upd Obj Bnd]:
  fixes P1 :: "sterm \<Rightarrow> bool" and P2 :: "sterm \<Rightarrow> bool"
  assumes
  "lc t" and
  "\<And>x. P1 (Fvar x)" and
  "\<And>t l a. \<lbrakk> lc t; P1 t; lc a; P1 a \<rbrakk> \<Longrightarrow> P1 (Call t l a)" and
  "\<And>t l u. \<lbrakk> lc t; P1 t; P2 u \<rbrakk> \<Longrightarrow> P1 (Upd t l u)" and
  "\<And>f T. \<forall>l\<in>dom f. P2 (the(f l)) \<Longrightarrow> P1 (Obj f T)" and
  "\<And>L t. \<lbrakk> finite L;
            \<forall>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
             \<longrightarrow> lc (t\<^bsup>[Fvar s, Fvar p]\<^esup>) \<and> P1 (t\<^bsup>[Fvar s, Fvar p]\<^esup>) \<rbrakk>
  \<Longrightarrow> P2 t"
  shows "P1 t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P1 t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lc t
P1 (Fvar ?x)
\<lbrakk>lc ?t; P1 ?t; lc ?a; P1 ?a\<rbrakk> \<Longrightarrow> P1 (Call ?t ?l ?a)
\<lbrakk>lc ?t; P1 ?t; P2 ?u\<rbrakk> \<Longrightarrow> P1 (Upd ?t ?l ?u)
\<forall>l\<in>dom ?f. P2 (the (?f l)) \<Longrightarrow> P1 (Obj ?f ?T)
\<lbrakk>finite ?L; \<forall>s p. s \<notin> ?L \<and> p \<notin> ?L \<and> s \<noteq> p \<longrightarrow> lc (?t\<^bsup>[Fvar s,Fvar p]\<^esup>) \<and> P1 (?t\<^bsup>[Fvar s,Fvar p]\<^esup>)\<rbrakk> \<Longrightarrow> P2 ?t

goal (1 subgoal):
 1. P1 t
[PROOF STEP]
by (induct rule: lc.induct, auto)


[STATEMENT]
lemma not_prime: "\<not>prime_elem (of_nat p :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> prime_elem (of_nat p)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
assume prime: "prime_elem (of_nat p :: gauss_int)"
[PROOF STATE]
proof (state)
this:
prime_elem (of_nat p)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
obtain x where x: "x > 0" "x \<le> (p - 1) div 2" "[x ^ 2 + 1 = 0] (mod p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>0 < x; x \<le> (p - 1) div 2; [x\<^sup>2 + 1 = 0] (mod p)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  minimal_QuadRes_neg1
[PROOF STATE]
proof (prove)
using this:
(\<And>x. \<lbrakk>0 < x; x \<le> (p - 1) div 2; [x\<^sup>2 + 1 = 0] (mod p)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>0 < x; x \<le> (p - 1) div 2; [x\<^sup>2 + 1 = 0] (mod p)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < x
x \<le> (p - 1) div 2
[x\<^sup>2 + 1 = 0] (mod p)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
have "of_nat p dvd (of_nat (x ^ 2 + 1) :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat p dvd of_nat (x\<^sup>2 + 1)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
0 < x
x \<le> (p - 1) div 2
[x\<^sup>2 + 1 = 0] (mod p)

goal (1 subgoal):
 1. of_nat p dvd of_nat (x\<^sup>2 + 1)
[PROOF STEP]
by (intro of_nat_dvd_of_nat) (auto simp: cong_0_iff)
[PROOF STATE]
proof (state)
this:
of_nat p dvd of_nat (x\<^sup>2 + 1)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat p dvd of_nat (x\<^sup>2 + 1)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
have eq: "of_nat (x ^ 2 + 1) = ((of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>) :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (x\<^sup>2 + 1) = (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)
[PROOF STEP]
using \<open>x > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. of_nat (x\<^sup>2 + 1) = (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)
[PROOF STEP]
by (simp add: algebra_simps gauss_int_eq_iff power2_eq_square of_nat_diff)
[PROOF STATE]
proof (state)
this:
of_nat (x\<^sup>2 + 1) = (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)
[PROOF STEP]
have "of_nat p dvd ((of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>) :: gauss_int)"
[PROOF STATE]
proof (prove)
using this:
of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)

goal (1 subgoal):
 1. of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
from prime and this
[PROOF STATE]
proof (chain)
picking this:
prime_elem (of_nat p)
of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)
[PROOF STEP]
have "of_nat p dvd (of_nat x + \<i>\<^sub>\<int> :: gauss_int) \<or> of_nat p dvd (of_nat x - \<i>\<^sub>\<int> :: gauss_int)"
[PROOF STATE]
proof (prove)
using this:
prime_elem (of_nat p)
of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)

goal (1 subgoal):
 1. of_nat p dvd of_nat x + \<i>\<^sub>\<int> \<or> of_nat p dvd of_nat x - \<i>\<^sub>\<int>
[PROOF STEP]
by (rule prime_elem_dvd_multD)
[PROOF STATE]
proof (state)
this:
of_nat p dvd of_nat x + \<i>\<^sub>\<int> \<or> of_nat p dvd of_nat x - \<i>\<^sub>\<int>

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
hence dvd: "of_nat p dvd (of_nat x + \<i>\<^sub>\<int> :: gauss_int)" "of_nat p dvd (of_nat x - \<i>\<^sub>\<int> :: gauss_int)"
[PROOF STATE]
proof (prove)
using this:
of_nat p dvd of_nat x + \<i>\<^sub>\<int> \<or> of_nat p dvd of_nat x - \<i>\<^sub>\<int>

goal (1 subgoal):
 1. of_nat p dvd of_nat x + \<i>\<^sub>\<int> &&& of_nat p dvd of_nat x - \<i>\<^sub>\<int>
[PROOF STEP]
by (auto dest: of_nat_dvd_imp_dvd_gauss_cnj)
[PROOF STATE]
proof (state)
this:
of_nat p dvd of_nat x + \<i>\<^sub>\<int>
of_nat p dvd of_nat x - \<i>\<^sub>\<int>

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
have "of_nat (p ^ 2) = (of_nat p * of_nat p :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (p\<^sup>2) = of_nat p * of_nat p
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
of_nat (p\<^sup>2) = of_nat p * of_nat p

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat (p\<^sup>2) = of_nat p * of_nat p

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
from dvd
[PROOF STATE]
proof (chain)
picking this:
of_nat p dvd of_nat x + \<i>\<^sub>\<int>
of_nat p dvd of_nat x - \<i>\<^sub>\<int>
[PROOF STEP]
have "\<dots> dvd ((of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>))"
[PROOF STATE]
proof (prove)
using this:
of_nat p dvd of_nat x + \<i>\<^sub>\<int>
of_nat p dvd of_nat x - \<i>\<^sub>\<int>

goal (1 subgoal):
 1. of_nat p * of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)
[PROOF STEP]
by (intro mult_dvd_mono)
[PROOF STATE]
proof (state)
this:
of_nat p * of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat p * of_nat p dvd (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = of_nat (x ^ 2 + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>) = of_nat (x\<^sup>2 + 1)
[PROOF STEP]
by (rule eq [symmetric])
[PROOF STATE]
proof (state)
this:
(of_nat x + \<i>\<^sub>\<int>) * (of_nat x - \<i>\<^sub>\<int>) = of_nat (x\<^sup>2 + 1)

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_nat (p\<^sup>2) dvd of_nat (x\<^sup>2 + 1)
[PROOF STEP]
have "p ^ 2 dvd (x ^ 2 + 1)"
[PROOF STATE]
proof (prove)
using this:
of_nat (p\<^sup>2) dvd of_nat (x\<^sup>2 + 1)

goal (1 subgoal):
 1. p\<^sup>2 dvd x\<^sup>2 + 1
[PROOF STEP]
by (subst (asm) of_nat_dvd_of_nat_gauss_int_iff)
[PROOF STATE]
proof (state)
this:
p\<^sup>2 dvd x\<^sup>2 + 1

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
hence "p ^ 2 \<le> x ^ 2 + 1"
[PROOF STATE]
proof (prove)
using this:
p\<^sup>2 dvd x\<^sup>2 + 1

goal (1 subgoal):
 1. p\<^sup>2 \<le> x\<^sup>2 + 1
[PROOF STEP]
by (intro dvd_imp_le) auto
[PROOF STATE]
proof (state)
this:
p\<^sup>2 \<le> x\<^sup>2 + 1

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p\<^sup>2 \<le> x\<^sup>2 + 1

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
have "p ^ 2 > x ^ 2 + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
have "x ^ 2 + 1 \<le> ((p - 1) div 2) ^ 2 + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>2 + 1 \<le> ((p - 1) div 2)\<^sup>2 + 1
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
0 < x
x \<le> (p - 1) div 2
[x\<^sup>2 + 1 = 0] (mod p)

goal (1 subgoal):
 1. x\<^sup>2 + 1 \<le> ((p - 1) div 2)\<^sup>2 + 1
[PROOF STEP]
by (intro add_mono power_mono) auto
[PROOF STATE]
proof (state)
this:
x\<^sup>2 + 1 \<le> ((p - 1) div 2)\<^sup>2 + 1

goal (1 subgoal):
 1. x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x\<^sup>2 + 1 \<le> ((p - 1) div 2)\<^sup>2 + 1

goal (1 subgoal):
 1. x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
have "\<dots> \<le> (p - 1) ^ 2 + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((p - 1) div 2)\<^sup>2 + 1 \<le> (p - 1)\<^sup>2 + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((p - 1) div 2)\<^sup>2 + 1 \<le> (p - 1)\<^sup>2 + 1

goal (1 subgoal):
 1. x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((p - 1) div 2)\<^sup>2 + 1 \<le> (p - 1)\<^sup>2 + 1

goal (1 subgoal):
 1. x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
have "(p - 1) * (p - 1) < (p - 1) * (p + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p - 1) * (p - 1) < (p - 1) * (p + 1)
[PROOF STEP]
using p_gt_2
[PROOF STATE]
proof (prove)
using this:
2 < p

goal (1 subgoal):
 1. (p - 1) * (p - 1) < (p - 1) * (p + 1)
[PROOF STEP]
by (intro mult_strict_left_mono) auto
[PROOF STATE]
proof (state)
this:
(p - 1) * (p - 1) < (p - 1) * (p + 1)

goal (1 subgoal):
 1. x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
hence "(p - 1) ^ 2 + 1 < p ^ 2"
[PROOF STATE]
proof (prove)
using this:
(p - 1) * (p - 1) < (p - 1) * (p + 1)

goal (1 subgoal):
 1. (p - 1)\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(p - 1)\<^sup>2 + 1 < p\<^sup>2

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x\<^sup>2 + 1 < p\<^sup>2

goal (1 subgoal):
 1. prime_elem (of_nat p) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p\<^sup>2 \<le> x\<^sup>2 + 1
x\<^sup>2 + 1 < p\<^sup>2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p\<^sup>2 \<le> x\<^sup>2 + 1
x\<^sup>2 + 1 < p\<^sup>2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sublist_append_both_I:
  assumes "subseq a b" "subseq c d"
  shows "subseq (a @ c) (b @ d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subseq (a @ c) (b @ d)
[PROOF STEP]
using assms list_emb_append_mono
[PROOF STATE]
proof (prove)
using this:
subseq a b
subseq c d
\<lbrakk>list_emb ?P ?xs ?xs'; list_emb ?P ?ys ?ys'\<rbrakk> \<Longrightarrow> list_emb ?P (?xs @ ?ys) (?xs' @ ?ys')

goal (1 subgoal):
 1. subseq (a @ c) (b @ d)
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_numeral_fps_const: "numeral k = fps_const (numeral k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral k = fps_const (numeral k)
[PROOF STEP]
by (induct k) (simp_all only: numeral.simps fps_const_1_eq_1 fps_const_add [symmetric])


[STATEMENT]
lemma vimage_func1: "(-`) (f \<circ> g) = (-`) g \<circ> (-`) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (-`) (f \<circ> g) = (-`) g \<circ> (-`) f
[PROOF STEP]
unfolding fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (f \<circ> g) -` x = ((-`) g \<circ> (-`) f) x
[PROOF STEP]
by (simp add: vimage_comp)


[STATEMENT]
lemma frontier_complement [simp]: "frontier (- S) = frontier S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (- S) = frontier S
[PROOF STEP]
by (auto simp: frontier_def closure_complement interior_complement)


[STATEMENT]
lemma (in abelian_subgroup) a_inv_op_closed1:
  shows "\<lbrakk>x \<in> carrier G; h \<in> H\<rbrakk> \<Longrightarrow> (\<ominus> x) \<oplus> h \<oplus> x \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; h \<in> H\<rbrakk> \<Longrightarrow> \<ominus> x \<oplus> h \<oplus> x \<in> H
[PROOF STEP]
by (rule normal.inv_op_closed1 [OF a_normal,
    folded a_inv_def, simplified monoid_record_simps])


[STATEMENT]
lemma proj_psi_minus_1_mult_psi_Suc_l:
  "(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
have id: "(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m N
[PROOF STEP]
using unitary_proj_psi_minus_1
[PROOF STATE]
proof (prove)
using this:
unitary (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N)

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m N
[PROOF STEP]
unfolding unitary_def hermitian_proj_psi_minus_1[simplified hermitian_def]
[PROOF STATE]
proof (prove)
using this:
2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N \<in> carrier_mat (dim_row (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N)) (dim_row (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N)) \<and> inverts_mat (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N)

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m N
[PROOF STEP]
unfolding inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N \<in> carrier_mat (dim_row (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N)) (dim_row (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N)) \<and> (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m (dim_row (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N))

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m N

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
have "(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)
[PROOF STEP]
using proj_psi_minus_1_mult_psi'_l
[PROOF STATE]
proof (prove)
using this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l ?l = psi_l (?l + 1)

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
have "\<dots> = ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l
[PROOF STEP]
apply (subst assoc_mult_mat_vec)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N \<in> carrier_mat ?n\<^sub>1 ?n\<^sub>2
 2. 2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N \<in> carrier_mat ?n\<^sub>2 ?n\<^sub>3
 3. psi'_l l \<in> carrier_vec ?n\<^sub>3
 4. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)
[PROOF STEP]
using proj_psi_dim psi'_l_dim
[PROOF STATE]
proof (prove)
using this:
proj_psi \<in> carrier_mat N N
psi'_l ?l \<in> carrier_vec N

goal (4 subgoals):
 1. 2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N \<in> carrier_mat ?n\<^sub>1 ?n\<^sub>2
 2. 2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N \<in> carrier_mat ?n\<^sub>2 ?n\<^sub>3
 3. psi'_l l \<in> carrier_vec ?n\<^sub>3
 4. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v ((2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l) = (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
have "\<dots> = psi'_l l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi'_l l
[PROOF STEP]
using psi'_l_dim id
[PROOF STATE]
proof (prove)
using this:
psi'_l ?l \<in> carrier_vec N
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) = 1\<^sub>m N

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi'_l l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) * (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi'_l l

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi_l (l + 1) = psi'_l l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multeqp_code_eq_reflclp_multp: "irreflp r \<Longrightarrow> transp r \<Longrightarrow> multeqp_code r = (multp r)\<^sup>=\<^sup>="
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>irreflp r; transp r\<rbrakk> \<Longrightarrow> multeqp_code r = (multp r)\<^sup>=\<^sup>=
[PROOF STEP]
using multeqp_code_iff_reflcl_mult[of "{(x, y). r x y}" r for r,
    folded irreflp_irrefl_eq transp_trans, simplified, folded multp_def]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>irreflp ?ra4; transp ?ra4\<rbrakk> \<Longrightarrow> multeqp_code ?ra4 ?N ?M = (multp ?ra4 ?N ?M \<or> ?N = ?M)

goal (1 subgoal):
 1. \<lbrakk>irreflp r; transp r\<rbrakk> \<Longrightarrow> multeqp_code r = (multp r)\<^sup>=\<^sup>=
[PROOF STEP]
by blast


[STATEMENT]
lemma sum_inverse_squares_expansion_bigo:
  fixes N :: nat
  defines "T \<equiv> \<lambda>n. pi ^ 2 / 6 - 1 / n + 1 / (2*n ^ 2) -
                     (\<Sum>i=1..N. bernoulli (2*i) / (n ^ (2*i+1)))"
  defines "S \<equiv> (\<lambda>n. bernoulli (2*(Suc N)) / (real n ^ (2*N+3)))"
  shows "(\<lambda>n. (\<Sum>i=1..n. 1 / real i ^ 2) - T n) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
have 3: "3 = Suc (Suc (Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 = Suc (Suc (Suc 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 = Suc (Suc (Suc 0))

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
have "(\<lambda>n. (\<Sum>i=1..n. 1 / real i ^ 2) - T n) \<in> \<Theta>(\<lambda>n. -S n - R (Suc N) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> \<Theta>(\<lambda>n. - S n - R (Suc N) n)
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> \<Theta>(\<lambda>n. - S n - EM_remainder (2 * Suc N + 1) (\<lambda>x. - fact (2 * Suc N + 2) / x ^ (2 * Suc N + 3)) (int n))
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_gt_at_top[of "0::nat"]])
       (auto simp: T_def sum_inverse_squares_expansion[of _ "Suc N"] S_def 3
             simp del: One_nat_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> \<Theta>(\<lambda>n. - S n - R (Suc N) n)

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> \<Theta>(\<lambda>n. - S n - R (Suc N) n)

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
have "(\<lambda>n. -S n - R (Suc N) n) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - S n - R (Suc N) n) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
proof (intro sum_in_bigo)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. - S x) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
 2. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
show "(\<lambda>x. - S x) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. - S x) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. - (bernoulli (2 * Suc N) / real x ^ (2 * N + 3))) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
by (rule landau_o.big.compose[OF _ filterlim_real_sequentially]) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. - S x) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))

goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
have "R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * Suc N + 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * Suc N + 2))
[PROOF STEP]
by (rule sum_inverse_squares_remainder_bigo) simp_all
[PROOF STATE]
proof (state)
this:
R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * Suc N + 2))

goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * Suc N + 2))

goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
have "2 * Suc N + 2 = 2 * N + 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Suc N + 2 = 2 * N + 4
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * Suc N + 2 = 2 * N + 4

goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * Suc N + 2 = 2 * N + 4

goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
have "(\<lambda>n. 1 / real n ^ (2 * N + 4)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 / real n ^ (2 * N + 4)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
by (rule landau_o.big.compose[OF _ filterlim_real_sequentially]) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 / real n ^ (2 * N + 4)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))

goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
show "R (Suc N) \<in> \<dots>"
[PROOF STATE]
proof (prove)
using this:
R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))

goal (1 subgoal):
 1. R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
R (Suc N) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - S n - R (Suc N) n) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - T (real n)) \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 3))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indspace_fspanning_set :
  fixes   vs         :: "'v list"
  and     hs         :: "'g list"
  defines hfvss       : "hfvss \<equiv> negHorbit_list hs induced_vector vs"
  assumes base_spset  : "set vs \<subseteq> V" "V = BaseRep.fSpan vs"
  and     rcoset_reps : "Supgroup.is_rcoset_replist G hs"
  shows   "indV = induced_smult.fSpan (concat hfvss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indV = R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
proof (rule VectorSpace.SpanI[OF fVectorSpace_indspace])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (concat hfvss) \<subseteq> indV
 2. indV \<subseteq> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
from base_spset(1) hfvss
[PROOF STATE]
proof (chain)
picking this:
set vs \<subseteq> V
hfvss \<equiv> negHorbit_list hs induced_vector vs
[PROOF STEP]
show "set (concat hfvss) \<subseteq> indV"
[PROOF STATE]
proof (prove)
using this:
set vs \<subseteq> V
hfvss \<equiv> negHorbit_list hs induced_vector vs

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV
[PROOF STEP]
using Supgroup.is_rcoset_replistD_set[OF rcoset_reps]
          induced_vector_indV negHorbit_list_indV
[PROOF STATE]
proof (prove)
using this:
set vs \<subseteq> V
hfvss \<equiv> negHorbit_list hs induced_vector vs
set hs \<subseteq> H
?v \<in> V \<Longrightarrow> induced_vector ?v \<in> indV
\<lbrakk>set ?gs \<subseteq> H; ?T ` set ?as \<subseteq> indV\<rbrakk> \<Longrightarrow> set (concat (negHorbit_list ?gs ?T ?as)) \<subseteq> indV

goal (1 subgoal):
 1. set (concat hfvss) \<subseteq> indV
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
set (concat hfvss) \<subseteq> indV

goal (1 subgoal):
 1. indV \<subseteq> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
show "indV \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (\<currency>))
              (concat hfvss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indV \<subseteq> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
assume f: "f \<in> indV"
[PROOF STATE]
proof (state)
this:
f \<in> indV

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
hence "\<forall>h \<in> set hs. f (1 \<delta>\<delta> h) \<in> V"
[PROOF STATE]
proof (prove)
using this:
f \<in> indV

goal (1 subgoal):
 1. \<forall>h\<in>set hs. f ((1::'f) \<delta>\<delta> h) \<in> V
[PROOF STEP]
using indV BaseRep.indspaceD_range
[PROOF STATE]
proof (prove)
using this:
f \<in> indV
indV \<equiv> BaseRep.indspace G FH V
?f \<in> BaseRep.indspace ?G ?FH ?V \<Longrightarrow> range ?f \<subseteq> ?V

goal (1 subgoal):
 1. \<forall>h\<in>set hs. f ((1::'f) \<delta>\<delta> h) \<in> V
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<forall>h\<in>set hs. f ((1::'f) \<delta>\<delta> h) \<in> V

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
with base_spset(2)
[PROOF STATE]
proof (chain)
picking this:
V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs
\<forall>h\<in>set hs. f ((1::'f) \<delta>\<delta> h) \<in> V
[PROOF STEP]
have  coeffs_exist: "\<forall>h \<in> set hs. \<exists>ahs. length ahs = length vs
                                \<and> f (1 \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs"
[PROOF STATE]
proof (prove)
using this:
V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs
\<forall>h\<in>set hs. f ((1::'f) \<delta>\<delta> h) \<in> V

goal (1 subgoal):
 1. \<forall>h\<in>set hs. \<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
using BaseRep.in_fSpan_obtain_same_length_coeffs
[PROOF STATE]
proof (prove)
using this:
V = R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) vs
\<forall>h\<in>set hs. f ((1::'f) \<delta>\<delta> h) \<in> V
?n \<in> R_scalar_mult.RSpan UNIV (\<sharp>\<cdot>) ?ms \<Longrightarrow> \<exists>rs. set rs \<subseteq> UNIV \<and> length rs = length ?ms \<and> ?n = rs \<bullet>\<sharp>\<cdot> ?ms

goal (1 subgoal):
 1. \<forall>h\<in>set hs. \<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
\<forall>h\<in>set hs. \<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
define f_coeffs
      where "f_coeffs h = (SOME ahs. length ahs = length vs \<and> f (1 \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs)" for h
[PROOF STATE]
proof (state)
this:
f_coeffs ?h = (SOME ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> ?h) = ahs \<bullet>\<sharp>\<cdot> vs)

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
define ahss where "ahss = map f_coeffs hs"
[PROOF STATE]
proof (state)
this:
ahss = map f_coeffs hs

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
hence len_ahss: "length ahss = length hs"
[PROOF STATE]
proof (prove)
using this:
ahss = map f_coeffs hs

goal (1 subgoal):
 1. length ahss = length hs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length ahss = length hs

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
with hfvss
[PROOF STATE]
proof (chain)
picking this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
length ahss = length hs
[PROOF STEP]
have len_zip_ahss_hfvss: "length (zip ahss hfvss) = length hs"
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
length ahss = length hs

goal (1 subgoal):
 1. length (zip ahss hfvss) = length hs
[PROOF STEP]
using length_negHorbit_list[of hs induced_vector vs]
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
length ahss = length hs
length (negHorbit_list hs induced_vector vs) = length hs

goal (1 subgoal):
 1. length (zip ahss hfvss) = length hs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (zip ahss hfvss) = length hs

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
have len_ahss_el: "\<forall>ahs\<in>set ahss. length ahs = length vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ahs\<in>set ahss. length ahs = length vs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ahs. ahs \<in> set ahss \<Longrightarrow> length ahs = length vs
[PROOF STEP]
fix ahs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ahs. ahs \<in> set ahss \<Longrightarrow> length ahs = length vs
[PROOF STEP]
assume "ahs \<in> set ahss"
[PROOF STATE]
proof (state)
this:
ahs \<in> set ahss

goal (1 subgoal):
 1. \<And>ahs. ahs \<in> set ahss \<Longrightarrow> length ahs = length vs
[PROOF STEP]
from this ahss_def
[PROOF STATE]
proof (chain)
picking this:
ahs \<in> set ahss
ahss = map f_coeffs hs
[PROOF STEP]
obtain h where h: "h \<in> set hs" "ahs = f_coeffs h"
[PROOF STATE]
proof (prove)
using this:
ahs \<in> set ahss
ahss = map f_coeffs hs

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> set hs; ahs = f_coeffs h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using set_map
[PROOF STATE]
proof (prove)
using this:
ahs \<in> set ahss
ahss = map f_coeffs hs
set (map ?f ?xs) = ?f ` set ?xs

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> set hs; ahs = f_coeffs h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> set hs
ahs = f_coeffs h

goal (1 subgoal):
 1. \<And>ahs. ahs \<in> set ahss \<Longrightarrow> length ahs = length vs
[PROOF STEP]
from h(1)
[PROOF STATE]
proof (chain)
picking this:
h \<in> set hs
[PROOF STEP]
have "\<exists>ahs. length ahs = length vs \<and> f (1 \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs"
[PROOF STATE]
proof (prove)
using this:
h \<in> set hs

goal (1 subgoal):
 1. \<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
using coeffs_exist
[PROOF STATE]
proof (prove)
using this:
h \<in> set hs
\<forall>h\<in>set hs. \<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. \<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. \<And>ahs. ahs \<in> set ahss \<Longrightarrow> length ahs = length vs
[PROOF STEP]
with h(2)
[PROOF STATE]
proof (chain)
picking this:
ahs = f_coeffs h
\<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
show "length ahs = length vs"
[PROOF STATE]
proof (prove)
using this:
ahs = f_coeffs h
\<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. length ahs = length vs
[PROOF STEP]
unfolding f_coeffs_def
[PROOF STATE]
proof (prove)
using this:
ahs = (SOME ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs)
\<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. length ahs = length vs
[PROOF STEP]
using someI_ex[of "\<lambda>ahs. length ahs = length vs \<and> f (1 \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs"]
[PROOF STATE]
proof (prove)
using this:
ahs = (SOME ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs)
\<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs
\<exists>x. length x = length vs \<and> f ((1::'f) \<delta>\<delta> h) = x \<bullet>\<sharp>\<cdot> vs \<Longrightarrow> length (SOME x. length x = length vs \<and> f ((1::'f) \<delta>\<delta> h) = x \<bullet>\<sharp>\<cdot> vs) = length vs \<and> f ((1::'f) \<delta>\<delta> h) = (SOME x. length x = length vs \<and> f ((1::'f) \<delta>\<delta> h) = x \<bullet>\<sharp>\<cdot> vs) \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. length ahs = length vs
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
length ahs = length vs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>ahs\<in>set ahss. length ahs = length vs

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
have "\<forall>(ahs,hfvs)\<in>set (zip ahss hfvss). length ahs = length hfvs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>(ahs, hfvs)\<in>set (zip ahss hfvss). length ahs = length hfvs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (zip ahss hfvss) \<Longrightarrow> case x of (ahs, hfvs) \<Rightarrow> length ahs = length hfvs
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (zip ahss hfvss) \<Longrightarrow> case x of (ahs, hfvs) \<Rightarrow> length ahs = length hfvs
[PROOF STEP]
assume x: "x \<in> set (zip ahss hfvss)"
[PROOF STATE]
proof (state)
this:
x \<in> set (zip ahss hfvss)

goal (1 subgoal):
 1. \<And>x. x \<in> set (zip ahss hfvss) \<Longrightarrow> case x of (ahs, hfvs) \<Rightarrow> length ahs = length hfvs
[PROOF STEP]
show "case x of (ahs, hfvs) \<Rightarrow> length ahs = length hfvs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. case x of (ahs, hfvs) \<Rightarrow> length ahs = length hfvs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ahs hfvs. x = (ahs, hfvs) \<Longrightarrow> length ahs = length hfvs
[PROOF STEP]
fix ahs hfvs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ahs hfvs. x = (ahs, hfvs) \<Longrightarrow> length ahs = length hfvs
[PROOF STEP]
assume "x = (ahs,hfvs)"
[PROOF STATE]
proof (state)
this:
x = (ahs, hfvs)

goal (1 subgoal):
 1. \<And>ahs hfvs. x = (ahs, hfvs) \<Longrightarrow> length ahs = length hfvs
[PROOF STEP]
with x hfvss
[PROOF STATE]
proof (chain)
picking this:
x \<in> set (zip ahss hfvss)
hfvss \<equiv> negHorbit_list hs induced_vector vs
x = (ahs, hfvs)
[PROOF STEP]
have "length ahs = length vs" "length hfvs = length vs"
[PROOF STATE]
proof (prove)
using this:
x \<in> set (zip ahss hfvss)
hfvss \<equiv> negHorbit_list hs induced_vector vs
x = (ahs, hfvs)

goal (1 subgoal):
 1. length ahs = length vs &&& length hfvs = length vs
[PROOF STEP]
using set_zip_leftD[of ahs hfvs] len_ahss_el set_zip_rightD[of ahs hfvs]
                length_negHorbit_list_sublist[of _ hs induced_vector]
[PROOF STATE]
proof (prove)
using this:
x \<in> set (zip ahss hfvss)
hfvss \<equiv> negHorbit_list hs induced_vector vs
x = (ahs, hfvs)
(ahs, hfvs) \<in> set (zip ?xs ?ys) \<Longrightarrow> ahs \<in> set ?xs
\<forall>ahs\<in>set ahss. length ahs = length vs
(ahs, hfvs) \<in> set (zip ?xs ?ys) \<Longrightarrow> hfvs \<in> set ?ys
?fs \<in> set (negHorbit_list hs induced_vector ?as) \<Longrightarrow> length ?fs = length ?as

goal (1 subgoal):
 1. length ahs = length vs &&& length hfvs = length vs
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
length ahs = length vs
length hfvs = length vs

goal (1 subgoal):
 1. \<And>ahs hfvs. x = (ahs, hfvs) \<Longrightarrow> length ahs = length hfvs
[PROOF STEP]
thus "length ahs = length hfvs"
[PROOF STATE]
proof (prove)
using this:
length ahs = length vs
length hfvs = length vs

goal (1 subgoal):
 1. length ahs = length hfvs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length ahs = length hfvs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
case x of (ahs, hfvs) \<Rightarrow> length ahs = length hfvs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>(ahs, hfvs)\<in>set (zip ahss hfvss). length ahs = length hfvs

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
with hfvss
[PROOF STATE]
proof (chain)
picking this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
\<forall>(ahs, hfvs)\<in>set (zip ahss hfvss). length ahs = length hfvs
[PROOF STEP]
have list_all2_len_ahss_hfvss:
      "list_all2 (\<lambda>rs ms. length rs = length ms) ahss hfvss"
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
\<forall>(ahs, hfvs)\<in>set (zip ahss hfvss). length ahs = length hfvs

goal (1 subgoal):
 1. list_all2 (\<lambda>rs ms. length rs = length ms) ahss hfvss
[PROOF STEP]
using len_ahss length_negHorbit_list[of hs induced_vector vs]
            list_all2I[of ahss hfvss]
[PROOF STATE]
proof (prove)
using this:
hfvss \<equiv> negHorbit_list hs induced_vector vs
\<forall>(ahs, hfvs)\<in>set (zip ahss hfvss). length ahs = length hfvs
length ahss = length hs
length (negHorbit_list hs induced_vector vs) = length hs
\<lbrakk>\<forall>x\<in>set (zip ahss hfvss). case x of (x, xa) \<Rightarrow> ?P x xa; length ahss = length hfvss\<rbrakk> \<Longrightarrow> list_all2 ?P ahss hfvss

goal (1 subgoal):
 1. list_all2 (\<lambda>rs ms. length rs = length ms) ahss hfvss
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>rs ms. length rs = length ms) ahss hfvss

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
define f' where "f' = (concat ahss) \<bullet>\<currency>\<currency> (concat hfvss)"
[PROOF STATE]
proof (state)
this:
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
have "f = f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = f'
[PROOF STEP]
using Supgroup.is_rcoset_replistD_set[OF rcoset_reps]
            Supgroup.group_eq_subgrp_rcoset_un[OF Subgroup rcoset_reps]
            f
[PROOF STATE]
proof (prove)
using this:
set hs \<subseteq> H
H = (\<Union>g\<in>set hs. G + {g})
f \<in> indV

goal (1 subgoal):
 1. f = f'
[PROOF STEP]
proof (rule indspace_el_eq'[of hs])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f' \<in> indV
 2. \<forall>i<length hs. f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
from f'_def hfvss base_spset(1)
[PROOF STATE]
proof (chain)
picking this:
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V
[PROOF STEP]
show "f' \<in> indV"
[PROOF STATE]
proof (prove)
using this:
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V

goal (1 subgoal):
 1. f' \<in> indV
[PROOF STEP]
using Supgroup.is_rcoset_replistD_set[OF rcoset_reps]
              induced_vector_indV negHorbit_list_indV[of hs induced_vector vs]
              FGModule.flincomb_closed[OF FHModule_indspace]
[PROOF STATE]
proof (prove)
using this:
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V
set hs \<subseteq> H
?v \<in> V \<Longrightarrow> induced_vector ?v \<in> indV
\<lbrakk>set hs \<subseteq> H; induced_vector ` set vs \<subseteq> indV\<rbrakk> \<Longrightarrow> set (concat (negHorbit_list hs induced_vector vs)) \<subseteq> indV
\<lbrakk>set ?rs \<subseteq> UNIV; set ?ms \<subseteq> indV\<rbrakk> \<Longrightarrow> ?rs \<bullet>\<currency>\<currency> ?ms \<in> indV

goal (1 subgoal):
 1. f' \<in> indV
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
f' \<in> indV

goal (1 subgoal):
 1. \<forall>i<length hs. f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
have "\<And>i. i<length hs \<Longrightarrow> f (1 \<delta>\<delta> (hs!i)) = f' (1 \<delta>\<delta> (hs!i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
assume i: "i < length hs"
[PROOF STATE]
proof (state)
this:
i < length hs

goal (1 subgoal):
 1. \<And>i. i < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
with f_coeffs_def
[PROOF STATE]
proof (chain)
picking this:
f_coeffs ?h = (SOME ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> ?h) = ahs \<bullet>\<sharp>\<cdot> vs)
i < length hs
[PROOF STEP]
have "f (1 \<delta>\<delta> (hs!i)) = (f_coeffs (hs!i)) \<bullet>\<sharp>\<cdot> vs"
[PROOF STATE]
proof (prove)
using this:
f_coeffs ?h = (SOME ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> ?h) = ahs \<bullet>\<sharp>\<cdot> vs)
i < length hs

goal (1 subgoal):
 1. f ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
using coeffs_exist
                someI_ex[of "\<lambda>ahs. length ahs = length vs \<and> f (1 \<delta>\<delta> hs!i) = ahs \<bullet>\<sharp>\<cdot> vs"]
[PROOF STATE]
proof (prove)
using this:
f_coeffs ?h = (SOME ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> ?h) = ahs \<bullet>\<sharp>\<cdot> vs)
i < length hs
\<forall>h\<in>set hs. \<exists>ahs. length ahs = length vs \<and> f ((1::'f) \<delta>\<delta> h) = ahs \<bullet>\<sharp>\<cdot> vs
\<exists>x. length x = length vs \<and> f ((1::'f) \<delta>\<delta> hs ! i) = x \<bullet>\<sharp>\<cdot> vs \<Longrightarrow> length (SOME x. length x = length vs \<and> f ((1::'f) \<delta>\<delta> hs ! i) = x \<bullet>\<sharp>\<cdot> vs) = length vs \<and> f ((1::'f) \<delta>\<delta> hs ! i) = (SOME x. length x = length vs \<and> f ((1::'f) \<delta>\<delta> hs ! i) = x \<bullet>\<sharp>\<cdot> vs) \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. f ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
f ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. \<And>i. i < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. \<And>i. i < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
from i hfvss f'_def base_spset(1) rcoset_reps ahss_def
[PROOF STATE]
proof (chain)
picking this:
i < length hs
hfvss \<equiv> negHorbit_list hs induced_vector vs
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
set vs \<subseteq> V
Supgroup.is_rcoset_replist G hs
ahss = map f_coeffs hs
[PROOF STEP]
have  "f' (1 \<delta>\<delta> (hs!i)) = (f_coeffs (hs!i)) \<bullet>\<sharp>\<cdot> vs"
[PROOF STATE]
proof (prove)
using this:
i < length hs
hfvss \<equiv> negHorbit_list hs induced_vector vs
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
set vs \<subseteq> V
Supgroup.is_rcoset_replist G hs
ahss = map f_coeffs hs

goal (1 subgoal):
 1. f' ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
using list_all2_len_ahss_hfvss flincomb_Horbit_induced_veclist_reduce
[PROOF STATE]
proof (prove)
using this:
i < length hs
hfvss \<equiv> negHorbit_list hs induced_vector vs
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
set vs \<subseteq> V
Supgroup.is_rcoset_replist G hs
ahss = map f_coeffs hs
list_all2 (\<lambda>rs ms. length rs = length ms) ahss hfvss
\<lbrakk>set ?vs \<subseteq> V; ?i < length ?hs; list_all2 (\<lambda>rs ms. length rs = length ms) ?css (negHorbit_list ?hs induced_vector ?vs); Supgroup.is_rcoset_replist G ?hs\<rbrakk> \<Longrightarrow> (concat ?css \<bullet>\<currency>\<currency> concat (negHorbit_list ?hs induced_vector ?vs)) ((1::'f) \<delta>\<delta> ?hs ! ?i) = ?css ! ?i \<bullet>\<sharp>\<cdot> ?vs

goal (1 subgoal):
 1. f' ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
f' ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. \<And>i. i < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs
f' ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs
[PROOF STEP]
show "f (1 \<delta>\<delta> (hs!i)) = f' (1 \<delta>\<delta> (hs!i))"
[PROOF STATE]
proof (prove)
using this:
f ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs
f' ((1::'f) \<delta>\<delta> hs ! i) = f_coeffs (hs ! i) \<bullet>\<sharp>\<cdot> vs

goal (1 subgoal):
 1. f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i10 < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! ?i10) = f' ((1::'f) \<delta>\<delta> hs ! ?i10)

goal (1 subgoal):
 1. \<forall>i<length hs. f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
thus "\<forall>i<length hs. f (1 \<delta>\<delta> (hs!i)) = f' (1 \<delta>\<delta> (hs!i))"
[PROOF STATE]
proof (prove)
using this:
?i10 < length hs \<Longrightarrow> f ((1::'f) \<delta>\<delta> hs ! ?i10) = f' ((1::'f) \<delta>\<delta> hs ! ?i10)

goal (1 subgoal):
 1. \<forall>i<length hs. f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<forall>i<length hs. f ((1::'f) \<delta>\<delta> hs ! i) = f' ((1::'f) \<delta>\<delta> hs ! i)

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

goal (1 subgoal):
 1. \<And>x. x \<in> indV \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
with f'_def hfvss base_spset(1)
[PROOF STATE]
proof (chain)
picking this:
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V
f = f'
[PROOF STEP]
show "f \<in> induced_smult.fSpan (concat hfvss)"
[PROOF STATE]
proof (prove)
using this:
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V
f = f'

goal (1 subgoal):
 1. f \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
using Supgroup.is_rcoset_replistD_set[OF rcoset_reps]
            induced_vector_indV negHorbit_list_indV[of hs induced_vector vs]
            VectorSpace.SpanI_lincomb_arb_len_coeffs[OF fVectorSpace_indspace]
[PROOF STATE]
proof (prove)
using this:
f' = concat ahss \<bullet>\<currency>\<currency> concat hfvss
hfvss \<equiv> negHorbit_list hs induced_vector vs
set vs \<subseteq> V
f = f'
set hs \<subseteq> H
?v \<in> V \<Longrightarrow> induced_vector ?v \<in> indV
\<lbrakk>set hs \<subseteq> H; induced_vector ` set vs \<subseteq> indV\<rbrakk> \<Longrightarrow> set (concat (negHorbit_list hs induced_vector vs)) \<subseteq> indV
\<lbrakk>set ?rs \<subseteq> UNIV; set ?ms \<subseteq> indV\<rbrakk> \<Longrightarrow> ?rs \<bullet>\<currency>\<currency> ?ms \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) ?ms

goal (1 subgoal):
 1. f \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
f \<in> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
indV \<subseteq> R_scalar_mult.RSpan UNIV (\<currency>\<currency>) (concat hfvss)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hrcis_zero_mod [simp]: "\<And>a. hrcis 0 a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. hrcis 0 a = 0
[PROOF STEP]
by transfer (rule rcis_zero_mod)


[STATEMENT]
lemma Sup_less_least:
  "(!! v . v < w \<Longrightarrow> P v \<le> Q) \<Longrightarrow> Sup_less P w \<le> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. v < w \<Longrightarrow> P v \<le> Q) \<Longrightarrow> Sup_less P w \<le> Q
[PROOF STEP]
by (simp add: Sup_less_def, rule Sup_least, blast)


[STATEMENT]
lemma at_within_ball_bot_iff:
  fixes x y :: "'a::{real_normed_vector,perfect_space}"
  shows "at x within ball y r = bot \<longleftrightarrow> (r=0 \<or> x \<notin> cball y r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (at x within ball y r = bot) = (r = 0 \<or> x \<notin> cball y r)
[PROOF STEP]
unfolding trivial_limit_within
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> x islimpt ball y r) = (r = 0 \<or> x \<notin> cball y r)
[PROOF STEP]
by (metis (no_types) cball_empty equals0D islimpt_ball less_linear)


[STATEMENT]
lemma zcount_image_zmset_zero: "(\<And>m. m \<in>#\<^sub>z M \<Longrightarrow> f m \<noteq> x) \<Longrightarrow> x \<notin>#\<^sub>z image_zmset f M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. m \<in>#\<^sub>z M \<Longrightarrow> f m \<noteq> x) \<Longrightarrow> x \<notin>#\<^sub>z Auxiliary.image_zmset f M
[PROOF STEP]
unfolding set_zmset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. m \<in> {x. zcount M x \<noteq> 0} \<Longrightarrow> f m \<noteq> x) \<Longrightarrow> x \<notin> {x. zcount (Auxiliary.image_zmset f M) x \<noteq> 0}
[PROOF STEP]
by (simp add: zcount_image_zmset) (metis Int_emptyI sum.empty vimage_singleton_eq)


[STATEMENT]
lemma lsorted_lmap':
  assumes "ord.lsorted orda xs" "monotone orda ordb f"
  shows "ord.lsorted ordb (lmap f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord.lsorted ordb (lmap f xs)
[PROOF STEP]
using \<open>ord.lsorted orda xs\<close>
[PROOF STATE]
proof (prove)
using this:
ord.lsorted orda xs

goal (1 subgoal):
 1. ord.lsorted ordb (lmap f xs)
[PROOF STEP]
by(coinduction arbitrary: xs rule: ord.lsorted_coinduct')(auto intro: monotoneD[OF \<open>monotone orda ordb f\<close>] ord.lsorted_lhdD ord.lsorted_ltlI)


[STATEMENT]
lemma map_suf_conv [reversal_rule]: assumes "inj f" shows "map f u \<le>s map f v \<longleftrightarrow> u \<le>s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f u \<le>s map f v) = (u \<le>s v)
[PROOF STEP]
using map_mono_suffix[of "map f u" "map f v" "inv f"] map_mono_suffix
[PROOF STATE]
proof (prove)
using this:
map f u \<le>s map f v \<Longrightarrow> map (inv f) (map f u) \<le>s map (inv f) (map f v)
?xs \<le>s ?ys \<Longrightarrow> map ?f ?xs \<le>s map ?f ?ys

goal (1 subgoal):
 1. (map f u \<le>s map f v) = (u \<le>s v)
[PROOF STEP]
unfolding map_map inv_o_cancel[OF \<open>inj f\<close>] list.map_id
[PROOF STATE]
proof (prove)
using this:
map f u \<le>s map f v \<Longrightarrow> u \<le>s v
?xs \<le>s ?ys \<Longrightarrow> map ?f ?xs \<le>s map ?f ?ys

goal (1 subgoal):
 1. (map f u \<le>s map f v) = (u \<le>s v)
[PROOF STEP]
..


[STATEMENT]
lemma n_star_induct_sup:
  "n(z \<squnion> x * y) \<le> n(y) \<Longrightarrow> n(x\<^sup>\<star> * z) \<le> n(y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n (z \<squnion> x * y) \<le> n y \<Longrightarrow> n (x\<^sup>\<star> * z) \<le> n y
[PROOF STEP]
by (metis an_dist_sup an_mult_least_upper_bound an_n_order n_mult_right_upper_bound n_star_induct star_L_split)


[STATEMENT]
lemma pathin_compose:
     "\<lbrakk>pathin X g; continuous_map X Y f\<rbrakk> \<Longrightarrow> pathin Y (f \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pathin X g; continuous_map X Y f\<rbrakk> \<Longrightarrow> pathin Y (f \<circ> g)
[PROOF STEP]
by (simp add: continuous_map_compose pathin_def)