[STATEMENT]
lemma eval_pos_if_dominant_term_pos':
  assumes "basis_wf basis" "trimmed_ms_aux F" "is_expansion_aux F f basis"
          "fst (dominant_term_ms_aux F) > 0"
  shows   "eventually (\<lambda>x. f x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
have "f \<sim>[at_top] eval_monom (dominant_term_ms_aux F) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<sim>[at_top] eval_monom (dominant_term_ms_aux F) basis
[PROOF STEP]
by (intro dominant_term_ms_aux assms)
[PROOF STATE]
proof (state)
this:
f \<sim>[at_top] eval_monom (dominant_term_ms_aux F) basis

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
from dominant_term_ms_aux(2)[OF assms(1-3)]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))
[PROOF STEP]
have "\<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
basis_wf basis
trimmed_ms_aux F
is_expansion_aux F f basis
0 < fst (dominant_term_ms_aux F)
[PROOF STEP]
have "eventually (\<lambda>x. eval_monom (dominant_term_ms_aux F) basis x > 0) at_top"
[PROOF STATE]
proof (prove)
using this:
basis_wf basis
trimmed_ms_aux F
is_expansion_aux F f basis
0 < fst (dominant_term_ms_aux F)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < eval_monom (dominant_term_ms_aux F) basis x
[PROOF STEP]
by (intro eval_monom_pos)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < eval_monom (dominant_term_ms_aux F) basis x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))
\<forall>\<^sub>F x in at_top. 0 < eval_monom (dominant_term_ms_aux F) basis x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. sgn (f x) = sgn (fst (dominant_term_ms_aux F))
\<forall>\<^sub>F x in at_top. 0 < eval_monom (dominant_term_ms_aux F) basis x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
by eventually_elim (insert assms, simp add: sgn_if split: if_splits)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_pred:
  assumes "x \<noteq> first_el"
  shows "pos (pred x) = pos x - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos (pred x) = pos x - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pos (pred x) = pos x - 1
[PROOF STEP]
have "first_el \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. first_el \<le> x
[PROOF STEP]
by (rule first_el_smallest)
[PROOF STATE]
proof (state)
this:
first_el \<le> x

goal (1 subgoal):
 1. pos (pred x) = pos x - 1
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> first_el
first_el \<le> x
[PROOF STEP]
have "first_el < x"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> first_el
first_el \<le> x

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

goal (1 subgoal):
 1. pos (pred x) = pos x - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
first_el < x
[PROOF STEP]
have "pos first_el < pos x"
[PROOF STATE]
proof (prove)
using this:
first_el < x

goal (1 subgoal):
 1. pos first_el < pos x
[PROOF STEP]
by (simp add: less_pos)
[PROOF STATE]
proof (state)
this:
pos first_el < pos x

goal (1 subgoal):
 1. pos (pred x) = pos x - 1
[PROOF STEP]
with rangeI [of pos x]
[PROOF STATE]
proof (chain)
picking this:
pos x \<in> range pos
pos first_el < pos x
[PROOF STEP]
have "pos x - 1 \<in> range pos"
[PROOF STATE]
proof (prove)
using this:
pos x \<in> range pos
pos first_el < pos x

goal (1 subgoal):
 1. pos x - 1 \<in> range pos
[PROOF STEP]
by (simp add: range_pos first_el_def pos_val)
[PROOF STATE]
proof (state)
this:
pos x - 1 \<in> range pos

goal (1 subgoal):
 1. pos (pred x) = pos x - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pos x - 1 \<in> range pos
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pos x - 1 \<in> range pos

goal (1 subgoal):
 1. pos (pred x) = pos x - 1
[PROOF STEP]
by (simp add: pred_def pos_val)
[PROOF STATE]
proof (state)
this:
pos (pred x) = pos x - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma primorial_mono: "x \<le> y \<Longrightarrow> primorial x \<le> primorial y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> primorial x \<le> primorial y
[PROOF STEP]
unfolding primorial_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> \<Prod>{p. prime p \<and> real p \<le> x} \<le> \<Prod>{p. prime p \<and> real p \<le> y}
[PROOF STEP]
by (intro dvd_imp_le prod_dvd_prod_subset)
     (auto intro!: prod_pos finite_primes_le dest: prime_gt_0_nat)


[STATEMENT]
lemma distinct_merge_distinct[simp]: "\<lbrakk>sorted xs; distinct xs; sorted ys; distinct ys\<rbrakk> \<Longrightarrow>
  distinct (merge_distinct xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted xs; distinct xs; sorted ys; distinct ys\<rbrakk> \<Longrightarrow> distinct (merge_distinct xs ys)
[PROOF STEP]
by (induct xs ys rule: merge_distinct.induct) (auto)


[STATEMENT]
lemma angle_eq_pi_imp_dist_additive:
  assumes "angle a b c = pi"
  shows   "dist a c = dist a b + dist b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist a c = dist a b + dist b c
[PROOF STEP]
using vangle_eq_piD[OF assms[unfolded angle_def]]
[PROOF STATE]
proof (prove)
using this:
norm (a - b) *\<^sub>R (c - b) + norm (c - b) *\<^sub>R (a - b) = (0::'a)

goal (1 subgoal):
 1. dist a c = dist a b + dist b c
[PROOF STEP]
by (subst dist_triangle_eq) (simp add: dist_norm norm_minus_commute)


[STATEMENT]
lemma summable_real_powr_iff: "summable (\<lambda>n. of_nat n powr s :: real) \<longleftrightarrow> s < -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. real n powr s) = (s < - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. real n powr s) = (s < - 1)
[PROOF STEP]
from eventually_gt_at_top[of "0::nat"]
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) 0) sequentially
[PROOF STEP]
have "summable (\<lambda>n. of_nat n powr s) \<longleftrightarrow> summable (\<lambda>n. exp (ln (of_nat n) * s))"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) sequentially

goal (1 subgoal):
 1. summable (\<lambda>n. real n powr s) = summable (\<lambda>n. exp (ln (real n) * s))
[PROOF STEP]
by (intro summable_cong) (auto elim!: eventually_mono simp: powr_def)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. real n powr s) = summable (\<lambda>n. exp (ln (real n) * s))

goal (1 subgoal):
 1. summable (\<lambda>n. real n powr s) = (s < - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. real n powr s) = summable (\<lambda>n. exp (ln (real n) * s))

goal (1 subgoal):
 1. summable (\<lambda>n. real n powr s) = (s < - 1)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> s < -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. exp (ln (real n) * s)) = (s < - 1)
[PROOF STEP]
using abs_summable_complex_powr_iff[of "of_real s"]
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. cmod (exp (complex_of_real (ln (real n)) * complex_of_real s))) = (Re (complex_of_real s) < - 1)

goal (1 subgoal):
 1. summable (\<lambda>n. exp (ln (real n) * s)) = (s < - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. exp (ln (real n) * s)) = (s < - 1)

goal (1 subgoal):
 1. summable (\<lambda>n. real n powr s) = (s < - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. real n powr s) = (s < - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. real n powr s) = (s < - 1)

goal (1 subgoal):
 1. summable (\<lambda>n. real n powr s) = (s < - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. real n powr s) = (s < - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma div_sum:
  fixes a::nat and n::nat
  shows "\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<0. A x * D x)
 2. \<And>n. \<lbrakk>\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x); \<forall>x. a dvd A x\<rbrakk> \<Longrightarrow> a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
\<forall>x. a dvd A x

goal (2 subgoals):
 1. \<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<0. A x * D x)
 2. \<And>n. \<lbrakk>\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x); \<forall>x. a dvd A x\<rbrakk> \<Longrightarrow> a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd (\<Sum>x<0. A x * D x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a dvd (\<Sum>x<0. A x * D x)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x); \<forall>x. a dvd A x\<rbrakk> \<Longrightarrow> a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x); \<forall>x. a dvd A x\<rbrakk> \<Longrightarrow> a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x)
\<forall>x. a dvd A x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x); \<forall>x. a dvd A x\<rbrakk> \<Longrightarrow> a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x)
\<forall>x. a dvd A x
[PROOF STEP]
have "a dvd (A n * D n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x)
\<forall>x. a dvd A x

goal (1 subgoal):
 1. a dvd A n * D n
[PROOF STEP]
by (simp add: dvd_mult2)
[PROOF STATE]
proof (state)
this:
a dvd A n * D n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x); \<forall>x. a dvd A x\<rbrakk> \<Longrightarrow> a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x)
\<forall>x. a dvd A x
a dvd A n * D n
[PROOF STEP]
have "a dvd ((\<Sum>x<n. A x * D x) + (A n * D n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x)
\<forall>x. a dvd A x
a dvd A n * D n

goal (1 subgoal):
 1. a dvd (\<Sum>x<n. A x * D x) + A n * D n
[PROOF STEP]
by (simp add: dvd_add)
[PROOF STATE]
proof (state)
this:
a dvd (\<Sum>x<n. A x * D x) + A n * D n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>x. a dvd A x \<Longrightarrow> a dvd (\<Sum>x<n. A x * D x); \<forall>x. a dvd A x\<rbrakk> \<Longrightarrow> a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
a dvd (\<Sum>x<n. A x * D x) + A n * D n

goal (1 subgoal):
 1. a dvd (\<Sum>x<Suc n. A x * D x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a dvd (\<Sum>x<Suc n. A x * D x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SReal_Infinitesimal_zero: "x \<in> \<real> \<Longrightarrow> x \<in> Infinitesimal \<Longrightarrow> x = 0"
  for x :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; x \<in> Infinitesimal\<rbrakk> \<Longrightarrow> x = 0
[PROOF STEP]
using SReal_Int_Infinitesimal_zero
[PROOF STATE]
proof (prove)
using this:
\<real> \<inter> Infinitesimal = {0}

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; x \<in> Infinitesimal\<rbrakk> \<Longrightarrow> x = 0
[PROOF STEP]
by blast


[STATEMENT]
lemma subst_if: "subst x v (EIf e1 e2 e3) = EIf (subst x v e1) (subst x v e2) (subst x v e3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst x v (EIf e1 e2 e3) = EIf (subst x v e1) (subst x v e2) (subst x v e3)
[PROOF STEP]
by auto


[STATEMENT]
lemma fun_graph_memE':
  assumes "f \<in> carrier (Fun\<^bsub>n\<^esub> R)"
  assumes "p \<in> fun_graph R n f"
  shows "f (take n p) = p!n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (take n p) = p ! n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (function_ring (carrier (R\<^bsup>n\<^esup>)) R)
p \<in> fun_graph R n f

goal (1 subgoal):
 1. f (take n p) = p ! n
[PROOF STEP]
unfolding fun_graph_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (function_ring (carrier (R\<^bsup>n\<^esup>)) R)
p \<in> {as. \<exists>x\<in>carrier (R\<^bsup>n\<^esup>). as = x @ [f x]}

goal (1 subgoal):
 1. f (take n p) = p ! n
[PROOF STEP]
by (smt Cons_nth_drop_Suc append_take_drop_id assms(2) butlast_snoc cartesian_power_car_memE
      drop_all graph_range last_snoc le_Suc_eq lessI mem_Collect_eq subsetD)


[STATEMENT]
lemma (in encoding) refl_symm_trans_closure_of_indRelST:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  assumes reflT: "refl TRel"
      and symmS: "sym SRel"
      and symmT: "sym TRel"
  shows "indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+
[PROOF STEP]
have "(symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+ = (symcl (indRelST SRel TRel))\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+ = (symcl (indRelST SRel TRel))\<^sup>*
[PROOF STEP]
by (rule refl_symm_trans_closure_is_symm_refl_trans_closure[where Rel="indRelST SRel TRel"])
[PROOF STATE]
proof (state)
this:
(symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+ = (symcl (indRelST SRel TRel))\<^sup>*

goal (1 subgoal):
 1. indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+ = (symcl (indRelST SRel TRel))\<^sup>*

goal (1 subgoal):
 1. indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+
[PROOF STEP]
from symmS symmT
[PROOF STATE]
proof (chain)
picking this:
sym SRel
sym TRel
[PROOF STEP]
have "symcl (indRelST SRel TRel) = indRelST SRel TRel"
[PROOF STATE]
proof (prove)
using this:
sym SRel
sym TRel

goal (1 subgoal):
 1. symcl (indRelST SRel TRel) = indRelST SRel TRel
[PROOF STEP]
using indRelST_symm[where SRel="SRel" and TRel="TRel"]
            symm_closure_of_symm_rel[where Rel="indRelST SRel TRel"]
[PROOF STATE]
proof (prove)
using this:
sym SRel
sym TRel
sym SRel \<and> sym TRel \<Longrightarrow> sym (indRelST SRel TRel)
sym (indRelST SRel TRel) \<Longrightarrow> symcl (indRelST SRel TRel) = indRelST SRel TRel

goal (1 subgoal):
 1. symcl (indRelST SRel TRel) = indRelST SRel TRel
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
symcl (indRelST SRel TRel) = indRelST SRel TRel

goal (1 subgoal):
 1. indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+ = (symcl (indRelST SRel TRel))\<^sup>*
symcl (indRelST SRel TRel) = indRelST SRel TRel
[PROOF STEP]
show "indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+"
[PROOF STATE]
proof (prove)
using this:
(symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+ = (symcl (indRelST SRel TRel))\<^sup>*
symcl (indRelST SRel TRel) = indRelST SRel TRel

goal (1 subgoal):
 1. indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+
[PROOF STEP]
using reflT refl_trans_closure_of_indRelST[where SRel="SRel" and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
(symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+ = (symcl (indRelST SRel TRel))\<^sup>*
symcl (indRelST SRel TRel) = indRelST SRel TRel
refl TRel
refl TRel \<Longrightarrow> indRelSTEQ SRel TRel = (indRelST SRel TRel)\<^sup>*

goal (1 subgoal):
 1. indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
indRelSTEQ SRel TRel = (symcl ((indRelST SRel TRel)\<^sup>=))\<^sup>+

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pi_approx:
  fixes n :: nat assumes n: "even n" and "n > 0"
  shows   "\<bar>pi - pi_approx n\<bar> \<le> inverse (2^(13*n - 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
even n
[PROOF STEP]
have n': "even (3*n)"
[PROOF STATE]
proof (prove)
using this:
even n

goal (1 subgoal):
 1. even (3 * n)
[PROOF STEP]
by simp
  \<comment> \<open>We apply the Machin formula\<close>
[PROOF STATE]
proof (state)
this:
even (3 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
from machin
[PROOF STATE]
proof (chain)
picking this:
pi / 4 = 4 * arctan (1 / 5) - arctan (1 / 239)
[PROOF STEP]
have "pi = 16 * arctan (1/5) - 4 * arctan (1/239::real)"
[PROOF STATE]
proof (prove)
using this:
pi / 4 = 4 * arctan (1 / 5) - arctan (1 / 239)

goal (1 subgoal):
 1. pi = 16 * arctan (1 / 5) - 4 * arctan (1 / 239)
[PROOF STEP]
by simp
  \<comment> \<open>Taylor series expansion of the arctangent\<close>
[PROOF STATE]
proof (state)
this:
pi = 16 * arctan (1 / 5) - 4 * arctan (1 / 239)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pi = 16 * arctan (1 / 5) - 4 * arctan (1 / 239)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
from arctan_approx[OF _ _ n', of "1/5"] arctan_approx[OF _ _ n, of "1/239"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> 1 / 5; 1 / 5 < 1\<rbrakk> \<Longrightarrow> arctan (1 / 5) - arctan_approx (3 * n) (1 / 5) \<in> {0..(1 / 5) ^ (2 * (3 * n) + 1) / (1 - (1 / 5) ^ 4)}
\<lbrakk>0 \<le> 1 / 239; 1 / 239 < 1\<rbrakk> \<Longrightarrow> arctan (1 / 239) - arctan_approx n (1 / 239) \<in> {0..(1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4)}
[PROOF STEP]
have "\<dots> - pi_approx n \<in> {-4*((1/239)^(2*n+1) / (1-(1/239)^4))..16*(1/5)^(6*n+1) / (1-(1/5)^4)}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> 1 / 5; 1 / 5 < 1\<rbrakk> \<Longrightarrow> arctan (1 / 5) - arctan_approx (3 * n) (1 / 5) \<in> {0..(1 / 5) ^ (2 * (3 * n) + 1) / (1 - (1 / 5) ^ 4)}
\<lbrakk>0 \<le> 1 / 239; 1 / 239 < 1\<rbrakk> \<Longrightarrow> arctan (1 / 239) - arctan_approx n (1 / 239) \<in> {0..(1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4)}

goal (1 subgoal):
 1. 16 * arctan (1 / 5) - 4 * arctan (1 / 239) - pi_approx n \<in> {- 4 * ((1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4))..16 * (1 / 5) ^ (6 * n + 1) / (1 - (1 / 5) ^ 4)}
[PROOF STEP]
by (simp add: pi_approx_def)
  \<comment> \<open>Coarsening the bounds to make them a bit nicer\<close>
[PROOF STATE]
proof (state)
this:
16 * arctan (1 / 5) - 4 * arctan (1 / 239) - pi_approx n \<in> {- 4 * ((1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4))..16 * (1 / 5) ^ (6 * n + 1) / (1 - (1 / 5) ^ 4)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
16 * arctan (1 / 5) - 4 * arctan (1 / 239) - pi_approx n \<in> {- 4 * ((1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4))..16 * (1 / 5) ^ (6 * n + 1) / (1 - (1 / 5) ^ 4)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
have "-4*((1/239::real)^(2*n+1) / (1-(1/239)^4)) = -((13651919 / 815702160) / 57121^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 4 * ((1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4)) = - (13651919 / 815702160 / 57121 ^ n)
[PROOF STEP]
by (simp add: power_mult power2_eq_square) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
- 4 * ((1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4)) = - (13651919 / 815702160 / 57121 ^ n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- 4 * ((1 / 239) ^ (2 * n + 1) / (1 - (1 / 239) ^ 4)) = - (13651919 / 815702160 / 57121 ^ n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
have "16*(1/5)^(6*n+1) / (1-(1/5::real)^4) = (125/39) / 15625^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 16 * (1 / 5) ^ (6 * n + 1) / (1 - (1 / 5) ^ 4) = 125 / 39 / 15625 ^ n
[PROOF STEP]
by (simp add: power_mult power2_eq_square) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
16 * (1 / 5) ^ (6 * n + 1) / (1 - (1 / 5) ^ 4) = 125 / 39 / 15625 ^ n

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
16 * (1 / 5) ^ (6 * n + 1) / (1 - (1 / 5) ^ 4) = 125 / 39 / 15625 ^ n

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
have "{-((13651919 / 815702160) / 57121^n) .. (125 / 39) / 15625^n} \<subseteq>
               {- (4 / 2^(13*n)) .. 4 / (2^(13*n)::real)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {- (13651919 / 815702160 / 57121 ^ n)..125 / 39 / 15625 ^ n} \<subseteq> {- (4 / 2 ^ (13 * n))..4 / 2 ^ (13 * n)}
[PROOF STEP]
by (subst atLeastatMost_subset_iff, intro disjI2 conjI le_imp_neg_le)
       (rule frac_le; simp add: power_mult power_mono)+
[PROOF STATE]
proof (state)
this:
{- (13651919 / 815702160 / 57121 ^ n)..125 / 39 / 15625 ^ n} \<subseteq> {- (4 / 2 ^ (13 * n))..4 / 2 ^ (13 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pi - pi_approx n \<in> {- (4 / 2 ^ (13 * n))..4 / 2 ^ (13 * n)}
[PROOF STEP]
have "abs (pi - pi_approx n) \<le> 4 / 2^(13*n)"
[PROOF STATE]
proof (prove)
using this:
pi - pi_approx n \<in> {- (4 / 2 ^ (13 * n))..4 / 2 ^ (13 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> 4 / 2 ^ (13 * n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>pi - pi_approx n\<bar> \<le> 4 / 2 ^ (13 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>pi - pi_approx n\<bar> \<le> 4 / 2 ^ (13 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
from \<open>n > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "4 / 2^(13*n) = 1 / (2^(13*n - 2) :: real)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 4 / 2 ^ (13 * n) = 1 / 2 ^ (13 * n - 2)
[PROOF STEP]
by (cases n) (simp_all add: power_add)
[PROOF STATE]
proof (state)
this:
4 / 2 ^ (13 * n) = 1 / 2 ^ (13 * n - 2)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>pi - pi_approx n\<bar> \<le> 1 / 2 ^ (13 * n - 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>pi - pi_approx n\<bar> \<le> 1 / 2 ^ (13 * n - 2)

goal (1 subgoal):
 1. \<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))
[PROOF STEP]
by (simp add: divide_inverse)
[PROOF STATE]
proof (state)
this:
\<bar>pi - pi_approx n\<bar> \<le> inverse (2 ^ (13 * n - 2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_plus_minus_cancel:
  assumes "u adds t" and "s adds u"
  shows "(t - u) + (u - s) = t - s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t - u + (u - s) = t - s
[PROOF STEP]
by (metis assms(1) assms(2) local.add_diff_cancel_left' local.add_diff_cancel_right local.addsE minus_plus)


[STATEMENT]
lemma pred_is_pr: "(\<lambda> x. x - (1::nat)) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x - 1) \<in> PrimRec1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. x - 1) \<in> PrimRec1
[PROOF STEP]
have S1: "PrimRecOp1 0 (\<lambda> x y. x) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PrimRecOp1 0 (\<lambda>x y. x) \<in> PrimRec1
[PROOF STEP]
proof (rule pr_rec1)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x y. x) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda> x y. x) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. x) \<in> PrimRec2
[PROOF STEP]
by (rule pr_id2_1)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. x) \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
PrimRecOp1 0 (\<lambda>x y. x) \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>x. x - 1) \<in> PrimRec1
[PROOF STEP]
have "(\<lambda> x. x-(1::nat)) = PrimRecOp1 0 (\<lambda> x y. x)" (is "_ = ?f")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)
[PROOF STEP]
have "\<And> x. (?f x = x-(1::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. PrimRecOp1 0 (\<lambda>x y. x) x = x - 1
[PROOF STEP]
by (induct_tac x, auto)
[PROOF STATE]
proof (state)
this:
PrimRecOp1 0 (\<lambda>x y. x) ?x = ?x - 1

goal (1 subgoal):
 1. (\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
PrimRecOp1 0 (\<lambda>x y. x) ?x = ?x - 1

goal (1 subgoal):
 1. (\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)
[PROOF STEP]
by (simp add: ext)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)

goal (1 subgoal):
 1. (\<lambda>x. x - 1) \<in> PrimRec1
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
PrimRecOp1 0 (\<lambda>x y. x) \<in> PrimRec1
(\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
PrimRecOp1 0 (\<lambda>x y. x) \<in> PrimRec1
(\<lambda>x. x - 1) = PrimRecOp1 0 (\<lambda>x y. x)

goal (1 subgoal):
 1. (\<lambda>x. x - 1) \<in> PrimRec1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x - 1) \<in> PrimRec1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma t_list_of_A_log_bound:
  "braun t \<Longrightarrow> t_list_of_A t \<le> 2 * nlog2 (size t + 1) * size t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. braun t \<Longrightarrow> t_list_of_A t \<le> 2 * nat \<lceil>log 2 (real (size t + 1))\<rceil> * size t
[PROOF STEP]
using t_list_of_A_bound[of t]
[PROOF STATE]
proof (prove)
using this:
t_list_of_A t \<le> 2 * height t * size t

goal (1 subgoal):
 1. braun t \<Longrightarrow> t_list_of_A t \<le> 2 * nat \<lceil>log 2 (real (size t + 1))\<rceil> * size t
[PROOF STEP]
by (simp add: height_acomplete acomplete_if_braun size1_size)


[STATEMENT]
lemma create_opt_sol_satisfies_geq0:
  assumes "create_optimal_solutions A b c = Sat X"
  assumes "(x, y) = split_n_m_x (dim_vec c) (dim_vec b) X"
  shows "\<And>i. i < dim_vec y \<Longrightarrow> y$i \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < dim_vec y \<Longrightarrow> 0 \<le> y $ i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec y \<Longrightarrow> 0 \<le> y $ i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec y \<Longrightarrow> 0 \<le> y $ i
[PROOF STEP]
assume "i < dim_vec y"
[PROOF STATE]
proof (state)
this:
i < dim_vec y

goal (1 subgoal):
 1. \<And>i. i < dim_vec y \<Longrightarrow> 0 \<le> y $ i
[PROOF STEP]
have *: "\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (from_index_geq0_vector (dim_vec c) (0\<^sub>v (dim_vec b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (from_index_geq0_vector (dim_vec c) (0\<^sub>v (dim_vec b)))
[PROOF STEP]
using assms(1) create_opt_sol_satisfies
[PROOF STATE]
proof (prove)
using this:
create_optimal_solutions A b c = Inr X
create_optimal_solutions ?A ?b ?c = Inr ?X \<Longrightarrow> \<langle>?X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (x_times_c_geq_y_times_b ?c ?b # mat_leqb_eqc ?A ?b ?c @ from_index_geq0_vector (dim_vec ?c) (0\<^sub>v (dim_vec ?b)))

goal (1 subgoal):
 1. \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (from_index_geq0_vector (dim_vec c) (0\<^sub>v (dim_vec b)))
[PROOF STEP]
by (metis UnCI append_Cons set_append)
[PROOF STATE]
proof (state)
this:
\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (from_index_geq0_vector (dim_vec c) (0\<^sub>v (dim_vec b)))

goal (1 subgoal):
 1. \<And>i. i < dim_vec y \<Longrightarrow> 0 \<le> y $ i
[PROOF STEP]
have **: "i < dim_vec b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_vec b
[PROOF STEP]
by (metis \<open>i < dim_vec y\<close> assms(2) split_n_m_x_abbrev_dims(2))
[PROOF STATE]
proof (state)
this:
i < dim_vec b

goal (1 subgoal):
 1. \<And>i. i < dim_vec y \<Longrightarrow> 0 \<le> y $ i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_vec b
[PROOF STEP]
show "0 \<le> y $ i"
[PROOF STATE]
proof (prove)
using this:
i < dim_vec b

goal (1 subgoal):
 1. 0 \<le> y $ i
[PROOF STEP]
using from_index_geq0_vector_split_snd[of "dim_vec c" "0\<^sub>v (dim_vec b)" X x y
        "dim_vec b" i, OF * assms(2)]
[PROOF STATE]
proof (prove)
using this:
i < dim_vec b
\<lbrakk>i < dim_vec (0\<^sub>v (dim_vec b)); i < dim_vec b\<rbrakk> \<Longrightarrow> 0\<^sub>v (dim_vec b) $ i \<le> y $ i

goal (1 subgoal):
 1. 0 \<le> y $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> y $ i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subpath0_flow_to_path:
  shows "(subpath 0 u (flow_to_path x t t')) = flow_to_path x t (t + u*(t'-t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subpath 0 u (flow_to_path x t t') = flow_to_path x t (t + u * (t' - t))
[PROOF STEP]
unfolding flow_to_path_def subpath_image subpath0_linepath
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow0 x \<circ> linepath t (t + u * (t' - t)) = flow0 x \<circ> linepath t (t + u * (t' - t))
[PROOF STEP]
by auto


[STATEMENT]
lemma four_block_mat_real_diag:
  assumes "\<forall>i < dim_row B1. B1$$(i,i) \<in> Reals"
  and "\<forall>i < dim_row B2. B2$$(i,i) \<in> Reals"
  and "dim_row B1 = dim_col B1"
  and "dim_row B2 = dim_col B2"
  and "i < dim_row (four_block_diag B1 B2)"
shows "(four_block_diag B1 B2) $$ (i,i) \<in> Reals"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
proof (cases "i < dim_row B1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < dim_row B1 \<Longrightarrow> four_block_diag B1 B2 $$ (i, i) \<in> \<real>
 2. \<not> i < dim_row B1 \<Longrightarrow> four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < dim_row B1

goal (2 subgoals):
 1. i < dim_row B1 \<Longrightarrow> four_block_diag B1 B2 $$ (i, i) \<in> \<real>
 2. \<not> i < dim_row B1 \<Longrightarrow> four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row B1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < dim_row B1

goal (1 subgoal):
 1. four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row B1
\<forall>i<dim_row B1. B1 $$ (i, i) \<in> \<real>
\<forall>i<dim_row B2. B2 $$ (i, i) \<in> \<real>
dim_row B1 = dim_col B1
dim_row B2 = dim_col B2
i < dim_row (four_block_diag B1 B2)

goal (1 subgoal):
 1. four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_diag B1 B2 $$ (i, i) \<in> \<real>

goal (1 subgoal):
 1. \<not> i < dim_row B1 \<Longrightarrow> four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < dim_row B1 \<Longrightarrow> four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < dim_row B1

goal (1 subgoal):
 1. \<not> i < dim_row B1 \<Longrightarrow> four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> i < dim_row B1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> i < dim_row B1

goal (1 subgoal):
 1. four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> i < dim_row B1
\<forall>i<dim_row B1. B1 $$ (i, i) \<in> \<real>
\<forall>i<dim_row B2. B2 $$ (i, i) \<in> \<real>
dim_row B1 = dim_col B1
dim_row B2 = dim_col B2
i < dim_row (four_block_diag B1 B2)

goal (1 subgoal):
 1. four_block_diag B1 B2 $$ (i, i) \<in> \<real>
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
four_block_diag B1 B2 $$ (i, i) \<in> \<real>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_zero_vec[simp]: "(v :: 'a :: group_add vec) \<in> carrier_vec n \<Longrightarrow> v - 0\<^sub>v n = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec n \<Longrightarrow> v - 0\<^sub>v n = v
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma succ_rtran_set: "set (succ_rtran G v) = {e2. (v,e2) \<in> (set (edgesL G))\<^sup>*}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (FiniteListGraph.succ_rtran G v) = {e2. (v, e2) \<in> (set (edgesL G))\<^sup>*}
[PROOF STEP]
unfolding succ_rtran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (rtrancl_list_impl (edgesL G) [v]) = {e2. (v, e2) \<in> (set (edgesL G))\<^sup>*}
[PROOF STEP]
by (simp add: rtrancl_list_impl)

  \<comment> \<open>succ tran\<close>


[STATEMENT]
lemma tagged_division_Un_interval:
  fixes a :: "'a::euclidean_space"
  assumes "p1 tagged_division_of (cbox a b \<inter> {x. x\<bullet>k \<le> (c::real)})"
    and "p2 tagged_division_of (cbox a b \<inter> {x. x\<bullet>k \<ge> c})"
    and k: "k \<in> Basis"
  shows "(p1 \<union> p2) tagged_division_of (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 \<union> p2 tagged_division_of cbox a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p1 \<union> p2 tagged_division_of cbox a b
[PROOF STEP]
have *: "cbox a b = (cbox a b \<inter> {x. x\<bullet>k \<le> c}) \<union> (cbox a b \<inter> {x. x\<bullet>k \<ge> c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox a b = cbox a b \<inter> {x. x \<bullet> k \<le> c} \<union> cbox a b \<inter> {x. c \<le> x \<bullet> k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cbox a b = cbox a b \<inter> {x. x \<bullet> k \<le> c} \<union> cbox a b \<inter> {x. c \<le> x \<bullet> k}

goal (1 subgoal):
 1. p1 \<union> p2 tagged_division_of cbox a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 \<union> p2 tagged_division_of cbox a b
[PROOF STEP]
apply (subst *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 \<union> p2 tagged_division_of cbox a b \<inter> {x. x \<bullet> k \<le> c} \<union> cbox a b \<inter> {x. c \<le> x \<bullet> k}
[PROOF STEP]
apply (rule tagged_division_Un[OF assms(1-2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (cbox a b \<inter> {x. x \<bullet> k \<le> c}) \<inter> interior (cbox a b \<inter> {x. c \<le> x \<bullet> k}) = {}
[PROOF STEP]
unfolding interval_split[OF k] interior_cbox
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. box a (\<Sum>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) *\<^sub>R i) \<inter> box (\<Sum>i\<in>Basis. (if i = k then max (a \<bullet> k) c else a \<bullet> i) *\<^sub>R i) b = {}
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k \<in> Basis

goal (1 subgoal):
 1. box a (\<Sum>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) *\<^sub>R i) \<inter> box (\<Sum>i\<in>Basis. (if i = k then max (a \<bullet> k) c else a \<bullet> i) *\<^sub>R i) b = {}
[PROOF STEP]
apply (auto simp add: box_def elim!: ballE[where x=k])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
p1 \<union> p2 tagged_division_of cbox a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem measure_while_option_Some: fixes f :: "'s \<Rightarrow> nat"
shows "(\<And>s. P s \<Longrightarrow> b s \<Longrightarrow> P(c s) \<and> f(c s) < f s)
  \<Longrightarrow> P s \<Longrightarrow> \<exists>t. while_option b c s = Some t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. \<lbrakk>P s; b s\<rbrakk> \<Longrightarrow> P (c s) \<and> f (c s) < f s; P s\<rbrakk> \<Longrightarrow> \<exists>t. while_option b c s = Some t
[PROOF STEP]
by(blast intro: wf_while_option_Some[OF wf_if_measure, of P b f])


[STATEMENT]
lemma isMaxim_unique[intro]: "\<lbrakk>isMaxim A x; isMaxim A y\<rbrakk> \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isMaxim A x; isMaxim A y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
unfolding isMaxim_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A \<and> (\<forall>a\<in>A. (a, x) \<in> r); y \<in> A \<and> (\<forall>a\<in>A. (a, y) \<in> r)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using antisymD[OF ANTISYM, of x y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(x, y) \<in> r; (y, x) \<in> r\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. \<lbrakk>x \<in> A \<and> (\<forall>a\<in>A. (a, x) \<in> r); y \<in> A \<and> (\<forall>a\<in>A. (a, y) \<in> r)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by auto


[STATEMENT]
lemma rows_and_cols_transpose: "rows M = cols M\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rows M = cols M\<^sup>T
[PROOF STEP]
using row_transpose
[PROOF STATE]
proof (prove)
using this:
?j < dim_col ?A \<Longrightarrow> row ?A\<^sup>T ?j = col ?A ?j

goal (1 subgoal):
 1. rows M = cols M\<^sup>T
[PROOF STEP]
by simp


[STATEMENT]
lemma register_Snd_register_Fst[simp]:
  assumes \<open>register F\<close>
  shows \<open>(F o Snd; F o Fst) = F o swap\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<circ> Snd;F \<circ> Fst) = F \<circ> swap
[PROOF STEP]
apply (rule tensor_extensionality)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. clinear (F \<circ> Snd;F \<circ> Fst)
 2. clinear (F \<circ> swap)
 3. \<And>a b. (F \<circ> Snd;F \<circ> Fst) (a \<otimes>\<^sub>u b) = (F \<circ> swap) (a \<otimes>\<^sub>u b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
register F

goal (3 subgoals):
 1. clinear (F \<circ> Snd;F \<circ> Fst)
 2. clinear (F \<circ> swap)
 3. \<And>a b. (F \<circ> Snd;F \<circ> Fst) (a \<otimes>\<^sub>u b) = (F \<circ> swap) (a \<otimes>\<^sub>u b)
[PROOF STEP]
by (auto simp: register_pair_apply Fst_def Snd_def register_mult comp_tensor_op)


[STATEMENT]
lemma zero_power_eq:
  "0 ^ n = (1 when n = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) ^ n = ((1::'a) when n = 0)
[PROOF STEP]
by (simp add: power_0_left)


[STATEMENT]
lemma unique_default_example: "succ_tran \<lparr>nodes = {vertex_1, vertex_2}, edges = {(vertex_1, vertex_2)}\<rparr> vertex_2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. succ_tran \<lparr>nodes = {vertex_1, vertex_2}, edges = {(vertex_1, vertex_2)}\<rparr> vertex_2 = {}
[PROOF STEP]
apply (simp add: succ_tran_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (vertex_2, x) \<notin> {(vertex_1, vertex_2)}\<^sup>+
[PROOF STEP]
by (metis Domain.DomainI Domain_empty Domain_insert distinct_vertices12 singleton_iff trancl_domain)