[STATEMENT]
lemma simplicial_imp_singular_chain:
   "simplicial_chain p S c
      \<Longrightarrow> singular_chain p (subtopology (powertop_real UNIV) S) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_chain p S c \<Longrightarrow> singular_chain p (subtopology (powertop_real UNIV) S) c
[PROOF STEP]
unfolding simplicial_chain_def singular_chain_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly_Mapping.keys c \<subseteq> Collect (simplicial_simplex p S) \<Longrightarrow> Poly_Mapping.keys c \<subseteq> singular_simplex_set p (subtopology (powertop_real UNIV) S)
[PROOF STEP]
by (auto intro: simplicial_imp_singular_simplex)


[STATEMENT]
lemma divide_left_mono:
  "b \<le> a \<Longrightarrow> 0 \<le> c \<Longrightarrow> 0 < a*b \<Longrightarrow> c / a \<le> c / b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<le> a; (0::'a) \<le> c; (0::'a) < a * b\<rbrakk> \<Longrightarrow> c / a \<le> c / b
[PROOF STEP]
using local.divide_cancel_left local.divide_strict_left_mono local.dual_order.order_iff_strict
[PROOF STATE]
proof (prove)
using this:
(?c / ?a = ?c / ?b) = (?c = (0::'a) \<or> ?a = ?b)
\<lbrakk>?b < ?a; (0::'a) < ?c; (0::'a) < ?a * ?b\<rbrakk> \<Longrightarrow> ?c / ?a < ?c / ?b
(?b \<le> ?a) = (?b < ?a \<or> ?a = ?b)

goal (1 subgoal):
 1. \<lbrakk>b \<le> a; (0::'a) \<le> c; (0::'a) < a * b\<rbrakk> \<Longrightarrow> c / a \<le> c / b
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_eqI: "(\<And>n. coeff p n = coeff q n) \<Longrightarrow> p = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. coeff p n = coeff q n) \<Longrightarrow> p = q
[PROOF STEP]
by (simp add: poly_eq_iff)


[STATEMENT]
lemma count_list_upt [simp]: "count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
proof (cases "a \<le> b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
 2. \<not> a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
 2. \<not> a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<le> b
[PROOF STEP]
obtain k where "b = a + k"
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. (\<And>k. b = a + k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using le_Suc_ex
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n

goal (1 subgoal):
 1. (\<And>k. b = a + k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b = a + k

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
 2. \<not> a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
unfolding \<open>b = a + k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list [a..<a + k] x = (if a \<le> x \<and> x < a + k then 1 else 0)
[PROOF STEP]
by (induct k, simp_all)
[PROOF STATE]
proof (state)
this:
count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> a \<le> b

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> a \<le> b

goal (1 subgoal):
 1. count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count_list [a..<b] x = (if a \<le> x \<and> x < b then 1 else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_nhds_top:
  fixes P :: "'a :: {order_top,linorder_topology} \<Rightarrow> bool"
    and b :: 'a
  assumes "b < top"
  shows "eventually P (nhds top) \<longleftrightarrow> (\<exists>b<top. (\<forall>z. b < z \<longrightarrow> P z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (nhds top) = (\<exists>b<top. \<forall>z>b. P z)
[PROOF STEP]
unfolding eventually_nhds
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>S. open S \<and> top \<in> S \<and> Ball S P) = (\<exists>b<top. \<forall>z>b. P z)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>open S; top \<in> S; Ball S P\<rbrakk> \<Longrightarrow> \<exists>b<top. \<forall>z>b. P z
 2. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
fix S :: "'a set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>open S; top \<in> S; Ball S P\<rbrakk> \<Longrightarrow> \<exists>b<top. \<forall>z>b. P z
 2. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
assume "open S" "top \<in> S"
[PROOF STATE]
proof (state)
this:
open S
top \<in> S

goal (2 subgoals):
 1. \<And>S. \<lbrakk>open S; top \<in> S; Ball S P\<rbrakk> \<Longrightarrow> \<exists>b<top. \<forall>z>b. P z
 2. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
note open_left[OF this \<open>b < top\<close>]
[PROOF STATE]
proof (state)
this:
\<exists>b<top. {b<..top} \<subseteq> S

goal (2 subgoals):
 1. \<And>S. \<lbrakk>open S; top \<in> S; Ball S P\<rbrakk> \<Longrightarrow> \<exists>b<top. \<forall>z>b. P z
 2. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>b<top. {b<..top} \<subseteq> S

goal (2 subgoals):
 1. \<And>S. \<lbrakk>open S; top \<in> S; Ball S P\<rbrakk> \<Longrightarrow> \<exists>b<top. \<forall>z>b. P z
 2. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
assume "\<forall>s\<in>S. P s"
[PROOF STATE]
proof (state)
this:
\<forall>s\<in>S. P s

goal (2 subgoals):
 1. \<And>S. \<lbrakk>open S; top \<in> S; Ball S P\<rbrakk> \<Longrightarrow> \<exists>b<top. \<forall>z>b. P z
 2. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>b<top. {b<..top} \<subseteq> S
\<forall>s\<in>S. P s
[PROOF STEP]
show "\<exists>b<top. \<forall>z>b. P z"
[PROOF STATE]
proof (prove)
using this:
\<exists>b<top. {b<..top} \<subseteq> S
\<forall>s\<in>S. P s

goal (1 subgoal):
 1. \<exists>b<top. \<forall>z>b. P z
[PROOF STEP]
by (auto simp: subset_eq Ball_def)
[PROOF STATE]
proof (state)
this:
\<exists>b<top. \<forall>z>b. P z

goal (1 subgoal):
 1. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
assume "b < top" "\<forall>z>b. P z"
[PROOF STATE]
proof (state)
this:
b < top
\<forall>z>b. P z

goal (1 subgoal):
 1. \<And>b. \<lbrakk>b < top; \<forall>z>b. P z\<rbrakk> \<Longrightarrow> \<exists>S. open S \<and> top \<in> S \<and> Ball S P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b < top
\<forall>z>b. P z
[PROOF STEP]
show "\<exists>S. open S \<and> top \<in> S \<and> (\<forall>xa\<in>S. P xa)"
[PROOF STATE]
proof (prove)
using this:
b < top
\<forall>z>b. P z

goal (1 subgoal):
 1. \<exists>S. open S \<and> top \<in> S \<and> (\<forall>xa\<in>S. P xa)
[PROOF STEP]
by (intro exI[of _ "{b <..}"]) auto
[PROOF STATE]
proof (state)
this:
\<exists>S. open S \<and> top \<in> S \<and> (\<forall>xa\<in>S. P xa)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quot_of_fract_to_fract [simp]: "quot_of_fract (to_fract x) = (x, 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_of_fract (to_fract x) = (x, 1::'a)
[PROOF STEP]
unfolding to_fract_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_of_fract (Fraction_Field.Fract x (1::'a)) = (x, 1::'a)
[PROOF STEP]
by transfer (simp add: normalize_quot_def)


[STATEMENT]
lemma digit_wise_block_subtractivity:
  fixes c
  defines "b \<equiv> 2 ^ Suc c"
  assumes yltx_digits: "\<forall>t'. nth_digit y t' b \<le> nth_digit x t' b"
      and "k\<le>c"
      and "c>0"
  shows "nth_digit (x-y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
have x: "nth_digit x t b \<exclamdown> k = x \<exclamdown> (Suc c * t + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit x t b \<exclamdown> k = x \<exclamdown> (Suc c * t + k)
[PROOF STEP]
using digit_gen_pow2_reduct[of "k" "Suc c" "x" "t"] b_def `k\<le>c`
[PROOF STATE]
proof (prove)
using this:
k < Suc c \<Longrightarrow> nth_digit x t (2 ^ Suc c) \<exclamdown> k = x \<exclamdown> (Suc c * t + k)
b \<equiv> 2 ^ Suc c
k \<le> c

goal (1 subgoal):
 1. nth_digit x t b \<exclamdown> k = x \<exclamdown> (Suc c * t + k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nth_digit x t b \<exclamdown> k = x \<exclamdown> (Suc c * t + k)

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
have y: "nth_digit y t b \<exclamdown> k = y \<exclamdown> (Suc c * t + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit y t b \<exclamdown> k = y \<exclamdown> (Suc c * t + k)
[PROOF STEP]
using digit_gen_pow2_reduct[of "k" "Suc c" "y" "t"] b_def `k\<le>c`
[PROOF STATE]
proof (prove)
using this:
k < Suc c \<Longrightarrow> nth_digit y t (2 ^ Suc c) \<exclamdown> k = y \<exclamdown> (Suc c * t + k)
b \<equiv> 2 ^ Suc c
k \<le> c

goal (1 subgoal):
 1. nth_digit y t b \<exclamdown> k = y \<exclamdown> (Suc c * t + k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nth_digit y t b \<exclamdown> k = y \<exclamdown> (Suc c * t + k)

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
have "b > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < b
[PROOF STEP]
using `c>0` b_def
[PROOF STATE]
proof (prove)
using this:
0 < c
b \<equiv> 2 ^ Suc c

goal (1 subgoal):
 1. 1 < b
[PROOF STEP]
by (metis Suc_1 lessI power_gt1)
[PROOF STATE]
proof (state)
this:
1 < b

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < b
[PROOF STEP]
have yltx: "y \<le> x"
[PROOF STATE]
proof (prove)
using this:
1 < b

goal (1 subgoal):
 1. y \<le> x
[PROOF STEP]
using digitwise_leq yltx_digits
[PROOF STATE]
proof (prove)
using this:
1 < b
\<lbrakk>1 < ?b; \<forall>t. nth_digit ?x t ?b \<le> nth_digit ?y t ?b\<rbrakk> \<Longrightarrow> ?x \<le> ?y
\<forall>t'. nth_digit y t' b \<le> nth_digit x t' b

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

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
have "(nth_digit x t b - nth_digit y t b) \<exclamdown> k
      = ((nth_digit x t b) \<exclamdown> k + (nth_digit y t b) \<exclamdown> k
        + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nth_digit x t b - nth_digit y t b) \<exclamdown> k = (nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2
[PROOF STEP]
using dif_digit_formula yltx_digits
[PROOF STATE]
proof (prove)
using this:
?b \<le> ?a \<longrightarrow> (?a - ?b) \<exclamdown> ?k = (?a \<exclamdown> ?k + ?b \<exclamdown> ?k + bin_narry ?a ?b ?k) mod 2
\<forall>t'. nth_digit y t' b \<le> nth_digit x t' b

goal (1 subgoal):
 1. (nth_digit x t b - nth_digit y t b) \<exclamdown> k = (nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(nth_digit x t b - nth_digit y t b) \<exclamdown> k = (nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(nth_digit x t b - nth_digit y t b) \<exclamdown> k = (nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
have "... = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k)
                    + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
nth_digit x t b \<exclamdown> k = x \<exclamdown> (Suc c * t + k)
nth_digit y t b \<exclamdown> k = y \<exclamdown> (Suc c * t + k)

goal (1 subgoal):
 1. (nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(nth_digit x t b \<exclamdown> k + nth_digit y t b \<exclamdown> k + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
have "... = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k)
                    + bin_narry x y (Suc c * t + k)) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2
[PROOF STEP]
using narry_gen_pow2_reduct
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?c; \<forall>t'. nth_digit ?y t' (2 ^ Suc ?c) \<le> nth_digit ?x t' (2 ^ Suc ?c); ?k \<le> ?c\<rbrakk> \<Longrightarrow> bin_narry (nth_digit ?x ?t (2 ^ Suc ?c)) (nth_digit ?y ?t (2 ^ Suc ?c)) ?k = bin_narry ?x ?y (Suc ?c * ?t + ?k)

goal (1 subgoal):
 1. (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2
[PROOF STEP]
using assms(3) assms(4) b_def yltx_digits
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?c; \<forall>t'. nth_digit ?y t' (2 ^ Suc ?c) \<le> nth_digit ?x t' (2 ^ Suc ?c); ?k \<le> ?c\<rbrakk> \<Longrightarrow> bin_narry (nth_digit ?x ?t (2 ^ Suc ?c)) (nth_digit ?y ?t (2 ^ Suc ?c)) ?k = bin_narry ?x ?y (Suc ?c * ?t + ?k)
k \<le> c
0 < c
b \<equiv> 2 ^ Suc c
\<forall>t'. nth_digit y t' b \<le> nth_digit x t' b

goal (1 subgoal):
 1. (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry (nth_digit x t b) (nth_digit y t b) k) mod 2 = (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
have "... = nth_digit (x-y) t b \<exclamdown> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2 = nth_digit (x - y) t b \<exclamdown> k
[PROOF STEP]
using digit_gen_pow2_reduct[of "k" "Suc c" "x-y" "t"] b_def `k\<le>c` dif_digit_formula yltx
[PROOF STATE]
proof (prove)
using this:
k < Suc c \<Longrightarrow> nth_digit (x - y) t (2 ^ Suc c) \<exclamdown> k = (x - y) \<exclamdown> (Suc c * t + k)
b \<equiv> 2 ^ Suc c
k \<le> c
?b \<le> ?a \<longrightarrow> (?a - ?b) \<exclamdown> ?k = (?a \<exclamdown> ?k + ?b \<exclamdown> ?k + bin_narry ?a ?b ?k) mod 2
y \<le> x

goal (1 subgoal):
 1. (x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2 = nth_digit (x - y) t b \<exclamdown> k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x \<exclamdown> (Suc c * t + k) + y \<exclamdown> (Suc c * t + k) + bin_narry x y (Suc c * t + k)) mod 2 = nth_digit (x - y) t b \<exclamdown> k

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(nth_digit x t b - nth_digit y t b) \<exclamdown> k = nth_digit (x - y) t b \<exclamdown> k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(nth_digit x t b - nth_digit y t b) \<exclamdown> k = nth_digit (x - y) t b \<exclamdown> k

goal (1 subgoal):
 1. nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nth_digit (x - y) t b \<exclamdown> k = (nth_digit x t b - nth_digit y t b) \<exclamdown> k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspace_dual_S: "subspace (dual_space S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace (dual_space S)
[PROOF STEP]
apply (rule subspace_dual_space)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace S
[PROOF STEP]
apply (rule local.vs1.subspace)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_le2:
  fixes y::V assumes "x \<noteq> 0" "y \<noteq> 0" "y \<noteq> 1" shows "x \<sqsubset> x * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubset> x * y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqsubset> x * y
[PROOF STEP]
obtain v where v: "v \<in> elts y" "v \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> elts y; v \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0
y \<noteq> 0
y \<noteq> 1

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> elts y; v \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
v \<in> elts y
v \<noteq> 0

goal (1 subgoal):
 1. x \<sqsubset> x * y
[PROOF STEP]
have "x \<noteq> x * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> x * y
[PROOF STEP]
using lift_lemma [of x v]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<noteq> 0; v \<noteq> 0\<rbrakk> \<Longrightarrow> \<not> lift (x * v) x \<le> x

goal (1 subgoal):
 1. x \<noteq> x * y
[PROOF STEP]
by (metis \<open>x \<noteq> 0\<close> bdd_above_iff_small cSUP_upper2 order_refl replacement small_elts mult v)
[PROOF STATE]
proof (state)
this:
x \<noteq> x * y

goal (1 subgoal):
 1. x \<sqsubset> x * y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> x * y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> x * y

goal (1 subgoal):
 1. x \<sqsubset> x * y
[PROOF STEP]
using assms mult_le1 [of y x]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> x * y
x \<noteq> 0
y \<noteq> 0
y \<noteq> 1
y \<noteq> 0 \<Longrightarrow> x \<sqsubseteq> x * y

goal (1 subgoal):
 1. x \<sqsubset> x * y
[PROOF STEP]
by (auto simp: le_TC_def)
[PROOF STATE]
proof (state)
this:
x \<sqsubset> x * y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_power_n_eq:
  fixes x::"'a :: idom"
  assumes "n\<noteq>0"
  shows "poly ([:-a,1:]^n) x=0 \<longleftrightarrow> (x=a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly ([:- a, 1::'a:] ^ n) x = (0::'a)) = (x = a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (poly ([:- a, 1::'a:] ^ n) x = (0::'a)) = (x = a)
[PROOF STEP]
by (induct n,auto)


[STATEMENT]
lemma antichain_eqI: "(\<And>b. b \<in>\<^sub>A A \<longleftrightarrow> b \<in>\<^sub>A B) \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. (b \<in>\<^sub>A A) = (b \<in>\<^sub>A B)) \<Longrightarrow> A = B
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma scaleR_left_le_one_le: "0 \<le> x \<Longrightarrow> a \<le> 1 \<Longrightarrow> a *\<^sub>R x \<le> x"
  for x :: "'a::ordered_real_vector" and a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> x; a \<le> 1\<rbrakk> \<Longrightarrow> a *\<^sub>R x \<le> x
[PROOF STEP]
using scaleR_right_mono[of a 1 x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> 1; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> a *\<^sub>R x \<le> 1 *\<^sub>R x

goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> x; a \<le> 1\<rbrakk> \<Longrightarrow> a *\<^sub>R x \<le> x
[PROOF STEP]
by simp


[STATEMENT]
lemma cinner_scaleR_right [simp]: "cinner x (scaleR r y) = of_real r * (cinner x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet>\<^sub>C r *\<^sub>R y = complex_of_real r * (x \<bullet>\<^sub>C y)
[PROOF STEP]
by (simp add: scaleR_scaleC)


[STATEMENT]
lemma M\<alpha>_Rel_arrow_rl_ArrVal_app[cat_cs_simps]:
  assumes "a_bc = \<langle>a, \<langle>b, c\<rangle>\<rangle>" and "a_bc \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> (B \<times>\<^sub>\<circ> C)"
  shows "M\<alpha>_Rel_arrow_rl A B C\<lparr>ArrVal\<rparr>\<lparr>a_bc\<rparr> = \<langle>\<langle>a, b\<rangle>, c\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_rl A B C\<lparr>ArrVal\<rparr>\<lparr>a_bc\<rparr> = \<langle>\<langle>a, b\<rangle>, c\<rangle>
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
a_bc \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<times>\<^sub>\<circ> C

goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_rl A B C\<lparr>ArrVal\<rparr>\<lparr>a_bc\<rparr> = \<langle>\<langle>a, b\<rangle>, c\<rangle>
[PROOF STEP]
unfolding assms(1)
[PROOF STATE]
proof (prove)
using this:
\<langle>a, b, c\<rangle> \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<times>\<^sub>\<circ> C

goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_rl A B C\<lparr>ArrVal\<rparr>\<lparr>\<langle>a, b, c\<rangle>\<rparr> = \<langle>\<langle>a, b\<rangle>, c\<rangle>
[PROOF STEP]
by (simp_all add: M\<alpha>_Rel_arrow_rl_ArrVal_app' nat_omega_simps)


[STATEMENT]
lemma card_ineq_aux_quadruples:
  assumes "finite A"
  shows "card (additive_quadruple_set A) \<le> (card A)^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
define f:: "'a \<times> 'a \<times> 'a \<times> 'a \<Rightarrow> 'a \<times> 'a \<times> 'a" where "f = (\<lambda> (a, b, c, d) . (a, b, c))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>(a, b, c, d). (a, b, c))

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
have hinj: "inj_on f {(a, b, c, d) | a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}
[PROOF STEP]
unfolding inj_on_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}. \<forall>y\<in>{(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}. (case x of (a, b, c, d) \<Rightarrow> (a, b, c)) = (case y of (a, b, c, d) \<Rightarrow> (a, b, c)) \<longrightarrow> x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on f {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on f {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
have himage: "f ` {(a, b, c, d) | a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(a, b, c, d). (a, b, c)) ` {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on f {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}
f ` {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A
[PROOF STEP]
have "card (additive_quadruple_set A) \<le> card ({(a, b, c, d) | a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A})"
[PROOF STATE]
proof (prove)
using this:
inj_on f {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}
f ` {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}
[PROOF STEP]
using card_mono inj_on_finite[of "f"] assms additive_quadruple_set_sub finite_SigmaI
[PROOF STATE]
proof (prove)
using this:
inj_on f {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}
f ` {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B
\<lbrakk>inj_on f ?A; f ` ?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
finite A
additive_quadruple_set ?A \<subseteq> {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> ?A \<and> b \<in> ?A \<and> c \<in> ?A \<and> d \<in> ?A}
\<lbrakk>finite ?A; \<And>a. a \<in> ?A \<Longrightarrow> finite (?B a)\<rbrakk> \<Longrightarrow> finite (Sigma ?A ?B)

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
card (additive_quadruple_set A) \<le> card {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (additive_quadruple_set A) \<le> card {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
have "... \<le> card (A \<times> A \<times> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<le> card (A \<times> A \<times> A)
[PROOF STEP]
using himage hinj assms card_inj_on_le finite_SigmaI
[PROOF STATE]
proof (prove)
using this:
f ` {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<subseteq> A \<times> A \<times> A
inj_on f {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A}
finite A
\<lbrakk>inj_on ?f ?A; ?f ` ?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B
\<lbrakk>finite ?A; \<And>a. a \<in> ?A \<Longrightarrow> finite (?B a)\<rbrakk> \<Longrightarrow> finite (Sigma ?A ?B)

goal (1 subgoal):
 1. card {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<le> card (A \<times> A \<times> A)
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
card {(a, b, c, d) |a b c d. d = a \<oplus> b \<ominus> c \<and> a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A} \<le> card (A \<times> A \<times> A)

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (additive_quadruple_set A) \<le> card (A \<times> A \<times> A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (additive_quadruple_set A) \<le> card (A \<times> A \<times> A)

goal (1 subgoal):
 1. card (additive_quadruple_set A) \<le> card A ^ 3
[PROOF STEP]
by (simp add: card_cartesian_product power3_eq_cube)
[PROOF STATE]
proof (state)
this:
card (additive_quadruple_set A) \<le> card A ^ 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DERIV_even_real_root:
  assumes n: "0 < n"
    and "even n"
    and x: "x < 0"
  shows "DERIV (root n) x :> inverse (- real n * root n x ^ (n - Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (root n has_real_derivative inverse (- real n * root n x ^ (n - Suc 0))) (at x)
[PROOF STEP]
proof (rule DERIV_inverse_function)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. (?f has_real_derivative - real n * root n x ^ (n - Suc 0)) (at (root n x))
 2. - real n * root n x ^ (n - Suc 0) \<noteq> 0
 3. ?a < x
 4. x < ?b
 5. \<And>y. \<lbrakk>?a < y; y < ?b\<rbrakk> \<Longrightarrow> ?f (root n y) = y
 6. isCont (root n) x
[PROOF STEP]
show "x - 1 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - 1 < x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - 1 < x

goal (5 subgoals):
 1. (?f has_real_derivative - real n * root n x ^ (n - Suc 0)) (at (root n x))
 2. - real n * root n x ^ (n - Suc 0) \<noteq> 0
 3. x < ?b
 4. \<And>y. \<lbrakk>x - 1 < y; y < ?b\<rbrakk> \<Longrightarrow> ?f (root n y) = y
 5. isCont (root n) x
[PROOF STEP]
show "x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 0
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x < 0

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

goal (4 subgoals):
 1. (?f has_real_derivative - real n * root n x ^ (n - Suc 0)) (at (root n x))
 2. - real n * root n x ^ (n - Suc 0) \<noteq> 0
 3. \<And>y. \<lbrakk>x - 1 < y; y < 0\<rbrakk> \<Longrightarrow> ?f (root n y) = y
 4. isCont (root n) x
[PROOF STEP]
show "- (root n y ^ n) = y" if "x - 1 < y" and "y < 0" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (root n y ^ n) = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (root n y ^ n) = y
[PROOF STEP]
have "root n (-y) ^ n = -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root n (- y) ^ n = - y
[PROOF STEP]
using that \<open>0 < n\<close>
[PROOF STATE]
proof (prove)
using this:
x - 1 < y
y < 0
0 < n

goal (1 subgoal):
 1. root n (- y) ^ n = - y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
root n (- y) ^ n = - y

goal (1 subgoal):
 1. - (root n y ^ n) = y
[PROOF STEP]
with real_root_minus and \<open>even n\<close>
[PROOF STATE]
proof (chain)
picking this:
root ?n (- ?x) = - root ?n ?x
even n
root n (- y) ^ n = - y
[PROOF STEP]
show "- (root n y ^ n) = y"
[PROOF STATE]
proof (prove)
using this:
root ?n (- ?x) = - root ?n ?x
even n
root n (- y) ^ n = - y

goal (1 subgoal):
 1. - (root n y ^ n) = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (root n y ^ n) = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>x - 1 < ?y; ?y < 0\<rbrakk> \<Longrightarrow> - (root n ?y ^ n) = ?y

goal (3 subgoals):
 1. ((\<lambda>a. - (a ^ n)) has_real_derivative - real n * root n x ^ (n - Suc 0)) (at (root n x))
 2. - real n * root n x ^ (n - Suc 0) \<noteq> 0
 3. isCont (root n) x
[PROOF STEP]
show "DERIV (\<lambda>x. - (x ^ n)) (root n x) :> - real n * root n x ^ (n - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - (x ^ n)) has_real_derivative - real n * root n x ^ (n - Suc 0)) (at (root n x))
[PROOF STEP]
by  (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. - (x ^ n)) has_real_derivative - real n * root n x ^ (n - Suc 0)) (at (root n x))

goal (2 subgoals):
 1. - real n * root n x ^ (n - Suc 0) \<noteq> 0
 2. isCont (root n) x
[PROOF STEP]
show "- real n * root n x ^ (n - Suc 0) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - real n * root n x ^ (n - Suc 0) \<noteq> 0
[PROOF STEP]
using n x
[PROOF STATE]
proof (prove)
using this:
0 < n
x < 0

goal (1 subgoal):
 1. - real n * root n x ^ (n - Suc 0) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- real n * root n x ^ (n - Suc 0) \<noteq> 0

goal (1 subgoal):
 1. isCont (root n) x
[PROOF STEP]
show "isCont (root n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (root n) x
[PROOF STEP]
by (rule isCont_real_root)
[PROOF STATE]
proof (state)
this:
isCont (root n) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma listrel_mono: "r \<subseteq> s \<Longrightarrow> listrel r \<subseteq> listrel s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<subseteq> s \<Longrightarrow> listrel r \<subseteq> listrel s
[PROOF STEP]
by (meson listrel_iff_nth subrelI subset_eq)


[STATEMENT]
lemma of_int_monom:
  "of_int k = monom (of_int k) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int k = monom (of_int k) 0
[PROOF STEP]
by (simp add: of_int_poly monom_0)


[STATEMENT]
lemma poly_map_Cons:
  assumes "is_poly_tuple n fs"
  assumes "f \<in> carrier (Q\<^sub>p[\<X>\<^bsub>n\<^esub>])"
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "poly_map n (f#fs) a = (Qp_ev f a)#poly_map n fs a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map n (f # fs) a = eval_at_point Q\<^sub>p a f # poly_map n fs a
[PROOF STEP]
using assms poly_map_cons
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> poly_map ?n (?f # ?fs) ?a = eval_at_point Q\<^sub>p ?a ?f # poly_map ?n ?fs ?a

goal (1 subgoal):
 1. poly_map n (f # fs) a = eval_at_point Q\<^sub>p a f # poly_map n fs a
[PROOF STEP]
by blast


[STATEMENT]
lemma remove_max_mset:
  assumes "l \<noteq> []" "(m, l') = remove_max l"
  shows "add_mset m (mset l') = mset l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_mset m (mset l') = mset l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l \<noteq> []
(m, l') = remove_max l

goal (1 subgoal):
 1. add_mset m (mset l') = mset l
[PROOF STEP]
unfolding remove_max_def
[PROOF STATE]
proof (prove)
using this:
l \<noteq> []
(m, l') = foldl f (hd l, []) (tl l)

goal (1 subgoal):
 1. add_mset m (mset l') = mset l
[PROOF STEP]
using remove_max_mset_lemma[of m l' "hd l" "[]" "tl l"]
[PROOF STATE]
proof (prove)
using this:
l \<noteq> []
(m, l') = foldl f (hd l, []) (tl l)
(m, l') = foldl f (hd l, []) (tl l) \<Longrightarrow> mset (m # l') = mset (hd l # [] @ tl l)

goal (1 subgoal):
 1. add_mset m (mset l') = mset l
[PROOF STEP]
by auto


[STATEMENT]
lemma msubst_conj [usubst]: "(P(x) \<and> Q(x))\<lbrakk>x\<rightarrow>v\<rbrakk> = ((P(x))\<lbrakk>x\<rightarrow>v\<rbrakk> \<and> (Q(x))\<lbrakk>x\<rightarrow>v\<rbrakk>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P x \<and> Q x)\<lbrakk>x\<rightarrow>v\<rbrakk> = (msubst P v \<and> msubst Q v)
[PROOF STEP]
by (pred_auto)


[STATEMENT]
lemma interfree_swap_Map: "\<forall>k. i\<le>k \<and> k<j \<longrightarrow> interfree_aux \<Gamma> \<Theta> F (x, a, c k, fst (Q k))
 \<and> interfree_aux \<Gamma> \<Theta> F (c k, (Q k), x, fst a)
 \<Longrightarrow> interfree_swap \<Gamma> \<Theta> F (x, a, map c [i..<j], map Q [i..<j])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k. i \<le> k \<and> k < j \<longrightarrow> interfree_aux \<Gamma> \<Theta> F (x, a, c k, fst (Q k)) \<and> interfree_aux \<Gamma> \<Theta> F (c k, Q k, x, fst a) \<Longrightarrow> interfree_swap \<Gamma> \<Theta> F (x, a, map c [i..<j], map Q [i..<j])
[PROOF STEP]
by(force simp add: interfree_swap_def less_diff_conv)


[STATEMENT]
lemma SA_poly_to_Qp_poly_comm_taylor_term:
  assumes "F \<in> carrier (UP (SA n))"
  assumes "c \<in> carrier (SA n)"
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "SA_poly_to_Qp_poly n a (UP_cring.taylor_term (SA n) c F i) =
        UP_cring.taylor_term Q\<^sub>p (c a) (SA_poly_to_Qp_poly n a F) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (UPSA.taylor_term n c F i) = UPQ.taylor_term (c a) (SA_poly_to_Qp_poly n a F) i
[PROOF STEP]
unfolding SA_poly_to_Qp_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (UPSA.taylor_term n c F i) = UPQ.taylor_term (c a) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) F) i
[PROOF STEP]
using assms  Qp.cring_axioms SA_is_cring eval_hom_def
      eval_hom_is_SA_hom UP_cring.poly_lift_hom_comm_taylor_term[of "SA n" Q\<^sub>p "eval_hom a" F c i] ring_hom_ring.homh
[PROOF STATE]
proof (prove)
using this:
F \<in> carrier (UP (SA n))
c \<in> carrier (SA n)
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
cring Q\<^sub>p
cring (SA ?n)
eval_hom ?a = (\<lambda>f. f ?a)
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> ring_hom_ring (SA ?n) Q\<^sub>p (eval_hom ?a)
\<lbrakk>UP_cring (SA n); cring Q\<^sub>p; eval_hom a \<in> ring_hom (SA n) Q\<^sub>p; F \<in> carrier (UP (SA n)); c \<in> carrier (SA n)\<rbrakk> \<Longrightarrow> poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (UPSA.taylor_term n c F i) = UPQ.taylor_term (eval_hom a c) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) F) i
ring_hom_ring ?R ?S ?h \<Longrightarrow> ?h \<in> ring_hom ?R ?S

goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (UPSA.taylor_term n c F i) = UPQ.taylor_term (c a) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) F) i
[PROOF STEP]
unfolding  SA_poly_to_Qp_poly_def eval_hom_def UP_cring_def
[PROOF STATE]
proof (prove)
using this:
F \<in> carrier (UP (SA n))
c \<in> carrier (SA n)
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
cring Q\<^sub>p
cring (SA ?n)
(\<lambda>f. f ?a) = (\<lambda>f. f ?a)
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> ring_hom_ring (SA ?n) Q\<^sub>p (\<lambda>f. f ?a)
\<lbrakk>cring (SA n); cring Q\<^sub>p; (\<lambda>f. f a) \<in> ring_hom (SA n) Q\<^sub>p; F \<in> carrier (UP (SA n)); c \<in> carrier (SA n)\<rbrakk> \<Longrightarrow> poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) (UPSA.taylor_term n c F i) = UPQ.taylor_term (c a) (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) F) i
ring_hom_ring ?R ?S ?h \<Longrightarrow> ?h \<in> ring_hom ?R ?S

goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) (UPSA.taylor_term n c F i) = UPQ.taylor_term (c a) (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) F) i
[PROOF STEP]
by metis


[STATEMENT]
lemma Suc_sub: "Suc n = m \<Longrightarrow> n = m - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n = m \<Longrightarrow> n = m - 1
[PROOF STEP]
by simp


[STATEMENT]
theorem divisibility_alpha2:
  assumes "b>2" "m>0"
  shows "(\<alpha> b k)^2 dvd (\<alpha> b m) \<longleftrightarrow> k*(\<alpha> b k) dvd m" (is "?P \<longleftrightarrow> ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<alpha> b k)\<^sup>2 dvd \<alpha> b m) = (int k * \<alpha> b k dvd int m)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. int k * \<alpha> b k dvd int m \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
assume Q: "?Q"
[PROOF STATE]
proof (state)
this:
int k * \<alpha> b k dvd int m

goal (2 subgoals):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. int k * \<alpha> b k dvd int m \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int k * \<alpha> b k dvd int m
[PROOF STEP]
show "?P"
[PROOF STATE]
proof (prove)
using this:
int k * \<alpha> b k dvd int m

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
proof(cases "k dvd m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k dvd m

goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k dvd m
[PROOF STEP]
obtain l where mkl: "m = k * l"
[PROOF STATE]
proof (prove)
using this:
k dvd m

goal (1 subgoal):
 1. (\<And>l. m = k * l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m = k * l

goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
from Q assms mkl
[PROOF STATE]
proof (chain)
picking this:
int k * \<alpha> b k dvd int m
2 < b
0 < m
m = k * l
[PROOF STEP]
have S0: "l mod \<alpha> b k = 0"
[PROOF STATE]
proof (prove)
using this:
int k * \<alpha> b k dvd int m
2 < b
0 < m
m = k * l

goal (1 subgoal):
 1. int l mod \<alpha> b k = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int l mod \<alpha> b k = 0

goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
from S0
[PROOF STATE]
proof (chain)
picking this:
int l mod \<alpha> b k = 0
[PROOF STEP]
have S1: "l*(\<alpha> b k) mod (\<alpha> b k)^2 = 0"
[PROOF STATE]
proof (prove)
using this:
int l mod \<alpha> b k = 0

goal (1 subgoal):
 1. int l * \<alpha> b k mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
int l * \<alpha> b k mod (\<alpha> b k)\<^sup>2 = 0

goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
int l * \<alpha> b k mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
have S2: "((-1)^(l-1)*l*(\<alpha> b k)*(\<alpha> b (k-1))^(l-1)) mod (\<alpha> b k)^2 = 0"
[PROOF STATE]
proof (prove)
using this:
int l * \<alpha> b k mod (\<alpha> b k)\<^sup>2 = 0

goal (1 subgoal):
 1. (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int l * \<alpha> b k mod (\<alpha> b k)\<^sup>2 = 0 \<Longrightarrow> (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
have "\<forall>i. \<alpha> b k * (int l * i) mod (\<alpha> b k)\<^sup>2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. \<alpha> b k * (int l * i) mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
by (metis (no_types) S1 mod_0 mod_mult_left_eq mult.assoc mult.left_commute mult_zero_left)
[PROOF STATE]
proof (state)
this:
\<forall>i. \<alpha> b k * (int l * i) mod (\<alpha> b k)\<^sup>2 = 0

goal (1 subgoal):
 1. int l * \<alpha> b k mod (\<alpha> b k)\<^sup>2 = 0 \<Longrightarrow> (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. \<alpha> b k * (int l * i) mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i. \<alpha> b k * (int l * i) mod (\<alpha> b k)\<^sup>2 = 0

goal (1 subgoal):
 1. (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
by (simp add: mult.assoc mult.left_commute)
[PROOF STATE]
proof (state)
this:
(- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0

goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
from assms divisibility_congruence mkl
[PROOF STATE]
proof (chain)
picking this:
2 < b
0 < m
\<lbrakk>?m = ?k * ?l; 2 < ?b; 0 < ?m\<rbrakk> \<Longrightarrow> \<alpha> ?b ?m mod (\<alpha> ?b ?k)\<^sup>2 = (- 1) ^ (?l - 1) * int ?l * \<alpha> ?b ?k * \<alpha> ?b (?k - 1) ^ (?l - 1) mod (\<alpha> ?b ?k)\<^sup>2
m = k * l
[PROOF STEP]
have S3:
      "\<alpha> b m mod (\<alpha> b k)^2 = ((-1)^(l-1)*l*(\<alpha> b k)*(\<alpha> b (k-1))^(l-1)) mod (\<alpha> b k)^2"
[PROOF STATE]
proof (prove)
using this:
2 < b
0 < m
\<lbrakk>?m = ?k * ?l; 2 < ?b; 0 < ?m\<rbrakk> \<Longrightarrow> \<alpha> ?b ?m mod (\<alpha> ?b ?k)\<^sup>2 = (- 1) ^ (?l - 1) * int ?l * \<alpha> ?b ?k * \<alpha> ?b (?k - 1) ^ (?l - 1) mod (\<alpha> ?b ?k)\<^sup>2
m = k * l

goal (1 subgoal):
 1. \<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2

goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
from S2 S3
[PROOF STATE]
proof (chain)
picking this:
(- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2
[PROOF STEP]
have S4: "\<alpha> b m mod (\<alpha> b k)^2 = 0"
[PROOF STATE]
proof (prove)
using this:
(- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2 = 0
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2

goal (1 subgoal):
 1. \<alpha> b m mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = 0

goal (2 subgoals):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
 2. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = 0

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m

goal (1 subgoal):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k dvd m

goal (1 subgoal):
 1. \<lbrakk>int k * \<alpha> b k dvd int m; \<not> k dvd m\<rbrakk> \<Longrightarrow> (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> k dvd m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> k dvd m

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
using Q dvd_mult_left int_dvd_int_iff
[PROOF STATE]
proof (prove)
using this:
\<not> k dvd m
int k * \<alpha> b k dvd int m
?a * ?b dvd ?c \<Longrightarrow> ?a dvd ?c
(int ?m dvd int ?n) = (?m dvd ?n)

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
assume P: "?P"
[PROOF STATE]
proof (state)
this:
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd \<alpha> b m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
show "?Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int k * \<alpha> b k dvd int m
[PROOF STEP]
proof(cases "k dvd m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k dvd m

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k dvd m
[PROOF STEP]
obtain l where mkl: "m = k * l"
[PROOF STATE]
proof (prove)
using this:
k dvd m

goal (1 subgoal):
 1. (\<And>l. m = k * l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m = k * l

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
from assms mkl divisibility_congruence
[PROOF STATE]
proof (chain)
picking this:
2 < b
0 < m
m = k * l
\<lbrakk>?m = ?k * ?l; 2 < ?b; 0 < ?m\<rbrakk> \<Longrightarrow> \<alpha> ?b ?m mod (\<alpha> ?b ?k)\<^sup>2 = (- 1) ^ (?l - 1) * int ?l * \<alpha> ?b ?k * \<alpha> ?b (?k - 1) ^ (?l - 1) mod (\<alpha> ?b ?k)\<^sup>2
[PROOF STEP]
have S0:
          "\<alpha> b m mod (\<alpha> b k)^2 = ((-1)^(l-1)*l*(\<alpha> b k)*(\<alpha> b (k-1))^(l-1)) mod (\<alpha> b k)^2"
[PROOF STATE]
proof (prove)
using this:
2 < b
0 < m
m = k * l
\<lbrakk>?m = ?k * ?l; 2 < ?b; 0 < ?m\<rbrakk> \<Longrightarrow> \<alpha> ?b ?m mod (\<alpha> ?b ?k)\<^sup>2 = (- 1) ^ (?l - 1) * int ?l * \<alpha> ?b ?k * \<alpha> ?b (?k - 1) ^ (?l - 1) mod (\<alpha> ?b ?k)\<^sup>2

goal (1 subgoal):
 1. \<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
from S0 P
[PROOF STATE]
proof (chain)
picking this:
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m
[PROOF STEP]
have S1: "(\<alpha> b k)^2 dvd ((-1)^(l-1)*l*(\<alpha> b k)*(\<alpha> b (k-1))^(l-1))"
[PROOF STATE]
proof (prove)
using this:
\<alpha> b m mod (\<alpha> b k)\<^sup>2 = (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1) mod (\<alpha> b k)\<^sup>2
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<alpha> b k)\<^sup>2 dvd (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
(\<alpha> b k)\<^sup>2 dvd (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)
[PROOF STEP]
have S2: "(\<alpha> b k)^2 dvd l*(\<alpha> b k)*(\<alpha> b (k-1))^(l-1)"
[PROOF STATE]
proof (prove)
using this:
(\<alpha> b k)\<^sup>2 dvd (- 1) ^ (l - 1) * int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)

goal (1 subgoal):
 1. (\<alpha> b k)\<^sup>2 dvd int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)
[PROOF STEP]
by (metis (no_types, opaque_lifting) Groups.mult_ac(1) dvd_trans dvd_triv_right left_minus_one_mult_self)
[PROOF STATE]
proof (state)
this:
(\<alpha> b k)\<^sup>2 dvd int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
from S2
[PROOF STATE]
proof (chain)
picking this:
(\<alpha> b k)\<^sup>2 dvd int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)
[PROOF STEP]
have S3: "(\<alpha> b k) dvd l*(\<alpha> b (k-1))^(l-1)"
[PROOF STATE]
proof (prove)
using this:
(\<alpha> b k)\<^sup>2 dvd int l * \<alpha> b k * \<alpha> b (k - 1) ^ (l - 1)

goal (1 subgoal):
 1. \<alpha> b k dvd int l * \<alpha> b (k - 1) ^ (l - 1)
[PROOF STEP]
by (metis (full_types) Exp_Matrices.alpha_superlinear assms(1) assms(2) mkl
            mult.assoc mult.commute mult_0 not_less_zero of_nat_le_0_iff power2_eq_square zdvd_mult_cancel)
[PROOF STATE]
proof (state)
this:
\<alpha> b k dvd int l * \<alpha> b (k - 1) ^ (l - 1)

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
from div_coprime Suc_eq_plus1 Suc_pred' assms(1) assms(2) mkl less_imp_le_nat nat_0_less_mult_iff
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>2 < ?b; (0::?'a) \<le> ?n\<rbrakk> \<Longrightarrow> coprime (\<alpha> ?b ?k) (\<alpha> ?b (?k + 1))
Suc ?n = ?n + 1
0 < ?n \<Longrightarrow> ?n = Suc (?n - 1)
2 < b
0 < m
m = k * l
?m < ?n \<Longrightarrow> ?m \<le> ?n
(0 < ?m * ?n) = (0 < ?m \<and> 0 < ?n)
[PROOF STEP]
have S4: "coprime (\<alpha> b k) (\<alpha> b (k-1))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 < ?b; (0::?'a) \<le> ?n\<rbrakk> \<Longrightarrow> coprime (\<alpha> ?b ?k) (\<alpha> ?b (?k + 1))
Suc ?n = ?n + 1
0 < ?n \<Longrightarrow> ?n = Suc (?n - 1)
2 < b
0 < m
m = k * l
?m < ?n \<Longrightarrow> ?m \<le> ?n
(0 < ?m * ?n) = (0 < ?m \<and> 0 < ?n)

goal (1 subgoal):
 1. coprime (\<alpha> b k) (\<alpha> b (k - 1))
[PROOF STEP]
by (metis coprime_commute)
[PROOF STATE]
proof (state)
this:
coprime (\<alpha> b k) (\<alpha> b (k - 1))

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
hence "coprime (\<alpha> b k) ((\<alpha> b (k-1))^(l-1))"
[PROOF STATE]
proof (prove)
using this:
coprime (\<alpha> b k) (\<alpha> b (k - 1))

goal (1 subgoal):
 1. coprime (\<alpha> b k) (\<alpha> b (k - 1) ^ (l - 1))
[PROOF STEP]
using coprime_power_right_iff
[PROOF STATE]
proof (prove)
using this:
coprime (\<alpha> b k) (\<alpha> b (k - 1))
coprime ?a (?b ^ ?n) = (coprime ?a ?b \<or> ?n = 0)

goal (1 subgoal):
 1. coprime (\<alpha> b k) (\<alpha> b (k - 1) ^ (l - 1))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
coprime (\<alpha> b k) (\<alpha> b (k - 1) ^ (l - 1))

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
hence "(\<alpha> b k) dvd l"
[PROOF STATE]
proof (prove)
using this:
coprime (\<alpha> b k) (\<alpha> b (k - 1) ^ (l - 1))

goal (1 subgoal):
 1. \<alpha> b k dvd int l
[PROOF STEP]
using S3
[PROOF STATE]
proof (prove)
using this:
coprime (\<alpha> b k) (\<alpha> b (k - 1) ^ (l - 1))
\<alpha> b k dvd int l * \<alpha> b (k - 1) ^ (l - 1)

goal (1 subgoal):
 1. \<alpha> b k dvd int l
[PROOF STEP]
using coprime_dvd_mult_left_iff
[PROOF STATE]
proof (prove)
using this:
coprime (\<alpha> b k) (\<alpha> b (k - 1) ^ (l - 1))
\<alpha> b k dvd int l * \<alpha> b (k - 1) ^ (l - 1)
coprime ?a ?c \<Longrightarrow> (?a dvd ?b * ?c) = (?a dvd ?b)

goal (1 subgoal):
 1. \<alpha> b k dvd int l
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<alpha> b k dvd int l

goal (2 subgoals):
 1. k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> b k dvd int l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> b k dvd int l

goal (1 subgoal):
 1. int k * \<alpha> b k dvd int m
[PROOF STEP]
by (simp add: mkl)
[PROOF STATE]
proof (state)
this:
int k * \<alpha> b k dvd int m

goal (1 subgoal):
 1. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k dvd m

goal (1 subgoal):
 1. \<not> k dvd m \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> k dvd m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> k dvd m

goal (1 subgoal):
 1. int k * \<alpha> b k dvd int m
[PROOF STEP]
apply(cases "0<k")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<not> k dvd m; 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
 2. \<lbrakk>\<not> k dvd m; \<not> 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> k dvd m; 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
using divisibility_alpha[of b k m] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 < b; 0 < k\<rbrakk> \<Longrightarrow> (\<alpha> b k dvd \<alpha> b m) = (k dvd m)
2 < b
0 < m

goal (1 subgoal):
 1. \<lbrakk>\<not> k dvd m; 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
using dvd_mult_left P
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 < b; 0 < k\<rbrakk> \<Longrightarrow> (\<alpha> b k dvd \<alpha> b m) = (k dvd m)
2 < b
0 < m
?a * ?b dvd ?c \<Longrightarrow> ?a dvd ?c
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m

goal (1 subgoal):
 1. \<lbrakk>\<not> k dvd m; 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> k dvd m; \<not> 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> k dvd m; \<not> 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
using Exp_Matrices.alpha_strictly_increasing_general assms(1) P
[PROOF STATE]
proof (prove)
using this:
2 < ?b \<and> ?n < ?m \<Longrightarrow> \<alpha> ?b ?n < \<alpha> ?b ?m
2 < b
(\<alpha> b k)\<^sup>2 dvd \<alpha> b m

goal (1 subgoal):
 1. \<lbrakk>\<not> k dvd m; \<not> 0 < k\<rbrakk> \<Longrightarrow> int k * \<alpha> b k dvd int m
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
int k * \<alpha> b k dvd int m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int k * \<alpha> b k dvd int m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basis_col_space_eq_basis_row_space_transpose:
  "basis_col_space A = basis_row_space (transpose A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_col_space A = basis_row_space (Finite_Cartesian_Product.transpose A)
[PROOF STEP]
unfolding basis_col_space_def basis_row_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) |i. row i (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0} = {row i (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) |i. row i (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0}
[PROOF STEP]
..


[STATEMENT]
lemma splitFace_incr_faces:
 "pre_splitFace g u v f vs \<Longrightarrow>
 finals(snd(snd(splitFace g u v f vs))) = finals g \<and>
       |nonFinals(snd(snd(splitFace g u v f vs)))| = Suc |nonFinals g|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_splitFace g u v f vs \<Longrightarrow> finals (snd (snd (splitFace g u v f vs))) = finals g \<and> |nonFinals (snd (snd (splitFace g u v f vs)))| = Suc |nonFinals g|
[PROOF STEP]
apply(unfold pre_splitFace_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<F> g \<and> \<not> final f \<and> distinct (vertices f) \<and> distinct vs \<and> \<V> g \<inter> set vs = {} \<and> \<V> f \<inter> set vs = {} \<and> u \<in> \<V> f \<and> v \<in> \<V> f \<and> u \<noteq> v \<and> ((u, v) \<notin> \<E> f \<and> (v, u) \<notin> \<E> f \<and> (u, v) \<notin> \<E> g \<and> (v, u) \<notin> \<E> g \<or> vs \<noteq> []) \<Longrightarrow> finals (snd (snd (splitFace g u v f vs))) = finals g \<and> |nonFinals (snd (snd (splitFace g u v f vs)))| = Suc |nonFinals g|
[PROOF STEP]
apply(simp add: splitFace_def split_def finals_def nonFinals_def
      split_face_def filter_replace2 length_filter_replace2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma analytic_on_power [analytic_intros]:
  "f analytic_on S \<Longrightarrow> (\<lambda>z. (f z) ^ n) analytic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f analytic_on S \<Longrightarrow> (\<lambda>z. f z ^ n) analytic_on S
[PROOF STEP]
by (induct n) (auto simp: analytic_on_mult)


[STATEMENT]
lemma pathVertices_append: "pathVertices u (p1 @ p2) =
butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2
[PROOF STEP]
proof (induction p1 arbitrary: u)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>u. pathVertices u ([] @ p2) = butlast (pathVertices u []) @ pathVertices (last (pathVertices u [])) p2
 2. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>u. pathVertices u ([] @ p2) = butlast (pathVertices u []) @ pathVertices (last (pathVertices u [])) p2
 2. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathVertices u ([] @ p2) = butlast (pathVertices u []) @ pathVertices (last (pathVertices u [])) p2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pathVertices u ([] @ p2) = butlast (pathVertices u []) @ pathVertices (last (pathVertices u [])) p2

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
case (Cons e es)
[PROOF STATE]
proof (state)
this:
pathVertices ?u (es @ p2) = butlast (pathVertices ?u es) @ pathVertices (last (pathVertices ?u es)) p2

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
have "pathVertices u ((e # es) @ p2) =  fst e # pathVertices (snd e) (es @ p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathVertices u ((e # es) @ p2) = fst e # pathVertices (snd e) (es @ p2)
[PROOF STEP]
by (metis Graph.pathVertices.simps(2) append_Cons)
[PROOF STATE]
proof (state)
this:
pathVertices u ((e # es) @ p2) = fst e # pathVertices (snd e) (es @ p2)

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pathVertices u ((e # es) @ p2) = fst e # pathVertices (snd e) (es @ p2)

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
have "pathVertices (snd e) (es @ p2)
    = butlast (pathVertices (snd e) es)
      @ pathVertices (last (pathVertices (snd e) es)) p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathVertices (snd e) (es @ p2) = butlast (pathVertices (snd e) es) @ pathVertices (last (pathVertices (snd e) es)) p2
[PROOF STEP]
using Cons.IH
[PROOF STATE]
proof (prove)
using this:
pathVertices ?u (es @ p2) = butlast (pathVertices ?u es) @ pathVertices (last (pathVertices ?u es)) p2

goal (1 subgoal):
 1. pathVertices (snd e) (es @ p2) = butlast (pathVertices (snd e) es) @ pathVertices (last (pathVertices (snd e) es)) p2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pathVertices (snd e) (es @ p2) = butlast (pathVertices (snd e) es) @ pathVertices (last (pathVertices (snd e) es)) p2

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pathVertices (snd e) (es @ p2) = butlast (pathVertices (snd e) es) @ pathVertices (last (pathVertices (snd e) es)) p2

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
have "fst e # butlast (pathVertices (snd e) es) =
    butlast (fst e # pathVertices (snd e) es)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst e # butlast (pathVertices (snd e) es) = butlast (fst e # pathVertices (snd e) es)
[PROOF STEP]
by (metis Graph.pathVertices.simps(1)
        Graph.pathVertices_alt Nil_is_append_conv butlast.simps(2)
        list.distinct(1))
[PROOF STATE]
proof (state)
this:
fst e # butlast (pathVertices (snd e) es) = butlast (fst e # pathVertices (snd e) es)

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst e # butlast (pathVertices (snd e) es) = butlast (fst e # pathVertices (snd e) es)

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
have "fst e # pathVertices (snd e) es = pathVertices u (e # es)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst e # pathVertices (snd e) es = pathVertices u (e # es)
[PROOF STEP]
by (metis Graph.pathVertices.simps(2))
[PROOF STATE]
proof (state)
this:
fst e # pathVertices (snd e) es = pathVertices u (e # es)

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst e # pathVertices (snd e) es = pathVertices u (e # es)

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
have "last (pathVertices (snd e) es) = last (pathVertices u (e # es))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (pathVertices (snd e) es) = last (pathVertices u (e # es))
[PROOF STEP]
by (metis Graph.pathVertices.simps(1) Graph.pathVertices_alt
    last.simps last_snoc list.distinct(1))
[PROOF STATE]
proof (state)
this:
last (pathVertices (snd e) es) = last (pathVertices u (e # es))

goal (1 subgoal):
 1. \<And>a p1 u. (\<And>u. pathVertices u (p1 @ p2) = butlast (pathVertices u p1) @ pathVertices (last (pathVertices u p1)) p2) \<Longrightarrow> pathVertices u ((a # p1) @ p2) = butlast (pathVertices u (a # p1)) @ pathVertices (last (pathVertices u (a # p1))) p2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
pathVertices u ((e # es) @ p2) = fst e # pathVertices (snd e) (es @ p2)
pathVertices (snd e) (es @ p2) = butlast (pathVertices (snd e) es) @ pathVertices (last (pathVertices (snd e) es)) p2
fst e # butlast (pathVertices (snd e) es) = butlast (fst e # pathVertices (snd e) es)
fst e # pathVertices (snd e) es = pathVertices u (e # es)
last (pathVertices (snd e) es) = last (pathVertices u (e # es))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
pathVertices u ((e # es) @ p2) = fst e # pathVertices (snd e) (es @ p2)
pathVertices (snd e) (es @ p2) = butlast (pathVertices (snd e) es) @ pathVertices (last (pathVertices (snd e) es)) p2
fst e # butlast (pathVertices (snd e) es) = butlast (fst e # pathVertices (snd e) es)
fst e # pathVertices (snd e) es = pathVertices u (e # es)
last (pathVertices (snd e) es) = last (pathVertices u (e # es))

goal (1 subgoal):
 1. pathVertices u ((e # es) @ p2) = butlast (pathVertices u (e # es)) @ pathVertices (last (pathVertices u (e # es))) p2
[PROOF STEP]
by (metis append_Cons)
[PROOF STATE]
proof (state)
this:
pathVertices u ((e # es) @ p2) = butlast (pathVertices u (e # es)) @ pathVertices (last (pathVertices u (e # es))) p2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_pmf_finite: "s \<in> S \<Longrightarrow> D \<in> K s \<Longrightarrow> finite D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> S; D \<in> K s\<rbrakk> \<Longrightarrow> finite (set_pmf D)
[PROOF STEP]
using K_closed
[PROOF STATE]
proof (prove)
using this:
?s \<in> S \<Longrightarrow> \<Union> (set_pmf ` K ?s) \<subseteq> S

goal (1 subgoal):
 1. \<lbrakk>s \<in> S; D \<in> K s\<rbrakk> \<Longrightarrow> finite (set_pmf D)
[PROOF STEP]
by (intro finite_subset[OF _ S_finite]) auto


[STATEMENT]
lemma matrix_sum_tensor_P1:
  "(\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N) \<Longrightarrow> (A \<in> carrier_mat K K) \<Longrightarrow>
   matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>k. k < 0 \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) 0 = tensor_P (matrix_sum N g 0) A
 2. \<And>m. \<lbrakk>\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A; \<And>k. k < Suc m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?k2 < 0 \<Longrightarrow> g ?k2 \<in> carrier_mat N N
A \<in> carrier_mat K K

goal (2 subgoals):
 1. \<lbrakk>\<And>k. k < 0 \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) 0 = tensor_P (matrix_sum N g 0) A
 2. \<And>m. \<lbrakk>\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A; \<And>k. k < Suc m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. tensor_P (g k) A) 0 = tensor_P (matrix_sum N g 0) A
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m d d = tensor_P (0\<^sub>m N N) A
[PROOF STEP]
unfolding ps2_P.ptensor_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m d d = ps_P.tensor_mat (0\<^sub>m N N) A
[PROOF STEP]
using ps_P.tensor_mat_zero1[simplified ps_P_d ps_P_d1, of A]
[PROOF STATE]
proof (prove)
using this:
ps_P.tensor_mat (0\<^sub>m N N) A = 0\<^sub>m d d

goal (1 subgoal):
 1. 0\<^sub>m d d = ps_P.tensor_mat (0\<^sub>m N N) A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. tensor_P (g k) A) 0 = tensor_P (matrix_sum N g 0) A

goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A; \<And>k. k < Suc m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A; \<And>k. k < Suc m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A
?k2 < Suc m \<Longrightarrow> g ?k2 \<in> carrier_mat N N
A \<in> carrier_mat K K

goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A; \<And>k. k < Suc m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A
?k2 < Suc m \<Longrightarrow> g ?k2 \<in> carrier_mat N N
A \<in> carrier_mat K K
[PROOF STEP]
have ind: "matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A"
    and dk: "\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N" and "A \<in> carrier_mat K K"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A
?k2 < Suc m \<Longrightarrow> g ?k2 \<in> carrier_mat N N
A \<in> carrier_mat K K

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A &&& (\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N) &&& A \<in> carrier_mat K K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A
?k2 < m \<Longrightarrow> g ?k2 \<in> carrier_mat N N
A \<in> carrier_mat K K

goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A; \<And>k. k < Suc m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
have ds: "matrix_sum N g m \<in> carrier_mat N N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum N g m \<in> carrier_mat N N
[PROOF STEP]
apply (subst matrix_sum_dim)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N
 2. True
[PROOF STEP]
using dk
[PROOF STATE]
proof (prove)
using this:
?k2 < m \<Longrightarrow> g ?k2 \<in> carrier_mat N N

goal (2 subgoals):
 1. \<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N
 2. True
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum N g m \<in> carrier_mat N N

goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A; \<And>k. k < Suc m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_P (g m) A + matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (g m + matrix_sum N g m) A
[PROOF STEP]
apply (subst ind)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_P (g m) A + tensor_P (matrix_sum N g m) A = tensor_P (g m + matrix_sum N g m) A
[PROOF STEP]
unfolding ps2_P.ptensor_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps_P.tensor_mat (g m) A + ps_P.tensor_mat (matrix_sum N g m) A = ps_P.tensor_mat (g m + matrix_sum N g m) A
[PROOF STEP]
apply (subst ps_P.tensor_mat_add1)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. g m \<in> carrier_mat ps_P.d1 ps_P.d1
 2. matrix_sum N g m \<in> carrier_mat ps_P.d1 ps_P.d1
 3. A \<in> carrier_mat ps_P.d2 ps_P.d2
 4. ps_P.tensor_mat (g m) A + ps_P.tensor_mat (matrix_sum N g m) A = ps_P.tensor_mat (g m) A + ps_P.tensor_mat (matrix_sum N g m) A
[PROOF STEP]
unfolding ps_P_d1 ps_P_d2
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. g m \<in> carrier_mat N N
 2. matrix_sum N g m \<in> carrier_mat N N
 3. A \<in> carrier_mat K K
 4. ps_P.tensor_mat (g m) A + ps_P.tensor_mat (matrix_sum N g m) A = ps_P.tensor_mat (g m) A + ps_P.tensor_mat (matrix_sum N g m) A
[PROOF STEP]
using Suc ds
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k. k < m \<Longrightarrow> g k \<in> carrier_mat N N; A \<in> carrier_mat K K\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_P (g k) A) m = tensor_P (matrix_sum N g m) A
?k2 < Suc m \<Longrightarrow> g ?k2 \<in> carrier_mat N N
A \<in> carrier_mat K K
matrix_sum N g m \<in> carrier_mat N N

goal (4 subgoals):
 1. g m \<in> carrier_mat N N
 2. matrix_sum N g m \<in> carrier_mat N N
 3. A \<in> carrier_mat K K
 4. ps_P.tensor_mat (g m) A + ps_P.tensor_mat (matrix_sum N g m) A = ps_P.tensor_mat (g m) A + ps_P.tensor_mat (matrix_sum N g m) A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. tensor_P (g k) A) (Suc m) = tensor_P (matrix_sum N g (Suc m)) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cone_contains_0:
  assumes "cone S"
  shows "S \<noteq> {} \<longleftrightarrow> 0 \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S \<noteq> {}) = ((0::'a) \<in> S)
[PROOF STEP]
using assms mem_cone
[PROOF STATE]
proof (prove)
using this:
cone S
\<lbrakk>cone ?S; ?x \<in> ?S; 0 \<le> ?c\<rbrakk> \<Longrightarrow> ?c *\<^sub>R ?x \<in> ?S

goal (1 subgoal):
 1. (S \<noteq> {}) = ((0::'a) \<in> S)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma list_length_hint3:
assumes "length l = Suc 0"
shows    "l \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<noteq> []
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length l = Suc 0

goal (1 subgoal):
 1. l \<noteq> []
[PROOF STEP]
by (metis Zero_neq_Suc list.size(3))


[STATEMENT]
lemma inj_on_image_inv_of_rat_range_rcut:
  "inj_on (image (inv of_rat)) (range rcut)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((`) (inv real_of_rat)) (range rcut)
[PROOF STEP]
using range_rcut_subset_Pow_rat inj_on_inv_image_inv_of_rat_Pow_rat
[PROOF STATE]
proof (prove)
using this:
range rcut \<subseteq> Pow \<rat>
inj_on ((`) (inv of_rat)) (Pow \<rat>)

goal (1 subgoal):
 1. inj_on ((`) (inv real_of_rat)) (range rcut)
[PROOF STEP]
by (auto intro: inj_on_subset)


[STATEMENT]
lemma match_pres_distinct:
  "distinct (map fst pres) \<Longrightarrow> match_pres pres s \<longleftrightarrow> Map.map_of pres \<subseteq>\<^sub>m s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst pres) \<Longrightarrow> Solve_SASP.match_pres pres s = (Map.map_of pres \<subseteq>\<^sub>m s)
[PROOF STEP]
unfolding match_pres_def match_pre_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst pres) \<Longrightarrow> (\<forall>pre\<in>set pres. (case pre of (x, v) \<Rightarrow> \<lambda>s. s x = Some v) s) = (Map.map_of pres \<subseteq>\<^sub>m s)
[PROOF STEP]
using map_le_def map_of_SomeD
[PROOF STATE]
proof (prove)
using this:
(?m\<^sub>1 \<subseteq>\<^sub>m ?m\<^sub>2) = (\<forall>a\<in>dom ?m\<^sub>1. ?m\<^sub>1 a = ?m\<^sub>2 a)
Map.map_of ?xs ?k = Some ?y \<Longrightarrow> (?k, ?y) \<in> set ?xs

goal (1 subgoal):
 1. distinct (map fst pres) \<Longrightarrow> (\<forall>pre\<in>set pres. (case pre of (x, v) \<Rightarrow> \<lambda>s. s x = Some v) s) = (Map.map_of pres \<subseteq>\<^sub>m s)
[PROOF STEP]
apply (auto split: prod.splits)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>distinct (map fst pres); \<And>m\<^sub>1 m\<^sub>2. (m\<^sub>1 \<subseteq>\<^sub>m m\<^sub>2) = (\<forall>a\<in>dom m\<^sub>1. m\<^sub>1 a = m\<^sub>2 a); \<And>xs k y. Map.map_of xs k = Some y \<Longrightarrow> (k, y) \<in> set xs; \<forall>pre\<in>set pres. \<forall>x1 x2. pre = (x1, x2) \<longrightarrow> s x1 = Some x2\<rbrakk> \<Longrightarrow> Map.map_of pres \<subseteq>\<^sub>m s
 2. \<And>x1 x2. \<lbrakk>distinct (map fst pres); \<And>m\<^sub>1 m\<^sub>2. (m\<^sub>1 \<subseteq>\<^sub>m m\<^sub>2) = (\<forall>a\<in>dom m\<^sub>1. m\<^sub>1 a = m\<^sub>2 a); \<And>xs k y. Map.map_of xs k = Some y \<Longrightarrow> (k, y) \<in> set xs; Map.map_of pres \<subseteq>\<^sub>m s; (x1, x2) \<in> set pres\<rbrakk> \<Longrightarrow> s x1 = Some x2
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>distinct (map fst pres); \<And>m\<^sub>1 m\<^sub>2. (m\<^sub>1 \<subseteq>\<^sub>m m\<^sub>2) = (\<forall>a\<in>dom m\<^sub>1. m\<^sub>1 a = m\<^sub>2 a); \<And>xs k y. Map.map_of xs k = Some y \<Longrightarrow> (k, y) \<in> set xs; Map.map_of pres \<subseteq>\<^sub>m s; (x1, x2) \<in> set pres\<rbrakk> \<Longrightarrow> s x1 = Some x2
[PROOF STEP]
using domI map_of_is_SomeI
[PROOF STATE]
proof (prove)
using this:
?m ?a = Some ?b \<Longrightarrow> ?a \<in> dom ?m
\<lbrakk>distinct (map fst ?xys); (?x, ?y) \<in> set ?xys\<rbrakk> \<Longrightarrow> Map.map_of ?xys ?x = Some ?y

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>distinct (map fst pres); \<And>m\<^sub>1 m\<^sub>2. (m\<^sub>1 \<subseteq>\<^sub>m m\<^sub>2) = (\<forall>a\<in>dom m\<^sub>1. m\<^sub>1 a = m\<^sub>2 a); \<And>xs k y. Map.map_of xs k = Some y \<Longrightarrow> (k, y) \<in> set xs; Map.map_of pres \<subseteq>\<^sub>m s; (x1, x2) \<in> set pres\<rbrakk> \<Longrightarrow> s x1 = Some x2
[PROOF STEP]
by smt


[STATEMENT]
lemma markedElementsAreElementsBeforeLastDecisionAndLastDecision:
  assumes "markedElements M \<noteq> []"
  shows "(markedElements M) = (markedElements (prefixBeforeLastMarked M)) @ [lastMarked M]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. markedElements M = markedElements (prefixBeforeLastMarked M) @ [lastMarked M]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
markedElements M \<noteq> []

goal (1 subgoal):
 1. markedElements M = markedElements (prefixBeforeLastMarked M) @ [lastMarked M]
[PROOF STEP]
unfolding lastMarked_def
[PROOF STATE]
proof (prove)
using this:
markedElements M \<noteq> []

goal (1 subgoal):
 1. markedElements M = markedElements (prefixBeforeLastMarked M) @ [last (markedElements M)]
[PROOF STEP]
by (induct M) (auto split: if_split_asm)


[STATEMENT]
lemma supp_is_least_supports:
  fixes S :: "'x set"
  and   x :: "'a"
  assumes  pt: "pt TYPE('a) TYPE('x)"
  and      at: "at TYPE ('x)"
  and      a1: "S supports x"
  and      a2: "finite S"
  and      a3: "\<forall>S'. (S' supports x) \<longrightarrow> S\<subseteq>S'"
  shows "S = (supp x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = supp x
[PROOF STEP]
proof (rule equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S \<subseteq> supp x
 2. supp x \<subseteq> S
[PROOF STEP]
show "((supp x)::'x set)\<subseteq>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp x \<subseteq> S
[PROOF STEP]
using a1 a2
[PROOF STATE]
proof (prove)
using this:
S supports x
finite S

goal (1 subgoal):
 1. supp x \<subseteq> S
[PROOF STEP]
by (rule supp_is_subset)
[PROOF STATE]
proof (state)
this:
supp x \<subseteq> S

goal (1 subgoal):
 1. S \<subseteq> supp x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<subseteq> supp x
[PROOF STEP]
have "((supp x)::'x set) supports x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp x supports x
[PROOF STEP]
by (rule supp_supports[OF pt, OF at])
[PROOF STATE]
proof (state)
this:
supp x supports x

goal (1 subgoal):
 1. S \<subseteq> supp x
[PROOF STEP]
with a3
[PROOF STATE]
proof (chain)
picking this:
\<forall>S'. S' supports x \<longrightarrow> S \<subseteq> S'
supp x supports x
[PROOF STEP]
show "S\<subseteq>supp x"
[PROOF STATE]
proof (prove)
using this:
\<forall>S'. S' supports x \<longrightarrow> S \<subseteq> S'
supp x supports x

goal (1 subgoal):
 1. S \<subseteq> supp x
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
S \<subseteq> supp x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_interior_nonempty_interior:
  fixes S :: "'n::euclidean_space set"
  shows "interior S \<noteq> {} \<Longrightarrow> rel_interior S = interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior S \<noteq> {} \<Longrightarrow> rel_interior S = interior S
[PROOF STEP]
by (metis interior_rel_interior_gen)


[STATEMENT]
lemma min_int_poly_prime_elem [intro]:
  fixes x :: "'a :: {field_char_0, field_gcd}"
  shows "prime_elem (min_int_poly x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_elem (min_int_poly x)
[PROOF STEP]
using min_int_poly_irreducible[of x]
[PROOF STATE]
proof (prove)
using this:
irreducible (min_int_poly x)

goal (1 subgoal):
 1. prime_elem (min_int_poly x)
[PROOF STEP]
by blast


[STATEMENT]
lemma (in ring) canonical_proj_ext_tl:
  "(\<lambda>a. canonical_proj_ext I (Suc n) a) = (\<lambda>a. ((I 0) +> a) # (canonical_proj_ext (\<lambda>i. I (Suc i)) n a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. canonical_proj_ext I (Suc n) = (\<lambda>a. (I 0 +> a) # canonical_proj_ext (\<lambda>i. I (Suc i)) n a)
[PROOF STEP]
unfolding canonical_proj_ext_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. map (\<lambda>i. I i +> a) [0..<Suc (Suc n)]) = (\<lambda>a. (I 0 +> a) # map (\<lambda>i. I (Suc i) +> a) [0..<Suc n])
[PROOF STEP]
by (induct n) (auto, metis (lifting) append.assoc append_Cons append_Nil)


[STATEMENT]
lemma piecewise_C1_differentiable_affine:
  fixes m::real
  assumes "f piecewise_C1_differentiable_on ((\<lambda>x. m * x + c) ` S)"
  shows "(f \<circ> (\<lambda>x. m *\<^sub>R x + c)) piecewise_C1_differentiable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
proof (cases "m = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
 2. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
 2. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m = 0

goal (1 subgoal):
 1. f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
m = 0

goal (1 subgoal):
 1. (\<lambda>x. f (m *\<^sub>R x + c)) piecewise_C1_differentiable_on S
[PROOF STEP]
by (auto simp: piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
m \<noteq> 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
have *: "\<And>x. finite (S \<inter> {y. m * y + c = x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. finite (S \<inter> {y. m * y + c = x})
[PROOF STEP]
using False not_finite_existsD
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0
infinite {a. ?P a} \<Longrightarrow> \<exists>a. ?P a

goal (1 subgoal):
 1. \<And>x. finite (S \<inter> {y. m * y + c = x})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
finite (S \<inter> {y. m * y + c = ?x})

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S
[PROOF STEP]
apply (rule piecewise_C1_differentiable_compose [OF C1_differentiable_imp_piecewise])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. m *\<^sub>R x + c) C1_differentiable_on S
 2. f piecewise_C1_differentiable_on (\<lambda>x. m *\<^sub>R x + c) ` S
 3. \<And>x. finite (S \<inter> (\<lambda>x. m *\<^sub>R x + c) -` {x})
[PROOF STEP]
apply (rule * assms derivative_intros | simp add: False vimage_def)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_C1_differentiable_on S

goal:
No subgoals!
[PROOF STEP]
qed