[STATEMENT]
lemma eq_mask_less:
  fixes w :: "'a::len word"
  assumes eqm: "w = w AND mask n"
  and      sz: "n < len_of TYPE ('a)"
  shows "w < (2::'a word) ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w < 2 ^ n
[PROOF STEP]
by (subst eqm, rule and_mask_less' [OF sz])


[STATEMENT]
lemma (in monoid) properfactor_prod_r:
  assumes ab: "properfactor G a b"
    and carr[simp]: "a \<in> carrier G"  "b \<in> carrier G"  "c \<in> carrier G"
  shows "properfactor G a (b \<otimes> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properfactor G a (b \<otimes> c)
[PROOF STEP]
by (intro properfactor_trans2[OF ab] divides_prod_r) simp_all


[STATEMENT]
lemma bdd_above_multiset_imp_bdd_above_count:
  assumes "subset_mset.bdd_above (A :: 'a multiset set)"
  shows   "bdd_above ((\<lambda>X. count X x) ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above ((\<lambda>X. count X x) ` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bdd_above ((\<lambda>X. count X x) ` A)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
subset_mset.bdd_above A
[PROOF STEP]
obtain Y where Y: "\<forall>X\<in>A. X \<subseteq># Y"
[PROOF STATE]
proof (prove)
using this:
subset_mset.bdd_above A

goal (1 subgoal):
 1. (\<And>Y. \<forall>X\<in>A. X \<subseteq># Y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson subset_mset.bdd_above.E)
[PROOF STATE]
proof (state)
this:
\<forall>X\<in>A. X \<subseteq># Y

goal (1 subgoal):
 1. bdd_above ((\<lambda>X. count X x) ` A)
[PROOF STEP]
hence "count X x \<le> count Y x" if "X \<in> A" for X
[PROOF STATE]
proof (prove)
using this:
\<forall>X\<in>A. X \<subseteq># Y

goal (1 subgoal):
 1. count X x \<le> count Y x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<forall>X\<in>A. X \<subseteq># Y
X \<in> A

goal (1 subgoal):
 1. count X x \<le> count Y x
[PROOF STEP]
by (auto intro: mset_subset_eq_count)
[PROOF STATE]
proof (state)
this:
?X \<in> A \<Longrightarrow> count ?X x \<le> count Y x

goal (1 subgoal):
 1. bdd_above ((\<lambda>X. count X x) ` A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?X \<in> A \<Longrightarrow> count ?X x \<le> count Y x

goal (1 subgoal):
 1. bdd_above ((\<lambda>X. count X x) ` A)
[PROOF STEP]
by (intro bdd_aboveI[of _ "count Y x"]) auto
[PROOF STATE]
proof (state)
this:
bdd_above ((\<lambda>X. count X x) ` A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mem_Epigraph: "(x, y) \<in> Epigraph S f \<longleftrightarrow> x \<in> S \<and> f x \<le> ereal y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> Epigraph S f) = (x \<in> S \<and> f x \<le> ereal y)
[PROOF STEP]
unfolding Epigraph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> {xy. fst xy \<in> S \<and> f (fst xy) \<le> ereal (snd xy)}) = (x \<in> S \<and> f x \<le> ereal y)
[PROOF STEP]
by auto


[STATEMENT]
lemma  Amin_geTr:"(\<forall>j \<le> n. f j \<in> Z\<^sub>\<infinity>) \<and> (\<forall>j \<le> n. z \<le> (f j)) \<longrightarrow>
                                 z \<le> (Amin n f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>j\<le>n. f j \<in> Z\<^sub>\<infinity>) \<and> (\<forall>j\<le>n. z \<le> f j) \<longrightarrow> z \<le> Amin n f
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<forall>j\<le>0. f j \<in> Z\<^sub>\<infinity>) \<and> (\<forall>j\<le>0. z \<le> f j) \<longrightarrow> z \<le> Amin 0 f
 2. \<And>n. (\<forall>j\<le>n. f j \<in> Z\<^sub>\<infinity>) \<and> (\<forall>j\<le>n. z \<le> f j) \<longrightarrow> z \<le> Amin n f \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> Z\<^sub>\<infinity>) \<and> (\<forall>j\<le>Suc n. z \<le> f j) \<longrightarrow> z \<le> Amin (Suc n) f
[PROOF STEP]
apply (rule impI, erule conjE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (\<forall>j\<le>n. f j \<in> Z\<^sub>\<infinity>) \<and> (\<forall>j\<le>n. z \<le> f j) \<longrightarrow> z \<le> Amin n f \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> Z\<^sub>\<infinity>) \<and> (\<forall>j\<le>Suc n. z \<le> f j) \<longrightarrow> z \<le> Amin (Suc n) f
[PROOF STEP]
apply (rule impI, (erule conjE)+,
       cut_tac Nsetn_sub_mem1[of n], simp,
       drule_tac x = "Suc n" in spec, simp,
       rule_tac z = z and x = "Amin n f" and y = "f(Suc n)" in amin_ge1,
       simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sym_factor_idem[simp]: "sym_factor (sym_factor r) = sym_factor r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym_factor (sym_factor r) = sym_factor r
[PROOF STEP]
using sym_factor_absorb_if_sym[OF sym_sym_factor]
[PROOF STATE]
proof (prove)
using this:
sym_factor (sym_factor ?r1) = sym_factor ?r1

goal (1 subgoal):
 1. sym_factor (sym_factor r) = sym_factor r
[PROOF STEP]
.


[STATEMENT]
lemma d_s_prod_eq_meet: "d x \<cdot> d y = d x \<sqinter> d y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x \<cdot> d y = d x \<sqinter> d y
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d x \<cdot> d y \<le> d x \<sqinter> d y
 2. d x \<sqinter> d y \<le> d x \<cdot> d y
[PROOF STEP]
apply (metis local.d_lb1 local.d_lb2 local.meet_glb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x \<sqinter> d y \<le> d x \<cdot> d y
[PROOF STEP]
by (metis d_meet_closed local.inf_le1 local.inf_le2 local.d_glb)


[STATEMENT]
lemma mat_of_cblinfun_minus:
  "mat_of_cblinfun (M - N) = mat_of_cblinfun M - mat_of_cblinfun N"
  for M::"'a::{basis_enum,complex_normed_vector} \<Rightarrow>\<^sub>C\<^sub>L 'b::{basis_enum,complex_normed_vector}" and N::"'a \<Rightarrow>\<^sub>C\<^sub>L'b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (M - N) = mat_of_cblinfun M - mat_of_cblinfun N
[PROOF STEP]
by (smt (z3) add_uminus_minus_mat mat_of_cblinfun_uminus mat_carrier mat_of_cblinfun_def mat_of_cblinfun_plus pth_2)


[STATEMENT]
lemma the_min_eq_zero: "the_min = (0::'a::{the_min,nat})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
have "the_min \<le> (0::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_min \<le> (0::'a)
[PROOF STEP]
by (fact the_min_min)
[PROOF STATE]
proof (state)
this:
the_min \<le> (0::'a)

goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
hence "rep_nat (the_min::'a) \<le> rep_nat (0::'a)"
[PROOF STATE]
proof (prove)
using this:
the_min \<le> (0::'a)

goal (1 subgoal):
 1. rep_nat the_min \<le> rep_nat (0::'a)
[PROOF STEP]
by (simp only: ord_iff)
[PROOF STATE]
proof (state)
this:
rep_nat the_min \<le> rep_nat (0::'a)

goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rep_nat the_min \<le> rep_nat (0::'a)

goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rep_nat (0::'a) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rep_nat (0::'a) = 0

goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rep_nat the_min \<le> 0
[PROOF STEP]
have "rep_nat (the_min::'a) = 0"
[PROOF STATE]
proof (prove)
using this:
rep_nat the_min \<le> 0

goal (1 subgoal):
 1. rep_nat the_min = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rep_nat the_min = 0

goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
rep_nat the_min = 0

goal (1 subgoal):
 1. the_min = (0::'a)
[PROOF STEP]
by (simp only: rep_zero_iff)
[PROOF STATE]
proof (state)
this:
the_min = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "0b110 OR 0b011 = (0b111 :: 8 word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 6 OR 3 = 7
[PROOF STEP]
by simp


[STATEMENT]
lemma "\<exists>x. \<forall>y::'a::linordered_field. y < 2 \<longrightarrow> 2 * (y - x) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. \<forall>y<2::'a. (2::'a) * (y - x) \<le> (0::'a)
[PROOF STEP]
by ferrack


[STATEMENT]
lemma one_over_fun_smult_eval:
  assumes "f \<in> carrier (SA n)"
  assumes "a \<noteq> \<zero>"
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f x \<noteq> \<zero>"
  shows "one_over_fun n (a \<odot>\<^bsub>SA n\<^esub>f) x = inv (a \<otimes> (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_over_fun n (a \<odot>\<^bsub>SA n\<^esub> f) x = inv (a \<otimes> f x)
[PROOF STEP]
using one_over_fun_eq[of "a \<odot>\<^bsub>SA n\<^esub> f" n x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<odot>\<^bsub>SA n\<^esub> f \<in> carrier (SA n); x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>); (a \<odot>\<^bsub>SA n\<^esub> f) x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> one_over_fun n (a \<odot>\<^bsub>SA n\<^esub> f) x = inv (a \<odot>\<^bsub>SA n\<^esub> f) x
f \<in> carrier (SA n)
a \<noteq> \<zero>
a \<in> carrier Q\<^sub>p
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f x \<noteq> \<zero>

goal (1 subgoal):
 1. one_over_fun n (a \<odot>\<^bsub>SA n\<^esub> f) x = inv (a \<otimes> f x)
[PROOF STEP]
by (metis Qp.function_ring_car_memE Qp.integral SA_car_memE(2) SA_smult_closed SA_smult_formula)


[STATEMENT]
lemma less_eq_multiset\<^sub>H\<^sub>O:
  "M \<le> N \<longleftrightarrow> (\<forall>y. count N y < count M y \<longrightarrow> (\<exists>x. y < x \<and> count M x < count N x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M \<le> N) = (\<forall>y. count N y < count M y \<longrightarrow> (\<exists>x>y. count M x < count N x))
[PROOF STEP]
by (auto simp: less_eq_multiset_def less_multiset\<^sub>H\<^sub>O)


[STATEMENT]
lemma span_eq_dim: "span S = span T \<Longrightarrow> dim S = dim T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span S = span T \<Longrightarrow> dim S = dim T
[PROOF STEP]
by (metis dim_span)


[STATEMENT]
lemma limit_mat_minus:
  fixes X :: "nat \<Rightarrow> complex mat" and Y :: "nat \<Rightarrow> complex mat" and A :: "complex mat"
    and m :: nat and B :: "complex mat"
  assumes limX: "limit_mat X A m" and limY: "limit_mat Y B m"
  shows "limit_mat (\<lambda>k. X k - Y k) (A - B) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have dimA: "A \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat m m
[PROOF STEP]
using limX limit_mat_def
[PROOF STATE]
proof (prove)
using this:
limit_mat X A m
limit_mat ?X ?A ?m = (\<forall>n. ?X n \<in> carrier_mat ?m ?m \<and> ?A \<in> carrier_mat ?m ?m \<and> (\<forall>i<?m. \<forall>j<?m. (\<lambda>n. ?X n $$ (i, j)) \<longlonglongrightarrow> ?A $$ (i, j)))

goal (1 subgoal):
 1. A \<in> carrier_mat m m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat m m

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have dimB: "B \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat m m
[PROOF STEP]
using limY limit_mat_def
[PROOF STATE]
proof (prove)
using this:
limit_mat Y B m
limit_mat ?X ?A ?m = (\<forall>n. ?X n \<in> carrier_mat ?m ?m \<and> ?A \<in> carrier_mat ?m ?m \<and> (\<forall>i<?m. \<forall>j<?m. (\<lambda>n. ?X n $$ (i, j)) \<longlonglongrightarrow> ?A $$ (i, j)))

goal (1 subgoal):
 1. B \<in> carrier_mat m m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat m m

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have dimX: "\<And>n. X n \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. X n \<in> carrier_mat m m
[PROOF STEP]
using limX
[PROOF STATE]
proof (prove)
using this:
limit_mat X A m

goal (1 subgoal):
 1. \<And>n. X n \<in> carrier_mat m m
[PROOF STEP]
unfolding limit_mat_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. X n \<in> carrier_mat m m \<and> A \<in> carrier_mat m m \<and> (\<forall>i<m. \<forall>j<m. (\<lambda>n. X n $$ (i, j)) \<longlonglongrightarrow> A $$ (i, j))

goal (1 subgoal):
 1. \<And>n. X n \<in> carrier_mat m m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X ?n \<in> carrier_mat m m

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have dimY: "\<And>n. Y n \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. Y n \<in> carrier_mat m m
[PROOF STEP]
using limY
[PROOF STATE]
proof (prove)
using this:
limit_mat Y B m

goal (1 subgoal):
 1. \<And>n. Y n \<in> carrier_mat m m
[PROOF STEP]
unfolding limit_mat_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. Y n \<in> carrier_mat m m \<and> B \<in> carrier_mat m m \<and> (\<forall>i<m. \<forall>j<m. (\<lambda>n. Y n $$ (i, j)) \<longlonglongrightarrow> B $$ (i, j))

goal (1 subgoal):
 1. \<And>n. Y n \<in> carrier_mat m m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Y ?n \<in> carrier_mat m m

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have "-1 \<cdot>\<^sub>m Y n = - Y n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 \<cdot>\<^sub>m Y n = - Y n
[PROOF STEP]
using dimY
[PROOF STATE]
proof (prove)
using this:
Y ?n \<in> carrier_mat m m

goal (1 subgoal):
 1. - 1 \<cdot>\<^sub>m Y n = - Y n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- 1 \<cdot>\<^sub>m Y ?n = - Y ?n

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- 1 \<cdot>\<^sub>m Y ?n = - Y ?n

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have "-1 \<cdot>\<^sub>m B = - B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 \<cdot>\<^sub>m B = - B
[PROOF STEP]
using dimB
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat m m

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

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- 1 \<cdot>\<^sub>m Y ?n = - Y ?n
- 1 \<cdot>\<^sub>m B = - B
[PROOF STEP]
have "limit_mat (\<lambda>n. - Y n) (- B) m"
[PROOF STATE]
proof (prove)
using this:
- 1 \<cdot>\<^sub>m Y ?n = - Y ?n
- 1 \<cdot>\<^sub>m B = - B

goal (1 subgoal):
 1. limit_mat (\<lambda>n. - Y n) (- B) m
[PROOF STEP]
using limit_mat_scale[OF limY, of "-1"]
[PROOF STATE]
proof (prove)
using this:
- 1 \<cdot>\<^sub>m Y ?n = - Y ?n
- 1 \<cdot>\<^sub>m B = - B
limit_mat (\<lambda>n. - 1 \<cdot>\<^sub>m Y n) (- 1 \<cdot>\<^sub>m B) m

goal (1 subgoal):
 1. limit_mat (\<lambda>n. - Y n) (- B) m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
limit_mat (\<lambda>n. - Y n) (- B) m

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limit_mat (\<lambda>n. - Y n) (- B) m
[PROOF STEP]
have "limit_mat (\<lambda>n. X n + (- Y n)) (A + (- B)) m"
[PROOF STATE]
proof (prove)
using this:
limit_mat (\<lambda>n. - Y n) (- B) m

goal (1 subgoal):
 1. limit_mat (\<lambda>n. X n + - Y n) (A + - B) m
[PROOF STEP]
using limit_mat_add limX
[PROOF STATE]
proof (prove)
using this:
limit_mat (\<lambda>n. - Y n) (- B) m
\<lbrakk>limit_mat ?X ?A ?m; limit_mat ?Y ?B ?m\<rbrakk> \<Longrightarrow> limit_mat (\<lambda>k. ?X k + ?Y k) (?A + ?B) ?m
limit_mat X A m

goal (1 subgoal):
 1. limit_mat (\<lambda>n. X n + - Y n) (A + - B) m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
limit_mat (\<lambda>n. X n + - Y n) (A + - B) m

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
limit_mat (\<lambda>n. X n + - Y n) (A + - B) m

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have "X n + (- Y n) = X n - Y n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X n + - Y n = X n - Y n
[PROOF STEP]
using dimX dimY
[PROOF STATE]
proof (prove)
using this:
X ?n \<in> carrier_mat m m
Y ?n \<in> carrier_mat m m

goal (1 subgoal):
 1. X n + - Y n = X n - Y n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X ?n + - Y ?n = X ?n - Y ?n

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
X ?n + - Y ?n = X ?n - Y ?n

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
have "A + (- B) = A - B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + - B = A - B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A + - B = A - B

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
limit_mat (\<lambda>n. X n + - Y n) (A + - B) m
X ?n + - Y ?n = X ?n - Y ?n
A + - B = A - B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
limit_mat (\<lambda>n. X n + - Y n) (A + - B) m
X ?n + - Y ?n = X ?n - Y ?n
A + - B = A - B

goal (1 subgoal):
 1. limit_mat (\<lambda>k. X k - Y k) (A - B) m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
limit_mat (\<lambda>k. X k - Y k) (A - B) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma col_cong2_bet3:
  assumes "Col A B D" and
    "Bet A B C" and
    "Cong A B C D" and
    "Cong A C B D"
  shows "Bet B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bet B C D
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) assms(4) bet__le1213 bet__le2313 bet_col col_transitivity_2 cong_diff_3 cong_reflexivity l5_12_b l5_6 not_bet_distincts)


[STATEMENT]
lemma listprepend_correct: "dnf_to_bool \<gamma> (listprepend as ds) \<longleftrightarrow> (\<exists>a\<in> set as. dnf_to_bool \<gamma> [[a]] \<and> dnf_to_bool \<gamma> ds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dnf_to_bool \<gamma> (listprepend as ds) = (\<exists>a\<in>set as. dnf_to_bool \<gamma> [[a]] \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(induction as)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dnf_to_bool \<gamma> (listprepend [] ds) = (\<exists>a\<in>set []. dnf_to_bool \<gamma> [[a]] \<and> dnf_to_bool \<gamma> ds)
 2. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = (\<exists>a\<in>set as. dnf_to_bool \<gamma> [[a]] \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (listprepend (a # as) ds) = (\<exists>a\<in>set (a # as). dnf_to_bool \<gamma> [[a]] \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = (\<exists>a\<in>set as. dnf_to_bool \<gamma> [[a]] \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (listprepend (a # as) ds) = (\<exists>a\<in>set (a # as). dnf_to_bool \<gamma> [[a]] \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = ((\<exists>a\<in>set as. cnf_to_bool \<gamma> [a]) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (map ((#) a) ds @ listprepend as ds) = ((cnf_to_bool \<gamma> [a] \<or> (\<exists>a\<in>set as. cnf_to_bool \<gamma> [a])) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(rename_tac a as)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = ((\<exists>a\<in>set as. cnf_to_bool \<gamma> [a]) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (map ((#) a) ds @ listprepend as ds) = ((cnf_to_bool \<gamma> [a] \<or> (\<exists>a\<in>set as. cnf_to_bool \<gamma> [a])) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(simp add: map_a_and cnf_to_bool_append dnf_to_bool_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = ((\<exists>a\<in>set as. cnf_to_bool \<gamma> [a]) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> (cnf_to_bool \<gamma> [a] \<and> dnf_to_bool \<gamma> ds \<or> (\<exists>a\<in>set as. cnf_to_bool \<gamma> [a]) \<and> dnf_to_bool \<gamma> ds) = ((cnf_to_bool \<gamma> [a] \<or> (\<exists>a\<in>set as. cnf_to_bool \<gamma> [a])) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
by blast


[STATEMENT]
lemma convex_with_UNIV_domain:
  fixes f :: "'a::euclidean_space \<Rightarrow> ereal"
  assumes "convex_on UNIV f"
  assumes "domain f = UNIV"
  shows "(\<forall>x. f x > -\<infinity>) \<or> (\<forall>x. f x = -\<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. - \<infinity> < f x) \<or> (\<forall>x. f x = - \<infinity>)
[PROOF STEP]
by (metis assms convex_improper ereal_MInfty_lessI proper_iff rel_interior_UNIV UNIV_I)


[STATEMENT]
lemma assoc_simps [simp]:
    assumes "ide f" and "ide g" and "ide h" and "src f = trg g" and "src g = trg h"
    shows "arr (assoc f g h)"
    and "dom (assoc f g h) = hcomp (hcomp f g) h"
    and "cod (assoc f g h) = hcomp f (hcomp g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr (assoc f g h) &&& local.dom (assoc f g h) = hcomp (hcomp f g) h &&& cod (assoc f g h) = hcomp f (hcomp g h)
[PROOF STEP]
using assms assoc_in_hom
[PROOF STATE]
proof (prove)
using this:
ide f
ide g
ide h
src f = trg g
src g = trg h
\<lbrakk>ide ?f; ide ?g; ide ?h; src ?f = trg ?g; src ?g = trg ?h\<rbrakk> \<Longrightarrow> \<guillemotleft>assoc ?f ?g ?h : hcomp (hcomp ?f ?g) ?h \<Rightarrow> hcomp ?f (hcomp ?g ?h)\<guillemotright>

goal (1 subgoal):
 1. arr (assoc f g h) &&& local.dom (assoc f g h) = hcomp (hcomp f g) h &&& cod (assoc f g h) = hcomp f (hcomp g h)
[PROOF STEP]
by auto


[STATEMENT]
lemma intersect_list_language[simp]: "NBA.language (intersect_list AA) = \<Inter> (NBA.language ` set AA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NBA.language (intersect_list AA) = \<Inter> (NBA.language ` set AA)
[PROOF STEP]
by simp


[STATEMENT]
lemma measure_Un2:
  "A \<in> fmeasurable M \<Longrightarrow> B \<in> fmeasurable M \<Longrightarrow> measure M (A \<union> B) = measure M A + measure M (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> fmeasurable M; B \<in> fmeasurable M\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> B) = Sigma_Algebra.measure M A + Sigma_Algebra.measure M (B - A)
[PROOF STEP]
using measure_Union[of M A "B - A"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>emeasure M A \<noteq> \<infinity>; emeasure M (B - A) \<noteq> \<infinity>; A \<in> sets M; B - A \<in> sets M; A \<inter> (B - A) = {}\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> (B - A)) = Sigma_Algebra.measure M A + Sigma_Algebra.measure M (B - A)

goal (1 subgoal):
 1. \<lbrakk>A \<in> fmeasurable M; B \<in> fmeasurable M\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> B) = Sigma_Algebra.measure M A + Sigma_Algebra.measure M (B - A)
[PROOF STEP]
by (auto simp: fmeasurableD2 fmeasurable.Diff)


[STATEMENT]
lemma int_not_not: "NOT (NOT x) = x"
  for x :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NOT (NOT x) = x
[PROOF STEP]
by (fact bit.double_compl)


[STATEMENT]
lemma mod [simp]: "\<chi> (a mod n) = \<chi> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> (a mod n) = \<chi> a
[PROOF STEP]
by (rule cong) (simp_all add: cong_def)


[STATEMENT]
lemma qbs_prob_integral_indep1:
  assumes "qbs_integrable p f"
  shows "(\<integral>\<^sub>Q z. f (fst z) \<partial>(p \<Otimes>\<^sub>Q\<^sub>m\<^sub>e\<^sub>s q)) = (\<integral>\<^sub>Q x. f x \<partial>p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sub>Q z. f (fst z) \<partial>p \<Otimes>\<^sub>Q\<^sub>m\<^sub>e\<^sub>s q = qbs_prob_integral p f
[PROOF STEP]
using qbs_prob_integral_Fubini_snd[OF qbs_integrable_indep1[OF assms],of q]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sub>Q y. \<integral>\<^sub>Q x. f (fst (x, y)) \<partial>p \<partial>q = \<integral>\<^sub>Q z. f (fst z) \<partial>p \<Otimes>\<^sub>Q\<^sub>m\<^sub>e\<^sub>s q

goal (1 subgoal):
 1. \<integral>\<^sub>Q z. f (fst z) \<partial>p \<Otimes>\<^sub>Q\<^sub>m\<^sub>e\<^sub>s q = qbs_prob_integral p f
[PROOF STEP]
by(simp add: qbs_prob_integral_const)


[STATEMENT]
lemma ex_least_set:"\<lbrakk>A = {H. finite H \<and> P H}; H \<in> A\<rbrakk> \<Longrightarrow>
                       \<exists>K \<in> A. (LEAST j. j \<in> (card ` A)) =  card K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = {H. finite H \<and> P H}; H \<in> A\<rbrakk> \<Longrightarrow> \<exists>K\<in>A. (LEAST j. j \<in> card ` A) = card K
[PROOF STEP]
(* proof by L. C. Paulson *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = {H. finite H \<and> P H}; H \<in> A\<rbrakk> \<Longrightarrow> \<exists>K\<in>A. (LEAST j. j \<in> card ` A) = card K
[PROOF STEP]
by (simp add:image_def, rule LeastI, rule_tac x = "H" in exI, simp)


[STATEMENT]
lemma Arccos_bounds: "\<bar>Re z\<bar> < 1 \<Longrightarrow> 0 < Re(Arccos z) \<and> Re(Arccos z) < pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Re z\<bar> < 1 \<Longrightarrow> 0 < Re (Arccos z) \<and> Re (Arccos z) < pi
[PROOF STEP]
unfolding Re_Arccos
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Re z\<bar> < 1 \<Longrightarrow> 0 < Im (Ln (z + \<i> * csqrt (1 - z\<^sup>2))) \<and> Im (Ln (z + \<i> * csqrt (1 - z\<^sup>2))) < pi
[PROOF STEP]
by (blast intro!: Im_Ln_pos_lt_imp Arccos_range_lemma)


[STATEMENT]
lemma bernoulli_pmf_0: "bernoulli_pmf 0 = return_pmf False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli_pmf 0 = return_pmf False
[PROOF STEP]
by(rule pmf_eqI)(simp split: split_indicator)


[STATEMENT]
lemma coprime_cong_prime_factors:
  fixes x y :: "'a :: factorial_semiring_gcd"
  assumes "x \<noteq> 0" "y \<noteq> 0" "x' \<noteq> 0" "y' \<noteq> 0"
  assumes "prime_factors x = prime_factors x'"
  assumes "prime_factors y = prime_factors y'"
  shows   "coprime x y \<longleftrightarrow> coprime x' y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime x y = coprime x' y'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)
y \<noteq> (0::'a)
x' \<noteq> (0::'a)
y' \<noteq> (0::'a)
prime_factors x = prime_factors x'
prime_factors y = prime_factors y'

goal (1 subgoal):
 1. coprime x y = coprime x' y'
[PROOF STEP]
by (simp add: coprime_iff_prime_factors_disjoint)


[STATEMENT]
lemma AE_PiM_component:
  "(\<And>i. i \<in> I \<Longrightarrow> prob_space (M i)) \<Longrightarrow> i \<in> I \<Longrightarrow> AE x in M i. P x \<Longrightarrow> AE x in PiM I M. P (x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<in> I \<Longrightarrow> prob_space (M i); i \<in> I; almost_everywhere (M i) P\<rbrakk> \<Longrightarrow> AE x in Pi\<^sub>M I M. P (x i)
[PROOF STEP]
using AE_distrD[of "\<lambda>x. x i" "PiM I M" "M i"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>x. x i) \<in> Pi\<^sub>M I M \<rightarrow>\<^sub>M M i; almost_everywhere (distr (Pi\<^sub>M I M) (M i) (\<lambda>x. x i)) ?P\<rbrakk> \<Longrightarrow> AE x in Pi\<^sub>M I M. ?P (x i)

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<in> I \<Longrightarrow> prob_space (M i); i \<in> I; almost_everywhere (M i) P\<rbrakk> \<Longrightarrow> AE x in Pi\<^sub>M I M. P (x i)
[PROOF STEP]
by (subst (asm) distr_PiM_component[of I _ i]) (auto intro: AE_distrD[of "\<lambda>x. x i" _ _ P])


[STATEMENT]
lemma lmeasure_integral_UNIV: "S \<in> lmeasurable \<Longrightarrow> measure lebesgue S = integral UNIV (indicator S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> lmeasurable \<Longrightarrow> Sigma_Algebra.measure lebesgue S = integral UNIV (indicat_real S)
[PROOF STEP]
by (simp add: lmeasurable_iff_has_integral integral_unique)


[STATEMENT]
lemma octo_inner_e3_left [simp]: "inner e3 x = Im3 x"
 and  octo_inner_e3_right [simp]: "inner x e3 = Im3 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e3 \<bullet> x = Im3 x &&& x \<bullet> e3 = Im3 x
[PROOF STEP]
unfolding inner_octo_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ree e3 * Ree x + Im1 e3 * Im1 x + Im2 e3 * Im2 x + Im3 e3 * Im3 x + Im4 e3 * Im4 x + Im5 e3 * Im5 x + Im6 e3 * Im6 x + Im7 e3 * Im7 x = Im3 x &&& Ree x * Ree e3 + Im1 x * Im1 e3 + Im2 x * Im2 e3 + Im3 x * Im3 e3 + Im4 x * Im4 e3 + Im5 x * Im5 e3 + Im6 x * Im6 e3 + Im7 x * Im7 e3 = Im3 x
[PROOF STEP]
by simp_all


[STATEMENT]
lemma in_polychain_of_ccw:
  assumes "e \<in> UNIV \<rightarrow> {0 <..< 1}"
  assumes "ccw'.sortedP 0 qs"
  assumes "length qs \<noteq> 1"
  assumes "seg \<in> set (polychain_of Pc qs)"
  shows "ccw' (fst seg) (snd seg) (Pc + (\<Sum>P \<in> set qs. e P *\<^sub>R P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw' (fst seg) (snd seg) (Pc + (\<Sum>P\<in>set qs. e P *\<^sub>R P))
[PROOF STEP]
using polychain_of_ccw[OF assms(1,2,3)] assms(4)
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>(xi, xj). ccw' xi xj (?Pc + (\<Sum>P\<in>set qs. e P *\<^sub>R P))) (polychain_of ?Pc qs)
seg \<in> set (polychain_of Pc qs)

goal (1 subgoal):
 1. ccw' (fst seg) (snd seg) (Pc + (\<Sum>P\<in>set qs. e P *\<^sub>R P))
[PROOF STEP]
by (simp add: list_all_iff split_beta)


[STATEMENT]
lemma succ_le_TC_iff: "Ord j \<Longrightarrow> succ i \<sqsubseteq> j \<longleftrightarrow> i \<sqsubset> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord j \<Longrightarrow> (ZFC_in_HOL.succ i \<sqsubseteq> j) = (i \<sqsubset> j)
[PROOF STEP]
by (metis Ord_in_Ord Ord_linear Ord_mem_iff_less_TC Ord_succ le_TC_def less_TC_succ less_asym_TC)


[STATEMENT]
lemma representation_eqI:
  assumes basis: "independent basis" and b: "v \<in> span basis"
    and ne_zero: "\<And>b. f b \<noteq> 0 \<Longrightarrow> b \<in> basis"
    and finite: "finite {b. f b \<noteq> 0}"
    and eq: "(\<Sum>b | f b \<noteq> 0. f b *s b) = v"
  shows "representation basis v = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. representation basis v = f
[PROOF STEP]
by (rule unique_representation[OF basis])
     (auto simp: representation_ne_zero finite_representation
       sum_nonzero_representation_eq[OF basis b] ne_zero finite eq)


[STATEMENT]
lemma mult_neg_pos: "a < 0 \<Longrightarrow> 0 < b \<Longrightarrow> a * b < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < (0::'a); (0::'a) < b\<rbrakk> \<Longrightarrow> a * b < (0::'a)
[PROOF STEP]
using mult_strict_right_mono [of a 0 b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < (0::'a); (0::'a) < b\<rbrakk> \<Longrightarrow> a * b < (0::'a) * b

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


[STATEMENT]
lemma Lim_bounded: "f \<longlonglongrightarrow> l \<Longrightarrow> \<forall>n\<ge>M. f n \<le> C \<Longrightarrow> l \<le> C"
  for l :: "'a::linorder_topology"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<longlonglongrightarrow> l; \<forall>n\<ge>M. f n \<le> C\<rbrakk> \<Longrightarrow> l \<le> C
[PROOF STEP]
by (intro LIMSEQ_le_const2) auto


[STATEMENT]
lemma flow0_image_UNIV:
  assumes "existence_ivl0 x = UNIV"
  shows "flow0 (flow0 x t) ` S = flow0 x ` (\<lambda>s. s + t) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow0 (flow0 x t) ` S = flow0 x ` (\<lambda>s. s + t) ` S
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. xa \<in> S \<Longrightarrow> flow0 (flow0 x t) xa \<in> flow0 x ` (\<lambda>s. s + t) ` S
 2. \<And>s. s \<in> S \<Longrightarrow> flow0 x (s + t) \<in> flow0 (flow0 x t) ` S
[PROOF STEP]
apply (metis UNIV_I add.commute assms image_eqI local.existence_ivl_trans' local.flow_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. s \<in> S \<Longrightarrow> flow0 x (s + t) \<in> flow0 (flow0 x t) ` S
[PROOF STEP]
by (metis UNIV_I add.commute assms imageI local.existence_ivl_trans' local.flow_trans)


[STATEMENT]
lemma csubspace_INF[simp]: "(\<And>x. x \<in> A \<Longrightarrow> csubspace x) \<Longrightarrow> csubspace (\<Inter>A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> csubspace x) \<Longrightarrow> csubspace (\<Inter> A)
[PROOF STEP]
by (simp add: complex_vector.subspace_Inter)


[STATEMENT]
lemma ordinal_exp_distrib:
"x ** (y + z) = (x ** y) * (x ** (z::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ** (y + z) = x ** y * x ** z
[PROOF STEP]
apply (case_tac "x = 0", simp_all add: ordinal_plus_not_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> x ** (y + z) = x ** y * x ** z
[PROOF STEP]
apply (rule_tac a=z in oLimit_induct, simp_all add: ordinal_times_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tendsto_inverse_0_at_top: "LIM x F. f x :> at_top \<Longrightarrow> ((\<lambda>x. inverse (f x) :: real) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F \<Longrightarrow> ((\<lambda>x. inverse (f x)) \<longlongrightarrow> 0) F
[PROOF STEP]
by (metis filterlim_at filterlim_mono[OF _ at_top_le_at_infinity order_refl] filterlim_inverse_at_iff)


[STATEMENT]
lemma DERIV_power[derivative_intros]:
  "(f has_field_derivative D) (at x within s) \<Longrightarrow>
    ((\<lambda>x. f x ^ n) has_field_derivative of_nat n * (D * f x ^ (n - Suc 0))) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within s) \<Longrightarrow> ((\<lambda>x. f x ^ n) has_field_derivative of_nat n * (D * f x ^ (n - Suc 0))) (at x within s)
[PROOF STEP]
by (rule has_derivative_imp_has_field_derivative[OF has_derivative_power])
     (auto simp: has_field_derivative_def)


[STATEMENT]
lemma r_cancel [simp]:
  "(y ** x = z ** x) = (y = z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y ** x = z ** x) = (y = z)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y ** x = z ** x \<Longrightarrow> y = z
 2. y = z \<Longrightarrow> y ** x = z ** x
[PROOF STEP]
assume eq: "y ** x = z ** x"
[PROOF STATE]
proof (state)
this:
y ** x = z ** x

goal (2 subgoals):
 1. y ** x = z ** x \<Longrightarrow> y = z
 2. y = z \<Longrightarrow> y ** x = z ** x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y ** x = z ** x
[PROOF STEP]
have "y ** (x ** inv x) = z ** (x ** inv x)"
[PROOF STATE]
proof (prove)
using this:
y ** x = z ** x

goal (1 subgoal):
 1. y ** (x ** local.inv x) = z ** (x ** local.inv x)
[PROOF STEP]
by (simp add: assoc [symmetric] del: r_inv)
[PROOF STATE]
proof (state)
this:
y ** (x ** local.inv x) = z ** (x ** local.inv x)

goal (2 subgoals):
 1. y ** x = z ** x \<Longrightarrow> y = z
 2. y = z \<Longrightarrow> y ** x = z ** x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y ** (x ** local.inv x) = z ** (x ** local.inv x)
[PROOF STEP]
show "y = z"
[PROOF STATE]
proof (prove)
using this:
y ** (x ** local.inv x) = z ** (x ** local.inv x)

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

goal (1 subgoal):
 1. y = z \<Longrightarrow> y ** x = z ** x
[PROOF STEP]
qed simp


[STATEMENT]
lemma finite_trees_of_size [simp,intro]: "finite (trees_of_size n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (trees_of_size n)
[PROOF STEP]
by (induction n rule: catalan.induct)
     (auto simp: trees_of_size_Suc intro!: finite_imageI finite_cartesian_product)


[STATEMENT]
lemma Red_I_eq_Red_I_diff_Red_F: "Red_I N = Red_I (N - Red_F N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Red_I N = Red_I (N - Red_F N)
[PROOF STEP]
unfolding Red_F_conv Red_I_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_std_red.Red_I N = fin_std_red.Red_I (N - fin_std_red.Red_F N)
[PROOF STEP]
by (rule fin_std_red.Red_I_eq_Red_I_diff_Red_F)


[STATEMENT]
lemma prime_multiplicity_squarefree_part_le_Suc_0 [intro]:
  assumes "prime p"
  shows   "multiplicity p (squarefree_part n) \<le> Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (squarefree_part n) \<le> Suc 0
[PROOF STEP]
by (simp add: assms prime_multiplicity_squarefree_part)


[STATEMENT]
lemma geodesic_segment_betweenI:
  assumes "g 0 = x" "g (dist x y) = y" "isometry_on {0..dist x y} g" "G = g`{0..dist x y}"
  shows "geodesic_segment_between G x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_segment_between G x y
[PROOF STEP]
unfolding geodesic_segment_between_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. g 0 = x \<and> g (dist x y) = y \<and> isometry_on {0..dist x y} g \<and> G = g ` {0..dist x y}
[PROOF STEP]
apply (rule exI[of _ g])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g 0 = x \<and> g (dist x y) = y \<and> isometry_on {0..dist x y} g \<and> G = g ` {0..dist x y}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g 0 = x
g (dist x y) = y
isometry_on {0..dist x y} g
G = g ` {0..dist x y}

goal (1 subgoal):
 1. g 0 = x \<and> g (dist x y) = y \<and> isometry_on {0..dist x y} g \<and> G = g ` {0..dist x y}
[PROOF STEP]
by auto


[STATEMENT]
lemma max_border_len_rev: "\<^bold>|max_border u\<^bold>| =  \<^bold>|max_border (rev u)\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>|max_border u\<^bold>| = \<^bold>|max_border (rev u)\<^bold>|
[PROOF STEP]
by (cases "u = \<epsilon>", simp, metis length_rev max_borderP_max_border max_borderP_rev_conv max_border_ex)


[STATEMENT]
lemma range_inter_basis_snd:
  shows "\<BB> (range g \<inter> range h) = h ` (snd ` \<CC>\<^sub>m g h)"
        "\<BB> (range g \<inter> range h) = g ` (fst ` \<CC>\<^sub>m g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> range g \<inter> range h = h ` snd ` \<CC>\<^sub>m g h &&& \<BB> range g \<inter> range h = g ` fst ` \<CC>\<^sub>m g h
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<BB> range g \<inter> range h = h ` snd ` \<CC>\<^sub>m g h
 2. \<BB> range g \<inter> range h = g ` fst ` \<CC>\<^sub>m g h
[PROOF STEP]
show "\<BB> (range g \<inter> range h) = h ` (snd ` \<CC>\<^sub>m g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> range g \<inter> range h = h ` snd ` \<CC>\<^sub>m g h
[PROOF STEP]
unfolding coin_set_inter_snd[folded image_comp, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> h ` snd ` \<CC> g h = h ` snd ` \<CC>\<^sub>m g h
[PROOF STEP]
using  min_coin_im_basis(1)
[PROOF STATE]
proof (prove)
using this:
\<BB> h ` snd ` \<CC> g h = h ` snd ` \<CC>\<^sub>m g h

goal (1 subgoal):
 1. \<BB> h ` snd ` \<CC> g h = h ` snd ` \<CC>\<^sub>m g h
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<BB> range g \<inter> range h = h ` snd ` \<CC>\<^sub>m g h

goal (1 subgoal):
 1. \<BB> range g \<inter> range h = g ` fst ` \<CC>\<^sub>m g h
[PROOF STEP]
show "\<BB> (range g \<inter> range h) = g ` (fst ` \<CC>\<^sub>m g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> range g \<inter> range h = g ` fst ` \<CC>\<^sub>m g h
[PROOF STEP]
unfolding coin_set_inter_fst[folded image_comp, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> g ` fst ` \<CC> g h = g ` fst ` \<CC>\<^sub>m g h
[PROOF STEP]
using min_coin_im_basis(2)
[PROOF STATE]
proof (prove)
using this:
\<BB> g ` fst ` \<CC> g h = g ` fst ` \<CC>\<^sub>m g h

goal (1 subgoal):
 1. \<BB> g ` fst ` \<CC> g h = g ` fst ` \<CC>\<^sub>m g h
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<BB> range g \<inter> range h = g ` fst ` \<CC>\<^sub>m g h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Suffixes_compower:
  assumes "A \<noteq> {}"
  shows   "Suffixes (A ^^ n) = insert [] (Suffixes A @@ (\<Union>k<n. A ^^ k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n}))
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
 2. \<And>n. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})) \<Longrightarrow> Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n}))

goal (2 subgoals):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
 2. \<And>n. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})) \<Longrightarrow> Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n}))
[PROOF STEP]
have "Suffixes (A ^^ Suc n) =
                   insert [] (Suffixes A @@ ((\<Union>k<n. A ^^ k) \<union> A ^^ n))"
[PROOF STATE]
proof (prove)
using this:
Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n}))

goal (1 subgoal):
 1. Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ (\<Union> ((^^) A ` {..<n}) \<union> A ^^ n))
[PROOF STEP]
by (simp_all add: assms conc_Un_distrib)
[PROOF STATE]
proof (state)
this:
Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ (\<Union> ((^^) A ` {..<n}) \<union> A ^^ n))

goal (2 subgoals):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
 2. \<And>n. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})) \<Longrightarrow> Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ (\<Union> ((^^) A ` {..<n}) \<union> A ^^ n))

goal (2 subgoals):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
 2. \<And>n. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})) \<Longrightarrow> Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
have "(\<Union>k<n. A ^^ k) \<union> A ^^ n = (\<Union>k\<in>insert n {..<n}. A ^^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> ((^^) A ` {..<n}) \<union> A ^^ n = \<Union> ((^^) A ` insert n {..<n})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> ((^^) A ` {..<n}) \<union> A ^^ n = \<Union> ((^^) A ` insert n {..<n})

goal (2 subgoals):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
 2. \<And>n. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})) \<Longrightarrow> Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> ((^^) A ` {..<n}) \<union> A ^^ n = \<Union> ((^^) A ` insert n {..<n})

goal (2 subgoals):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
 2. \<And>n. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})) \<Longrightarrow> Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
have "insert n {..<n} = {..<Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert n {..<n} = {..<Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert n {..<n} = {..<Suc n}

goal (2 subgoals):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
 2. \<And>n. Suffixes (A ^^ n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})) \<Longrightarrow> Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))

goal (1 subgoal):
 1. Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Suffixes (A ^^ Suc n) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<Suc n}))

goal (1 subgoal):
 1. Suffixes (A ^^ 0) = insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<0}))
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma no_hide_read: "(\<forall>y. c y \<notin> B) \<Longrightarrow> ((c `?` x \<rightarrow> (P x)) \\ B) = (c `?` x \<rightarrow> ((P x) \\ B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. c y \<notin> B \<Longrightarrow> read c UNIV P \ B = (c`?`x \<rightarrow> P x \ B)
[PROOF STEP]
by (simp add: read_def o_def, subst hide_mprefix_distr, auto)


[STATEMENT]
lemma set_vebt_equal[vebt_simps]: "invar_vebt t\<^sub>1 n \<Longrightarrow> invar_vebt t\<^sub>2 n \<Longrightarrow> t\<^sub>1=t\<^sub>2 \<longleftrightarrow> set_vebt t\<^sub>1 = set_vebt t\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt t\<^sub>1 n; invar_vebt t\<^sub>2 n\<rbrakk> \<Longrightarrow> (t\<^sub>1 = t\<^sub>2) = (set_vebt t\<^sub>1 = set_vebt t\<^sub>2)
[PROOF STEP]
by (auto simp: unique_tree)


[STATEMENT]
lemma add_order_least: "n>0 \<Longrightarrow> a+^n = 0 \<Longrightarrow> add_order a \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; a +^ n = (0::'a)\<rbrakk> \<Longrightarrow> add_order a \<le> n
[PROOF STEP]
using Least_le[of "\<lambda>n. n>0 \<and> a+^n = 0"] add_order_def
[PROOF STATE]
proof (prove)
using this:
0 < ?k \<and> a +^ ?k = (0::'a) \<Longrightarrow> (LEAST x. 0 < x \<and> a +^ x = (0::'a)) \<le> ?k
add_order ?a \<equiv> if \<exists>n>0. ?a +^ n = (0::'a) then LEAST n. 0 < n \<and> ?a +^ n = (0::'a) else 0

goal (1 subgoal):
 1. \<lbrakk>0 < n; a +^ n = (0::'a)\<rbrakk> \<Longrightarrow> add_order a \<le> n
[PROOF STEP]
by simp


[STATEMENT]
lemma is_mapD:
  assumes "is_map M" "(a, b\<^sub>1) \<in> M" "(a, b\<^sub>2) \<in> M"
  shows "b\<^sub>1 = b\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b\<^sub>1 = b\<^sub>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_map M
(a, b\<^sub>1) \<in> M
(a, b\<^sub>2) \<in> M

goal (1 subgoal):
 1. b\<^sub>1 = b\<^sub>2
[PROOF STEP]
unfolding is_map_def
[PROOF STATE]
proof (prove)
using this:
\<forall>(a\<^sub>1, b\<^sub>1)\<in>M. \<forall>(a\<^sub>2, b\<^sub>2)\<in>M. a\<^sub>1 = a\<^sub>2 \<longrightarrow> b\<^sub>1 = b\<^sub>2
(a, b\<^sub>1) \<in> M
(a, b\<^sub>2) \<in> M

goal (1 subgoal):
 1. b\<^sub>1 = b\<^sub>2
[PROOF STEP]
by auto


[STATEMENT]
lemma fcompose_smult: "fcompose (smult a p) q1 q2 = smult a (fcompose p q1 q2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fcompose (smult a p) q1 q2 = smult a (fcompose p q1 q2)
[PROOF STEP]
by (induct p) (simp_all add:fcompose_pCons smult_add_right)


[STATEMENT]
lemma (in category) cat_cf_Hom_fst_ObjMap_app[cat_cs_simps]:
  assumes "b \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>" and "a \<in>\<^sub>\<circ> op_cat \<CC>\<lparr>Obj\<rparr>"
  shows "Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,b)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = Hom \<CC> a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,b)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = Hom \<CC> a b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,b)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = Hom \<CC> a b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
b \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
a \<in>\<^sub>\<circ> op_cat \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
have ab: "[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> (op_cat \<CC> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
a \<in>\<^sub>\<circ> op_cat \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> (op_cat \<CC> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (intro cat_prod_2_ObjI) (auto intro: cat_cs_intros)
[PROOF STATE]
proof (state)
this:
[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> (op_cat \<CC> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,b)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = Hom \<CC> a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,b)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = Hom \<CC> a b
[PROOF STEP]
unfolding
      cf_Hom_fst_def
      bifunctor_proj_fst_ObjMap_app[OF category_op category_axioms ab]
      cf_Hom_ObjMap_app[OF ab]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hom \<CC> a b = Hom \<CC> a b
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,b)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = Hom \<CC> a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma time_closest_pair_rec_tm_simps_2:
  assumes "\<not> (length xs \<le> 3)"
  shows "time (closest_pair_rec_tm xs) = 1 + (
    let (xs\<^sub>L, xs\<^sub>R) = val (split_at_tm (length xs div 2) xs) in
    let (ys\<^sub>L, p\<^sub>L) = val (closest_pair_rec_tm xs\<^sub>L) in
    let (ys\<^sub>R, p\<^sub>R) = val (closest_pair_rec_tm xs\<^sub>R) in
    let ys = val (merge_tm (\<lambda>p. snd p) ys\<^sub>L ys\<^sub>R) in
    time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) +
    time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm (\<lambda>p. snd p) ys\<^sub>L ys\<^sub>R) + t_combine p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys
  )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. time (closest_pair_rec_tm xs) = 1 + (let (xs\<^sub>L, xs\<^sub>R) = Time_Monad.val (split_at_tm (length xs div 2) xs); (ys\<^sub>L, p\<^sub>L) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>L); (ys\<^sub>R, p\<^sub>R) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>R); ys = Time_Monad.val (merge_tm snd ys\<^sub>L ys\<^sub>R) in time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) + time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm snd ys\<^sub>L ys\<^sub>R) + t_combine p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> length xs \<le> 3

goal (1 subgoal):
 1. time (closest_pair_rec_tm xs) = 1 + (let (xs\<^sub>L, xs\<^sub>R) = Time_Monad.val (split_at_tm (length xs div 2) xs); (ys\<^sub>L, p\<^sub>L) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>L); (ys\<^sub>R, p\<^sub>R) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>R); ys = Time_Monad.val (merge_tm snd ys\<^sub>L ys\<^sub>R) in time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) + time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm snd ys\<^sub>L ys\<^sub>R) + t_combine p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys)
[PROOF STEP]
apply (subst closest_pair_rec_tm.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> length xs \<le> 3 \<Longrightarrow> time (length_tm xs \<bind> (\<lambda>n. if n \<le> 3 then mergesort_tm snd xs \<bind> (\<lambda>ys. closest_pair_bf_tm xs \<bind> (\<lambda>p. return (ys, p))) else split_at_tm (n div 2) xs \<bind> (\<lambda>(xs\<^sub>L, xs\<^sub>R). closest_pair_rec_tm xs\<^sub>L \<bind> (\<lambda>(ys\<^sub>L, p\<^sub>0\<^sub>L, p\<^sub>1\<^sub>L). closest_pair_rec_tm xs\<^sub>R \<bind> (\<lambda>(ys\<^sub>R, p\<^sub>0\<^sub>R, p\<^sub>1\<^sub>R). merge_tm snd ys\<^sub>L ys\<^sub>R \<bind> (\<lambda>ys. combine_tm (p\<^sub>0\<^sub>L, p\<^sub>1\<^sub>L) (p\<^sub>0\<^sub>R, p\<^sub>1\<^sub>R) (fst (hd xs\<^sub>R)) ys \<bind> (\<lambda>(p\<^sub>0, p\<^sub>1). return (ys, p\<^sub>0, p\<^sub>1))))))) \<bind> tick) = 1 + (let (xs\<^sub>L, xs\<^sub>R) = Time_Monad.val (split_at_tm (length xs div 2) xs); (ys\<^sub>L, p\<^sub>L) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>L); (ys\<^sub>R, p\<^sub>R) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>R); ys = Time_Monad.val (merge_tm snd ys\<^sub>L ys\<^sub>R) in time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) + time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm snd ys\<^sub>L ys\<^sub>R) + t_combine p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys)
[PROOF STEP]
by (auto simp del: closest_pair_rec_tm.simps
           simp add: time_simps length_eq_val_length_tm t_combine_eq_time_combine_tm
              split: prod.split)


[STATEMENT]
lemma lattice_is_monotone:
  fixes S T
  assumes S: "set S \<subseteq> carrier_vec n"
  assumes T: "set T \<subseteq> carrier_vec n"
  assumes subs: "set S \<subseteq> set T"
  shows "lattice_of S \<subseteq> lattice_of T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of S \<subseteq> lattice_of T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice_of S \<subseteq> lattice_of T
[PROOF STEP]
have "\<exists>fa. lincomb fa (set T) = lincomb f (set S)" for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
let ?f = "\<lambda>i. if i \<in> set T - set S then 0 else f i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
have set_T_eq: "set T = set S \<union> (set T - set S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set T = set S \<union> (set T - set S)
[PROOF STEP]
using subs
[PROOF STATE]
proof (prove)
using this:
set S \<subseteq> set T

goal (1 subgoal):
 1. set T = set S \<union> (set T - set S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set T = set S \<union> (set T - set S)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
have l0: "lincomb ?f (set T - set S) = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S) = 0\<^sub>v n
[PROOF STEP]
by (rule lincomb_zero, insert T, auto)
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S) = 0\<^sub>v n

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
have "lincomb ?f (set T) = lincomb ?f (set S \<union> (set T - set S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S \<union> (set T - set S))
[PROOF STEP]
using set_T_eq
[PROOF STATE]
proof (prove)
using this:
set T = set S \<union> (set T - set S)

goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S \<union> (set T - set S))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S \<union> (set T - set S))

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S \<union> (set T - set S))

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
have "... = lincomb ?f (set S) + lincomb ?f (set T - set S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S \<union> (set T - set S)) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) + lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S)
[PROOF STEP]
by (rule lincomb_union, insert S T subs, auto)
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S \<union> (set T - set S)) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) + lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S \<union> (set T - set S)) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) + lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
have "... = lincomb ?f (set S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) + lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S)
[PROOF STEP]
using l0
[PROOF STATE]
proof (prove)
using this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S) = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) + lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S)
[PROOF STEP]
by (auto simp add: S)
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) + lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) + lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T - set S) = lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
have "... = lincomb f (set S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) = lincomb f (set S)
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
set S \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) = lincomb f (set S)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set S) = lincomb f (set S)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T) = lincomb f (set S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lincomb (\<lambda>i. if i \<in> set T - set S then 0 else f i) (set T) = lincomb f (set S)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set T) = lincomb f (set S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>fa. lincomb fa (set T) = lincomb f (set S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>fa. lincomb fa (set T) = lincomb ?f1 (set S)

goal (1 subgoal):
 1. lattice_of S \<subseteq> lattice_of T
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>fa. lincomb fa (set T) = lincomb ?f1 (set S)

goal (1 subgoal):
 1. lattice_of S \<subseteq> lattice_of T
[PROOF STEP]
unfolding lattice_of_altdef_lincomb[OF S] lattice_of_altdef_lincomb[OF T]
[PROOF STATE]
proof (prove)
using this:
\<exists>fa. lincomb fa (set T) = lincomb ?f1 (set S)

goal (1 subgoal):
 1. {y. \<exists>f. lincomb (of_int \<circ> f) (set S) = y} \<subseteq> {y. \<exists>f. lincomb (of_int \<circ> f) (set T) = y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lattice_of S \<subseteq> lattice_of T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_to_bl_minus1: "bin_to_bl n (- 1) = replicate n True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_to_bl n (- 1) = replicate n True
[PROOF STEP]
by (simp add: bin_to_bl_def bin_to_bl_minus1_aux)


[STATEMENT]
lemma (in -) project_set_Int_subset:
    "project_set h (A \<inter> B) \<subseteq> (project_set h A) \<inter> (project_set h B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. project_set h (A \<inter> B) \<subseteq> project_set h A \<inter> project_set h B
[PROOF STEP]
by auto


[STATEMENT]
lemma abs_conv_abscissa_mult_le:
  "abs_conv_abscissa (f * g :: 'a :: dirichlet_series fds) \<le>
      max (abs_conv_abscissa f) (abs_conv_abscissa g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa (f * g) \<le> max (abs_conv_abscissa f) (abs_conv_abscissa g)
[PROOF STEP]
proof (rule abs_conv_abscissa_leI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c'. max (abs_conv_abscissa f) (abs_conv_abscissa g) < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges (f * g) s
[PROOF STEP]
case (1 c')
[PROOF STATE]
proof (state)
this:
max (abs_conv_abscissa f) (abs_conv_abscissa g) < ereal c'

goal (1 subgoal):
 1. \<And>c'. max (abs_conv_abscissa f) (abs_conv_abscissa g) < ereal c' \<Longrightarrow> \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges (f * g) s
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
max (abs_conv_abscissa f) (abs_conv_abscissa g) < ereal c'

goal (1 subgoal):
 1. \<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges (f * g) s
[PROOF STEP]
by (auto intro!: exI[of _ "of_real c'"] fds_abs_converges_mult intro: fds_abs_converges)
[PROOF STATE]
proof (state)
this:
\<exists>s. s \<bullet> (1::'a) = c' \<and> fds_abs_converges (f * g) s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fprod_aux: "{x \<cdot> y |x y. x \<in> (f ` A) \<and> y \<in> (g ` B)} = {f x \<cdot> g y |x y. x \<in> A \<and> y \<in> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<cdot> y |x y. x \<in> f ` A \<and> y \<in> g ` B} = {f x \<cdot> g y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
by auto


[STATEMENT]
lemma bounded_linear_Im: "bounded_linear Im"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear Im
[PROOF STEP]
by (rule bounded_linear_intro [where K=1]) (simp_all add: norm_complex_def)


[STATEMENT]
lemma degree_pdevs_of_list_append:
  "degree (pdevs_of_list (xs @ ys)) \<le> length xs + degree (pdevs_of_list ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (pdevs_of_list (xs @ ys)) \<le> length xs + degree (pdevs_of_list ys)
[PROOF STEP]
by (rule degree_le) (auto simp: pdevs_apply_pdevs_of_list_append)


[STATEMENT]
lemma hensels_lemma':
  assumes "f \<in> carrier Zp_x"
  assumes "a \<in> carrier Zp"
  assumes "val_Zp (f\<bullet>a) > 2*val_Zp ((pderiv f)\<bullet>a)"
  shows "\<exists>!\<alpha> \<in> carrier Zp. f\<bullet>\<alpha> = \<zero> \<and> val_Zp (a \<ominus> \<alpha>) > val_Zp ((pderiv f)\<bullet>a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
proof(cases "f\<bullet>a = \<zero>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<bullet> a = \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
 2. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f \<bullet> a = \<zero>

goal (2 subgoals):
 1. f \<bullet> a = \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
 2. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
have T0: "pderiv f \<bullet> a \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv f \<bullet> a \<noteq> \<zero>
[PROOF STEP]
apply(rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> pderiv f \<bullet> a \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
eint 2 * val_Zp (pderiv f \<bullet> a) < val_Zp (f \<bullet> a)

goal (1 subgoal):
 1. \<not> pderiv f \<bullet> a \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
unfolding val_Zp_def
[PROOF STATE]
proof (prove)
using this:
eint 2 * (if pderiv f \<bullet> a = \<zero> then \<infinity> else eint (padic_val p (pderiv f \<bullet> a))) < (if f \<bullet> a = \<zero> then \<infinity> else eint (padic_val p (f \<bullet> a)))

goal (1 subgoal):
 1. \<not> pderiv f \<bullet> a \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pderiv f \<bullet> a \<noteq> \<zero>

goal (2 subgoals):
 1. f \<bullet> a = \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
 2. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pderiv f \<bullet> a \<noteq> \<zero>
[PROOF STEP]
have T1: "a \<in> carrier Zp \<and> f\<bullet>a = \<zero> \<and> val_Zp (a \<ominus> a) > val_Zp ((pderiv f)\<bullet>a)"
[PROOF STATE]
proof (prove)
using this:
pderiv f \<bullet> a \<noteq> \<zero>

goal (1 subgoal):
 1. a \<in> carrier Zp \<and> f \<bullet> a = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> a)
[PROOF STEP]
using assms True
[PROOF STATE]
proof (prove)
using this:
pderiv f \<bullet> a \<noteq> \<zero>
f \<in> carrier (UP Zp)
a \<in> carrier Zp
eint 2 * val_Zp (pderiv f \<bullet> a) < val_Zp (f \<bullet> a)
f \<bullet> a = \<zero>

goal (1 subgoal):
 1. a \<in> carrier Zp \<and> f \<bullet> a = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> a)
[PROOF STEP]
by(simp add: val_Zp_def)
[PROOF STATE]
proof (state)
this:
a \<in> carrier Zp \<and> f \<bullet> a = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> a)

goal (2 subgoals):
 1. f \<bullet> a = \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
 2. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
have T2: "\<And>b. b \<in> carrier Zp \<and> f\<bullet>b = \<zero> \<and> val_Zp (a \<ominus> b) > val_Zp ((pderiv f)\<bullet>a) \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
assume A: "b \<in> carrier Zp \<and> f\<bullet>b = \<zero> \<and> val_Zp (a \<ominus> b) > val_Zp ((pderiv f)\<bullet>a)"
[PROOF STATE]
proof (state)
this:
b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b)

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
obtain h where h_def: "h = b \<ominus> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. h = b \<ominus> a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h = b \<ominus> a

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h = b \<ominus> a
[PROOF STEP]
have h_fact: "h \<in> carrier Zp \<and> b = a \<oplus> h"
[PROOF STATE]
proof (prove)
using this:
h = b \<ominus> a

goal (1 subgoal):
 1. h \<in> carrier Zp \<and> b = a \<oplus> h
[PROOF STEP]
by (metis A R.l_neg R.minus_closed R.minus_eq R.r_zero add_assoc add_comm assms(2))
[PROOF STATE]
proof (state)
this:
h \<in> carrier Zp \<and> b = a \<oplus> h

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h \<in> carrier Zp \<and> b = a \<oplus> h
[PROOF STEP]
have 1: "f\<bullet>(a \<oplus> h) = \<zero>"
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier Zp \<and> b = a \<oplus> h

goal (1 subgoal):
 1. f \<bullet> (a \<oplus> h) = \<zero>
[PROOF STEP]
using assms A
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier Zp \<and> b = a \<oplus> h
f \<in> carrier (UP Zp)
a \<in> carrier Zp
eint 2 * val_Zp (pderiv f \<bullet> a) < val_Zp (f \<bullet> a)
b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b)

goal (1 subgoal):
 1. f \<bullet> (a \<oplus> h) = \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<bullet> (a \<oplus> h) = \<zero>

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
obtain c where c_def: "c \<in> carrier Zp \<and> f\<bullet>(a \<oplus> h) = (f \<bullet> a) \<oplus> (deriv f a)\<otimes>h \<oplus> c \<otimes>(h[^](2::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. c \<in> carrier Zp \<and> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using taylor_deg_1_eval'[of  f a h _ "f \<bullet> a" "deriv f a" ]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f \<in> carrier (UP Zp); a \<in> carrier Zp; h \<in> carrier Zp; ?c = shift 2 (taylor a f) \<bullet> h; f \<bullet> a = f \<bullet> a; deriv f a = deriv f a\<rbrakk> \<Longrightarrow> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> ?c \<otimes> h [^] 2

goal (1 subgoal):
 1. (\<And>c. c \<in> carrier Zp \<and> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson taylor_closed assms(1) assms(2) to_fun_closed h_fact shift_closed)
[PROOF STATE]
proof (state)
this:
c \<in> carrier Zp \<and> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<in> carrier Zp \<and> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2
[PROOF STEP]
have  "(f \<bullet> a) \<oplus> (deriv f a)\<otimes>h \<oplus> c \<otimes>(h[^](2::nat)) = \<zero>"
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier Zp \<and> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2

goal (1 subgoal):
 1. f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>
[PROOF STEP]
by (simp add: "1")
[PROOF STATE]
proof (state)
this:
f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>
[PROOF STEP]
have 2:  "(deriv f a)\<otimes>h \<oplus> c \<otimes>(h[^](2::nat)) = \<zero>"
[PROOF STATE]
proof (prove)
using this:
f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>

goal (1 subgoal):
 1. deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>
[PROOF STEP]
by (simp add: True assms(1) assms(2) deriv_closed h_fact)
[PROOF STATE]
proof (state)
this:
deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
hence 3: "((deriv f a) \<oplus> c \<otimes>h)\<otimes>h = \<zero>"
[PROOF STATE]
proof (prove)
using this:
deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>

goal (1 subgoal):
 1. (deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero> \<Longrightarrow> (deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>
[PROOF STEP]
have "((deriv f a) \<oplus> c \<otimes>h)\<otimes>h = ((deriv f a)\<otimes>h \<oplus> (c \<otimes>h)\<otimes>h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h \<otimes> h
[PROOF STEP]
by (simp add: R.l_distr assms(1) assms(2) c_def deriv_closed h_fact)
[PROOF STATE]
proof (state)
this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h \<otimes> h

goal (1 subgoal):
 1. deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero> \<Longrightarrow> (deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h \<otimes> h
[PROOF STEP]
have "((deriv f a) \<oplus> c \<otimes>h)\<otimes>h = (deriv f a)\<otimes>h \<oplus> (c \<otimes>(h\<otimes>h))"
[PROOF STATE]
proof (prove)
using this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h \<otimes> h

goal (1 subgoal):
 1. (deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> (h \<otimes> h)
[PROOF STEP]
by (simp add: mult_assoc)
[PROOF STATE]
proof (state)
this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> (h \<otimes> h)

goal (1 subgoal):
 1. deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero> \<Longrightarrow> (deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> (h \<otimes> h)
[PROOF STEP]
have "((deriv f a) \<oplus> c \<otimes>h)\<otimes>h = (deriv f a)\<otimes>h \<oplus> (c \<otimes>(h[^](2::nat)))"
[PROOF STATE]
proof (prove)
using this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> (h \<otimes> h)

goal (1 subgoal):
 1. (deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2
[PROOF STEP]
using nat_pow_def[of Zp h "2"]
[PROOF STATE]
proof (prove)
using this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> (h \<otimes> h)
h [^] 2 = rec_nat \<one> (\<lambda>u b. b \<otimes> h) 2

goal (1 subgoal):
 1. (deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2
[PROOF STEP]
by (simp add: h_fact)
[PROOF STATE]
proof (state)
this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2

goal (1 subgoal):
 1. deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero> \<Longrightarrow> (deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2

goal (1 subgoal):
 1. (deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2
deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>

goal (1 subgoal):
 1. (deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
have "h = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h = \<zero>
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
assume "h \<noteq> \<zero>"
[PROOF STATE]
proof (state)
this:
h \<noteq> \<zero>

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h \<noteq> \<zero>
[PROOF STEP]
have "(deriv f a) \<oplus> c \<otimes>h = \<zero>"
[PROOF STATE]
proof (prove)
using this:
h \<noteq> \<zero>

goal (1 subgoal):
 1. deriv f a \<oplus> c \<otimes> h = \<zero>
[PROOF STEP]
using 2 3
[PROOF STATE]
proof (prove)
using this:
h \<noteq> \<zero>
deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2 = \<zero>
(deriv f a \<oplus> c \<otimes> h) \<otimes> h = \<zero>

goal (1 subgoal):
 1. deriv f a \<oplus> c \<otimes> h = \<zero>
[PROOF STEP]
by (meson R.m_closed UP_cring.deriv_closed Zp_x_is_UP_cring assms(1) assms(2) c_def h_fact local.integral sum_closed)
[PROOF STATE]
proof (state)
this:
deriv f a \<oplus> c \<otimes> h = \<zero>

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv f a \<oplus> c \<otimes> h = \<zero>
[PROOF STEP]
have "(deriv f a) = \<ominus> c \<otimes>h"
[PROOF STATE]
proof (prove)
using this:
deriv f a \<oplus> c \<otimes> h = \<zero>

goal (1 subgoal):
 1. deriv f a = \<ominus> c \<otimes> h
[PROOF STEP]
using R.l_minus R.minus_equality assms(1) assms(2) c_def deriv_closed h_fact
[PROOF STATE]
proof (prove)
using this:
deriv f a \<oplus> c \<otimes> h = \<zero>
\<lbrakk>?x \<in> carrier Zp; ?y \<in> carrier Zp\<rbrakk> \<Longrightarrow> \<ominus> ?x \<otimes> ?y = \<ominus> (?x \<otimes> ?y)
\<lbrakk>?y \<oplus> ?x = \<zero>; ?x \<in> carrier Zp; ?y \<in> carrier Zp\<rbrakk> \<Longrightarrow> \<ominus> ?x = ?y
f \<in> carrier (UP Zp)
a \<in> carrier Zp
c \<in> carrier Zp \<and> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2
\<lbrakk>?f \<in> carrier (UP Zp); ?a \<in> carrier Zp\<rbrakk> \<Longrightarrow> deriv ?f ?a \<in> carrier Zp
h \<in> carrier Zp \<and> b = a \<oplus> h

goal (1 subgoal):
 1. deriv f a = \<ominus> c \<otimes> h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
deriv f a = \<ominus> c \<otimes> h

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv f a = \<ominus> c \<otimes> h
[PROOF STEP]
have "val_Zp (deriv f a) = val_Zp (c \<otimes> h)"
[PROOF STATE]
proof (prove)
using this:
deriv f a = \<ominus> c \<otimes> h

goal (1 subgoal):
 1. val_Zp (deriv f a) = val_Zp (c \<otimes> h)
[PROOF STEP]
by (meson R.m_closed \<open>deriv f a \<oplus> c \<otimes> h = \<zero>\<close> assms(1) assms(2) c_def deriv_closed h_fact val_Zp_not_equal_imp_notequal(3))
[PROOF STATE]
proof (state)
this:
val_Zp (deriv f a) = val_Zp (c \<otimes> h)

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
val_Zp (deriv f a) = val_Zp (c \<otimes> h)
[PROOF STEP]
have P: "val_Zp (deriv f a) = val_Zp h +  val_Zp c"
[PROOF STATE]
proof (prove)
using this:
val_Zp (deriv f a) = val_Zp (c \<otimes> h)

goal (1 subgoal):
 1. val_Zp (deriv f a) = val_Zp h + val_Zp c
[PROOF STEP]
by (simp add: c_def h_fact val_Zp_mult)
[PROOF STATE]
proof (state)
this:
val_Zp (deriv f a) = val_Zp h + val_Zp c

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
have "val_Zp (deriv f a) \<ge> val_Zp h "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val_Zp h \<le> val_Zp (deriv f a)
[PROOF STEP]
using P val_pos[of c] c_def
[PROOF STATE]
proof (prove)
using this:
val_Zp (deriv f a) = val_Zp h + val_Zp c
c \<in> carrier Zp \<Longrightarrow> 0 \<le> val_Zp c
c \<in> carrier Zp \<and> f \<bullet> (a \<oplus> h) = f \<bullet> a \<oplus> deriv f a \<otimes> h \<oplus> c \<otimes> h [^] 2

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

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
val_Zp h \<le> val_Zp (deriv f a)
[PROOF STEP]
have "val_Zp (deriv f a) \<ge> val_Zp (b \<ominus> a) "
[PROOF STATE]
proof (prove)
using this:
val_Zp h \<le> val_Zp (deriv f a)

goal (1 subgoal):
 1. val_Zp (b \<ominus> a) \<le> val_Zp (deriv f a)
[PROOF STEP]
using h_def
[PROOF STATE]
proof (prove)
using this:
val_Zp h \<le> val_Zp (deriv f a)
h = b \<ominus> a

goal (1 subgoal):
 1. val_Zp (b \<ominus> a) \<le> val_Zp (deriv f a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
val_Zp (b \<ominus> a) \<le> val_Zp (deriv f a)

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
val_Zp (b \<ominus> a) \<le> val_Zp (deriv f a)
[PROOF STEP]
have "val_Zp (deriv f a) > val_Zp ((pderiv f)\<bullet>a)"
[PROOF STATE]
proof (prove)
using this:
val_Zp (b \<ominus> a) \<le> val_Zp (deriv f a)

goal (1 subgoal):
 1. val_Zp (pderiv f \<bullet> a) < val_Zp (deriv f a)
[PROOF STEP]
by (metis (no_types, lifting) A assms(2) h_def h_fact minus_a_inv not_less order_trans val_Zp_of_minus)
[PROOF STATE]
proof (state)
this:
val_Zp (pderiv f \<bullet> a) < val_Zp (deriv f a)

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
val_Zp (pderiv f \<bullet> a) < val_Zp (deriv f a)
[PROOF STEP]
have P0:"val_Zp (deriv f a) > val_Zp (deriv f a)"
[PROOF STATE]
proof (prove)
using this:
val_Zp (pderiv f \<bullet> a) < val_Zp (deriv f a)

goal (1 subgoal):
 1. val_Zp (deriv f a) < val_Zp (deriv f a)
[PROOF STEP]
by (metis UP_cring.pderiv_eval_deriv Zp_x_is_UP_cring assms(1) assms(2))
[PROOF STATE]
proof (state)
this:
val_Zp (deriv f a) < val_Zp (deriv f a)

goal (1 subgoal):
 1. h \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
val_Zp (deriv f a) < val_Zp (deriv f a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h = \<zero>

goal (1 subgoal):
 1. \<And>b. b \<in> carrier Zp \<and> f \<bullet> b = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> b) \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h = \<zero>
[PROOF STEP]
show "a = b"
[PROOF STATE]
proof (prove)
using this:
h = \<zero>

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by (simp add: assms(2) h_fact)
[PROOF STATE]
proof (state)
this:
a = b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?b2 \<in> carrier Zp \<and> f \<bullet> ?b2 = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> ?b2) \<Longrightarrow> a = ?b2

goal (2 subgoals):
 1. f \<bullet> a = \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
 2. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
using T1 T2
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Zp \<and> f \<bullet> a = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> a)
?b2 \<in> carrier Zp \<and> f \<bullet> ?b2 = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> ?b2) \<Longrightarrow> a = ?b2

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)

goal (1 subgoal):
 1. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<bullet> a \<noteq> \<zero>

goal (1 subgoal):
 1. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
have F0: "pderiv f \<bullet> a \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv f \<bullet> a \<noteq> \<zero>
[PROOF STEP]
apply(rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> pderiv f \<bullet> a \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
eint 2 * val_Zp (pderiv f \<bullet> a) < val_Zp (f \<bullet> a)

goal (1 subgoal):
 1. \<not> pderiv f \<bullet> a \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
unfolding val_Zp_def
[PROOF STATE]
proof (prove)
using this:
eint 2 * (if pderiv f \<bullet> a = \<zero> then \<infinity> else eint (padic_val p (pderiv f \<bullet> a))) < (if f \<bullet> a = \<zero> then \<infinity> else eint (padic_val p (f \<bullet> a)))

goal (1 subgoal):
 1. \<not> pderiv f \<bullet> a \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pderiv f \<bullet> a \<noteq> \<zero>

goal (1 subgoal):
 1. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
obtain \<alpha> where alpha_def:
       "f\<bullet>\<alpha> = \<zero>"  "\<alpha> \<in> carrier Zp"
       "val_Zp (a \<ominus> \<alpha>) > val_Zp ((pderiv f)\<bullet>a)"
       "(val_Zp (a \<ominus> \<alpha>) = val_Zp (divide (f\<bullet>a) ((pderiv f)\<bullet>a)))"
       "val_Zp ((pderiv f)\<bullet>\<alpha>) = val_Zp ((pderiv f)\<bullet>a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<alpha>. \<lbrakk>f \<bullet> \<alpha> = \<zero>; \<alpha> \<in> carrier Zp; val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>); val_Zp (a \<ominus> \<alpha>) = val_Zp (local.divide (f \<bullet> a) (pderiv f \<bullet> a)); val_Zp (pderiv f \<bullet> \<alpha>) = val_Zp (pderiv f \<bullet> a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms hensels_lemma F0 False
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (UP Zp)
a \<in> carrier Zp
eint 2 * val_Zp (pderiv f \<bullet> a) < val_Zp (f \<bullet> a)
\<lbrakk>?f \<in> carrier (UP Zp); ?a \<in> carrier Zp; pderiv ?f \<bullet> ?a \<noteq> \<zero>; ?f \<bullet> ?a \<noteq> \<zero>; eint 2 * val_Zp (pderiv ?f \<bullet> ?a) < val_Zp (?f \<bullet> ?a); \<And>\<alpha>. \<lbrakk>?f \<bullet> \<alpha> = \<zero>; \<alpha> \<in> carrier Zp; val_Zp (pderiv ?f \<bullet> ?a) < val_Zp (?a \<ominus> \<alpha>); val_Zp (?a \<ominus> \<alpha>) = val_Zp (local.divide (?f \<bullet> ?a) (pderiv ?f \<bullet> ?a)); val_Zp (pderiv ?f \<bullet> \<alpha>) = val_Zp (pderiv ?f \<bullet> ?a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
pderiv f \<bullet> a \<noteq> \<zero>
f \<bullet> a \<noteq> \<zero>

goal (1 subgoal):
 1. (\<And>\<alpha>. \<lbrakk>f \<bullet> \<alpha> = \<zero>; \<alpha> \<in> carrier Zp; val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>); val_Zp (a \<ominus> \<alpha>) = val_Zp (local.divide (f \<bullet> a) (pderiv f \<bullet> a)); val_Zp (pderiv f \<bullet> \<alpha>) = val_Zp (pderiv f \<bullet> a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<bullet> \<alpha> = \<zero>
\<alpha> \<in> carrier Zp
val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
val_Zp (a \<ominus> \<alpha>) = val_Zp (local.divide (f \<bullet> a) (pderiv f \<bullet> a))
val_Zp (pderiv f \<bullet> \<alpha>) = val_Zp (pderiv f \<bullet> a)

goal (1 subgoal):
 1. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
have 0: "\<And>x. x \<in> carrier Zp \<and> f \<bullet> x = \<zero> \<and> val_Zp (a \<ominus> x) > val_Zp (pderiv f \<bullet> a) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> x) \<Longrightarrow> x= \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier Zp \<and> f \<bullet> x = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> x) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> x) \<Longrightarrow> x = \<alpha>
[PROOF STEP]
using alpha_def assms hensels_lemma_unique_root[of f a \<alpha>] F0 False
[PROOF STATE]
proof (prove)
using this:
f \<bullet> \<alpha> = \<zero>
\<alpha> \<in> carrier Zp
val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
val_Zp (a \<ominus> \<alpha>) = val_Zp (local.divide (f \<bullet> a) (pderiv f \<bullet> a))
val_Zp (pderiv f \<bullet> \<alpha>) = val_Zp (pderiv f \<bullet> a)
f \<in> carrier (UP Zp)
a \<in> carrier Zp
eint 2 * val_Zp (pderiv f \<bullet> a) < val_Zp (f \<bullet> a)
\<lbrakk>f \<in> carrier (UP Zp); a \<in> carrier Zp; pderiv f \<bullet> a \<noteq> \<zero>; f \<bullet> a \<noteq> \<zero>; eint 2 * val_Zp (pderiv f \<bullet> a) < val_Zp (f \<bullet> a); f \<bullet> \<alpha> = \<zero>; \<alpha> \<in> carrier Zp; val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>); f \<bullet> ?\<beta> = \<zero>; ?\<beta> \<in> carrier Zp; val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> ?\<beta>); val_Zp (pderiv f \<bullet> \<alpha>) = val_Zp (pderiv f \<bullet> a)\<rbrakk> \<Longrightarrow> \<alpha> = ?\<beta>
pderiv f \<bullet> a \<noteq> \<zero>
f \<bullet> a \<noteq> \<zero>

goal (1 subgoal):
 1. \<And>x. x \<in> carrier Zp \<and> f \<bullet> x = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> x) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> x) \<Longrightarrow> x = \<alpha>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x2 \<in> carrier Zp \<and> f \<bullet> ?x2 = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> ?x2) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> ?x2) \<Longrightarrow> ?x2 = \<alpha>

goal (1 subgoal):
 1. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
have 1: "\<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (a \<ominus> \<alpha>) > val_Zp (pderiv f \<bullet> a) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> \<alpha>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
using alpha_def order_less_le
[PROOF STATE]
proof (prove)
using this:
f \<bullet> \<alpha> = \<zero>
\<alpha> \<in> carrier Zp
val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
val_Zp (a \<ominus> \<alpha>) = val_Zp (local.divide (f \<bullet> a) (pderiv f \<bullet> a))
val_Zp (pderiv f \<bullet> \<alpha>) = val_Zp (pderiv f \<bullet> a)
(?x < ?y) = (?x \<le> ?y \<and> ?x \<noteq> ?y)

goal (1 subgoal):
 1. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> \<alpha>)

goal (1 subgoal):
 1. f \<bullet> a \<noteq> \<zero> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> \<alpha>)

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> \<alpha>)
?x2 \<in> carrier Zp \<and> f \<bullet> ?x2 = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> ?x2) \<and> val_Zp (pderiv f \<bullet> a) \<noteq> val_Zp (a \<ominus> ?x2) \<Longrightarrow> ?x2 = \<alpha>

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)
[PROOF STEP]
by (metis (no_types, opaque_lifting) R.minus_closed alpha_def(1-3) assms(2) equal_val_Zp val_Zp_ultrametric_eq')
[PROOF STATE]
proof (state)
this:
\<exists>!\<alpha>. \<alpha> \<in> carrier Zp \<and> f \<bullet> \<alpha> = \<zero> \<and> val_Zp (pderiv f \<bullet> a) < val_Zp (a \<ominus> \<alpha>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nuc_inf_closed: "nucleus f \<Longrightarrow> inf_closed_set (Fix f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nucleus f \<Longrightarrow> inf_closed_set (Fix f)
[PROOF STEP]
by (simp add: Inf_inf_closed nuc_Inf_closed)


[STATEMENT]
lemma mult_neg_pos: "a < 0 \<Longrightarrow> 0 < b \<Longrightarrow> a * b < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < (0::'a); (0::'a) < b\<rbrakk> \<Longrightarrow> a * b < (0::'a)
[PROOF STEP]
using mult_strict_right_mono [of a 0 b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < (0::'a); (0::'a) < b\<rbrakk> \<Longrightarrow> a * b < (0::'a) * b

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


[STATEMENT]
lemma dickson_gradingD2':
  assumes "dickson_grading (d::'a::comm_monoid_add \<Rightarrow> nat)"
  shows "wqo_on (adds) {x. d x \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (adds) {x. d x \<le> n}
[PROOF STEP]
proof (intro wqo_onI transp_onI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>x \<in> {x. d x \<le> n}; y \<in> {x. d x \<le> n}; z \<in> {x. d x \<le> n}; x adds y; y adds z\<rbrakk> \<Longrightarrow> x adds z
 2. almost_full_on (adds) {x. d x \<le> n}
[PROOF STEP]
fix x y z :: 'a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>x \<in> {x. d x \<le> n}; y \<in> {x. d x \<le> n}; z \<in> {x. d x \<le> n}; x adds y; y adds z\<rbrakk> \<Longrightarrow> x adds z
 2. almost_full_on (adds) {x. d x \<le> n}
[PROOF STEP]
assume "x adds y" and "y adds z"
[PROOF STATE]
proof (state)
this:
x adds y
y adds z

goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>x \<in> {x. d x \<le> n}; y \<in> {x. d x \<le> n}; z \<in> {x. d x \<le> n}; x adds y; y adds z\<rbrakk> \<Longrightarrow> x adds z
 2. almost_full_on (adds) {x. d x \<le> n}
[PROOF STEP]
thus "x adds z"
[PROOF STATE]
proof (prove)
using this:
x adds y
y adds z

goal (1 subgoal):
 1. x adds z
[PROOF STEP]
by (rule adds_trans)
[PROOF STATE]
proof (state)
this:
x adds z

goal (1 subgoal):
 1. almost_full_on (adds) {x. d x \<le> n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. almost_full_on (adds) {x. d x \<le> n}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
dickson_grading d
[PROOF STEP]
show "almost_full_on (adds) {x. d x \<le> n}"
[PROOF STATE]
proof (prove)
using this:
dickson_grading d

goal (1 subgoal):
 1. almost_full_on (adds) {x. d x \<le> n}
[PROOF STEP]
by (rule dickson_gradingD2)
[PROOF STATE]
proof (state)
this:
almost_full_on (adds) {x. d x \<le> n}

goal:
No subgoals!
[PROOF STEP]
qed