[STATEMENT]
lemma awalk_verts_app_iso_eq:
  assumes "digraph_isomorphism hom" and "awalk u p v"
  shows "pre_digraph.awalk_verts (app_iso hom G) (iso_verts hom u) (map (iso_arcs hom) p)
    = map (iso_verts hom) (awalk_verts u p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_digraph.awalk_verts (app_iso hom G) (iso_verts hom u) (map (iso_arcs hom) p) = map (iso_verts hom) (awalk_verts u p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
awalk u p v

goal (1 subgoal):
 1. pre_digraph.awalk_verts (app_iso hom G) (iso_verts hom u) (map (iso_arcs hom) p) = map (iso_verts hom) (awalk_verts u p)
[PROOF STEP]
by (induct p arbitrary: u)
     (auto simp: pre_digraph.awalk_verts.simps iso_verts_head iso_verts_tail awalk_Cons_iff)


[STATEMENT]
lemma GreenThm_typeI_typeII_divisible_region:
  assumes only_vertical_division:
    "only_vertical_division one_chain_typeI two_chain_typeI"
    "boundary_chain one_chain_typeI" and
    only_horizontal_division:
    "only_horizontal_division one_chain_typeII two_chain_typeII"
    "boundary_chain one_chain_typeII" and
    typeI_and_typII_one_chains_have_common_subdiv:
    "common_boundary_sudivision_exists one_chain_typeI one_chain_typeII"
  shows "integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. (F x) \<bullet> j) i x - partial_vector_derivative (\<lambda>x. (F x) \<bullet> i) j x) = one_chain_line_integral F {i, j} one_chain_typeI"
    "integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. (F x) \<bullet> j) i x - partial_vector_derivative (\<lambda>x. (F x) \<bullet> i) j x) = one_chain_line_integral F {i, j} one_chain_typeII"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} one_chain_typeI &&& integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} one_chain_typeII
[PROOF STEP]
using GreenThm_typeI_typeII_divisible_region' only_vertical_division only_horizontal_division common_subdiv_imp_gen_common_subdiv[OF typeI_and_typII_one_chains_have_common_subdiv]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>only_vertical_division ?one_chain_typeI two_chain_typeI; boundary_chain ?one_chain_typeI; only_horizontal_division ?one_chain_typeII two_chain_typeII; boundary_chain ?one_chain_typeII; common_sudiv_exists ?one_chain_typeI ?one_chain_typeII\<rbrakk> \<Longrightarrow> integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} ?one_chain_typeI
\<lbrakk>only_vertical_division ?one_chain_typeI two_chain_typeI; boundary_chain ?one_chain_typeI; only_horizontal_division ?one_chain_typeII two_chain_typeII; boundary_chain ?one_chain_typeII; common_sudiv_exists ?one_chain_typeI ?one_chain_typeII\<rbrakk> \<Longrightarrow> integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} ?one_chain_typeII
only_vertical_division one_chain_typeI two_chain_typeI
boundary_chain one_chain_typeI
only_horizontal_division one_chain_typeII two_chain_typeII
boundary_chain one_chain_typeII
common_sudiv_exists one_chain_typeI one_chain_typeII

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} one_chain_typeI &&& integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} one_chain_typeII
[PROOF STEP]
by auto


[STATEMENT]
lemma "!!a::int. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |]
      ==> a+a+a+a+a+a <= l+l+l+l+i+l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a + b + c + d \<le> i + j + k + l; a \<le> b; b \<le> c; c \<le> d; i \<le> j; j \<le> k; k \<le> l\<rbrakk> \<Longrightarrow> a + a + a + a + a + a \<le> l + l + l + l + i + l
[PROOF STEP]
by arith


[STATEMENT]
lemma rref_condition3_explicit:
assumes rref_A: "reduced_row_echelon_form A"
and i_le: "i < i + 1"
and "\<not> is_zero_row i A" and "\<not> is_zero_row (i + 1) A"
shows "(LEAST n. A $ i $ n \<noteq> 0) < (LEAST n. A $ (i + 1) $ n \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))
[PROOF STEP]
using rref_condition3 assms
[PROOF STATE]
proof (prove)
using this:
reduced_row_echelon_form ?A \<Longrightarrow> \<forall>i. i < i + (1::?'c) \<and> \<not> is_zero_row i ?A \<and> \<not> is_zero_row (i + (1::?'c)) ?A \<longrightarrow> (LEAST n. ?A $ i $ n \<noteq> (0::?'a)) < (LEAST n. ?A $ (i + (1::?'c)) $ n \<noteq> (0::?'a))
reduced_row_echelon_form A
i < i + (1::'c)
\<not> is_zero_row i A
\<not> is_zero_row (i + (1::'c)) A

goal (1 subgoal):
 1. (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))
[PROOF STEP]
by blast


[STATEMENT]
lemma bit_rec:
  \<open>bit a n \<longleftrightarrow> (if n = 0 then odd a else bit (a div 2) (n - 1))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit a n = (if n = 0 then odd a else bit (a div (2::'a)) (n - 1))
[PROOF STEP]
by (cases n) (simp_all add: bit_Suc bit_0)


[STATEMENT]
lemma strict_mono_imp_inj: "strict_mono (f::('a::linorder \<Rightarrow> 'b::order)) \<Longrightarrow> inj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono f \<Longrightarrow> inj f
[PROOF STEP]
by (rule strict_mono_imp_inj_on)


[STATEMENT]
lemma prv_imp_neg_fls:
  assumes "\<phi> \<in> fmla"
  shows "prv (imp \<phi> (imp (neg \<phi>) fls))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp \<phi> (imp (neg \<phi>) fls))
[PROOF STEP]
using assms prv_imp_com prv_imp_refl neg_def
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> fmla
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; ?\<psi> \<in> fmla; prv (imp ?\<phi> (imp ?\<chi> ?\<psi>))\<rbrakk> \<Longrightarrow> prv (imp ?\<chi> (imp ?\<phi> ?\<psi>))
?\<phi> \<in> fmla \<Longrightarrow> prv (imp ?\<phi> ?\<phi>)
neg ?\<phi> = imp ?\<phi> fls

goal (1 subgoal):
 1. prv (imp \<phi> (imp (neg \<phi>) fls))
[PROOF STEP]
by auto


[STATEMENT]
theorem Clique_with_n_nodes_not_solvable_by_small_monotone_circuit:
  fixes \<phi> :: "'a mformula"
  assumes large: "n \<ge> large_number"
  and kn: "\<exists> k. n = k^8"
  and \<pi>: "bij_betw \<pi> V [n]^\<two>"
  and s: "s = root 4 n"
  and solution: "\<forall>G\<in>Graphs [n]. (G \<in> Clique [n] s) = eval (\<lambda> x. \<pi> x \<in> G) \<phi>"
  and vars: "vars \<phi> \<subseteq> V"
shows "cs \<phi> > (root 7 n) powr (root 8 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
from kn
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. n = k ^ 8
[PROOF STEP]
obtain k where nk: "n = k^8"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. n = k ^ 8

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

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have kn: "k = root 8 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real k = root 8 (real n)
[PROOF STEP]
unfolding nk of_nat_power
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real k = root 8 (real k ^ 8)
[PROOF STEP]
by (subst real_root_pos2, auto)
[PROOF STATE]
proof (state)
this:
real k = root 8 (real n)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have "root 4 n = root 4 ((real (k^2))^4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 4 (real n) = root 4 (real (k\<^sup>2) ^ 4)
[PROOF STEP]
unfolding nk
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 4 (real (k ^ 8)) = root 4 (real (k\<^sup>2) ^ 4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
root 4 (real n) = root 4 (real (k\<^sup>2) ^ 4)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root 4 (real n) = root 4 (real (k\<^sup>2) ^ 4)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have "\<dots> = k^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 4 (real (k\<^sup>2) ^ 4) = real (k\<^sup>2)
[PROOF STEP]
by (simp add: real_root_pos_unique)
[PROOF STATE]
proof (state)
this:
root 4 (real (k\<^sup>2) ^ 4) = real (k\<^sup>2)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
root 4 (real n) = real (k\<^sup>2)
[PROOF STEP]
have r4: "root 4 n = k^2"
[PROOF STATE]
proof (prove)
using this:
root 4 (real n) = real (k\<^sup>2)

goal (1 subgoal):
 1. root 4 (real n) = real (k\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
root 4 (real n) = real (k\<^sup>2)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have s: "s = k^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = k\<^sup>2
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
real s = root 4 (real n)

goal (1 subgoal):
 1. s = k\<^sup>2
[PROOF STEP]
unfolding r4
[PROOF STATE]
proof (prove)
using this:
real s = real (k\<^sup>2)

goal (1 subgoal):
 1. s = k\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
s = k\<^sup>2

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
from large[unfolded nk large_number_def]
[PROOF STATE]
proof (chain)
picking this:
Large_Number ^ 8 \<le> k ^ 8
[PROOF STEP]
have Large: "k \<ge> Large_Number"
[PROOF STATE]
proof (prove)
using this:
Large_Number ^ 8 \<le> k ^ 8

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

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have "0 < Large_Number"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Large_Number
[PROOF STEP]
unfolding Large_Number_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Max {64, L0''\<^sup>2, L0\<^sup>2, L0'\<^sup>2, M0, M0'}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < Large_Number

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
with Large
[PROOF STATE]
proof (chain)
picking this:
Large_Number \<le> k
0 < Large_Number
[PROOF STEP]
have k0: "k > 0"
[PROOF STATE]
proof (prove)
using this:
Large_Number \<le> k
0 < Large_Number

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

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
hence n0: "n > 0"
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
using nk
[PROOF STATE]
proof (prove)
using this:
0 < k
n = k ^ 8

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

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
from Clique_not_solvable_by_small_monotone_circuit[OF Large \<pi>[unfolded nk] _ vars]
    solution[unfolded s] nk
[PROOF STATE]
proof (chain)
picking this:
\<forall>G\<in>Graphs [k ^ 8]. (G \<in> Clique [k ^ 8] (k\<^sup>2)) = eval (\<lambda>x. \<pi> x \<in> G) \<phi> \<Longrightarrow> real k powr (8 / 7 * real k) < real (cs \<phi>)
\<forall>G\<in>Graphs [n]. (G \<in> Clique [n] (k\<^sup>2)) = eval (\<lambda>x. \<pi> x \<in> G) \<phi>
n = k ^ 8
[PROOF STEP]
have "real k powr (8 / 7 * real k) < cs \<phi>"
[PROOF STATE]
proof (prove)
using this:
\<forall>G\<in>Graphs [k ^ 8]. (G \<in> Clique [k ^ 8] (k\<^sup>2)) = eval (\<lambda>x. \<pi> x \<in> G) \<phi> \<Longrightarrow> real k powr (8 / 7 * real k) < real (cs \<phi>)
\<forall>G\<in>Graphs [n]. (G \<in> Clique [n] (k\<^sup>2)) = eval (\<lambda>x. \<pi> x \<in> G) \<phi>
n = k ^ 8

goal (1 subgoal):
 1. real k powr (8 / 7 * real k) < real (cs \<phi>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real k powr (8 / 7 * real k) < real (cs \<phi>)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real k powr (8 / 7 * real k) < real (cs \<phi>)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have "real k powr (8 / 7 * real k) = root 8 n powr (8 / 7 * root 8 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real k powr (8 / 7 * real k) = root 8 (real n) powr (8 / 7 * root 8 (real n))
[PROOF STEP]
unfolding kn
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 8 (real n) powr (8 / 7 * root 8 (real n)) = root 8 (real n) powr (8 / 7 * root 8 (real n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real k powr (8 / 7 * real k) = root 8 (real n) powr (8 / 7 * root 8 (real n))

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real k powr (8 / 7 * real k) = root 8 (real n) powr (8 / 7 * root 8 (real n))

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have "\<dots> = ((root 8 n) powr (8 / 7)) powr (root 8 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 8 (real n) powr (8 / 7 * root 8 (real n)) = (root 8 (real n) powr (8 / 7)) powr root 8 (real n)
[PROOF STEP]
unfolding powr_powr
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 8 (real n) powr (8 / 7 * root 8 (real n)) = root 8 (real n) powr (8 / 7 * root 8 (real n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
root 8 (real n) powr (8 / 7 * root 8 (real n)) = (root 8 (real n) powr (8 / 7)) powr root 8 (real n)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root 8 (real n) powr (8 / 7 * root 8 (real n)) = (root 8 (real n) powr (8 / 7)) powr root 8 (real n)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
have "(root 8 n) powr (8 / 7) = root 7 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 8 (real n) powr (8 / 7) = root 7 (real n)
[PROOF STEP]
using n0
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. root 8 (real n) powr (8 / 7) = root 7 (real n)
[PROOF STEP]
by (simp add: root_powr_inverse powr_powr)
[PROOF STATE]
proof (state)
this:
root 8 (real n) powr (8 / 7) = root 7 (real n)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
root 7 (real n) powr root 8 (real n) < real (cs \<phi>)

goal (1 subgoal):
 1. root 7 (real n) powr root 8 (real n) < real (cs \<phi>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
root 7 (real n) powr root 8 (real n) < real (cs \<phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma drop_butlast: "drop n (butlast xs) = butlast (drop n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (butlast xs) = butlast (drop n xs)
[PROOF STEP]
by (simp add: butlast_conv_take drop_take ac_simps)


[STATEMENT]
lemma fls_inverse_deriv:
  fixes a :: "'a::field fls"
  shows "fls_deriv (inverse a) = - fls_deriv a * (inverse a)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (inverse a) = - fls_deriv a * (inverse a)\<^sup>2
[PROOF STEP]
by    (simp add: fls_inverse_deriv_divring power2_eq_square)


[STATEMENT]
lemma int_1_and: fixes x :: int shows "1 AND x = x mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 AND x = x mod 2
[PROOF STEP]
by (fact one_and_eq)


[STATEMENT]
lemma move_matrix_mult: "move_matrix ((A::('a::semiring_0) matrix)*B) j i = (move_matrix A j 0) * (move_matrix B 0 i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. move_matrix (A * B) j i = move_matrix A j 0 * move_matrix B 0 i
[PROOF STEP]
by (simp add: move_matrix_ortho[of "A*B"] move_matrix_col_mult move_matrix_row_mult)


[STATEMENT]
lemma R_and_a_half_\<theta>:
  "(R + 1/2) * \<theta> = pi / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real R + 1 / 2) * \<theta> = pi / 2
[PROOF STEP]
using R \<theta>_neq_0
[PROOF STATE]
proof (prove)
using this:
real R = pi / (2 * \<theta>) - 1 / 2
\<theta> \<noteq> 0

goal (1 subgoal):
 1. (real R + 1 / 2) * \<theta> = pi / 2
[PROOF STEP]
by auto


[STATEMENT]
lemma mult_bounds_enclose_zero2:
  "min (la * lb) (min (la * ub) (min (lb * ua) (ua * ub))) \<le> 0"
  "0 \<le> max (la * lb) (max (la * ub) (max (lb * ua) (ua * ub)))"
  if "lb \<le> 0" "0 \<le> ub"
  for la lb ua ub:: "'a::linordered_idom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (la * lb) (min (la * ub) (min (lb * ua) (ua * ub))) \<le> (0::'a) &&& (0::'a) \<le> max (la * lb) (max (la * ub) (max (lb * ua) (ua * ub)))
[PROOF STEP]
using mult_bounds_enclose_zero1[OF that, of la ua]
[PROOF STATE]
proof (prove)
using this:
min (lb * la) (min (lb * ua) (min (la * ub) (ub * ua))) \<le> (0::'a)
(0::'a) \<le> max (lb * la) (max (lb * ua) (max (la * ub) (ub * ua)))

goal (1 subgoal):
 1. min (la * lb) (min (la * ub) (min (lb * ua) (ua * ub))) \<le> (0::'a) &&& (0::'a) \<le> max (la * lb) (max (la * ub) (max (lb * ua) (ua * ub)))
[PROOF STEP]
by (simp_all add: ac_simps)


[STATEMENT]
lemma qbs_prob_integral_real_Markov_inequality':
  assumes "qbs_prob_space_qbs s = \<real>\<^sub>Q"
          "qbs_integrable s f"
      and "0 < c"
    shows "qbs_measure s {r. c \<le> \<bar>f r\<bar>} \<le> 1/c * qbs_prob_integral s (\<lambda>x. \<bar>f x\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_measure s {r. c \<le> \<bar>f r\<bar>} \<le> 1 / c * \<integral>\<^sub>Q x. \<bar>f x\<bar> \<partial>s
[PROOF STEP]
using qbs_prob_integral_Markov_inequality_abs'[OF assms]
[PROOF STATE]
proof (prove)
using this:
qbs_measure s {x \<in> qbs_space \<real>\<^sub>Q. c \<le> \<bar>f x\<bar>} \<le> 1 / c * \<integral>\<^sub>Q x. \<bar>f x\<bar> \<partial>s

goal (1 subgoal):
 1. qbs_measure s {r. c \<le> \<bar>f r\<bar>} \<le> 1 / c * \<integral>\<^sub>Q x. \<bar>f x\<bar> \<partial>s
[PROOF STEP]
by simp


[STATEMENT]
theorem Plus_comm: "Plus r s = Plus s r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Plus r s = Plus s r
[PROOF STEP]
by (coinduction arbitrary: r s) auto


[STATEMENT]
lemma lead_coeff_p_gt_0: "lead_coeff (p s) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < lead_coeff (p s)
[PROOF STEP]
unfolding lead_coeff_p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (\<Prod>i = 0..<s. 1 / (real s - real i))
[PROOF STEP]
by (rule prod_pos, auto)


[STATEMENT]
lemma delete_edge_set_edges:
    "set (edgesL (delete_edge v v' G)) = {(a,b). (a,b) \<in> set (edgesL G) \<and> (a,b) \<noteq> (v,v')}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (edgesL (FiniteListGraph.delete_edge v v' G)) = {(a, b). (a, b) \<in> set (edgesL G) \<and> (a, b) \<noteq> (v, v')}
[PROOF STEP]
unfolding delete_edge_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (edgesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> v \<or> e2 \<noteq> v') (edgesL G)\<rparr>) = {(a, b). (a, b) \<in> set (edgesL G) \<and> (a, b) \<noteq> (v, v')}
[PROOF STEP]
by auto


[STATEMENT]
lemma scale_cancel_right [simp]: "scale a x = scale b x \<longleftrightarrow> a = b \<or> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *s x = b *s x) = (a = b \<or> x = (0::'b))
[PROOF STEP]
by (auto intro: scale_right_imp_eq)


[STATEMENT]
lemma Collect_disj_Un: "{f i |i. P i \<or> Q i} = {f i |i. P i} \<union> {f i |i. Q i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f i |i. P i \<or> Q i} = {f i |i. P i} \<union> {f i |i. Q i}
[PROOF STEP]
by auto


[STATEMENT]
lemma all_lt_Max_imp_lt_mset: "N \<noteq> {#} \<Longrightarrow> (\<forall>a \<in># M. a < Max (set_mset N)) \<Longrightarrow> M < N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>N \<noteq> {#}; \<forall>a\<in>#M. a < Max_mset N\<rbrakk> \<Longrightarrow> M < N
[PROOF STEP]
by (meson Max_in[OF finite_set_mset] ex_gt_imp_less_multiset set_mset_eq_empty_iff)


[STATEMENT]
lemma Least_eq[simp]: "(LEAST y. y = x) = x" and "(LEAST y. x = y) = x" for x :: "'a::order"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST y. y = x) = x &&& (LEAST y. x = y) = x
[PROOF STEP]
by (blast intro: Least_equality)+


[STATEMENT]
lemma measurable_envelopeD:
  assumes "measurable_envelope M A E"
  shows "A \<subseteq> E"
    and "E \<in> sets M"
    and "\<And>F. F \<in> sets M \<Longrightarrow> emeasure M (F \<inter> E) = outer_measure_of M (F \<inter> A)"
    and "A \<subseteq> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<subseteq> E &&& E \<in> sets M) &&& (\<And>F. F \<in> sets M \<Longrightarrow> emeasure M (F \<inter> E) = outer_measure_of M (F \<inter> A)) &&& A \<subseteq> space M
[PROOF STEP]
using assms sets.sets_into_space[of E]
[PROOF STATE]
proof (prove)
using this:
measurable_envelope M A E
E \<in> sets ?M \<Longrightarrow> E \<subseteq> space ?M

goal (1 subgoal):
 1. (A \<subseteq> E &&& E \<in> sets M) &&& (\<And>F. F \<in> sets M \<Longrightarrow> emeasure M (F \<inter> E) = outer_measure_of M (F \<inter> A)) &&& A \<subseteq> space M
[PROOF STEP]
by (auto simp: measurable_envelope_def)


[STATEMENT]
lemma register_eqI: \<open>separating TYPE('b::finite) A \<Longrightarrow> clinear F \<Longrightarrow> clinear G \<Longrightarrow> (\<And>x. x\<in>A \<Longrightarrow> F x = G x) \<Longrightarrow> F = (G::_ \<Rightarrow> 'b update)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>separating TYPE('b) A; clinear F; clinear G; \<And>x. x \<in> A \<Longrightarrow> F x = G x\<rbrakk> \<Longrightarrow> F = G
[PROOF STEP]
unfolding separating_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>F G. clinear F \<longrightarrow> clinear G \<longrightarrow> (\<forall>x\<in>A. F x = G x) \<longrightarrow> F = G; clinear F; clinear G; \<And>x. x \<in> A \<Longrightarrow> F x = G x\<rbrakk> \<Longrightarrow> F = G
[PROOF STEP]
by auto


[STATEMENT]
lemma prime_factors_elem:
  fixes n :: nat assumes "1 < n" shows "\<exists>p. p \<in> prime_factors n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. p \<in># prime_factorization n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. \<exists>p. p \<in># prime_factorization n
[PROOF STEP]
by (cases "prime n") (auto simp: prime_factors_dvd prime_factor_nat)


[STATEMENT]
lemma length_weave:
shows "length (weave A xs ys) = length xs + length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (weave A xs ys) = length xs + length ys
[PROOF STEP]
unfolding weave_def length_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [0..<length xs + length ys] = length xs + length ys
[PROOF STEP]
by simp


[STATEMENT]
lemma skelBinp_def2:
assumes "goodBinp binp"
shows "skelBinp binp = lift skelAbs binp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. skelBinp binp = lift skelAbs binp
[PROOF STEP]
unfolding skelBinp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qSkelBinp (pickBinp binp) = lift skelAbs binp
[PROOF STEP]
unfolding qSkelBinp_def pickBinp_def skelAbs_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lift qSkelAbs (lift pick binp) = lift (\<lambda>A. qSkelAbs (pick A)) binp
[PROOF STEP]
unfolding lift_comp comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lift (\<lambda>x. qSkelAbs (pick x)) binp = lift (\<lambda>A. qSkelAbs (pick A)) binp
[PROOF STEP]
by simp


[STATEMENT]
lemma "\<turnstile>\<^sub>t
{\<lambda>s. \<exists>n. n = nat(s ''x'')}
 WHILE Less (N 0) (V ''x'') DO ''x'' ::= Plus (V ''x'') (N (-1))
{\<lambda>s. s ''x'' \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile>\<^sub>t {\<lambda>s. \<exists>n. n = nat (s ''x'')} WHILE Less (N 0) (V ''x'') DO ''x'' ::= Plus (V ''x'') (N (- 1)) {\<lambda>s. s ''x'' \<le> 0}
[PROOF STEP]
apply(rule weaken_post)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<turnstile>\<^sub>t {\<lambda>s. \<exists>n. n = nat (s ''x'')} WHILE Less (N 0) (V ''x'') DO ''x'' ::= Plus (V ''x'') (N (- 1)) {?Q}
 2. \<forall>s. ?Q s \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
apply(rule While)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {\<lambda>s. n = nat (s ''x'')}
 2. \<forall>n s. Suc n = nat (s ''x'') \<longrightarrow> bval (Less (N 0) (V ''x'')) s
 3. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> \<not> bval (Less (N 0) (V ''x'')) s
 4. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
apply(rule Assign')
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n. \<forall>s. Suc n = nat (s ''x'') \<longrightarrow> n = nat ((s[Plus (V ''x'') (N (- 1))/''x'']) ''x'')
 2. \<forall>n s. Suc n = nat (s ''x'') \<longrightarrow> bval (Less (N 0) (V ''x'')) s
 3. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> \<not> bval (Less (N 0) (V ''x'')) s
 4. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma gbinomial_mult_fact': "(a gchoose k) * fact k = (\<Prod>i = 0..<k. a - of_nat i)"
  for a :: "'a::field_char_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a gchoose k) * fact k = (\<Prod>i = 0..<k. a - of_nat i)
[PROOF STEP]
using gbinomial_mult_fact [of k a]
[PROOF STATE]
proof (prove)
using this:
fact k * (a gchoose k) = (\<Prod>i = 0..<k. a - of_nat i)

goal (1 subgoal):
 1. (a gchoose k) * fact k = (\<Prod>i = 0..<k. a - of_nat i)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma fps_XD'_add [simp]: "fps_XD' a (b + c :: 'a :: comm_ring_1 fps) = fps_XD' a b + fps_XD' a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_XD' a (b + c) = fps_XD' a b + fps_XD' a c
[PROOF STEP]
by (simp add: fps_XD'_def algebra_simps)


[STATEMENT]
lemma iso_iff:
   "h \<in> iso G H \<longleftrightarrow> h \<in> hom G H \<and> h ` (carrier G) = carrier H \<and> inj_on h (carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<in> Group.iso G H) = (h \<in> hom G H \<and> h ` carrier G = carrier H \<and> inj_on h (carrier G))
[PROOF STEP]
by (auto simp: iso_def hom_def bij_betw_def)


[STATEMENT]
lemma height_full_node: "height (full_node k a h) = h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height (full_node k a h) = h
[PROOF STEP]
apply(induction k a h rule: full_node.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k c. height (full_node k c 0) = 0
 2. \<And>k c n. \<lbrakk>height (full_node k c n) = n; height (full_node k c n) = n\<rbrakk> \<Longrightarrow> height (full_node k c (Suc n)) = Suc n
[PROOF STEP]
apply (auto simp add: set_replicate_conv_if)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Dirichlet_kernel_minus [simp]: "Dirichlet_kernel n (-x) = Dirichlet_kernel n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dirichlet_kernel n (- x) = Dirichlet_kernel n x
[PROOF STEP]
by (auto simp: Dirichlet_kernel_def)


[STATEMENT]
lemma homeomorphic_map_path_connectedness_eq:
   "homeomorphic_map X Y f \<Longrightarrow> path_connectedin X U \<longleftrightarrow> U \<subseteq> topspace X \<and> path_connectedin Y (f ` U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X Y f \<Longrightarrow> path_connectedin X U = (U \<subseteq> topspace X \<and> path_connectedin Y (f ` U))
[PROOF STEP]
by (meson homeomorphic_map_path_connectedness path_connectedin_def)


[STATEMENT]
lemma im_set_un2:"A = A1 \<union> A2 \<Longrightarrow>  f `A = f `(A1) \<union> f `(A2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = A1 \<union> A2 \<Longrightarrow> f ` A = f ` A1 \<union> f ` A2
[PROOF STEP]
apply (rule equalityI,
       rule subsetI, simp add:image_def, erule bexE, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = A1 \<union> A2 \<Longrightarrow> f ` A1 \<union> f ` A2 \<subseteq> f ` A
[PROOF STEP]
apply (rule subsetI,
       simp add:image_def, erule disjE, erule bexE, blast, erule bexE, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cnj_zero [simp]: "cnj 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quaternions.cnj 0 = 0
[PROOF STEP]
by (simp add: quat_eq_iff)


[STATEMENT]
lemma (in padic_integers) val_Zp_of_minus:
  assumes "a \<in> carrier Zp"
  shows "val_Zp a = val_Zp (\<ominus> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val_Zp a = val_Zp (\<ominus> a)
[PROOF STEP]
using assms not_nonzero_Zp ord_Zp_def ord_Zp_of_a_inv val_Zp_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Zp
\<lbrakk>?x \<in> carrier Zp; ?x \<notin> nonzero Zp\<rbrakk> \<Longrightarrow> ?x = \<zero>
ord_Zp = padic_val p
?a \<in> nonzero Zp \<Longrightarrow> ord_Zp ?a = ord_Zp (\<ominus> ?a)
val_Zp = (\<lambda>x. if x = \<zero> then \<infinity> else eint (padic_val p x))

goal (1 subgoal):
 1. val_Zp a = val_Zp (\<ominus> a)
[PROOF STEP]
by auto


[STATEMENT]
lemma orthogonal_spaces_leq_compl: \<open>orthogonal_spaces S T \<longleftrightarrow> S \<le> -T\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_spaces S T = (S \<le> - T)
[PROOF STEP]
unfolding orthogonal_spaces_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>space_as_set S. \<forall>y\<in>space_as_set T. is_orthogonal x y) = (S \<le> - T)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S T. \<lbrakk>closed_csubspace S; closed_csubspace T\<rbrakk> \<Longrightarrow> (\<forall>x\<in>S. \<forall>y\<in>T. is_orthogonal x y) = (S \<subseteq> orthogonal_complement T)
[PROOF STEP]
by (auto simp: orthogonal_complement_def)


[STATEMENT]
lemma lcm_altdef_int [code]: "lcm a b = \<bar>a\<bar> * \<bar>b\<bar> div gcd a b"
  for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm a b = \<bar>a\<bar> * \<bar>b\<bar> div gcd a b
[PROOF STEP]
by (simp add: abs_mult lcm_gcd abs_div)


[STATEMENT]
lemma bound_pow_of_nat: "bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg
[PROOF STEP]
proof (induct deg)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
 2. \<And>deg. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg \<Longrightarrow> bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
case (Suc deg)
[PROOF STATE]
proof (state)
this:
bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg

goal (2 subgoals):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
 2. \<And>deg. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg \<Longrightarrow> bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
have "bound (a * of_nat n ^ Suc deg) =  bound (of_nat n * (a * of_nat n ^ deg))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (a * of_nat n ^ Suc deg) = bound (of_nat n * (a * of_nat n ^ deg))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
bound (a * of_nat n ^ Suc deg) = bound (of_nat n * (a * of_nat n ^ deg))

goal (2 subgoals):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
 2. \<And>deg. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg \<Longrightarrow> bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound (a * of_nat n ^ Suc deg) = bound (of_nat n * (a * of_nat n ^ deg))

goal (2 subgoals):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
 2. \<And>deg. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg \<Longrightarrow> bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
have "\<dots> \<le> n * bound (a * of_nat n ^ deg)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (of_nat n * (a * of_nat n ^ deg)) \<le> n * bound (a * of_nat n ^ deg)
[PROOF STEP]
by (rule bound_of_nat_times)
[PROOF STATE]
proof (state)
this:
bound (of_nat n * (a * of_nat n ^ deg)) \<le> n * bound (a * of_nat n ^ deg)

goal (2 subgoals):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
 2. \<And>deg. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg \<Longrightarrow> bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound (of_nat n * (a * of_nat n ^ deg)) \<le> n * bound (a * of_nat n ^ deg)

goal (2 subgoals):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
 2. \<And>deg. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg \<Longrightarrow> bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
have "\<dots> \<le> n * (bound a * of_nat n ^ deg)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n * bound (a * of_nat n ^ deg) \<le> n * (bound a * of_nat n ^ deg)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg

goal (1 subgoal):
 1. n * bound (a * of_nat n ^ deg) \<le> n * (bound a * of_nat n ^ deg)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n * bound (a * of_nat n ^ deg) \<le> n * (bound a * of_nat n ^ deg)

goal (2 subgoals):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
 2. \<And>deg. bound (a * of_nat n ^ deg) \<le> bound a * of_nat n ^ deg \<Longrightarrow> bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bound (a * of_nat n ^ Suc deg) \<le> n * (bound a * of_nat n ^ deg)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bound (a * of_nat n ^ Suc deg) \<le> n * (bound a * of_nat n ^ deg)

goal (1 subgoal):
 1. bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
bound (a * of_nat n ^ Suc deg) \<le> bound a * of_nat n ^ Suc deg

goal (1 subgoal):
 1. bound (a * of_nat n ^ 0) \<le> bound a * of_nat n ^ 0
[PROOF STEP]
qed simp


[STATEMENT]
lemma setdist_eq_0I: "\<lbrakk>x \<in> S; x \<in> T\<rbrakk> \<Longrightarrow> setdist S T = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> S; x \<in> T\<rbrakk> \<Longrightarrow> setdist S T = 0
[PROOF STEP]
by (metis antisym dist_self setdist_le_dist setdist_pos_le)


[STATEMENT]
lemma five:  "5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
have       "5 = Suc(Suc(Suc(Suc(Suc(0)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 5 = Suc (Suc (Suc (Suc (Suc 0))))
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
5 = Suc (Suc (Suc (Suc (Suc 0))))

goal (1 subgoal):
 1. 5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
hence      "5 \<times> x = Suc(Suc(Suc(Suc(Suc(0))))) \<times> x"
[PROOF STATE]
proof (prove)
using this:
5 = Suc (Suc (Suc (Suc (Suc 0))))

goal (1 subgoal):
 1. 5 \<times> x = Suc (Suc (Suc (Suc (Suc 0)))) \<times> x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
5 \<times> x = Suc (Suc (Suc (Suc (Suc 0)))) \<times> x

goal (1 subgoal):
 1. 5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
5 \<times> x = Suc (Suc (Suc (Suc (Suc 0)))) \<times> x

goal (1 subgoal):
 1. 5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
have  "\<dots> = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (Suc (Suc (Suc (Suc 0)))) \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (Suc (Suc (Suc (Suc 0)))) \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x

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

goal (1 subgoal):
 1. 5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
5 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma icard_eq_enat_imp_card: "icard A = enat n \<Longrightarrow> card A = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. icard A = enat n \<Longrightarrow> card A = n
[PROOF STEP]
by (frule icard_eq_enat_imp, simp add: icard_finite)


[STATEMENT]
lemma mat_t_mat_t [simp]:
  shows "mat_transpose (mat_transpose A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_transpose (mat_transpose A) = A
[PROOF STEP]
by (cases A) auto


[STATEMENT]
lemma rot_circle_top_left_edges_neq [simp]: "rot_circle_top_edge \<noteq> rot_circle_left_edge"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rot_circle_top_edge \<noteq> rot_circle_left_edge
[PROOF STEP]
apply (simp add: rot_circle_left_edge_def rot_circle_top_edge_def x_coord_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. (0, d / 2)) \<noteq> (\<lambda>t. (- (d * circle_y (t - 1 / 2)), (t - 1 / 2) * d))
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) cancel_comm_monoid_add_class.diff_cancel d_gt_0 divide_eq_0_iff mult_zero_left order_less_irrefl prod.sel(2) zero_neq_numeral)


[STATEMENT]
lemma transpose_mat_of_cols: "(mat_of_cols n vs)\<^sup>T = mat_of_rows n vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mat_of_cols n vs)\<^sup>T = mat_of_rows n vs
[PROOF STEP]
by (auto intro!: eq_matI simp: mat_of_rows_index mat_of_cols_index)


[STATEMENT]
lemma normal_imp_not_denormal: "is_normal f \<Longrightarrow> \<not>is_denormal f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_normal f \<Longrightarrow> \<not> is_denormal f
[PROOF STEP]
by (simp add: is_normal_def is_denormal_def)


[STATEMENT]
lemma powsum_shift: "x\<^bsup>k \<^esup>\<cdot> x\<^bsub>m\<^esub>\<^bsup>n\<^esup> = x\<^bsub>k+m\<^esub>\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsup>k\<^esup> \<cdot> x\<^bsub>m\<^esub>\<^bsup>n\<^esup> = x\<^bsub>k + m\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
by (induct k, simp_all, metis Suc_eq_plus1 mult.assoc powsum_shift1)


[STATEMENT]
lemma rpc_expl: "rpc x y = \<Squnion>{z. x \<sqinter> z \<le> y \<and> \<nu> z = (z::'a::bool_unital_quantale)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. x \<sqinter> z \<le> y \<and> \<nu> z = z}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. x \<sqinter> z \<le> y \<and> \<nu> z = z}
[PROOF STEP]
have "rpc x y = \<Squnion>{z. z \<le> rpc x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. z \<le> rpc x y}
[PROOF STEP]
using Sup_atMost atMost_def
[PROOF STATE]
proof (prove)
using this:
\<Squnion> {..?y} = ?y
{..?u} \<equiv> {x. x \<le> ?u}

goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. z \<le> rpc x y}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
rpc x y = \<Squnion> {z. z \<le> rpc x y}

goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. x \<sqinter> z \<le> y \<and> \<nu> z = z}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rpc x y = \<Squnion> {z. z \<le> rpc x y}

goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. x \<sqinter> z \<le> y \<and> \<nu> z = z}
[PROOF STEP]
have "... = \<Squnion>{z. x \<sqinter> \<nu> z \<le> y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> {z. z \<le> rpc x y} = \<Squnion> {z. x \<sqinter> \<nu> z \<le> y}
[PROOF STEP]
using lsl_rpc_galois
[PROOF STATE]
proof (prove)
using this:
(?x \<sqinter> \<nu> ?z \<le> ?y) = (?z \<le> rpc ?x ?y)

goal (1 subgoal):
 1. \<Squnion> {z. z \<le> rpc x y} = \<Squnion> {z. x \<sqinter> \<nu> z \<le> y}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<Squnion> {z. z \<le> rpc x y} = \<Squnion> {z. x \<sqinter> \<nu> z \<le> y}

goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. x \<sqinter> z \<le> y \<and> \<nu> z = z}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rpc x y = \<Squnion> {z. x \<sqinter> \<nu> z \<le> y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rpc x y = \<Squnion> {z. x \<sqinter> \<nu> z \<le> y}

goal (1 subgoal):
 1. rpc x y = \<Squnion> {z. x \<sqinter> z \<le> y \<and> \<nu> z = z}
[PROOF STEP]
by (simp add: rpc_expl_aux)
[PROOF STATE]
proof (state)
this:
rpc x y = \<Squnion> {z. x \<sqinter> z \<le> y \<and> \<nu> z = z}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma left_commute: "f a (f b c) = f b (f a c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a (f b c) = f b (f a c)
[PROOF STEP]
apply (simp add: left_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (f a b) c = f (f b a) c
[PROOF STEP]
apply (simp add: commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma connected_conv:
  shows "connected G \<longleftrightarrow> verts G \<noteq> {} \<and> (\<forall>u \<in> verts G. \<forall>v \<in> verts G. (u,v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digraph_Component.connected G = (verts G \<noteq> {} \<and> (\<forall>u\<in>verts G. \<forall>v\<in>verts G. (u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Digraph_Component.connected G = (verts G \<noteq> {} \<and> (\<forall>u\<in>verts G. \<forall>v\<in>verts G. (u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)))
[PROOF STEP]
have "symcl (arcs_ends G) = parcs (mk_symmetric G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arcs_ends G)\<^sup>s = parcs (mk_symmetric G)
[PROOF STEP]
by (auto simp: parcs_mk_symmetric symcl_def arcs_ends_conv)
[PROOF STATE]
proof (state)
this:
(arcs_ends G)\<^sup>s = parcs (mk_symmetric G)

goal (1 subgoal):
 1. Digraph_Component.connected G = (verts G \<noteq> {} \<and> (\<forall>u\<in>verts G. \<forall>v\<in>verts G. (u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(arcs_ends G)\<^sup>s = parcs (mk_symmetric G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(arcs_ends G)\<^sup>s = parcs (mk_symmetric G)

goal (1 subgoal):
 1. Digraph_Component.connected G = (verts G \<noteq> {} \<and> (\<forall>u\<in>verts G. \<forall>v\<in>verts G. (u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)))
[PROOF STEP]
by (auto simp: connected_def strongly_connected_def reachable_def)
[PROOF STATE]
proof (state)
this:
Digraph_Component.connected G = (verts G \<noteq> {} \<and> (\<forall>u\<in>verts G. \<forall>v\<in>verts G. (u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(- 5) ^ 11 = (-48828125::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 5) ^ 11 = - 48828125
[PROOF STEP]
by simp


[STATEMENT]
theorem big_step_determ: "\<lbrakk> (c,s) \<Rightarrow> t; (c,s) \<Rightarrow> u \<rbrakk> \<Longrightarrow> u = t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, s) \<Rightarrow> t; (c, s) \<Rightarrow> u\<rbrakk> \<Longrightarrow> u = t
[PROOF STEP]
by (induction arbitrary: u rule: big_step.induct) blast+


[STATEMENT]
lemma log_pow_cancel [simp]:
  "a > 0 \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> log a (a ^ b) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a \<noteq> 1\<rbrakk> \<Longrightarrow> log a (a ^ b) = real b
[PROOF STEP]
by (simp add: ln_realpow log_def)


[STATEMENT]
lemma poly_poly_y_x:
  fixes p :: "'a :: comm_semiring_1 poly poly"
  shows "poly (poly (poly_y_x p) q) y = poly (poly p [:y:]) (poly q y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly (poly_y_x p) q) y = poly (poly p [:y:]) (poly q y)
[PROOF STEP]
apply(subst(5) poly_as_sum_of_monoms[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly (poly_y_x p) q) y = poly (poly (\<Sum>i\<le>degree p. monom (coeff p i) i) [:y:]) (poly q y)
[PROOF STEP]
apply(subst poly_as_sum_of_monoms[symmetric,of "coeff p _"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly (poly_y_x p) q) y = poly (poly (\<Sum>i\<le>degree p. monom (\<Sum>ia\<le>degree (coeff p i). monom (coeff (coeff p i) ia) ia) i) [:y:]) (poly q y)
[PROOF STEP]
unfolding poly_y_x_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly (\<Sum>i\<le>degree p. \<Sum>j\<le>degree (coeff p i). monom (monom (coeff (coeff p i) j) i) j) q) y = poly (poly (\<Sum>i\<le>degree p. monom (\<Sum>ia\<le>degree (coeff p i). monom (coeff (coeff p i) ia) ia) i) [:y:]) (poly q y)
[PROOF STEP]
unfolding coeff_sum monom_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly (\<Sum>i\<le>degree p. \<Sum>j\<le>degree (coeff p i). monom (monom (coeff (coeff p i) j) i) j) q) y = poly (poly (\<Sum>i\<le>degree p. \<Sum>x\<le>degree (coeff p i). monom (monom (coeff (coeff p i) x) x) i) [:y:]) (poly q y)
[PROOF STEP]
unfolding poly_hom.hom_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<le>degree p. \<Sum>xa\<le>degree (coeff p x). poly (poly (monom (monom (coeff (coeff p x) xa) x) xa) q) y) = (\<Sum>x\<le>degree p. \<Sum>xa\<le>degree (coeff p x). poly (poly (monom (monom (coeff (coeff p x) xa) xa) x) [:y:]) (poly q y))
[PROOF STEP]
apply(rule sum.cong, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {..degree p} \<Longrightarrow> (\<Sum>xa\<le>degree (coeff p x). poly (poly (monom (monom (coeff (coeff p x) xa) x) xa) q) y) = (\<Sum>xa\<le>degree (coeff p x). poly (poly (monom (monom (coeff (coeff p x) xa) xa) x) [:y:]) (poly q y))
[PROOF STEP]
apply(rule sum.cong, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> {..degree p}; xa \<in> {..degree (coeff p x)}\<rbrakk> \<Longrightarrow> poly (poly (monom (monom (coeff (coeff p x) xa) x) xa) q) y = poly (poly (monom (monom (coeff (coeff p x) xa) xa) x) [:y:]) (poly q y)
[PROOF STEP]
unfolding atMost_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<le> degree p; xa \<le> degree (coeff p x)\<rbrakk> \<Longrightarrow> poly (poly (monom (monom (coeff (coeff p x) xa) x) xa) q) y = poly (poly (monom (monom (coeff (coeff p x) xa) xa) x) [:y:]) (poly q y)
[PROOF STEP]
unfolding poly2_monom poly_monom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<le> degree p; xa \<le> degree (coeff p x)\<rbrakk> \<Longrightarrow> poly (monom (coeff (coeff p x) xa) x * q ^ xa) y = poly (monom (coeff (coeff p x) xa) xa * [:y:] ^ x) (poly q y)
[PROOF STEP]
apply(subst poly_monom_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<le> degree p; xa \<le> degree (coeff p x)\<rbrakk> \<Longrightarrow> poly (monom (coeff (coeff p x) xa) xa * [:y:] ^ x) (poly q y) = poly (monom (coeff (coeff p x) xa) xa * [:y:] ^ x) (poly q y)
[PROOF STEP]
..


[STATEMENT]
lemma column_matrix_matrix_mult:
  shows "column i (P**A) = P *v (column i A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i (P ** A) = P *v column i A
[PROOF STEP]
unfolding column_def matrix_vector_mult_def matrix_matrix_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia. (\<chi>i j. \<Sum>k\<in>UNIV. P $ i $ k * A $ k $ j) $ ia $ i) = (\<chi>ia. \<Sum>j\<in>UNIV. P $ ia $ j * (\<chi>ia. A $ ia $ i) $ j)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma strictly_solvent_just_cash_equiv:
  "strictly_solvent (just_cash c) = (0 \<le> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strictly_solvent (just_cash c) = (0 \<le> c)
[PROOF STEP]
unfolding strictly_solvent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. 0 \<le> sum (\<pi> (just_cash c)) {..n}) = (0 \<le> c)
[PROOF STEP]
using Rep_account_just_cash just_cash_def
[PROOF STATE]
proof (prove)
using this:
\<pi> (just_cash ?c) = (\<lambda>n. if n = 0 then ?c else 0)
just_cash ?c = \<iota> (\<lambda>n. if n = 0 then ?c else 0)

goal (1 subgoal):
 1. (\<forall>n. 0 \<le> sum (\<pi> (just_cash c)) {..n}) = (0 \<le> c)
[PROOF STEP]
by force


[STATEMENT]
lemma relative_homology_group_restrict [simp]:
   "relative_homology_group p X (topspace X \<inter> S) = relative_homology_group p X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relative_homology_group p X (topspace X \<inter> S) = relative_homology_group p X S
[PROOF STEP]
by (simp add: relative_homology_group_def)


[STATEMENT]
lemma rank_1_proj_positive:
  assumes "\<parallel>v\<parallel> = 1"
  shows "Complex_Matrix.positive (rank_1_proj v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.positive (rank_1_proj v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.positive (rank_1_proj v)
[PROOF STEP]
have "projector (rank_1_proj v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
using assms rank_1_proj_projector
[PROOF STATE]
proof (prove)
using this:
\<parallel>v\<parallel> = 1
\<parallel>?v\<parallel> = 1 \<Longrightarrow> projector (rank_1_proj ?v)

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

goal (1 subgoal):
 1. Complex_Matrix.positive (rank_1_proj v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
projector (rank_1_proj v)

goal (1 subgoal):
 1. Complex_Matrix.positive (rank_1_proj v)
[PROOF STEP]
using projector_positive
[PROOF STATE]
proof (prove)
using this:
projector (rank_1_proj v)
projector ?M \<Longrightarrow> Complex_Matrix.positive ?M

goal (1 subgoal):
 1. Complex_Matrix.positive (rank_1_proj v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.positive (rank_1_proj v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reduce_invertible_mat_D0:
  assumes A: "A \<in> carrier_mat m n"
  and a: "a < m"
  and b: "b < m"
  and n0: "0<n"
  and ab: "a \<noteq> b"
  and a_less_b: "a<b"
  shows "\<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
proof (cases "A$$(a,0) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A $$ (a, 0) = 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
 2. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A $$ (a, 0) = 0

goal (2 subgoals):
 1. A $$ (a, 0) = 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
 2. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A $$ (a, 0) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A $$ (a, 0) = 0

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
by (smt A invertible_mat_one left_mult_one_mat one_carrier_mat reduce.simps)
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
A $$ (a, 0) \<noteq> 0

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
obtain p q u v d where pquvd: "(p,q,u,v,d) = euclid_ext2 (A$$(a,0)) (A$$(b,0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q u v d. (p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: euclid_ext2_def)
[PROOF STATE]
proof (state)
this:
(p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0))

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
let ?BM = "bezout_matrix_JNF A a b 0 euclid_ext2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
have "reduce a b 0 A = ?BM * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce a b 0 A = bezout_matrix_JNF A a b 0 euclid_ext2 * A
[PROOF STEP]
by (rule reduce_invertible_mat_D0_BM[OF A a b ab False])
[PROOF STATE]
proof (state)
this:
reduce a b 0 A = bezout_matrix_JNF A a b 0 euclid_ext2 * A

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
reduce a b 0 A = bezout_matrix_JNF A a b 0 euclid_ext2 * A

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
have invertible_bezout: "invertible_mat ?BM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat (bezout_matrix_JNF A a b 0 euclid_ext2)
[PROOF STEP]
by (rule invertible_bezout_matrix_JNF[OF A is_bezout_ext_euclid_ext2 a_less_b _ n0 False],
        insert a_less_b b, auto)
[PROOF STATE]
proof (state)
this:
invertible_mat (bezout_matrix_JNF A a b 0 euclid_ext2)

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invertible_mat (bezout_matrix_JNF A a b 0 euclid_ext2)

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
have BM: "?BM \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bezout_matrix_JNF A a b 0 euclid_ext2 \<in> carrier_mat m m
[PROOF STEP]
unfolding bezout_matrix_JNF_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_row A) (\<lambda>(x, y). let (p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) in if x = a \<and> y = a then p else if x = a \<and> y = b then q else if x = b \<and> y = a then u else if x = b \<and> y = b then v else if x = y then 1 else 0) \<in> carrier_mat m m
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m n

goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_row A) (\<lambda>(x, y). let (p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) in if x = a \<and> y = a then p else if x = a \<and> y = b then q else if x = b \<and> y = a then u else if x = b \<and> y = b then v else if x = y then 1 else 0) \<in> carrier_mat m m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bezout_matrix_JNF A a b 0 euclid_ext2 \<in> carrier_mat m m

goal (1 subgoal):
 1. A $$ (a, 0) \<noteq> 0 \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
reduce a b 0 A = bezout_matrix_JNF A a b 0 euclid_ext2 * A
invertible_mat (bezout_matrix_JNF A a b 0 euclid_ext2)
bezout_matrix_JNF A a b 0 euclid_ext2 \<in> carrier_mat m m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
reduce a b 0 A = bezout_matrix_JNF A a b 0 euclid_ext2 * A
invertible_mat (bezout_matrix_JNF A a b 0 euclid_ext2)
bezout_matrix_JNF A a b 0 euclid_ext2 \<in> carrier_mat m m

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> reduce a b 0 A = P * A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ortho_mult_equiv: "a \<bottom> b \<longleftrightarrow> (\<forall>k. (nth_bit a k) * (nth_bit b k) = 0)" (is "?P \<longleftrightarrow> ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<bottom> b) = (\<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<bottom> b \<Longrightarrow> \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0
 2. \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0 \<Longrightarrow> a \<bottom> b
[PROOF STEP]
assume "?P"
[PROOF STATE]
proof (state)
this:
a \<bottom> b

goal (2 subgoals):
 1. a \<bottom> b \<Longrightarrow> \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0
 2. \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0 \<Longrightarrow> a \<bottom> b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<bottom> b
[PROOF STEP]
show "?Q"
[PROOF STATE]
proof (prove)
using this:
a \<bottom> b

goal (1 subgoal):
 1. \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0
[PROOF STEP]
using bitAND_digit_mult nth_bit_def
[PROOF STATE]
proof (prove)
using this:
a \<bottom> b
(?a && ?b) \<exclamdown> ?k = ?a \<exclamdown> ?k * ?b \<exclamdown> ?k
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2

goal (1 subgoal):
 1. \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0
[PROOF STEP]
by (metis div_0 mod_0 orthogonal.simps)
[PROOF STATE]
proof (state)
this:
\<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0

goal (1 subgoal):
 1. \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0 \<Longrightarrow> a \<bottom> b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0 \<Longrightarrow> a \<bottom> b
[PROOF STEP]
assume "?Q"
[PROOF STATE]
proof (state)
this:
\<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0

goal (1 subgoal):
 1. \<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0 \<Longrightarrow> a \<bottom> b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0
[PROOF STEP]
show "?P"
[PROOF STATE]
proof (prove)
using this:
\<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0

goal (1 subgoal):
 1. a \<bottom> b
[PROOF STEP]
using bitAND_mult_equiv nth_bit_def
[PROOF STATE]
proof (prove)
using this:
\<forall>k. a \<exclamdown> k * b \<exclamdown> k = 0
(\<forall>k. ?c \<exclamdown> k = ?a \<exclamdown> k * ?b \<exclamdown> k) = (?c = ?a && ?b)
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2

goal (1 subgoal):
 1. a \<bottom> b
[PROOF STEP]
by (metis div_0 mod_0 orthogonal.simps)
[PROOF STATE]
proof (state)
this:
a \<bottom> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zmset_subset_eq_zcount: "A \<subseteq>#\<^sub>z B \<Longrightarrow> zcount A a \<le> zcount B a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq>#\<^sub>z B \<Longrightarrow> zcount A a \<le> zcount B a
[PROOF STEP]
by (simp add: subseteq_zmset_def)


[STATEMENT]
lemma stc_diff:
  "\<lbrakk>x \<in> HFinite; y \<in> HFinite\<rbrakk> \<Longrightarrow> stc (x-y) = stc(x) - stc(y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> HFinite; y \<in> HFinite\<rbrakk> \<Longrightarrow> stc (x - y) = stc x - stc y
[PROOF STEP]
by (simp add: stc_unique stc_SComplex stc_approx_self approx_diff)


[STATEMENT]
lemma snd_proj_prop: "\<forall>x\<in>snd_proj {(A,B) | A B. P B \<and> R A B}. P(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>snd_proj {(A, B) |A B. P B \<and> R A B}. P x
[PROOF STEP]
unfolding snd_proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{B. \<exists>A. (A, B) \<in> {(A, B) |A B. P B \<and> R A B}}. P x
[PROOF STEP]
by auto


[STATEMENT]
lemma hcomplex_hcnj_minus: "\<And>z. hcnj (- z) = - hcnj z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. hcnj (- z) = - hcnj z
[PROOF STEP]
by transfer (rule complex_cnj_minus)


[STATEMENT]
lemma continuous_on_closed_UN:
  assumes "finite S"
  shows "((\<And>s. s \<in> S \<Longrightarrow> closed s) \<Longrightarrow> (\<And>s. s \<in> S \<Longrightarrow> continuous_on s f) \<Longrightarrow> continuous_on (\<Union>S) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. s \<in> S \<Longrightarrow> closed s; \<And>s. s \<in> S \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> S) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. \<lbrakk>\<And>s. s \<in> S \<Longrightarrow> closed s; \<And>s. s \<in> S \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> S) f
[PROOF STEP]
proof(induction S)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>s. s \<in> {} \<Longrightarrow> closed s; \<And>s. s \<in> {} \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> {}) f
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f; \<And>s. s \<in> insert x F \<Longrightarrow> closed s; \<And>s. s \<in> insert x F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> (insert x F)) f
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?s \<in> {} \<Longrightarrow> closed ?s
?s \<in> {} \<Longrightarrow> continuous_on ?s f

goal (2 subgoals):
 1. \<lbrakk>\<And>s. s \<in> {} \<Longrightarrow> closed s; \<And>s. s \<in> {} \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> {}) f
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f; \<And>s. s \<in> insert x F \<Longrightarrow> closed s; \<And>s. s \<in> insert x F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> (insert x F)) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?s \<in> {} \<Longrightarrow> closed ?s
?s \<in> {} \<Longrightarrow> continuous_on ?s f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?s \<in> {} \<Longrightarrow> closed ?s
?s \<in> {} \<Longrightarrow> continuous_on ?s f

goal (1 subgoal):
 1. continuous_on (\<Union> {}) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on (\<Union> {}) f

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f; \<And>s. s \<in> insert x F \<Longrightarrow> closed s; \<And>s. s \<in> insert x F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> (insert x F)) f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f; \<And>s. s \<in> insert x F \<Longrightarrow> closed s; \<And>s. s \<in> insert x F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> (insert x F)) f
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f
?s \<in> insert x F \<Longrightarrow> closed ?s
?s \<in> insert x F \<Longrightarrow> continuous_on ?s f

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f; \<And>s. s \<in> insert x F \<Longrightarrow> closed s; \<And>s. s \<in> insert x F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> (insert x F)) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
\<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f
?s \<in> insert x F \<Longrightarrow> closed ?s
?s \<in> insert x F \<Longrightarrow> continuous_on ?s f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f
?s \<in> insert x F \<Longrightarrow> closed ?s
?s \<in> insert x F \<Longrightarrow> continuous_on ?s f

goal (1 subgoal):
 1. continuous_on (\<Union> (insert x F)) f
[PROOF STEP]
using continuous_on_closed_Un closed_Union
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>s. s \<in> F \<Longrightarrow> closed s; \<And>s. s \<in> F \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> F) f
?s \<in> insert x F \<Longrightarrow> closed ?s
?s \<in> insert x F \<Longrightarrow> continuous_on ?s f
\<lbrakk>closed ?s; closed ?t; continuous_on ?s ?f; continuous_on ?t ?f\<rbrakk> \<Longrightarrow> continuous_on (?s \<union> ?t) ?f
\<lbrakk>finite ?S; \<forall>T\<in>?S. closed T\<rbrakk> \<Longrightarrow> closed (\<Union> ?S)

goal (1 subgoal):
 1. continuous_on (\<Union> (insert x F)) f
[PROOF STEP]
by (simp add: closed_Union continuous_on_closed_Un)
[PROOF STATE]
proof (state)
this:
continuous_on (\<Union> (insert x F)) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma delete_edges_set_edges: "set (edgesL (delete_edges G E)) = set (edgesL G) - set E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (edgesL (FiniteListGraph.delete_edges G E)) = set (edgesL G) - set E
[PROOF STEP]
by (induction E arbitrary: G) (auto simp: delete_edge_def delete_edge_set_nodes)


[STATEMENT]
lemma isDiagonal_diagonal_to_Smith_aux:
  assumes diag_A: "isDiagonal A" and k: "k < min (nrows A) (ncols A)"
  shows "isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout)
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k < min (nrows A) (ncols A)

goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout)
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<0] bezout)
 2. \<And>k. \<lbrakk>k < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout); Suc k < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < min (nrows A) (ncols A)

goal (2 subgoals):
 1. 0 < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<0] bezout)
 2. \<And>k. \<lbrakk>k < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout); Suc k < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < min (nrows A) (ncols A)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < min (nrows A) (ncols A)

goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith_aux A [0..<0] bezout)
[PROOF STEP]
using diag_A
[PROOF STATE]
proof (prove)
using this:
0 < min (nrows A) (ncols A)
isDiagonal A

goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith_aux A [0..<0] bezout)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isDiagonal (diagonal_to_Smith_aux A [0..<0] bezout)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout); Suc k < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout); Suc k < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
k < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout)
Suc k < min (nrows A) (ncols A)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout); Suc k < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)
[PROOF STEP]
have "Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = 0"
    if a_not_b: "to_nat a \<noteq> to_nat b" for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)
[PROOF STEP]
have "Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b
      = (diagonal_to_Smith_aux A [0..<k] bezout) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = diagonal_to_Smith_aux A [0..<k] bezout $ a $ b
[PROOF STEP]
by (rule diagonal_to_Smith_row_i_preserves_previous[OF ib _ a_not_b], insert Suc.prems, auto)
[PROOF STATE]
proof (state)
this:
Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = diagonal_to_Smith_aux A [0..<k] bezout $ a $ b

goal (1 subgoal):
 1. Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = diagonal_to_Smith_aux A [0..<k] bezout $ a $ b

goal (1 subgoal):
 1. Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_to_Smith_aux A [0..<k] bezout $ a $ b = (0::'a)
[PROOF STEP]
by (rule isDiagonal[OF Suc.hyps a_not_b], insert Suc.prems, auto)
[PROOF STATE]
proof (state)
this:
diagonal_to_Smith_aux A [0..<k] bezout $ a $ b = (0::'a)

goal (1 subgoal):
 1. Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)

goal (1 subgoal):
 1. Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ a $ b = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
to_nat ?a \<noteq> to_nat ?b \<Longrightarrow> Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ ?a $ ?b = (0::'a)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < min (nrows A) (ncols A) \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<k] bezout); Suc k < min (nrows A) (ncols A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
to_nat ?a \<noteq> to_nat ?b \<Longrightarrow> Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ ?a $ ?b = (0::'a)

goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)
[PROOF STEP]
unfolding isDiagonal_def
[PROOF STATE]
proof (prove)
using this:
to_nat ?a \<noteq> to_nat ?b \<Longrightarrow> Diagonal_to_Smith_row_i (diagonal_to_Smith_aux A [0..<k] bezout) k bezout $ ?a $ ?b = (0::'a)

goal (1 subgoal):
 1. \<forall>a b. to_nat a \<noteq> to_nat b \<longrightarrow> diagonal_to_Smith_aux A [0..<Suc k] bezout $ a $ b = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isDiagonal (diagonal_to_Smith_aux A [0..<Suc k] bezout)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_abs_converges_norm_iff':
  fixes f :: "'a :: {nat_power_normed_field,banach} fds"
  shows "fds_abs_converges (fds_norm f) s \<longleftrightarrow> fds_abs_converges f (of_real s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges (fds_norm f) s = fds_abs_converges f (of_real s)
[PROOF STEP]
unfolding fds_abs_converges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth (fds_norm f) n / nat_power n s)) = summable (\<lambda>n. norm (fds_nth f n / nat_power n (of_real s)))
[PROOF STEP]
by (rule summable_cong [OF eventually_mono[OF eventually_gt_at_top[of 0]]])
     (simp add: fds_abs_converges_def fds_norm_def fds_nth_fds' norm_divide norm_nat_power)


[STATEMENT]
lemma PiE_choice: "(\<exists>f\<in>Pi\<^sub>E I F. \<forall>i\<in>I. P i (f i)) \<longleftrightarrow> (\<forall>i\<in>I. \<exists>x\<in>F i. P i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>f\<in>Pi\<^sub>E I F. \<forall>i\<in>I. P i (f i)) = (\<forall>i\<in>I. \<exists>x\<in>F i. P i x)
[PROOF STEP]
by (auto simp: Bex_def PiE_iff Ball_def dest!: choice_iff'[THEN iffD1])
     (force intro: exI[of _ "restrict f I" for f])


[STATEMENT]
lemma sH_orbit: "\<^bold>{P\<^bold>} ({(s,s') | s s'. s' \<in> \<gamma>\<^sup>\<phi> s}) \<^bold>{Q\<^bold>} = (\<forall>s \<in> S. P s \<longrightarrow> (\<forall> t \<in> T. Q (\<phi> t s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>{P\<^bold>}{(s, s') |s s'. s' \<in> \<gamma>\<^sup>\<phi> s}\<^bold>{Q\<^bold>} = (\<forall>s\<in>S. P s \<longrightarrow> (\<forall>t\<in>T. Q (\<phi> t s)))
[PROOF STEP]
using sH_g_ode
[PROOF STATE]
proof (prove)
using this:
\<^bold>{?P\<^bold>}x\<acute>=\<lambda>t. f & ?G on \<lambda>s. T S @ 0\<^bold>{?Q\<^bold>} = (\<forall>s\<in>S. ?P s \<longrightarrow> (\<forall>t\<in>T. (\<forall>\<tau>\<in>down T t. ?G (\<phi> \<tau> s)) \<longrightarrow> ?Q (\<phi> t s)))

goal (1 subgoal):
 1. \<^bold>{P\<^bold>}{(s, s') |s s'. s' \<in> \<gamma>\<^sup>\<phi> s}\<^bold>{Q\<^bold>} = (\<forall>s\<in>S. P s \<longrightarrow> (\<forall>t\<in>T. Q (\<phi> t s)))
[PROOF STEP]
unfolding orbit_def g_ode_def
[PROOF STATE]
proof (prove)
using this:
\<^bold>{?P\<^bold>}{(s, s') |s s'. s' \<in> g_orbital (\<lambda>t. f) ?G (\<lambda>s. T) S 0 s}\<^bold>{?Q\<^bold>} = (\<forall>s\<in>S. ?P s \<longrightarrow> (\<forall>t\<in>T. (\<forall>\<tau>\<in>down T t. ?G (\<phi> \<tau> s)) \<longrightarrow> ?Q (\<phi> t s)))

goal (1 subgoal):
 1. \<^bold>{P\<^bold>}{(s, s') |s s'. s' \<in> g_orbital (\<lambda>t. f) (\<lambda>s. True) (\<lambda>s. T) S 0 s}\<^bold>{Q\<^bold>} = (\<forall>s\<in>S. P s \<longrightarrow> (\<forall>t\<in>T. Q (\<phi> t s)))
[PROOF STEP]
by auto


[STATEMENT]
lemma basic_mat_mult_code[code]: "basic_mat_mult A B = mat (dim_row A) (dim_col B) (\<lambda> (i,j). row A i \<bullet> col B j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basic_mat_mult A B = mat (dim_row A) (dim_col B) (\<lambda>(i, j). row A i \<bullet> col B j)
[PROOF STEP]
unfolding basic_mat_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = mat (dim_row A) (dim_col B) (\<lambda>(i, j). row A i \<bullet> col B j)
[PROOF STEP]
by auto


[STATEMENT]
lemma exists_linear_eq_matrix':
  fixes A::"'a::{field}^'m^'n" and X::"'a^'m^'m" and Y::"'a^'n^'n"
  assumes basis_X: "is_basis (set_of_vector X)" and basis_Y: "is_basis (set_of_vector Y)"
  shows "\<exists>f. matrix' X Y f = A \<and> linear ((*s)) ((*s)) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f
[PROOF STEP]
define f where "f v = sum (\<lambda>j. A $ j $ (THE k. v = X $ k) *s Y $ j) UNIV" for v
[PROOF STATE]
proof (state)
this:
f ?v = (\<Sum>j\<in>UNIV. A $ j $ (THE k. ?v = X $ k) *s Y $ j)

goal (1 subgoal):
 1. \<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f
[PROOF STEP]
have indep: "vec.independent (set_of_vector X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (set_of_vector X)
[PROOF STEP]
using basis_X
[PROOF STATE]
proof (prove)
using this:
is_basis (set_of_vector X)

goal (1 subgoal):
 1. vec.independent (set_of_vector X)
[PROOF STEP]
unfolding is_basis_def
[PROOF STATE]
proof (prove)
using this:
vec.independent (set_of_vector X) \<and> vec.span (set_of_vector X) = UNIV

goal (1 subgoal):
 1. vec.independent (set_of_vector X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec.independent (set_of_vector X)

goal (1 subgoal):
 1. \<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f
[PROOF STEP]
define g where "g = vec.construct (set_of_vector X) f"
[PROOF STATE]
proof (state)
this:
g = vec.construct (set_of_vector X) f

goal (1 subgoal):
 1. \<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f
[PROOF STEP]
have linear_g: "linear ((*s)) ((*s)) g" and f_eq_g: "(\<forall>x \<in> (set_of_vector X). g x = f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (*s) (*s) g &&& \<forall>x\<in>set_of_vector X. g x = f x
[PROOF STEP]
using vec.linear_construct[OF indep] vec.construct_basis[OF indep]
[PROOF STATE]
proof (prove)
using this:
linear (*s) (*s) (vec.construct (set_of_vector X) ?f)
?b \<in> set_of_vector X \<Longrightarrow> vec.construct (set_of_vector X) ?f ?b = ?f ?b

goal (1 subgoal):
 1. linear (*s) (*s) g &&& \<forall>x\<in>set_of_vector X. g x = f x
[PROOF STEP]
unfolding g_def module_hom_iff_linear
[PROOF STATE]
proof (prove)
using this:
linear (*s) (*s) (vec.construct (set_of_vector X) ?f)
?b \<in> set_of_vector X \<Longrightarrow> vec.construct (set_of_vector X) ?f ?b = ?f ?b

goal (1 subgoal):
 1. linear (*s) (*s) (vec.construct (set_of_vector X) f) &&& \<forall>x\<in>set_of_vector X. vec.construct (set_of_vector X) f x = f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
linear (*s) (*s) g
\<forall>x\<in>set_of_vector X. g x = f x

goal (1 subgoal):
 1. \<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f
[PROOF STEP]
proof (rule exI[of _ g], rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. matrix' X Y g = A
 2. linear (*s) (*s) g
[PROOF STEP]
show "matrix' X Y g = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix' X Y g = A
[PROOF STEP]
proof (rule matrix'2)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. is_basis (set_of_vector X)
 2. is_basis (set_of_vector Y)
 3. \<forall>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
show "is_basis (set_of_vector X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_basis (set_of_vector X)
[PROOF STEP]
using basis_X
[PROOF STATE]
proof (prove)
using this:
is_basis (set_of_vector X)

goal (1 subgoal):
 1. is_basis (set_of_vector X)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
is_basis (set_of_vector X)

goal (2 subgoals):
 1. is_basis (set_of_vector Y)
 2. \<forall>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
show "is_basis (set_of_vector Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_basis (set_of_vector Y)
[PROOF STEP]
using basis_Y
[PROOF STATE]
proof (prove)
using this:
is_basis (set_of_vector Y)

goal (1 subgoal):
 1. is_basis (set_of_vector Y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
is_basis (set_of_vector Y)

goal (1 subgoal):
 1. \<forall>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
show "\<forall>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
proof (clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
have the_k_eq_i: "(THE k. X $ i = X $ k) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE k. X $ i = X $ k) = i
[PROOF STEP]
proof (rule the_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. X $ i = X $ i
 2. \<And>k. X $ i = X $ k \<Longrightarrow> k = i
[PROOF STEP]
show "X $ i = X $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X $ i = X $ i
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
X $ i = X $ i

goal (1 subgoal):
 1. \<And>k. X $ i = X $ k \<Longrightarrow> k = i
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. X $ i = X $ k \<Longrightarrow> k = i
[PROOF STEP]
assume Xi_Xk: "X $ i = X $ k"
[PROOF STATE]
proof (state)
this:
X $ i = X $ k

goal (1 subgoal):
 1. \<And>k. X $ i = X $ k \<Longrightarrow> k = i
[PROOF STEP]
show "k = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = i
[PROOF STEP]
using Xi_Xk basis_X inj_eq inj_op_nth
[PROOF STATE]
proof (prove)
using this:
X $ i = X $ k
is_basis (set_of_vector X)
inj ?f \<Longrightarrow> (?f ?x = ?f ?y) = (?x = ?y)
is_basis (set_of_vector ?X) \<Longrightarrow> inj (($) ?X)

goal (1 subgoal):
 1. k = i
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
k = i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(THE k. X $ i = X $ k) = i

goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
have Xi_in_X:"X$i \<in> (set_of_vector X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X $ i \<in> set_of_vector X
[PROOF STEP]
unfolding set_of_vector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X $ i \<in> {X $ i |i. i \<in> UNIV}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X $ i \<in> set_of_vector X

goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
have "g (X$i) = f (X$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (X $ i) = f (X $ i)
[PROOF STEP]
using f_eq_g Xi_in_X
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set_of_vector X. g x = f x
X $ i \<in> set_of_vector X

goal (1 subgoal):
 1. g (X $ i) = f (X $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g (X $ i) = f (X $ i)

goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g (X $ i) = f (X $ i)

goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
have "... = (\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j) = (\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j)

goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j)

goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
have "... = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
unfolding the_k_eq_i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>UNIV. A $ j $ (THE k. X $ i = X $ k) *s Y $ j) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)

goal (1 subgoal):
 1. \<And>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
show "g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s  Y $ j)"
[PROOF STATE]
proof (prove)
using this:
g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)

goal (1 subgoal):
 1. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i. g (X $ i) = (\<Sum>j\<in>UNIV. A $ j $ i *s Y $ j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
matrix' X Y g = A

goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
show "linear ((*s)) ((*s)) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
using linear_g
[PROOF STATE]
proof (prove)
using this:
linear (*s) (*s) g

goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
linear (*s) (*s) g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f. matrix' X Y f = A \<and> linear (*s) (*s) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_vector_mult_0 [simp]: "0 *v w = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 *v w = 0
[PROOF STEP]
by (simp add: matrix_vector_mult_def vec_eq_iff)


[STATEMENT]
lemma rtrancl_Un2_separatorE:
  "B O A = {} \<Longrightarrow> (A \<union> B)\<^sup>* = A\<^sup>* \<union> A\<^sup>* O B\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B O A = {} \<Longrightarrow> (A \<union> B)\<^sup>* = A\<^sup>* \<union> A\<^sup>* O B\<^sup>*
[PROOF STEP]
by (metis R_O_Id empty_subsetI relcomp_distrib rtrancl_U_push rtrancl_reflcl_absorb sup_commute)


[STATEMENT]
lemma sqrt_rat_floor_code[code]: "sqrt_rat_floor x = (case quotient_of x of (a,b) \<Rightarrow> sqrt_int_floor (a * b) div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_rat_floor x = (case quotient_of x of (a, b) \<Rightarrow> sqrt_int_floor (a * b) div b)
[PROOF STEP]
unfolding sqrt_rat_floor_def root_rat_floor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case quotient_of x of (a, b) \<Rightarrow> root_int_floor 2 (a * b ^ (2 - 1)) div b) = (case quotient_of x of (a, b) \<Rightarrow> sqrt_int_floor (a * b) div b)
[PROOF STEP]
by (simp add: sqrt_def)


[STATEMENT]
lemma lsu_lax: "\<nu>\<^sup>\<natural> (x::'a::unital_quantale) \<cdot> \<nu>\<^sup>\<natural> y \<le> \<nu>\<^sup>\<natural> (x \<cdot> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu>\<^sup>\<natural> x \<cdot> \<nu>\<^sup>\<natural> y \<le> \<nu>\<^sup>\<natural> (x \<cdot> y)
[PROOF STEP]
unfolding lsu_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<top> \<rightarrow> x) \<cdot> (\<top> \<rightarrow> y) \<le> \<top> \<rightarrow> x \<cdot> y
[PROOF STEP]
by (meson bres_canc1 bres_galois bres_interchange le_top order_trans)


[STATEMENT]
lemma word_le_minus_mono_left: "y \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> y - x \<le> z - x"
  for x y z :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<le> z; x \<le> y\<rbrakk> \<Longrightarrow> y - x \<le> z - x
[PROOF STEP]
by uint_arith


[STATEMENT]
lemma Card_lt_csucc_iff: "\<lbrakk>Card \<kappa>'; Card \<kappa>\<rbrakk> \<Longrightarrow> (\<kappa>' < csucc \<kappa>) = (\<kappa>' \<le> \<kappa>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Card \<kappa>'; Card \<kappa>\<rbrakk> \<Longrightarrow> (\<kappa>' < csucc \<kappa>) = (\<kappa>' \<le> \<kappa>)
[PROOF STEP]
by (simp add: lt_csucc_iff Card_cardinal_eq Card_is_Ord)


[STATEMENT]
lemma set_butlast_distinct_conv:
      "\<lbrakk>distinct l\<rbrakk> \<Longrightarrow> set (butlast l) = set l - {last l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct l \<Longrightarrow> set (butlast l) = set l - {last l}
[PROOF STEP]
by (cases l rule: rev_cases; auto)


[STATEMENT]
lemma mult_le_mono_hmset: "i \<le> j \<Longrightarrow> k \<le> l \<Longrightarrow> i * k \<le> j * l" for i j k l :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; k \<le> l\<rbrakk> \<Longrightarrow> i * k \<le> j * l
[PROOF STEP]
by (simp add: mult_mono)


[STATEMENT]
lemma imult_ile_mono2: "(i::enat) \<le> j \<Longrightarrow> k * i \<le> k * j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> k * i \<le> k * j
[PROOF STEP]
by (rule imult_ile_mono[OF order_refl])


[STATEMENT]
lemma DERIV_sum[derivative_intros]:
  "(\<And> n. n \<in> S \<Longrightarrow> ((\<lambda>x. f x n) has_field_derivative (f' x n)) F) \<Longrightarrow>
    ((\<lambda>x. sum (f x) S) has_field_derivative sum (f' x) S) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. n \<in> S \<Longrightarrow> ((\<lambda>x. f x n) has_field_derivative f' x n) F) \<Longrightarrow> ((\<lambda>x. sum (f x) S) has_field_derivative sum (f' x) S) F
[PROOF STEP]
by (rule has_derivative_imp_has_field_derivative [OF has_derivative_sum])
     (auto simp: sum_distrib_left mult_commute_abs dest: has_field_derivative_imp_has_derivative)


[STATEMENT]
lemma (in group) subgroup_incl:
  assumes "subgroup I G" and "subgroup J G" and "I \<subseteq> J"
  shows "subgroup I (G \<lparr> carrier := J \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup I (G\<lparr>carrier := J\<rparr>)
[PROOF STEP]
using group.group_incl_imp_subgroup[of "G \<lparr> carrier := J \<rparr>" I]
        assms(1-2)[THEN subgroup.subgroup_is_group[OF _ group_axioms]] assms(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Group.group (G\<lparr>carrier := J\<rparr>); I \<subseteq> carrier (G\<lparr>carrier := J\<rparr>); Group.group (G\<lparr>carrier := J, carrier := I\<rparr>)\<rbrakk> \<Longrightarrow> subgroup I (G\<lparr>carrier := J\<rparr>)
Group.group (G\<lparr>carrier := I\<rparr>)
Group.group (G\<lparr>carrier := J\<rparr>)
I \<subseteq> J

goal (1 subgoal):
 1. subgroup I (G\<lparr>carrier := J\<rparr>)
[PROOF STEP]
by auto


[STATEMENT]
lemma knights_path_board_m_n_geq_1: "knights_path (board n m) ps \<Longrightarrow> min n m \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> 1 \<le> min n m
[PROOF STEP]
unfolding board_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knights_path {(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m} ps \<Longrightarrow> 1 \<le> min n m
[PROOF STEP]
using knights_path_board_non_empty
[PROOF STATE]
proof (prove)
using this:
knights_path ?b ?ps \<Longrightarrow> ?b \<noteq> {}

goal (1 subgoal):
 1. knights_path {(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m} ps \<Longrightarrow> 1 \<le> min n m
[PROOF STEP]
by fastforce