[STATEMENT]
lemma eventually_sgn_le_neg1D:
  assumes "eventually (\<lambda>x::real. sgn (f x) \<le> u x) at_top"
          "(u expands_to (const_expansion (-1) :: 'a :: multiseries)) bs"
  shows   "((\<lambda>x. sgn (f x)) expands_to (const_expansion (-1) :: 'a)) bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sgn (f x)) expands_to const_expansion (- 1)) bs
[PROOF STEP]
proof (rule expands_to_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (?f expands_to const_expansion (- 1)) bs
 2. \<forall>\<^sub>F x in at_top. ?f x = sgn (f x)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
(u expands_to const_expansion (- 1)) bs
[PROOF STEP]
have "eventually (\<lambda>x. u x = -1) at_top"
[PROOF STATE]
proof (prove)
using this:
(u expands_to const_expansion (- 1)) bs

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. u x = - 1
[PROOF STEP]
by (simp add: expands_to.simps eq_commute)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. u x = - 1

goal (2 subgoals):
 1. (?f expands_to const_expansion (- 1)) bs
 2. \<forall>\<^sub>F x in at_top. ?f x = sgn (f x)
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. sgn (f x) \<le> u x
\<forall>\<^sub>F x in at_top. u x = - 1
[PROOF STEP]
show "eventually (\<lambda>x. -1 = sgn (f x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. sgn (f x) \<le> u x
\<forall>\<^sub>F x in at_top. u x = - 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. - 1 = sgn (f x)
[PROOF STEP]
by eventually_elim (auto simp: sgn_if split: if_splits)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. - 1 = sgn (f x)

goal (1 subgoal):
 1. ((\<lambda>x. - 1) expands_to const_expansion (- 1)) bs
[PROOF STEP]
qed (insert assms, auto simp: expands_to.simps)


[STATEMENT]
lemma nat_relprime_power_divisors:
  assumes n0: "0 < n" and abc: "(a::nat)*b = c^n" and relprime: "coprime a b"
  shows "\<exists> k. a = k^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n
a * b = c ^ n
coprime a b

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
proof (induct c arbitrary: a b rule: nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na a b. \<lbrakk>\<forall>m<na. 0 < n \<longrightarrow> (\<forall>x xa. x * xa = m ^ n \<longrightarrow> coprime x xa \<longrightarrow> (\<exists>k. x = k ^ n)); 0 < n; a * b = na ^ n; coprime a b\<rbrakk> \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
case (1 c)
[PROOF STATE]
proof (state)
this:
\<forall>m<c. 0 < n \<longrightarrow> (\<forall>x xa. x * xa = m ^ n \<longrightarrow> coprime x xa \<longrightarrow> (\<exists>k. x = k ^ n))
0 < n
a * b = c ^ n
coprime a b

goal (1 subgoal):
 1. \<And>na a b. \<lbrakk>\<forall>m<na. 0 < n \<longrightarrow> (\<forall>x xa. x * xa = m ^ n \<longrightarrow> coprime x xa \<longrightarrow> (\<exists>k. x = k ^ n)); 0 < n; a * b = na ^ n; coprime a b\<rbrakk> \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
proof (cases "a > 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
 2. \<not> 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 1 < a

goal (2 subgoals):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
 2. \<not> 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence "a = 0 \<or> a = 1"
[PROOF STATE]
proof (prove)
using this:
\<not> 1 < a

goal (1 subgoal):
 1. a = 0 \<or> a = 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
a = 0 \<or> a = 1

goal (2 subgoals):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
 2. \<not> 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0 \<or> a = 1

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
using n0 power_one zero_power
[PROOF STATE]
proof (prove)
using this:
a = 0 \<or> a = 1
0 < n
(1::?'a) ^ ?n = (1::?'a)
0 < ?n \<Longrightarrow> (0::?'a) ^ ?n = (0::?'a)

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
by (simp only: eq_sym_conv) blast
[PROOF STATE]
proof (state)
this:
\<exists>k. a = k ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
1 < a

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < a
[PROOF STEP]
obtain p where p: "prime p" "p dvd a"
[PROOF STATE]
proof (prove)
using this:
1 < a

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; p dvd a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using prime_factor_nat[of a]
[PROOF STATE]
proof (prove)
using this:
1 < a
a \<noteq> 1 \<Longrightarrow> \<exists>p. prime p \<and> p dvd a

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; p dvd a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prime p
p dvd a

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence h1: "p dvd (c^n)"
[PROOF STATE]
proof (prove)
using this:
prime p
p dvd a

goal (1 subgoal):
 1. p dvd c ^ n
[PROOF STEP]
using 1(3) dvd_mult2[of p a b]
[PROOF STATE]
proof (prove)
using this:
prime p
p dvd a
a * b = c ^ n
p dvd a \<Longrightarrow> p dvd a * b

goal (1 subgoal):
 1. p dvd c ^ n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
p dvd c ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence "(p^n) dvd (c^n)"
[PROOF STATE]
proof (prove)
using this:
p dvd c ^ n

goal (1 subgoal):
 1. p ^ n dvd c ^ n
[PROOF STEP]
using p(1) prime_dvd_power_nat[of p c n] dvd_power_same[of p c n]
[PROOF STATE]
proof (prove)
using this:
p dvd c ^ n
prime p
\<lbrakk>prime p; p dvd c ^ n\<rbrakk> \<Longrightarrow> p dvd c
p dvd c \<Longrightarrow> p ^ n dvd c ^ n

goal (1 subgoal):
 1. p ^ n dvd c ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p ^ n dvd c ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p ^ n dvd c ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
have h2: "\<not> p dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> p dvd b
[PROOF STEP]
using p \<open>coprime a b\<close> coprime_common_divisor_nat [of a b p]
[PROOF STATE]
proof (prove)
using this:
prime p
p dvd a
coprime a b
\<lbrakk>coprime a b; p dvd a; p dvd b\<rbrakk> \<Longrightarrow> p = 1

goal (1 subgoal):
 1. \<not> p dvd b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> p dvd b

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence "\<not> (p^n) dvd b"
[PROOF STATE]
proof (prove)
using this:
\<not> p dvd b

goal (1 subgoal):
 1. \<not> p ^ n dvd b
[PROOF STEP]
using n0 p(1)  dvd_power[of n p] gcd_nat.trans
[PROOF STATE]
proof (prove)
using this:
\<not> p dvd b
0 < n
prime p
0 < n \<or> p = 1 \<Longrightarrow> p dvd p ^ n
\<lbrakk>?a dvd ?b; ?b dvd ?c\<rbrakk> \<Longrightarrow> ?a dvd ?c

goal (1 subgoal):
 1. \<not> p ^ n dvd b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> p ^ n dvd b

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p ^ n dvd c ^ n
\<not> p ^ n dvd b
[PROOF STEP]
have "(p^n) dvd a"
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd c ^ n
\<not> p ^ n dvd b

goal (1 subgoal):
 1. p ^ n dvd a
[PROOF STEP]
using "1.prems" p(1) prime_elem_divprod_pow [of p a b n]
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd c ^ n
\<not> p ^ n dvd b
0 < n
a * b = c ^ n
coprime a b
prime p
\<lbrakk>prime_elem p; coprime a b; p ^ n dvd a * b\<rbrakk> \<Longrightarrow> p ^ n dvd a \<or> p ^ n dvd b

goal (1 subgoal):
 1. p ^ n dvd a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p ^ n dvd a

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p ^ n dvd a
[PROOF STEP]
obtain a' c' where ac: "a = p^n * a'" "c = p * c'"
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd a

goal (1 subgoal):
 1. (\<And>a' c'. \<lbrakk>a = p ^ n * a'; c = p * c'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using h1 dvdE[of "p^n" a] dvdE[of p c] prime_dvd_power_nat[of p c n] p(1)
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd a
p dvd c ^ n
\<lbrakk>p ^ n dvd a; \<And>k. a = p ^ n * k \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
\<lbrakk>p dvd c; \<And>k. c = p * k \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
\<lbrakk>prime p; p dvd c ^ n\<rbrakk> \<Longrightarrow> p dvd c
prime p

goal (1 subgoal):
 1. (\<And>a' c'. \<lbrakk>a = p ^ n * a'; c = p * c'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
a = p ^ n * a'
c = p * c'

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence "p^n * (a' * b) = p^n * c'^n"
[PROOF STATE]
proof (prove)
using this:
a = p ^ n * a'
c = p * c'

goal (1 subgoal):
 1. p ^ n * (a' * b) = p ^ n * c' ^ n
[PROOF STEP]
using 1(3)
[PROOF STATE]
proof (prove)
using this:
a = p ^ n * a'
c = p * c'
a * b = c ^ n

goal (1 subgoal):
 1. p ^ n * (a' * b) = p ^ n * c' ^ n
[PROOF STEP]
by (simp add: power_mult_distrib semiring_normalization_rules(18))
[PROOF STATE]
proof (state)
this:
p ^ n * (a' * b) = p ^ n * c' ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence "a' * b = c'^n"
[PROOF STATE]
proof (prove)
using this:
p ^ n * (a' * b) = p ^ n * c' ^ n

goal (1 subgoal):
 1. a' * b = c' ^ n
[PROOF STEP]
using p(1)
[PROOF STATE]
proof (prove)
using this:
p ^ n * (a' * b) = p ^ n * c' ^ n
prime p

goal (1 subgoal):
 1. a' * b = c' ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a' * b = c' ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a' * b = c' ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
have "coprime a' b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a' b
[PROOF STEP]
using 1(4) ac(1)
[PROOF STATE]
proof (prove)
using this:
coprime a b
a = p ^ n * a'

goal (1 subgoal):
 1. coprime a' b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime a' b

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coprime a' b

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
have "0 < b" "0 < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b &&& 0 < a
[PROOF STEP]
using h2 dvd_0_right gr0I True
[PROOF STATE]
proof (prove)
using this:
\<not> p dvd b
?a dvd (0::?'a)
(?n = 0 \<Longrightarrow> False) \<Longrightarrow> 0 < ?n
1 < a

goal (1 subgoal):
 1. 0 < b &&& 0 < a
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
0 < b
0 < a

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < b
0 < a
[PROOF STEP]
have "0 < c" "1 < p"
[PROOF STATE]
proof (prove)
using this:
0 < b
0 < a

goal (1 subgoal):
 1. 0 < c &&& 1 < p
[PROOF STEP]
using p(1) 1(3) nat_0_less_mult_iff [of a b] n0 prime_gt_Suc_0_nat
[PROOF STATE]
proof (prove)
using this:
0 < b
0 < a
prime p
a * b = c ^ n
(0 < a * b) = (0 < a \<and> 0 < b)
0 < n
prime ?p \<Longrightarrow> Suc 0 < ?p

goal (1 subgoal):
 1. 0 < c &&& 1 < p
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 < c
1 < p

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence "c' < c"
[PROOF STATE]
proof (prove)
using this:
0 < c
1 < p

goal (1 subgoal):
 1. c' < c
[PROOF STEP]
using ac(2)
[PROOF STATE]
proof (prove)
using this:
0 < c
1 < p
c = p * c'

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

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a' * b = c' ^ n
coprime a' b
c' < c
[PROOF STEP]
obtain k where "a' = k^n"
[PROOF STATE]
proof (prove)
using this:
a' * b = c' ^ n
coprime a' b
c' < c

goal (1 subgoal):
 1. (\<And>k. a' = k ^ n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using 1(1) n0
[PROOF STATE]
proof (prove)
using this:
a' * b = c' ^ n
coprime a' b
c' < c
\<forall>m<c. 0 < n \<longrightarrow> (\<forall>x xa. x * xa = m ^ n \<longrightarrow> coprime x xa \<longrightarrow> (\<exists>k. x = k ^ n))
0 < n

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

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
hence "a = (p*k)^n"
[PROOF STATE]
proof (prove)
using this:
a' = k ^ n

goal (1 subgoal):
 1. a = (p * k) ^ n
[PROOF STEP]
using ac(1)
[PROOF STATE]
proof (prove)
using this:
a' = k ^ n
a = p ^ n * a'

goal (1 subgoal):
 1. a = (p * k) ^ n
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
a = (p * k) ^ n

goal (1 subgoal):
 1. 1 < a \<Longrightarrow> \<exists>k. a = k ^ n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = (p * k) ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. a = k ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>k. a = k ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_conj_product: "(a \<sqinter> b) \<iinter> (c \<sqinter> d) = (a \<iinter> c) \<sqinter> (a \<iinter> d) \<sqinter> (b \<iinter> c) \<sqinter> (b \<iinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<sqinter> b) \<iinter> (c \<sqinter> d) = a \<iinter> c \<sqinter> a \<iinter> d \<sqinter> b \<iinter> c \<sqinter> b \<iinter> d
variables:
a, b, c, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis inf_conj_distrib conj_commute inf_assoc)


[STATEMENT]
lemma I_ZmX_spectrum:
  shows "{Re x |x. x \<in> spectrum I_ZmX} \<subseteq> {- 1, 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum I_ZmX} \<subseteq> {- 1, 1}
[PROOF STEP]
using unitary_hermitian_Re_spectrum I_ZmX_hermitian
    I_ZmX_unitary I_ZmX_carrier
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary ?U; hermitian ?U; ?U \<in> carrier_mat ?n ?n; 0 < ?n\<rbrakk> \<Longrightarrow> {Re x |x. x \<in> spectrum ?U} \<subseteq> {- 1, 1}
hermitian I_ZmX
Complex_Matrix.unitary I_ZmX
I_ZmX \<in> carrier_mat 4 4

goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum I_ZmX} \<subseteq> {- 1, 1}
[PROOF STEP]
by simp


[STATEMENT]
lemma integrable_on_superset:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  assumes "f integrable_on S"
    and "\<And>x. x \<notin> S \<Longrightarrow> f x = 0"
    and "S \<subseteq> t"
  shows "f integrable_on t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f integrable_on S
?x \<notin> S \<Longrightarrow> f ?x = (0::'a)
S \<subseteq> t

goal (1 subgoal):
 1. f integrable_on t
[PROOF STEP]
unfolding integrable_on_def
[PROOF STATE]
proof (prove)
using this:
\<exists>y. (f has_integral y) S
?x \<notin> S \<Longrightarrow> f ?x = (0::'a)
S \<subseteq> t

goal (1 subgoal):
 1. \<exists>y. (f has_integral y) t
[PROOF STEP]
by (auto intro:has_integral_on_superset)


[STATEMENT]
lemma ennreal_top_mult: "top * a = (if a = 0 then 0 else top :: ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top * a = (if a = 0 then 0 else top)
[PROOF STEP]
by (simp add: ennreal_mult_eq_top_iff)


[STATEMENT]
lemma "((0::real) \<le> x - y) = (y \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> x - y) = (y \<le> x)
[PROOF STEP]
by arith


[STATEMENT]
lemma insertion_fst_tmf_polys:
  "insertion e (fst (tmf_polys z)) = (\<Sum>i<length z. e 0 ^ i * (mid (z ! i)))"
  for e::"nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion e (map_poly real_of_float (fst (tmf_polys z))) = (\<Sum>i<length z. e 0 ^ i * real_of_float (mid (z ! i)))
[PROOF STEP]
proof (induction z)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. insertion e (map_poly real_of_float (fst (tmf_polys []))) = (\<Sum>i<length []. e 0 ^ i * real_of_float (mid ([] ! i)))
 2. \<And>a z. insertion e (map_poly real_of_float (fst (tmf_polys z))) = (\<Sum>i<length z. e 0 ^ i * real_of_float (mid (z ! i))) \<Longrightarrow> insertion e (map_poly real_of_float (fst (tmf_polys (a # z)))) = (\<Sum>i<length (a # z). e 0 ^ i * real_of_float (mid ((a # z) ! i)))
[PROOF STEP]
case (Cons z zs)
[PROOF STATE]
proof (state)
this:
insertion e (map_poly real_of_float (fst (tmf_polys zs))) = (\<Sum>i<length zs. e 0 ^ i * real_of_float (mid (zs ! i)))

goal (2 subgoals):
 1. insertion e (map_poly real_of_float (fst (tmf_polys []))) = (\<Sum>i<length []. e 0 ^ i * real_of_float (mid ([] ! i)))
 2. \<And>a z. insertion e (map_poly real_of_float (fst (tmf_polys z))) = (\<Sum>i<length z. e 0 ^ i * real_of_float (mid (z ! i))) \<Longrightarrow> insertion e (map_poly real_of_float (fst (tmf_polys (a # z)))) = (\<Sum>i<length (a # z). e 0 ^ i * real_of_float (mid ((a # z) ! i)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion e (map_poly real_of_float (fst (tmf_polys (z # zs)))) = (\<Sum>i<length (z # zs). e 0 ^ i * real_of_float (mid ((z # zs) ! i)))
[PROOF STEP]
unfolding list.size add_Suc_right sum.lessThan_Suc_shift
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion e (map_poly real_of_float (fst (tmf_polys (z # zs)))) = e 0 ^ 0 * real_of_float (mid ((z # zs) ! 0)) + (\<Sum>i<length zs + 0. e 0 ^ Suc i * real_of_float (mid ((z # zs) ! Suc i)))
[PROOF STEP]
by (auto simp: split_beta' Let_def nth_Cons Cons sum_distrib_left ac_simps)
[PROOF STATE]
proof (state)
this:
insertion e (map_poly real_of_float (fst (tmf_polys (z # zs)))) = (\<Sum>i<length (z # zs). e 0 ^ i * real_of_float (mid ((z # zs) ! i)))

goal (1 subgoal):
 1. insertion e (map_poly real_of_float (fst (tmf_polys []))) = (\<Sum>i<length []. e 0 ^ i * real_of_float (mid ([] ! i)))
[PROOF STEP]
qed simp


[STATEMENT]
lemma cong_mult_self_left:
  "[a * b = 0] (mod a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a * b = 0::'a] (mod a)
[PROOF STEP]
by (simp add: cong_def)


[STATEMENT]
lemma higherPowers_lowerPowers: "higherPowers n i (lowerPowers n i x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higherPowers n i (lowerPowers n i x) = x
[PROOF STEP]
by transfer (force simp: dec_above_def inc_above_def antisym_conv2)


[STATEMENT]
lemma (in ring) weak_ring_morphism_range:
  assumes "weak_ring_morphism f I R" and "a \<in> carrier R" shows "f ` (I +> a) = { f a }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (I +> a) = {f a}
[PROOF STEP]
using add.weak_group_morphism_range[OF weak_add_group_morphism[OF assms(1)] assms(2)]
[PROOF STATE]
proof (prove)
using this:
f ` (I #>\<^bsub>add_monoid R\<^esub> a) = {f a}

goal (1 subgoal):
 1. f ` (I +> a) = {f a}
[PROOF STEP]
unfolding a_r_coset_def
[PROOF STATE]
proof (prove)
using this:
f ` (I #>\<^bsub>add_monoid R\<^esub> a) = {f a}

goal (1 subgoal):
 1. f ` (I #>\<^bsub>add_monoid R\<^esub> a) = {f a}
[PROOF STEP]
.


[STATEMENT]
lemma x_div_x: "x > 0 \<Longrightarrow> (x::nat) div x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> x div x = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma lemma_4_13_i: "b l\<rightarrow> a = a \<Longrightarrow> a = 1 \<or> b = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b l\<rightarrow> a = a \<Longrightarrow> a = (1::'a) \<or> b = (1::'a)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b l\<rightarrow> a = a; b \<noteq> (1::'a)\<rbrakk> \<Longrightarrow> a = (1::'a)
[PROOF STEP]
apply (drule_tac a = b and b = a in lemma_4_12_i_iii)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b l\<rightarrow> a = a; \<exists>n. b ^ n \<le> a\<rbrakk> \<Longrightarrow> a = (1::'a)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>b l\<rightarrow> a = a; b ^ n \<le> a\<rbrakk> \<Longrightarrow> a = (1::'a)
[PROOF STEP]
apply (subst (asm) left_lesseq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>b l\<rightarrow> a = a; b ^ n l\<rightarrow> a = (1::'a)\<rbrakk> \<Longrightarrow> a = (1::'a)
[PROOF STEP]
apply (drule_tac n = n in power_impl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>b ^ n l\<rightarrow> a = (1::'a); b ^ n l\<rightarrow> a = a\<rbrakk> \<Longrightarrow> a = (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma rel_interior_closed_segment:
  fixes a :: "'a :: euclidean_space"
  shows "rel_interior(closed_segment a b) =
         (if a = b then {a} else open_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
proof (cases "a = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<Longrightarrow> rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
 2. a \<noteq> b \<Longrightarrow> rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. a = b \<Longrightarrow> rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
 2. a \<noteq> b \<Longrightarrow> rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b

goal (1 subgoal):
 1. rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)
[PROOF STEP]
by simp
       (metis closure_open_segment convex_open_segment convex_rel_interior_closure
              rel_interior_open_segment)
[PROOF STATE]
proof (state)
this:
rel_interior (closed_segment a b) = (if a = b then {a} else open_segment a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma at_to_0: "at a = filtermap (\<lambda>x. x + a) (at 0)"
  for a :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at a = filtermap (\<lambda>x. x + a) (at (0::'a))
[PROOF STEP]
using filtermap_at_shift[of "-a" 0]
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. x - - a) (at (0::'a)) = at ((0::'a) - - a)

goal (1 subgoal):
 1. at a = filtermap (\<lambda>x. x + a) (at (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma even_succ_div_exp [simp]:
  \<open>(1 + a) div 2 ^ n = a div 2 ^ n\<close> if \<open>even a\<close> and \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
even a
0 < n
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
even a
0 < n
n = 0

goal (1 subgoal):
 1. ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n = Suc n

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
with \<open>even a\<close>
[PROOF STATE]
proof (chain)
picking this:
even a
n = Suc n
[PROOF STEP]
have \<open>(1 + a) div 2 ^ Suc n = a div 2 ^ Suc n\<close>
[PROOF STATE]
proof (prove)
using this:
even a
n = Suc n

goal (1 subgoal):
 1. ((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>even a; n = Suc 0\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc 0 = a div (2::'a) ^ Suc 0
 2. \<And>na. \<lbrakk>\<lbrakk>even a; n = Suc na\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc na = a div (2::'a) ^ Suc na; even a; n = Suc (Suc na)\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc (Suc na) = a div (2::'a) ^ Suc (Suc na)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
even a
n = Suc 0

goal (2 subgoals):
 1. \<lbrakk>even a; n = Suc 0\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc 0 = a div (2::'a) ^ Suc 0
 2. \<And>na. \<lbrakk>\<lbrakk>even a; n = Suc na\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc na = a div (2::'a) ^ Suc na; even a; n = Suc (Suc na)\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc (Suc na) = a div (2::'a) ^ Suc (Suc na)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even a
n = Suc 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
even a
n = Suc 0

goal (1 subgoal):
 1. ((1::'a) + a) div (2::'a) ^ Suc 0 = a div (2::'a) ^ Suc 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((1::'a) + a) div (2::'a) ^ Suc 0 = a div (2::'a) ^ Suc 0

goal (1 subgoal):
 1. \<And>na. \<lbrakk>\<lbrakk>even a; n = Suc na\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc na = a div (2::'a) ^ Suc na; even a; n = Suc (Suc na)\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc (Suc na) = a div (2::'a) ^ Suc (Suc na)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>\<lbrakk>even a; n = Suc na\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc na = a div (2::'a) ^ Suc na; even a; n = Suc (Suc na)\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc (Suc na) = a div (2::'a) ^ Suc (Suc na)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>even a; n = Suc n\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n
even a
n = Suc (Suc n)

goal (1 subgoal):
 1. \<And>na. \<lbrakk>\<lbrakk>even a; n = Suc na\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc na = a div (2::'a) ^ Suc na; even a; n = Suc (Suc na)\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc (Suc na) = a div (2::'a) ^ Suc (Suc na)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>even a; n = Suc n\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n
even a
n = Suc (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>even a; n = Suc n\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n
even a
n = Suc (Suc n)

goal (1 subgoal):
 1. ((1::'a) + a) div (2::'a) ^ Suc (Suc n) = a div (2::'a) ^ Suc (Suc n)
[PROOF STEP]
using div_exp_eq [of _ 1 \<open>Suc n\<close>, symmetric]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>even a; n = Suc n\<rbrakk> \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n
even a
n = Suc (Suc n)
?a div (2::'a) ^ (1 + Suc n) = ?a div (2::'a) ^ 1 div (2::'a) ^ Suc n

goal (1 subgoal):
 1. ((1::'a) + a) div (2::'a) ^ Suc (Suc n) = a div (2::'a) ^ Suc (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((1::'a) + a) div (2::'a) ^ Suc (Suc n) = a div (2::'a) ^ Suc (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
n = Suc n
((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc n
((1::'a) + a) div (2::'a) ^ Suc n = a div (2::'a) ^ Suc n

goal (1 subgoal):
 1. ((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((1::'a) + a) div (2::'a) ^ n = a div (2::'a) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_b_least_impl_zero: "y < b_least f x \<Longrightarrow> f x y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < b_least f x \<Longrightarrow> f x y = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y < b_least f x \<Longrightarrow> f x y = 0
[PROOF STEP]
assume A1: "y < b_least f x" (is "_ < ?b")
[PROOF STATE]
proof (state)
this:
y < b_least f x

goal (1 subgoal):
 1. y < b_least f x \<Longrightarrow> f x y = 0
[PROOF STEP]
have "b_least f x \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b_least f x \<le> x
[PROOF STEP]
by (rule b_least_le_arg)
[PROOF STATE]
proof (state)
this:
b_least f x \<le> x

goal (1 subgoal):
 1. y < b_least f x \<Longrightarrow> f x y = 0
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
y < b_least f x
b_least f x \<le> x
[PROOF STEP]
have S1: "y < x"
[PROOF STATE]
proof (prove)
using this:
y < b_least f x
b_least f x \<le> x

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

goal (1 subgoal):
 1. y < b_least f x \<Longrightarrow> f x y = 0
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
y < b_least f x
y < x
[PROOF STEP]
have " y < (Least (%y. y = x \<or> (y < x \<and> (f x y) \<noteq> 0)))"
[PROOF STATE]
proof (prove)
using this:
y < b_least f x
y < x

goal (1 subgoal):
 1. y < (LEAST y. y = x \<or> y < x \<and> f x y \<noteq> 0)
[PROOF STEP]
by (simp add: b_least_def)
[PROOF STATE]
proof (state)
this:
y < (LEAST y. y = x \<or> y < x \<and> f x y \<noteq> 0)

goal (1 subgoal):
 1. y < b_least f x \<Longrightarrow> f x y = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < (LEAST y. y = x \<or> y < x \<and> f x y \<noteq> 0)
[PROOF STEP]
have "\<not> (y = x \<or> (y < x \<and> (f x y) \<noteq> 0))"
[PROOF STATE]
proof (prove)
using this:
y < (LEAST y. y = x \<or> y < x \<and> f x y \<noteq> 0)

goal (1 subgoal):
 1. \<not> (y = x \<or> y < x \<and> f x y \<noteq> 0)
[PROOF STEP]
by (rule not_less_Least)
[PROOF STATE]
proof (state)
this:
\<not> (y = x \<or> y < x \<and> f x y \<noteq> 0)

goal (1 subgoal):
 1. y < b_least f x \<Longrightarrow> f x y = 0
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
y < x
\<not> (y = x \<or> y < x \<and> f x y \<noteq> 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y < x
\<not> (y = x \<or> y < x \<and> f x y \<noteq> 0)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aprimedivisor_gt_Suc_0_nat [simp]: "d > Suc 0 \<Longrightarrow> aprimedivisor d > Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < d \<Longrightarrow> Suc 0 < aprimedivisor d
[PROOF STEP]
using prime_aprimedivisor'[of d]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>d \<noteq> 0; \<not> is_unit d\<rbrakk> \<Longrightarrow> prime (aprimedivisor d)

goal (1 subgoal):
 1. Suc 0 < d \<Longrightarrow> Suc 0 < aprimedivisor d
[PROOF STEP]
by (simp add: prime_gt_Suc_0_nat)


[STATEMENT]
lemma AbstTermP_subst [simp]:
      "(AbstTermP v i t u)(j::=w) = AbstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (AbstTermP v i t u)(j::=w) = AbstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (AbstTermP v i t u)(j::=w) = AbstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
obtain s::name and k::name  where "atom s \<sharp> (v,i,t,u,w,j,k)"  "atom k \<sharp> (v,i,t,u,w,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s k. \<lbrakk>atom s \<sharp> (v, i, t, u, w, j, k); atom k \<sharp> (v, i, t, u, w, j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom s \<sharp> (v, i, t, u, w, j, k)
atom k \<sharp> (v, i, t, u, w, j)

goal (1 subgoal):
 1. (AbstTermP v i t u)(j::=w) = AbstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom s \<sharp> (v, i, t, u, w, j, k)
atom k \<sharp> (v, i, t, u, w, j)

goal (1 subgoal):
 1. (AbstTermP v i t u)(j::=w) = AbstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
by (simp add: AbstTermP.simps [of s _ _ _ _ k])
[PROOF STATE]
proof (state)
this:
(AbstTermP v i t u)(j::=w) = AbstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_atLeastAtMostI:
  fixes f l r :: "real \<Rightarrow> real"
  assumes "eventually (\<lambda>x. l x \<le> f x) at_top" "eventually (\<lambda>x. f x \<le> u x) at_top"
  shows   "eventually (\<lambda>x. f x \<in> {l x..u x}) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x \<in> {l x..u x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. l x \<le> f x
\<forall>\<^sub>F x in at_top. f x \<le> u x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x \<in> {l x..u x}
[PROOF STEP]
by eventually_elim simp


[STATEMENT]
lemma one_minus_of_nat_in_nonpos_Ints_iff:
  "(1 - of_nat n :: 'a :: ring_char_0) \<in> \<int>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
have "(1 - of_nat n :: 'a) = of_int (1 - int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) - of_nat n = of_int (1 - int n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) - of_nat n = of_int (1 - int n)

goal (1 subgoal):
 1. ((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) - of_nat n = of_int (1 - int n)

goal (1 subgoal):
 1. ((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
have "\<dots> \<in> \<int>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int (1 - int n) \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
by (subst of_int_in_nonpos_Ints_iff) presburger
[PROOF STATE]
proof (state)
this:
(of_int (1 - int n) \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)

goal (1 subgoal):
 1. ((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)

goal (1 subgoal):
 1. ((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((1::'a) - of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (0 < n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma loxodromic_imp_not_elliptic_parabolic:
  assumes "loxodromic_isometry f"
  shows "\<not>elliptic_isometry f"
        "\<not>parabolic_isometry f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> elliptic_isometry f &&& \<not> parabolic_isometry f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
loxodromic_isometry f

goal (1 subgoal):
 1. \<not> elliptic_isometry f &&& \<not> parabolic_isometry f
[PROOF STEP]
unfolding parabolic_isometry_def loxodromic_isometry_def
[PROOF STATE]
proof (prove)
using this:
isometry f \<and> \<not> elliptic_isometry f \<and> stable_translation_length f \<noteq> 0

goal (1 subgoal):
 1. \<not> elliptic_isometry f &&& \<not> (isometry f \<and> \<not> elliptic_isometry f \<and> stable_translation_length f = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma p_intpow_inv:
  fixes n::int
  shows  "(\<pp> [^] n) \<otimes> (\<pp> [^] -n) = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> [^] n \<otimes> \<pp> [^] - n = \<one>
[PROOF STEP]
using Units_eq_nonzero monoid.int_pow_inv'[of Q\<^sub>p \<pp> n]
[PROOF STATE]
proof (prove)
using this:
Units Q\<^sub>p = nonzero Q\<^sub>p
\<lbrakk>Group.monoid Q\<^sub>p; \<pp> \<in> Units Q\<^sub>p\<rbrakk> \<Longrightarrow> \<pp> [^] - n = inv (\<pp> [^] n)

goal (1 subgoal):
 1. \<pp> [^] n \<otimes> \<pp> [^] - n = \<one>
[PROOF STEP]
by (metis add.right_inverse int_pow_0 p_intpow_add)


[STATEMENT]
lemma tendsto_Liminf:
  fixes f :: "_ \<Rightarrow> 'a :: {complete_linorder,linorder_topology}"
  shows "F \<noteq> bot \<Longrightarrow> Limsup F f = Liminf F f \<Longrightarrow> (f \<longlongrightarrow> Liminf F f) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<noteq> bot; Limsup F f = Liminf F f\<rbrakk> \<Longrightarrow> (f \<longlongrightarrow> Liminf F f) F
[PROOF STEP]
by (subst tendsto_iff_Liminf_eq_Limsup) auto


[STATEMENT]
lemma mult_eq_1:
  fixes a b :: "'a :: {ordered_semiring, comm_monoid_mult}"
  shows "0 \<le> a \<Longrightarrow> a \<le> 1 \<Longrightarrow> b \<le> 1 \<Longrightarrow> a * b = 1 \<longleftrightarrow> (a = 1 \<and> b = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> a; a \<le> (1::'a); b \<le> (1::'a)\<rbrakk> \<Longrightarrow> (a * b = (1::'a)) = (a = (1::'a) \<and> b = (1::'a))
[PROOF STEP]
by (metis mult.left_neutral eq_iff mult.commute mult_right_mono)


[STATEMENT]
lemma dX_empty_or_singleton:
  assumes "allocation X"
  shows "\<forall>d. dX X d = {} \<or> (\<exists>x. dX X d = {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>d. dX X d = {} \<or> (\<exists>x. dX X d = {x})
[PROOF STEP]
unfolding dX_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>d. {x \<in> X. Xd x = d} = {} \<or> (\<exists>x. {x \<in> X. Xd x = d} = {x})
[PROOF STEP]
using \<open>allocation X\<close>
[PROOF STATE]
proof (prove)
using this:
inj_on Xd X

goal (1 subgoal):
 1. \<forall>d. {x \<in> X. Xd x = d} = {} \<or> (\<exists>x. {x \<in> X. Xd x = d} = {x})
[PROOF STEP]
by (fastforce dest: inj_onD)


[STATEMENT]
lemma lookup_mult_scalar:
  "lookup (p \<odot> q) v = lookup (p * (proj_poly (component_of_term v) q)) (pp_of_term v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (p \<odot> q) v = lookup (p * proj_poly (component_of_term v) q) (pp_of_term v)
[PROOF STEP]
unfolding mult_scalar_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (lift_poly_fun ((*) p) q) v = lookup (p * proj_poly (component_of_term v) q) (pp_of_term v)
[PROOF STEP]
by (rule lookup_lift_poly_fun_homogenous, simp)


[STATEMENT]
lemma Max_wrt_among_preorder:
  "Max_wrt_among le A = {x\<in>carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max_wrt_among le A = {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x}
[PROOF STEP]
unfolding Max_wrt_among_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> A. le x x \<and> (\<forall>y\<in>A. le x y \<longrightarrow> le y x)} = {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x}
[PROOF STEP]
using not_outside refl
[PROOF STATE]
proof (prove)
using this:
le ?x ?y \<Longrightarrow> ?x \<in> carrier
le ?x ?y \<Longrightarrow> ?y \<in> carrier
?x \<in> carrier \<Longrightarrow> le ?x ?x

goal (1 subgoal):
 1. {x \<in> A. le x x \<and> (\<forall>y\<in>A. le x y \<longrightarrow> le y x)} = {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x}
[PROOF STEP]
by blast


[STATEMENT]
lemma lim_inverse_n': "((\<lambda>n. 1 / n) \<longlongrightarrow> 0) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
using lim_inverse_n
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse (of_nat n)) \<longlonglongrightarrow> (0::?'a)

goal (1 subgoal):
 1. (\<lambda>n. 1 / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: inverse_eq_divide)


[STATEMENT]
lemma cinner_sum_right: "cinner x (\<Sum>y\<in>A. f y) = (\<Sum>y\<in>A. cinner x (f y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner x (sum f A) = (\<Sum>y\<in>A. cinner x (f y))
[PROOF STEP]
proof (subst cinner_commute)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cinner x (f y))
[PROOF STEP]
have "(\<Sum>y\<in>A. cinner (f y) x) = (\<Sum>y\<in>A. cinner (f y) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>A. cinner (f y) x) = (\<Sum>y\<in>A. cinner (f y) x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>A. cinner (f y) x) = (\<Sum>y\<in>A. cinner (f y) x)

goal (1 subgoal):
 1. cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cinner x (f y))
[PROOF STEP]
hence "cnj (\<Sum>y\<in>A. cinner (f y) x) = cnj (\<Sum>y\<in>A. (cinner (f y) x))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>y\<in>A. cinner (f y) x) = (\<Sum>y\<in>A. cinner (f y) x)

goal (1 subgoal):
 1. cnj (\<Sum>y\<in>A. cinner (f y) x) = cnj (\<Sum>y\<in>A. cinner (f y) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnj (\<Sum>y\<in>A. cinner (f y) x) = cnj (\<Sum>y\<in>A. cinner (f y) x)

goal (1 subgoal):
 1. cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cinner x (f y))
[PROOF STEP]
hence "cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cnj (cinner (f y) x))"
[PROOF STATE]
proof (prove)
using this:
cnj (\<Sum>y\<in>A. cinner (f y) x) = cnj (\<Sum>y\<in>A. cinner (f y) x)

goal (1 subgoal):
 1. cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cnj (cinner (f y) x))
[PROOF STEP]
by (simp add: cinner_sum_left)
[PROOF STATE]
proof (state)
this:
cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cnj (cinner (f y) x))

goal (1 subgoal):
 1. cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cinner x (f y))
[PROOF STEP]
thus "cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. (cinner x (f y)))"
[PROOF STATE]
proof (prove)
using this:
cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cnj (cinner (f y) x))

goal (1 subgoal):
 1. cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cinner x (f y))
[PROOF STEP]
by (subst (2) cinner_commute)
[PROOF STATE]
proof (state)
this:
cnj (cinner (sum f A) x) = (\<Sum>y\<in>A. cinner x (f y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_IccI:
  "\<lbrakk>(f \<longlongrightarrow> f a) (at_right a);
    (f \<longlongrightarrow> f b) (at_left b);
    (\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> f \<midarrow>x\<rightarrow> f x); a < b\<rbrakk> \<Longrightarrow>
    continuous_on {a .. b} f"
  for a::"'a::linorder_topology"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> f a) (at_right a); (f \<longlongrightarrow> f b) (at_left b); \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> f \<midarrow>x\<rightarrow> f x; a < b\<rbrakk> \<Longrightarrow> continuous_on {a..b} f
[PROOF STEP]
using at_within_open[of _ "{a<..<b}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {a<..<b}; open {a<..<b}\<rbrakk> \<Longrightarrow> at ?a within {a<..<b} = at ?a

goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> f a) (at_right a); (f \<longlongrightarrow> f b) (at_left b); \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> f \<midarrow>x\<rightarrow> f x; a < b\<rbrakk> \<Longrightarrow> continuous_on {a..b} f
[PROOF STEP]
by (auto simp: continuous_on_def at_within_Icc_at_right at_within_Icc_at_left le_less
      at_within_Icc_at)


[STATEMENT]
lemma lemma2_6_1_set: "ds r (S \<union> T) = ds r S \<union> ds r T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<down>s (S \<union> T) = r \<down>s S \<union> r \<down>s T
[PROOF STEP]
unfolding set_mset_union ds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>S \<union> T. (y, x) \<in> r} = {y. \<exists>x\<in>S. (y, x) \<in> r} \<union> {y. \<exists>x\<in>T. (y, x) \<in> r}
[PROOF STEP]
by auto


[STATEMENT]
lemma has_vector_derivative_sum[derivative_intros]:
  "(\<And>i. i \<in> I \<Longrightarrow> (f i has_vector_derivative f' i) net) \<Longrightarrow>
    ((\<lambda>x. \<Sum>i\<in>I. f i x) has_vector_derivative (\<Sum>i\<in>I. f' i)) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> (f i has_vector_derivative f' i) net) \<Longrightarrow> ((\<lambda>x. \<Sum>i\<in>I. f i x) has_vector_derivative sum f' I) net
[PROOF STEP]
by (auto simp: has_vector_derivative_def fun_eq_iff scaleR_sum_right intro!: derivative_eq_intros)


[STATEMENT]
lemma swap_with_xor:
  "\<lbrakk>(x::'a::len word) = a XOR b; y = b XOR x; z = x XOR y\<rbrakk> \<Longrightarrow> z = b \<and> y = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = a XOR b; y = b XOR x; z = x XOR y\<rbrakk> \<Longrightarrow> z = b \<and> y = a
[PROOF STEP]
by (auto intro: bit_word_eqI simp add: bit_simps)


[STATEMENT]
lemma norm_commute: "norm (x,y) = norm (y,x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x, y) = norm (y, x)
[PROOF STEP]
by (simp add: norm_Pair)


[STATEMENT]
lemma "\<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace>
          TRY
            WHILE True
            INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace>
            DO IF \<acute>M = a THEN THROW ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 FI OD
          CATCH
            SKIP
          END
          \<lbrace>\<acute>S = a * b\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace> TRY WHILE True INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace> DO IF \<acute>M = a THEN THROW ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 FI OD CATCH SKIP END \<lbrace>\<acute>S = a * b\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b
 2. \<And>M S. \<lbrakk>S = M * b; True\<rbrakk> \<Longrightarrow> (M = a \<longrightarrow> S = a * b) \<and> (M \<noteq> a \<longrightarrow> S + b = (M + 1) * b)
 3. \<And>M S. \<lbrakk>S = M * b; \<not> True\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Iam_calc: "$(Ia)^{m}_n = (\<Sum>j<n. (j+1)/m * (\<Sum>k=j*m..<(j+1)*m. $v.^((k+1)/m)))"
  if "m \<noteq> 0" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
let ?I = "{..<n}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
let ?A = "\<lambda>j. {j*m..<(j+1)*m}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
let ?g = "\<lambda>k. $v.^((k+1::nat)/m) * \<lceil>(k+1::nat)/m\<rceil> / m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
have "$(Ia)^{m}_n = (\<Sum>j<n. \<Sum>k=j*m..<(j+1)*m. $v.^((k+1)/m) * \<lceil>(k+1)/m\<rceil> / m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m)
[PROOF STEP]
unfolding ann_incr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (1 * (k + 1)) / real m\<rceil> / (real 1 * real m)) = (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m)
[PROOF STEP]
using seq_part_multiple that
[PROOF STATE]
proof (prove)
using this:
?m \<noteq> 0 \<Longrightarrow> \<forall>i j. i \<noteq> j \<longrightarrow> {i * ?m..<(i + 1) * ?m} \<inter> {j * ?m..<(j + 1) * ?m} = {}
?m \<noteq> 0 \<Longrightarrow> (\<Union>i<?n. {i * ?m..<(i + 1) * ?m}) = {..<?n * ?m}
m \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>k<n * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (1 * (k + 1)) / real m\<rceil> / (real 1 * real m)) = (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m)
[PROOF STEP]
apply (simp only: mult_1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>m. m \<noteq> 0 \<Longrightarrow> \<forall>i j. i \<noteq> j \<longrightarrow> {i * m..<(i + 1) * m} \<inter> {j * m..<(j + 1) * m} = {}; \<And>m n. m \<noteq> 0 \<Longrightarrow> (\<Union>i<n. {i * m..<(i + 1) * m}) = {..<n * m}; m \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>k<n * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / (real 1 * real m)) = (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m)
[PROOF STEP]
by (subst sum.UNION_disjoint[of ?I ?A ?g, THEN sym]; simp)
[PROOF STATE]
proof (state)
this:
$(I^{1}a)^{m}_n = (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m)

goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
$(I^{1}a)^{m}_n = (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m)

goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
have "\<dots> = (\<Sum>j<n. (j+1)/m * (\<Sum>k=j*m..<(j+1)*m. $v.^((k+1)/m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
fix j k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
assume "j*m \<le> k \<and> k < (j+1)*m"
[PROOF STATE]
proof (state)
this:
j * m \<le> k \<and> k < (j + 1) * m

goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
hence "j*m < k+1 \<and> k+1 \<le> (j+1)*m"
[PROOF STATE]
proof (prove)
using this:
j * m \<le> k \<and> k < (j + 1) * m

goal (1 subgoal):
 1. j * m < k + 1 \<and> k + 1 \<le> (j + 1) * m
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
j * m < k + 1 \<and> k + 1 \<le> (j + 1) * m

goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
hence "j < (k+1)/m \<and> (k+1)/m \<le> j+1"
[PROOF STATE]
proof (prove)
using this:
j * m < k + 1 \<and> k + 1 \<le> (j + 1) * m

goal (1 subgoal):
 1. real j < real (k + 1) / real m \<and> real (k + 1) / real m \<le> real (j + 1)
[PROOF STEP]
using pos_less_divide_eq pos_divide_le_eq of_nat_less_iff of_nat_le_iff that
[PROOF STATE]
proof (prove)
using this:
j * m < k + 1 \<and> k + 1 \<le> (j + 1) * m
(0::?'a) < ?c \<Longrightarrow> (?a < ?b / ?c) = (?a * ?c < ?b)
(0::?'a) < ?c \<Longrightarrow> (?b / ?c \<le> ?a) = (?b \<le> ?a * ?c)
(of_nat ?m < of_nat ?n) = (?m < ?n)
(of_nat ?m \<le> of_nat ?n) = (?m \<le> ?n)
m \<noteq> 0

goal (1 subgoal):
 1. real j < real (k + 1) / real m \<and> real (k + 1) / real m \<le> real (j + 1)
[PROOF STEP]
by (smt (verit) of_nat_le_0_iff of_nat_mult)
[PROOF STATE]
proof (state)
this:
real j < real (k + 1) / real m \<and> real (k + 1) / real m \<le> real (j + 1)

goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
hence "\<lceil>(k+1)/m\<rceil> = j+1"
[PROOF STATE]
proof (prove)
using this:
real j < real (k + 1) / real m \<and> real (k + 1) / real m \<le> real (j + 1)

goal (1 subgoal):
 1. \<lceil>real (k + 1) / real m\<rceil> = int (j + 1)
[PROOF STEP]
by (simp add: ceiling_unique)
[PROOF STATE]
proof (state)
this:
\<lceil>real (k + 1) / real m\<rceil> = int (j + 1)

goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?j2 * m \<le> ?k2 \<and> ?k2 < (?j2 + 1) * m \<Longrightarrow> \<lceil>real (?k2 + 1) / real m\<rceil> = int (?j2 + 1)

goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
hence "\<And>j k. j*m \<le> k \<and> k < (j+1)*m \<Longrightarrow> \<lceil>(k+1)/m\<rceil> = j+1"
[PROOF STATE]
proof (prove)
using this:
?j2 * m \<le> ?k2 \<and> ?k2 < (?j2 + 1) * m \<Longrightarrow> \<lceil>real (?k2 + 1) / real m\<rceil> = int (?j2 + 1)

goal (1 subgoal):
 1. \<And>j k. j * m \<le> k \<and> k < (j + 1) * m \<Longrightarrow> \<lceil>(real k + 1) / real m\<rceil> = int j + 1
[PROOF STEP]
by (metis (no_types) of_nat_1 of_nat_add)
[PROOF STATE]
proof (state)
this:
?j * m \<le> ?k \<and> ?k < (?j + 1) * m \<Longrightarrow> \<lceil>(real ?k + 1) / real m\<rceil> = int ?j + 1

goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
with v_pos
[PROOF STATE]
proof (chain)
picking this:
0 < $v
?j * m \<le> ?k \<and> ?k < (?j + 1) * m \<Longrightarrow> \<lceil>(real ?k + 1) / real m\<rceil> = int ?j + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < $v
?j * m \<le> ?k \<and> ?k < (?j + 1) * m \<Longrightarrow> \<lceil>(real ?k + 1) / real m\<rceil> = int ?j + 1

goal (1 subgoal):
 1. (\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
apply (intro sum.cong, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < $v; \<And>j k. j * m \<le> k \<and> k < (j + 1) * m \<Longrightarrow> \<lceil>(real k + 1) / real m\<rceil> = int j + 1; x \<in> {..<n}\<rbrakk> \<Longrightarrow> (\<Sum>k = x * m..<(x + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = real (x + 1) / real m * (\<Sum>k = x * m..<(x + 1) * m. $v .^ (real (k + 1) / real m))
[PROOF STEP]
apply (subst sum_distrib_left, rule sum.cong; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>0 < $v; \<And>j k. j * m \<le> k \<and> k < m + j * m \<Longrightarrow> \<lceil>(real k + 1) / real m\<rceil> = int j + 1; x < n; x * m \<le> xa \<and> xa < m + x * m\<rbrakk> \<Longrightarrow> real_of_int \<lceil>(1 + real xa) / real m\<rceil> = 1 + real x
[PROOF STEP]
by (smt (verit, ccfv_SIG) of_int_1 of_int_diff of_int_of_nat_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. \<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (k + 1) / real m\<rceil> / real m) = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))

goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
$(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
$(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))

goal (1 subgoal):
 1. $(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
$(I^{1}a)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. $v .^ (real (k + 1) / real m)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma openin_path_components_of_locally_path_connected_space:
   "\<lbrakk>locally_path_connected_space X; c \<in> path_components_of X\<rbrakk> \<Longrightarrow> openin X c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>locally_path_connected_space X; c \<in> path_components_of X\<rbrakk> \<Longrightarrow> openin X c
[PROOF STEP]
apply (auto simp: locally_path_connected_space_eq_open_path_component_of)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>U x. openin X U \<and> x \<in> U \<longrightarrow> openin X (path_component_of_set (subtopology X U) x); c \<in> path_components_of X\<rbrakk> \<Longrightarrow> openin X c
[PROOF STEP]
by (metis (no_types, lifting) imageE openin_topspace path_components_of_def subtopology_topspace)


[STATEMENT]
lemma utility_weak_ranking_index:
  "is_vnm_utility (\<lambda>x. real (length (weak_ranking le) - weak_ranking_index x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_vnm_utility (\<lambda>x. real (length (weak_ranking le) - weak_ranking_index x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (real (length (weak_ranking le) - weak_ranking_index x) \<le> real (length (weak_ranking le) - weak_ranking_index y)) = le x y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (real (length (weak_ranking le) - weak_ranking_index x) \<le> real (length (weak_ranking le) - weak_ranking_index y)) = le x y
[PROOF STEP]
assume xy: "x \<in> carrier" "y \<in> carrier"
[PROOF STATE]
proof (state)
this:
x \<in> carrier
y \<in> carrier

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (real (length (weak_ranking le) - weak_ranking_index x) \<le> real (length (weak_ranking le) - weak_ranking_index y)) = le x y
[PROOF STEP]
with this[THEN nth_weak_ranking_index(1)] this[THEN nth_weak_ranking_index(2)]
[PROOF STATE]
proof (chain)
picking this:
weak_ranking_index x < length (weak_ranking le)
weak_ranking_index y < length (weak_ranking le)
x \<in> weak_ranking le ! weak_ranking_index x
y \<in> weak_ranking le ! weak_ranking_index y
x \<in> carrier
y \<in> carrier
[PROOF STEP]
show "(real (length (weak_ranking le) - weak_ranking_index x)
            \<le> real (length (weak_ranking le) - weak_ranking_index y)) \<longleftrightarrow> le x y"
[PROOF STATE]
proof (prove)
using this:
weak_ranking_index x < length (weak_ranking le)
weak_ranking_index y < length (weak_ranking le)
x \<in> weak_ranking le ! weak_ranking_index x
y \<in> weak_ranking le ! weak_ranking_index y
x \<in> carrier
y \<in> carrier

goal (1 subgoal):
 1. (real (length (weak_ranking le) - weak_ranking_index x) \<le> real (length (weak_ranking le) - weak_ranking_index y)) = le x y
[PROOF STEP]
by (simp add: le_diff_iff')
[PROOF STATE]
proof (state)
this:
(real (length (weak_ranking le) - weak_ranking_index x) \<le> real (length (weak_ranking le) - weak_ranking_index y)) = le x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pi_gt_zero [simp]: "0 < pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < pi
[PROOF STEP]
using pi_half_gt_zero
[PROOF STATE]
proof (prove)
using this:
0 < pi / 2

goal (1 subgoal):
 1. 0 < pi
[PROOF STEP]
by simp


[STATEMENT]
lemma "\<bar>x\<bar> \<le> 1 \<longrightarrow> \<bar>64 * x^7 - 112 * x^5 + 56 * x^3 - 7 * x\<bar> \<le> (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> 1 \<longrightarrow> \<bar>64 * x ^ 7 - 112 * x ^ 5 + 56 * x ^ 3 - 7 * x\<bar> \<le> 1
[PROOF STEP]
by (sos "((((A<0 * R<1) + ((A<=1 * R<1) * (R<1 * [~8*x^3 + ~4*x^2 + 4*x + 1]^2)))) & ((((A<0 * A<1) * R<1) + ((A<=1 * (A<0 * R<1)) * (R<1 * [8*x^3 + ~4*x^2 + ~4*x + 1]^2)))))")


[STATEMENT]
lemma "\<forall>x::'a::linordered_field.
  \<exists>y < \<bar>3 * x - 1\<bar>. \<forall>z \<ge> 3 * \<bar>x\<bar> - 1. \<bar>12 * x - 13 * y + 19 * z\<bar> > \<bar>23 * x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<exists>y<\<bar>(3::'a) * x - (1::'a)\<bar>. \<forall>z\<ge>(3::'a) * \<bar>x\<bar> - (1::'a). \<bar>(23::'a) * x\<bar> < \<bar>(12::'a) * x - (13::'a) * y + (19::'a) * z\<bar>
[PROOF STEP]
by ferrack


[STATEMENT]
lemma Pring_mult_assoc:
  assumes "a \<in> carrier (Pring R I)"
  assumes "b \<in> carrier (Pring R I)"
  assumes "c \<in> carrier (Pring R I)"
  shows "a \<otimes>\<^bsub>Pring R I\<^esub> (b \<otimes>\<^bsub>Pring R I\<^esub> c) = (a \<otimes>\<^bsub>Pring R I\<^esub> b) \<otimes>\<^bsub>Pring R I\<^esub> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes>\<^bsub>Pring R I\<^esub> (b \<otimes>\<^bsub>Pring R I\<^esub> c) = a \<otimes>\<^bsub>Pring R I\<^esub> b \<otimes>\<^bsub>Pring R I\<^esub> c
[PROOF STEP]
using assms P_ring_mult_assoc[of a b c]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Pring R I)
b \<in> carrier (Pring R I)
c \<in> carrier (Pring R I)
\<lbrakk>carrier_coeff a; carrier_coeff b; carrier_coeff c\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p (b \<Otimes>\<^sub>p c) = a \<Otimes>\<^sub>p b \<Otimes>\<^sub>p c

goal (1 subgoal):
 1. a \<otimes>\<^bsub>Pring R I\<^esub> (b \<otimes>\<^bsub>Pring R I\<^esub> c) = a \<otimes>\<^bsub>Pring R I\<^esub> b \<otimes>\<^bsub>Pring R I\<^esub> c
[PROOF STEP]
by (metis Pring_carrier_coeff Pring_mult)


[STATEMENT]
lemma (in aGroup)  nt_mult_mm:"\<lbrakk> a \<in> carrier A; m < 0; n < 0\<rbrakk> \<Longrightarrow>
                     m\<triangleright>(n\<triangleright>a\<^bsub>A\<^esub>)\<^bsub>A\<^esub> = (m * n)\<triangleright>a\<^bsub>A\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; m < 0; n < 0\<rbrakk> \<Longrightarrow> m\<triangleright>n\<triangleright>a\<^bsub>A\<^esub>\<^bsub>A\<^esub> = (m * n)\<triangleright>a\<^bsub>A\<^esub>
[PROOF STEP]
apply (simp add:sprod_n_a_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; m < 0; n < 0\<rbrakk> \<Longrightarrow> (0 \<le> m * n \<longrightarrow> aSum A (nat (- m)) (-\<^sub>a aSum A (nat (- n)) (-\<^sub>a a)) = aSum A (nat (m * n)) a) \<and> (\<not> 0 \<le> m * n \<longrightarrow> aSum A (nat (- m)) (-\<^sub>a aSum A (nat (- n)) (-\<^sub>a a)) = aSum A (nat (- (m * n))) (-\<^sub>a a))
[PROOF STEP]
apply (subgoal_tac "0 \<le> m * n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; m < 0; n < 0; 0 \<le> m * n\<rbrakk> \<Longrightarrow> (0 \<le> m * n \<longrightarrow> aSum A (nat (- m)) (-\<^sub>a aSum A (nat (- n)) (-\<^sub>a a)) = aSum A (nat (m * n)) a) \<and> (\<not> 0 \<le> m * n \<longrightarrow> aSum A (nat (- m)) (-\<^sub>a aSum A (nat (- n)) (-\<^sub>a a)) = aSum A (nat (- (m * n))) (-\<^sub>a a))
 2. \<lbrakk>a \<in> carrier A; m < 0; n < 0\<rbrakk> \<Longrightarrow> 0 \<le> m * n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; m < 0; n < 0; 0 \<le> m * n\<rbrakk> \<Longrightarrow> aSum A (nat (- m)) (-\<^sub>a aSum A (nat (- n)) (-\<^sub>a a)) = aSum A (nat (m * n)) a
 2. \<lbrakk>a \<in> carrier A; m < 0; n < 0\<rbrakk> \<Longrightarrow> 0 \<le> m * n
[PROOF STEP]
apply (simp add:asum_multTr_mm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; m < 0; n < 0\<rbrakk> \<Longrightarrow> 0 \<le> m * n
[PROOF STEP]
apply (frule zmult_neg_neg[of "m" "n"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; m < 0; n < 0; 0 < m * n\<rbrakk> \<Longrightarrow> 0 \<le> m * n
[PROOF STEP]
apply (simp add:zle_imp_zless_or_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subset_image_Int: "A \<subseteq> B \<Longrightarrow> f ` (A \<inter> B) = f ` A \<inter> f ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> f ` (A \<inter> B) = f ` A \<inter> f ` B
[PROOF STEP]
by (simp only: Int_absorb2 image_mono)


[STATEMENT]
lemma power_eq_1_iff:
  fixes w :: "'a::real_normed_div_algebra"
  shows "w ^ n = 1 \<Longrightarrow> norm w = 1 \<or> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w ^ n = (1::'a) \<Longrightarrow> norm w = 1 \<or> n = 0
[PROOF STEP]
by (metis norm_one power_0_left power_eq_0_iff power_eq_imp_eq_norm power_one)


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


[STATEMENT]
lemma (in group)
  assumes finite': "finite (carrier G)" "a \<in> carrier G"
  shows pow_ord_eq_ord_iff: "group.ord G (a [^] k) = ord a \<longleftrightarrow> coprime k (ord a)" (is "?L \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ord (a [^] k) = ord a) = coprime k (ord a)
[PROOF STEP]
using assms ord_ge_1 [OF assms]
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
a \<in> carrier G
1 \<le> ord a

goal (1 subgoal):
 1. (ord (a [^] k) = ord a) = coprime k (ord a)
[PROOF STEP]
by (auto simp: div_eq_dividend_iff ord_pow_gen coprime_iff_gcd_eq_1 gcd.commute split: if_split_asm)


[STATEMENT]
lemma tagged_partial_division_ofD:
  assumes "s tagged_partial_division_of i"
  shows "finite s"
    and "\<And>x K. (x,K) \<in> s \<Longrightarrow> x \<in> K"
    and "\<And>x K. (x,K) \<in> s \<Longrightarrow> K \<subseteq> i"
    and "\<And>x K. (x,K) \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b"
    and "\<And>x1 K1 x2 K2. (x1,K1) \<in> s \<Longrightarrow>
      (x2, K2) \<in> s \<Longrightarrow> (x1, K1) \<noteq> (x2, K2) \<Longrightarrow> interior K1 \<inter> interior K2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finite s &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> x \<in> K)) &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> K \<subseteq> i) &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b) &&& (\<And>x1 K1 x2 K2. \<lbrakk>(x1, K1) \<in> s; (x2, K2) \<in> s; (x1, K1) \<noteq> (x2, K2)\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s tagged_partial_division_of i

goal (1 subgoal):
 1. (finite s &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> x \<in> K)) &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> K \<subseteq> i) &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b) &&& (\<And>x1 K1 x2 K2. \<lbrakk>(x1, K1) \<in> s; (x2, K2) \<in> s; (x1, K1) \<noteq> (x2, K2)\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {})
[PROOF STEP]
unfolding tagged_partial_division_of_def
[PROOF STATE]
proof (prove)
using this:
finite s \<and> (\<forall>x K. (x, K) \<in> s \<longrightarrow> x \<in> K \<and> K \<subseteq> i \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>x1 K1 x2 K2. (x1, K1) \<in> s \<and> (x2, K2) \<in> s \<and> (x1, K1) \<noteq> (x2, K2) \<longrightarrow> interior K1 \<inter> interior K2 = {})

goal (1 subgoal):
 1. (finite s &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> x \<in> K)) &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> K \<subseteq> i) &&& (\<And>x K. (x, K) \<in> s \<Longrightarrow> \<exists>a b. K = cbox a b) &&& (\<And>x1 K1 x2 K2. \<lbrakk>(x1, K1) \<in> s; (x2, K2) \<in> s; (x1, K1) \<noteq> (x2, K2)\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {})
[PROOF STEP]
by blast+


[STATEMENT]
lemma cos_npi_int [simp]:
  fixes n::int shows "cos (pi * of_int n) = (if even n then 1 else -1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (pi * real_of_int n) = (if even n then 1 else - 1)
[PROOF STEP]
by (auto simp: algebra_simps cos_one_2pi_int elim!: oddE evenE)


[STATEMENT]
lemma eint_minus_ineq:
  assumes "(c::eint) \<noteq>\<infinity>"
  assumes "b \<ge> d"
  shows "b - c \<ge> d - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d - c \<le> b - c
[PROOF STEP]
by (metis add_left_mono antisym assms(1) assms(2) eint_add_cancel_fact linear)


[STATEMENT]
lemma algebraic_add_cancel_right [simp]:
  assumes "algebraic y"
  shows   "algebraic (x + y) \<longleftrightarrow> algebraic x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic (x + y) = algebraic x
[PROOF STEP]
using algebraic_add_cancel_left[of y x] assms
[PROOF STATE]
proof (prove)
using this:
algebraic y \<Longrightarrow> algebraic (y + x) = algebraic x
algebraic y

goal (1 subgoal):
 1. algebraic (x + y) = algebraic x
[PROOF STEP]
by (simp add: add.commute del: algebraic_add_cancel_left)


[STATEMENT]
lemma (in weak_partial_order) least_cong:
  "\<lbrakk>x .= x'; x \<in> carrier L; x' \<in> carrier L; is_closed A\<rbrakk> \<Longrightarrow> least L x A = least L x' A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x .= x'; x \<in> carrier L; x' \<in> carrier L; is_closed A\<rbrakk> \<Longrightarrow> least L x A = least L x' A
[PROOF STEP]
unfolding least_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x .= x'; x \<in> carrier L; x' \<in> carrier L; is_closed A\<rbrakk> \<Longrightarrow> (A \<subseteq> carrier L \<and> x \<in> A \<and> Ball A ((\<sqsubseteq>) x)) = (A \<subseteq> carrier L \<and> x' \<in> A \<and> Ball A ((\<sqsubseteq>) x'))
[PROOF STEP]
by (meson is_closed_eq is_closed_eq_rev le_cong local.refl subset_iff)


[STATEMENT]
lemma AE_I:
  assumes "{x \<in> space M. \<not> P x} \<subseteq> N" "emeasure M N = 0" "N \<in> sets M"
  shows "AE x in M. P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere M P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
{x \<in> space M. \<not> P x} \<subseteq> N
emeasure M N = 0
N \<in> sets M

goal (1 subgoal):
 1. almost_everywhere M P
[PROOF STEP]
unfolding eventually_ae_filter
[PROOF STATE]
proof (prove)
using this:
{x \<in> space M. \<not> P x} \<subseteq> N
emeasure M N = 0
N \<in> sets M

goal (1 subgoal):
 1. Bex (null_sets M) ((\<subseteq>) {x \<in> space M. \<not> P x})
[PROOF STEP]
by auto


[STATEMENT]
lemma make_mat_index:
  assumes i: "i<n" and j: "j<n"
  shows "make_mat n k B $$ (i,j) = (if i = 0 \<and> j = 0 then B$$(0,0) else
    if i = 0 \<and> j = k then B$$(0,1) else if i=k \<and> j = 0
      then B$$(1,0) else if i=k \<and> j=k then B$$(1,1)
      else if i=j then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. make_mat n k B $$ (i, j) = (if i = 0 \<and> j = 0 then B $$ (0, 0) else if i = 0 \<and> j = k then B $$ (0, 1) else if i = k \<and> j = 0 then B $$ (1, 0) else if i = k \<and> j = k then B $$ (1, 1) else if i = j then 1::'a else (0::'a))
[PROOF STEP]
unfolding make_mat_def index_mat[OF i j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (i, j) of (i, j) \<Rightarrow> if i = 0 \<and> j = 0 then B $$ (0, 0) else if i = 0 \<and> j = k then B $$ (0, 1) else if i = k \<and> j = 0 then B $$ (1, 0) else if i = k \<and> j = k then B $$ (1, 1) else if i = j then 1::'a else (0::'a)) = (if i = 0 \<and> j = 0 then B $$ (0, 0) else if i = 0 \<and> j = k then B $$ (0, 1) else if i = k \<and> j = 0 then B $$ (1, 0) else if i = k \<and> j = k then B $$ (1, 1) else if i = j then 1::'a else (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma pmf_of_multiset_pmf_of_mapping:
  assumes "A \<noteq> {#}" "set xs = set_mset A" "distinct xs"
  shows   "mapping_of_pmf (pmf_of_multiset A) = Mapping.tabulate xs (\<lambda>x. count A x / real (size A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mapping_of_pmf (pmf_of_multiset A) = Mapping.tabulate xs (\<lambda>x. real (count A x) / real (size A))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {#}
set xs = set_mset A
distinct xs

goal (1 subgoal):
 1. mapping_of_pmf (pmf_of_multiset A) = Mapping.tabulate xs (\<lambda>x. real (count A x) / real (size A))
[PROOF STEP]
by (intro mapping_of_pmfI) (auto simp: lookup_tabulate)


[STATEMENT]
lemma cos_vangle_eqD: "cos (vangle u v) = cos (vangle w x) \<Longrightarrow> vangle u v = vangle w x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (vangle u v) = cos (vangle w x) \<Longrightarrow> vangle u v = vangle w x
[PROOF STEP]
by (rule cos_inj_pi) (simp_all add: vangle_bounds)


[STATEMENT]
lemma helper2:
  fixes A ::"'a::comm_ring mat"
  fixes v ::"'a vec"
  assumes "v \<in> carrier_vec (length ss)"
  assumes "\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr"
  shows
    "mat_of_cols nr ss *\<^sub>v v =
   mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
?x \<in> set ls \<Longrightarrow> dim_vec ?x = nr

goal (1 subgoal):
 1. mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v)
[PROOF STEP]
proof (induction ls)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ([] @ ss) *\<^sub>v (0\<^sub>v (length []) @\<^sub>v v)
 2. \<And>a ls. \<lbrakk>(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x \<in> set (a # ls) \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ((a # ls) @ ss) *\<^sub>v (0\<^sub>v (length (a # ls)) @\<^sub>v v)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
?x \<in> set [] \<Longrightarrow> dim_vec ?x = nr

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ([] @ ss) *\<^sub>v (0\<^sub>v (length []) @\<^sub>v v)
 2. \<And>a ls. \<lbrakk>(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x \<in> set (a # ls) \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ((a # ls) @ ss) *\<^sub>v (0\<^sub>v (length (a # ls)) @\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set [] \<Longrightarrow> dim_vec ?x = nr
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?x \<in> set [] \<Longrightarrow> dim_vec ?x = nr

goal (1 subgoal):
 1. mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ([] @ ss) *\<^sub>v (0\<^sub>v (length []) @\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ([] @ ss) *\<^sub>v (0\<^sub>v (length []) @\<^sub>v v)

goal (1 subgoal):
 1. \<And>a ls. \<lbrakk>(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x \<in> set (a # ls) \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ((a # ls) @ ss) *\<^sub>v (0\<^sub>v (length (a # ls)) @\<^sub>v v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ls. \<lbrakk>(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x \<in> set (a # ls) \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ((a # ls) @ ss) *\<^sub>v (0\<^sub>v (length (a # ls)) @\<^sub>v v)
[PROOF STEP]
case (Cons a ls)
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v)
?x \<in> set (a # ls) \<Longrightarrow> dim_vec ?x = nr

goal (1 subgoal):
 1. \<And>a ls. \<lbrakk>(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x \<in> set (a # ls) \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ((a # ls) @ ss) *\<^sub>v (0\<^sub>v (length (a # ls)) @\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v)
?x \<in> set (a # ls) \<Longrightarrow> dim_vec ?x = nr
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> set ls \<Longrightarrow> dim_vec x = nr) \<Longrightarrow> mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v)
?x \<in> set (a # ls) \<Longrightarrow> dim_vec ?x = nr

goal (1 subgoal):
 1. mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ((a # ls) @ ss) *\<^sub>v (0\<^sub>v (length (a # ls)) @\<^sub>v v)
[PROOF STEP]
apply (auto simp add:zero_vec_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x = a \<or> x \<in> set ls \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v) = mat_of_cols nr (a # ls @ ss) *\<^sub>v vCons (0::'a) (0\<^sub>v (length ls) @\<^sub>v v)
[PROOF STEP]
apply (subst mat_of_cols_cons_mat_vec)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x = a \<or> x \<in> set ls \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> 0\<^sub>v (length ls) @\<^sub>v v \<in> carrier_vec (length (ls @ ss))
 2. \<lbrakk>mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x = a \<or> x \<in> set ls \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> dim_vec a = nr
 3. \<lbrakk>mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v); \<And>x. x = a \<or> x \<in> set ls \<Longrightarrow> dim_vec x = nr\<rbrakk> \<Longrightarrow> mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v) = (0::'a) \<cdot>\<^sub>v a + mat_of_cols nr (ls @ ss) *\<^sub>v (0\<^sub>v (length ls) @\<^sub>v v)
[PROOF STEP]
by (auto simp add:assms smult_vec_zero)
[PROOF STATE]
proof (state)
this:
mat_of_cols nr ss *\<^sub>v v = mat_of_cols nr ((a # ls) @ ss) *\<^sub>v (0\<^sub>v (length (a # ls)) @\<^sub>v v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_heap_children_larger:
  "is_heap t \<Longrightarrow> \<forall> x \<in> set (children t). priority x \<ge> priority t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_heap_list (priority t) (children t) \<Longrightarrow> \<forall>x\<in>set (children t). priority t \<le> priority x
[PROOF STEP]
by (erule is_heap_list.induct) simp_all


[STATEMENT]
lemma generic_poly_eval_at_point:
  assumes "a \<in> carrier (R\<^bsup>n+3\<^esup>)"
  shows "eval_at_point R a (generic_poly R (Suc n)) = (eval_at_point R a (generic_poly R n)) \<oplus>
                                                    (a!(n + 2)) \<otimes> (a!0)[^](Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_at_point R a (generic_poly R (Suc n)) = eval_at_point R a (generic_poly R n) \<oplus> a ! (n + 2) \<otimes> a ! 0 [^] Suc n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_at_point R a (generic_poly R (Suc n)) = eval_at_point R a (generic_poly R n) \<oplus> a ! (n + 2) \<otimes> a ! 0 [^] Suc n
[PROOF STEP]
have 0: "(generic_poly R n) \<in> carrier (coord_ring R (n + 3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generic_poly R n \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>])
[PROOF STEP]
using generic_poly_closed'
[PROOF STATE]
proof (prove)
using this:
?k \<le> ?n \<Longrightarrow> generic_poly R ?k \<in> carrier (R [\<X>\<^bsub>Suc (Suc ?n)\<^esub>])

goal (1 subgoal):
 1. generic_poly R n \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>])
[PROOF STEP]
by (metis Suc3_eq_add_3 add.commute eq_imp_le le_SucI)
[PROOF STATE]
proof (state)
this:
generic_poly R n \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>])

goal (1 subgoal):
 1. eval_at_point R a (generic_poly R (Suc n)) = eval_at_point R a (generic_poly R n) \<oplus> a ! (n + 2) \<otimes> a ! 0 [^] Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
generic_poly R n \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
generic_poly R n \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>])

goal (1 subgoal):
 1. eval_at_point R a (generic_poly R (Suc n)) = eval_at_point R a (generic_poly R n) \<oplus> a ! (n + 2) \<otimes> a ! 0 [^] Suc n
[PROOF STEP]
using generic_poly.simps(2)
          generic_poly_closed'[of n "n + 3"]
          generic_poly_lt_eval eval_at_point_add[of a "(n + 3)" "generic_poly R n"]
[PROOF STATE]
proof (prove)
using this:
generic_poly R n \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>])
generic_poly ?R (Suc ?n) = generic_poly ?R ?n \<oplus>\<^bsub>?R [\<X>\<^bsub>?n + 3\<^esub>]\<^esub> generic_poly_lt ?R (Suc ?n)
n \<le> n + 3 \<Longrightarrow> generic_poly R n \<in> carrier (R [\<X>\<^bsub>Suc (Suc (n + 3))\<^esub>])
?a \<in> carrier (R\<^bsup>?n + 2\<^esup>) \<Longrightarrow> eval_at_point R ?a (generic_poly_lt R ?n) = ?a ! Suc ?n \<otimes> ?a ! 0 [^] ?n
\<lbrakk>a \<in> carrier (R\<^bsup>n + 3\<^esup>); generic_poly R n \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>]); ?B \<in> carrier (R [\<X>\<^bsub>n + 3\<^esub>])\<rbrakk> \<Longrightarrow> eval_at_point R a (generic_poly R n \<oplus>\<^bsub>R [\<X>\<^bsub>n + 3\<^esub>]\<^esub> ?B) = eval_at_point R a (generic_poly R n) \<oplus> eval_at_point R a ?B

goal (1 subgoal):
 1. eval_at_point R a (generic_poly R (Suc n)) = eval_at_point R a (generic_poly R n) \<oplus> a ! (n + 2) \<otimes> a ! 0 [^] Suc n
[PROOF STEP]
by (metis (no_types, lifting) add.left_commute add_2_eq_Suc' assms
        generic_poly_lt_closed numeral_2_eq_2 numeral_3_eq_3 plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
eval_at_point R a (generic_poly R (Suc n)) = eval_at_point R a (generic_poly R n) \<oplus> a ! (n + 2) \<otimes> a ! 0 [^] Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Times_mset_single_right: "A \<times># {#b#} = image_mset (\<lambda>a. Pair a b) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times># {#b#} = {#(a, b). a \<in># A#}
[PROOF STEP]
unfolding Sigma_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>#A. image_mset (Pair a) {#b#}) = {#(a, b). a \<in># A#}
[PROOF STEP]
by (induction A) auto


[STATEMENT]
lemma (in Semilat) trans_r [trans, intro?]: "\<lbrakk>x \<sqsubseteq>\<^sub>r y; y \<sqsubseteq>\<^sub>r z; x \<in> A; y \<in> A; z \<in> A \<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^sub>r z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> z; x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> z; x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z
[PROOF STEP]
by (auto intro: order_trans)


[STATEMENT]
lemma float_zero:
  "float (0, b) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. float (0, b) = 0
[PROOF STEP]
by (simp add: float_def)


[STATEMENT]
lemma octo_of_nat_add [simp]: "octo_of_nat (a + b) = octo_of_nat a + octo_of_nat b"
  and octo_of_nat_mult [simp]: "octo_of_nat (a * b) = octo_of_nat a * octo_of_nat b"
  and octo_of_nat_diff [simp]: "b \<le> a \<Longrightarrow> octo_of_nat (a - b) = octo_of_nat a - octo_of_nat b"
  and octo_of_nat_0 [simp]: "octo_of_nat 0 = 0"
  and octo_of_nat_1 [simp]: "octo_of_nat 1 = 1"
  and octo_of_nat_Suc_0 [simp]: "octo_of_nat (Suc 0) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (octo_of_nat (a + b) = octo_of_nat a + octo_of_nat b &&& octo_of_nat (a * b) = octo_of_nat a * octo_of_nat b &&& (b \<le> a \<Longrightarrow> octo_of_nat (a - b) = octo_of_nat a - octo_of_nat b)) &&& octo_of_nat 0 = 0 &&& octo_of_nat 1 = 1 &&& octo_of_nat (Suc 0) = 1
[PROOF STEP]
by (simp_all add: octo_eq_iff octo_mult_components)


[STATEMENT]
lemma shiftl_lt_0: fixes i :: int shows "push_bit n i < 0 \<longleftrightarrow> i < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (push_bit n i < 0) = (i < 0)
[PROOF STEP]
by (fact push_bit_negative_int_iff)


[STATEMENT]
lemma padr_padl_eq:
  assumes v: "v : carrier_vec n"
  shows "padr m v = padl n u \<longleftrightarrow> v = 0\<^sub>v n \<and> u = 0\<^sub>v m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v @\<^sub>v 0\<^sub>v m = 0\<^sub>v n @\<^sub>v u) = (v = 0\<^sub>v n \<and> u = 0\<^sub>v m)
[PROOF STEP]
apply (subst append_vec_eq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. v \<in> carrier_vec ?n
 2. 0\<^sub>v n \<in> carrier_vec ?n
 3. (v = 0\<^sub>v n \<and> 0\<^sub>v m = u) = (v = 0\<^sub>v n \<and> u = 0\<^sub>v m)
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n

goal (3 subgoals):
 1. v \<in> carrier_vec ?n
 2. 0\<^sub>v n \<in> carrier_vec ?n
 3. (v = 0\<^sub>v n \<and> 0\<^sub>v m = u) = (v = 0\<^sub>v n \<and> u = 0\<^sub>v m)
[PROOF STEP]
by auto


[STATEMENT]
lemma cos_arccos_abs: "\<bar>y\<bar> \<le> 1 \<Longrightarrow> cos (arccos y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>y\<bar> \<le> 1 \<Longrightarrow> cos (arccos y) = y
[PROOF STEP]
by (simp add: abs_le_iff)


[STATEMENT]
lemma mult_strict_mono:
  assumes t1: "a < b" and t2: "c < d" and t3: "0 < b" and t4: "0 \<le> c"
  shows "a * c < b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
have "a * c < b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
by (metis local.dual_order.order_iff_strict local.dual_order.strict_trans2
        local.mult_strict_left_mono local.mult_strict_right_mono local.mult_zero_right t1 t2 t3 t4)
[PROOF STATE]
proof (state)
this:
a * c < b * d

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a * c < b * d

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a * c < b * d
a < b
c < d
(0::'a) < b
(0::'a) \<le> c

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a * c < b * d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lists_iff_set: "w \<in> lists A \<longleftrightarrow> set w \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w \<in> lists A) = (set w \<subseteq> A)
[PROOF STEP]
by auto


[STATEMENT]
theorem "\<exists>(x::int) y. 0 < x  \<and> 0 \<le> y \<and> 3 * x - 5 * y = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. 0 < x \<and> 0 \<le> y \<and> 3 * x - 5 * y = 1
[PROOF STEP]
by cooper


[STATEMENT]
lemma le_mtx_norm: "m \<in> {\<parallel>A *\<^sub>V x\<parallel> |x. \<parallel>x\<parallel> = 1} \<Longrightarrow> m \<le> \<parallel>A\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<in> {\<parallel>A *\<^sub>V x\<parallel> |x. \<parallel>x\<parallel> = 1} \<Longrightarrow> m \<le> \<parallel>A\<parallel>
[PROOF STEP]
using cSup_upper[of _ "{\<parallel>(to_vec A) *v x\<parallel> | x. \<parallel>x\<parallel> = 1}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> {\<parallel>to_vec A *v x\<parallel> |x. \<parallel>x\<parallel> = 1}; bdd_above {\<parallel>to_vec A *v x\<parallel> |x. \<parallel>x\<parallel> = 1}\<rbrakk> \<Longrightarrow> ?x \<le> Sup {\<parallel>to_vec A *v x\<parallel> |x. \<parallel>x\<parallel> = 1}

goal (1 subgoal):
 1. m \<in> {\<parallel>A *\<^sub>V x\<parallel> |x. \<parallel>x\<parallel> = 1} \<Longrightarrow> m \<le> \<parallel>A\<parallel>
[PROOF STEP]
by (simp add: op_norm_set_proptys(2) op_norm_def norm_sq_mtx_def sq_mtx_vec_mult.rep_eq)


[STATEMENT]
lemma HUnion_hinsert [simp]: "\<Squnion>(A \<triangleleft> a) = a \<squnion> \<Squnion>A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>(A \<triangleleft> a) = a \<squnion> \<Squnion>A
[PROOF STEP]
by (auto simp: hf_ext)


[STATEMENT]
theorem wls_substAbs_compose2:
assumes  "wlsAbs (us,s) A" and "wls (asSort ys) Y" and "wls (asSort zs) Z"
and "ys \<noteq> zs \<or> y \<noteq> z" and fresh: "fresh ys y Z"
shows "((A $[Y / y]_ys) $[Z / z]_zs) = ((A $[Z / z]_zs) $[(Y #[Z / z]_zs) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[Y / y]_ys $[Z / z]_zs = A $[Z / z]_zs $[Y #[Z / z]_zs / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wls (asSort ys) Y
wls (asSort zs) Z
ys \<noteq> zs \<or> y \<noteq> z
fresh ys y Z

goal (1 subgoal):
 1. A $[Y / y]_ys $[Z / z]_zs = A $[Z / z]_zs $[Y #[Z / z]_zs / y]_ys
[PROOF STEP]
by(simp add: substAbs_compose2)


[STATEMENT]
lemma full_pmdl_UNIV: "full_pmdl UNIV = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_pmdl UNIV = UNIV
[PROOF STEP]
by (simp add: full_pmdl_def)


[STATEMENT]
lemma obj_abs_subst_comm: assumes "f o f \<equiv> id" and "g o g \<equiv> id" and "f o g \<equiv> g o f"
  shows "(\<lambda>x. F (f (g x))) o (f o g) \<equiv> (\<lambda>x. F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. F (f (g x))) \<circ> (f \<circ> g) \<equiv> F
[PROOF STEP]
unfolding \<open>f o g \<equiv> g o f\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. F (f (g x))) \<circ> (g \<circ> f) \<equiv> F
[PROOF STEP]
unfolding comp_assoc[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. F (f (g x))) \<circ> g \<circ> f \<equiv> F
[PROOF STEP]
unfolding obj_abs_subst[OF \<open>g o g \<equiv> id\<close>, of "\<lambda>x. F (f x)"] obj_abs_subst[OF \<open>f o f \<equiv> id\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<equiv> F
[PROOF STEP]
.