[STATEMENT]
lemma v_pos: "$v > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < $v
[PROOF STEP]
unfolding v_pres_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / (1 + i)
[PROOF STEP]
using v_futr_pos
[PROOF STATE]
proof (prove)
using this:
0 < 1 + i

goal (1 subgoal):
 1. 0 < 1 / (1 + i)
[PROOF STEP]
by auto


[STATEMENT]
lemma lm032:
  "allAllocations N G =
   injectionsUniverse \<inter> ((Range -` (all_partitions G)) \<inter> (Domain -`(Pow N)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. allAllocations N G = injectionsUniverse \<inter> (Range -` all_partitions G \<inter> Domain -` Pow N)
[PROOF STEP]
using allocationInjectionsUnivervseProperty lm031
[PROOF STATE]
proof (prove)
using this:
allAllocations ?N ?G = injectionsUniverse \<inter> {a. Domain a \<subseteq> ?N \<and> Range a \<in> all_partitions ?G}
{a. Domain a \<subseteq> ?N \<and> Range a \<in> all_partitions ?G} = Domain -` Pow ?N \<inter> Range -` all_partitions ?G

goal (1 subgoal):
 1. allAllocations N G = injectionsUniverse \<inter> (Range -` all_partitions G \<inter> Domain -` Pow N)
[PROOF STEP]
by (metis (no_types) Int_commute)


[STATEMENT]
lemma matching_disjointness:
  assumes "matching V E M"
  assumes "e1 \<in> M"
  assumes "e2 \<in> M"
  assumes "e1 \<noteq> e2"
  shows  "edge_as_set e1 \<inter> edge_as_set e2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge_as_set e1 \<inter> edge_as_set e2 = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
matching V E M
e1 \<in> M
e2 \<in> M
e1 \<noteq> e2

goal (1 subgoal):
 1. edge_as_set e1 \<inter> edge_as_set e2 = {}
[PROOF STEP]
by (auto simp add: edge_as_set_def disjoint_edges_def matching_def)


[STATEMENT]
lemma sortedP_append_iff:
  "sortedP (xs @ ys) = (sortedP xs & sortedP ys & (\<forall>x \<in> set xs. \<forall>y \<in> set ys. le x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sortedP (xs @ ys) = (sortedP xs \<and> sortedP ys \<and> (\<forall>x\<in>set xs. \<forall>y\<in>set ys. le x y))
[PROOF STEP]
by (induct xs) (auto intro!: Nil Cons elim!: sortedP_Cons)


[STATEMENT]
lemma kmp_result: "kmp_SPEC s t =
  RETURN (if sublist s t then Some (LEAST i. sublist_at s t i) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kmp_SPEC s t = RETURN (if sublist s t then Some (LEAST i. sublist_at s t i) else None)
[PROOF STEP]
unfolding kmp_SPEC_def sublist_iff_sublist_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPEC (case_option (\<not> Ex (sublist_at s t)) (\<lambda>i. sublist_at s t i \<and> (\<forall>ii<i. \<not> sublist_at s t ii))) = RETURN (if Ex (sublist_at s t) then Some (LEAST i. sublist_at s t i) else None)
[PROOF STEP]
apply (auto intro: LeastI dest: not_less_Least split: option.splits)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x2. \<lbrakk>sublist_at s t x; sublist_at s t x2; \<forall>ii<x2. \<not> sublist_at s t ii\<rbrakk> \<Longrightarrow> x2 = Least (sublist_at s t)
[PROOF STEP]
by (meson LeastI nat_neq_iff not_less_Least)


[STATEMENT]
lemma sorted_asc: "j\<le>i \<Longrightarrow> i<size ss \<Longrightarrow> \<forall>x \<in> set ss. \<forall>y \<in> set ss. k(x) \<le> k(y) \<longrightarrow> f y \<le> f x
  \<Longrightarrow> sorted (map k ss) \<Longrightarrow> f (ss ! i) \<le> f (ss ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j \<le> i; i < length ss; \<forall>x\<in>set ss. \<forall>y\<in>set ss. k x \<le> k y \<longrightarrow> f y \<le> f x; sorted (map k ss)\<rbrakk> \<Longrightarrow> f (ss ! i) \<le> f (ss ! j)
[PROOF STEP]
by (auto simp: sorted_iff_nth_mono)


[STATEMENT]
lemma one_le_ceiling [simp]: "1 \<le> \<lceil>x\<rceil> \<longleftrightarrow> 0 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> \<lceil>x\<rceil>) = ((0::'a) < x)
[PROOF STEP]
by (simp add: le_ceiling_iff)


[STATEMENT]
lemma table_wf_table: "table n A X = wf_table n A (\<lambda>v. v \<in> X) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. table n A X = wf_table n A (\<lambda>v. v \<in> X) X
[PROOF STEP]
unfolding table_def wf_table_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball X (wf_tuple n A) = (\<forall>x. (x \<in> X) = (x \<in> X \<and> wf_tuple n A x))
[PROOF STEP]
by auto


[STATEMENT]
theorem isin_set_inorder: "sorted_less (inorder t) \<Longrightarrow> isin t x = (x \<in> set (inorder t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_less (inorder t) \<Longrightarrow> isin t x = (x \<in> set (inorder t))
[PROOF STEP]
proof(induction t x rule: isin.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. sorted_less (inorder Leaf) \<Longrightarrow> isin Leaf y = (y \<in> set (inorder Leaf))
 2. \<And>ts t y. \<lbrakk>\<And>x ya. \<lbrakk>(x, ya) = split ts y; ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t y = (y \<in> set (inorder t)); \<And>x ya x21 x22 xa yaa. \<lbrakk>(x, ya) = split ts y; ya = x21 # x22; (xa, yaa) = x21; y \<noteq> yaa; sorted_less (inorder xa)\<rbrakk> \<Longrightarrow> isin xa y = (y \<in> set (inorder xa)); sorted_less (inorder (Node ts t))\<rbrakk> \<Longrightarrow> isin (Node ts t) y = (y \<in> set (inorder (Node ts t)))
[PROOF STEP]
case (2 ts t x)
[PROOF STATE]
proof (state)
this:
\<lbrakk>(?x, ?ya) = split ts x; ?ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (inorder t))
\<lbrakk>(?x, ?ya) = split ts x; ?ya = ?x21.0 # ?x22.0; (?xa, ?yaa) = ?x21.0; x \<noteq> ?yaa; sorted_less (inorder ?xa)\<rbrakk> \<Longrightarrow> isin ?xa x = (x \<in> set (inorder ?xa))
sorted_less (inorder (Node ts t))

goal (2 subgoals):
 1. \<And>y. sorted_less (inorder Leaf) \<Longrightarrow> isin Leaf y = (y \<in> set (inorder Leaf))
 2. \<And>ts t y. \<lbrakk>\<And>x ya. \<lbrakk>(x, ya) = split ts y; ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t y = (y \<in> set (inorder t)); \<And>x ya x21 x22 xa yaa. \<lbrakk>(x, ya) = split ts y; ya = x21 # x22; (xa, yaa) = x21; y \<noteq> yaa; sorted_less (inorder xa)\<rbrakk> \<Longrightarrow> isin xa y = (y \<in> set (inorder xa)); sorted_less (inorder (Node ts t))\<rbrakk> \<Longrightarrow> isin (Node ts t) y = (y \<in> set (inorder (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(?x, ?ya) = split ts x; ?ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (inorder t))
\<lbrakk>(?x, ?ya) = split ts x; ?ya = ?x21.0 # ?x22.0; (?xa, ?yaa) = ?x21.0; x \<noteq> ?yaa; sorted_less (inorder ?xa)\<rbrakk> \<Longrightarrow> isin ?xa x = (x \<in> set (inorder ?xa))
sorted_less (inorder (Node ts t))
[PROOF STEP]
obtain ls rs where list_split: "split ts x = (ls, rs)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?x, ?ya) = split ts x; ?ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (inorder t))
\<lbrakk>(?x, ?ya) = split ts x; ?ya = ?x21.0 # ?x22.0; (?xa, ?yaa) = ?x21.0; x \<noteq> ?yaa; sorted_less (inorder ?xa)\<rbrakk> \<Longrightarrow> isin ?xa x = (x \<in> set (inorder ?xa))
sorted_less (inorder (Node ts t))

goal (1 subgoal):
 1. (\<And>ls rs. split ts x = (ls, rs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson surj_pair)
[PROOF STATE]
proof (state)
this:
split ts x = (ls, rs)

goal (2 subgoals):
 1. \<And>y. sorted_less (inorder Leaf) \<Longrightarrow> isin Leaf y = (y \<in> set (inorder Leaf))
 2. \<And>ts t y. \<lbrakk>\<And>x ya. \<lbrakk>(x, ya) = split ts y; ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t y = (y \<in> set (inorder t)); \<And>x ya x21 x22 xa yaa. \<lbrakk>(x, ya) = split ts y; ya = x21 # x22; (xa, yaa) = x21; y \<noteq> yaa; sorted_less (inorder xa)\<rbrakk> \<Longrightarrow> isin xa y = (y \<in> set (inorder xa)); sorted_less (inorder (Node ts t))\<rbrakk> \<Longrightarrow> isin (Node ts t) y = (y \<in> set (inorder (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
split ts x = (ls, rs)
[PROOF STEP]
have list_conc: "ts = ls @ rs"
[PROOF STATE]
proof (prove)
using this:
split ts x = (ls, rs)

goal (1 subgoal):
 1. ts = ls @ rs
[PROOF STEP]
using split_conc
[PROOF STATE]
proof (prove)
using this:
split ts x = (ls, rs)
split ?xs ?p = (?ls, ?rs) \<Longrightarrow> ?xs = ?ls @ ?rs

goal (1 subgoal):
 1. ts = ls @ rs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ts = ls @ rs

goal (2 subgoals):
 1. \<And>y. sorted_less (inorder Leaf) \<Longrightarrow> isin Leaf y = (y \<in> set (inorder Leaf))
 2. \<And>ts t y. \<lbrakk>\<And>x ya. \<lbrakk>(x, ya) = split ts y; ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t y = (y \<in> set (inorder t)); \<And>x ya x21 x22 xa yaa. \<lbrakk>(x, ya) = split ts y; ya = x21 # x22; (xa, yaa) = x21; y \<noteq> yaa; sorted_less (inorder xa)\<rbrakk> \<Longrightarrow> isin xa y = (y \<in> set (inorder xa)); sorted_less (inorder (Node ts t))\<rbrakk> \<Longrightarrow> isin (Node ts t) y = (y \<in> set (inorder (Node ts t)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
proof (cases rs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
rs = []

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rs = []
[PROOF STEP]
have "isin (Node ts t) x = isin t x"
[PROOF STATE]
proof (prove)
using this:
rs = []

goal (1 subgoal):
 1. isin (Node ts t) x = isin t x
[PROOF STEP]
by (simp add: list_split)
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = isin t x

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = isin t x

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
have "\<dots> = (x \<in> set (inorder t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isin t x = (x \<in> set (inorder t))
[PROOF STEP]
using "2.IH"(1) list_split Nil
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?x, ?ya) = split ts x; ?ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (inorder t))
split ts x = (ls, rs)
rs = []

goal (1 subgoal):
 1. isin t x = (x \<in> set (inorder t))
[PROOF STEP]
using "2.prems" sorted_inorder_induct_last
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?x, ?ya) = split ts x; ?ya = []; sorted_less (inorder t)\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (inorder t))
split ts x = (ls, rs)
rs = []
sorted_less (inorder (Node ts t))
sorted_less (inorder (Node ?ts ?t)) \<Longrightarrow> sorted_less (inorder ?t)

goal (1 subgoal):
 1. isin t x = (x \<in> set (inorder t))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isin t x = (x \<in> set (inorder t))

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
isin t x = (x \<in> set (inorder t))

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
have "\<dots> = (x \<in> set (inorder (Node ts t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (inorder t)) = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
using isin_sorted_split[of ts t x ls rs]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sorted_less (inorder (Node ts t)); split ts x = (ls, rs)\<rbrakk> \<Longrightarrow> (x \<in> set (inorder (Node ts t))) = (x \<in> set (inorder_list rs @ inorder t))

goal (1 subgoal):
 1. (x \<in> set (inorder t)) = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
using "2.prems" list_split list_conc Nil
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sorted_less (inorder (Node ts t)); split ts x = (ls, rs)\<rbrakk> \<Longrightarrow> (x \<in> set (inorder (Node ts t))) = (x \<in> set (inorder_list rs @ inorder t))
sorted_less (inorder (Node ts t))
split ts x = (ls, rs)
ts = ls @ rs
rs = []

goal (1 subgoal):
 1. (x \<in> set (inorder t)) = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<in> set (inorder t)) = (x \<in> set (inorder (Node ts t)))

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))

goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
case (Cons a list)
[PROOF STATE]
proof (state)
this:
rs = a # list

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rs = a # list
[PROOF STEP]
obtain sub sep where a_split: "a = (sub,sep)"
[PROOF STATE]
proof (prove)
using this:
rs = a # list

goal (1 subgoal):
 1. (\<And>sub sep. a = (sub, sep) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases a)
[PROOF STATE]
proof (state)
this:
a = (sub, sep)

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = (sub, sep)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = (sub, sep)

goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
proof (cases "x = sep")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>a = (sub, sep); x = sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = sep

goal (2 subgoals):
 1. \<lbrakk>a = (sub, sep); x = sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
 2. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = sep
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = sep

goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
using list_conc Cons a_split list_split
[PROOF STATE]
proof (prove)
using this:
x = sep
ts = ls @ rs
rs = a # list
a = (sub, sep)
split ts x = (ls, rs)

goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))

goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> sep

goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> sep
[PROOF STEP]
have "isin (Node ts t) x = isin sub x"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> sep

goal (1 subgoal):
 1. isin (Node ts t) x = isin sub x
[PROOF STEP]
using list_split Cons a_split False
[PROOF STATE]
proof (prove)
using this:
x \<noteq> sep
split ts x = (ls, rs)
rs = a # list
a = (sub, sep)
x \<noteq> sep

goal (1 subgoal):
 1. isin (Node ts t) x = isin sub x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = isin sub x

goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = isin sub x

goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
have "\<dots> = (x \<in> set (inorder sub))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isin sub x = (x \<in> set (inorder sub))
[PROOF STEP]
using "2.IH"(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?x, ?ya) = split ts x; ?ya = ?x21.0 # ?x22.0; (?xa, ?yaa) = ?x21.0; x \<noteq> ?yaa; sorted_less (inorder ?xa)\<rbrakk> \<Longrightarrow> isin ?xa x = (x \<in> set (inorder ?xa))

goal (1 subgoal):
 1. isin sub x = (x \<in> set (inorder sub))
[PROOF STEP]
using "2.prems" False a_split list_conc list_split local.Cons sorted_inorder_induct_subtree
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?x, ?ya) = split ts x; ?ya = ?x21.0 # ?x22.0; (?xa, ?yaa) = ?x21.0; x \<noteq> ?yaa; sorted_less (inorder ?xa)\<rbrakk> \<Longrightarrow> isin ?xa x = (x \<in> set (inorder ?xa))
sorted_less (inorder (Node ts t))
x \<noteq> sep
a = (sub, sep)
ts = ls @ rs
split ts x = (ls, rs)
rs = a # list
sorted_less (inorder (Node (?ls @ (?sub, ?sep) # ?rs) ?t)) \<Longrightarrow> sorted_less (inorder ?sub)

goal (1 subgoal):
 1. isin sub x = (x \<in> set (inorder sub))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
isin sub x = (x \<in> set (inorder sub))

goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
isin sub x = (x \<in> set (inorder sub))

goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
have "\<dots> = (x \<in> set (inorder (Node ts t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (inorder sub)) = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
using isin_sorted_split[OF "2.prems" list_split]
[PROOF STATE]
proof (prove)
using this:
(x \<in> set (inorder (Node ts t))) = (x \<in> set (inorder_list rs @ inorder t))

goal (1 subgoal):
 1. (x \<in> set (inorder sub)) = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
using isin_sorted_split_right "2.prems" list_split Cons a_split False
[PROOF STATE]
proof (prove)
using this:
(x \<in> set (inorder (Node ts t))) = (x \<in> set (inorder_list rs @ inorder t))
\<lbrakk>split ?ts ?x = (?ls, (?sub, ?sep) # ?rs); sorted_less (inorder (Node ?ts ?t)); ?sep \<noteq> ?x\<rbrakk> \<Longrightarrow> (?x \<in> set (inorder_list ((?sub, ?sep) # ?rs) @ inorder ?t)) = (?x \<in> set (inorder ?sub))
sorted_less (inorder (Node ts t))
split ts x = (ls, rs)
rs = a # list
a = (sub, sep)
x \<noteq> sep

goal (1 subgoal):
 1. (x \<in> set (inorder sub)) = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<in> set (inorder sub)) = (x \<in> set (inorder (Node ts t)))

goal (1 subgoal):
 1. \<lbrakk>a = (sub, sep); x \<noteq> sep\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))

goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (inorder (Node ts t)))

goal (1 subgoal):
 1. \<And>y. sorted_less (inorder Leaf) \<Longrightarrow> isin Leaf y = (y \<in> set (inorder Leaf))
[PROOF STEP]
qed auto


[STATEMENT]
lemma pre_well_order_extend:
  fixes r (infix "\<sqsubseteq>" 50)
  assumes A: "pre_well_ordered_set A (\<sqsubseteq>)" and B: "pre_well_ordered_set B (\<sqsubseteq>)"
    and AB: "\<forall>a \<in> A. \<forall>b \<in> B. a \<sqsubseteq> b \<and> \<not> b \<sqsubseteq> a"
  shows "pre_well_ordered_set (A\<union>B) (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_well_ordered_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pre_well_ordered_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
interpret A: pre_well_ordered_set A "(\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_well_ordered_set A (\<sqsubseteq>)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
pre_well_ordered_set A (\<sqsubseteq>)

goal (1 subgoal):
 1. pre_well_ordered_set A (\<sqsubseteq>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pre_well_ordered_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
interpret B: pre_well_ordered_set B "(\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_well_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
pre_well_ordered_set B (\<sqsubseteq>)

goal (1 subgoal):
 1. pre_well_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pre_well_ordered_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_well_ordered_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
apply (intro pre_well_ordered_set.intro well_related_extend semiattractive_extend)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. semiattractive A (\<sqsubseteq>)
 2. semiattractive B (\<sqsubseteq>)
 3. \<forall>a\<in>A. \<forall>b\<in>B. a \<sqsubseteq> b \<and> \<not> b \<sqsubseteq> a
 4. well_related_set A (\<sqsubseteq>)
 5. well_related_set B (\<sqsubseteq>)
 6. \<forall>a\<in>A. \<forall>b\<in>B. a \<sqsubseteq> b
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>a\<in>A. \<forall>b\<in>B. a \<sqsubseteq> b \<and> \<not> b \<sqsubseteq> a
 2. \<forall>a\<in>A. \<forall>b\<in>B. a \<sqsubseteq> b
[PROOF STEP]
by (auto dest: AB[rule_format])
[PROOF STATE]
proof (state)
this:
pre_well_ordered_set (A \<union> B) (\<sqsubseteq>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reflp_rel_generat [simp]: "reflp (rel_generat A B C) \<longleftrightarrow> reflp A \<and> reflp B \<and> reflp C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflp (rel_generat A B C) = (reflp A \<and> reflp B \<and> reflp C)
[PROOF STEP]
by(auto 4 3 intro!: reflpI rel_generatI dest: reflpD reflpD[where x="Pure _"] reflpD[where x="IO _ _"])


[STATEMENT]
lemma remove_proper_prefixes_code_trie[code] :
  "remove_proper_prefixes (set xs) = (case xs of [] \<Rightarrow> {} | (x#xs') \<Rightarrow> set (paths (from_list (x#xs'))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remove_proper_prefixes (set xs) = (case xs of [] \<Rightarrow> {} | x # xs' \<Rightarrow> set (paths (from_list (x # xs'))))
[PROOF STEP]
unfolding from_list_paths remove_proper_prefixes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> set xs. \<nexists>x'. x' \<noteq> [] \<and> x @ x' \<in> set xs} = (case xs of [] \<Rightarrow> {} | x # xs' \<Rightarrow> {y \<in> set (x # xs'). \<nexists>y'. y' \<noteq> [] \<and> y @ y' \<in> set (x # xs')})
[PROOF STEP]
by (cases xs; auto)


[STATEMENT]
lemma order_antisym: "\<lbrakk> order r A; x \<sqsubseteq>\<^sub>r y; y \<sqsubseteq>\<^sub>r x; x \<in> A; y \<in> A \<rbrakk> \<Longrightarrow>  x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> x; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> x; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (unfold order_def) ( simp (no_asm_simp))


[STATEMENT]
lemma lex_fun_lin: "lex_fun s t \<or> lex_fun t s" for s t::"'a \<Rightarrow> 'b::{ordered_comm_monoid_add, linorder}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lex_fun s t \<or> lex_fun t s
[PROOF STEP]
proof (intro disjCI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> lex_fun t s \<Longrightarrow> lex_fun s t
[PROOF STEP]
assume "\<not> lex_fun t s"
[PROOF STATE]
proof (state)
this:
\<not> lex_fun t s

goal (1 subgoal):
 1. \<not> lex_fun t s \<Longrightarrow> lex_fun s t
[PROOF STEP]
hence a: "\<forall>x. \<not> (t x < s x) \<or> (\<exists>y<x. t y \<noteq> s y)"
[PROOF STATE]
proof (prove)
using this:
\<not> lex_fun t s

goal (1 subgoal):
 1. \<forall>x. \<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)
[PROOF STEP]
unfolding lex_fun_alt
[PROOF STATE]
proof (prove)
using this:
\<not> (t = s \<or> (\<exists>x. t x < s x \<and> (\<forall>y<x. t y = s y)))

goal (1 subgoal):
 1. \<forall>x. \<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. \<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)

goal (1 subgoal):
 1. \<not> lex_fun t s \<Longrightarrow> lex_fun s t
[PROOF STEP]
show "lex_fun s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lex_fun s t
[PROOF STEP]
unfolding lex_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. s x \<le> t x \<or> (\<exists>y<x. s y \<noteq> t y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. s x \<le> t x \<or> (\<exists>y<x. s y \<noteq> t y)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. s x \<le> t x \<or> (\<exists>y<x. s y \<noteq> t y)
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. \<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)
[PROOF STEP]
have "\<not> (t x < s x) \<or> (\<exists>y<x. t y \<noteq> s y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. \<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)

goal (1 subgoal):
 1. \<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)

goal (1 subgoal):
 1. \<And>x. s x \<le> t x \<or> (\<exists>y<x. s y \<noteq> t y)
[PROOF STEP]
thus "s x \<le> t x \<or> (\<exists>y<x. s y \<noteq> t y)"
[PROOF STATE]
proof (prove)
using this:
\<not> t x < s x \<or> (\<exists>y<x. t y \<noteq> s y)

goal (1 subgoal):
 1. s x \<le> t x \<or> (\<exists>y<x. s y \<noteq> t y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s x \<le> t x \<or> (\<exists>y<x. s y \<noteq> t y)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtrancl_mono_mp: "U\<subseteq>V \<Longrightarrow> x\<in>U\<^sup>* \<Longrightarrow> x\<in>V\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>U \<subseteq> V; x \<in> U\<^sup>*\<rbrakk> \<Longrightarrow> x \<in> V\<^sup>*
[PROOF STEP]
by (metis in_mono rtrancl_mono)


[STATEMENT]
lemma equiv_rels_enum:
  assumes "rgf x"
  shows "count_list (enum_rgfs (length x)) x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list (enum_rgfs (length x)) x = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
rgf x

goal (1 subgoal):
 1. count_list (enum_rgfs (length x)) x = 1
[PROOF STEP]
proof (induction x rule:rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rgf [] \<Longrightarrow> count_list (enum_rgfs (length [])) [] = 1
 2. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
rgf []

goal (2 subgoals):
 1. rgf [] \<Longrightarrow> count_list (enum_rgfs (length [])) [] = 1
 2. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rgf []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
rgf []

goal (1 subgoal):
 1. count_list (enum_rgfs (length [])) [] = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count_list (enum_rgfs (length [])) [] = 1

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
case (snoc x xs)
[PROOF STATE]
proof (state)
this:
rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1
rgf (xs @ [x])

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
have b:"rgf xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rgf xs
[PROOF STEP]
using snoc(2) rgf_def
[PROOF STATE]
proof (prove)
using this:
rgf (xs @ [x])
rgf ?x = (\<forall>ys y. prefix (ys @ [y]) ?x \<longrightarrow> y \<le> rgf_limit ys)

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

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
hence "x < rgf_limit xs + 1"
[PROOF STATE]
proof (prove)
using this:
rgf xs

goal (1 subgoal):
 1. x < rgf_limit xs + 1
[PROOF STEP]
using rgf_snoc snoc
[PROOF STATE]
proof (prove)
using this:
rgf xs
rgf (?xs @ [?x]) = (rgf ?xs \<and> ?x < rgf_limit ?xs + 1)
rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1
rgf (xs @ [x])

goal (1 subgoal):
 1. x < rgf_limit xs + 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x < rgf_limit xs + 1

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
hence a:"card ({0..<rgf_limit xs + 1} \<inter> {x}) = 1"
[PROOF STATE]
proof (prove)
using this:
x < rgf_limit xs + 1

goal (1 subgoal):
 1. card ({0..<rgf_limit xs + 1} \<inter> {x}) = 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
card ({0..<rgf_limit xs + 1} \<inter> {x}) = 1

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
have "1 = count_list (enum_rgfs (length xs)) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = count_list (enum_rgfs (length xs)) xs
[PROOF STEP]
using snoc b
[PROOF STATE]
proof (prove)
using this:
rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1
rgf (xs @ [x])
rgf xs

goal (1 subgoal):
 1. 1 = count_list (enum_rgfs (length xs)) xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 = count_list (enum_rgfs (length xs)) xs

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = count_list (enum_rgfs (length xs)) xs

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
have "... = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) *
      card ({0..<rgf_limit xs + 1} \<inter> {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list (enum_rgfs (length xs)) xs = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit xs + 1} \<inter> {x}))
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
card ({0..<rgf_limit xs + 1} \<inter> {x}) = 1

goal (1 subgoal):
 1. count_list (enum_rgfs (length xs)) xs = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit xs + 1} \<inter> {x}))
[PROOF STEP]
by (simp add:length_concat filter_concat count_list_expand length_filter)
[PROOF STATE]
proof (state)
this:
count_list (enum_rgfs (length xs)) xs = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit xs + 1} \<inter> {x}))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count_list (enum_rgfs (length xs)) xs = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit xs + 1} \<inter> {x}))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
have "... = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) *
      card ({0..<rgf_limit r1 + 1} \<inter> {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit xs + 1} \<inter> {x})) = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit r1 + 1} \<inter> {x}))
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) mult_eq_0_iff of_bool_eq_0_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit xs + 1} \<inter> {x})) = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit r1 + 1} \<inter> {x}))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit xs + 1} \<inter> {x})) = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit r1 + 1} \<inter> {x}))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
have "... = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) *
      (\<Sum>r2\<leftarrow>[0..<rgf_limit r1 + 1]. of_bool (x = r2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit r1 + 1} \<inter> {x})) = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * (\<Sum>r2\<leftarrow>[0..<rgf_limit r1 + 1]. of_bool (x = r2)))
[PROOF STEP]
by (simp add:interv_sum_list_conv_sum_set_nat del:One_nat_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit r1 + 1} \<inter> {x})) = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * (\<Sum>r2\<leftarrow>[0..<rgf_limit r1 + 1]. of_bool (x = r2)))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * card ({0..<rgf_limit r1 + 1} \<inter> {x})) = (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * (\<Sum>r2\<leftarrow>[0..<rgf_limit r1 + 1]. of_bool (x = r2)))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
have "... = length (filter ((=) (xs@[x])) (enum_rgfs (length (xs@[x]))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * (\<Sum>r2\<leftarrow>[0..<rgf_limit r1 + 1]. of_bool (x = r2))) = length (filter ((=) (xs @ [x])) (enum_rgfs (length (xs @ [x]))))
[PROOF STEP]
by (simp add:length_concat filter_concat length_filter comp_def
        of_bool_conj sum_list_const_mult del:upt_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * (\<Sum>r2\<leftarrow>[0..<rgf_limit r1 + 1]. of_bool (x = r2))) = length (filter ((=) (xs @ [x])) (enum_rgfs (length (xs @ [x]))))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r1\<leftarrow>enum_rgfs (length xs). of_bool (xs = r1) * (\<Sum>r2\<leftarrow>[0..<rgf_limit r1 + 1]. of_bool (x = r2))) = length (filter ((=) (xs @ [x])) (enum_rgfs (length (xs @ [x]))))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
have "... = count_list (enum_rgfs (length (xs@[x]))) (xs@[x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) (xs @ [x])) (enum_rgfs (length (xs @ [x])))) = count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x])
[PROOF STEP]
by (simp add:count_list_expand length_filter del:enum_rgfs.simps)
[PROOF STATE]
proof (state)
this:
length (filter ((=) (xs @ [x])) (enum_rgfs (length (xs @ [x])))) = count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x])

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>rgf xs \<Longrightarrow> count_list (enum_rgfs (length xs)) xs = 1; rgf (xs @ [x])\<rbrakk> \<Longrightarrow> count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 = count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
1 = count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x])

goal (1 subgoal):
 1. count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
count_list (enum_rgfs (length (xs @ [x]))) (xs @ [x]) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ln_less_cancel_iff [simp]: "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln x < ln y \<longleftrightarrow> x < y"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; 0 < y\<rbrakk> \<Longrightarrow> (ln x < ln y) = (x < y)
[PROOF STEP]
by (subst exp_less_cancel_iff [symmetric]) simp


[STATEMENT]
lemma nths_all[simp]: "nths xs {j. j < length xs} = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths xs {j. j < length xs} = xs
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. nths [] {j. j < length []} = []
 2. \<And>a xs. nths xs {j. j < length xs} = xs \<Longrightarrow> nths (a # xs) {j. j < length (a # xs)} = a # xs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. nths xs {j. j < length xs} = xs \<Longrightarrow> nths (a # xs) {j. j < length (a # xs)} = a # xs
[PROOF STEP]
apply (simp add: nths_Cons)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sumhr_minus: "\<And>m n. sumhr (m, n, \<lambda>i. - f i) = - sumhr (m, n, f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. sumhr (m, n, \<lambda>i. - f i) = - sumhr (m, n, f)
[PROOF STEP]
unfolding sumhr_app
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. (*f2* (\<lambda>m n. \<Sum>i = m..<n. - f i)) m n = - (*f2* (\<lambda>m n. sum f {m..<n})) m n
[PROOF STEP]
by transfer (rule sum_negf)


[STATEMENT]
lemma absolutely_integrable_spike_set_eq:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "negligible {x \<in> S - T. f x \<noteq> 0}" "negligible {x \<in> T - S. f x \<noteq> 0}"
  shows "(f absolutely_integrable_on S \<longleftrightarrow> f absolutely_integrable_on T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f absolutely_integrable_on S) = (f absolutely_integrable_on T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f absolutely_integrable_on S) = (f absolutely_integrable_on T)
[PROOF STEP]
have "(\<lambda>x. if x \<in> S then f x else 0) absolutely_integrable_on UNIV \<longleftrightarrow>
        (\<lambda>x. if x \<in> T then f x else 0) absolutely_integrable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) absolutely_integrable_on UNIV) = ((\<lambda>x. if x \<in> T then f x else (0::'b)) absolutely_integrable_on UNIV)
[PROOF STEP]
proof (rule absolutely_integrable_spike_eq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. negligible ?S
 2. \<And>x. x \<in> UNIV - ?S \<Longrightarrow> (if x \<in> T then f x else (0::'b)) = (if x \<in> S then f x else (0::'b))
[PROOF STEP]
show "negligible ({x \<in> S - T. f x \<noteq> 0} \<union> {x \<in> T - S. f x \<noteq> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible ({x \<in> S - T. f x \<noteq> (0::'b)} \<union> {x \<in> T - S. f x \<noteq> (0::'b)})
[PROOF STEP]
by (rule negligible_Un [OF assms])
[PROOF STATE]
proof (state)
this:
negligible ({x \<in> S - T. f x \<noteq> (0::'b)} \<union> {x \<in> T - S. f x \<noteq> (0::'b)})

goal (1 subgoal):
 1. \<And>x. x \<in> UNIV - ({x \<in> S - T. f x \<noteq> (0::'b)} \<union> {x \<in> T - S. f x \<noteq> (0::'b)}) \<Longrightarrow> (if x \<in> T then f x else (0::'b)) = (if x \<in> S then f x else (0::'b))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<in> S then f x else (0::'b)) absolutely_integrable_on UNIV) = ((\<lambda>x. if x \<in> T then f x else (0::'b)) absolutely_integrable_on UNIV)

goal (1 subgoal):
 1. (f absolutely_integrable_on S) = (f absolutely_integrable_on T)
[PROOF STEP]
with absolutely_integrable_restrict_UNIV
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. if x \<in> ?S then ?f x else (0::?'b)) absolutely_integrable_on UNIV) = (?f absolutely_integrable_on ?S)
((\<lambda>x. if x \<in> S then f x else (0::'b)) absolutely_integrable_on UNIV) = ((\<lambda>x. if x \<in> T then f x else (0::'b)) absolutely_integrable_on UNIV)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. if x \<in> ?S then ?f x else (0::?'b)) absolutely_integrable_on UNIV) = (?f absolutely_integrable_on ?S)
((\<lambda>x. if x \<in> S then f x else (0::'b)) absolutely_integrable_on UNIV) = ((\<lambda>x. if x \<in> T then f x else (0::'b)) absolutely_integrable_on UNIV)

goal (1 subgoal):
 1. (f absolutely_integrable_on S) = (f absolutely_integrable_on T)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(f absolutely_integrable_on S) = (f absolutely_integrable_on T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_integral_lebesgue_on:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "integrable (lebesgue_on S) f" "S \<in> sets lebesgue"
  shows "(f has_integral (integral\<^sup>L (lebesgue_on S) f)) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
let ?f = "\<lambda>x. if x \<in> S then f x else 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
have "integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
using indicator_scaleR_eq_if [of S _ f] assms
[PROOF STATE]
proof (prove)
using this:
indicat_real S ?x *\<^sub>R f ?x = (if ?x \<in> S then f ?x else (0::'b))
integrable (lebesgue_on S) f
S \<in> sets lebesgue

goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
by (metis (full_types) integrable_restrict_space sets.Int_space_eq2)
[PROOF STATE]
proof (state)
this:
integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
have "integrable lebesgue ?f"
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. if x \<in> S then f x else (0::'b))
[PROOF STEP]
using indicator_scaleR_eq_if [of S _ f] assms
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)
indicat_real S ?x *\<^sub>R f ?x = (if ?x \<in> S then f ?x else (0::'b))
integrable (lebesgue_on S) f
S \<in> sets lebesgue

goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. if x \<in> S then f x else (0::'b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable lebesgue (\<lambda>x. if x \<in> S then f x else (0::'b))

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable lebesgue (\<lambda>x. if x \<in> S then f x else (0::'b))
[PROOF STEP]
have "(?f has_integral (integral\<^sup>L lebesgue ?f)) UNIV"
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue (\<lambda>x. if x \<in> S then f x else (0::'b))

goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) UNIV
[PROOF STEP]
by (rule has_integral_integral_lebesgue)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) UNIV

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) UNIV
[PROOF STEP]
have "(f has_integral (integral\<^sup>L lebesgue ?f)) S"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) UNIV

goal (1 subgoal):
 1. (f has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) S
[PROOF STEP]
using has_integral_restrict_UNIV
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) UNIV
((\<lambda>x. if x \<in> ?s then ?f x else (0::?'a)) has_integral ?i) UNIV = (?f has_integral ?i) ?s

goal (1 subgoal):
 1. (f has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(f has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) S

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(f has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) S

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
have "S \<inter> space lebesgue \<in> sets lebesgue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> space lebesgue \<in> sets lebesgue
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
S \<inter> space lebesgue \<in> sets lebesgue

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<inter> space lebesgue \<in> sets lebesgue
[PROOF STEP]
have "(integral\<^sup>L lebesgue ?f) = (integral\<^sup>L (lebesgue_on S) f)"
[PROOF STATE]
proof (prove)
using this:
S \<inter> space lebesgue \<in> sets lebesgue

goal (1 subgoal):
 1. LINT x|lebesgue. (if x \<in> S then f x else (0::'b)) = integral\<^sup>L (lebesgue_on S) f
[PROOF STEP]
by (simp add: integral_restrict_space indicator_scaleR_eq_if)
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue. (if x \<in> S then f x else (0::'b)) = integral\<^sup>L (lebesgue_on S) f

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(f has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) S
LINT x|lebesgue. (if x \<in> S then f x else (0::'b)) = integral\<^sup>L (lebesgue_on S) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f has_integral LINT x|lebesgue. (if x \<in> S then f x else (0::'b))) S
LINT x|lebesgue. (if x \<in> S then f x else (0::'b)) = integral\<^sup>L (lebesgue_on S) f

goal (1 subgoal):
 1. (f has_integral integral\<^sup>L (lebesgue_on S) f) S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f has_integral integral\<^sup>L (lebesgue_on S) f) S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_ord_Cons_imp: "\<lbrakk> list_ord ord xs; ord x (hd xs) \<rbrakk> \<Longrightarrow> list_ord ord (x # xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_ord ord xs; ord x (hd xs)\<rbrakk> \<Longrightarrow> list_ord ord (x # xs)
[PROOF STEP]
by (induct xs, simp+)


[STATEMENT]
lemma in_square2[simp]:
  "(a,b) : square2 n i j \<longleftrightarrow> i\<le>a \<and> a<2^n+i \<and> j\<le>b \<and> b<2^n+j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a, b) \<in> square2 n i j) = (i \<le> a \<and> a < 2 ^ n + i \<and> j \<le> b \<and> b < 2 ^ n + j)
[PROOF STEP]
by(simp add:square2_def)


[STATEMENT]
lemma c: "c = ln (2*pi) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c = ln (2 * pi) / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c = ln (2 * pi) / 2
[PROOF STEP]
note exp_c [symmetric]
[PROOF STATE]
proof (state)
this:
sqrt (2 * pi) = exp c

goal (1 subgoal):
 1. c = ln (2 * pi) / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt (2 * pi) = exp c

goal (1 subgoal):
 1. c = ln (2 * pi) / 2
[PROOF STEP]
have "ln (exp c) = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (exp c) = c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln (exp c) = c

goal (1 subgoal):
 1. c = ln (2 * pi) / 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (sqrt (2 * pi)) = c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln (sqrt (2 * pi)) = c

goal (1 subgoal):
 1. c = ln (2 * pi) / 2
[PROOF STEP]
by (simp add: ln_sqrt)
[PROOF STATE]
proof (state)
this:
c = ln (2 * pi) / 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wens_single_finite_eq_Union:
     "wens_single_finite act B n = (\<Union>k\<in>atMost n. wens_single_finite act B k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wens_single_finite act B n = \<Union> (wens_single_finite act B ` {..n})
[PROOF STEP]
apply (auto simp add: wens_single_finite_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa i. \<lbrakk>xa \<le> n; x \<in> (wp act ^^ i) B; i \<le> xa\<rbrakk> \<Longrightarrow> \<exists>xa\<in>{..n}. x \<in> (wp act ^^ xa) B
[PROOF STEP]
apply (blast intro: le_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma val2formAppend:
  fixes valuation1 :: Valuation and valuation2 :: Valuation
  shows "val2form (valuation1 @ valuation2) = (val2form valuation1 @ val2form valuation2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val2form (valuation1 @ valuation2) = val2form valuation1 @ val2form valuation2
[PROOF STEP]
by (induct valuation1) auto


[STATEMENT]
lemma RSubmodule_sum_list :
  "(\<forall>N\<in>set Ns. RSubmodule N) \<Longrightarrow> RSubmodule (\<Sum>N\<leftarrow>Ns. N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>N\<in>set Ns. RSubmodule N \<Longrightarrow> RSubmodule (\<Sum>N\<leftarrow>Ns. N)
[PROOF STEP]
using trivial_RSubmodule RSubmodule_set_plus
[PROOF STATE]
proof (prove)
using this:
RSubmodule 0
\<lbrakk>RSubmodule ?L; RSubmodule ?N\<rbrakk> \<Longrightarrow> RSubmodule (?L + ?N)

goal (1 subgoal):
 1. \<forall>N\<in>set Ns. RSubmodule N \<Longrightarrow> RSubmodule (\<Sum>N\<leftarrow>Ns. N)
[PROOF STEP]
by    (induct Ns) auto


[STATEMENT]
lemma relative_equality:
  "x \<squnion> z = y \<squnion> z \<Longrightarrow> x \<sqinter> z = y \<sqinter> z \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<squnion> z = y \<squnion> z; x \<sqinter> z = y \<sqinter> z\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis inf.commute inf_sup_absorb inf_sup_distrib2)


[STATEMENT]
lemma Lambert_W_exp_1 [simp]: "Lambert_W (exp 1) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lambert_W (exp 1) = 1
[PROOF STEP]
by (rule Lambert_W_eqI) auto


[STATEMENT]
lemma principal_subs_le_iff[iff]:
  "principal_subs As A \<le> principal_subs As' A'
            \<longleftrightarrow> {x. x\<in>As \<and> x \<subseteq> A} \<subseteq> {x. x\<in>As' \<and> x \<subseteq> A'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (principal_subs As A \<le> principal_subs As' A') = ({x \<in> As. x \<subseteq> A} \<subseteq> {x \<in> As'. x \<subseteq> A'})
[PROOF STEP]
unfolding le_filter_def eventually_principal_subs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>P. (\<forall>x. x \<in> As' \<and> x \<subseteq> A' \<longrightarrow> P x) \<longrightarrow> (\<forall>x. x \<in> As \<and> x \<subseteq> A \<longrightarrow> P x)) = ({x \<in> As. x \<subseteq> A} \<subseteq> {x \<in> As'. x \<subseteq> A'})
[PROOF STEP]
by blast


[STATEMENT]
lemma fls_divide_subdegree_ge:
  fixes   f g :: "'a::{comm_monoid_add,uminus,times,inverse} fls"
  assumes "f / g \<noteq> 0"
  shows   "fls_subdegree (f / g) \<ge> fls_subdegree f - fls_subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
using   assms fls_divide_nth_below
[PROOF STATE]
proof (prove)
using this:
f / g \<noteq> 0
?n < fls_subdegree ?f - fls_subdegree ?g \<Longrightarrow> (?f / ?g) $$ ?n = (0::?'a)

goal (1 subgoal):
 1. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
by      (intro fls_subdegree_geI) simp


[STATEMENT]
lemma P_set_nonzero:
"P_set n \<subseteq> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P_set n \<subseteq> nonzero Q\<^sub>p
[PROOF STEP]
unfolding P_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a} \<subseteq> nonzero Q\<^sub>p
[PROOF STEP]
by blast


[STATEMENT]
lemma nat_pow_eq [simp]: "x [^]\<^bsub>R\<^esub> (k :: nat) = (x ^ k) mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>R\<^esub> k = x ^ k mod n
[PROOF STEP]
using n_gt_1
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. x [^]\<^bsub>R\<^esub> k = x ^ k mod n
[PROOF STEP]
by (induction k) (auto simp: mod_simps mult_ac)


[STATEMENT]
lemma replace_span:
  assumes "q \<in> span B"
  shows "span (insert q (B - {p})) \<subseteq> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert q (B - {p})) \<subseteq> span B
[PROOF STEP]
by (rule span_insert_subset, rule span_mono, fact Diff_subset, fact)


[STATEMENT]
lemma (in group) complementary_symm: "complementary A B \<longleftrightarrow> complementary B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complementary A B = complementary B A
[PROOF STEP]
unfolding complementary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<inter> B = {\<one>}) = (B \<inter> A = {\<one>})
[PROOF STEP]
by blast


[STATEMENT]
lemma d_test_inf_closed:
  assumes "test x"
      and "test y"
    shows "d (x \<sqinter> y) = x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (x \<sqinter> y) = x \<sqinter> y
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d (x \<sqinter> y) \<le> x \<sqinter> y
 2. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
have "d (x \<sqinter> y) = d (x \<sqinter> y) \<sqinter> d (x \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (x \<sqinter> y) = d (x \<sqinter> y) \<sqinter> d (x \<sqinter> y)
[PROOF STEP]
by (simp add: d_test_inf_idempotent)
[PROOF STATE]
proof (state)
this:
d (x \<sqinter> y) = d (x \<sqinter> y) \<sqinter> d (x \<sqinter> y)

goal (2 subgoals):
 1. d (x \<sqinter> y) \<le> x \<sqinter> y
 2. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d (x \<sqinter> y) = d (x \<sqinter> y) \<sqinter> d (x \<sqinter> y)

goal (2 subgoals):
 1. d (x \<sqinter> y) \<le> x \<sqinter> y
 2. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
have "... \<le> x \<sqinter> d (x \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (x \<sqinter> y) \<sqinter> d (x \<sqinter> y) \<le> x \<sqinter> d (x \<sqinter> y)
[PROOF STEP]
by (simp add: assms(1) d2 il_sub_inf_left_isotone)
[PROOF STATE]
proof (state)
this:
d (x \<sqinter> y) \<sqinter> d (x \<sqinter> y) \<le> x \<sqinter> d (x \<sqinter> y)

goal (2 subgoals):
 1. d (x \<sqinter> y) \<le> x \<sqinter> y
 2. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d (x \<sqinter> y) \<sqinter> d (x \<sqinter> y) \<le> x \<sqinter> d (x \<sqinter> y)

goal (2 subgoals):
 1. d (x \<sqinter> y) \<le> x \<sqinter> y
 2. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
have "... \<le> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> d (x \<sqinter> y) \<le> x \<sqinter> y
[PROOF STEP]
by (metis assms d_isotone il_sub_inf_right_isotone test_inf_left_below test_d_fixpoint)
[PROOF STATE]
proof (state)
this:
x \<sqinter> d (x \<sqinter> y) \<le> x \<sqinter> y

goal (2 subgoals):
 1. d (x \<sqinter> y) \<le> x \<sqinter> y
 2. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d (x \<sqinter> y) \<le> x \<sqinter> y
[PROOF STEP]
show "d (x \<sqinter> y) \<le> x \<sqinter> y"
[PROOF STATE]
proof (prove)
using this:
d (x \<sqinter> y) \<le> x \<sqinter> y

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

goal (1 subgoal):
 1. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
show "x \<sqinter> y \<le> d (x \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<le> d (x \<sqinter> y)
[PROOF STEP]
using assms d_increasing_sub_identity dual_order.trans test_inf_left_below test_sub_identity
[PROOF STATE]
proof (prove)
using this:
test x
test y
?x \<le> top \<Longrightarrow> ?x \<le> d ?x
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a
test ?x \<Longrightarrow> ?x \<sqinter> ?y \<le> ?y
test ?x \<Longrightarrow> ?x \<le> top

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_poly_0_left: "(0::'a poly) * q = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 * q = 0
[PROOF STEP]
by (simp add: times_poly_def)


[STATEMENT]
lemma pmf_embed_spmf_None: "pmf embed_spmf None = 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf local.embed_spmf None = 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)
[PROOF STEP]
unfolding embed_spmf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (embed_pmf (case_option (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) (\<lambda>x'. max 0 (f x')))) None = 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)
[PROOF STEP]
apply(subst pmf_embed_pmf)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. 0 \<le> (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))
 2. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
 3. (case None of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) = 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (case x_ of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))
[PROOF STEP]
using prob
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV \<le> 1

goal (1 subgoal):
 1. 0 \<le> (case x_ of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))
[PROOF STEP]
by(simp add: field_simps enn2real_leI split: option.split)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
 2. (case None of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) = 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)
[PROOF STEP]
apply(rule nn_integral_embed_spmf_eq_1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case None of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) = 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma evalF_FAll: "evalF M phi (FAll Pos A) = (!x: (objects M). (evalF M (vblcase x (%v .phi v)) A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evalF M phi (FAll Pos A) = (\<forall>x\<in>objects M. evalF M (vblcase x phi) A)
[PROOF STEP]
by simp


[STATEMENT]
lemma dual_ball: "(\<forall>x \<in> X. P (\<partial> x)) \<longleftrightarrow> (\<forall>y \<in> \<partial> ` X. P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>X. P (\<partial> x)) = (\<forall>y\<in>\<partial> ` X. P y)
[PROOF STEP]
by simp


[STATEMENT]
lemma sd_distr: "sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
have "sd_prod (Sup_prod X) y = sd_prod (\<Squnion>{fst x |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X}) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = sd_prod (\<Squnion>{fst x |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X}) y
[PROOF STEP]
by (simp add: Sup_prod_def)
[PROOF STATE]
proof (state)
this:
sd_prod (Sup_prod X) y = sd_prod (\<Squnion>{fst x |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X}) y

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sd_prod (Sup_prod X) y = sd_prod (\<Squnion>{fst x |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X}) y

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
have
    "... = ((\<Squnion>{fst x |x. x \<in> X}) \<cdot> fst y, (\<Squnion>{snd x |x. x \<in> X}) \<squnion> (\<alpha> (\<Squnion>{fst x | x. x \<in> X})  (snd y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sd_prod (\<Squnion>{fst x |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X}) y = (\<Squnion>{fst x |x. x \<in> X} \<cdot> fst y, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y))
[PROOF STEP]
by (simp add: sd_prod_def)
[PROOF STATE]
proof (state)
this:
sd_prod (\<Squnion>{fst x |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X}) y = (\<Squnion>{fst x |x. x \<in> X} \<cdot> fst y, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y))

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sd_prod (\<Squnion>{fst x |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X}) y = (\<Squnion>{fst x |x. x \<in> X} \<cdot> fst y, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y))

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
have
    "... = (\<Squnion>{fst x \<cdot> fst y|x. x \<in> X}, (\<Squnion>{snd x |x. x \<in> X}) \<squnion> (\<alpha> (\<Squnion>{fst x | x. x \<in> X})  (snd y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>{fst x |x. x \<in> X} \<cdot> fst y, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y)) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y))
[PROOF STEP]
by (simp add: Sup_distr)
[PROOF STATE]
proof (state)
this:
(\<Squnion>{fst x |x. x \<in> X} \<cdot> fst y, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y)) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y))

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>{fst x |x. x \<in> X} \<cdot> fst y, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y)) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y))

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
have
    "... = (\<Squnion>{fst x \<cdot> fst y|x. x \<in> X}, (\<Squnion> {snd x |x. x \<in> X}) \<squnion> (\<Squnion>{\<alpha> (fst x) (snd y) | x. x \<in> X}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y)) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<Squnion>{\<alpha> (fst x) (snd y) |x. x \<in> X})
[PROOF STEP]
by (simp add: act3)
[PROOF STATE]
proof (state)
this:
(\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y)) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<Squnion>{\<alpha> (fst x) (snd y) |x. x \<in> X})

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<alpha> (\<Squnion>{fst x |x. x \<in> X}) (snd y)) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<Squnion>{\<alpha> (fst x) (snd y) |x. x \<in> X})

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
have "... = (\<Squnion>{fst x \<cdot> fst y|x. x \<in> X}, \<Squnion>{snd x \<squnion> (\<alpha> (fst x) (snd y)) | x. x \<in> X})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<Squnion>{\<alpha> (fst x) (snd y) |x. x \<in> X}) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x \<squnion> \<alpha> (fst x) (snd y) |x. x \<in> X})
[PROOF STEP]
by (simp only: sd_distr_aux)
[PROOF STATE]
proof (state)
this:
(\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<Squnion>{\<alpha> (fst x) (snd y) |x. x \<in> X}) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x \<squnion> \<alpha> (fst x) (snd y) |x. x \<in> X})

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x |x. x \<in> X} \<squnion> \<Squnion>{\<alpha> (fst x) (snd y) |x. x \<in> X}) = (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x \<squnion> \<alpha> (fst x) (snd y) |x. x \<in> X})

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
have "... = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> (\<alpha> (fst x) (snd y))) |x. x \<in> X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x \<squnion> \<alpha> (fst x) (snd y) |x. x \<in> X}) = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |x. x \<in> X}
[PROOF STEP]
by (simp add: Sup_prod_def, metis)
[PROOF STATE]
proof (state)
this:
(\<Squnion>{fst x \<cdot> fst y |x. x \<in> X}, \<Squnion>{snd x \<squnion> \<alpha> (fst x) (snd y) |x. x \<in> X}) = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |x. x \<in> X}

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sd_prod (Sup_prod X) y = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |x. x \<in> X}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sd_prod (Sup_prod X) y = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |x. x \<in> X}

goal (1 subgoal):
 1. sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}
[PROOF STEP]
by (simp add: sd_prod_def)
[PROOF STATE]
proof (state)
this:
sd_prod (Sup_prod X) y = Sup_prod {sd_prod x y |x. x \<in> X}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<forall>x::real. 2*\<lfloor>x\<rfloor> \<le> \<lfloor>2*x\<rfloor> \<and> \<lfloor>2*x\<rfloor> \<le> 2*\<lfloor>x+1\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 2 * \<lfloor>x\<rfloor> \<le> \<lfloor>2 * x\<rfloor> \<and> \<lfloor>2 * x\<rfloor> \<le> 2 * \<lfloor>x + 1\<rfloor>
[PROOF STEP]
by mir


[STATEMENT]
lemma Card_order_Fpow: "Card_order r \<Longrightarrow> r \<le>o |Fpow(Field r) |"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order r \<Longrightarrow> r \<le>o |Fpow (Field r)|
[PROOF STEP]
using card_of_Fpow card_of_Field_ordIso ordIso_ordLeq_trans ordIso_symmetric
[PROOF STATE]
proof (prove)
using this:
|?A| \<le>o |Fpow ?A|
Card_order ?r \<Longrightarrow> |Field ?r| =o ?r
\<lbrakk>?r =o ?r'; ?r' \<le>o ?r''\<rbrakk> \<Longrightarrow> ?r \<le>o ?r''
?r =o ?r' \<Longrightarrow> ?r' =o ?r

goal (1 subgoal):
 1. Card_order r \<Longrightarrow> r \<le>o |Fpow (Field r)|
[PROOF STEP]
by blast


[STATEMENT]
lemma ocircline_set_fix_iff_ocircline_fix:
  assumes "ocircline_set H' \<noteq> {}"
  shows "ocircline_set (moebius_ocircline M H) = ocircline_set H' \<longleftrightarrow>
         moebius_ocircline M H = H' \<or> moebius_ocircline M H = opposite_ocircline H'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ocircline_set (moebius_ocircline M H) = ocircline_set H') = (moebius_ocircline M H = H' \<or> moebius_ocircline M H = opposite_ocircline H')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ocircline_set H' \<noteq> {}

goal (1 subgoal):
 1. (ocircline_set (moebius_ocircline M H) = ocircline_set H') = (moebius_ocircline M H = H' \<or> moebius_ocircline M H = opposite_ocircline H')
[PROOF STEP]
using inj_ocircline_set[of "moebius_ocircline M H" H']
[PROOF STATE]
proof (prove)
using this:
ocircline_set H' \<noteq> {}
\<lbrakk>ocircline_set (moebius_ocircline M H) = ocircline_set H'; ocircline_set (moebius_ocircline M H) \<noteq> {}\<rbrakk> \<Longrightarrow> moebius_ocircline M H = H' \<or> moebius_ocircline M H = opposite_ocircline H'

goal (1 subgoal):
 1. (ocircline_set (moebius_ocircline M H) = ocircline_set H') = (moebius_ocircline M H = H' \<or> moebius_ocircline M H = opposite_ocircline H')
[PROOF STEP]
by (auto simp del: ocircline_set_moebius_ocircline)


[STATEMENT]
lemma frechet_tendsto_vec_nth:
  fixes f::"real \<Rightarrow> ('a::real_normed_vector)^'m"
  assumes "((\<lambda>x. (f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R (\<parallel>x - x\<^sub>0\<parallel>)) \<longlongrightarrow> 0) (at t within T)"
  shows "((\<lambda>x. (f x $ i - f x\<^sub>0 $ i - (x - x\<^sub>0) *\<^sub>R f' t $ i) /\<^sub>R (\<parallel>x - x\<^sub>0\<parallel>)) \<longlongrightarrow> 0) (at t within T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (f x $ i - f x\<^sub>0 $ i - (x - x\<^sub>0) *\<^sub>R f' t $ i) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>) \<longlongrightarrow> (0::'a)) (at t within T)
[PROOF STEP]
apply(rule_tac F="(\<lambda>x. (f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R (\<parallel>x - x\<^sub>0\<parallel>))" in tendsto_zero_norm_bound)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x. \<parallel>(f x $ i - f x\<^sub>0 $ i - (x - x\<^sub>0) *\<^sub>R f' t $ i) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>\<parallel> \<le> \<parallel>(f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>\<parallel>
 2. ((\<lambda>x. (f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>) \<longlongrightarrow> 0) (at t within T)
[PROOF STEP]
apply(clarsimp, rule mult_left_mono)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<parallel>f x $ i - f x\<^sub>0 $ i - (x - x\<^sub>0) *\<^sub>R f' t $ i\<parallel> \<le> \<parallel>f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t\<parallel>
 2. \<And>x. 0 \<le> inverse \<bar>x - x\<^sub>0\<bar>
 3. ((\<lambda>x. (f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>) \<longlongrightarrow> 0) (at t within T)
[PROOF STEP]
apply (metis Finite_Cartesian_Product.norm_nth_le vector_minus_component vector_scaleR_component)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. 0 \<le> inverse \<bar>x - x\<^sub>0\<bar>
 2. ((\<lambda>x. (f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>) \<longlongrightarrow> 0) (at t within T)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. (f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>) \<longlongrightarrow> 0) (at t within T)

goal (2 subgoals):
 1. \<And>x. 0 \<le> inverse \<bar>x - x\<^sub>0\<bar>
 2. ((\<lambda>x. (f x - f x\<^sub>0 - (x - x\<^sub>0) *\<^sub>R f' t) /\<^sub>R \<parallel>x - x\<^sub>0\<parallel>) \<longlongrightarrow> 0) (at t within T)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma locally_compact_Times:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  shows "\<lbrakk>locally compact S; locally compact T\<rbrakk> \<Longrightarrow> locally compact (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>locally compact S; locally compact T\<rbrakk> \<Longrightarrow> locally compact (S \<times> T)
[PROOF STEP]
by (auto simp: compact_Times locally_Times)


[STATEMENT]
lemma "implc_offending_flows NonI_m \<lparr>nodesL = [1::nat,2,3,4], edgesL = [(1,2), (1,3), (2,3), (4, 3)] \<rparr> =
    [[(1, 2), (1, 3)], [(1, 3), (2, 3)], [(4, 3)]]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. implc_offending_flows NonI_m \<lparr>nodesL = [1, 2, 3, 4], edgesL = [(1, 2), (1, 3), (2, 3), (4, 3)]\<rparr> = [[(1, 2), (1, 3)], [(1, 3), (2, 3)], [(4, 3)]]
[PROOF STEP]
by eval


[STATEMENT]
lemma ODNmapTr1:"\<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; ODord y x\<rbrakk> \<Longrightarrow>
                  y = ordinal_number (Iod D (segment D (ODNmap D y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; y \<sqsubset> x\<rbrakk> \<Longrightarrow> y = ordinal_number (Iod D (segment D (ODNmap D y)))
[PROOF STEP]
apply (frule ODNmap_mem [of "D" "x" "y"], assumption+, erule conjE,
       frule ODnum_segmentTr1 [of "D" "x" "y"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; y \<sqsubset> x; ODNmap D y \<in> carrier D; \<forall>Y\<in>y. ord_equiv Y (Iod D (segment D (ODNmap D y))); \<exists>c. c \<in> carrier D \<and> y = ordinal_number (Iod D (segment D c))\<rbrakk> \<Longrightarrow> y = ordinal_number (Iod D (segment D (ODNmap D y)))
[PROOF STEP]
apply (erule exE, erule conjE,
        cut_tac D = D and a = c in Worder.segment_Worder, assumption+,
        frule_tac D = "Iod D (segment D c)" and x = y in ordinal_numberTr2,
            assumption+,
        frule_tac x = "Iod D (segment D c)" in bspec, assumption,
         thin_tac "\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D (ODNmap D y)))",
        cut_tac a = "ODNmap D y" in Worder.segment_Worder[of "D"],
         assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; y \<sqsubset> x; ODNmap D y \<in> carrier D; c \<in> carrier D; y = ordinal_number (Iod D (segment D c)); Worder (Iod D (segment D c)); Iod D (segment D c) \<in> y; ord_equiv (Iod D (segment D c)) (Iod D (segment D (ODNmap D y))); Worder (Iod D (segment D (ODNmap D y)))\<rbrakk> \<Longrightarrow> y = ordinal_number (Iod D (segment D (ODNmap D y)))
[PROOF STEP]
apply (frule_tac D = "Iod D (segment D c)" and E = "Iod D (segment D (ODNmap D y))" in ordinal_number_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; y \<sqsubset> x; ODNmap D y \<in> carrier D; c \<in> carrier D; y = ordinal_number (Iod D (segment D c)); Worder (Iod D (segment D c)); Iod D (segment D c) \<in> y; ord_equiv (Iod D (segment D c)) (Iod D (segment D (ODNmap D y))); Worder (Iod D (segment D (ODNmap D y))); ord_equiv (Iod D (segment D c)) (Iod D (segment D (ODNmap D y))) = (ordinal_number (Iod D (segment D c)) = ordinal_number (Iod D (segment D (ODNmap D y))))\<rbrakk> \<Longrightarrow> y = ordinal_number (Iod D (segment D (ODNmap D y)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cnorm_le: "norm x \<le> norm y \<longleftrightarrow> cinner x x \<le> cinner y y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x \<le> norm y) = (cinner x x \<le> cinner y y)
[PROOF STEP]
by (smt (verit) complex_of_real_mono_iff norm_eq_sqrt_cinner norm_ge_zero of_real_power power2_norm_eq_cinner real_sqrt_le_mono real_sqrt_pow2)


[STATEMENT]
theorem gcsort_stable:
  assumes
    A: "index_less index key" and
    B: "index_same index key" and
    C: "length xs \<le> p"
  shows "[x\<leftarrow>gcsort index key p xs. key x = k] = [x\<leftarrow>xs. key x = k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
let ?t = "(0, [length xs], xs)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
have "stab_inv (\<lambda>k. [x\<leftarrow>xs. key x = k]) key (gcsort_aux index key p ?t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stab_inv (\<lambda>k. filter (\<lambda>x. key x = k) xs) key (gcsort_aux index key p (0, [length xs], xs))
[PROOF STEP]
by (rule gcsort_stab_inv [OF A B _ C], rule gcsort_add_input,
     rule gcsort_aux_set, rule gcsort_stab_input)
[PROOF STATE]
proof (state)
this:
stab_inv (\<lambda>k. filter (\<lambda>x. key x = k) xs) key (gcsort_aux index key p (0, [length xs], xs))

goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
hence "[x\<leftarrow>gcsort_out (gcsort_aux index key p ?t). key x = k] =
    [x\<leftarrow>xs. key x = k]"
[PROOF STATE]
proof (prove)
using this:
stab_inv (\<lambda>k. filter (\<lambda>x. key x = k) xs) key (gcsort_aux index key p (0, [length xs], xs))

goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort_out (gcsort_aux index key p (0, [length xs], xs))) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
by (rule gcsort_stab_intro)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>x. key x = k) (gcsort_out (gcsort_aux index key p (0, [length xs], xs))) = filter (\<lambda>x. key x = k) xs

goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
filter (\<lambda>x. key x = k) (gcsort_out (gcsort_aux index key p (0, [length xs], xs))) = filter (\<lambda>x. key x = k) xs

goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
have "?t = gcsort_in xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0, [length xs], xs) = gcsort_in xs
[PROOF STEP]
by (simp add: gcsort_in_def)
[PROOF STATE]
proof (state)
this:
(0, [length xs], xs) = gcsort_in xs

goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
filter (\<lambda>x. key x = k) (gcsort_out (gcsort_aux index key p (0, [length xs], xs))) = filter (\<lambda>x. key x = k) xs
(0, [length xs], xs) = gcsort_in xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filter (\<lambda>x. key x = k) (gcsort_out (gcsort_aux index key p (0, [length xs], xs))) = filter (\<lambda>x. key x = k) xs
(0, [length xs], xs) = gcsort_in xs

goal (1 subgoal):
 1. filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs
[PROOF STEP]
by (simp add: gcsort_def)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>x. key x = k) (gcsort index key p xs) = filter (\<lambda>x. key x = k) xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_points_on_circline:
  shows "\<forall> z \<in> ideal_points H. z \<in> circline_set H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z\<in>ideal_points H. z \<in> circline_set H
[PROOF STEP]
unfolding ideal_points_def circline_intersection_def circline_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z\<in>{z. on_circline H z \<and> on_circline unit_circle z}. z \<in> Collect (on_circline H)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in domain) associated_polynomials_iff:
  assumes "subfield K R" and "p \<in> carrier (K[X])" "q \<in> carrier (K[X])"
  shows "p \<sim>\<^bsub>K[X]\<^esub> q \<longleftrightarrow> (\<exists>k \<in> K - { \<zero> }. p = [ k ] \<otimes>\<^bsub>K[X]\<^esub> q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<sim>\<^bsub>K [X]\<^esub> q = (\<exists>k\<in>K - {\<zero>}. p = [k] \<otimes>\<^bsub>K [X]\<^esub> q)
[PROOF STEP]
using domain.ring_associated_iff[OF univ_poly_is_domain[OF subfieldE(1)[OF assms(1)]] assms(2-3)]
[PROOF STATE]
proof (prove)
using this:
p \<sim>\<^bsub>K [X]\<^esub> q = (\<exists>u\<in>Units (K [X]). p = u \<otimes>\<^bsub>K [X]\<^esub> q)

goal (1 subgoal):
 1. p \<sim>\<^bsub>K [X]\<^esub> q = (\<exists>k\<in>K - {\<zero>}. p = [k] \<otimes>\<^bsub>K [X]\<^esub> q)
[PROOF STEP]
unfolding univ_poly_units[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
p \<sim>\<^bsub>K [X]\<^esub> q = (\<exists>u\<in>{[k] |k. k \<in> K - {\<zero>}}. p = u \<otimes>\<^bsub>K [X]\<^esub> q)

goal (1 subgoal):
 1. p \<sim>\<^bsub>K [X]\<^esub> q = (\<exists>k\<in>K - {\<zero>}. p = [k] \<otimes>\<^bsub>K [X]\<^esub> q)
[PROOF STEP]
by auto


[STATEMENT]
lemma GFP_least:
  assumes "x \<in> carrier L"
          "(\<And>u. \<lbrakk> u \<in> carrier L; u \<sqsubseteq> f u \<rbrakk> \<Longrightarrow> u \<sqsubseteq> x)"
  shows "GFP f \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GFP f \<sqsubseteq> x
[PROOF STEP]
by (auto simp add:GREATEST_FP_def intro:sup_least assms)


[STATEMENT]
lemma strict_mono_ordinal_of_nat: "strict_mono ordinal_of_nat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OrdinalInduct.strict_mono ordinal_of_nat
[PROOF STEP]
by (rule strict_mono_natI, simp)


[STATEMENT]
lemma word_ao_dist: "(x OR y) AND z = x AND z OR y AND z"
  for x :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x OR y) AND z = x AND z OR y AND z
[PROOF STEP]
by (fact bit.conj_disj_distrib2)


[STATEMENT]
lemma ipoly_poly_add:
  fixes x y :: "'a :: idom"
  assumes p0: "(of_int (lead_coeff p) :: 'a) \<noteq> 0" and q0: "(of_int (lead_coeff q) :: 'a) \<noteq> 0"
      and x: "ipoly p x = 0" and y: "ipoly q y = 0"
  shows "ipoly (poly_add p q) (x+y) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipoly (poly_add p q) (x + y) = (0::'a)
[PROOF STEP]
using assms of_int_hom.hom_lead_coeff_nonzero_imp_map_poly_hom[OF q0]
[PROOF STATE]
proof (prove)
using this:
of_int (lead_coeff p) \<noteq> (0::'a)
of_int (lead_coeff q) \<noteq> (0::'a)
ipoly p x = (0::'a)
ipoly q y = (0::'a)
of_int_poly q \<noteq> 0

goal (1 subgoal):
 1. ipoly (poly_add p q) (x + y) = (0::'a)
[PROOF STEP]
by (auto intro: poly_add simp: of_int_hom.poly_add_hom[OF p0 q0])


[STATEMENT]
lemma dual_inv_all: "(\<forall>x. P (\<partial>\<^sup>- x)) \<longleftrightarrow> (\<forall>y. P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P (\<partial>\<^sup>- x)) = (\<forall>y. P y)
[PROOF STEP]
by (metis dual_inv_surj surj_def)


[STATEMENT]
lemma integrable_exp_minus_squared:
  assumes "A \<subseteq> {0..}" "A \<in> sets lborel"
  shows   "set_integrable lborel A (\<lambda>t::real. exp (-t\<^sup>2))" (is ?thesis1)
    and   "(\<lambda>t::real. exp (-t\<^sup>2)) integrable_on A" (is ?thesis2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel A (\<lambda>t. exp (- t\<^sup>2)) &&& (\<lambda>t. exp (- t\<^sup>2)) integrable_on A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set_integrable lborel A (\<lambda>t. exp (- t\<^sup>2))
 2. (\<lambda>t. exp (- t\<^sup>2)) integrable_on A
[PROOF STEP]
show ?thesis1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel A (\<lambda>t. exp (- t\<^sup>2))
[PROOF STEP]
by (rule set_integrable_subset[of _ "{0..}"])
       (insert assms has_bochner_integral_erf_aux, auto simp: has_bochner_integral_iff set_integrable_def)
[PROOF STATE]
proof (state)
this:
set_integrable lborel A (\<lambda>t. exp (- t\<^sup>2))

goal (1 subgoal):
 1. (\<lambda>t. exp (- t\<^sup>2)) integrable_on A
[PROOF STEP]
thus ?thesis2
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel A (\<lambda>t. exp (- t\<^sup>2))

goal (1 subgoal):
 1. (\<lambda>t. exp (- t\<^sup>2)) integrable_on A
[PROOF STEP]
by (rule set_borel_integral_eq_integral)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. exp (- t\<^sup>2)) integrable_on A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Limsup_filtermap_le: "inj f \<Longrightarrow> Limsup (filtermap f F) g \<le> Limsup F (\<lambda>x. g (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f \<Longrightarrow> Limsup (filtermap f F) g \<le> Limsup F (\<lambda>x. g (f x))
[PROOF STEP]
apply (cases "F = bot", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj f; F \<noteq> bot\<rbrakk> \<Longrightarrow> Limsup (filtermap f F) g \<le> Limsup F (\<lambda>x. g (f x))
[PROOF STEP]
apply (rule Limsup_greatest)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. \<lbrakk>inj f; F \<noteq> bot; eventually P F\<rbrakk> \<Longrightarrow> Limsup (filtermap f F) g \<le> (SUP x\<in>Collect P. g (f x))
[PROOF STEP]
subgoal for P
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj f; F \<noteq> bot; eventually P F\<rbrakk> \<Longrightarrow> Limsup (filtermap f F) g \<le> (SUP x\<in>Collect P. g (f x))
[PROOF STEP]
by (auto simp: eventually_filtermap the_inv_f_f
        intro!: Limsup_bounded SUP_upper2 eventually_mono[of P])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_integrable_mult_right_iff [simp]:
  fixes a :: "'a::{real_normed_field, second_countable_topology}"
  assumes "a \<noteq> 0"
  shows "set_integrable M A (\<lambda>t. a * f t) \<longleftrightarrow> set_integrable M A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M A (\<lambda>t. a * f t) = set_integrable M A f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set_integrable M A (\<lambda>t. a * f t) \<Longrightarrow> set_integrable M A f
 2. set_integrable M A f \<Longrightarrow> set_integrable M A (\<lambda>t. a * f t)
[PROOF STEP]
assume "set_integrable M A (\<lambda>t. a * f t)"
[PROOF STATE]
proof (state)
this:
set_integrable M A (\<lambda>t. a * f t)

goal (2 subgoals):
 1. set_integrable M A (\<lambda>t. a * f t) \<Longrightarrow> set_integrable M A f
 2. set_integrable M A f \<Longrightarrow> set_integrable M A (\<lambda>t. a * f t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_integrable M A (\<lambda>t. a * f t)
[PROOF STEP]
have "set_integrable M A (\<lambda>t. 1/a * (a * f t))"
[PROOF STATE]
proof (prove)
using this:
set_integrable M A (\<lambda>t. a * f t)

goal (1 subgoal):
 1. set_integrable M A (\<lambda>t. (1::'a) / a * (a * f t))
[PROOF STEP]
using set_integrable_mult_right
[PROOF STATE]
proof (prove)
using this:
set_integrable M A (\<lambda>t. a * f t)
(?a \<noteq> (0::?'a) \<Longrightarrow> set_integrable ?M ?A ?f) \<Longrightarrow> set_integrable ?M ?A (\<lambda>t. ?a * ?f t)

goal (1 subgoal):
 1. set_integrable M A (\<lambda>t. (1::'a) / a * (a * f t))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set_integrable M A (\<lambda>t. (1::'a) / a * (a * f t))

goal (2 subgoals):
 1. set_integrable M A (\<lambda>t. a * f t) \<Longrightarrow> set_integrable M A f
 2. set_integrable M A f \<Longrightarrow> set_integrable M A (\<lambda>t. a * f t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_integrable M A (\<lambda>t. (1::'a) / a * (a * f t))
[PROOF STEP]
show "set_integrable M A f"
[PROOF STATE]
proof (prove)
using this:
set_integrable M A (\<lambda>t. (1::'a) / a * (a * f t))

goal (1 subgoal):
 1. set_integrable M A f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set_integrable M A (\<lambda>t. (1::'a) / a * (a * f t))
a \<noteq> (0::'a)

goal (1 subgoal):
 1. set_integrable M A f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_integrable M A f

goal (1 subgoal):
 1. set_integrable M A f \<Longrightarrow> set_integrable M A (\<lambda>t. a * f t)
[PROOF STEP]
qed auto


[STATEMENT]
lemma op_smc_smc_0[smc_op_simps]: "op_smc (smc_0) = smc_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_smc smc_0 = smc_0
[PROOF STEP]
proof(rule smc_dg_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. semicategory ?\<alpha> (op_smc smc_0)
 2. semicategory ?\<alpha> smc_0
 3. op_smc smc_0\<lparr>Comp\<rparr> = smc_0\<lparr>Comp\<rparr>
 4. smc_dg (op_smc smc_0) = smc_dg smc_0
[PROOF STEP]
define \<beta> where "\<beta> = \<omega> + \<omega>"
[PROOF STATE]
proof (state)
this:
\<beta> = \<omega> + \<omega>

goal (4 subgoals):
 1. semicategory ?\<alpha> (op_smc smc_0)
 2. semicategory ?\<alpha> smc_0
 3. op_smc smc_0\<lparr>Comp\<rparr> = smc_0\<lparr>Comp\<rparr>
 4. smc_dg (op_smc smc_0) = smc_dg smc_0
[PROOF STEP]
interpret \<beta>: \<Z> \<beta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Z> \<beta>
[PROOF STEP]
unfolding \<beta>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Z> (\<omega> + \<omega>)
[PROOF STEP]
by (rule \<Z>_\<omega>\<omega>)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. semicategory ?\<alpha> (op_smc smc_0)
 2. semicategory ?\<alpha> smc_0
 3. op_smc smc_0\<lparr>Comp\<rparr> = smc_0\<lparr>Comp\<rparr>
 4. smc_dg (op_smc smc_0) = smc_dg smc_0
[PROOF STEP]
show "semicategory \<beta> (op_smc smc_0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semicategory \<beta> (op_smc smc_0)
[PROOF STEP]
by (cs_concl cs_shallow cs_intro: smc_cs_intros smc_op_intros)
[PROOF STATE]
proof (state)
this:
semicategory \<beta> (op_smc smc_0)

goal (3 subgoals):
 1. semicategory (\<omega> + \<omega>) smc_0
 2. op_smc smc_0\<lparr>Comp\<rparr> = smc_0\<lparr>Comp\<rparr>
 3. smc_dg (op_smc smc_0) = smc_dg smc_0
[PROOF STEP]
show "semicategory \<beta> smc_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semicategory \<beta> smc_0
[PROOF STEP]
by (cs_concl cs_shallow cs_intro: smc_cs_intros)
[PROOF STATE]
proof (state)
this:
semicategory \<beta> smc_0

goal (2 subgoals):
 1. op_smc smc_0\<lparr>Comp\<rparr> = smc_0\<lparr>Comp\<rparr>
 2. smc_dg (op_smc smc_0) = smc_dg smc_0
[PROOF STEP]
qed
  (
    simp_all add:
      smc_0_components op_smc_components smc_dg_smc_0
      slicing_commute[symmetric] dg_op_simps
  )


[STATEMENT]
lemma del_list_sorted4:
  "sorted1 (xs @ (a,a') # ys @ (b,b') # zs @ (c,c') # us) \<Longrightarrow> x < c \<Longrightarrow>
  del_list x (xs @ (a,a') # ys @ (b,b') # zs @ (c,c') # us) = del_list x (xs @ (a,a') # ys @ (b,b') # zs) @ (c,c') # us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted1 (xs @ (a, a') # ys @ (b, b') # zs @ (c, c') # us); x < c\<rbrakk> \<Longrightarrow> del_list x (xs @ (a, a') # ys @ (b, b') # zs @ (c, c') # us) = del_list x (xs @ (a, a') # ys @ (b, b') # zs) @ (c, c') # us
[PROOF STEP]
by (auto simp: del_list_sorted sorted_lems)