[STATEMENT]
lemma continuous_sqrt_on_contractible:
  fixes f :: "'a::real_normed_vector \<Rightarrow> complex"
  assumes "continuous_on S f" "contractible S"
      and "\<And>z. z \<in> S \<Longrightarrow> f z \<noteq> 0"
  obtains g where "continuous_on S g" "\<And>x. x \<in> S \<Longrightarrow> f x = (g x) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = (g x)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = (g x)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain g where contg: "continuous_on S g" and feq: "\<And>x. x \<in> S \<Longrightarrow> f x = exp(g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using continuous_logarithm_on_contractible [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>z. z \<in> S \<Longrightarrow> z \<in> S; \<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on S g
?x \<in> S \<Longrightarrow> f ?x = exp (g ?x)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = (g x)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on S ?g
 2. \<And>x. x \<in> S \<Longrightarrow> f x = (?g x)\<^sup>2
[PROOF STEP]
show "continuous_on S (\<lambda>z. exp (g z / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>z. exp (g z / 2))
[PROOF STEP]
by (rule continuous_on_compose2 [of UNIV exp]; intro continuous_intros contg subset_UNIV) auto
[PROOF STATE]
proof (state)
this:
continuous_on S (\<lambda>z. exp (g z / 2))

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> f x = (exp (g x / 2))\<^sup>2
[PROOF STEP]
show "\<And>x. x \<in> S \<Longrightarrow> f x = (exp (g x / 2))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> f x = (exp (g x / 2))\<^sup>2
[PROOF STEP]
by (metis exp_double feq nonzero_mult_div_cancel_left times_divide_eq_right zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> f ?x = (exp (g ?x / 2))\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma swap_list :
  assumes  "a < length L"
  assumes "b < length L"
  shows "nth_default 0 (L[b := L ! a, a := L ! b]) (swap a b xa) = nth_default 0 L xa"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_default (0::'a) (L[b := L ! a, a := L ! b]) (swap a b xa) = nth_default (0::'a) L xa
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < length L
b < length L

goal (1 subgoal):
 1. nth_default (0::'a) (L[b := L ! a, a := L ! b]) (swap a b xa) = nth_default (0::'a) L xa
[PROOF STEP]
unfolding swap_def
[PROOF STATE]
proof (prove)
using this:
a < length L
b < length L

goal (1 subgoal):
 1. nth_default (0::'a) (L[b := L ! a, a := L ! b]) (if xa = a then b else if xa = b then a else xa) = nth_default (0::'a) L xa
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>a < length L; b < length L; xa = b; b \<noteq> a\<rbrakk> \<Longrightarrow> nth_default (0::'a) (L[b := L ! a, a := L ! b]) a = nth_default (0::'a) L b
 2. \<lbrakk>a < length L; b < length L; a \<noteq> b; xa = a\<rbrakk> \<Longrightarrow> nth_default (0::'a) (L[b := L ! a, a := L ! b]) b = nth_default (0::'a) L a
 3. \<lbrakk>a < length L; b < length L; xa \<noteq> b; xa \<noteq> a\<rbrakk> \<Longrightarrow> nth_default (0::'a) (L[b := L ! a, a := L ! b]) xa = nth_default (0::'a) L xa
[PROOF STEP]
apply (simp_all add: nth_default_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < length L; b < length L; xa \<noteq> b; xa \<noteq> a\<rbrakk> \<Longrightarrow> nth_default (0::'a) (L[b := L ! a, a := L ! b]) xa = nth_default (0::'a) L xa
[PROOF STEP]
by (simp add: nth_default_def)


[STATEMENT]
lemma isCont_If_ge:
  fixes a :: "'a :: linorder_topology"
  assumes "continuous (at_left a) g" and f: "(f \<longlongrightarrow> g a) (at_right a)"
  shows "isCont (\<lambda>x. if x \<le> a then g x else f x) a" (is "isCont ?gf a")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
have g: "(g \<longlongrightarrow> g a) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<longlongrightarrow> g a) (at_left a)
[PROOF STEP]
using assms continuous_within
[PROOF STATE]
proof (prove)
using this:
continuous (at_left a) g
(f \<longlongrightarrow> g a) (at_right a)
continuous (at ?x within ?s) ?f = (?f \<longlongrightarrow> ?f ?x) (at ?x within ?s)

goal (1 subgoal):
 1. (g \<longlongrightarrow> g a) (at_left a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(g \<longlongrightarrow> g a) (at_left a)

goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
unfolding isCont_def continuous_within
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<le> a then g x else f x) \<midarrow>a\<rightarrow> (if a \<le> a then g a else f a)
[PROOF STEP]
proof (intro filterlim_split_at; simp)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_left a)
 2. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)
[PROOF STEP]
show "(?gf \<longlongrightarrow> g a) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_left a)
[PROOF STEP]
by (subst filterlim_cong[OF refl refl, where g=g]) (simp_all add: eventually_at_filter less_le g)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_left a)

goal (1 subgoal):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)
[PROOF STEP]
show "(?gf \<longlongrightarrow> g a) (at_right a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)
[PROOF STEP]
by (subst filterlim_cong[OF refl refl, where g=f]) (simp_all add: eventually_at_filter less_le f)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. if x \<le> a then g x else f x) a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma funpow_prefix: "j < k \<Longrightarrow> ((f ^^ j) a, (f ^^ k) a) \<in> leq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < k \<Longrightarrow> ((f ^^ j) a, (f ^^ k) a) \<in> leq
[PROOF STEP]
proof(induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. j < 0 \<Longrightarrow> ((f ^^ j) a, (f ^^ 0) a) \<in> leq
 2. \<And>k. \<lbrakk>j < k \<Longrightarrow> ((f ^^ j) a, (f ^^ k) a) \<in> leq; j < Suc k\<rbrakk> \<Longrightarrow> ((f ^^ j) a, (f ^^ Suc k) a) \<in> leq
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
j < k \<Longrightarrow> ((f ^^ j) a, (f ^^ k) a) \<in> leq
j < Suc k

goal (2 subgoals):
 1. j < 0 \<Longrightarrow> ((f ^^ j) a, (f ^^ 0) a) \<in> leq
 2. \<And>k. \<lbrakk>j < k \<Longrightarrow> ((f ^^ j) a, (f ^^ k) a) \<in> leq; j < Suc k\<rbrakk> \<Longrightarrow> ((f ^^ j) a, (f ^^ Suc k) a) \<in> leq
[PROOF STEP]
with leq_trans[OF _ increasing[OF funpow_Field_leq]] funpow_Field_leq increasing a
[PROOF STATE]
proof (chain)
picking this:
(?x, (f ^^ ?k2) a) \<in> leq \<Longrightarrow> (?x, f ((f ^^ ?k2) a)) \<in> leq
(f ^^ ?k) a \<in> Field leq
?x \<in> Field leq \<Longrightarrow> (?x, f ?x) \<in> leq
a \<in> Field leq
j < k \<Longrightarrow> ((f ^^ j) a, (f ^^ k) a) \<in> leq
j < Suc k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(?x, (f ^^ ?k2) a) \<in> leq \<Longrightarrow> (?x, f ((f ^^ ?k2) a)) \<in> leq
(f ^^ ?k) a \<in> Field leq
?x \<in> Field leq \<Longrightarrow> (?x, f ?x) \<in> leq
a \<in> Field leq
j < k \<Longrightarrow> ((f ^^ j) a, (f ^^ k) a) \<in> leq
j < Suc k

goal (1 subgoal):
 1. ((f ^^ j) a, (f ^^ Suc k) a) \<in> leq
[PROOF STEP]
by simp (metis less_antisym)
[PROOF STATE]
proof (state)
this:
((f ^^ j) a, (f ^^ Suc k) a) \<in> leq

goal (1 subgoal):
 1. j < 0 \<Longrightarrow> ((f ^^ j) a, (f ^^ 0) a) \<in> leq
[PROOF STEP]
qed simp


[STATEMENT]
lemma relImage_mono:
  "R1 \<subseteq> R2 \<Longrightarrow> relImage R1 f \<subseteq> relImage R2 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> relImage R1 f \<subseteq> relImage R2 f
[PROOF STEP]
unfolding relImage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> {(f a1, f a2) |a1 a2. (a1, a2) \<in> R1} \<subseteq> {(f a1, f a2) |a1 a2. (a1, a2) \<in> R2}
[PROOF STEP]
by auto


[STATEMENT]
lemma sorted_from_radix_sort_step:
assumes "cols xss n" and "i < n" and "sorted_from (i+1) xss"
shows "sorted_from i (sort_col i xss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (map (drop i) (sort_col i xss))
[PROOF STEP]
proof (rule sorted_from_Suc2[OF cols_sort1[OF assms(1)] assms(2)])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sorted (map (\<lambda>xs. xs ! i) (sort_col i xss))
 2. \<And>x. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))
[PROOF STEP]
show "sorted_col i (sort_col i xss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (map (\<lambda>xs. xs ! i) (sort_col i xss))
[PROOF STEP]
by(simp add: sorted)
[PROOF STATE]
proof (state)
this:
sorted (map (\<lambda>xs. xs ! i) (sort_col i xss))

goal (1 subgoal):
 1. \<And>x. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))
[PROOF STEP]
show "sorted_from (i+1) [ys \<leftarrow> sort_col i xss . ys ! i = x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
sorted (map (drop (i + 1)) xss)
[PROOF STEP]
have "sorted_from (i+1) (filter (\<lambda>ys. ys!i = x) xss)"
[PROOF STATE]
proof (prove)
using this:
sorted (map (drop (i + 1)) xss)

goal (1 subgoal):
 1. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) xss))
[PROOF STEP]
by(rule sorted_filter)
[PROOF STATE]
proof (state)
this:
sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) xss))

goal (1 subgoal):
 1. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))
[PROOF STEP]
thus "sorted (map (drop (i+1)) (filter (\<lambda>ys. ys!i = x) (sort_col i xss)))"
[PROOF STATE]
proof (prove)
using this:
sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) xss))

goal (1 subgoal):
 1. sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))
[PROOF STEP]
by (metis stable stable_sort_key_def)
[PROOF STATE]
proof (state)
this:
sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sorted (map (drop (i + 1)) (filter (\<lambda>ys. ys ! i = x) (sort_col i xss)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem univ_ce_is_not_comp3: "\<not> computable univ_ce"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> computable univ_ce
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> \<not> computable univ_ce \<Longrightarrow> False
[PROOF STEP]
assume "\<not> \<not> computable univ_ce"
[PROOF STATE]
proof (state)
this:
\<not> \<not> computable univ_ce

goal (1 subgoal):
 1. \<not> \<not> computable univ_ce \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> \<not> computable univ_ce
[PROOF STEP]
have "computable univ_ce"
[PROOF STATE]
proof (prove)
using this:
\<not> \<not> computable univ_ce

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

goal (1 subgoal):
 1. \<not> \<not> computable univ_ce \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
computable univ_ce
[PROOF STEP]
have "total_recursive (chf univ_ce)"
[PROOF STATE]
proof (prove)
using this:
computable univ_ce

goal (1 subgoal):
 1. total_recursive (chf univ_ce)
[PROOF STEP]
by (rule comp_impl_tot_rec)
[PROOF STATE]
proof (state)
this:
total_recursive (chf univ_ce)

goal (1 subgoal):
 1. \<not> \<not> computable univ_ce \<Longrightarrow> False
[PROOF STEP]
with univ_ce_is_not_comp2
[PROOF STATE]
proof (chain)
picking this:
\<not> total_recursive (chf univ_ce)
total_recursive (chf univ_ce)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> total_recursive (chf univ_ce)
total_recursive (chf univ_ce)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_image_closed_interval:
  fixes a b and f :: "real \<Rightarrow> real"
  defines "S \<equiv> {a..b}"
  assumes "a \<le> b" and f: "continuous_on S f"
  shows "\<exists>c d. f`S = {c..d} \<and> c \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
have S: "compact S" "S \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact S &&& S \<noteq> {}
[PROOF STEP]
using \<open>a \<le> b\<close>
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. compact S &&& S \<noteq> {}
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
compact S
S \<noteq> {}

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
obtain c where "c \<in> S" "\<forall>d\<in>S. f d \<le> f c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<in> S; \<forall>d\<in>S. f d \<le> f c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using continuous_attains_sup[OF S f]
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. \<forall>y\<in>S. f y \<le> f x

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

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c \<in> S
\<forall>d\<in>S. f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
obtain d where "d \<in> S" "\<forall>c\<in>S. f d \<le> f c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>d \<in> S; \<forall>c\<in>S. f d \<le> f c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using continuous_attains_inf[OF S f]
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. \<forall>y\<in>S. f x \<le> f y

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

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
d \<in> S
\<forall>c\<in>S. f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
have "connected (f`S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (f ` S)
[PROOF STEP]
using connected_continuous_image[OF f] connected_Icc
[PROOF STATE]
proof (prove)
using this:
connected S \<Longrightarrow> connected (f ` S)
connected {?a..?b}

goal (1 subgoal):
 1. connected (f ` S)
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
connected (f ` S)

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c \<in> S
\<forall>d\<in>S. f d \<le> f c
d \<in> S
\<forall>c\<in>S. f d \<le> f c
connected (f ` S)
[PROOF STEP]
have "f ` S = {f d .. f c} \<and> f d \<le> f c"
[PROOF STATE]
proof (prove)
using this:
c \<in> S
\<forall>d\<in>S. f d \<le> f c
d \<in> S
\<forall>c\<in>S. f d \<le> f c
connected (f ` S)

goal (1 subgoal):
 1. f ` S = {f d..f c} \<and> f d \<le> f c
[PROOF STEP]
by (auto simp: connected_iff_interval)
[PROOF STATE]
proof (state)
this:
f ` S = {f d..f c} \<and> f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ` S = {f d..f c} \<and> f d \<le> f c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f ` S = {f d..f c} \<and> f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c d. f ` S = {c..d} \<and> c \<le> d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding) indRelRSTPO_trans:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  shows "trans (indRelRSTPO SRel TRel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (indRelRSTPO SRel TRel)
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> y \<longrightarrow> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z \<longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> y \<and> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z \<Longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z
[PROOF STEP]
fix P Q R
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> y \<and> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z \<Longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z
[PROOF STEP]
assume "P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> Q" and "Q \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> R"
[PROOF STATE]
proof (state)
this:
P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> Q
Q \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> R

goal (1 subgoal):
 1. \<And>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> y \<and> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z \<Longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> z
[PROOF STEP]
thus "P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> R"
[PROOF STATE]
proof (prove)
using this:
P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> Q
Q \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> R

goal (1 subgoal):
 1. P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> R
[PROOF STEP]
by (rule indRelRSTPO.trans)
[PROOF STATE]
proof (state)
this:
P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>R<SRel,TRel> R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma product_commutativity: "O x y \<Longrightarrow> x \<otimes> y = y \<otimes> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O x y \<Longrightarrow> x \<otimes> y = y \<otimes> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. O x y \<Longrightarrow> x \<otimes> y = y \<otimes> x
[PROOF STEP]
assume "O x y"
[PROOF STATE]
proof (state)
this:
O x y

goal (1 subgoal):
 1. O x y \<Longrightarrow> x \<otimes> y = y \<otimes> x
[PROOF STEP]
hence "O y x"
[PROOF STATE]
proof (prove)
using this:
O x y

goal (1 subgoal):
 1. O y x
[PROOF STEP]
by (rule overlap_symmetry)
[PROOF STATE]
proof (state)
this:
O y x

goal (1 subgoal):
 1. O x y \<Longrightarrow> x \<otimes> y = y \<otimes> x
[PROOF STEP]
hence "\<forall>w. P w (y \<otimes> x) \<longleftrightarrow> (P w y \<and> P w x)"
[PROOF STATE]
proof (prove)
using this:
O y x

goal (1 subgoal):
 1. \<forall>w. P w (y \<otimes> x) = (P w y \<and> P w x)
[PROOF STEP]
by (rule product_character)
[PROOF STATE]
proof (state)
this:
\<forall>w. P w (y \<otimes> x) = (P w y \<and> P w x)

goal (1 subgoal):
 1. O x y \<Longrightarrow> x \<otimes> y = y \<otimes> x
[PROOF STEP]
hence "\<forall>w. P w (y \<otimes> x) \<longleftrightarrow> (P w x \<and> P w y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>w. P w (y \<otimes> x) = (P w y \<and> P w x)

goal (1 subgoal):
 1. \<forall>w. P w (y \<otimes> x) = (P w x \<and> P w y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>w. P w (y \<otimes> x) = (P w x \<and> P w y)

goal (1 subgoal):
 1. O x y \<Longrightarrow> x \<otimes> y = y \<otimes> x
[PROOF STEP]
thus "x \<otimes> y = y \<otimes> x"
[PROOF STATE]
proof (prove)
using this:
\<forall>w. P w (y \<otimes> x) = (P w x \<and> P w y)

goal (1 subgoal):
 1. x \<otimes> y = y \<otimes> x
[PROOF STEP]
by (rule product_intro)
[PROOF STATE]
proof (state)
this:
x \<otimes> y = y \<otimes> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subcocycle_birkhoff:
  assumes "integrable M f"
  shows "subcocycle (birkhoff_sum f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcocycle (birkhoff_sum f)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. integrable M (birkhoff_sum f n)) \<and> (\<forall>n m x. birkhoff_sum f (n + m) x \<le> birkhoff_sum f n x + birkhoff_sum f m ((T ^^ n) x))
[PROOF STEP]
by (auto simp add: assms birkhoff_sum_integral(1) birkhoff_sum_cocycle)


[STATEMENT]
lemma finsum_split:
  assumes "finite S"
  assumes "f \<in> S \<rightarrow> carrier R"
  assumes "g \<in> S \<rightarrow> carrier R"
  assumes "k \<in> carrier  R"
  assumes "c \<in> S"
  assumes "\<And>s. s \<in> S \<and> s \<noteq> c \<Longrightarrow> f s = g s"
  assumes "g c = f c \<oplus> k"
  shows "finsum R g S = k \<oplus> finsum R f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
have 0: "finsum R f S = f c \<oplus> finsum R f (S - {c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f S = f c \<oplus> finsum R f (S - {c})
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finsum R f S = f c \<oplus> finsum R f (S - {c})
[PROOF STEP]
have "f \<in> S - {c} \<rightarrow> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> S - {c} \<rightarrow> carrier R
[PROOF STEP]
by (metis Pi_split_insert_domain assms(2) assms(5) insert_Diff)
[PROOF STATE]
proof (state)
this:
f \<in> S - {c} \<rightarrow> carrier R

goal (1 subgoal):
 1. finsum R f S = f c \<oplus> finsum R f (S - {c})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> S - {c} \<rightarrow> carrier R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> S - {c} \<rightarrow> carrier R

goal (1 subgoal):
 1. finsum R f S = f c \<oplus> finsum R f (S - {c})
[PROOF STEP]
using assms finsum_insert[of "S - {c}" c f]
[PROOF STATE]
proof (prove)
using this:
f \<in> S - {c} \<rightarrow> carrier R
finite S
f \<in> S \<rightarrow> carrier R
g \<in> S \<rightarrow> carrier R
k \<in> carrier R
c \<in> S
?s23 \<in> S \<and> ?s23 \<noteq> c \<Longrightarrow> f ?s23 = g ?s23
g c = f c \<oplus> k
\<lbrakk>finite (S - {c}); c \<notin> S - {c}; f \<in> S - {c} \<rightarrow> carrier R; f c \<in> carrier R\<rbrakk> \<Longrightarrow> finsum R f (insert c (S - {c})) = f c \<oplus> finsum R f (S - {c})

goal (1 subgoal):
 1. finsum R f S = f c \<oplus> finsum R f (S - {c})
[PROOF STEP]
by (metis DiffD2 Pi_iff finite_Diff insert_Diff singletonI)
[PROOF STATE]
proof (state)
this:
finsum R f S = f c \<oplus> finsum R f (S - {c})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finsum R f S = f c \<oplus> finsum R f (S - {c})

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
have 1: "finsum R g S = g c \<oplus> finsum R g (S - {c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R g S = g c \<oplus> finsum R g (S - {c})
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finsum R g S = g c \<oplus> finsum R g (S - {c})
[PROOF STEP]
have "g \<in> S - {c} \<rightarrow> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> S - {c} \<rightarrow> carrier R
[PROOF STEP]
by (metis Pi_split_insert_domain  assms(3) assms(5) insert_Diff)
[PROOF STATE]
proof (state)
this:
g \<in> S - {c} \<rightarrow> carrier R

goal (1 subgoal):
 1. finsum R g S = g c \<oplus> finsum R g (S - {c})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g \<in> S - {c} \<rightarrow> carrier R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g \<in> S - {c} \<rightarrow> carrier R

goal (1 subgoal):
 1. finsum R g S = g c \<oplus> finsum R g (S - {c})
[PROOF STEP]
using assms finsum_insert[of "S - {c}" c g]
[PROOF STATE]
proof (prove)
using this:
g \<in> S - {c} \<rightarrow> carrier R
finite S
f \<in> S \<rightarrow> carrier R
g \<in> S \<rightarrow> carrier R
k \<in> carrier R
c \<in> S
?s23 \<in> S \<and> ?s23 \<noteq> c \<Longrightarrow> f ?s23 = g ?s23
g c = f c \<oplus> k
\<lbrakk>finite (S - {c}); c \<notin> S - {c}; g \<in> S - {c} \<rightarrow> carrier R; g c \<in> carrier R\<rbrakk> \<Longrightarrow> finsum R g (insert c (S - {c})) = g c \<oplus> finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = g c \<oplus> finsum R g (S - {c})
[PROOF STEP]
by (metis DiffD2 Pi_iff finite_Diff insert_Diff singletonI)
[PROOF STATE]
proof (state)
this:
finsum R g S = g c \<oplus> finsum R g (S - {c})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finsum R g S = g c \<oplus> finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
have "finsum R f (S - {c}) = finsum R g (S - {c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f (S - {c}) = finsum R g (S - {c})
[PROOF STEP]
using assms Diff_iff Pi_split_insert_domain finsum_cong'[of "S- {c}" "S - {c}" g f]
      insert_Diff singletonI
[PROOF STATE]
proof (prove)
using this:
finite S
f \<in> S \<rightarrow> carrier R
g \<in> S \<rightarrow> carrier R
k \<in> carrier R
c \<in> S
?s23 \<in> S \<and> ?s23 \<noteq> c \<Longrightarrow> f ?s23 = g ?s23
g c = f c \<oplus> k
(?c \<in> ?A - ?B) = (?c \<in> ?A \<and> ?c \<notin> ?B)
(?x \<in> Pi (insert ?i ?I) ?X) = (?x \<in> Pi ?I ?X \<and> ?x ?i \<in> ?X ?i)
\<lbrakk>S - {c} = S - {c}; g \<in> S - {c} \<rightarrow> carrier R; \<And>i. i \<in> S - {c} \<Longrightarrow> f i = g i\<rbrakk> \<Longrightarrow> finsum R f (S - {c}) = finsum R g (S - {c})
?a \<in> ?A \<Longrightarrow> insert ?a (?A - {?a}) = ?A
?a \<in> {?a}

goal (1 subgoal):
 1. finsum R f (S - {c}) = finsum R g (S - {c})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finsum R f (S - {c}) = finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finsum R f (S - {c}) = finsum R g (S - {c})
[PROOF STEP]
have "finsum R g S = f c \<oplus> k \<oplus> finsum R g (S - {c})"
[PROOF STATE]
proof (prove)
using this:
finsum R f (S - {c}) = finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = f c \<oplus> k \<oplus> finsum R g (S - {c})
[PROOF STEP]
using assms  \<open>finsum R g S = g c \<oplus> finsum R g (S - {c})\<close>
[PROOF STATE]
proof (prove)
using this:
finsum R f (S - {c}) = finsum R g (S - {c})
finite S
f \<in> S \<rightarrow> carrier R
g \<in> S \<rightarrow> carrier R
k \<in> carrier R
c \<in> S
?s23 \<in> S \<and> ?s23 \<noteq> c \<Longrightarrow> f ?s23 = g ?s23
g c = f c \<oplus> k
finsum R g S = g c \<oplus> finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = f c \<oplus> k \<oplus> finsum R g (S - {c})
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finsum R g S = f c \<oplus> k \<oplus> finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finsum R g S = f c \<oplus> k \<oplus> finsum R g (S - {c})
[PROOF STEP]
have 1: "finsum R g S = f c \<oplus> k \<oplus> finsum R f (S - {c})"
[PROOF STATE]
proof (prove)
using this:
finsum R g S = f c \<oplus> k \<oplus> finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = f c \<oplus> k \<oplus> finsum R f (S - {c})
[PROOF STEP]
using \<open>finsum R f (S - {c}) = finsum R g (S - {c})\<close>
[PROOF STATE]
proof (prove)
using this:
finsum R g S = f c \<oplus> k \<oplus> finsum R g (S - {c})
finsum R f (S - {c}) = finsum R g (S - {c})

goal (1 subgoal):
 1. finsum R g S = f c \<oplus> k \<oplus> finsum R f (S - {c})
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finsum R g S = f c \<oplus> k \<oplus> finsum R f (S - {c})

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
have "finsum R g S = k \<oplus> ( f c \<oplus> finsum R f (S - {c}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
have "f c \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f c \<in> carrier R
[PROOF STEP]
by (metis PiE assms(2) assms(5))
[PROOF STATE]
proof (state)
this:
f c \<in> carrier R

goal (1 subgoal):
 1. finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
have "finsum R f (S - {c}) \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f (S - {c}) \<in> carrier R
[PROOF STEP]
by (metis Pi_split_insert_domain assms(2) assms(5) finsum_closed insert_Diff)
[PROOF STATE]
proof (state)
this:
finsum R f (S - {c}) \<in> carrier R

goal (1 subgoal):
 1. finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finsum R f (S - {c}) \<in> carrier R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finsum R f (S - {c}) \<in> carrier R

goal (1 subgoal):
 1. finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
using assms(4) 1
[PROOF STATE]
proof (prove)
using this:
finsum R f (S - {c}) \<in> carrier R
k \<in> carrier R
finsum R g S = f c \<oplus> k \<oplus> finsum R f (S - {c})

goal (1 subgoal):
 1. finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
using \<open>f c \<in> carrier R\<close> add.m_assoc add.m_lcomm
[PROOF STATE]
proof (prove)
using this:
finsum R f (S - {c}) \<in> carrier R
k \<in> carrier R
finsum R g S = f c \<oplus> k \<oplus> finsum R f (S - {c})
f c \<in> carrier R
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R; ?z \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<oplus> ?y \<oplus> ?z = ?x \<oplus> (?y \<oplus> ?z)
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R; ?z \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<oplus> (?y \<oplus> ?z) = ?y \<oplus> (?x \<oplus> ?z)

goal (1 subgoal):
 1. finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
using "0"
[PROOF STATE]
proof (prove)
using this:
finsum R g S = k \<oplus> (f c \<oplus> finsum R f (S - {c}))
finsum R f S = f c \<oplus> finsum R f (S - {c})

goal (1 subgoal):
 1. finsum R g S = k \<oplus> finsum R f S
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finsum R g S = k \<oplus> finsum R f S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Decrypt_Decrypt_eq [iff]: "(Decrypt K X = Decrypt K X') = (X=X')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Decrypt K X = Decrypt K X') = (X = X')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Decrypt K X = Decrypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
assume "Decrypt K X = Decrypt K X'"
[PROOF STATE]
proof (state)
this:
Decrypt K X = Decrypt K X'

goal (2 subgoals):
 1. Decrypt K X = Decrypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
hence "Crypt K (Decrypt K X) = Crypt K (Decrypt K X')"
[PROOF STATE]
proof (prove)
using this:
Decrypt K X = Decrypt K X'

goal (1 subgoal):
 1. Crypt K (Decrypt K X) = Crypt K (Decrypt K X')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Crypt K (Decrypt K X) = Crypt K (Decrypt K X')

goal (2 subgoals):
 1. Decrypt K X = Decrypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
thus "X = X'"
[PROOF STATE]
proof (prove)
using this:
Crypt K (Decrypt K X) = Crypt K (Decrypt K X')

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

goal (1 subgoal):
 1. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
assume "X = X'"
[PROOF STATE]
proof (state)
this:
X = X'

goal (1 subgoal):
 1. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
thus "Decrypt K X = Decrypt K X'"
[PROOF STATE]
proof (prove)
using this:
X = X'

goal (1 subgoal):
 1. Decrypt K X = Decrypt K X'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Decrypt K X = Decrypt K X'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_swapped_skel:
assumes "wls s X" and "(X,Y) \<in> swapped"
shows "skel Y = skel X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. skel Y = skel X
[PROOF STEP]
apply(rule swapped_skel)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. good X
 2. (X, Y) \<in> swapped
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
(X, Y) \<in> swapped

goal (2 subgoals):
 1. good X
 2. (X, Y) \<in> swapped
[PROOF STEP]
by auto


[STATEMENT]
lemma lnull_ldropn [simp]: "lnull (ldropn n xs) \<longleftrightarrow> llength xs \<le> enat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnull (ldropn n xs) = (llength xs \<le> enat n)
[PROOF STEP]
proof(induction n arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. lnull (ldropn 0 xs) = (llength xs \<le> enat 0)
 2. \<And>n xs. (\<And>xs. lnull (ldropn n xs) = (llength xs \<le> enat n)) \<Longrightarrow> lnull (ldropn (Suc n) xs) = (llength xs \<le> enat (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
lnull (ldropn n ?xs) = (llength ?xs \<le> enat n)

goal (2 subgoals):
 1. \<And>xs. lnull (ldropn 0 xs) = (llength xs \<le> enat 0)
 2. \<And>n xs. (\<And>xs. lnull (ldropn n xs) = (llength xs \<le> enat n)) \<Longrightarrow> lnull (ldropn (Suc n) xs) = (llength xs \<le> enat (Suc n))
[PROOF STEP]
from Suc.IH[of "ltl xs"]
[PROOF STATE]
proof (chain)
picking this:
lnull (ldropn n (ltl xs)) = (llength (ltl xs) \<le> enat n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
lnull (ldropn n (ltl xs)) = (llength (ltl xs) \<le> enat n)

goal (1 subgoal):
 1. lnull (ldropn (Suc n) xs) = (llength xs \<le> enat (Suc n))
[PROOF STEP]
by(cases xs)(simp_all add: eSuc_enat[symmetric])
[PROOF STATE]
proof (state)
this:
lnull (ldropn (Suc n) xs) = (llength xs \<le> enat (Suc n))

goal (1 subgoal):
 1. \<And>xs. lnull (ldropn 0 xs) = (llength xs \<le> enat 0)
[PROOF STEP]
qed(simp add: zero_enat_def[symmetric])


[STATEMENT]
lemma filterlim_tendsto_pos_mult_at_top:
  assumes f: "(f \<longlongrightarrow> c) F"
    and c: "0 < c"
    and g: "LIM x F. g x :> at_top"
  shows "LIM x F. (f x * g x :: real) :> at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top
[PROOF STEP]
unfolding filterlim_at_top_gt[where c=0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Z>0. \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
fix Z :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
assume "0 < Z"
[PROOF STATE]
proof (state)
this:
0 < Z

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
from f \<open>0 < c\<close>
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> c) F
0 < c
[PROOF STEP]
have "eventually (\<lambda>x. c / 2 < f x) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> c) F
0 < c

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. c / 2 < f x
[PROOF STEP]
by (auto dest!: tendstoD[where e="c / 2"] elim!: eventually_mono
        simp: dist_real_def abs_real_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. c / 2 < f x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. c / 2 < f x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
from g
[PROOF STATE]
proof (chain)
picking this:
filterlim g at_top F
[PROOF STEP]
have "eventually (\<lambda>x. (Z / c * 2) \<le> g x) F"
[PROOF STATE]
proof (prove)
using this:
filterlim g at_top F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z / c * 2 \<le> g x
[PROOF STEP]
unfolding filterlim_at_top
[PROOF STATE]
proof (prove)
using this:
\<forall>Z. \<forall>\<^sub>F x in F. Z \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z / c * 2 \<le> g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. Z / c * 2 \<le> g x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. c / 2 < f x
\<forall>\<^sub>F x in F. Z / c * 2 \<le> g x
[PROOF STEP]
show "eventually (\<lambda>x. Z \<le> f x * g x) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. c / 2 < f x
\<forall>\<^sub>F x in F. Z / c * 2 \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>c / 2 < f x; Z / c * 2 \<le> g x\<rbrakk> \<Longrightarrow> Z \<le> f x * g x
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
c / 2 < f x
Z / c * 2 \<le> g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>c / 2 < f x; Z / c * 2 \<le> g x\<rbrakk> \<Longrightarrow> Z \<le> f x * g x
[PROOF STEP]
with \<open>0 < Z\<close> \<open>0 < c\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < Z
0 < c
c / 2 < f x
Z / c * 2 \<le> g x
[PROOF STEP]
have "c / 2 * (Z / c * 2) \<le> f x * g x"
[PROOF STATE]
proof (prove)
using this:
0 < Z
0 < c
c / 2 < f x
Z / c * 2 \<le> g x

goal (1 subgoal):
 1. c / 2 * (Z / c * 2) \<le> f x * g x
[PROOF STEP]
by (intro mult_mono) (auto simp: zero_le_divide_iff)
[PROOF STATE]
proof (state)
this:
c / 2 * (Z / c * 2) \<le> f x * g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>c / 2 < f x; Z / c * 2 \<le> g x\<rbrakk> \<Longrightarrow> Z \<le> f x * g x
[PROOF STEP]
with \<open>0 < c\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < c
c / 2 * (Z / c * 2) \<le> f x * g x
[PROOF STEP]
show "Z \<le> f x * g x"
[PROOF STATE]
proof (prove)
using this:
0 < c
c / 2 * (Z / c * 2) \<le> f x * g x

goal (1 subgoal):
 1. Z \<le> f x * g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Z \<le> f x * g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. Z \<le> f x * g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_col_first_dim[simp]:
  "dim_row (mat_col_first A n) = dim_row A"
  "dim_col (mat_col_first A n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_col_first A n) = dim_row A &&& dim_col (mat_col_first A n) = n
[PROOF STEP]
unfolding mat_col_first_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_row_first A\<^sup>T n)\<^sup>T = dim_row A &&& dim_col (mat_row_first A\<^sup>T n)\<^sup>T = n
[PROOF STEP]
by simp_all


[STATEMENT]
lemma integral_cos [simp]:
  fixes a::real
  assumes "a \<le> b" shows "integral {a..b} cos = sin b - sin a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..b} cos = sin b - sin a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral {a..b} cos = sin b - sin a
[PROOF STEP]
have "(cos has_integral (sin b - sin a)) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos has_integral sin b - sin a) {a..b}
[PROOF STEP]
proof (rule fundamental_theorem_of_calculus)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> b
 2. \<And>x. x \<in> {a..b} \<Longrightarrow> (sin has_vector_derivative cos x) (at x within {a..b})
[PROOF STEP]
show "(sin has_vector_derivative cos x) (at x within {a..b})" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin has_vector_derivative cos x) (at x within {a..b})
[PROOF STEP]
unfolding has_real_derivative_iff_has_vector_derivative [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin has_real_derivative cos x) (at x within {a..b})
[PROOF STEP]
by (rule derivative_eq_intros | force)+
[PROOF STATE]
proof (state)
this:
(sin has_vector_derivative cos ?x) (at ?x within {a..b})

goal (1 subgoal):
 1. a \<le> b
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
(cos has_integral sin b - sin a) {a..b}

goal (1 subgoal):
 1. integral {a..b} cos = sin b - sin a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(cos has_integral sin b - sin a) {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(cos has_integral sin b - sin a) {a..b}

goal (1 subgoal):
 1. integral {a..b} cos = sin b - sin a
[PROOF STEP]
by (simp add: integral_unique)
[PROOF STATE]
proof (state)
this:
integral {a..b} cos = sin b - sin a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_field_derivative_zero_constant:
  assumes "convex s" "\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative 0) (at x within s)"
  shows   "\<exists>c. \<forall>x\<in>s. f (x) = (c :: 'a :: real_normed_field)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
proof (rule has_derivative_zero_constant)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convex s
 2. \<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0::'a)) (at x within s)
[PROOF STEP]
have A: "(*) 0 = (\<lambda>_. 0 :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*) (0::'a) = (\<lambda>_. 0::'a)
[PROOF STEP]
by (intro ext) simp
[PROOF STATE]
proof (state)
this:
(*) (0::'a) = (\<lambda>_. 0::'a)

goal (2 subgoals):
 1. convex s
 2. \<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0::'a)) (at x within s)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convex s
 2. \<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0::'a)) (at x within s)
[PROOF STEP]
assume "x \<in> s"
[PROOF STATE]
proof (state)
this:
x \<in> s

goal (2 subgoals):
 1. convex s
 2. \<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0::'a)) (at x within s)
[PROOF STEP]
thus "(f has_derivative (\<lambda>h. 0)) (at x within s)"
[PROOF STATE]
proof (prove)
using this:
x \<in> s

goal (1 subgoal):
 1. (f has_derivative (\<lambda>h. 0::'a)) (at x within s)
[PROOF STEP]
using assms(2)[of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> s
x \<in> s \<Longrightarrow> (f has_field_derivative (0::'a)) (at x within s)

goal (1 subgoal):
 1. (f has_derivative (\<lambda>h. 0::'a)) (at x within s)
[PROOF STEP]
by (simp add: has_field_derivative_def A)
[PROOF STATE]
proof (state)
this:
(f has_derivative (\<lambda>h. 0::'a)) (at x within s)

goal (1 subgoal):
 1. convex s
[PROOF STEP]
qed fact


[STATEMENT]
lemma multisetLeListDiff:
assumes
  "trans r"
shows
  "multiset_le (mset (list_diff a b)) (mset a) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiset_le (mset (list_diff a b)) (mset a) r
[PROOF STEP]
proof (induct a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. multiset_le (mset (list_diff [] b)) (mset []) r
 2. \<And>a1 a2. multiset_le (mset (list_diff a2 b)) (mset a2) r \<Longrightarrow> multiset_le (mset (list_diff (a1 # a2) b)) (mset (a1 # a2)) r
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. multiset_le (mset (list_diff [] b)) (mset []) r
 2. \<And>a1 a2. multiset_le (mset (list_diff a2 b)) (mset a2) r \<Longrightarrow> multiset_le (mset (list_diff (a1 # a2) b)) (mset (a1 # a2)) r
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiset_le (mset (list_diff [] b)) (mset []) r
[PROOF STEP]
unfolding multiset_le_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (list_diff [] b) = mset [] \<or> (mset (list_diff [] b), mset []) \<in> mult r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
multiset_le (mset (list_diff [] b)) (mset []) r

goal (1 subgoal):
 1. \<And>a1 a2. multiset_le (mset (list_diff a2 b)) (mset a2) r \<Longrightarrow> multiset_le (mset (list_diff (a1 # a2) b)) (mset (a1 # a2)) r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a1 a2. multiset_le (mset (list_diff a2 b)) (mset a2) r \<Longrightarrow> multiset_le (mset (list_diff (a1 # a2) b)) (mset (a1 # a2)) r
[PROOF STEP]
case (Cons x a')
[PROOF STATE]
proof (state)
this:
multiset_le (mset (list_diff a' b)) (mset a') r

goal (1 subgoal):
 1. \<And>a1 a2. multiset_le (mset (list_diff a2 b)) (mset a2) r \<Longrightarrow> multiset_le (mset (list_diff (a1 # a2) b)) (mset (a1 # a2)) r
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
multiset_le (mset (list_diff a' b)) (mset a') r

goal (1 subgoal):
 1. multiset_le (mset (list_diff (x # a') b)) (mset (x # a')) r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
multiset_le (mset (list_diff a' b)) (mset a') r
trans r

goal (1 subgoal):
 1. multiset_le (mset (list_diff (x # a') b)) (mset (x # a')) r
[PROOF STEP]
using multisetEmptyLeI[of "{#x#}" "r"]
[PROOF STATE]
proof (prove)
using this:
multiset_le (mset (list_diff a' b)) (mset a') r
trans r
multiset_le {#} {#x#} r

goal (1 subgoal):
 1. multiset_le (mset (list_diff (x # a') b)) (mset (x # a')) r
[PROOF STEP]
using multisetUnionLeMono[of "r" "mset (list_diff a' b)" "mset a'" "{#}" "{#x#}"]
[PROOF STATE]
proof (prove)
using this:
multiset_le (mset (list_diff a' b)) (mset a') r
trans r
multiset_le {#} {#x#} r
\<lbrakk>trans r; multiset_le (mset (list_diff a' b)) (mset a') r; multiset_le {#} {#x#} r\<rbrakk> \<Longrightarrow> multiset_le (mset (list_diff a' b) + {#}) (mset a' + {#x#}) r

goal (1 subgoal):
 1. multiset_le (mset (list_diff (x # a') b)) (mset (x # a')) r
[PROOF STEP]
using multisetUnionLeMono1[of "r" "mset (list_diff a' b)" "mset a'" "{#x#}"]
[PROOF STATE]
proof (prove)
using this:
multiset_le (mset (list_diff a' b)) (mset a') r
trans r
multiset_le {#} {#x#} r
\<lbrakk>trans r; multiset_le (mset (list_diff a' b)) (mset a') r; multiset_le {#} {#x#} r\<rbrakk> \<Longrightarrow> multiset_le (mset (list_diff a' b) + {#}) (mset a' + {#x#}) r
\<lbrakk>trans r; multiset_le (mset (list_diff a' b)) (mset a') r\<rbrakk> \<Longrightarrow> multiset_le (mset (list_diff a' b) + {#x#}) (mset a' + {#x#}) r

goal (1 subgoal):
 1. multiset_le (mset (list_diff (x # a') b)) (mset (x # a')) r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
multiset_le (mset (list_diff (x # a') b)) (mset (x # a')) r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_is_max_div:
   assumes m0: "m \<noteq> 0" and p: "prime p"
   shows "~ p dvd (m div (p^(multiplicity p m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> p dvd m div p ^ multiplicity p m
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> \<not> p dvd m div p ^ multiplicity p m \<Longrightarrow> False
[PROOF STEP]
assume "~ ~ p dvd (m div (p^(multiplicity p m)))"
[PROOF STATE]
proof (state)
this:
\<not> \<not> p dvd m div p ^ multiplicity p m

goal (1 subgoal):
 1. \<not> \<not> p dvd m div p ^ multiplicity p m \<Longrightarrow> False
[PROOF STEP]
hence a:"p dvd (m div (p^(multiplicity p m)))"
[PROOF STATE]
proof (prove)
using this:
\<not> \<not> p dvd m div p ^ multiplicity p m

goal (1 subgoal):
 1. p dvd m div p ^ multiplicity p m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p dvd m div p ^ multiplicity p m

goal (1 subgoal):
 1. \<not> \<not> p dvd m div p ^ multiplicity p m \<Longrightarrow> False
[PROOF STEP]
from m0
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> (0::'a)
[PROOF STEP]
have "p^(multiplicity p m) dvd m"
[PROOF STATE]
proof (prove)
using this:
m \<noteq> (0::'a)

goal (1 subgoal):
 1. p ^ multiplicity p m dvd m
[PROOF STEP]
by (auto simp add: multiplicity_dvd)
[PROOF STATE]
proof (state)
this:
p ^ multiplicity p m dvd m

goal (1 subgoal):
 1. \<not> \<not> p dvd m div p ^ multiplicity p m \<Longrightarrow> False
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
p dvd m div p ^ multiplicity p m
p ^ multiplicity p m dvd m
[PROOF STEP]
have "p^Suc (multiplicity p m) dvd m"
[PROOF STATE]
proof (prove)
using this:
p dvd m div p ^ multiplicity p m
p ^ multiplicity p m dvd m

goal (1 subgoal):
 1. p ^ Suc (multiplicity p m) dvd m
[PROOF STEP]
by (subst (asm) dvd_div_iff_mult) auto
[PROOF STATE]
proof (state)
this:
p ^ Suc (multiplicity p m) dvd m

goal (1 subgoal):
 1. \<not> \<not> p dvd m div p ^ multiplicity p m \<Longrightarrow> False
[PROOF STEP]
with m0 p
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> (0::'a)
prime p
p ^ Suc (multiplicity p m) dvd m
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
m \<noteq> (0::'a)
prime p
p ^ Suc (multiplicity p m) dvd m

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_unique_p:
  assumes "conjugate f g"
      and "conjugate f h"
    shows "uminus \<circ> g = uminus \<circ> h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uminus \<circ> g = uminus \<circ> h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. uminus \<circ> g = uminus \<circ> h
[PROOF STEP]
have "\<forall>x y . x \<sqinter> g y = bot \<longleftrightarrow> x \<sqinter> h y = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x \<sqinter> g y = bot) = (x \<sqinter> h y = bot)
[PROOF STEP]
using assms conjugate_def inf.commute
[PROOF STATE]
proof (prove)
using this:
conjugate f g
conjugate f h
conjugate ?f ?g \<equiv> \<forall>x y. (?f x \<sqinter> y = bot) = (x \<sqinter> ?g y = bot)
?a \<sqinter> ?b = ?b \<sqinter> ?a

goal (1 subgoal):
 1. \<forall>x y. (x \<sqinter> g y = bot) = (x \<sqinter> h y = bot)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x y. (x \<sqinter> g y = bot) = (x \<sqinter> h y = bot)

goal (1 subgoal):
 1. uminus \<circ> g = uminus \<circ> h
[PROOF STEP]
hence "\<forall>x y . x \<le> -(g y) \<longleftrightarrow> x \<le> -(h y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x \<sqinter> g y = bot) = (x \<sqinter> h y = bot)

goal (1 subgoal):
 1. \<forall>x y. (x \<le> - g y) = (x \<le> - h y)
[PROOF STEP]
using inf.commute pseudo_complement
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x \<sqinter> g y = bot) = (x \<sqinter> h y = bot)
?a \<sqinter> ?b = ?b \<sqinter> ?a
(?x \<sqinter> ?y = bot) = (?x \<le> - ?y)

goal (1 subgoal):
 1. \<forall>x y. (x \<le> - g y) = (x \<le> - h y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x y. (x \<le> - g y) = (x \<le> - h y)

goal (1 subgoal):
 1. uminus \<circ> g = uminus \<circ> h
[PROOF STEP]
hence "\<forall>y . -(g y) = -(h y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x \<le> - g y) = (x \<le> - h y)

goal (1 subgoal):
 1. \<forall>y. - g y = - h y
[PROOF STEP]
using order.eq_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x \<le> - g y) = (x \<le> - h y)
(?a = ?b) = (?a \<le> ?b \<and> ?b \<le> ?a)

goal (1 subgoal):
 1. \<forall>y. - g y = - h y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>y. - g y = - h y

goal (1 subgoal):
 1. uminus \<circ> g = uminus \<circ> h
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>y. - g y = - h y

goal (1 subgoal):
 1. uminus \<circ> g = uminus \<circ> h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uminus \<circ> g = uminus \<circ> h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ccspan_Times_sing1: \<open>ccspan ({0::'a::complex_normed_vector} \<times> B) = ccsubspace_Times 0 (ccspan B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan ({0::'a} \<times> B) = ccsubspace_Times 0 (ccspan B)
[PROOF STEP]
proof (transfer fixing: B)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
have \<open>closure (cspan ({0::'a} \<times> B)) = closure ({0} \<times> cspan B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = closure ({0::'a} \<times> cspan B)
[PROOF STEP]
by (simp add: complex_vector.span_Times_sing1)
[PROOF STATE]
proof (state)
this:
closure (cspan ({0::'a} \<times> B)) = closure ({0::'a} \<times> cspan B)

goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure (cspan ({0::'a} \<times> B)) = closure ({0::'a} \<times> cspan B)

goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
have \<open>\<dots> = closure {0} \<times> closure (cspan B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure ({0::'a} \<times> cspan B) = closure {0::'a} \<times> closure (cspan B)
[PROOF STEP]
using closure_Times
[PROOF STATE]
proof (prove)
using this:
closure (?A \<times> ?B) = closure ?A \<times> closure ?B

goal (1 subgoal):
 1. closure ({0::'a} \<times> cspan B) = closure {0::'a} \<times> closure (cspan B)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closure ({0::'a} \<times> cspan B) = closure {0::'a} \<times> closure (cspan B)

goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure ({0::'a} \<times> cspan B) = closure {0::'a} \<times> closure (cspan B)

goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
have \<open>\<dots> = {0} \<times> closure (cspan B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure {0::'a} \<times> closure (cspan B) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closure {0::'a} \<times> closure (cspan B) = {0::'a} \<times> closure (cspan B)

goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
show \<open>closure (cspan ({0::'a} \<times> B)) = {0} \<times> closure (cspan B)\<close>
[PROOF STATE]
proof (prove)
using this:
closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)

goal (1 subgoal):
 1. closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
closure (cspan ({0::'a} \<times> B)) = {0::'a} \<times> closure (cspan B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vcard_vempty: "vcard A = 0 \<longleftrightarrow> A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vcard A = 0) = (A = 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (vcard A = 0) = (A = 0)
[PROOF STEP]
have vcard_A: "vcard A \<approx>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard A \<approx>\<^sub>\<circ> A
[PROOF STEP]
by (simp add: cardinal_eqpoll)
[PROOF STATE]
proof (state)
this:
vcard A \<approx>\<^sub>\<circ> A

goal (1 subgoal):
 1. (vcard A = 0) = (A = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vcard A \<approx>\<^sub>\<circ> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vcard A \<approx>\<^sub>\<circ> A

goal (1 subgoal):
 1. (vcard A = 0) = (A = 0)
[PROOF STEP]
using eq0_iff eqpoll_iff_bijections
[PROOF STATE]
proof (prove)
using this:
vcard A \<approx>\<^sub>\<circ> A
(?x = 0) = (\<forall>y. y \<notin>\<^sub>\<circ> ?x)
(?A \<approx> ?B) = (\<exists>f g. (\<forall>x\<in>?A. f x \<in> ?B \<and> g (f x) = x) \<and> (\<forall>y\<in>?B. g y \<in> ?A \<and> f (g y) = y))

goal (1 subgoal):
 1. (vcard A = 0) = (A = 0)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(vcard A = 0) = (A = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_key_plus:
  "map_key f (p + q) = map_key f p + map_key f q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_key f (p + q) = map_key f p + map_key f q
[PROOF STEP]
by transfer (simp add: fun_eq_iff)


[STATEMENT]
lemma msetext_huet_mono_strong:
  "(\<forall>y \<in> set ys. \<forall>x \<in> set xs. gt y x \<longrightarrow> gt' y x) \<Longrightarrow> msetext_huet gt ys xs \<Longrightarrow> msetext_huet gt' ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>set ys. \<forall>x\<in>set xs. gt y x \<longrightarrow> gt' y x; msetext_huet gt ys xs\<rbrakk> \<Longrightarrow> msetext_huet gt' ys xs
[PROOF STEP]
unfolding msetext_huet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>set ys. \<forall>x\<in>set xs. gt y x \<longrightarrow> gt' y x; let N = mset ys; M = mset xs in M \<noteq> N \<and> (\<forall>x. count N x < count M x \<longrightarrow> (\<exists>y. gt y x \<and> count M y < count N y))\<rbrakk> \<Longrightarrow> let N = mset ys; M = mset xs in M \<noteq> N \<and> (\<forall>x. count N x < count M x \<longrightarrow> (\<exists>y. gt' y x \<and> count M y < count N y))
[PROOF STEP]
by (metis less_le_trans mem_Collect_eq not_le not_less0 set_mset_mset[unfolded set_mset_def])


[STATEMENT]
lemma ennreal_spmf_map: "ennreal (spmf (map_spmf f p) x) = emeasure (measure_spmf p) (f -` {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (spmf (map_spmf f p) x) = emeasure (measure_spmf p) (f -` {x})
[PROOF STEP]
by(auto simp add: ennreal_pmf_map measure_spmf_def emeasure_distr emeasure_restrict_space space_restrict_space intro: arg_cong2[where f=emeasure])


[STATEMENT]
lemma size_regex_positive: "size (r :: ('a, 't :: timestamp) regex) > Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < size r
[PROOF STEP]
by (induction r) (auto intro: size_formula_positive)


[STATEMENT]
lemma product_iff:
  "x \<in> A \<otimes> B \<longleftrightarrow> (\<exists>a \<in> A. \<exists>b \<in> B. x = a |\<union>| b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> A \<otimes> B) = (\<exists>a\<in>A. \<exists>b\<in>B. x = a |\<union>| b)
[PROOF STEP]
unfolding product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {a |\<union>| b |a b. a \<in> A \<and> b \<in> B}) = (\<exists>a\<in>A. \<exists>b\<in>B. x = a |\<union>| b)
[PROOF STEP]
by blast


[STATEMENT]
lemma boolean_is_boolean_II:
  "class.boolean_algebra_II uminus inf sup bot top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.boolean_algebra_II uminus inf_class.inf sup_class.sup bot_class.bot top_class.top
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (9 subgoals):
 1. \<And>x y z. sup_class.sup x (sup_class.sup y z) = sup_class.sup (sup_class.sup x y) z
 2. \<And>x y. sup_class.sup x y = sup_class.sup y x
 3. \<And>x y. inf_class.inf x y = inf_class.inf y x
 4. \<And>x y z. inf_class.inf x (inf_class.inf y z) = inf_class.inf (inf_class.inf x y) z
 5. \<And>x y. sup_class.sup x (inf_class.inf x y) = x
 6. \<And>x y. inf_class.inf x (sup_class.sup x y) = x
 7. \<And>x y z. sup_class.sup x (inf_class.inf y z) = inf_class.inf (sup_class.sup x y) (sup_class.sup x z)
 8. \<And>x. sup_class.sup x (- x) = top_class.top
 9. \<And>x. inf_class.inf x (- x) = bot_class.bot
[PROOF STEP]
apply (metis sup_assoc sup_commute sup_inf_absorb sup_compl_top
             inf_assoc inf_commute inf_sup_absorb inf_compl_bot
             sup_inf_distrib1)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma squarefree_bernoulli_denom: "squarefree (bernoulli_denom n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squarefree (bernoulli_denom n)
[PROOF STEP]
by (auto intro!: squarefree_prod_coprime primes_coprime
           simp: bernoulli_denom_def squarefree_prime)


[STATEMENT]
theorem prod_sum_PiE:
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c :: comm_semiring_1"
  assumes finite: "finite A" and finite: "\<And>x. x \<in> A \<Longrightarrow> finite (B x)"
  shows   "(\<Prod>x\<in>A. \<Sum>y\<in>B x. f x y) = (\<Sum>g\<in>PiE A B. \<Prod>x\<in>A. f x (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x\<in>A. f x (g x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
?x \<in> A \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x\<in>A. f x (g x))
[PROOF STEP]
proof (induction A rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>x. x \<in> {} \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>{}. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E {} B. \<Prod>x\<in>{}. f x (g x))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?x \<in> {} \<Longrightarrow> finite (B ?x)

goal (2 subgoals):
 1. (\<And>x. x \<in> {} \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>{}. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E {} B. \<Prod>x\<in>{}. f x (g x))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?x \<in> {} \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. (\<Prod>x\<in>{}. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E {} B. \<Prod>x\<in>{}. f x (g x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>{}. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E {} B. \<Prod>x\<in>{}. f x (g x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x\<in>A. f x (g x))
?x \<in> insert x A \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
have "(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x)) =
          (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (g x')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (g x')))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x\<in>A. f x (g x))
?x \<in> insert x A \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (g x')))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (g x')))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (g x')))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
have "(\<lambda>g. \<Prod>x'\<in>A. f x' (g x')) = (\<lambda>g. \<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>g. \<Prod>x'\<in>A. f x' (g x')) = (\<lambda>g. \<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x\<in>A. f x (g x))
?x \<in> insert x A \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. (\<lambda>g. \<Prod>x'\<in>A. f x' (g x')) = (\<lambda>g. \<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))
[PROOF STEP]
by (intro ext prod.cong) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>g. \<Prod>x'\<in>A. f x' (g x')) = (\<lambda>g. \<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>g. \<Prod>x'\<in>A. f x' (g x')) = (\<lambda>g. \<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
have "(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * \<dots> g) =
               (\<Sum>(y,g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))) = (\<Sum>(y, g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))
[PROOF STEP]
using insert.prems insert.hyps
[PROOF STATE]
proof (prove)
using this:
?x \<in> insert x A \<Longrightarrow> finite (B ?x)
finite A
x \<notin> A

goal (1 subgoal):
 1. (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))) = (\<Sum>(y, g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>(y,g). g(x := y)" "\<lambda>g. (g x, g(x := undefined))"])
       (auto simp: PiE_def extensional_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))) = (\<Sum>(y, g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. f x (g x) * (\<Prod>x'\<in>A. f x' (if x' = x then undefined else g x'))) = (\<Sum>(y, g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
have "\<dots> = (\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(y, g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x'))) = (\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))
[PROOF STEP]
by (subst sum.cartesian_product) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x'))) = (\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, g)\<in>B x \<times> Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x'))) = (\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x')))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
have "\<dots> = (\<Sum>y\<in>B x. f x y) * (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x'))) = sum (f x) (B x) * (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x'))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x\<in>A. f x (g x))
?x \<in> insert x A \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. (\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x'))) = sum (f x) (B x) * (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x'))
[PROOF STEP]
by (subst sum.swap) (simp add: sum_distrib_left sum_distrib_right)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x'))) = sum (f x) (B x) * (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x'))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>B x. \<Sum>g\<in>Pi\<^sub>E A B. f x y * (\<Prod>x'\<in>A. f x' (g x'))) = sum (f x) (B x) * (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x'))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
have "(\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x')) = (\<Prod>x\<in>A. \<Sum>y\<in>B x. f x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x')) = (\<Prod>x\<in>A. sum (f x) (B x))
[PROOF STEP]
using insert.prems
[PROOF STATE]
proof (prove)
using this:
?x \<in> insert x A \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. (\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x')) = (\<Prod>x\<in>A. sum (f x) (B x))
[PROOF STEP]
by (intro insert.IH [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x')) = (\<Prod>x\<in>A. sum (f x) (B x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>g\<in>Pi\<^sub>E A B. \<Prod>x'\<in>A. f x' (g x')) = (\<Prod>x\<in>A. sum (f x) (B x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
have "(\<Sum>y\<in>B x. f x y) * \<dots> = (\<Prod>x\<in>insert x A. \<Sum>y\<in>B x. f x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (f x) (B x) * (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Prod>x\<in>insert x A. sum (f x) (B x))
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. sum (f x) (B x) * (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Prod>x\<in>insert x A. sum (f x) (B x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum (f x) (B x) * (\<Prod>x\<in>A. sum (f x) (B x)) = (\<Prod>x\<in>insert x A. sum (f x) (B x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> finite (B x)) \<Longrightarrow> (\<Prod>x\<in>F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E F B. \<Prod>x\<in>F. f x (g x)); \<And>xa. xa \<in> insert x F \<Longrightarrow> finite (B xa)\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>insert x F. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x F) B. \<Prod>x\<in>insert x F. f x (g x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x)) = (\<Prod>x\<in>insert x A. sum (f x) (B x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x)) = (\<Prod>x\<in>insert x A. sum (f x) (B x))

goal (1 subgoal):
 1. (\<Prod>x\<in>insert x A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>insert x A. sum (f x) (B x)) = (\<Sum>g\<in>Pi\<^sub>E (insert x A) B. \<Prod>x\<in>insert x A. f x (g x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pair_qbs_closed1: "qbs_closed1 (pair_qbs_Mx (X::'a quasi_borel) (Y::'b quasi_borel))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_closed1 (pair_qbs_Mx X Y)
[PROOF STEP]
unfolding pair_qbs_Mx_def qbs_closed1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>{f. fst \<circ> f \<in> qbs_Mx X \<and> snd \<circ> f \<in> qbs_Mx Y}. \<forall>f\<in>borel_measurable real_borel. a \<circ> f \<in> {f. fst \<circ> f \<in> qbs_Mx X \<and> snd \<circ> f \<in> qbs_Mx Y}
[PROOF STEP]
by (metis (no_types, lifting) comp_assoc mem_Collect_eq qbs_closed1_dest)


[STATEMENT]
lemma Bij_imp_extensional: "f \<in> Bij S \<Longrightarrow> f \<in> extensional S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> Bij S \<Longrightarrow> f \<in> extensional S
[PROOF STEP]
by (simp add: Bij_def)


[STATEMENT]
lemma mat_pow_ring_pow: assumes mat: "mat n n (m :: ('a :: semiring_1)mat)" shows "mat_pow n m k = m [^]\<^bsub>mat_ring n b\<^esub> k"
  (is "_ = m [^]\<^bsub>?C\<^esub> k")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_pow n m k = m [^]\<^bsub>mat_ring n b\<^esub> k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_pow n m k = m [^]\<^bsub>mat_ring n b\<^esub> k
[PROOF STEP]
interpret semiring ?C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semiring (mat_ring n b)
[PROOF STEP]
by (rule mat_semiring)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_pow n m k = m [^]\<^bsub>mat_ring n b\<^esub> k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_pow n m k = m [^]\<^bsub>mat_ring n b\<^esub> k
[PROOF STEP]
by (induct k, auto, auto simp: mat_ring_def)
[PROOF STATE]
proof (state)
this:
mat_pow n m k = m [^]\<^bsub>mat_ring n b\<^esub> k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_of_nat_eq [simp]:
"(ordinal_of_nat x = ordinal_of_nat y) = (x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ordinal_of_nat x = ordinal_of_nat y) = (x = y)
[PROOF STEP]
by (rule strict_mono_cancel_eq[OF strict_mono_ordinal_of_nat])


[STATEMENT]
lemma times_mk_dimvec [code, si_def]:
  "(mk_dimvec xs * mk_dimvec ys :: ('n::ring_1, 'a::enum) dimvec) =
  (if (length xs = CARD('a) \<and> length ys = CARD('a))
    then mk_dimvec (map (\<lambda> (x, y). x + y) (zip xs ys))
    else if length xs = CARD('a) then mk_dimvec xs else mk_dimvec ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_dimvec xs \<cdot> mk_dimvec ys = (if length xs = CARD('a) \<and> length ys = CARD('a) then mk_dimvec (map2 (+) xs ys) else if length xs = CARD('a) then mk_dimvec xs else mk_dimvec ys)
[PROOF STEP]
by (auto simp add: times_dimvec_def mk_dimvec_def fun_eq_iff one_dimvec_def)


[STATEMENT]
lemma combine_union_sets_set_sub1:
  assumes "\<forall>xs \<in> Y. \<forall>ys \<in> Y. xs = ys \<or> set xs \<inter> set ys = {}"
      and "\<forall>ys \<in> X. \<exists>U \<in> Y. \<exists>V \<in> Y. U@V = ys"
    shows "\<Union>(set ` Y) \<subseteq> \<Union>(set ` (X \<union> {x. x \<in> Y \<and> set x \<inter> \<Union>(set ` X) = {}}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set ` Y) \<subseteq> \<Union> (set ` (X \<union> {x \<in> Y. set x \<inter> \<Union> (set ` X) = {}}))
[PROOF STEP]
using combine_union_sets_set_sub1_aux[OF assms]
[PROOF STATE]
proof (prove)
using this:
?x \<in> \<Union> (set ` Y) \<Longrightarrow> ?x \<in> \<Union> (set ` (X \<union> {x \<in> Y. set x \<inter> \<Union> (set ` X) = {}}))

goal (1 subgoal):
 1. \<Union> (set ` Y) \<subseteq> \<Union> (set ` (X \<union> {x \<in> Y. set x \<inter> \<Union> (set ` X) = {}}))
[PROOF STEP]
by blast


[STATEMENT]
theorem lookup_val_cons: "lookup (Val a) (x # xs) = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (Val a) (x # xs) = None
[PROOF STEP]
by simp


[STATEMENT]
lemma complex_diff_cnj: "z - cnj z = complex_of_real (2 * Im z) * \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z - cnj z = complex_of_real (2 * Im z) * \<i>
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma iFROM_iT_Div_Int: "
  \<lbrakk> 0 < k; n \<le> iMin A \<rbrakk> \<Longrightarrow> (A \<inter> [n\<dots>]) \<oslash> k = (A \<oslash> k) \<inter> ([n\<dots>] \<oslash> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n \<le> iMin A\<rbrakk> \<Longrightarrow> A \<inter> [n\<dots>] \<oslash> k = (A \<oslash> k) \<inter> ([n\<dots>] \<oslash> k)
[PROOF STEP]
apply (rule subset_iT_Div_Int)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n \<le> iMin A\<rbrakk> \<Longrightarrow> A \<subseteq> [n\<dots>]
[PROOF STEP]
apply (blast intro: order_trans iMin_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma n_mult_commutative:
  "n(x) * n(y) = n(y) * n(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n x * n y = n y * n x
[PROOF STEP]
by (smt sup_commute mult_left_dist_sup mult_right_dist_sup n_sup_left_absorb_mult n_sup_right_absorb_mult n_export n_mult_idempotent)


[STATEMENT]
lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e
[PROOF STEP]
by auto


[STATEMENT]
theorem cayley_monoid:
  "\<exists>M' composition' unit'. transformation_monoid M' M \<and> (M, (\<cdot>), \<one>) \<cong>\<^sub>M (M', composition', unit')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M' composition' unit'. transformation_monoid M' M \<and> (M, (\<cdot>), \<one>) \<cong>\<^sub>M (M', composition', unit')
[PROOF STEP]
by (simp add: isomorphic_as_monoids_def) (fast intro: Translations_transformation_monoid)


[STATEMENT]
lemma ccw0_uminus[simp]: "\<not> coll 0 a b \<Longrightarrow> ccw 0 (-a) (-b) \<longleftrightarrow> ccw 0 a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det3 0 a b \<noteq> 0 \<Longrightarrow> ccw 0 (- a) (- b) = ccw 0 a b
[PROOF STEP]
using ccw_uminus3[of 0 a b]
[PROOF STATE]
proof (prove)
using this:
det3 0 a b \<noteq> 0 \<Longrightarrow> ccw (- 0) (- a) (- b) = ccw 0 a b

goal (1 subgoal):
 1. det3 0 a b \<noteq> 0 \<Longrightarrow> ccw 0 (- a) (- b) = ccw 0 a b
[PROOF STEP]
by simp


[STATEMENT]
lemma interval_integral_cong:
  assumes "\<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x"
  shows "interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> einterval (min a b) (max a b) \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
proof (induct a b rule: linorder_wlog)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<le> b; \<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
 2. \<And>a b. \<lbrakk>(\<And>x. x \<in> einterval (min b a) (max b a) \<Longrightarrow> f x = g x) \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g; \<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
case (sym a b)
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> einterval (min b a) (max b a) \<Longrightarrow> f x = g x) \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g
?x \<in> einterval (min a b) (max a b) \<Longrightarrow> f ?x = g ?x

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<le> b; \<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
 2. \<And>a b. \<lbrakk>(\<And>x. x \<in> einterval (min b a) (max b a) \<Longrightarrow> f x = g x) \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g; \<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> einterval (min b a) (max b a) \<Longrightarrow> f x = g x) \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g
?x \<in> einterval (min a b) (max a b) \<Longrightarrow> f ?x = g ?x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> einterval (min b a) (max b a) \<Longrightarrow> f x = g x) \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g
?x \<in> einterval (min a b) (max a b) \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
by (simp add: min.commute max.commute interval_integral_endpoints_reverse[of a b])
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; \<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; \<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
case (le a b)
[PROOF STATE]
proof (state)
this:
a \<le> b
?x \<in> einterval (min a b) (max a b) \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; \<And>x. x \<in> einterval (min a b) (max a b) \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<le> b
?x \<in> einterval (min a b) (max a b) \<Longrightarrow> f ?x = g ?x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> einterval (min a b) (max a b) \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
by (auto simp: interval_lebesgue_integral_def max_def min_def
             intro!: set_lebesgue_integral_cong)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g

goal:
No subgoals!
[PROOF STEP]
qed