[STATEMENT]
lemma LeadsETo_Union:
     "(\<And>A. A \<in> S \<Longrightarrow> F \<in> A LeadsTo[CC] B) \<Longrightarrow> F \<in> (\<Union>S) LeadsTo[CC] B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> A LeadsTo[CC] B) \<Longrightarrow> F \<in> \<Union> S LeadsTo[CC] B
[PROOF STEP]
apply (simp add: LeadsETo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> (reachable F \<inter> A) leadsTo[(\<inter>) (reachable F) ` CC] B) \<Longrightarrow> F \<in> (reachable F \<inter> \<Union> S) leadsTo[(\<inter>) (reachable F) ` CC] B
[PROOF STEP]
apply (subst Int_Union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> (reachable F \<inter> A) leadsTo[(\<inter>) (reachable F) ` CC] B) \<Longrightarrow> F \<in> \<Union> ((\<inter>) (reachable F) ` S) leadsTo[(\<inter>) (reachable F) ` CC] B
[PROOF STEP]
apply (blast intro: leadsETo_UN)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma complex_poly_cong:
  "(map_poly Re p = map_poly Re q \<and> map_poly Im p = map_poly Im q) = (p = q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_poly Re p = map_poly Re q \<and> map_poly Im p = map_poly Im q) = (p = q)
[PROOF STEP]
by (metis complex_poly_eq)


[STATEMENT]
lemma takeWhile_takeWhile: "takeWhile Q (takeWhile P xs) = takeWhile (\<lambda>x. P x \<and> Q x) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. takeWhile Q (takeWhile P xs) = takeWhile (\<lambda>x. P x \<and> Q x) xs
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma Lcm_dvd_iff: "Lcm A dvd x \<longleftrightarrow> (\<forall>y\<in>A. y dvd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Lcm A dvd x) = (\<forall>y\<in>A. y dvd x)
[PROOF STEP]
by (blast dest: Lcm_dvdD intro: Lcm_least)


[STATEMENT]
lemma L6_Boiler:
  assumes h1:"SteamBoiler x s y"
         and h2:"ts x"
         and h3:"hd (x j) = Zero"
  shows "(hd (s j)) - (10::nat) \<le> hd (s (Suc j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (s j) - 10 \<le> hd (s (Suc j))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hd (s j) - 10 \<le> hd (s (Suc j))
[PROOF STEP]
from h1 and h2
[PROOF STATE]
proof (chain)
picking this:
SteamBoiler x s y
ts x
[PROOF STEP]
obtain r where
     a1:"r \<le> 10"  and
     a2:"hd (s (Suc j)) = (if hd (x j) = Zero then hd (s j) - r else hd (s j) + r)"
[PROOF STATE]
proof (prove)
using this:
SteamBoiler x s y
ts x

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>r \<le> 10; hd (s (Suc j)) = (if hd (x j) = Zero then hd (s j) - r else hd (s j) + r)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: SteamBoiler_def, auto)
[PROOF STATE]
proof (state)
this:
r \<le> 10
hd (s (Suc j)) = (if hd (x j) = Zero then hd (s j) - r else hd (s j) + r)

goal (1 subgoal):
 1. hd (s j) - 10 \<le> hd (s (Suc j))
[PROOF STEP]
from a2 and h3
[PROOF STATE]
proof (chain)
picking this:
hd (s (Suc j)) = (if hd (x j) = Zero then hd (s j) - r else hd (s j) + r)
hd (x j) = Zero
[PROOF STEP]
have "hd (s (Suc j)) = hd (s j) - r"
[PROOF STATE]
proof (prove)
using this:
hd (s (Suc j)) = (if hd (x j) = Zero then hd (s j) - r else hd (s j) + r)
hd (x j) = Zero

goal (1 subgoal):
 1. hd (s (Suc j)) = hd (s j) - r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hd (s (Suc j)) = hd (s j) - r

goal (1 subgoal):
 1. hd (s j) - 10 \<le> hd (s (Suc j))
[PROOF STEP]
from this and a1
[PROOF STATE]
proof (chain)
picking this:
hd (s (Suc j)) = hd (s j) - r
r \<le> 10
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hd (s (Suc j)) = hd (s j) - r
r \<le> 10

goal (1 subgoal):
 1. hd (s j) - 10 \<le> hd (s (Suc j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hd (s j) - 10 \<le> hd (s (Suc j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bdd_all_make_bdd: "bdd_all P (make_bdd f n xs) = (\<forall>ys\<in>set (mk_nat_vecs n). P (f (xs @ ys)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_all P (make_bdd f n xs) = (\<forall>ys\<in>set (mk_nat_vecs n). P (f (xs @ ys)))
[PROOF STEP]
by (induct n arbitrary: xs) (auto simp add: Let_def)


[STATEMENT]
lemma diff_eq_0_ennreal: "a < top \<Longrightarrow> a \<le> b \<Longrightarrow> a - b = (0::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < top; a \<le> b\<rbrakk> \<Longrightarrow> a - b = 0
[PROOF STEP]
using ennreal_minus_pos_iff gr_zeroI not_less
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a < top \<or> ?b < top; 0 < ?a - ?b\<rbrakk> \<Longrightarrow> ?b < ?a
(?n = (0::?'a) \<Longrightarrow> False) \<Longrightarrow> (0::?'a) < ?n
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. \<lbrakk>a < top; a \<le> b\<rbrakk> \<Longrightarrow> a - b = 0
[PROOF STEP]
by blast


[STATEMENT]
lemma integral_by_parts:
  fixes f g F G::"real \<Rightarrow> real"
  assumes [arith]: "a \<le> b"
  assumes cont_f[intro]: "!!x. a \<le>x \<Longrightarrow> x\<le>b \<Longrightarrow> isCont f x"
  assumes cont_g[intro]: "!!x. a \<le>x \<Longrightarrow> x\<le>b \<Longrightarrow> isCont g x"
  assumes [intro]: "!!x. DERIV F x :> f x"
  assumes [intro]: "!!x. DERIV G x :> g x"
  shows "(\<integral>x. (F x * g x) * indicator {a .. b} x \<partial>lborel)
            =  F b * G b - F a * G a - \<integral>x. (f x * G x) * indicator {a .. b} x \<partial>lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
have "(\<integral>x. (F x * g x + f x * G x) * indicator {a .. b} x \<partial>lborel)
      = LBINT x. F x * g x * indicat_real {a..b} x + f x * G x * indicat_real {a..b} x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = LBINT x. F x * g x * indicat_real {a..b} x + f x * G x * indicat_real {a..b} x
[PROOF STEP]
by (meson vector_space_over_itself.scale_left_distrib)
[PROOF STATE]
proof (state)
this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = LBINT x. F x * g x * indicat_real {a..b} x + f x * G x * indicat_real {a..b} x

goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = LBINT x. F x * g x * indicat_real {a..b} x + f x * G x * indicat_real {a..b} x

goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
have "... = (\<integral>x. (F x * g x) * indicator {a .. b} x \<partial>lborel) + \<integral>x. (f x * G x) * indicator {a .. b} x \<partial>lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x + f x * G x * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
proof (intro Bochner_Integration.integral_add borel_integrable_atLeastAtMost cont_f cont_g continuous_intros)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x
 2. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 3. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
 4. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 5. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
 6. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x
[PROOF STEP]
show "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x" "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x) &&& (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x)
[PROOF STEP]
using DERIV_isCont
[PROOF STATE]
proof (prove)
using this:
(?f has_field_derivative ?D) (at ?x) \<Longrightarrow> isCont ?f ?x

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x) &&& (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> isCont F ?x
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> isCont G ?x

goal (4 subgoals):
 1. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 2. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
 3. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 4. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
LBINT x. F x * g x * indicat_real {a..b} x + f x * G x * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)

goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
have "(\<integral>x. (F x * g x + f x * G x) * indicator {a .. b} x \<partial>lborel) =
                (\<integral>x. (F x * g x) * indicator {a .. b} x \<partial>lborel) + \<integral>x. (f x * G x) * indicator {a .. b} x \<partial>lborel"
[PROOF STATE]
proof (prove)
using this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)

goal (1 subgoal):
 1. LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)

goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)

goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
have "(\<integral>x. (F x * g x + f x * G x) * indicator {a .. b} x \<partial>lborel) = F b * G b - F a * G a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = F b * G b - F a * G a
[PROOF STEP]
proof (intro integral_FTC_Icc_real derivative_eq_intros cont_f cont_g continuous_intros)
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. a \<le> b
 2. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (F has_real_derivative ?Da7 x) (at x)
 3. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (G has_real_derivative ?Db7 x) (at x)
 4. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> ?Da7 x * G x + ?Db7 x * F x = F x * g x + f x * G x
 5. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x
 6. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 7. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
 8. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 9. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
 10. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x
[PROOF STEP]
show "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x" "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x) &&& (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x)
[PROOF STEP]
using DERIV_isCont
[PROOF STATE]
proof (prove)
using this:
(?f has_field_derivative ?D) (at ?x) \<Longrightarrow> isCont ?f ?x

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont F x) &&& (\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont G x)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> isCont F ?x
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> isCont G ?x

goal (8 subgoals):
 1. a \<le> b
 2. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (F has_real_derivative ?Da7 x) (at x)
 3. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (G has_real_derivative ?Db7 x) (at x)
 4. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> ?Da7 x * G x + ?Db7 x * F x = F x * g x + f x * G x
 5. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 6. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
 7. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> a \<le> x
 8. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> b
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = F b * G b - F a * G a

goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = F b * G b - F a * G a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = (LBINT x. F x * g x * indicat_real {a..b} x) + (LBINT x. f x * G x * indicat_real {a..b} x)
LBINT x. (F x * g x + f x * G x) * indicat_real {a..b} x = F b * G b - F a * G a

goal (1 subgoal):
 1. LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_of_nat_less_eq_iff:
  \<open>word_of_nat m \<le> (word_of_nat n :: 'a::len word) \<longleftrightarrow> take_bit LENGTH('a) m \<le> take_bit LENGTH('a) n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (word_of_nat m \<le> word_of_nat n) = (take_bit LENGTH('a) m \<le> take_bit LENGTH('a) n)
[PROOF STEP]
by transfer (simp add: take_bit_of_nat)


[STATEMENT]
lemma mcont_enat_le_lprefix_case [cont_intro, simp]:
  assumes "mcont Sup (\<le>) lSup (\<sqsubseteq>) (\<lambda>x. f x (eSuc x))"
  shows "mcont Sup (\<le>) lSup (\<sqsubseteq>) (\<lambda>x. case x of 0 \<Rightarrow> LNil | eSuc x' \<Rightarrow> f x' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mcont Sup (\<le>) lSup (\<sqsubseteq>) (\<lambda>x. case x of 0 \<Rightarrow> LNil | eSuc x' \<Rightarrow> f x' x)
[PROOF STEP]
using llist_ccpo assms
[PROOF STATE]
proof (prove)
using this:
class.ccpo lSup (\<sqsubseteq>) (mk_less (\<sqsubseteq>))
mcont Sup (\<le>) lSup (\<sqsubseteq>) (\<lambda>x. f x (eSuc x))

goal (1 subgoal):
 1. mcont Sup (\<le>) lSup (\<sqsubseteq>) (\<lambda>x. case x of 0 \<Rightarrow> LNil | eSuc x' \<Rightarrow> f x' x)
[PROOF STEP]
by(rule mcont_enat_le_case) simp


[STATEMENT]
lemma a_calc_i_0: "$a^{m}_n = n" if "m \<noteq> 0" "i = 0" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $a^{m}_n = real n
[PROOF STEP]
unfolding ann_def v_pres_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 / (1 + i)) .^ (real (k + 1) / real m) / real m) = real n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0
i = 0

goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 / (1 + i)) .^ (real (k + 1) / real m) / real m) = real n
[PROOF STEP]
by simp


[STATEMENT]
lemma sfis_intro:
  assumes ms: "measure_space M" and Ams: "\<forall>i \<in> S. A i \<in> measurable_sets M"
  and nn: "nonnegative x" and S: "finite S"
  shows "(\<Sum>i\<in>S. x i * measure M (A i)) \<in>
  sfis (\<lambda>t. \<Sum>i\<in>(S::nat set). x i * \<chi> (A i) t) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
assume iS: "i \<in> S"
[PROOF STATE]
proof (state)
this:
i \<in> S

goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
with ms Ams
[PROOF STATE]
proof (chain)
picking this:
measure_space M
\<forall>i\<in>S. A i \<in> measurable_sets M
i \<in> S
[PROOF STEP]
have "measure M (A i) \<in> sfis \<chi> (A i) M"
[PROOF STATE]
proof (prove)
using this:
measure_space M
\<forall>i\<in>S. A i \<in> measurable_sets M
i \<in> S

goal (1 subgoal):
 1. Measure.measure M (A i) \<in> sfis \<chi> (A i) M
[PROOF STEP]
by (simp add: sfis_char)
[PROOF STATE]
proof (state)
this:
Measure.measure M (A i) \<in> sfis \<chi> (A i) M

goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
with nn
[PROOF STATE]
proof (chain)
picking this:
nonnegative x
Measure.measure M (A i) \<in> sfis \<chi> (A i) M
[PROOF STEP]
have "x i * measure M (A i) \<in> sfis (\<lambda>t. x i * \<chi> (A i) t) M"
[PROOF STATE]
proof (prove)
using this:
nonnegative x
Measure.measure M (A i) \<in> sfis \<chi> (A i) M

goal (1 subgoal):
 1. x i * Measure.measure M (A i) \<in> sfis (\<lambda>t. x i * \<chi> (A i) t) M
[PROOF STEP]
by (simp add: nonnegative_def sfis_times)
[PROOF STATE]
proof (state)
this:
x i * Measure.measure M (A i) \<in> sfis (\<lambda>t. x i * \<chi> (A i) t) M

goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 \<in> S \<Longrightarrow> x ?i2 * Measure.measure M (A ?i2) \<in> sfis (\<lambda>t. x ?i2 * \<chi> (A ?i2) t) M

goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
with ms S
[PROOF STATE]
proof (chain)
picking this:
measure_space M
finite S
?i2 \<in> S \<Longrightarrow> x ?i2 * Measure.measure M (A ?i2) \<in> sfis (\<lambda>t. x ?i2 * \<chi> (A ?i2) t) M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
measure_space M
finite S
?i2 \<in> S \<Longrightarrow> x ?i2 * Measure.measure M (A ?i2) \<in> sfis (\<lambda>t. x ?i2 * \<chi> (A ?i2) t) M

goal (1 subgoal):
 1. (\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M
[PROOF STEP]
by (simp add: sfis_sum)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>S. x i * Measure.measure M (A i)) \<in> sfis (\<lambda>t. \<Sum>i\<in>S. x i * \<chi> (A i) t) M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_descending_alt: "sorted_descending xs \<longleftrightarrow> sorted (rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_descending xs = sorted (rev xs)
[PROOF STEP]
using sorted_descending[of "rev xs"]
[PROOF STATE]
proof (prove)
using this:
sorted_descending (rev (rev xs)) = sorted (rev xs)

goal (1 subgoal):
 1. sorted_descending xs = sorted (rev xs)
[PROOF STEP]
unfolding rev_rev_ident
[PROOF STATE]
proof (prove)
using this:
sorted_descending xs = sorted (rev xs)

goal (1 subgoal):
 1. sorted_descending xs = sorted (rev xs)
[PROOF STEP]
.


[STATEMENT]
lemma coeff_mult_sum:
  "degree p \<le> m \<Longrightarrow> degree q \<le> n \<Longrightarrow> coeff (p * q) (m + n) = coeff p m * coeff q n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>degree p \<le> m; degree q \<le> n\<rbrakk> \<Longrightarrow> coeff (p * q) (m + n) = coeff p m * coeff q n
[PROOF STEP]
using degree_mult_le[of p q]
[PROOF STATE]
proof (prove)
using this:
degree (p * q) \<le> degree p + degree q

goal (1 subgoal):
 1. \<lbrakk>degree p \<le> m; degree q \<le> n\<rbrakk> \<Longrightarrow> coeff (p * q) (m + n) = coeff p m * coeff q n
[PROOF STEP]
by (auto simp add: le_less coeff_eq_0 coeff_mult_degree_sum)


[STATEMENT]
lemma rev_take_Suc: assumes j: "j < length xs"
  shows "rev (take (Suc j) xs) = xs ! j # rev (take j xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (take (Suc j) xs) = xs ! j # rev (take j xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rev (take (Suc j) xs) = xs ! j # rev (take j xs)
[PROOF STEP]
from j
[PROOF STATE]
proof (chain)
picking this:
j < length xs
[PROOF STEP]
have xs: "xs = take j xs @ xs ! j # drop (Suc j) xs"
[PROOF STATE]
proof (prove)
using this:
j < length xs

goal (1 subgoal):
 1. xs = take j xs @ xs ! j # drop (Suc j) xs
[PROOF STEP]
by (rule id_take_nth_drop)
[PROOF STATE]
proof (state)
this:
xs = take j xs @ xs ! j # drop (Suc j) xs

goal (1 subgoal):
 1. rev (take (Suc j) xs) = xs ! j # rev (take j xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (take (Suc j) xs) = xs ! j # rev (take j xs)
[PROOF STEP]
unfolding arg_cong[OF xs, of "\<lambda> xs. rev (take (Suc j) xs)"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (take (Suc j) (take j xs @ xs ! j # drop (Suc j) xs)) = xs ! j # rev (take j xs)
[PROOF STEP]
by (simp add: min_def)
[PROOF STATE]
proof (state)
this:
rev (take (Suc j) xs) = xs ! j # rev (take j xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trancl_impl:
  "set_of (trancl_i rel as) = {b. (\<exists> a \<in> set as. (a, b) \<in> (set rel)\<^sup>+)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (trancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>+}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_of (trancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>+}
[PROOF STEP]
interpret set_access_succ set_of memb empty un "gen_succ rel" "set rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_access_succ set_of memb empty un (gen_succ rel) (set rel)
[PROOF STEP]
by (unfold_locales, insert gen_succ, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_of (trancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>+}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (trancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>+}
[PROOF STEP]
unfolding trancl_impl_def Let_def relpow_impl trancl_unfold_left relcomp_unfold rtrancl_finite_relpow succ
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {uu_. \<exists>a b m. uu_ = b \<and> a \<in> {b. \<exists>a\<in>set as. (a, b) \<in> set rel} \<and> m \<le> length rel \<and> (a, b) \<in> set rel ^^ m} = {b. \<exists>a\<in>set as. (a, b) \<in> {(x, z). \<exists>y. (x, y) \<in> set rel \<and> (\<exists>n\<le>length rel. (y, z) \<in> set rel ^^ n)}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_of (trancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>+}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_of_append[simp]: "map_of (xs @ ys) = map_of ys ++ map_of xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (xs @ ys) = map_of ys ++ map_of xs
[PROOF STEP]
unfolding map_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some x \<Rightarrow> Some x)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
 2. \<And>a xs. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a) \<Longrightarrow> map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (2 subgoals):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
 2. \<And>a xs. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a) \<Longrightarrow> map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (1 subgoal):
 1. map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
by (force split: option.split)
[PROOF STATE]
proof (state)
this:
map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (1 subgoal):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
qed auto


[STATEMENT]
lemma rotater1_zip:
  "length xs = length ys \<Longrightarrow>
    rotater1 (zip xs ys) = zip (rotater1 xs) (rotater1 ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> rotater1 (zip xs ys) = zip (rotater1 xs) (rotater1 ys)
[PROOF STEP]
apply (unfold rotater1_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> (case zip xs ys of [] \<Rightarrow> [] | x # xsa \<Rightarrow> last (zip xs ys) # butlast (zip xs ys)) = zip (case xs of [] \<Rightarrow> [] | x # xsa \<Rightarrow> last xs # butlast xs) (case ys of [] \<Rightarrow> [] | x # xs \<Rightarrow> last ys # butlast ys)
[PROOF STEP]
apply (cases xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>length xs = length ys; xs = []\<rbrakk> \<Longrightarrow> (case zip xs ys of [] \<Rightarrow> [] | x # xsa \<Rightarrow> last (zip xs ys) # butlast (zip xs ys)) = zip (case xs of [] \<Rightarrow> [] | x # xsa \<Rightarrow> last xs # butlast xs) (case ys of [] \<Rightarrow> [] | x # xs \<Rightarrow> last ys # butlast ys)
 2. \<And>a list. \<lbrakk>length xs = length ys; xs = a # list\<rbrakk> \<Longrightarrow> (case zip xs ys of [] \<Rightarrow> [] | x # xsa \<Rightarrow> last (zip xs ys) # butlast (zip xs ys)) = zip (case xs of [] \<Rightarrow> [] | x # xsa \<Rightarrow> last xs # butlast xs) (case ys of [] \<Rightarrow> [] | x # xs \<Rightarrow> last ys # butlast ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. \<lbrakk>Suc 0 = length ys; xs = [a]\<rbrakk> \<Longrightarrow> (case zip [a] ys of [] \<Rightarrow> [] | x # xs \<Rightarrow> last (zip [a] ys) # butlast (zip [a] ys)) = zip [a] (case ys of [] \<Rightarrow> [] | x # xs \<Rightarrow> last ys # butlast ys)
 2. \<And>a list. \<lbrakk>Suc (length list) = length ys; xs = a # list; list \<noteq> []\<rbrakk> \<Longrightarrow> (case zip (a # list) ys of [] \<Rightarrow> [] | x # xs \<Rightarrow> last (zip (a # list) ys) # butlast (zip (a # list) ys)) = zip (last list # a # butlast list) (case ys of [] \<Rightarrow> [] | x # xs \<Rightarrow> last ys # butlast ys)
[PROOF STEP]
apply ((case_tac ys, auto simp: neq_Nil_conv but_last_zip)[1])+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arg_inv_pi:
  assumes "z \<noteq> 0" and "Arg z = pi"
  shows "Arg (1 / z) = pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg (1 / z) = pi
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Arg (1 / z) = pi
[PROOF STEP]
have "1/z = cnj z / cor ((cmod z)\<^sup>2 )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / z = cnj z / cor ((cmod z)\<^sup>2)
[PROOF STEP]
using \<open>z \<noteq> 0\<close> complex_mult_cnj_cmod[of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0
z * cnj z = cor ((cmod z)\<^sup>2)

goal (1 subgoal):
 1. 1 / z = cnj z / cor ((cmod z)\<^sup>2)
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
1 / z = cnj z / cor ((cmod z)\<^sup>2)

goal (1 subgoal):
 1. Arg (1 / z) = pi
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1 / z = cnj z / cor ((cmod z)\<^sup>2)

goal (1 subgoal):
 1. Arg (1 / z) = pi
[PROOF STEP]
using arg_div_real_positive[of "(cmod z)\<^sup>2" "cnj z"] \<open>z \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
1 / z = cnj z / cor ((cmod z)\<^sup>2)
0 < (cmod z)\<^sup>2 \<Longrightarrow> Arg (cnj z / cor ((cmod z)\<^sup>2)) = Arg (cnj z)
z \<noteq> 0

goal (1 subgoal):
 1. Arg (1 / z) = pi
[PROOF STEP]
using arg_cnj_pi[of z] \<open>Arg z = pi\<close>
[PROOF STATE]
proof (prove)
using this:
1 / z = cnj z / cor ((cmod z)\<^sup>2)
0 < (cmod z)\<^sup>2 \<Longrightarrow> Arg (cnj z / cor ((cmod z)\<^sup>2)) = Arg (cnj z)
z \<noteq> 0
Arg z = pi \<Longrightarrow> Arg (cnj z) = pi
Arg z = pi

goal (1 subgoal):
 1. Arg (1 / z) = pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Arg (1 / z) = pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_singleton_conv_Ex1:
  "is_singleton A \<longleftrightarrow> (\<exists>!x. x \<in> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_singleton A = (\<exists>!x. x \<in> A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_singleton A \<Longrightarrow> \<exists>!x. x \<in> A
 2. \<exists>!x. x \<in> A \<Longrightarrow> is_singleton A
[PROOF STEP]
assume "is_singleton A"
[PROOF STATE]
proof (state)
this:
is_singleton A

goal (2 subgoals):
 1. is_singleton A \<Longrightarrow> \<exists>!x. x \<in> A
 2. \<exists>!x. x \<in> A \<Longrightarrow> is_singleton A
[PROOF STEP]
thus "\<exists>!x. x \<in> A"
[PROOF STATE]
proof (prove)
using this:
is_singleton A

goal (1 subgoal):
 1. \<exists>!x. x \<in> A
[PROOF STEP]
by (auto elim!: is_singletonE)
[PROOF STATE]
proof (state)
this:
\<exists>!x. x \<in> A

goal (1 subgoal):
 1. \<exists>!x. x \<in> A \<Longrightarrow> is_singleton A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!x. x \<in> A \<Longrightarrow> is_singleton A
[PROOF STEP]
assume "\<exists>!x. x \<in> A"
[PROOF STATE]
proof (state)
this:
\<exists>!x. x \<in> A

goal (1 subgoal):
 1. \<exists>!x. x \<in> A \<Longrightarrow> is_singleton A
[PROOF STEP]
thus "is_singleton A"
[PROOF STATE]
proof (prove)
using this:
\<exists>!x. x \<in> A

goal (1 subgoal):
 1. is_singleton A
[PROOF STEP]
by (metis equals0D is_singletonI')
[PROOF STATE]
proof (state)
this:
is_singleton A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pullback_mono_self:
    assumes "mono f"
    shows "\<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]
[PROOF STEP]
have "f \<cdot> \<p>\<^sub>0[f, f] = f \<cdot> \<p>\<^sub>1[f, f]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<cdot> \<p>\<^sub>0[f, f] = f \<cdot> \<p>\<^sub>1[f, f]
[PROOF STEP]
using assms pullback_commutes [of f f]
[PROOF STATE]
proof (prove)
using this:
local.mono f
cospan f f \<Longrightarrow> commutative_square f f \<p>\<^sub>1[f, f] \<p>\<^sub>0[f, f]

goal (1 subgoal):
 1. f \<cdot> \<p>\<^sub>0[f, f] = f \<cdot> \<p>\<^sub>1[f, f]
[PROOF STEP]
by (metis commutative_squareE mono_implies_arr)
[PROOF STATE]
proof (state)
this:
f \<cdot> \<p>\<^sub>0[f, f] = f \<cdot> \<p>\<^sub>1[f, f]

goal (1 subgoal):
 1. \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<cdot> \<p>\<^sub>0[f, f] = f \<cdot> \<p>\<^sub>1[f, f]

goal (1 subgoal):
 1. \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]
[PROOF STEP]
using assms monoE [of f "\<p>\<^sub>1[f, f]" "\<p>\<^sub>0[f, f]"]
[PROOF STATE]
proof (prove)
using this:
f \<cdot> \<p>\<^sub>0[f, f] = f \<cdot> \<p>\<^sub>1[f, f]
local.mono f
\<lbrakk>local.mono f; seq f \<p>\<^sub>1[f, f]; seq f \<p>\<^sub>0[f, f]; f \<cdot> \<p>\<^sub>1[f, f] = f \<cdot> \<p>\<^sub>0[f, f]\<rbrakk> \<Longrightarrow> \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]

goal (1 subgoal):
 1. \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]
[PROOF STEP]
by (metis mono_implies_arr prj0_simps(1,3) seqI)
[PROOF STATE]
proof (state)
this:
\<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_span_le_n: assumes W: "W \<subseteq> carrier_vec n" shows "dim_span W \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_span W \<le> n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_span W \<le> n
[PROOF STEP]
from ex_basis_span[OF W]
[PROOF STATE]
proof (chain)
picking this:
\<exists>Wa\<subseteq>carrier_vec n. lin_indpt Wa \<and> local.span W = local.span Wa \<and> dim_span W = card Wa
[PROOF STEP]
obtain V where
    V: "V \<subseteq> carrier_vec n"
    and lin: "lin_indpt V"
    and dim: "dim_span W = card V"
[PROOF STATE]
proof (prove)
using this:
\<exists>Wa\<subseteq>carrier_vec n. lin_indpt Wa \<and> local.span W = local.span Wa \<and> dim_span W = card Wa

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>V \<subseteq> carrier_vec n; lin_indpt V; dim_span W = card V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V \<subseteq> carrier_vec n
lin_indpt V
dim_span W = card V

goal (1 subgoal):
 1. dim_span W \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_span W \<le> n
[PROOF STEP]
unfolding dim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card V \<le> n
[PROOF STEP]
using lin V
[PROOF STATE]
proof (prove)
using this:
lin_indpt V
V \<subseteq> carrier_vec n

goal (1 subgoal):
 1. card V \<le> n
[PROOF STEP]
using dim_is_n li_le_dim
[PROOF STATE]
proof (prove)
using this:
lin_indpt V
V \<subseteq> carrier_vec n
local.dim = n
\<lbrakk>fin_dim; ?A \<subseteq> carrier_vec n; lin_indpt ?A\<rbrakk> \<Longrightarrow> finite ?A
\<lbrakk>fin_dim; ?A \<subseteq> carrier_vec n; lin_indpt ?A\<rbrakk> \<Longrightarrow> card ?A \<le> local.dim

goal (1 subgoal):
 1. card V \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_span W \<le> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_segment_commute: "open_segment a b = open_segment b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_segment a b = open_segment b a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open_segment a b = open_segment b a
[PROOF STEP]
have "{a, b} = {b, a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a, b} = {b, a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a, b} = {b, a}

goal (1 subgoal):
 1. open_segment a b = open_segment b a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{a, b} = {b, a}

goal (1 subgoal):
 1. open_segment a b = open_segment b a
[PROOF STEP]
by (simp add: closed_segment_commute open_segment_def)
[PROOF STATE]
proof (state)
this:
open_segment a b = open_segment b a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rl_lpoly_coeff_nth_non_empty:
  assumes "i < length cs"
  assumes "cs \<noteq> []"
  shows "coeff (list_to_lpoly cs) i = cs!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly cs) i = cs ! i
[PROOF STEP]
using assms(2) assms(1)
[PROOF STATE]
proof (prove)
using this:
cs \<noteq> []
i < length cs

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly cs) i = cs ! i
[PROOF STEP]
proof (induction cs rule: rev_nonempty_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. i < length [x] \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly [x]) i = [x] ! i
 2. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
fix x ::rat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. i < length [x] \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly [x]) i = [x] ! i
 2. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
assume "i < length [x]"
[PROOF STATE]
proof (state)
this:
i < length [x]

goal (2 subgoals):
 1. \<And>x. i < length [x] \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly [x]) i = [x] ! i
 2. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
have "(list_to_lpoly [x]) = lp_monom x 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_to_lpoly [x] = lp_monom x 0
[PROOF STEP]
by (simp add: list_to_lpoly_def)
[PROOF STATE]
proof (state)
this:
list_to_lpoly [x] = lp_monom x 0

goal (2 subgoals):
 1. \<And>x. i < length [x] \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly [x]) i = [x] ! i
 2. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_to_lpoly [x] = lp_monom x 0
[PROOF STEP]
show "coeff (list_to_lpoly [x]) i = [x] ! i"
[PROOF STATE]
proof (prove)
using this:
list_to_lpoly [x] = lp_monom x 0

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly [x]) i = [x] ! i
[PROOF STEP]
using \<open>i < length [x]\<close> list_to_lpoly_def
[PROOF STATE]
proof (prove)
using this:
list_to_lpoly [x] = lp_monom x 0
i < length [x]
list_to_lpoly ?cs = sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length ?cs] ?cs)

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly [x]) i = [x] ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (list_to_lpoly [x]) i = [x] ! i

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
fix x :: rat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
fix xs :: "rat list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
assume "xs \<noteq> []"
[PROOF STATE]
proof (state)
this:
xs \<noteq> []

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
assume IH: "i < length xs \<Longrightarrow> coeff (list_to_lpoly xs) i = xs ! i"
[PROOF STATE]
proof (state)
this:
i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
assume "i < length (xs @ [x])"
[PROOF STATE]
proof (state)
this:
i < length (xs @ [x])

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
consider (le) "i < length xs" | (eq) "i = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs \<Longrightarrow> thesis; i = length xs \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using \<open>i < length (xs @ [x])\<close> less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
i < length (xs @ [x])
(?m < Suc ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. \<lbrakk>i < length xs \<Longrightarrow> thesis; i = length xs \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>i < length xs \<Longrightarrow> ?thesis; i = length xs \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>xs \<noteq> []; i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i; i < length (xs @ [x])\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>i < length xs \<Longrightarrow> ?thesis; i = length xs \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < length xs \<Longrightarrow> ?thesis; i = length xs \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
 2. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
case le
[PROOF STATE]
proof (state)
this:
i < length xs

goal (2 subgoals):
 1. i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
 2. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
have "coeff (lp_monom x (length xs)) i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (lp_monom x (length xs)) i = 0
[PROOF STEP]
using le
[PROOF STATE]
proof (prove)
using this:
i < length xs

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (lp_monom x (length xs)) i = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (lp_monom x (length xs)) i = 0

goal (2 subgoals):
 1. i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
 2. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
have "coeff (sum_list (map2 (\<lambda>x y. lp_monom y x)
          [0..<length (xs @ [x])] (xs @ [x]))) i = (xs @ [x]) ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x]))) i = (xs @ [x]) ! i
[PROOF STEP]
apply(simp add: IH le nth_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = i \<longrightarrow> Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<i] xs)) i + x = xs ! i) \<and> (length xs \<noteq> i \<longrightarrow> Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs)) i = xs ! i)
[PROOF STEP]
using IH le list_to_lpoly_def
[PROOF STATE]
proof (prove)
using this:
i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = xs ! i
i < length xs
list_to_lpoly ?cs = sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length ?cs] ?cs)

goal (1 subgoal):
 1. (length xs = i \<longrightarrow> Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<i] xs)) i + x = xs ! i) \<and> (length xs \<noteq> i \<longrightarrow> Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs)) i = xs ! i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x]))) i = (xs @ [x]) ! i

goal (2 subgoals):
 1. i < length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
 2. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x]))) i = (xs @ [x]) ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x]))) i = (xs @ [x]) ! i

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
unfolding list_to_lpoly_def
[PROOF STATE]
proof (prove)
using this:
Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x]))) i = (xs @ [x]) ! i

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x]))) i = (xs @ [x]) ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i

goal (1 subgoal):
 1. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
case eq
[PROOF STATE]
proof (state)
this:
i = length xs

goal (1 subgoal):
 1. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = length xs
[PROOF STEP]
have *: "coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs)) i = 0"
[PROOF STATE]
proof (prove)
using this:
i = length xs

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs)) i = 0
[PROOF STEP]
using sum_list_map_upto_coeff_limit[of xs i]
[PROOF STATE]
proof (prove)
using this:
i = length xs
length xs \<le> i \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly xs) i = 0

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs)) i = 0
[PROOF STEP]
by (simp add: list_to_lpoly_def)
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs)) i = 0

goal (1 subgoal):
 1. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
have **: "(sum_list (map2 (\<lambda> x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x]))) =
          sum_list (map (\<lambda>(x,y). lp_monom y x) (zip [0..<length xs] xs)) + lp_monom x (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x])) = sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs) + lp_monom x (length xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x])) = sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs) + lp_monom x (length xs)

goal (1 subgoal):
 1. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
have "coeff ((list_to_lpoly xs) + lp_monom x (length xs)) i = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly xs + lp_monom x (length xs)) i = x
[PROOF STEP]
unfolding list_to_lpoly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs) + lp_monom x (length xs)) i = x
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs)) i = 0
sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length (xs @ [x])] (xs @ [x])) = sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs) + lp_monom x (length xs)

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (sum_list (map2 (\<lambda>x y. lp_monom y x) [0..<length xs] xs) + lp_monom x (length xs)) i = x
[PROOF STEP]
by (simp add: eq)
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (list_to_lpoly xs + lp_monom x (length xs)) i = x

goal (1 subgoal):
 1. i = length xs \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Abstract_Linear_Poly.coeff (list_to_lpoly xs + lp_monom x (length xs)) i = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Abstract_Linear_Poly.coeff (list_to_lpoly xs + lp_monom x (length xs)) i = x

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i
[PROOF STEP]
by (simp add: eq list_to_lpoly_def)
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Abstract_Linear_Poly.coeff (list_to_lpoly (xs @ [x])) i = (xs @ [x]) ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ccpo) admissible_le_mono:
  assumes "monotone (\<le>) (\<le>) f"
  shows "ccpo.admissible Sup (\<le>) (\<lambda>x. x \<le> f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccpo.admissible Sup (\<le>) (\<lambda>x. x \<le> f x)
[PROOF STEP]
proof(rule ccpo.admissibleI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain (\<le>) A; A \<noteq> {}; \<forall>x\<in>A. x \<le> f x\<rbrakk> \<Longrightarrow> \<Squnion> A \<le> f (\<Squnion> A)
[PROOF STEP]
fix Y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain (\<le>) A; A \<noteq> {}; \<forall>x\<in>A. x \<le> f x\<rbrakk> \<Longrightarrow> \<Squnion> A \<le> f (\<Squnion> A)
[PROOF STEP]
assume chain: "Complete_Partial_Order.chain (\<le>) Y"
    and Y: "Y \<noteq> {}"
    and le [rule_format]: "\<forall>x\<in>Y. x \<le> f x"
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (\<le>) Y
Y \<noteq> {}
?x \<in> Y \<Longrightarrow> ?x \<le> f ?x

goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain (\<le>) A; A \<noteq> {}; \<forall>x\<in>A. x \<le> f x\<rbrakk> \<Longrightarrow> \<Squnion> A \<le> f (\<Squnion> A)
[PROOF STEP]
have "\<Squnion>Y \<le> \<Squnion>(f ` Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> Y \<le> \<Squnion> (f ` Y)
[PROOF STEP]
using chain
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (\<le>) Y

goal (1 subgoal):
 1. \<Squnion> Y \<le> \<Squnion> (f ` Y)
[PROOF STEP]
by(rule ccpo_Sup_least)(rule order_trans[OF le]; blast intro!: ccpo_Sup_upper chain_imageI[OF chain] intro: monotoneD[OF assms])
[PROOF STATE]
proof (state)
this:
\<Squnion> Y \<le> \<Squnion> (f ` Y)

goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain (\<le>) A; A \<noteq> {}; \<forall>x\<in>A. x \<le> f x\<rbrakk> \<Longrightarrow> \<Squnion> A \<le> f (\<Squnion> A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Squnion> Y \<le> \<Squnion> (f ` Y)

goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain (\<le>) A; A \<noteq> {}; \<forall>x\<in>A. x \<le> f x\<rbrakk> \<Longrightarrow> \<Squnion> A \<le> f (\<Squnion> A)
[PROOF STEP]
have "\<dots> \<le> f (\<Squnion>Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (f ` Y) \<le> f (\<Squnion> Y)
[PROOF STEP]
by(rule Sup_image_mono[OF _ assms chain Y, where lessa="(<)"]) unfold_locales
[PROOF STATE]
proof (state)
this:
\<Squnion> (f ` Y) \<le> f (\<Squnion> Y)

goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain (\<le>) A; A \<noteq> {}; \<forall>x\<in>A. x \<le> f x\<rbrakk> \<Longrightarrow> \<Squnion> A \<le> f (\<Squnion> A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Squnion> Y \<le> f (\<Squnion> Y)
[PROOF STEP]
show "\<Squnion>Y \<le> \<dots>"
[PROOF STATE]
proof (prove)
using this:
\<Squnion> Y \<le> f (\<Squnion> Y)

goal (1 subgoal):
 1. \<Squnion> Y \<le> f (\<Squnion> Y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Squnion> Y \<le> f (\<Squnion> Y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nlistsE_nth_in: "\<lbrakk> xs \<in> nlists n A; i < n \<rbrakk> \<Longrightarrow> xs!i \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> nlists n A; i < n\<rbrakk> \<Longrightarrow> xs ! i \<in> A
[PROOF STEP]
unfolding nlists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> {xs. length xs = n \<and> set xs \<subseteq> A}; i < n\<rbrakk> \<Longrightarrow> xs ! i \<in> A
[PROOF STEP]
by (auto)


[STATEMENT]
lemma stirling_sum_2_conv_stirling_sum'_1:
  fixes x :: "'a :: {real_div_algebra, field_char_0}"
  assumes "m > 0" "x \<noteq> 0"
  shows   "stirling_sum' 1 m x = 1 / x + 1 / (2 * x^2) + stirling_sum 2 m x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
have pochhammer_2: "pochhammer (of_nat k) 2 = of_nat k * of_nat (Suc k)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (of_nat k) 2 = of_nat k * of_nat (Suc k)
[PROOF STEP]
by (simp add: pochhammer_Suc eval_nat_numeral add_ac)
[PROOF STATE]
proof (state)
this:
pochhammer (of_nat ?k1) 2 = of_nat ?k1 * of_nat (Suc ?k1)

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
have "stirling_sum 2 m x =
          (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stirling_sum 2 m x = (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))
[PROOF STEP]
unfolding stirling_sum_def pochhammer_2 power2_minus power_one mult_1_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..<m. of_real (bernoulli (Suc k)) * (of_nat k * of_nat (Suc k)) / (of_nat k * of_nat (Suc k)) * inverse x ^ (k + 2)) = (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))
[PROOF STEP]
by (intro sum.cong refl)
       (simp_all add: stirling_sum_def pochhammer_2 power2_eq_square divide_simps bernoulli'_def
                 del: of_nat_Suc power_Suc)
[PROOF STATE]
proof (state)
this:
stirling_sum 2 m x = (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
stirling_sum 2 m x = (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
have "1 / (2 * x^2) + \<dots> =
               (\<Sum>k=0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) / ((2::'a) * x\<^sup>2) + (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k)) = (\<Sum>k = 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
x \<noteq> (0::'a)

goal (1 subgoal):
 1. (1::'a) / ((2::'a) * x\<^sup>2) + (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k)) = (\<Sum>k = 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))
[PROOF STEP]
by (subst (2) sum.atLeast_Suc_lessThan) (simp_all add: power2_eq_square field_simps)
[PROOF STATE]
proof (state)
this:
(1::'a) / ((2::'a) * x\<^sup>2) + (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k)) = (\<Sum>k = 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) / ((2::'a) * x\<^sup>2) + (\<Sum>k = Suc 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k)) = (\<Sum>k = 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k))

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
have "1 / x + \<dots> = (\<Sum>k=0..<Suc m. of_real (bernoulli' k) * inverse x ^ Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) / x + (\<Sum>k = 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k)) = (\<Sum>k = 0..<Suc m. of_real (bernoulli' k) * inverse x ^ Suc k)
[PROOF STEP]
by (subst sum.atLeast0_lessThan_Suc_shift) (simp_all add: bernoulli'_def divide_simps)
[PROOF STATE]
proof (state)
this:
(1::'a) / x + (\<Sum>k = 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k)) = (\<Sum>k = 0..<Suc m. of_real (bernoulli' k) * inverse x ^ Suc k)

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) / x + (\<Sum>k = 0..<m. of_real (bernoulli' (Suc k)) * inverse x ^ Suc (Suc k)) = (\<Sum>k = 0..<Suc m. of_real (bernoulli' k) * inverse x ^ Suc k)

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>m. of_real (bernoulli' k) * inverse x ^ Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..<Suc m. of_real (bernoulli' k) * inverse x ^ Suc k) = (\<Sum>k\<le>m. of_real (bernoulli' k) * inverse x ^ Suc k)
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..<Suc m. of_real (bernoulli' k) * inverse x ^ Suc k) = (\<Sum>k\<le>m. of_real (bernoulli' k) * inverse x ^ Suc k)

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..<Suc m. of_real (bernoulli' k) * inverse x ^ Suc k) = (\<Sum>k\<le>m. of_real (bernoulli' k) * inverse x ^ Suc k)

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
have "\<dots> = stirling_sum' 1 m x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. of_real (bernoulli' k) * inverse x ^ Suc k) = stirling_sum' 1 m x
[PROOF STEP]
by (simp add: stirling_sum'_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. of_real (bernoulli' k) * inverse x ^ Suc k) = stirling_sum' 1 m x

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1::'a) / x + ((1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x) = stirling_sum' 1 m x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1::'a) / x + ((1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x) = stirling_sum' 1 m x

goal (1 subgoal):
 1. stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
stirling_sum' 1 m x = (1::'a) / x + (1::'a) / ((2::'a) * x\<^sup>2) + stirling_sum 2 m x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iffb_inv2_aux: "Inf_pres \<phi> \<Longrightarrow> \<Sqinter>{X. x \<in> \<phi> X} \<subseteq> Y \<Longrightarrow> x \<in> \<phi> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; \<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y\<rbrakk> \<Longrightarrow> s2p (\<phi> Y) x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; \<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y\<rbrakk> \<Longrightarrow> s2p (\<phi> Y) x
[PROOF STEP]
assume "Inf_pres \<phi>"
    and h1: "\<Sqinter>{X. x \<in> \<phi> X} \<subseteq> Y"
[PROOF STATE]
proof (state)
this:
Inf_pres \<phi>
\<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y

goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; \<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y\<rbrakk> \<Longrightarrow> s2p (\<phi> Y) x
[PROOF STEP]
hence h2: "\<forall>X. \<phi> (\<Sqinter>X) = (\<Inter>x \<in> X. \<phi> x)"
[PROOF STATE]
proof (prove)
using this:
Inf_pres \<phi>
\<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y

goal (1 subgoal):
 1. \<forall>X. \<phi> (\<Inter> X) = \<Inter> (\<P> \<phi> X)
[PROOF STEP]
by (metis comp_eq_dest)
[PROOF STATE]
proof (state)
this:
\<forall>X. \<phi> (\<Inter> X) = \<Inter> (\<P> \<phi> X)

goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; \<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y\<rbrakk> \<Longrightarrow> s2p (\<phi> Y) x
[PROOF STEP]
hence "\<phi> (\<Sqinter>{X. x \<in> \<phi> X}) \<subseteq> \<phi> Y"
[PROOF STATE]
proof (prove)
using this:
\<forall>X. \<phi> (\<Inter> X) = \<Inter> (\<P> \<phi> X)

goal (1 subgoal):
 1. \<phi> (\<Inter> {X. s2p (\<phi> X) x}) \<subseteq> \<phi> Y
[PROOF STEP]
by (metis h1 INF_lower2 cInf_eq_minimum mem_Collect_eq order_refl)
[PROOF STATE]
proof (state)
this:
\<phi> (\<Inter> {X. s2p (\<phi> X) x}) \<subseteq> \<phi> Y

goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; \<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y\<rbrakk> \<Longrightarrow> s2p (\<phi> Y) x
[PROOF STEP]
hence "(\<Sqinter>{\<phi> X |X. x \<in> \<phi> X}) \<subseteq> \<phi> Y"
[PROOF STATE]
proof (prove)
using this:
\<phi> (\<Inter> {X. s2p (\<phi> X) x}) \<subseteq> \<phi> Y

goal (1 subgoal):
 1. \<Inter> {\<phi> X |X. s2p (\<phi> X) x} \<subseteq> \<phi> Y
[PROOF STEP]
by (metis h2 setcompr_eq_image)
[PROOF STATE]
proof (state)
this:
\<Inter> {\<phi> X |X. s2p (\<phi> X) x} \<subseteq> \<phi> Y

goal (1 subgoal):
 1. \<lbrakk>Inf_pres \<phi>; \<Inter> {X. s2p (\<phi> X) x} \<subseteq> Y\<rbrakk> \<Longrightarrow> s2p (\<phi> Y) x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Inter> {\<phi> X |X. s2p (\<phi> X) x} \<subseteq> \<phi> Y

goal (1 subgoal):
 1. s2p (\<phi> Y) x
[PROOF STEP]
by (force simp add: subset_iff)
[PROOF STATE]
proof (state)
this:
s2p (\<phi> Y) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cinner_zero_left [simp]: "cinner 0 x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner (0::'a) x = 0
[PROOF STEP]
using cinner_add_left [of 0 0 x]
[PROOF STATE]
proof (prove)
using this:
cinner ((0::'a) + (0::'a)) x = cinner (0::'a) x + cinner (0::'a) x

goal (1 subgoal):
 1. cinner (0::'a) x = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma inorder_insert_d: "insert_d x (t,dl) = (t',dl') \<Longrightarrow> sorted(inorder t)
  \<Longrightarrow> inorder t' = ins_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>insert_d x (t, dl) = (t', dl'); Sorted_Less.sorted (inorder t)\<rbrakk> \<Longrightarrow> inorder t' = ins_list x (inorder t)
[PROOF STEP]
by(auto simp add: ins0_neq_Unbal insert_def inorder_ins split: prod.split up.split)


[STATEMENT]
lemma cpx_sorted_diag_diff:
  fixes D::"complex Matrix.mat"
  assumes "D\<in> carrier_mat n n"
  and "\<forall> i < n. D$$(i,i) \<in> Reals"
  and "sorted (map Re (diag_mat D))"
shows "diag_diff D (eq_comps (diag_mat D))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_diff D (eq_comps (diag_mat D))
[PROOF STEP]
proof (rule lst_diff_imp_diag_diff)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. D \<in> carrier_mat ?n ?n
 2. lst_diff (diag_mat D) (eq_comps (diag_mat D))
[PROOF STEP]
show "D \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat n n
\<forall>i<n. D $$ (i, i) \<in> \<real>
sorted (map Re (diag_mat D))

goal (1 subgoal):
 1. D \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
D \<in> carrier_mat n n

goal (1 subgoal):
 1. lst_diff (diag_mat D) (eq_comps (diag_mat D))
[PROOF STEP]
have "\<forall>z\<in>set (diag_mat D). z \<in> \<real>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z\<in>set (diag_mat D). z \<in> \<real>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat n n
\<forall>i<n. D $$ (i, i) \<in> \<real>
sorted (map Re (diag_mat D))

goal (1 subgoal):
 1. \<forall>z\<in>set (diag_mat D). z \<in> \<real>
[PROOF STEP]
unfolding diag_mat_def
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat n n
\<forall>i<n. D $$ (i, i) \<in> \<real>
sorted (map Re (map (\<lambda>i. D $$ (i, i)) [0..<dim_row D]))

goal (1 subgoal):
 1. \<forall>z\<in>set (map (\<lambda>i. D $$ (i, i)) [0..<dim_row D]). z \<in> \<real>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>z\<in>set (diag_mat D). z \<in> \<real>

goal (1 subgoal):
 1. lst_diff (diag_mat D) (eq_comps (diag_mat D))
[PROOF STEP]
thus "lst_diff (diag_mat D) (eq_comps (diag_mat D))"
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>set (diag_mat D). z \<in> \<real>

goal (1 subgoal):
 1. lst_diff (diag_mat D) (eq_comps (diag_mat D))
[PROOF STEP]
using Re_sorted_lst_diff[of "diag_mat D"] assms
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>set (diag_mat D). z \<in> \<real>
\<lbrakk>\<forall>z\<in>set (diag_mat D). z \<in> \<real>; sorted (map Re (diag_mat D)); ?m = eq_comps (diag_mat D)\<rbrakk> \<Longrightarrow> lst_diff (diag_mat D) ?m
D \<in> carrier_mat n n
\<forall>i<n. D $$ (i, i) \<in> \<real>
sorted (map Re (diag_mat D))

goal (1 subgoal):
 1. lst_diff (diag_mat D) (eq_comps (diag_mat D))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lst_diff (diag_mat D) (eq_comps (diag_mat D))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtos_rs_i_rs:"\<lbrakk> 0 < r; 0 < s; i \<le> r * s - Suc 0;
rtos r s i = r * s - Suc 0\<rbrakk> \<Longrightarrow>  i = r * s - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; rtos r s i = r * s - Suc 0\<rbrakk> \<Longrightarrow> i = r * s - Suc 0
[PROOF STEP]
apply (frule mem_of_Nset [of "i" "r * s - Suc 0"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; rtos r s i = r * s - Suc 0; i \<in> {i. i \<le> r * s - Suc 0}\<rbrakk> \<Longrightarrow> i = r * s - Suc 0
[PROOF STEP]
apply (frule rtos_r_s [of "r" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; rtos r s i = r * s - Suc 0; i \<in> {i. i \<le> r * s - Suc 0}; rtos r s (r * s - Suc 0) = r * s - Suc 0\<rbrakk> \<Longrightarrow> i = r * s - Suc 0
[PROOF STEP]
apply (frule rtos_inj[of "r" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; rtos r s i = r * s - Suc 0; i \<in> {i. i \<le> r * s - Suc 0}; rtos r s (r * s - Suc 0) = r * s - Suc 0; inj_on (rtos r s) {i. i \<le> r * s - Suc 0}\<rbrakk> \<Longrightarrow> i = r * s - Suc 0
[PROOF STEP]
apply (cut_tac n_in_Nsetn[of "r * s - Suc 0"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; rtos r s i = r * s - Suc 0; i \<in> {i. i \<le> r * s - Suc 0}; rtos r s (r * s - Suc 0) = r * s - Suc 0; inj_on (rtos r s) {i. i \<le> r * s - Suc 0}; r * s - Suc 0 \<in> {i. i \<le> r * s - Suc 0}\<rbrakk> \<Longrightarrow> i = r * s - Suc 0
[PROOF STEP]
apply (simp add:inj_on_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lemma2_6_6_a: assumes t: "trans r" and "(M,N) \<in> mul_eq r" shows "(Q + M,Q + N) \<in> mul_eq r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Q + M, Q + N) \<in> mul_eq r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Q + M, Q + N) \<in> mul_eq r
[PROOF STEP]
obtain I J K where A:"Q+N=(Q+I)+J" and B:"Q+M=(Q+I)+K" and C:"set_mset K \<subseteq> dm r J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>I J K. \<lbrakk>Q + N = Q + I + J; Q + M = Q + I + K; set_mset K \<subseteq> r \<down>m J\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
(M, N) \<in> mul_eq r

goal (1 subgoal):
 1. (\<And>I J K. \<lbrakk>Q + N = Q + I + J; Q + M = Q + I + K; set_mset K \<subseteq> r \<down>m J\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding mul_eq_def
[PROOF STATE]
proof (prove)
using this:
(M, N) \<in> {(M, N). \<exists>I J K. M = I + K \<and> N = I + J \<and> set_mset K \<subseteq> r \<down>m J}

goal (1 subgoal):
 1. (\<And>I J K. \<lbrakk>Q + N = Q + I + J; Q + M = Q + I + K; set_mset K \<subseteq> r \<down>m J\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Q + N = Q + I + J
Q + M = Q + I + K
set_mset K \<subseteq> r \<down>m J

goal (1 subgoal):
 1. (Q + M, Q + N) \<in> mul_eq r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Q + N = Q + I + J
Q + M = Q + I + K
set_mset K \<subseteq> r \<down>m J

goal (1 subgoal):
 1. (Q + M, Q + N) \<in> mul_eq r
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
Q + N = Q + I + J
Q + M = Q + I + K
set_mset K \<subseteq> r \<down>m J
set_mset K \<subseteq> r \<down>m J

goal (1 subgoal):
 1. (Q + M, Q + N) \<in> mul_eq r
[PROOF STEP]
unfolding mul_eq_def
[PROOF STATE]
proof (prove)
using this:
Q + N = Q + I + J
Q + M = Q + I + K
set_mset K \<subseteq> r \<down>m J
set_mset K \<subseteq> r \<down>m J

goal (1 subgoal):
 1. (Q + M, Q + N) \<in> {(M, N). \<exists>I J K. M = I + K \<and> N = I + J \<and> set_mset K \<subseteq> r \<down>m J}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(Q + M, Q + N) \<in> mul_eq r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_approx_upper_minus: assumes "n \<le> k" and "n + a \<le> Suc k"
  shows "fact (k - n) * real a ^ n \<le> fact k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (k - n) * real a ^ n \<le> fact k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fact (k - n) * real a ^ n \<le> fact k
[PROOF STEP]
define l where "l = k - n"
[PROOF STATE]
proof (state)
this:
l = k - n

goal (1 subgoal):
 1. fact (k - n) * real a ^ n \<le> fact k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
n \<le> k
n + a \<le> Suc k
[PROOF STEP]
have k: "k = l + n"
[PROOF STATE]
proof (prove)
using this:
n \<le> k
n + a \<le> Suc k

goal (1 subgoal):
 1. k = l + n
[PROOF STEP]
unfolding l_def
[PROOF STATE]
proof (prove)
using this:
n \<le> k
n + a \<le> Suc k

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

goal (1 subgoal):
 1. fact (k - n) * real a ^ n \<le> fact k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (k - n) * real a ^ n \<le> fact k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<le> k
n + a \<le> Suc k

goal (1 subgoal):
 1. fact (k - n) * real a ^ n \<le> fact k
[PROOF STEP]
unfolding k
[PROOF STATE]
proof (prove)
using this:
n \<le> l + n
n + a \<le> Suc (l + n)

goal (1 subgoal):
 1. fact (l + n - n) * real a ^ n \<le> fact (l + n)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> Suc l \<Longrightarrow> fact l * real a ^ n \<le> fact (l + n)
[PROOF STEP]
apply (rule fact_approx_upper_add, insert assms, auto simp: l_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fact (k - n) * real a ^ n \<le> fact k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_cong_2134:
  assumes " \<not> Cong A B C D"
  shows "\<not> Cong B A C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Cong B A C D
[PROOF STEP]
using assms cong_left_commutativity
[PROOF STATE]
proof (prove)
using this:
\<not> Cong A B C D
Cong ?A ?B ?C ?D \<Longrightarrow> Cong ?B ?A ?C ?D

goal (1 subgoal):
 1. \<not> Cong B A C D
[PROOF STEP]
by blast


[STATEMENT]
lemma sgnx_poly_nz:
  assumes "poly p x\<noteq>0"
  shows "sgnx (poly p) (at_left x) = sgn (poly p x)"
        "sgnx (poly p) (at_right x) = sgn (poly p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_left x) = sgn (poly p x) &&& sgnx (poly p) (at_right x) = sgn (poly p x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sgnx (poly p) (at_left x) = sgn (poly p x)
 2. sgnx (poly p) (at_right x) = sgn (poly p x)
[PROOF STEP]
have "(poly p has_sgnx sgn(poly p x)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p has_sgnx sgn (poly p x)) (at x)
[PROOF STEP]
apply (rule tendsto_nonzero_has_sgnx)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. poly p \<midarrow>x\<rightarrow> poly p x
 2. poly p x \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
poly p x \<noteq> 0

goal (2 subgoals):
 1. poly p \<midarrow>x\<rightarrow> poly p x
 2. poly p x \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(poly p has_sgnx sgn (poly p x)) (at x)

goal (2 subgoals):
 1. sgnx (poly p) (at_left x) = sgn (poly p x)
 2. sgnx (poly p) (at_right x) = sgn (poly p x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(poly p has_sgnx sgn (poly p x)) (at x)
[PROOF STEP]
show "sgnx (poly p) (at_left x) = sgn (poly p x)"
        "sgnx (poly p) (at_right x) = sgn (poly p x)"
[PROOF STATE]
proof (prove)
using this:
(poly p has_sgnx sgn (poly p x)) (at x)

goal (1 subgoal):
 1. sgnx (poly p) (at_left x) = sgn (poly p x) &&& sgnx (poly p) (at_right x) = sgn (poly p x)
[PROOF STEP]
unfolding has_sgnx_split
[PROOF STATE]
proof (prove)
using this:
(poly p has_sgnx sgn (poly p x)) (at_left x) \<and> (poly p has_sgnx sgn (poly p x)) (at_right x)

goal (1 subgoal):
 1. sgnx (poly p) (at_left x) = sgn (poly p x) &&& sgnx (poly p) (at_right x) = sgn (poly p x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_left x) = sgn (poly p x)
sgnx (poly p) (at_right x) = sgn (poly p x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma induced_map_iterates_stabilize_A:
  assumes "x \<in> A"
  shows "((induced_map A)^^n) x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (induced_map A ^^ n) x \<in> A
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (induced_map A ^^ 0) x \<in> A
 2. \<And>n. (induced_map A ^^ n) x \<in> A \<Longrightarrow> (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (induced_map A ^^ 0) x \<in> A
 2. \<And>n. (induced_map A ^^ n) x \<in> A \<Longrightarrow> (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (induced_map A ^^ 0) x \<in> A
[PROOF STEP]
using \<open>x \<in> A\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> A

goal (1 subgoal):
 1. (induced_map A ^^ 0) x \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ 0) x \<in> A

goal (1 subgoal):
 1. \<And>n. (induced_map A ^^ n) x \<in> A \<Longrightarrow> (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (induced_map A ^^ n) x \<in> A \<Longrightarrow> (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ n) x \<in> A

goal (1 subgoal):
 1. \<And>n. (induced_map A ^^ n) x \<in> A \<Longrightarrow> (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
have "((induced_map A)^^(Suc n)) x = (induced_map A) (((induced_map A)^^n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (induced_map A ^^ Suc n) x = induced_map A ((induced_map A ^^ n) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ Suc n) x = induced_map A ((induced_map A ^^ n) x)

goal (1 subgoal):
 1. \<And>n. (induced_map A ^^ n) x \<in> A \<Longrightarrow> (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(induced_map A ^^ Suc n) x = induced_map A ((induced_map A ^^ n) x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(induced_map A ^^ Suc n) x = induced_map A ((induced_map A ^^ n) x)

goal (1 subgoal):
 1. (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
using Suc.IH induced_map_stabilizes_A
[PROOF STATE]
proof (prove)
using this:
(induced_map A ^^ Suc n) x = induced_map A ((induced_map A ^^ n) x)
(induced_map A ^^ n) x \<in> A
(?x \<in> ?A) = (induced_map ?A ?x \<in> ?A)

goal (1 subgoal):
 1. (induced_map A ^^ Suc n) x \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(induced_map A ^^ Suc n) x \<in> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smaps_over_singleton:
  assumes "k \<in> A" and "vs \<subseteq> B"
shows "{k := vs}. \<in> smaps_over A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. { k := vs}. \<in> smaps_over A B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<in> A
vs \<subseteq> B

goal (1 subgoal):
 1. { k := vs}. \<in> smaps_over A B
[PROOF STEP]
unfolding smaps_over_def
[PROOF STATE]
proof (prove)
using this:
k \<in> A
vs \<subseteq> B

goal (1 subgoal):
 1. { k := vs}. \<in> {m. sdom m \<subseteq> A \<and> sran m \<subseteq> B}
[PROOF STEP]
by(auto dest: subsetD[OF sdom_singleton])


[STATEMENT]
lemma map_of_append[simp]: "map_of (xs @ ys) = map_of ys ++ map_of xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (xs @ ys) = map_of ys ++ map_of xs
[PROOF STEP]
unfolding map_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some x \<Rightarrow> Some x)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
 2. \<And>a xs. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a) \<Longrightarrow> map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (2 subgoals):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
 2. \<And>a xs. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a) \<Longrightarrow> map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (1 subgoal):
 1. map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
by (force split: option.split)
[PROOF STATE]
proof (state)
this:
map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (1 subgoal):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
qed auto


[STATEMENT]
lemma diff_mult_distrib2: "x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - (b \<cdot> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
assume x: "x \<in> V"
[PROOF STATE]
proof (state)
this:
x \<in> V

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
have " (a - b) \<cdot> x = (a + - b) \<cdot> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - b) \<cdot> x = (a + - b) \<cdot> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a - b) \<cdot> x = (a + - b) \<cdot> x

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a - b) \<cdot> x = (a + - b) \<cdot> x

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
have "\<dots> = a \<cdot> x + (- b) \<cdot> x"
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. (a + - b) \<cdot> x = a \<cdot> x + - b \<cdot> x
[PROOF STEP]
by (rule add_mult_distrib2)
[PROOF STATE]
proof (state)
this:
(a + - b) \<cdot> x = a \<cdot> x + - b \<cdot> x

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a + - b) \<cdot> x = a \<cdot> x + - b \<cdot> x

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
have "\<dots> = a \<cdot> x + - (b \<cdot> x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. a \<cdot> x + - b \<cdot> x = a \<cdot> x + - (b \<cdot> x)
[PROOF STEP]
by (simp add: negate_eq1 mult_assoc2)
[PROOF STATE]
proof (state)
this:
a \<cdot> x + - b \<cdot> x = a \<cdot> x + - (b \<cdot> x)

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a \<cdot> x + - b \<cdot> x = a \<cdot> x + - (b \<cdot> x)

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
have "\<dots> = a \<cdot> x - (b \<cdot> x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. a \<cdot> x + - (b \<cdot> x) = a \<cdot> x - b \<cdot> x
[PROOF STEP]
by (simp add: diff_eq1)
[PROOF STATE]
proof (state)
this:
a \<cdot> x + - (b \<cdot> x) = a \<cdot> x - b \<cdot> x

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a - b) \<cdot> x = a \<cdot> x - b \<cdot> x

goal (1 subgoal):
 1. (a - b) \<cdot> x = a \<cdot> x - b \<cdot> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(a - b) \<cdot> x = a \<cdot> x - b \<cdot> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hcomplex_add_minus_eq_minus: "x + y = 0 \<Longrightarrow> x = - y"
  for x y :: hcomplex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y = 0 \<Longrightarrow> x = - y
[PROOF STEP]
apply (drule minus_unique)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x = y \<Longrightarrow> x = - y
[PROOF STEP]
apply (simp add: minus_equation_iff [of x y])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eventually_at_left:
  fixes x::"'a::{archimedean_field,linorder_topology}"
  shows "eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
obtain y where "y<x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y < x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using linordered_field_no_lb
[PROOF STATE]
proof (prove)
using this:
\<forall>x. \<exists>y. y < x

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

goal (1 subgoal):
 1. eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y < x

goal (1 subgoal):
 1. eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
using eventually_at_left[OF \<open>y<x\<close>]
[PROOF STATE]
proof (prove)
using this:
y < x
eventually ?P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> ?P y)

goal (1 subgoal):
 1. eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_subfrmls__UnionD:
  assumes "(\<Union>x\<in>A. subfrmlsr x) \<subseteq> B"
    and "x\<in>A"
    and "y\<in>subfrmlsr x"
  shows "y\<in>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<in> B
[PROOF STEP]
note subfrmlsr_id[of x]
[PROOF STATE]
proof (state)
this:
x \<in> subfrmlsr x

goal (1 subgoal):
 1. y \<in> B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<in> subfrmlsr x

goal (1 subgoal):
 1. y \<in> B
[PROOF STEP]
have "subfrmlsr x \<subseteq> (\<Union>x\<in>A. subfrmlsr x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subfrmlsr x \<subseteq> \<Union> (subfrmlsr ` A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Union> (subfrmlsr ` A) \<subseteq> B
x \<in> A
y \<in> subfrmlsr x

goal (1 subgoal):
 1. subfrmlsr x \<subseteq> \<Union> (subfrmlsr ` A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subfrmlsr x \<subseteq> \<Union> (subfrmlsr ` A)

goal (1 subgoal):
 1. y \<in> B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<Union> (subfrmlsr ` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> (subfrmlsr ` A)

goal (1 subgoal):
 1. y \<in> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> (subfrmlsr ` A)
\<Union> (subfrmlsr ` A) \<subseteq> B
x \<in> A
y \<in> subfrmlsr x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma INFM_nat_inductI:
  assumes P0: "P (0::nat)"
  assumes PS: "\<And>i. P i \<Longrightarrow> \<exists>j>i. P j \<and> Q j"
  shows "\<exists>\<^sub>\<infinity>i. Q i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<^sub>\<infinity>i. Q i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<^sub>\<infinity>i. Q i
[PROOF STEP]
have "\<forall>i. \<exists>j>i. P j \<and> Q j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. \<exists>j>i. P j \<and> Q j
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<exists>j>i. P j \<and> Q j
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<exists>j>i. P j \<and> Q j
[PROOF STEP]
show "\<exists>j>i. P j \<and> Q j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j>i. P j \<and> Q j
[PROOF STEP]
apply (induction i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>j>0. P j \<and> Q j
 2. \<And>i. \<exists>j>i. P j \<and> Q j \<Longrightarrow> \<exists>j>Suc i. P j \<and> Q j
[PROOF STEP]
using PS[OF P0]
[PROOF STATE]
proof (prove)
using this:
\<exists>j>0. P j \<and> Q j

goal (2 subgoals):
 1. \<exists>j>0. P j \<and> Q j
 2. \<And>i. \<exists>j>i. P j \<and> Q j \<Longrightarrow> \<exists>j>Suc i. P j \<and> Q j
[PROOF STEP]
apply auto []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<exists>j>i. P j \<and> Q j \<Longrightarrow> \<exists>j>Suc i. P j \<and> Q j
[PROOF STEP]
by (metis PS Suc_lessI)
[PROOF STATE]
proof (state)
this:
\<exists>j>i. P j \<and> Q j

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i. \<exists>j>i. P j \<and> Q j

goal (1 subgoal):
 1. \<exists>\<^sub>\<infinity>i. Q i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i. \<exists>j>i. P j \<and> Q j

goal (1 subgoal):
 1. \<exists>\<^sub>\<infinity>i. Q i
[PROOF STEP]
unfolding INFM_nat
[PROOF STATE]
proof (prove)
using this:
\<forall>i. \<exists>j>i. P j \<and> Q j

goal (1 subgoal):
 1. \<forall>m. \<exists>n>m. Q n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>\<infinity>i. Q i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_principal_singleton[simp]:
  shows "(f \<longlongrightarrow> f x) (principal {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> f x) (principal {x})
[PROOF STEP]
unfolding tendsto_def eventually_principal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S. open S \<longrightarrow> f x \<in> S \<longrightarrow> (\<forall>x\<in>{x}. f x \<in> S)
[PROOF STEP]
by simp


[STATEMENT]
lemma G_eq_real_suminf:
  "convergence_G x y (1::real) \<Longrightarrow> G x y = ennreal (\<Sum>i. p x y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergence_G x y 1 \<Longrightarrow> G x y = ennreal (\<Sum>i. p x y i)
[PROOF STEP]
unfolding G_eq_suminf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergence_G x y 1 \<Longrightarrow> (\<Sum>i. ennreal (p x y i)) = ennreal (\<Sum>i. p x y i)
[PROOF STEP]
by (intro suminf_ennreal ennreal_suminf_neq_top p_nonneg)
     (auto simp: convergence_G_def p_def)


[STATEMENT]
lemma Cons_tl_drop_update: "i < length xs \<Longrightarrow> x # tl (drop i xs) = drop i (xs[i := x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length xs \<Longrightarrow> x # tl (drop i xs) = drop i (xs[i := x])
[PROOF STEP]
proof (induct i arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. 0 < length xs \<Longrightarrow> x # tl (drop 0 xs) = drop 0 (xs[0 := x])
 2. \<And>i xs. \<lbrakk>\<And>xs. i < length xs \<Longrightarrow> x # tl (drop i xs) = drop i (xs[i := x]); Suc i < length xs\<rbrakk> \<Longrightarrow> x # tl (drop (Suc i) xs) = drop (Suc i) (xs[Suc i := x])
[PROOF STEP]
case (0 xs)
[PROOF STATE]
proof (state)
this:
0 < length xs

goal (2 subgoals):
 1. \<And>xs. 0 < length xs \<Longrightarrow> x # tl (drop 0 xs) = drop 0 (xs[0 := x])
 2. \<And>i xs. \<lbrakk>\<And>xs. i < length xs \<Longrightarrow> x # tl (drop i xs) = drop i (xs[i := x]); Suc i < length xs\<rbrakk> \<Longrightarrow> x # tl (drop (Suc i) xs) = drop (Suc i) (xs[Suc i := x])
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 < length xs

goal (1 subgoal):
 1. x # tl (drop 0 xs) = drop 0 (xs[0 := x])
[PROOF STEP]
by (cases xs, auto)
[PROOF STATE]
proof (state)
this:
x # tl (drop 0 xs) = drop 0 (xs[0 := x])

goal (1 subgoal):
 1. \<And>i xs. \<lbrakk>\<And>xs. i < length xs \<Longrightarrow> x # tl (drop i xs) = drop i (xs[i := x]); Suc i < length xs\<rbrakk> \<Longrightarrow> x # tl (drop (Suc i) xs) = drop (Suc i) (xs[Suc i := x])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i xs. \<lbrakk>\<And>xs. i < length xs \<Longrightarrow> x # tl (drop i xs) = drop i (xs[i := x]); Suc i < length xs\<rbrakk> \<Longrightarrow> x # tl (drop (Suc i) xs) = drop (Suc i) (xs[Suc i := x])
[PROOF STEP]
case (Suc i xs)
[PROOF STATE]
proof (state)
this:
i < length ?xs \<Longrightarrow> x # tl (drop i ?xs) = drop i (?xs[i := x])
Suc i < length xs

goal (1 subgoal):
 1. \<And>i xs. \<lbrakk>\<And>xs. i < length xs \<Longrightarrow> x # tl (drop i xs) = drop i (xs[i := x]); Suc i < length xs\<rbrakk> \<Longrightarrow> x # tl (drop (Suc i) xs) = drop (Suc i) (xs[Suc i := x])
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
i < length ?xs \<Longrightarrow> x # tl (drop i ?xs) = drop i (?xs[i := x])
Suc i < length xs

goal (1 subgoal):
 1. x # tl (drop (Suc i) xs) = drop (Suc i) (xs[Suc i := x])
[PROOF STEP]
by (cases xs, auto)
[PROOF STATE]
proof (state)
this:
x # tl (drop (Suc i) xs) = drop (Suc i) (xs[Suc i := x])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d1_sum_var: "x + y \<le> (d x + d y) \<cdot> (x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
have "x + y = d x \<cdot> x + d y \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y = d x \<cdot> x + d y \<cdot> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x + y = d x \<cdot> x + d y \<cdot> y

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + y = d x \<cdot> x + d y \<cdot> y

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
have "... \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x \<cdot> x + d y \<cdot> y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y
[PROOF STEP]
using local.distrib_right' local.join.sup_ge1 local.join.sup_ge2 local.join.sup_mono
[PROOF STATE]
proof (prove)
using this:
(?x + ?y) \<cdot> ?z = ?x \<cdot> ?z + ?y \<cdot> ?z
?x \<le> ?x + ?y
?y \<le> ?x + ?y
\<lbrakk>?a \<le> ?c; ?b \<le> ?d\<rbrakk> \<Longrightarrow> ?a + ?b \<le> ?c + ?d

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

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x + y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x + y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y

goal (1 subgoal):
 1. x + y \<le> (d x + d y) \<cdot> (x + y)
[PROOF STEP]
using order_trans subdistl_var
[PROOF STATE]
proof (prove)
using this:
x + y \<le> (d x + d y) \<cdot> x + (d x + d y) \<cdot> y
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z
?z \<cdot> ?x + ?z \<cdot> ?y \<le> ?z \<cdot> (?x + ?y)

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

goal:
No subgoals!
[PROOF STEP]
qed