[STATEMENT]
lemma pderiv_exp_prod:
  "pderiv p = (prod (\<lambda> (a,i). a ^ i) as * sum (\<lambda> (a,i).
    prod (\<lambda> (b,j). b) (as - {(a,i)}) * smult (of_nat (Suc i)) (pderiv a)) as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv p = (\<Prod>(a, i)\<in>as. a ^ i) * (\<Sum>(a, i)\<in>as. (\<Prod>(b, j)\<in>as - {(a, i)}. b) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
unfolding p pderiv_prod sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>as. (\<Prod>(a, i)\<in>as - {a}. a ^ Suc i) * pderiv (case a of (a, i) \<Rightarrow> a ^ Suc i)) = (\<Sum>n\<in>as. (\<Prod>(x, y)\<in>as. x ^ y) * (case n of (a, i) \<Rightarrow> (\<Prod>(b, j)\<in>as - {(a, i)}. b) * smult (of_nat (Suc i)) (pderiv a)))
[PROOF STEP]
proof (rule sum.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> as \<Longrightarrow> (\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) = (\<Prod>(x, y)\<in>as. x ^ y) * (case x of (a, i) \<Rightarrow> (\<Prod>(b, j)\<in>as - {(a, i)}. b) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> as \<Longrightarrow> (\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) = (\<Prod>(x, y)\<in>as. x ^ y) * (case x of (a, i) \<Rightarrow> (\<Prod>(b, j)\<in>as - {(a, i)}. b) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
assume "x \<in> as"
[PROOF STATE]
proof (state)
this:
x \<in> as

goal (1 subgoal):
 1. \<And>x. x \<in> as \<Longrightarrow> (\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) = (\<Prod>(x, y)\<in>as. x ^ y) * (case x of (a, i) \<Rightarrow> (\<Prod>(b, j)\<in>as - {(a, i)}. b) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> as
[PROOF STEP]
obtain a i where x: "x = (a,i)" and mem: "(a,i) \<in> as"
[PROOF STATE]
proof (prove)
using this:
x \<in> as

goal (1 subgoal):
 1. (\<And>a i. \<lbrakk>x = (a, i); (a, i) \<in> as\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases x, auto)
[PROOF STATE]
proof (state)
this:
x = (a, i)
(a, i) \<in> as

goal (1 subgoal):
 1. \<And>x. x \<in> as \<Longrightarrow> (\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) = (\<Prod>(x, y)\<in>as. x ^ y) * (case x of (a, i) \<Rightarrow> (\<Prod>(b, j)\<in>as - {(a, i)}. b) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
let ?si = "smult (of_nat (Suc i)) :: 'a poly \<Rightarrow> 'a poly"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> as \<Longrightarrow> (\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) = (\<Prod>(x, y)\<in>as. x ^ y) * (case x of (a, i) \<Rightarrow> (\<Prod>(b, j)\<in>as - {(a, i)}. b) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
show "(\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) =
         (\<Prod>(a, i)\<in>as. a ^ i) *
         (case x of (a, i) \<Rightarrow> (\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) = (\<Prod>(a, i)\<in>as. a ^ i) * (case x of (a, i) \<Rightarrow> (\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
unfolding x split pderiv_power_Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
let ?prod = "\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
let ?l = "?prod * (?si (a ^ i) * pderiv a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
let ?r = "(\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * ?si (pderiv a))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
have "?r = a ^ i * ((\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a) * ?si (pderiv a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a)) = a ^ i * ((\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
unfolding prod.remove[OF fin mem]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (a, i) of (x, xa) \<Rightarrow> x ^ xa) * (\<Prod>(x, y)\<in>as - {(a, i)}. x ^ y) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a)) = a ^ i * ((\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
(\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a)) = a ^ i * ((\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))

goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a)) = a ^ i * ((\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))

goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
have "(\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a)
      = ?prod"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a) = (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i)
[PROOF STEP]
unfolding prod.distrib[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>as - {(a, i)}. (case x of (x, xa) \<Rightarrow> x ^ xa) * (case x of (a, i) \<Rightarrow> a)) = (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i)
[PROOF STEP]
by (rule prod.cong[OF refl], auto)
[PROOF STATE]
proof (state)
this:
(\<Prod>(a, i)\<in>as - {(a, i)}. a ^ i) * (\<Prod>(a, i)\<in>as - {(a, i)}. a) = (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i)

goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>a\<in>as. case a of (a, i) \<Rightarrow> a ^ i) * ((\<Prod>a\<in>as - {(a, i)}. case a of (a, i) \<Rightarrow> a) * smult (of_nat (Suc i)) (pderiv a)) = a ^ i * ((\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
show "?l = ?r"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>a\<in>as. case a of (a, i) \<Rightarrow> a ^ i) * ((\<Prod>a\<in>as - {(a, i)}. case a of (a, i) \<Rightarrow> a) * smult (of_nat (Suc i)) (pderiv a)) = a ^ i * ((\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * smult (of_nat (Suc i)) (pderiv a))

goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
(\<Prod>(a, i)\<in>as - {(a, i)}. a ^ Suc i) * (smult (of_nat (Suc i)) (a ^ i) * pderiv a) = (\<Prod>(a, i)\<in>as. a ^ i) * ((\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Prod>(a, i)\<in>as - {x}. a ^ Suc i) * pderiv (case x of (a, i) \<Rightarrow> a ^ Suc i) = (\<Prod>(a, i)\<in>as. a ^ i) * (case x of (a, i) \<Rightarrow> (\<Prod>(a, i)\<in>as - {(a, i)}. a) * smult (of_nat (Suc i)) (pderiv a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma evalS_append: "evalS M phi (Gamma @ Delta) = (evalS M phi Gamma | evalS M phi Delta)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evalS M phi (Gamma @ Delta) = (evalS M phi Gamma \<or> evalS M phi Delta)
[PROOF STEP]
by(force simp add: evalS_def)


[STATEMENT]
lemma set_Times_plus_distrib: \<open>(A \<times> B) + (C \<times> D) = (A + C) \<times> (B + D)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> B + C \<times> D = (A + C) \<times> (B + D)
[PROOF STEP]
by (auto simp: Sigma_def set_plus_def)


[STATEMENT]
lemma pairs_sup_closed:
  assumes "(x,y) \<in> pairs"
      and "(z,w) \<in> pairs"
    shows "pairs_sup (x,y) (z,w) \<in> pairs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> pairs
(z, w) \<in> pairs
[PROOF STEP]
obtain u v where "y = phi (-x) \<squnion> up_filter u \<and> w = phi (-z) \<squnion> up_filter v"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> pairs
(z, w) \<in> pairs

goal (1 subgoal):
 1. (\<And>u v. y = phi (- x) \<squnion> up_filter u \<and> w = phi (- z) \<squnion> up_filter v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using pairs_def
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> pairs
(z, w) \<in> pairs
pairs = {(x, y). \<exists>z. y = phi (- x) \<squnion> up_filter z}

goal (1 subgoal):
 1. (\<And>u v. y = phi (- x) \<squnion> up_filter u \<and> w = phi (- z) \<squnion> up_filter v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = phi (- x) \<squnion> up_filter u \<and> w = phi (- z) \<squnion> up_filter v

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
hence "pairs_sup (x,y) (z,w) = (x \<squnion> z,(phi (-x) \<squnion> up_filter u) \<sqinter> (phi (-z) \<squnion> up_filter v))"
[PROOF STATE]
proof (prove)
using this:
y = phi (- x) \<squnion> up_filter u \<and> w = phi (- z) \<squnion> up_filter v

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) = (x \<squnion> z, (phi (- x) \<squnion> up_filter u) \<sqinter> (phi (- z) \<squnion> up_filter v))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pairs_sup (x, y) (z, w) = (x \<squnion> z, (phi (- x) \<squnion> up_filter u) \<sqinter> (phi (- z) \<squnion> up_filter v))

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pairs_sup (x, y) (z, w) = (x \<squnion> z, (phi (- x) \<squnion> up_filter u) \<sqinter> (phi (- z) \<squnion> up_filter v))

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
have "... = (x \<squnion> z,(phi (-x) \<sqinter> phi (-z)) \<squnion> (phi (-x) \<sqinter> up_filter v) \<squnion> (up_filter u \<sqinter> phi (-z)) \<squnion> (up_filter u \<sqinter> up_filter v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> z, (phi (- x) \<squnion> up_filter u) \<sqinter> (phi (- z) \<squnion> up_filter v)) = (x \<squnion> z, phi (- x) \<sqinter> phi (- z) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v)
[PROOF STEP]
by (simp add: inf.sup_commute inf_sup_distrib1 sup_commute sup_left_commute)
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, (phi (- x) \<squnion> up_filter u) \<sqinter> (phi (- z) \<squnion> up_filter v)) = (x \<squnion> z, phi (- x) \<sqinter> phi (- z) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v)

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, (phi (- x) \<squnion> up_filter u) \<sqinter> (phi (- z) \<squnion> up_filter v)) = (x \<squnion> z, phi (- x) \<sqinter> phi (- z) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v)

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
have "... = (x \<squnion> z,phi (-(x \<squnion> z)) \<squnion> (phi (-x) \<sqinter> up_filter v) \<squnion> (up_filter u \<sqinter> phi (-z)) \<squnion> (up_filter u \<sqinter> up_filter v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> z, phi (- x) \<sqinter> phi (- z) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v)
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
bounded_lattice_homomorphism phi

goal (1 subgoal):
 1. (x \<squnion> z, phi (- x) \<sqinter> phi (- z) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, phi (- x) \<sqinter> phi (- z) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v)

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, phi (- x) \<sqinter> phi (- z) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v)

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
have "... = (x \<squnion> z,phi (-(x \<squnion> z)) \<squnion> up_filter (rho (-x) v) \<squnion> up_filter (rho (-z) u) \<squnion> (up_filter u \<sqinter> up_filter v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter u \<sqinter> up_filter v)
[PROOF STEP]
by (metis inf.sup_commute rho_char)
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter u \<sqinter> up_filter v)

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> phi (- x) \<sqinter> up_filter v \<squnion> up_filter u \<sqinter> phi (- z) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter u \<sqinter> up_filter v)

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
have "... = (x \<squnion> z,phi (-(x \<squnion> z)) \<squnion> up_filter (rho (-x) v) \<squnion> up_filter (rho (-z) u) \<squnion> up_filter (u \<squnion> v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter (u \<squnion> v))
[PROOF STEP]
by (metis up_filter_dist_sup)
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter (u \<squnion> v))

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter u \<sqinter> up_filter v) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter (u \<squnion> v))

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
have "... = (x \<squnion> z,phi (-(x \<squnion> z)) \<squnion> up_filter (rho (-x) v \<sqinter> rho (-z) u \<sqinter> (u \<squnion> v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter (u \<squnion> v)) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v \<sqinter> rho (- z) u \<sqinter> (u \<squnion> v)))
[PROOF STEP]
by (simp add: sup_commute sup_left_commute up_filter_dist_inf)
[PROOF STATE]
proof (state)
this:
(x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v) \<squnion> up_filter (rho (- z) u) \<squnion> up_filter (u \<squnion> v)) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v \<sqinter> rho (- z) u \<sqinter> (u \<squnion> v)))

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pairs_sup (x, y) (z, w) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v \<sqinter> rho (- z) u \<sqinter> (u \<squnion> v)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pairs_sup (x, y) (z, w) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v \<sqinter> rho (- z) u \<sqinter> (u \<squnion> v)))

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
using pairs_def
[PROOF STATE]
proof (prove)
using this:
pairs_sup (x, y) (z, w) = (x \<squnion> z, phi (- (x \<squnion> z)) \<squnion> up_filter (rho (- x) v \<sqinter> rho (- z) u \<sqinter> (u \<squnion> v)))
pairs = {(x, y). \<exists>z. y = phi (- x) \<squnion> up_filter z}

goal (1 subgoal):
 1. pairs_sup (x, y) (z, w) \<in> pairs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pairs_sup (x, y) (z, w) \<in> pairs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_residue_times_deriv:
  "fls_residue (fls_deriv f * g) = - fls_residue (f * fls_deriv g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_residue (fls_deriv f * g) = - fls_residue (f * fls_deriv g)
[PROOF STEP]
using fls_residue_deriv[of "f*g"] minus_unique[of "fls_residue (f * fls_deriv g)"]
[PROOF STATE]
proof (prove)
using this:
fls_residue (fls_deriv (f * g)) = (0::'a)
fls_residue (f * fls_deriv g) + ?b = (0::'a) \<Longrightarrow> - fls_residue (f * fls_deriv g) = ?b

goal (1 subgoal):
 1. fls_residue (fls_deriv f * g) = - fls_residue (f * fls_deriv g)
[PROOF STEP]
by    simp


[STATEMENT]
lemma add_equal_means_equal:
assumes "\<Gamma> \<oplus> A = \<Delta> \<oplus> A"
shows "\<Gamma> = \<Delta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma> = \<Delta>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma> = \<Delta>
[PROOF STEP]
from assms and add_eq_conv_diff[where M=\<Gamma> and N=\<Delta> and a=A and b=A]
[PROOF STATE]
proof (chain)
picking this:
\<Gamma> \<oplus> A = \<Delta> \<oplus> A
(add_mset A \<Gamma> = add_mset A \<Delta>) = (\<Gamma> = \<Delta> \<and> A = A \<or> \<Gamma> = add_mset A (\<Delta> \<ominus> A) \<and> \<Delta> = add_mset A (\<Gamma> \<ominus> A))
[PROOF STEP]
show "\<Gamma> = \<Delta>"
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<oplus> A = \<Delta> \<oplus> A
(add_mset A \<Gamma> = add_mset A \<Delta>) = (\<Gamma> = \<Delta> \<and> A = A \<or> \<Gamma> = add_mset A (\<Delta> \<ominus> A) \<and> \<Delta> = add_mset A (\<Gamma> \<ominus> A))

goal (1 subgoal):
 1. \<Gamma> = \<Delta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Gamma> = \<Delta>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSBseq_isLub: "NSBseq X \<Longrightarrow> \<exists>U::real. isLub UNIV {x. \<exists>n. X n = x} U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSBseq X \<Longrightarrow> \<exists>U. isLub UNIV {x. \<exists>n. X n = x} U
[PROOF STEP]
by (simp add: Bseq_NSBseq_iff [symmetric] Bseq_isLub)


[STATEMENT]
lemma recvupd_preserves_InvInfoJustifiedWithII:
  assumes "InvInfoJustifiedWithII c0"
    and   "next_recvupd' c0 c1 p q"
  shows   "InvInfoJustifiedWithII c1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. InvInfoJustifiedWithII c1
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
InvInfoJustifiedWithII c0

goal (1 subgoal):
 1. InvInfoJustifiedWithII c1
[PROOF STEP]
unfolding
    InvInfoJustifiedWithII_def
    next_recvupd_complexD[OF assms(2)]
    next_recvupdD[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<forall>k p q. justified_with (c_caps c0 p) (InfoAt c0 k p q) (IncomingInfo c0 (k + 1) p q)

goal (1 subgoal):
 1. \<forall>k pa qa. justified_with (c_caps c0 pa) (if pa = p \<and> qa = q then InfoAt c0 (k + 1) p q else InfoAt c0 k pa qa) (if pa = p \<and> qa = q then IncomingInfo c0 (k + 1 + 1) pa qa else IncomingInfo c0 (k + 1) pa qa)
[PROOF STEP]
by auto


[STATEMENT]
lemma permutations_of_set_infinite:
  "\<not>finite A \<Longrightarrow> permutations_of_set A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> permutations_of_set A = {}
[PROOF STEP]
by (auto simp: permutations_of_set_def)


[STATEMENT]
lemma one_eq_Numeral1_nat: "(1::nat) = Numeral1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = Numeral1
[PROOF STEP]
by simp


[STATEMENT]
lemma semigroup_add_ow: "class.semigroup_add = semigroup_add_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.semigroup_add = semigroup_add_ow UNIV
[PROOF STEP]
unfolding
    class.semigroup_add_def semigroup_add_ow_def
    semigroup_add_ow_axioms_def plus_ow_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>plus. \<forall>a b c. plus (plus a b) c = plus a (plus b c)) = (\<lambda>plus. (\<forall>a b. a \<in> UNIV \<longrightarrow> b \<in> UNIV \<longrightarrow> plus a b \<in> UNIV) \<and> (\<forall>a b c. a \<in> UNIV \<longrightarrow> b \<in> UNIV \<longrightarrow> c \<in> UNIV \<longrightarrow> plus (plus a b) c = plus a (plus b c)))
[PROOF STEP]
by simp


[STATEMENT]
lemma DW_valid:"valid DWaxiom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid DWaxiom
[PROOF STEP]
apply(unfold DWaxiom_def valid_def Let_def impl_sem )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>I \<nu>. is_interp I \<longrightarrow> \<nu> \<in> fml_sem I ([[EvolveODE (OVar vid1) (Pc pid1)]]Pc pid1)
[PROOF STEP]
apply(safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I a b. is_interp I \<Longrightarrow> (a, b) \<in> fml_sem I ([[EvolveODE (OVar vid1) (Pc pid1)]]Pc pid1)
[PROOF STEP]
apply(auto simp only: fml_sem.simps prog_sem.simps box_sem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I aa ba ab bb sol t. \<lbrakk>is_interp I; 0 \<le> t; (aa, ba) = mk_v I (OVar vid1) (ab, bb) (sol t); (sol solves_ode (\<lambda>_. ODE_sem I (OVar vid1))) {0..t} {x. mk_v I (OVar vid1) (ab, bb) x \<in> fml_sem I (Pc pid1)}; sol 0 = fst (ab, bb)\<rbrakk> \<Longrightarrow> mk_v I (OVar vid1) (ab, bb) (sol t) \<in> fml_sem I (Pc pid1)
[PROOF STEP]
subgoal for I aa ba ab bb sol t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_interp I; 0 \<le> t; (aa, ba) = mk_v I (OVar vid1) (ab, bb) (sol t); (sol solves_ode (\<lambda>_. ODE_sem I (OVar vid1))) {0..t} {x. mk_v I (OVar vid1) (ab, bb) x \<in> fml_sem I (Pc pid1)}; sol 0 = fst (ab, bb)\<rbrakk> \<Longrightarrow> mk_v I (OVar vid1) (ab, bb) (sol t) \<in> fml_sem I (Pc pid1)
[PROOF STEP]
using mk_v_agree[of I "(OVar vid1)" "(ab,bb)" "sol t"]
    Vagree_univ[of "aa" "ba" "sol t" "ODEs I vid1 (sol t)"] solves_ode_domainD
[PROOF STATE]
proof (prove)
using this:
Vagree (mk_v I (OVar vid1) (ab, bb) (sol t)) (ab, bb) (- semBV I (OVar vid1)) \<and> Vagree (mk_v I (OVar vid1) (ab, bb) (sol t)) (mk_xode I (OVar vid1) (sol t)) (semBV I (OVar vid1))
Vagree (aa, ba) (sol t, ODEs I vid1 (sol t)) UNIV \<Longrightarrow> aa = sol t \<and> ba = ODEs I vid1 (sol t)
\<lbrakk>(?y solves_ode ?f) ?T ?X; ?t \<in> ?T\<rbrakk> \<Longrightarrow> ?y ?t \<in> ?X

goal (1 subgoal):
 1. \<lbrakk>is_interp I; 0 \<le> t; (aa, ba) = mk_v I (OVar vid1) (ab, bb) (sol t); (sol solves_ode (\<lambda>_. ODE_sem I (OVar vid1))) {0..t} {x. mk_v I (OVar vid1) (ab, bb) x \<in> fml_sem I (Pc pid1)}; sol 0 = fst (ab, bb)\<rbrakk> \<Longrightarrow> mk_v I (OVar vid1) (ab, bb) (sol t) \<in> fml_sem I (Pc pid1)
[PROOF STEP]
by (fastforce)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_nat_dvd_of_nat:
  assumes "a dvd b"
  shows   "of_nat a dvd (of_nat b :: 'a :: comm_semiring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat a dvd of_nat b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a dvd b

goal (1 subgoal):
 1. of_nat a dvd of_nat b
[PROOF STEP]
by auto


[STATEMENT]
theorem WS_is_weak_sim:"is_weak_sim (WS S) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_weak_sim (WS S) S
[PROOF STEP]
by(fastforce elim:WS_weak_sim simp:is_weak_sim_def)


[STATEMENT]
lemma pre_zeta_bound':
  assumes "0 < Re s" and a: "a > 0"
  shows   "norm (pre_zeta a s) \<le> norm s / (Re s * a powr Re s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < Re s
0 < a
[PROOF STEP]
have "norm (pre_zeta a s) \<le> (1 + norm s / Re s) / 2 * a powr -Re s"
[PROOF STATE]
proof (prove)
using this:
0 < Re s
0 < a

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> (1 + cmod s / Re s) / 2 * a powr - Re s
[PROOF STEP]
by (intro pre_zeta_bound) auto
[PROOF STATE]
proof (state)
this:
cmod (pre_zeta a s) \<le> (1 + cmod s / Re s) / 2 * a powr - Re s

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (pre_zeta a s) \<le> (1 + cmod s / Re s) / 2 * a powr - Re s

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
have "\<dots> = (Re s + norm s) / 2 / (Re s * a powr Re s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + cmod s / Re s) / 2 * a powr - Re s = (Re s + cmod s) / 2 / (Re s * a powr Re s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < Re s
0 < a

goal (1 subgoal):
 1. (1 + cmod s / Re s) / 2 * a powr - Re s = (Re s + cmod s) / 2 / (Re s * a powr Re s)
[PROOF STEP]
by (auto simp: field_simps powr_minus)
[PROOF STATE]
proof (state)
this:
(1 + cmod s / Re s) / 2 * a powr - Re s = (Re s + cmod s) / 2 / (Re s * a powr Re s)

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 + cmod s / Re s) / 2 * a powr - Re s = (Re s + cmod s) / 2 / (Re s * a powr Re s)

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
have "Re s + norm s \<le> norm s + norm s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re s + cmod s \<le> cmod s + cmod s
[PROOF STEP]
by (intro add_right_mono complex_Re_le_cmod)
[PROOF STATE]
proof (state)
this:
Re s + cmod s \<le> cmod s + cmod s

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re s + cmod s \<le> cmod s + cmod s

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
have "(norm s + norm s) / 2 = norm s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod s + cmod s) / 2 = cmod s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(cmod s + cmod s) / 2 = cmod s

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> x / 2 / (Re s * a powr Re s) \<le> y / 2 / (Re s * a powr Re s)) \<Longrightarrow> cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
show "norm (pre_zeta a s) \<le> norm s / (Re s * a powr Re s)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x / 2 / (Re s * a powr Re s) \<le> y / 2 / (Re s * a powr Re s)) \<Longrightarrow> cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x / 2 / (Re s * a powr Re s) \<le> y / 2 / (Re s * a powr Re s)) \<Longrightarrow> cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
0 < Re s
0 < a

goal (1 subgoal):
 1. cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)
[PROOF STEP]
by (simp add: divide_right_mono)
[PROOF STATE]
proof (state)
this:
cmod (pre_zeta a s) \<le> cmod s / (Re s * a powr Re s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ccsubspace_scaleC_invariant[simp]: "a \<noteq> 0 \<Longrightarrow> a *\<^sub>C S = S" for S :: "_ ccsubspace"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> a *\<^sub>C S = S
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a S. \<lbrakk>a \<noteq> 0; closed_csubspace S\<rbrakk> \<Longrightarrow> (*\<^sub>C) a ` S = S
[PROOF STEP]
by (simp add: closed_csubspace.subspace csubspace_scaleC_invariant)


[STATEMENT]
lemma hcard_0 [simp]: "hcard 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hcard 0 = 0
[PROOF STEP]
by (simp add: hcard_def)


[STATEMENT]
lemma convex_onD_Icc':
  assumes "convex_on {x..y} f" "c \<in> {x..y}"
  defines "d \<equiv> y - x"
  shows "f c \<le> (f y - f x) / d * (c - x) + f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
proof (cases x y rule: linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
x < y

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < y
[PROOF STEP]
have d: "d > 0"
[PROOF STATE]
proof (prove)
using this:
x < y

goal (1 subgoal):
 1. 0 < d
[PROOF STEP]
by (simp add: d_def)
[PROOF STATE]
proof (state)
this:
0 < d

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
from assms(2) less
[PROOF STATE]
proof (chain)
picking this:
c \<in> {x..y}
x < y
[PROOF STEP]
have A: "0 \<le> (c - x) / d" "(c - x) / d \<le> 1"
[PROOF STATE]
proof (prove)
using this:
c \<in> {x..y}
x < y

goal (1 subgoal):
 1. 0 \<le> (c - x) / d &&& (c - x) / d \<le> 1
[PROOF STEP]
by (simp_all add: d_def field_split_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> (c - x) / d
(c - x) / d \<le> 1

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
have "f c = f (x + (c - x) * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f c = f (x + (c - x) * 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f c = f (x + (c - x) * 1)

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f c = f (x + (c - x) * 1)

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
from less
[PROOF STATE]
proof (chain)
picking this:
x < y
[PROOF STEP]
have "1 = ((y - x) / d)"
[PROOF STATE]
proof (prove)
using this:
x < y

goal (1 subgoal):
 1. 1 = (y - x) / d
[PROOF STEP]
by (simp add: d_def)
[PROOF STATE]
proof (state)
this:
1 = (y - x) / d

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = (y - x) / d

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
from d
[PROOF STATE]
proof (chain)
picking this:
0 < d
[PROOF STEP]
have "x + (c - x) * \<dots> = (1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y"
[PROOF STATE]
proof (prove)
using this:
0 < d

goal (1 subgoal):
 1. x + (c - x) * ((y - x) / d) = (1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x + (c - x) * ((y - x) / d) = (1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + (c - x) * ((y - x) / d) = (1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
have "f \<dots> \<le> (1 - (c - x) / d) * f x + (c - x) / d * f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ((1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y) \<le> (1 - (c - x) / d) * f x + (c - x) / d * f y
[PROOF STEP]
using assms less
[PROOF STATE]
proof (prove)
using this:
convex_on {x..y} f
c \<in> {x..y}
d \<equiv> y - x
x < y

goal (1 subgoal):
 1. f ((1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y) \<le> (1 - (c - x) / d) * f x + (c - x) / d * f y
[PROOF STEP]
by (intro convex_onD_Icc) simp_all
[PROOF STATE]
proof (state)
this:
f ((1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y) \<le> (1 - (c - x) / d) * f x + (c - x) / d * f y

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f ((1 - (c - x) / d) *\<^sub>R x + ((c - x) / d) *\<^sub>R y) \<le> (1 - (c - x) / d) * f x + (c - x) / d * f y

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
from d
[PROOF STATE]
proof (chain)
picking this:
0 < d
[PROOF STEP]
have "\<dots> = (f y - f x) / d * (c - x) + f x"
[PROOF STATE]
proof (prove)
using this:
0 < d

goal (1 subgoal):
 1. (1 - (c - x) / d) * f x + (c - x) / d * f y = (f y - f x) / d * (c - x) + f x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(1 - (c - x) / d) * f x + (c - x) / d * f y = (f y - f x) / d * (c - x) + f x

goal (3 subgoals):
 1. x < y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 3. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f c \<le> (f y - f x) / d * (c - x) + f x

goal (1 subgoal):
 1. f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f c \<le> (f y - f x) / d * (c - x) + f x

goal (2 subgoals):
 1. x = y \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
 2. y < x \<Longrightarrow> f c \<le> (f y - f x) / d * (c - x) + f x
[PROOF STEP]
qed (insert assms(2), simp_all)


[STATEMENT]
lemma functions_of_is_surj_on:
  assumes "finite A"
  assumes "size M = card A" "set_mset M = B"
  shows "univ (\<lambda>f. f ` A = B) (functions_of A M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of A M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of A M)
[PROOF STEP]
have "functions_of A M \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. functions_of A M \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B
[PROOF STEP]
using functions_of \<open>finite A\<close> \<open>size M = card A\<close> \<open>set_mset M = B\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; set_mset ?M \<subseteq> ?B; size ?M = card ?A\<rbrakk> \<Longrightarrow> functions_of ?A ?M \<in> (?A \<rightarrow>\<^sub>E ?B) // domain_permutation ?A ?B
finite A
size M = card A
set_mset M = B

goal (1 subgoal):
 1. functions_of A M \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
functions_of A M \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of A M)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
functions_of A M \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B
[PROOF STEP]
obtain f where eq_f: "functions_of A M = domain_permutation A B `` {f}" and "f \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
using this:
functions_of A M \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>functions_of A M = domain_permutation A B `` {f}; f \<in> A \<rightarrow>\<^sub>E B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using quotientE
[PROOF STATE]
proof (prove)
using this:
functions_of A M \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B
\<lbrakk>?X \<in> ?A // ?r; \<And>x. \<lbrakk>?X = ?r `` {x}; x \<in> ?A\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>functions_of A M = domain_permutation A B `` {f}; f \<in> A \<rightarrow>\<^sub>E B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
functions_of A M = domain_permutation A B `` {f}
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of A M)
[PROOF STEP]
from eq_f
[PROOF STATE]
proof (chain)
picking this:
functions_of A M = domain_permutation A B `` {f}
[PROOF STEP]
have "f \<in> functions_of A M"
[PROOF STATE]
proof (prove)
using this:
functions_of A M = domain_permutation A B `` {f}

goal (1 subgoal):
 1. f \<in> functions_of A M
[PROOF STEP]
using \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> equiv_domain_permutation equiv_class_self
[PROOF STATE]
proof (prove)
using this:
functions_of A M = domain_permutation A B `` {f}
f \<in> A \<rightarrow>\<^sub>E B
equiv (?A \<rightarrow>\<^sub>E ?B) (domain_permutation ?A ?B)
\<lbrakk>equiv ?A ?r; ?a \<in> ?A\<rbrakk> \<Longrightarrow> ?a \<in> ?r `` {?a}

goal (1 subgoal):
 1. f \<in> functions_of A M
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f \<in> functions_of A M

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of A M)
[PROOF STEP]
have "f ` A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
using \<open>f \<in> functions_of A M\<close> assms set_mset_eq_implies_surj_on
[PROOF STATE]
proof (prove)
using this:
f \<in> functions_of A M
finite A
size M = card A
set_mset M = B
\<lbrakk>finite ?A; size ?M = card ?A; set_mset ?M = ?B; ?f \<in> functions_of ?A ?M\<rbrakk> \<Longrightarrow> ?f ` ?A = ?B

goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of A M)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f ` A = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of A M)
[PROOF STEP]
unfolding eq_f
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (domain_permutation A B `` {f})
[PROOF STEP]
using equiv_domain_permutation surjective_respects_domain_permutation \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (prove)
using this:
f ` A = B
equiv (?A \<rightarrow>\<^sub>E ?B) (domain_permutation ?A ?B)
(\<lambda>f. f ` ?A = ?B) respects domain_permutation ?A ?B
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (domain_permutation A B `` {f})
[PROOF STEP]
by (subst univ_commute') assumption+
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. f ` A = B) (functions_of A M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_compose_Pair:
  assumes f: "continuous_on (Sigma A B) (\<lambda>(a, b). f a b)"
  assumes g: "continuous_on C g"
  assumes h: "continuous_on C h"
  assumes subset: "\<And>c. c \<in> C \<Longrightarrow> g c \<in> A" "\<And>c. c \<in> C \<Longrightarrow> h c \<in> B (g c)"
  shows "continuous_on C (\<lambda>c. f (g c) (h c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
using continuous_on_compose2[OF f continuous_on_Pair[OF g h]] subset
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g x, h x)) ` C \<subseteq> Sigma A B \<Longrightarrow> continuous_on C (\<lambda>x. case (g x, h x) of (a, b) \<Rightarrow> f a b)
?c \<in> C \<Longrightarrow> g ?c \<in> A
?c \<in> C \<Longrightarrow> h ?c \<in> B (g ?c)

goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
by auto


[STATEMENT]
lemma interior_standard_hyperplane:
   "interior {x :: (real^'n). x$k = a} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior {x. x $ k = a} = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior {x. x $ k = a} = {}
[PROOF STEP]
have "axis k (1::real) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. axis k 1 \<noteq> 0
[PROOF STEP]
by (simp add: axis_def vec_eq_iff)
[PROOF STATE]
proof (state)
this:
axis k 1 \<noteq> 0

goal (1 subgoal):
 1. interior {x. x $ k = a} = {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
axis k 1 \<noteq> 0

goal (1 subgoal):
 1. interior {x. x $ k = a} = {}
[PROOF STEP]
have "axis k (1::real) \<bullet> x = x$k" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. axis k 1 \<bullet> x = x $ k
[PROOF STEP]
by (simp add: cart_eq_inner_axis inner_commute)
[PROOF STATE]
proof (state)
this:
axis k 1 \<bullet> ?x = ?x $ k

goal (1 subgoal):
 1. interior {x. x $ k = a} = {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k

goal (1 subgoal):
 1. interior {x. x $ k = a} = {}
[PROOF STEP]
using interior_hyperplane [of "axis k (1::real)" a]
[PROOF STATE]
proof (prove)
using this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k
axis k 1 \<noteq> 0 \<Longrightarrow> interior {x. axis k 1 \<bullet> x = a} = {}

goal (1 subgoal):
 1. interior {x. x $ k = a} = {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
interior {x. x $ k = a} = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Rats_abs_nat_div_natE:
  assumes "x \<in> \<rat>"
  obtains m n :: nat where "n \<noteq> 0" and "\<bar>x\<bar> = real m / real n" and "coprime m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from \<open>x \<in> \<rat>\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<rat>
[PROOF STEP]
obtain i :: int and n :: nat where "n \<noteq> 0" and "x = real_of_int i / real n"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<rat>

goal (1 subgoal):
 1. (\<And>n i. \<lbrakk>n \<noteq> 0; x = real_of_int i / real n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: Rats_eq_int_div_nat)
[PROOF STATE]
proof (state)
this:
n \<noteq> 0
x = real_of_int i / real n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
x = real_of_int i / real n
[PROOF STEP]
have "\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
x = real_of_int i / real n

goal (1 subgoal):
 1. \<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n
[PROOF STEP]
obtain m :: nat where x_rat: "\<bar>x\<bar> = real m / real n"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n

goal (1 subgoal):
 1. (\<And>m. \<bar>x\<bar> = real m / real n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real m / real n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?gcd = "gcd m n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from \<open>n \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have gcd: "?gcd \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. gcd m n \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd m n \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?k = "m div ?gcd"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?l = "n div ?gcd"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?gcd' = "gcd ?k ?l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "?gcd dvd m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m n dvd m
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
gcd m n dvd m

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd m n dvd m
[PROOF STEP]
have gcd_k: "?gcd * ?k = m"
[PROOF STATE]
proof (prove)
using this:
gcd m n dvd m

goal (1 subgoal):
 1. gcd m n * (m div gcd m n) = m
[PROOF STEP]
by (rule dvd_mult_div_cancel)
[PROOF STATE]
proof (state)
this:
gcd m n * (m div gcd m n) = m

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "?gcd dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m n dvd n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
gcd m n dvd n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd m n dvd n
[PROOF STEP]
have gcd_l: "?gcd * ?l = n"
[PROOF STATE]
proof (prove)
using this:
gcd m n dvd n

goal (1 subgoal):
 1. gcd m n * (n div gcd m n) = n
[PROOF STEP]
by (rule dvd_mult_div_cancel)
[PROOF STATE]
proof (state)
this:
gcd m n * (n div gcd m n) = n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from \<open>n \<noteq> 0\<close> and gcd_l
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
gcd m n * (n div gcd m n) = n
[PROOF STEP]
have "?gcd * ?l \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
gcd m n * (n div gcd m n) = n

goal (1 subgoal):
 1. gcd m n * (n div gcd m n) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd m n * (n div gcd m n) \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd m n * (n div gcd m n) \<noteq> 0
[PROOF STEP]
have "?l \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
gcd m n * (n div gcd m n) \<noteq> 0

goal (1 subgoal):
 1. n div gcd m n \<noteq> 0
[PROOF STEP]
by (blast dest!: mult_not_zero)
[PROOF STATE]
proof (state)
this:
n div gcd m n \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n div gcd m n \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<bar>x\<bar> = real ?k / real ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
from gcd
[PROOF STATE]
proof (chain)
picking this:
gcd m n \<noteq> 0
[PROOF STEP]
have "real ?k / real ?l = real (?gcd * ?k) / real (?gcd * ?l)"
[PROOF STATE]
proof (prove)
using this:
gcd m n \<noteq> 0

goal (1 subgoal):
 1. real (m div gcd m n) / real (n div gcd m n) = real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n))
[PROOF STEP]
by (simp add: real_of_nat_div)
[PROOF STATE]
proof (state)
this:
real (m div gcd m n) / real (n div gcd m n) = real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n))

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (m div gcd m n) / real (n div gcd m n) = real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n))

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
from gcd_k and gcd_l
[PROOF STATE]
proof (chain)
picking this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n
[PROOF STEP]
have "\<dots> = real m / real n"
[PROOF STATE]
proof (prove)
using this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n

goal (1 subgoal):
 1. real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n)) = real m / real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n)) = real m / real n

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n)) = real m / real n

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
from x_rat
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> = real m / real n
[PROOF STEP]
have "\<dots> = \<bar>x\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> = real m / real n

goal (1 subgoal):
 1. real m / real n = \<bar>x\<bar>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
real m / real n = \<bar>x\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (m div gcd m n) / real (n div gcd m n) = \<bar>x\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (m div gcd m n) / real (n div gcd m n) = \<bar>x\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "?gcd' = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
have "?gcd * ?gcd' = gcd (?gcd * ?k) (?gcd * ?l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))
[PROOF STEP]
by (rule gcd_mult_distrib_nat)
[PROOF STATE]
proof (state)
this:
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))

goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
with gcd_k gcd_l
[PROOF STATE]
proof (chain)
picking this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))
[PROOF STEP]
have "?gcd * ?gcd' = ?gcd"
[PROOF STATE]
proof (prove)
using this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))

goal (1 subgoal):
 1. gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd m n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd m n

goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
with gcd
[PROOF STATE]
proof (chain)
picking this:
gcd m n \<noteq> 0
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd m n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gcd m n \<noteq> 0
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd m n

goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd (m div gcd m n) (n div gcd m n) = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
gcd (m div gcd m n) (n div gcd m n) = 1

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
have "coprime ?k ?l"
[PROOF STATE]
proof (prove)
using this:
gcd (m div gcd m n) (n div gcd m n) = 1

goal (1 subgoal):
 1. coprime (m div gcd m n) (n div gcd m n)
[PROOF STEP]
by (simp only: coprime_iff_gcd_eq_1)
[PROOF STATE]
proof (state)
this:
coprime (m div gcd m n) (n div gcd m n)

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n div gcd m n \<noteq> 0
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
coprime (m div gcd m n) (n div gcd m n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n div gcd m n \<noteq> 0
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
coprime (m div gcd m n) (n div gcd m n)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dbm_entry_dbm_min2:
  assumes "dbm_entry_val u None (Some c) (min a b)"
  shows "dbm_entry_val u None (Some c) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dbm_entry_val u None (Some c) b
[PROOF STEP]
using dbm_entry_val_mono_2[folded less_eq, OF assms]
[PROOF STATE]
proof (prove)
using this:
min a b \<le> ?b' \<Longrightarrow> dbm_entry_val u None (Some c) ?b'

goal (1 subgoal):
 1. dbm_entry_val u None (Some c) b
[PROOF STEP]
by auto


[STATEMENT]
lemma support_set:
  assumes "permutation p" shows "set (support p a) = range (\<lambda>i. (p ^^ i) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (support p a) = range (\<lambda>i. (p ^^ i) a)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (support p a) \<subseteq> range (\<lambda>i. (p ^^ i) a)
 2. range (\<lambda>i. (p ^^ i) a) \<subseteq> set (support p a)
[PROOF STEP]
show "set (support p a) \<subseteq> range (\<lambda>i. (p ^^ i) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (support p a) \<subseteq> range (\<lambda>i. (p ^^ i) a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (support p a) \<subseteq> range (\<lambda>i. (p ^^ i) a)

goal (1 subgoal):
 1. range (\<lambda>i. (p ^^ i) a) \<subseteq> set (support p a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. range (\<lambda>i. (p ^^ i) a) \<subseteq> set (support p a)
[PROOF STEP]
show "range (\<lambda>i. (p ^^ i) a) \<subseteq> set (support p a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (\<lambda>i. (p ^^ i) a) \<subseteq> set (support p a)
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. (p ^^ i) a \<in> (\<lambda>x. (p ^^ x) a) ` {0..<least_power p a}
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. (p ^^ i) a \<in> (\<lambda>x. (p ^^ x) a) ` {0..<least_power p a}
[PROOF STEP]
have "(p ^^ i) a = (p ^^ (i mod (least_power p a))) ((p ^^ (i - (i mod (least_power p a)))) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p ^^ i) a = (p ^^ (i mod least_power p a)) ((p ^^ (i - i mod least_power p a)) a)
[PROOF STEP]
by (metis add_diff_inverse_nat funpow_add mod_less_eq_dividend not_le o_apply)
[PROOF STATE]
proof (state)
this:
(p ^^ i) a = (p ^^ (i mod least_power p a)) ((p ^^ (i - i mod least_power p a)) a)

goal (1 subgoal):
 1. \<And>i. (p ^^ i) a \<in> (\<lambda>x. (p ^^ x) a) ` {0..<least_power p a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(p ^^ i) a = (p ^^ (i mod least_power p a)) ((p ^^ (i - i mod least_power p a)) a)

goal (1 subgoal):
 1. \<And>i. (p ^^ i) a \<in> (\<lambda>x. (p ^^ x) a) ` {0..<least_power p a}
[PROOF STEP]
have " ... = (p ^^ (i mod (least_power p a))) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p ^^ (i mod least_power p a)) ((p ^^ (i - i mod least_power p a)) a) = (p ^^ (i mod least_power p a)) a
[PROOF STEP]
using least_power_dvd[OF assms]
[PROOF STATE]
proof (prove)
using this:
(least_power p ?a dvd ?n) = ((p ^^ ?n) ?a = ?a)

goal (1 subgoal):
 1. (p ^^ (i mod least_power p a)) ((p ^^ (i - i mod least_power p a)) a) = (p ^^ (i mod least_power p a)) a
[PROOF STEP]
by (metis dvd_minus_mod)
[PROOF STATE]
proof (state)
this:
(p ^^ (i mod least_power p a)) ((p ^^ (i - i mod least_power p a)) a) = (p ^^ (i mod least_power p a)) a

goal (1 subgoal):
 1. \<And>i. (p ^^ i) a \<in> (\<lambda>x. (p ^^ x) a) ` {0..<least_power p a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(p ^^ (i mod least_power p a)) ((p ^^ (i - i mod least_power p a)) a) = (p ^^ (i mod least_power p a)) a

goal (1 subgoal):
 1. \<And>i. (p ^^ i) a \<in> (\<lambda>x. (p ^^ x) a) ` {0..<least_power p a}
[PROOF STEP]
have " ... \<in> (\<lambda>i. (p ^^ i) a) ` {0..< (least_power p a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p ^^ (i mod least_power p a)) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..<least_power p a}
[PROOF STEP]
using least_power_of_permutation(2)[OF assms]
[PROOF STATE]
proof (prove)
using this:
0 < least_power p ?a

goal (1 subgoal):
 1. (p ^^ (i mod least_power p a)) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..<least_power p a}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(p ^^ (i mod least_power p a)) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..<least_power p a}

goal (1 subgoal):
 1. \<And>i. (p ^^ i) a \<in> (\<lambda>x. (p ^^ x) a) ` {0..<least_power p a}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(p ^^ i) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..<least_power p a}
[PROOF STEP]
show "(p ^^ i) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..< (least_power p a)}"
[PROOF STATE]
proof (prove)
using this:
(p ^^ i) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..<least_power p a}

goal (1 subgoal):
 1. (p ^^ i) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..<least_power p a}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(p ^^ i) a \<in> (\<lambda>i. (p ^^ i) a) ` {0..<least_power p a}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
range (\<lambda>i. (p ^^ i) a) \<subseteq> set (support p a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_sum_le_comp:
  assumes "finite I"
and "\<And>i. i \<in> I \<Longrightarrow> (0::real) \<le> f i"
and "sum f I \<le> c"
shows "\<forall>i \<in> I. f i \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. f i \<le> c
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>i\<in>I. f i \<le> c) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall>i\<in>I. f i \<le> c)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>i\<in>I. f i \<le> c)

goal (1 subgoal):
 1. \<not> (\<forall>i\<in>I. f i \<le> c) \<Longrightarrow> False
[PROOF STEP]
hence "\<exists>j\<in> I. c < f j"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>i\<in>I. f i \<le> c)

goal (1 subgoal):
 1. \<exists>j\<in>I. c < f j
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>j\<in>I. c < f j

goal (1 subgoal):
 1. \<not> (\<forall>i\<in>I. f i \<le> c) \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>j\<in>I. c < f j
[PROOF STEP]
obtain j where "j\<in> I" and "c < f j"
[PROOF STATE]
proof (prove)
using this:
\<exists>j\<in>I. c < f j

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j \<in> I; c < f j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j \<in> I
c < f j

goal (1 subgoal):
 1. \<not> (\<forall>i\<in>I. f i \<le> c) \<Longrightarrow> False
[PROOF STEP]
hence "c < sum f I"
[PROOF STATE]
proof (prove)
using this:
j \<in> I
c < f j

goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
using assms pos_sum_gt_comp[of I]
[PROOF STATE]
proof (prove)
using this:
j \<in> I
c < f j
finite I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i
sum f I \<le> c
\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> 0 \<le> ?f i; ?j \<in> I; ?c < ?f ?j\<rbrakk> \<Longrightarrow> ?c < sum ?f I

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

goal (1 subgoal):
 1. \<not> (\<forall>i\<in>I. f i \<le> c) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
c < sum f I

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c < sum f I
finite I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i
sum f I \<le> c

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_X_inv_shift_to_one [simp]: "fls_shift (-1) fls_X_inv = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_shift (- 1) fls_X_inv = 1
[PROOF STEP]
using fls_shift_fls_shift[of 1 "-1" 1]
[PROOF STATE]
proof (prove)
using this:
fls_shift 1 (fls_shift (- 1) 1) = fls_shift (- 1 + 1) 1

goal (1 subgoal):
 1. fls_shift (- 1) fls_X_inv = 1
[PROOF STEP]
by (simp add: fls_X_inv_conv_shift_1)


[STATEMENT]
lemma zero: "f 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'a) = (0::'b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (0::'a) = (0::'b)
[PROOF STEP]
have "f 0 = f (0 + 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'a) = f ((0::'a) + (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (0::'a) = f ((0::'a) + (0::'a))

goal (1 subgoal):
 1. f (0::'a) = (0::'b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (0::'a) = f ((0::'a) + (0::'a))

goal (1 subgoal):
 1. f (0::'a) = (0::'b)
[PROOF STEP]
have "\<dots> = f 0 + f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ((0::'a) + (0::'a)) = f (0::'a) + f (0::'a)
[PROOF STEP]
by (rule add)
[PROOF STATE]
proof (state)
this:
f ((0::'a) + (0::'a)) = f (0::'a) + f (0::'a)

goal (1 subgoal):
 1. f (0::'a) = (0::'b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (0::'a) = f (0::'a) + f (0::'a)
[PROOF STEP]
show "f 0 = 0"
[PROOF STATE]
proof (prove)
using this:
f (0::'a) = f (0::'a) + f (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted01: "length xs \<le> 1 \<Longrightarrow> sorted xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs \<le> 1 \<Longrightarrow> sorted xs
[PROOF STEP]
by (simp add: sorted_wrt01)


[STATEMENT]
lemma circuitI:
  assumes "X \<subseteq> carrier"
  assumes "\<not> indep X"
  assumes "\<And>x. x \<in> X \<Longrightarrow> indep (X - {x})"
  shows "circuit X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circuit X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> carrier
\<not> indep X
?x \<in> X \<Longrightarrow> indep (X - {?x})

goal (1 subgoal):
 1. circuit X
[PROOF STEP]
unfolding circuit_def
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> carrier
\<not> indep X
?x \<in> X \<Longrightarrow> indep (X - {?x})

goal (1 subgoal):
 1. X \<subseteq> carrier \<and> \<not> indep X \<and> (\<forall>x\<in>X. indep (X - {x}))
[PROOF STEP]
by auto


[STATEMENT]
lemma span_span[simp]:
  assumes "W \<subseteq> carrier_vec n"
  shows "span (span W) = span W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span (local.span W) = local.span W
[PROOF STEP]
proof(standard,standard,goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> local.span (local.span W) \<Longrightarrow> x \<in> local.span W
 2. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
case (1 x)
[PROOF STATE]
proof (state)
this:
x \<in> local.span (local.span W)

goal (2 subgoals):
 1. \<And>x. x \<in> local.span (local.span W) \<Longrightarrow> x \<in> local.span W
 2. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
with in_spanE
[PROOF STATE]
proof (chain)
picking this:
?v \<in> local.span ?W \<Longrightarrow> \<exists>a A. ?v = lincomb a A \<and> finite A \<and> A \<subseteq> ?W
x \<in> local.span (local.span W)
[PROOF STEP]
obtain a A where a: "x = lincomb a A" "finite A" "A \<subseteq> span W"
[PROOF STATE]
proof (prove)
using this:
?v \<in> local.span ?W \<Longrightarrow> \<exists>a A. ?v = lincomb a A \<and> finite A \<and> A \<subseteq> ?W
x \<in> local.span (local.span W)

goal (1 subgoal):
 1. (\<And>a A. \<lbrakk>x = lincomb a A; finite A; A \<subseteq> local.span W\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = lincomb a A
finite A
A \<subseteq> local.span W

goal (2 subgoals):
 1. \<And>x. x \<in> local.span (local.span W) \<Longrightarrow> x \<in> local.span W
 2. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
from a(3) assms
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> local.span W
W \<subseteq> carrier_vec n
[PROOF STEP]
have AC:"A \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> local.span W
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. A \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<subseteq> carrier_vec n

goal (2 subgoals):
 1. \<And>x. x \<in> local.span (local.span W) \<Longrightarrow> x \<in> local.span W
 2. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> local.span W
[PROOF STEP]
unfolding a(1)[unfolded lincomb_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>\<^bsub>V\<^esub>v\<in>A. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
proof(insert a(3),atomize (full),rule finite_induct[OF a(2)],goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {} \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>{}. a v \<cdot>\<^sub>v v) \<in> local.span W
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. {} \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>{}. a v \<cdot>\<^sub>v v) \<in> local.span W
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>{}. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
using span_zero
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v n \<in> local.span ?U

goal (1 subgoal):
 1. {} \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>{}. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{} \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>{}. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
case (2 x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
assume F:"insert x F \<subseteq> span W"
[PROOF STATE]
proof (state)
this:
insert x F \<subseteq> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
hence "a x \<cdot>\<^sub>v x \<in> span W"
[PROOF STATE]
proof (prove)
using this:
insert x F \<subseteq> local.span W

goal (1 subgoal):
 1. a x \<cdot>\<^sub>v x \<in> local.span W
[PROOF STEP]
by (intro smult_in_span[OF assms],auto)
[PROOF STATE]
proof (state)
this:
a x \<cdot>\<^sub>v x \<in> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
hence "a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> span W"
[PROOF STATE]
proof (prove)
using this:
a x \<cdot>\<^sub>v x \<in> local.span W

goal (1 subgoal):
 1. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
using span_add1 F 2 assms
[PROOF STATE]
proof (prove)
using this:
a x \<cdot>\<^sub>v x \<in> local.span W
\<lbrakk>?U \<subseteq> carrier_vec n; ?v \<in> local.span ?U; ?w \<in> local.span ?U\<rbrakk> \<Longrightarrow> ?v + ?w \<in> local.span ?U
insert x F \<subseteq> local.span W
finite F
x \<notin> F
F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
hence "(\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> span W"
[PROOF STATE]
proof (prove)
using this:
a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
apply(subst M.finsum_insert[OF 2(1,2)])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W \<Longrightarrow> (\<lambda>v. a v \<cdot>\<^sub>v v) \<in> F \<rightarrow> carrier_vec n
 2. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W \<Longrightarrow> a x \<cdot>\<^sub>v x \<in> carrier_vec n
 3. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W \<Longrightarrow> a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
using F assms
[PROOF STATE]
proof (prove)
using this:
insert x F \<subseteq> local.span W
W \<subseteq> carrier_vec n

goal (3 subgoals):
 1. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W \<Longrightarrow> (\<lambda>v. a v \<cdot>\<^sub>v v) \<in> F \<rightarrow> carrier_vec n
 2. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W \<Longrightarrow> a x \<cdot>\<^sub>v x \<in> carrier_vec n
 3. a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W \<Longrightarrow> a x \<cdot>\<^sub>v x + (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
insert x F \<subseteq> local.span W \<Longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>F. a v \<cdot>\<^sub>v v) \<in> local.span W\<rbrakk> \<Longrightarrow> insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
insert x F \<subseteq> local.span W \<Longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
insert x F \<subseteq> local.span W \<Longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal (1 subgoal):
 1. insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert x F \<subseteq> local.span W \<longrightarrow> (\<Oplus>\<^bsub>V\<^esub>v\<in>insert x F. a v \<cdot>\<^sub>v v) \<in> local.span W

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> local.span W

goal (1 subgoal):
 1. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. local.span W \<subseteq> local.span (local.span W)
[PROOF STEP]
by(intro in_own_span, auto)
[PROOF STATE]
proof (state)
this:
local.span W \<subseteq> local.span (local.span W)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_le_if_sucs_subset: "sucs t1 |\<subseteq>| sucs t2 \<Longrightarrow> size t1 \<le> size t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sucs t1 |\<subseteq>| sucs t2 \<Longrightarrow> size t1 \<le> size t2
[PROOF STEP]
using size_le_if_child_subset[of "sucs t1" "sucs t2" "root t1" "root t2"]
[PROOF STATE]
proof (prove)
using this:
sucs t1 |\<subseteq>| sucs t2 \<Longrightarrow> size (Node (dtree.root t1) (sucs t1)) \<le> size (Node (dtree.root t2) (sucs t2))

goal (1 subgoal):
 1. sucs t1 |\<subseteq>| sucs t2 \<Longrightarrow> size t1 \<le> size t2
[PROOF STEP]
by simp


[STATEMENT]
lemma span_insertI:
  assumes "p \<in> span B"
  shows "p \<in> span (insert r B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> span (insert r B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> span (insert r B)
[PROOF STEP]
have "B \<subseteq> insert r B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> insert r B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B \<subseteq> insert r B

goal (1 subgoal):
 1. p \<in> span (insert r B)
[PROOF STEP]
hence "span B \<subseteq> span (insert r B)"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> insert r B

goal (1 subgoal):
 1. span B \<subseteq> span (insert r B)
[PROOF STEP]
by (rule span_mono)
[PROOF STATE]
proof (state)
this:
span B \<subseteq> span (insert r B)

goal (1 subgoal):
 1. p \<in> span (insert r B)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
p \<in> span B
span B \<subseteq> span (insert r B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<in> span B
span B \<subseteq> span (insert r B)

goal (1 subgoal):
 1. p \<in> span (insert r B)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
p \<in> span (insert r B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transE: "\<lbrakk>(a, b) \<in> r; (b, c) \<in> r\<rbrakk> \<Longrightarrow> (a, c) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> r; (b, c) \<in> r\<rbrakk> \<Longrightarrow> (a, c) \<in> r
[PROOF STEP]
using cl_po
[PROOF STATE]
proof (prove)
using this:
cl \<in> PartialOrder

goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> r; (b, c) \<in> r\<rbrakk> \<Longrightarrow> (a, c) \<in> r
[PROOF STEP]
by (simp add: PartialOrder_def r_def) (unfold trans_def, fast)


[STATEMENT]
theorem wls_swap_preserves_fresh_distinct:
assumes "wls s X" and
       "xs \<noteq> ys \<or> x \<notin> {y1,y2}"
shows "fresh xs x (X #[y1 \<and> y2]_ys) = fresh xs x X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fresh xs x (X #[y1 \<and> y2]_ys) = fresh xs x X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
xs \<noteq> ys \<or> x \<notin> {y1, y2}

goal (1 subgoal):
 1. fresh xs x (X #[y1 \<and> y2]_ys) = fresh xs x X
[PROOF STEP]
by(intro swap_preserves_fresh_distinct) auto


[STATEMENT]
lemma in_nlistsE:
  "\<lbrakk> xs \<in> nlists n A; \<lbrakk>size xs = n; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> P \<rbrakk> \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> nlists n A; \<lbrakk>length xs = n; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (unfold nlists_def) blast


[STATEMENT]
lemma fps_compose_sub_distrib: "(a - b) oo (c::'a::ring_1 fps) = (a oo c) - (b oo c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b oo c = (a oo c) - (b oo c)
[PROOF STEP]
using fps_compose_add_distrib [of a "- b" c]
[PROOF STATE]
proof (prove)
using this:
a + - b oo c = (a oo c) + (- b oo c)

goal (1 subgoal):
 1. a - b oo c = (a oo c) - (b oo c)
[PROOF STEP]
by (simp add: fps_compose_uminus)


[STATEMENT]
lemma insertion_trivial [simp]:
  "insertion (\<lambda>_. 0) p = coeff p 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion (\<lambda>_. 0::'a) p = coeff p 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. insertion (\<lambda>_. 0::'a) p = coeff p 0
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. insertion (\<lambda>_. 0::'a) p = coeff p 0
[PROOF STEP]
fix f :: "(nat \<Rightarrow>\<^sub>0 nat) \<Rightarrow>\<^sub>0 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. insertion (\<lambda>_. 0::'a) p = coeff p 0
[PROOF STEP]
have "insertion_aux (\<lambda>_. 0) f = Poly_Mapping.lookup f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion_aux (\<lambda>_. 0::'a) f = poly_mapping.lookup f 0
[PROOF STEP]
apply (simp add: insertion_aux_def insertion_fun_def power_Sum_any [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a. poly_mapping.lookup f a * (0::'a) ^ Sum_any (poly_mapping.lookup a)) = poly_mapping.lookup f 0
[PROOF STEP]
apply (simp add: zero_power_eq mult_when aux)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
insertion_aux (\<lambda>_. 0::'a) f = poly_mapping.lookup f 0

goal (1 subgoal):
 1. insertion (\<lambda>_. 0::'a) p = coeff p 0
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
insertion_aux (\<lambda>_. 0::'a) ?f2 = poly_mapping.lookup ?f2 0

goal (1 subgoal):
 1. insertion (\<lambda>_. 0::'a) p = coeff p 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
insertion_aux (\<lambda>_. 0::'a) ?f2 = poly_mapping.lookup ?f2 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
insertion_aux (\<lambda>_. 0::'a) ?f2 = poly_mapping.lookup ?f2 0

goal (1 subgoal):
 1. insertion (\<lambda>_. 0::'a) p = coeff p 0
[PROOF STEP]
by (simp add: coeff_def insertion_def)
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>_. 0::'a) p = coeff p 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_of_X_plus:
  assumes "a \<in> carrier R"
  assumes "\<one> \<noteq>\<zero>"
  shows "degree (X_plus a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (X_poly_plus R a) = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg R (X_poly_plus R a) = 1
[PROOF STEP]
have 0:"degree (X_plus a) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (X_poly_plus R a) \<le> 1
[PROOF STEP]
using deg_add degree_X  P_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<in> carrier P; ?q \<in> carrier P\<rbrakk> \<Longrightarrow> deg R (?p \<oplus>\<^bsub>P\<^esub> ?q) \<le> max (deg R ?p) (deg R ?q)
\<one> \<noteq> \<zero> \<Longrightarrow> deg R (X_poly R) = 1
P \<equiv> UP R

goal (1 subgoal):
 1. deg R (X_poly_plus R a) \<le> 1
[PROOF STEP]
unfolding X_poly_plus_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<in> carrier P; ?q \<in> carrier P\<rbrakk> \<Longrightarrow> deg R (?p \<oplus>\<^bsub>P\<^esub> ?q) \<le> max (deg R ?p) (deg R ?q)
\<one> \<noteq> \<zero> \<Longrightarrow> deg R (X_poly R) = 1
P \<equiv> UP R

goal (1 subgoal):
 1. deg R (X_poly R \<oplus>\<^bsub>UP R\<^esub> to_polynomial R a) \<le> 1
[PROOF STEP]
using UP_cring.to_poly_closed UP_cring_axioms X_closed assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<in> carrier P; ?q \<in> carrier P\<rbrakk> \<Longrightarrow> deg R (?p \<oplus>\<^bsub>P\<^esub> ?q) \<le> max (deg R ?p) (deg R ?q)
\<one> \<noteq> \<zero> \<Longrightarrow> deg R (X_poly R) = 1
P \<equiv> UP R
\<lbrakk>UP_cring ?R; ?a \<in> carrier ?R\<rbrakk> \<Longrightarrow> to_polynomial ?R ?a \<in> carrier (UP ?R)
UP_cring R
X_poly R \<in> carrier P
a \<in> carrier R
\<one> \<noteq> \<zero>

goal (1 subgoal):
 1. deg R (X_poly R \<oplus>\<^bsub>UP R\<^esub> to_polynomial R a) \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
deg R (X_poly_plus R a) \<le> 1

goal (1 subgoal):
 1. deg R (X_poly_plus R a) = 1
[PROOF STEP]
have 1:"degree (X_plus a) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < deg R (X_poly_plus R a)
[PROOF STEP]
by (metis One_nat_def P_def R.one_closed R.r_zero X_poly_def
        X_closed X_poly_plus_def X_plus_closed  assms  coeff_add coeff_monom deg_aboveD
         gr0I  lessI  n_not_Suc_n to_polynomial_def to_poly_closed)
[PROOF STATE]
proof (state)
this:
0 < deg R (X_poly_plus R a)

goal (1 subgoal):
 1. deg R (X_poly_plus R a) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < deg R (X_poly_plus R a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < deg R (X_poly_plus R a)

goal (1 subgoal):
 1. deg R (X_poly_plus R a) = 1
[PROOF STEP]
using "0"
[PROOF STATE]
proof (prove)
using this:
0 < deg R (X_poly_plus R a)
deg R (X_poly_plus R a) \<le> 1

goal (1 subgoal):
 1. deg R (X_poly_plus R a) = 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
deg R (X_poly_plus R a) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decrpoly:
  assumes "polybound0 t"
  shows "Ipoly (x # bs) t = Ipoly bs (decrpoly t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly (x # bs) t = Ipoly bs (decrpoly t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
polybound0 t

goal (1 subgoal):
 1. Ipoly (x # bs) t = Ipoly bs (decrpoly t)
[PROOF STEP]
by (induct t rule: decrpoly.induct) simp_all


[STATEMENT]
lemma continuous_on_compose_Pair:
  assumes f: "continuous_on (Sigma A B) (\<lambda>(a, b). f a b)"
  assumes g: "continuous_on C g"
  assumes h: "continuous_on C h"
  assumes subset: "\<And>c. c \<in> C \<Longrightarrow> g c \<in> A" "\<And>c. c \<in> C \<Longrightarrow> h c \<in> B (g c)"
  shows "continuous_on C (\<lambda>c. f (g c) (h c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
using continuous_on_compose2[OF f continuous_on_Pair[OF g h]] subset
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g x, h x)) ` C \<subseteq> Sigma A B \<Longrightarrow> continuous_on C (\<lambda>x. case (g x, h x) of (a, b) \<Rightarrow> f a b)
?c \<in> C \<Longrightarrow> g ?c \<in> A
?c \<in> C \<Longrightarrow> h ?c \<in> B (g ?c)

goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
by auto


[STATEMENT]
lemma sub_eq_zero [simp]:
  assumes "z \<noteq> \<infinity>\<^sub>h"
  shows "z -\<^sub>h z = 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z -\<^sub>h z = 0\<^sub>h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. z -\<^sub>h z = 0\<^sub>h
[PROOF STEP]
using inf_or_of_complex[of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> \<infinity>\<^sub>h
z = \<infinity>\<^sub>h \<or> (\<exists>x. z = of_complex x)

goal (1 subgoal):
 1. z -\<^sub>h z = 0\<^sub>h
[PROOF STEP]
by auto


[STATEMENT]
lemma list_insert_map [reversal_rule]:
  assumes "inj f" shows "List.insert (f  x) (map f xs) = map f (List.insert x xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.insert (f x) (map f xs) = map f (List.insert x xs)
[PROOF STEP]
unfolding List.insert_def set_map inj_image_mem_iff[OF \<open>inj f\<close>] Cons_map if_image
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (if x \<in> set xs then xs else x # xs) = map f (if x \<in> set xs then xs else x # xs)
[PROOF STEP]
..

  \<comment> \<open>\<^const>\<open>List.union\<close>\<close>


[STATEMENT]
lemma pell_valuation_cnj_solution:
  fixes z :: "nat \<times> nat"
  assumes "solution z"
  shows   "pell_valuation (pell_cnj z) = 1 / pell_valuation z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
have "pell_valuation (pell_cnj z) * pell_valuation z = pell_valuation (pell_mul (pell_cnj z) z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) * pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (pell_mul (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) (case z of (x, y) \<Rightarrow> (int x, int y)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) * pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (pell_mul (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) (case z of (x, y) \<Rightarrow> (int x, int y)))

goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) * pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (pell_mul (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) (case z of (x, y) \<Rightarrow> (int x, int y)))

goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
solution z
[PROOF STEP]
have "pell_mul (pell_cnj z) z = (1, 0)"
[PROOF STATE]
proof (prove)
using this:
solution z

goal (1 subgoal):
 1. pell_mul (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) (case z of (x, y) \<Rightarrow> (int x, int y)) = (1, 0)
[PROOF STEP]
by (subst pell_mul_cnj_left) (auto simp: case_prod_unfold)
[PROOF STATE]
proof (state)
this:
pell_mul (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) (case z of (x, y) \<Rightarrow> (int x, int y)) = (1, 0)

goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) * pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (1, 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) * pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (1, 0)

goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
using pell_valuation_solution_pos_nat[OF assms]
[PROOF STATE]
proof (prove)
using this:
pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) * pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (1, 0)
0 < pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))

goal (1 subgoal):
 1. pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
by (auto simp: divide_simps)
[PROOF STATE]
proof (state)
this:
pell_valuation (pell_cnj (case z of (x, y) \<Rightarrow> (int x, int y))) = 1 / pell_valuation (case z of (x, y) \<Rightarrow> (int x, int y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_akiyama_tanigawa_row_numeral:
  "gen_akiyama_tanigawa_row f (numeral n) l u =
     akiyama_tanigawa_step_aux (Suc l) (gen_akiyama_tanigawa_row f (pred_numeral n) l (Suc u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen_akiyama_tanigawa_row f (numeral n) l u = akiyama_tanigawa_step_aux (Suc l) (gen_akiyama_tanigawa_row f (pred_numeral n) l (Suc u))
[PROOF STEP]
by (simp only: numeral_eq_Suc gen_akiyama_tanigawa_row_Suc)