[STATEMENT]
theorem detects_cycle:
  assumes has_negative_cycle
  shows "\<exists>i \<le> n. OPT (n + 1) i < OPT n i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
from assms \<open>t \<le> n\<close>
[PROOF STATE]
proof (chain)
picking this:
local.has_negative_cycle
t \<le> n
[PROOF STEP]
obtain xs a ys where cycle:
    "a \<le> n" "set xs \<subseteq> {0..n}" "set ys \<subseteq> {0..n}"
    "weight (a # xs @ [a]) < 0" "is_path (a # ys)"
[PROOF STATE]
proof (prove)
using this:
local.has_negative_cycle
t \<le> n

goal (1 subgoal):
 1. (\<And>a xs ys. \<lbrakk>a \<le> n; set xs \<subseteq> {0..n}; set ys \<subseteq> {0..n}; local.weight (a # xs @ [a]) < 0; local.is_path (a # ys)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding has_negative_cycle_def
[PROOF STATE]
proof (prove)
using this:
\<exists>xs a ys. set (a # xs @ ys) \<subseteq> {0..n} \<and> local.weight (a # xs @ [a]) < 0 \<and> local.is_path (a # ys)
t \<le> n

goal (1 subgoal):
 1. (\<And>a xs ys. \<lbrakk>a \<le> n; set xs \<subseteq> {0..n}; set ys \<subseteq> {0..n}; local.weight (a # xs @ [a]) < 0; local.is_path (a # ys)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0
local.is_path (a # ys)

goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0
local.is_path (a # ys)
[PROOF STEP]
have "reaches a"
[PROOF STATE]
proof (prove)
using this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0
local.is_path (a # ys)

goal (1 subgoal):
 1. local.reaches a
[PROOF STEP]
unfolding reaches_def
[PROOF STATE]
proof (prove)
using this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0
local.is_path (a # ys)

goal (1 subgoal):
 1. \<exists>xs. local.is_path (a # xs) \<and> a \<le> n \<and> set xs \<subseteq> {0..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.reaches a

goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
have reaches: "reaches x" if "x \<in> set xs" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.reaches x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.reaches x
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
x \<in> set xs
[PROOF STEP]
obtain as bs where "xs = as @ x # bs"
[PROOF STATE]
proof (prove)
using this:
x \<in> set xs

goal (1 subgoal):
 1. (\<And>as bs. xs = as @ x # bs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by atomize_elim (rule split_list)
[PROOF STATE]
proof (state)
this:
xs = as @ x # bs

goal (1 subgoal):
 1. local.reaches x
[PROOF STEP]
with cycle
[PROOF STATE]
proof (chain)
picking this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0
local.is_path (a # ys)
xs = as @ x # bs
[PROOF STEP]
have "weight (x # bs @ [a]) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0
local.is_path (a # ys)
xs = as @ x # bs

goal (1 subgoal):
 1. local.weight (x # bs @ [a]) < \<infinity>
[PROOF STEP]
using weight_append[of "a # as" x "bs @ [a]"]
[PROOF STATE]
proof (prove)
using this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0
local.is_path (a # ys)
xs = as @ x # bs
local.weight ((a # as) @ x # bs @ [a]) = local.weight ((a # as) @ [x]) + local.weight (x # bs @ [a])

goal (1 subgoal):
 1. local.weight (x # bs @ [a]) < \<infinity>
[PROOF STEP]
by simp (metis Pinf_add_right Pinf_le add.commute less_eq_extended.simps(2) not_less)
[PROOF STATE]
proof (state)
this:
local.weight (x # bs @ [a]) < \<infinity>

goal (1 subgoal):
 1. local.reaches x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.weight (x # bs @ [a]) < \<infinity>

goal (1 subgoal):
 1. local.reaches x
[PROOF STEP]
from \<open>reaches a\<close>
[PROOF STATE]
proof (chain)
picking this:
local.reaches a
[PROOF STEP]
obtain cs where "local.weight (a # cs @ [t]) < \<infinity>" "set cs \<subseteq> {0..n}"
[PROOF STATE]
proof (prove)
using this:
local.reaches a

goal (1 subgoal):
 1. (\<And>cs. \<lbrakk>local.weight (a # cs @ [t]) < \<infinity>; set cs \<subseteq> {0..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding reaches_def is_path_def
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. local.weight ((a # xs) @ [t]) < \<infinity> \<and> a \<le> n \<and> set xs \<subseteq> {0..n}

goal (1 subgoal):
 1. (\<And>cs. \<lbrakk>local.weight (a # cs @ [t]) < \<infinity>; set cs \<subseteq> {0..n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.weight (a # cs @ [t]) < \<infinity>
set cs \<subseteq> {0..n}

goal (1 subgoal):
 1. local.reaches x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local.weight (x # bs @ [a]) < \<infinity>
local.weight (a # cs @ [t]) < \<infinity>
set cs \<subseteq> {0..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.weight (x # bs @ [a]) < \<infinity>
local.weight (a # cs @ [t]) < \<infinity>
set cs \<subseteq> {0..n}

goal (1 subgoal):
 1. local.reaches x
[PROOF STEP]
unfolding reaches_def is_path_def
[PROOF STATE]
proof (prove)
using this:
local.weight (x # bs @ [a]) < \<infinity>
local.weight (a # cs @ [t]) < \<infinity>
set cs \<subseteq> {0..n}

goal (1 subgoal):
 1. \<exists>xs. local.weight ((x # xs) @ [t]) < \<infinity> \<and> x \<le> n \<and> set xs \<subseteq> {0..n}
[PROOF STEP]
using \<open>a \<le> n\<close> weight_append[of "x # bs" a "cs @ [t]"] cycle(2) \<open>xs = _\<close>
[PROOF STATE]
proof (prove)
using this:
local.weight (x # bs @ [a]) < \<infinity>
local.weight (a # cs @ [t]) < \<infinity>
set cs \<subseteq> {0..n}
a \<le> n
local.weight ((x # bs) @ a # cs @ [t]) = local.weight ((x # bs) @ [a]) + local.weight (a # cs @ [t])
set xs \<subseteq> {0..n}
xs = as @ x # bs

goal (1 subgoal):
 1. \<exists>xs. local.weight ((x # xs) @ [t]) < \<infinity> \<and> x \<le> n \<and> set xs \<subseteq> {0..n}
[PROOF STEP]
by - (rule exI[where x = "bs @ [a] @ cs"], auto intro: add_lt_infI)
[PROOF STATE]
proof (state)
this:
local.reaches x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 \<in> set xs \<Longrightarrow> local.reaches ?x2

goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
let ?S = "sum_list (map (OPT n) (a # xs @ [a]))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
obtain u v where "u \<le> n" "v \<le> n" "OPT n v + W u v < OPT n u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<le> n; v \<le> n; local.OPT n v + W u v < local.OPT n u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (atomize_elim, rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
assume "\<nexists>u v. u \<le> n \<and> v \<le> n \<and> OPT n v + W u v < OPT n u"
[PROOF STATE]
proof (state)
this:
\<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u

goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u
[PROOF STEP]
have "?S \<le> ?S + weight (a # xs @ [a])"
[PROOF STATE]
proof (prove)
using this:
\<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u

goal (1 subgoal):
 1. sum_list (map (local.OPT n) (a # xs @ [a])) \<le> sum_list (map (local.OPT n) (a # xs @ [a])) + local.weight (a # xs @ [a])
[PROOF STEP]
using cycle(1-3)
[PROOF STATE]
proof (prove)
using this:
\<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}

goal (1 subgoal):
 1. sum_list (map (local.OPT n) (a # xs @ [a])) \<le> sum_list (map (local.OPT n) (a # xs @ [a])) + local.weight (a # xs @ [a])
[PROOF STEP]
by (subst fold_sum_aux; fastforce simp: subset_eq)
[PROOF STATE]
proof (state)
this:
sum_list (map (local.OPT n) (a # xs @ [a])) \<le> sum_list (map (local.OPT n) (a # xs @ [a])) + local.weight (a # xs @ [a])

goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum_list (map (local.OPT n) (a # xs @ [a])) \<le> sum_list (map (local.OPT n) (a # xs @ [a])) + local.weight (a # xs @ [a])

goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
have "?S > -\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. -\<infinity> < sum_list (map (local.OPT n) (a # xs @ [a]))
[PROOF STEP]
using cycle(1-4)
[PROOF STATE]
proof (prove)
using this:
a \<le> n
set xs \<subseteq> {0..n}
set ys \<subseteq> {0..n}
local.weight (a # xs @ [a]) < 0

goal (1 subgoal):
 1. -\<infinity> < sum_list (map (local.OPT n) (a # xs @ [a]))
[PROOF STEP]
by (intro sum_list_not_minfI, auto intro!: OPT_not_minfI)
[PROOF STATE]
proof (state)
this:
-\<infinity> < sum_list (map (local.OPT n) (a # xs @ [a]))

goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
-\<infinity> < sum_list (map (local.OPT n) (a # xs @ [a]))

goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
have "?S < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map (local.OPT n) (a # xs @ [a])) < \<infinity>
[PROOF STEP]
using reaches \<open>t \<le> n\<close> cycle(1,2)
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> set xs \<Longrightarrow> local.reaches ?x2
t \<le> n
a \<le> n
set xs \<subseteq> {0..n}

goal (1 subgoal):
 1. sum_list (map (local.OPT n) (a # xs @ [a])) < \<infinity>
[PROOF STEP]
by (intro sum_list_not_infI) (auto intro: reaches_non_inf_path \<open>reaches a\<close> simp: subset_eq)
[PROOF STATE]
proof (state)
this:
sum_list (map (local.OPT n) (a # xs @ [a])) < \<infinity>

goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum_list (map (local.OPT n) (a # xs @ [a])) \<le> sum_list (map (local.OPT n) (a # xs @ [a])) + local.weight (a # xs @ [a])
-\<infinity> < sum_list (map (local.OPT n) (a # xs @ [a]))
sum_list (map (local.OPT n) (a # xs @ [a])) < \<infinity>
[PROOF STEP]
have "weight (a # xs @ [a]) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
sum_list (map (local.OPT n) (a # xs @ [a])) \<le> sum_list (map (local.OPT n) (a # xs @ [a])) + local.weight (a # xs @ [a])
-\<infinity> < sum_list (map (local.OPT n) (a # xs @ [a]))
sum_list (map (local.OPT n) (a # xs @ [a])) < \<infinity>

goal (1 subgoal):
 1. 0 \<le> local.weight (a # xs @ [a])
[PROOF STEP]
by (simp add: le_add_same_cancel1)
[PROOF STATE]
proof (state)
this:
0 \<le> local.weight (a # xs @ [a])

goal (1 subgoal):
 1. \<nexists>u v. u \<le> n \<and> v \<le> n \<and> local.OPT n v + W u v < local.OPT n u \<Longrightarrow> False
[PROOF STEP]
with \<open>weight _ < 0\<close>
[PROOF STATE]
proof (chain)
picking this:
local.weight (a # xs @ [a]) < 0
0 \<le> local.weight (a # xs @ [a])
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
local.weight (a # xs @ [a]) < 0
0 \<le> local.weight (a # xs @ [a])

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u \<le> n
v \<le> n
local.OPT n v + W u v < local.OPT n u

goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<le> n
v \<le> n
local.OPT n v + W u v < local.OPT n u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u \<le> n
v \<le> n
local.OPT n v + W u v < local.OPT n u

goal (1 subgoal):
 1. \<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i
[PROOF STEP]
by -
       (rule exI[where x = u],
        auto 4 4 intro: Min.coboundedI min.strict_coboundedI2 elim: order.strict_trans1[rotated]
          simp: OPT_Suc[OF \<open>t \<le> n\<close>])
[PROOF STATE]
proof (state)
this:
\<exists>i\<le>n. local.OPT (n + 1) i < local.OPT n i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rpr_less_not: "\<lbrakk> rpr A r; hasw [x,y] A; \<not> x \<^bsub>r\<^esub>\<prec> y \<rbrakk> \<Longrightarrow> y \<^bsub>r\<^esub>\<preceq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rpr A r; hasw [x, y] A; \<not> x \<^bsub>r\<^esub>\<prec> y\<rbrakk> \<Longrightarrow> y \<^bsub>r\<^esub>\<preceq> x
[PROOF STEP]
unfolding rpr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>complete A r \<and> refl_on A r \<and> trans r; hasw [x, y] A; \<not> x \<^bsub>r\<^esub>\<prec> y\<rbrakk> \<Longrightarrow> y \<^bsub>r\<^esub>\<preceq> x
[PROOF STEP]
by (auto simp add: complete_less_not)


[STATEMENT]
lemma pointwise_fun_fold:
    fixes f :: "'a \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b)"
    fixes s :: "'a \<Rightarrow> 'b"
    assumes indep1: "\<And>x x' s. x \<noteq> x' \<Longrightarrow> f x s x' = s x'"
    assumes indep2:  "\<And>x x' s. x \<noteq> x' \<Longrightarrow> f x (f x' s) x = f x s x"
    assumes [simp]: "distinct xs"
    shows "fold f xs s x = (if x \<in> set xs then f x s x else s x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold f xs s x = (if x \<in> set xs then f x s x else s x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fold f xs s x = (if x \<in> set xs then f x s x else s x)
[PROOF STEP]
interpret pointwise_op f "\<lambda>s. s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pointwise_op f (\<lambda>s. s)
[PROOF STEP]
by unfold_locales fact+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fold f xs s x = (if x \<in> set xs then f x s x else s x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold f xs s x = (if x \<in> set xs then f x s x else s x)
[PROOF STEP]
using pointwise_upd_fold[of xs s x]
[PROOF STATE]
proof (prove)
using this:
distinct xs \<Longrightarrow> fold f xs s x = (if x \<in> set xs then f x s x else s x)

goal (1 subgoal):
 1. fold f xs s x = (if x \<in> set xs then f x s x else s x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fold f xs s x = (if x \<in> set xs then f x s x else s x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma t1_space_singleton_Inter_open:
      "t1_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. \<Inter>{U. openin X U \<and> x \<in> U} = {x})"  (is "?P=?Q")
  and t1_space_Inter_open_supersets:
     "t1_space X \<longleftrightarrow> (\<forall>S. S \<subseteq> topspace X \<longrightarrow> \<Inter>{U. openin X U \<and> S \<subseteq> U} = S)" (is "?P=?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}) &&& t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x})
 2. t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
have "?R \<Longrightarrow> ?Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S \<Longrightarrow> \<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S; x \<in> topspace X\<rbrakk> \<Longrightarrow> \<Inter> {U. openin X U \<and> x \<in> U} = {x}
[PROOF STEP]
apply (drule_tac x="{x}" in spec, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S \<Longrightarrow> \<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}

goal (2 subgoals):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x})
 2. t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S \<Longrightarrow> \<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}

goal (2 subgoals):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x})
 2. t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
have "?Q \<Longrightarrow> ?P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x} \<Longrightarrow> t1_space X
[PROOF STEP]
apply (clarsimp simp add: t1_space_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}; x \<in> topspace X; y \<in> topspace X; x \<noteq> y\<rbrakk> \<Longrightarrow> \<exists>U. openin X U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
apply (drule_tac x=x in bspec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> topspace X; y \<in> topspace X; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<in> topspace X
 2. \<And>x y. \<lbrakk>x \<in> topspace X; y \<in> topspace X; x \<noteq> y; \<Inter> {U. openin X U \<and> x \<in> U} = {x}\<rbrakk> \<Longrightarrow> \<exists>U. openin X U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
apply (simp_all add: set_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> topspace X; y \<in> topspace X; x \<noteq> y; \<forall>xa. (\<forall>xb. openin X xb \<and> x \<in> xb \<longrightarrow> xa \<in> xb) = (xa = x)\<rbrakk> \<Longrightarrow> \<exists>U. openin X U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x} \<Longrightarrow> t1_space X

goal (2 subgoals):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x})
 2. t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x} \<Longrightarrow> t1_space X

goal (2 subgoals):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x})
 2. t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
have "?P \<Longrightarrow> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X \<Longrightarrow> \<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S
[PROOF STEP]
proof (clarsimp simp add: t1_space_closedin_singleton, rule subset_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X\<rbrakk> \<Longrightarrow> \<Inter> {U. openin X U \<and> S \<subseteq> U} \<subseteq> S
 2. \<And>S. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X\<rbrakk> \<Longrightarrow> S \<subseteq> \<Inter> {U. openin X U \<and> S \<subseteq> U}
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X\<rbrakk> \<Longrightarrow> \<Inter> {U. openin X U \<and> S \<subseteq> U} \<subseteq> S
 2. \<And>S. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X\<rbrakk> \<Longrightarrow> S \<subseteq> \<Inter> {U. openin X U \<and> S \<subseteq> U}
[PROOF STEP]
assume S: "\<forall>x\<in>topspace X. closedin X {x}" "S \<subseteq> topspace X"
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>topspace X. closedin X {x}
S \<subseteq> topspace X

goal (2 subgoals):
 1. \<And>S. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X\<rbrakk> \<Longrightarrow> \<Inter> {U. openin X U \<and> S \<subseteq> U} \<subseteq> S
 2. \<And>S. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X\<rbrakk> \<Longrightarrow> S \<subseteq> \<Inter> {U. openin X U \<and> S \<subseteq> U}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>topspace X. closedin X {x}
S \<subseteq> topspace X
[PROOF STEP]
show "\<Inter> {U. openin X U \<and> S \<subseteq> U} \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>topspace X. closedin X {x}
S \<subseteq> topspace X

goal (1 subgoal):
 1. \<Inter> {U. openin X U \<and> S \<subseteq> U} \<subseteq> S
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X; \<forall>xa. openin X xa \<and> S \<subseteq> xa \<longrightarrow> x \<in> xa\<rbrakk> \<Longrightarrow> x \<in> S
[PROOF STEP]
by (metis Diff_insert_absorb Set.set_insert closedin_def openin_topspace subset_insert)
[PROOF STATE]
proof (state)
this:
\<Inter> {U. openin X U \<and> S \<subseteq> U} \<subseteq> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<forall>x\<in>topspace X. closedin X {x}; S \<subseteq> topspace X\<rbrakk> \<Longrightarrow> S \<subseteq> \<Inter> {U. openin X U \<and> S \<subseteq> U}
[PROOF STEP]
qed force
[PROOF STATE]
proof (state)
this:
t1_space X \<Longrightarrow> \<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S

goal (2 subgoals):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x})
 2. t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S \<Longrightarrow> \<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}
\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x} \<Longrightarrow> t1_space X
t1_space X \<Longrightarrow> \<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S
[PROOF STEP]
show "?P=?Q" "?P=?R"
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S \<Longrightarrow> \<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}
\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x} \<Longrightarrow> t1_space X
t1_space X \<Longrightarrow> \<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S

goal (1 subgoal):
 1. t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x}) &&& t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t1_space X = (\<forall>x\<in>topspace X. \<Inter> {U. openin X U \<and> x \<in> U} = {x})
t1_space X = (\<forall>S\<subseteq>topspace X. \<Inter> {U. openin X U \<and> S \<subseteq> U} = S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_of_name[simp]: "to_name (of_name a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_name (of_name a) = a
[PROOF STEP]
unfolding to_name_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv of_name (of_name a) = a
[PROOF STEP]
using bij
[PROOF STATE]
proof (prove)
using this:
bij of_name

goal (1 subgoal):
 1. inv of_name (of_name a) = a
[PROOF STEP]
by (metis bij_inv_eq_iff)


[STATEMENT]
lemma rel_gpv''_refl: "\<lbrakk> (=) \<le> A; (=) \<le> C; R \<le> (=) \<rbrakk> \<Longrightarrow> (=) \<le> rel_gpv'' A C R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(=) \<le> A; (=) \<le> C; R \<le> (=)\<rbrakk> \<Longrightarrow> (=) \<le> rel_gpv'' A C R
[PROOF STEP]
by(subst rel_gpv''_eq[symmetric])(rule rel_gpv''_mono)


[STATEMENT]
lemma (in topological_space) nhds_discrete_open: "open {x} \<Longrightarrow> nhds x = principal {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x} \<Longrightarrow> nhds x = principal {x}
[PROOF STEP]
by (auto simp: nhds_def intro!: antisym INF_greatest INF_lower2[of "{x}"])


[STATEMENT]
lemma range_diff [simp]:
  fixes a::"'a::group_add" shows "range ((-) a) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj ((-) a)
[PROOF STEP]
by (metis (full_types) add_minus_cancel diff_minus_eq_add surj_def)


[STATEMENT]
lemma borel_Ioi:
  "borel = sigma UNIV (range greaterThan :: 'a::{linorder_topology, second_countable_topology} set set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel = sigma UNIV (range greaterThan)
[PROOF STEP]
unfolding second_countable_borel_measurable[OF open_generated_order]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma UNIV (range lessThan \<union> range greaterThan) = sigma UNIV (range greaterThan)
[PROOF STEP]
proof (intro sigma_eqI sigma_sets_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. range lessThan \<union> range greaterThan \<subseteq> Pow UNIV
 2. range greaterThan \<subseteq> Pow UNIV
 3. \<And>a. a \<in> range lessThan \<union> range greaterThan \<Longrightarrow> a \<in> sigma_sets UNIV (range greaterThan)
 4. \<And>b. b \<in> range greaterThan \<Longrightarrow> b \<in> sigma_sets UNIV (range lessThan \<union> range greaterThan)
[PROOF STEP]
obtain D :: "'a set" where D: "countable D" "\<And>X. open X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> \<exists>d\<in>D. d \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>D. \<lbrakk>countable D; \<And>X. \<lbrakk>open X; X \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>d\<in>D. d \<in> X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule countable_dense_setE) blast
[PROOF STATE]
proof (state)
this:
countable D
\<lbrakk>open ?X; ?X \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>d\<in>D. d \<in> ?X

goal (4 subgoals):
 1. range lessThan \<union> range greaterThan \<subseteq> Pow UNIV
 2. range greaterThan \<subseteq> Pow UNIV
 3. \<And>a. a \<in> range lessThan \<union> range greaterThan \<Longrightarrow> a \<in> sigma_sets UNIV (range greaterThan)
 4. \<And>b. b \<in> range greaterThan \<Longrightarrow> b \<in> sigma_sets UNIV (range lessThan \<union> range greaterThan)
[PROOF STEP]
interpret L: sigma_algebra UNIV "sigma_sets UNIV (range greaterThan)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra UNIV (sigma_sets UNIV (range greaterThan))
[PROOF STEP]
by (rule sigma_algebra_sigma_sets) simp
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. range lessThan \<union> range greaterThan \<subseteq> Pow UNIV
 2. range greaterThan \<subseteq> Pow UNIV
 3. \<And>a. a \<in> range lessThan \<union> range greaterThan \<Longrightarrow> a \<in> sigma_sets UNIV (range greaterThan)
 4. \<And>b. b \<in> range greaterThan \<Longrightarrow> b \<in> sigma_sets UNIV (range lessThan \<union> range greaterThan)
[PROOF STEP]
fix A :: "'a set"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. range lessThan \<union> range greaterThan \<subseteq> Pow UNIV
 2. range greaterThan \<subseteq> Pow UNIV
 3. \<And>a. a \<in> range lessThan \<union> range greaterThan \<Longrightarrow> a \<in> sigma_sets UNIV (range greaterThan)
 4. \<And>b. b \<in> range greaterThan \<Longrightarrow> b \<in> sigma_sets UNIV (range lessThan \<union> range greaterThan)
[PROOF STEP]
assume "A \<in> range lessThan \<union> range greaterThan"
[PROOF STATE]
proof (state)
this:
A \<in> range lessThan \<union> range greaterThan

goal (4 subgoals):
 1. range lessThan \<union> range greaterThan \<subseteq> Pow UNIV
 2. range greaterThan \<subseteq> Pow UNIV
 3. \<And>a. a \<in> range lessThan \<union> range greaterThan \<Longrightarrow> a \<in> sigma_sets UNIV (range greaterThan)
 4. \<And>b. b \<in> range greaterThan \<Longrightarrow> b \<in> sigma_sets UNIV (range lessThan \<union> range greaterThan)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> range lessThan \<union> range greaterThan
[PROOF STEP]
obtain y where "A = {y <..} \<or> A = {..< y}"
[PROOF STATE]
proof (prove)
using this:
A \<in> range lessThan \<union> range greaterThan

goal (1 subgoal):
 1. (\<And>y. A = {y<..} \<or> A = {..<y} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A = {y<..} \<or> A = {..<y}

goal (4 subgoals):
 1. range lessThan \<union> range greaterThan \<subseteq> Pow UNIV
 2. range greaterThan \<subseteq> Pow UNIV
 3. \<And>a. a \<in> range lessThan \<union> range greaterThan \<Longrightarrow> a \<in> sigma_sets UNIV (range greaterThan)
 4. \<And>b. b \<in> range greaterThan \<Longrightarrow> b \<in> sigma_sets UNIV (range lessThan \<union> range greaterThan)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = {y<..} \<or> A = {..<y}
[PROOF STEP]
show "A \<in> sigma_sets UNIV (range greaterThan)"
[PROOF STATE]
proof (prove)
using this:
A = {y<..} \<or> A = {..<y}

goal (1 subgoal):
 1. A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = {y<..} \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. A = {..<y} \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
assume A: "A = {..< y}"
[PROOF STATE]
proof (state)
this:
A = {..<y}

goal (2 subgoals):
 1. A = {y<..} \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. A = {..<y} \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. \<not> ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
assume "\<forall>x<y. \<exists>d. x < d \<and> d < y"
[PROOF STATE]
proof (state)
this:
\<forall>x<y. \<exists>d>x. d < y

goal (2 subgoals):
 1. ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. \<not> ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
with D(2)[of "{x <..< y}" for x]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>open {?x3<..<y}; {?x3<..<y} \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>d\<in>D. d \<in> {?x3<..<y}
\<forall>x<y. \<exists>d>x. d < y
[PROOF STEP]
have "\<forall>x<y. \<exists>d\<in>D. x < d \<and> d < y"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open {?x3<..<y}; {?x3<..<y} \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>d\<in>D. d \<in> {?x3<..<y}
\<forall>x<y. \<exists>d>x. d < y

goal (1 subgoal):
 1. \<forall>x<y. \<exists>d\<in>D. x < d \<and> d < y
[PROOF STEP]
by (auto simp: set_eq_iff)
[PROOF STATE]
proof (state)
this:
\<forall>x<y. \<exists>d\<in>D. x < d \<and> d < y

goal (2 subgoals):
 1. ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. \<not> ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<y. \<exists>d\<in>D. x < d \<and> d < y
[PROOF STEP]
have "A = UNIV - (\<Inter>d\<in>{d\<in>D. d < y}. {d <..})"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<y. \<exists>d\<in>D. x < d \<and> d < y

goal (1 subgoal):
 1. A = UNIV - \<Inter> (greaterThan ` {d \<in> D. d < y})
[PROOF STEP]
by (auto simp: A) (metis less_asym)
[PROOF STATE]
proof (state)
this:
A = UNIV - \<Inter> (greaterThan ` {d \<in> D. d < y})

goal (2 subgoals):
 1. ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. \<not> ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A = UNIV - \<Inter> (greaterThan ` {d \<in> D. d < y})

goal (2 subgoals):
 1. ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. \<not> ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
have "\<dots> \<in> sigma_sets UNIV (range greaterThan)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV - \<Inter> (greaterThan ` {d \<in> D. d < y}) \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
using D(1)
[PROOF STATE]
proof (prove)
using this:
countable D

goal (1 subgoal):
 1. UNIV - \<Inter> (greaterThan ` {d \<in> D. d < y}) \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
by (intro L.Diff L.top L.countable_INT'') auto
[PROOF STATE]
proof (state)
this:
UNIV - \<Inter> (greaterThan ` {d \<in> D. d < y}) \<in> sigma_sets UNIV (range greaterThan)

goal (2 subgoals):
 1. ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
 2. \<not> ?P \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<in> sigma_sets UNIV (range greaterThan)

goal (1 subgoal):
 1. A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets UNIV (range greaterThan)

goal (1 subgoal):
 1. \<not> (\<forall>x<y. \<exists>d>x. d < y) \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>x<y. \<exists>d>x. d < y) \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
assume "\<not> (\<forall>x<y. \<exists>d. x < d \<and> d < y)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x<y. \<exists>d>x. d < y)

goal (1 subgoal):
 1. \<not> (\<forall>x<y. \<exists>d>x. d < y) \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>x<y. \<exists>d>x. d < y)
[PROOF STEP]
obtain x where "x < y"  "\<And>d. y > d \<Longrightarrow> x \<ge> d"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x<y. \<exists>d>x. d < y)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x < y; \<And>d. d < y \<Longrightarrow> d \<le> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: not_less[symmetric])
[PROOF STATE]
proof (state)
this:
x < y
?d1 < y \<Longrightarrow> ?d1 \<le> x

goal (1 subgoal):
 1. \<not> (\<forall>x<y. \<exists>d>x. d < y) \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < y
?d1 < y \<Longrightarrow> ?d1 \<le> x
[PROOF STEP]
have "A = UNIV - {x <..}"
[PROOF STATE]
proof (prove)
using this:
x < y
?d1 < y \<Longrightarrow> ?d1 \<le> x

goal (1 subgoal):
 1. A = UNIV - {x<..}
[PROOF STEP]
unfolding A Compl_eq_Diff_UNIV[symmetric]
[PROOF STATE]
proof (prove)
using this:
x < y
?d1 < y \<Longrightarrow> ?d1 \<le> x

goal (1 subgoal):
 1. {..<y} = - {x<..}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = UNIV - {x<..}

goal (1 subgoal):
 1. \<not> (\<forall>x<y. \<exists>d>x. d < y) \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A = UNIV - {x<..}

goal (1 subgoal):
 1. \<not> (\<forall>x<y. \<exists>d>x. d < y) \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
have "\<dots> \<in> sigma_sets UNIV (range greaterThan)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV - {x<..} \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV - {x<..} \<in> sigma_sets UNIV (range greaterThan)

goal (1 subgoal):
 1. \<not> (\<forall>x<y. \<exists>d>x. d < y) \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<in> sigma_sets UNIV (range greaterThan)

goal (1 subgoal):
 1. A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets UNIV (range greaterThan)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets UNIV (range greaterThan)

goal (1 subgoal):
 1. A = {y<..} \<Longrightarrow> A \<in> sigma_sets UNIV (range greaterThan)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets UNIV (range greaterThan)

goal (3 subgoals):
 1. range lessThan \<union> range greaterThan \<subseteq> Pow UNIV
 2. range greaterThan \<subseteq> Pow UNIV
 3. \<And>b. b \<in> range greaterThan \<Longrightarrow> b \<in> sigma_sets UNIV (range lessThan \<union> range greaterThan)
[PROOF STEP]
qed auto


[STATEMENT]
lemma eval_at_point_indexed_pmult:
  assumes "a \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "A \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "i < n"
  shows "eval_at_point R a (A \<Otimes> i) =
          eval_at_point R a A \<otimes>\<^bsub>R\<^esub> (a!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_at_point R a (A \<Otimes> i) = eval_at_point R a A \<otimes> a ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_at_point R a (A \<Otimes> i) = eval_at_point R a A \<otimes> a ! i
[PROOF STEP]
have "(A \<Otimes> i) = A \<otimes>\<^bsub>R[\<X>\<^bsub>n\<^esub>]\<^esub> (pvar R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<Otimes> i = A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
[PROOF STEP]
using assms(2) pvar_indexed_pmult
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
?p \<in> carrier (R [\<X>\<^bsub>?n\<^esub>]) \<Longrightarrow> ?p \<Otimes> ?i = ?p \<otimes>\<^bsub>R [\<X>\<^bsub>?n\<^esub>]\<^esub> pvar R ?i

goal (1 subgoal):
 1. A \<Otimes> i = A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<Otimes> i = A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i

goal (1 subgoal):
 1. eval_at_point R a (A \<Otimes> i) = eval_at_point R a A \<otimes> a ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<Otimes> i = A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<Otimes> i = A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i

goal (1 subgoal):
 1. eval_at_point R a (A \<Otimes> i) = eval_at_point R a A \<otimes> a ! i
[PROOF STEP]
using assms eval_at_point_mult eval_pvar pvar_closed
[PROOF STATE]
proof (prove)
using this:
A \<Otimes> i = A \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> pvar R i
a \<in> carrier (R\<^bsup>n\<^esup>)
A \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
i < n
\<lbrakk>?a \<in> carrier (R\<^bsup>?n\<^esup>); ?A \<in> carrier (R [\<X>\<^bsub>?n\<^esub>]); ?B \<in> carrier (R [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> eval_at_point R ?a (?A \<otimes>\<^bsub>R [\<X>\<^bsub>?n\<^esub>]\<^esub> ?B) = eval_at_point R ?a ?A \<otimes> eval_at_point R ?a ?B
\<lbrakk>?i < ?n; ?a \<in> carrier (R\<^bsup>?n\<^esup>)\<rbrakk> \<Longrightarrow> eval_at_point R ?a (pvar R ?i) = ?a ! ?i
?i < ?n \<Longrightarrow> pvar R ?i \<in> carrier (R [\<X>\<^bsub>?n\<^esub>])

goal (1 subgoal):
 1. eval_at_point R a (A \<Otimes> i) = eval_at_point R a A \<otimes> a ! i
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
eval_at_point R a (A \<Otimes> i) = eval_at_point R a A \<otimes> a ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_incoming_pointwise: "(\<Sum>e\<in>incoming u. g e) = (\<Sum>v\<in>E\<inverse>``{u}. g (v,u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
have "(\<Sum>e\<in>incoming u. g e) = (\<Sum>e\<in>(\<lambda>v. (v,u))`(E\<inverse>``{u}). g e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g (incoming u) = sum g ((\<lambda>v. (v, u)) ` E\<inverse> `` {u})
[PROOF STEP]
by (rule sum.cong) (auto simp: incoming_def)
[PROOF STATE]
proof (state)
this:
sum g (incoming u) = sum g ((\<lambda>v. (v, u)) ` E\<inverse> `` {u})

goal (1 subgoal):
 1. sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum g (incoming u) = sum g ((\<lambda>v. (v, u)) ` E\<inverse> `` {u})

goal (1 subgoal):
 1. sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
have "\<dots> = (\<Sum>v\<in>E\<inverse>``{u}. g (v,u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g ((\<lambda>v. (v, u)) ` E\<inverse> `` {u}) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
by (subst sum.reindex)(auto simp add: inj_on_def)
[PROOF STATE]
proof (state)
this:
sum g ((\<lambda>v. (v, u)) ` E\<inverse> `` {u}) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))

goal (1 subgoal):
 1. sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))

goal (1 subgoal):
 1. sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum g (incoming u) = (\<Sum>v\<in>E\<inverse> `` {u}. g (v, u))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma into_WW_lenlex_iff: "(into_WW k ms, into_WW k ns) \<in> lenlex less_than \<longleftrightarrow> (ms, ns) \<in> lenlex less_than"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((into_WW k ms, into_WW k ns) \<in> lenlex less_than) = ((ms, ns) \<in> lenlex less_than)
[PROOF STEP]
proof (induction ms arbitrary: ns k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ns k. ((into_WW k [], into_WW k ns) \<in> lenlex less_than) = (([], ns) \<in> lenlex less_than)
 2. \<And>a ms ns k. (\<And>ns k. ((into_WW k ms, into_WW k ns) \<in> lenlex less_than) = ((ms, ns) \<in> lenlex less_than)) \<Longrightarrow> ((into_WW k (a # ms), into_WW k ns) \<in> lenlex less_than) = ((a # ms, ns) \<in> lenlex less_than)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>ns k. ((into_WW k [], into_WW k ns) \<in> lenlex less_than) = (([], ns) \<in> lenlex less_than)
 2. \<And>a ms ns k. (\<And>ns k. ((into_WW k ms, into_WW k ns) \<in> lenlex less_than) = ((ms, ns) \<in> lenlex less_than)) \<Longrightarrow> ((into_WW k (a # ms), into_WW k ns) \<in> lenlex less_than) = ((a # ms, ns) \<in> lenlex less_than)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((into_WW k [], into_WW k ns) \<in> lenlex less_than) = (([], ns) \<in> lenlex less_than)
[PROOF STEP]
by simp (metis length_0_conv length_into_WW)
[PROOF STATE]
proof (state)
this:
((into_WW k [], into_WW k ns) \<in> lenlex less_than) = (([], ns) \<in> lenlex less_than)

goal (1 subgoal):
 1. \<And>a ms ns k. (\<And>ns k. ((into_WW k ms, into_WW k ns) \<in> lenlex less_than) = ((ms, ns) \<in> lenlex less_than)) \<Longrightarrow> ((into_WW k (a # ms), into_WW k ns) \<in> lenlex less_than) = ((a # ms, ns) \<in> lenlex less_than)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ms ns k. (\<And>ns k. ((into_WW k ms, into_WW k ns) \<in> lenlex less_than) = ((ms, ns) \<in> lenlex less_than)) \<Longrightarrow> ((into_WW k (a # ms), into_WW k ns) \<in> lenlex less_than) = ((a # ms, ns) \<in> lenlex less_than)
[PROOF STEP]
case (Cons m ms)
[PROOF STATE]
proof (state)
this:
((into_WW ?k ms, into_WW ?k ?ns) \<in> lenlex less_than) = ((ms, ?ns) \<in> lenlex less_than)

goal (1 subgoal):
 1. \<And>a ms ns k. (\<And>ns k. ((into_WW k ms, into_WW k ns) \<in> lenlex less_than) = ((ms, ns) \<in> lenlex less_than)) \<Longrightarrow> ((into_WW k (a # ms), into_WW k ns) \<in> lenlex less_than) = ((a # ms, ns) \<in> lenlex less_than)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((into_WW ?k ms, into_WW ?k ?ns) \<in> lenlex less_than) = ((ms, ?ns) \<in> lenlex less_than)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
((into_WW ?k ms, into_WW ?k ?ns) \<in> lenlex less_than) = ((ms, ?ns) \<in> lenlex less_than)

goal (1 subgoal):
 1. ((into_WW k (m # ms), into_WW k ns) \<in> lenlex less_than) = ((m # ms, ns) \<in> lenlex less_than)
[PROOF STEP]
by (induction ns) (auto simp: Cons_lenlex_iff length_into_WW)
[PROOF STATE]
proof (state)
this:
((into_WW k (m # ms), into_WW k ns) \<in> lenlex less_than) = ((m # ms, ns) \<in> lenlex less_than)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma soundness_and_entailment :
  assumes "Sound Rule"
  assumes "Rule P1 P2 C"
  assumes "P1 \<in> S"
  assumes "P2 \<in> S"
  shows "entails S C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. entails S C
[PROOF STEP]
using Sound_def assms entails_def
[PROOF STATE]
proof (prove)
using this:
Sound ?Rule \<equiv> \<forall>I P1 P2 C. ?Rule P1 P2 C \<longrightarrow> I \<Turnstile> P1 \<longrightarrow> I \<Turnstile> P2 \<longrightarrow> I \<Turnstile> C
Sound Rule
Rule P1 P2 C
P1 \<in> S
P2 \<in> S
entails ?S ?C \<equiv> \<forall>I. I \<Turnstile> ?S \<longrightarrow> I \<Turnstile> ?C

goal (1 subgoal):
 1. entails S C
[PROOF STEP]
by auto


[STATEMENT]
lemma le_opt_trans [rule_format]:
  "order r A \<Longrightarrow> x \<in> opt A \<Longrightarrow> y \<in> opt A \<Longrightarrow> z \<in> opt A \<Longrightarrow> x \<sqsubseteq>\<^bsub>le r\<^esub> y \<longrightarrow> y \<sqsubseteq>\<^bsub>le r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>le r\<^esub> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; x \<in> opt A; y \<in> opt A; z \<in> opt A\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>Opt.le r\<^esub> y \<longrightarrow> y \<sqsubseteq>\<^bsub>Opt.le r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>Opt.le r\<^esub> z
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; x \<in> opt A; y \<in> opt A; z \<in> opt A\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>Opt.le r\<^esub> y \<longrightarrow> y \<sqsubseteq>\<^bsub>Opt.le r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>Opt.le r\<^esub> z
[PROOF STEP]
apply (simp add: unfold_le_opt opt_def split: option.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; x = None \<or> (\<exists>y. x = Some y \<and> y \<in> A); y = None \<or> (\<exists>ya. y = Some ya \<and> ya \<in> A); z = None \<or> (\<exists>y. z = Some y \<and> y \<in> A)\<rbrakk> \<Longrightarrow> \<forall>x2 x2a. x = Some x2a \<longrightarrow> z = Some x2 \<longrightarrow> (\<forall>x2b. y = Some x2b \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2b \<longrightarrow> x2b \<sqsubseteq>\<^bsub>r\<^esub> x2 \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2)
[PROOF STEP]
apply (blast intro: order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma expands_to_powr_const:
  "trimmed_pos F \<Longrightarrow> basis_wf basis \<Longrightarrow> (f expands_to F) basis \<Longrightarrow> p \<equiv> p \<Longrightarrow>
     ((\<lambda>x. f x powr p) expands_to powr_expansion abort F p) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trimmed_pos F; basis_wf basis; (f expands_to F) basis; p \<equiv> p\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x powr p) expands_to powr_expansion abort F p) basis
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_powr trimmed_pos_def elim: eventually_mono)


[STATEMENT]
lemma listrel_iff_nth: "(xs,ys) \<in> listrel r \<longleftrightarrow>
  length xs = length ys \<and> (\<forall>n < length xs. (xs!n, ys!n) \<in> r)" (is "?L \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((xs, ys) \<in> listrel r) = (length xs = length ys \<and> (\<forall>n<length xs. (xs ! n, ys ! n) \<in> r))
[PROOF STEP]
by (auto simp add: all_set_conv_all_nth listrel_iff_zip)


[STATEMENT]
lemma divides_irreducible_condition:
  assumes "irreducible G r" and "a \<in> carrier G"
  shows "a divides\<^bsub>G\<^esub> r \<Longrightarrow> a \<in> Units G \<or> a \<sim>\<^bsub>G\<^esub> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a divides\<^bsub>G\<^esub> r \<Longrightarrow> a \<in> Units G \<or> a \<sim>\<^bsub>G\<^esub> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
irreducible G r
a \<in> carrier G

goal (1 subgoal):
 1. a divides\<^bsub>G\<^esub> r \<Longrightarrow> a \<in> Units G \<or> a \<sim>\<^bsub>G\<^esub> r
[PROOF STEP]
unfolding irreducible_def properfactor_def associated_def
[PROOF STATE]
proof (prove)
using this:
r \<notin> Units G \<and> (\<forall>b\<in>carrier G. b divides\<^bsub>G\<^esub> r \<and> \<not> r divides\<^bsub>G\<^esub> b \<longrightarrow> b \<in> Units G)
a \<in> carrier G

goal (1 subgoal):
 1. a divides\<^bsub>G\<^esub> r \<Longrightarrow> a \<in> Units G \<or> a divides\<^bsub>G\<^esub> r \<and> r divides\<^bsub>G\<^esub> a
[PROOF STEP]
by (cases "r divides\<^bsub>G\<^esub> a", auto)


[STATEMENT]
lemma sum_rationals_common_divisor:
  fixes f g :: "'a \<Rightarrow> int"
  assumes "finite A"
  assumes "\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0"
  shows   "\<exists>c. (\<Sum>x\<in>A. f x / g x) = real_of_int c / (LCM x\<in>A. g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
?x \<in> A \<Longrightarrow> g ?x \<noteq> 0

goal (1 subgoal):
 1. \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
[PROOF STEP]
proof (induction rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>x. x \<in> {} \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>{}. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` {}))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?x \<in> {} \<Longrightarrow> g ?x \<noteq> 0

goal (2 subgoals):
 1. (\<And>x. x \<in> {} \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>{}. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` {}))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?x \<in> {} \<Longrightarrow> g ?x \<noteq> 0

goal (1 subgoal):
 1. \<exists>c. (\<Sum>x\<in>{}. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` {}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c. (\<Sum>x\<in>{}. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` {}))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
define d where "d = (LCM x\<in>A. g x)"
[PROOF STATE]
proof (state)
this:
d = Lcm (g ` A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
from insert
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0
[PROOF STEP]
have [simp]: "d \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0

goal (1 subgoal):
 1. d \<noteq> 0
[PROOF STEP]
by (auto simp: d_def Lcm_0_iff)
[PROOF STATE]
proof (state)
this:
d \<noteq> 0

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
from insert
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0
[PROOF STEP]
have [simp]: "g x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0

goal (1 subgoal):
 1. g x \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g x \<noteq> 0

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
from insert
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0
[PROOF STEP]
obtain c where c: "(\<Sum>x\<in>A. f x / g x) = real_of_int c / real_of_int d"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0

goal (1 subgoal):
 1. (\<And>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: d_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int d

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
define e1 where "e1 = lcm d (g x) div d"
[PROOF STATE]
proof (state)
this:
e1 = lcm d (g x) div d

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
define e2 where "e2 = lcm d (g x) div g x"
[PROOF STATE]
proof (state)
this:
e2 = lcm d (g x) div g x

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
have "(\<Sum>y\<in>insert x A. f y / g y) = c / d + f x / g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>insert x A. real_of_int (f y) / real_of_int (g y)) = real_of_int c / real_of_int d + real_of_int (f x) / real_of_int (g x)
[PROOF STEP]
using insert c
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0
(\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int d

goal (1 subgoal):
 1. (\<Sum>y\<in>insert x A. real_of_int (f y) / real_of_int (g y)) = real_of_int c / real_of_int d + real_of_int (f x) / real_of_int (g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>insert x A. real_of_int (f y) / real_of_int (g y)) = real_of_int c / real_of_int d + real_of_int (f x) / real_of_int (g x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>insert x A. real_of_int (f y) / real_of_int (g y)) = real_of_int c / real_of_int d + real_of_int (f x) / real_of_int (g x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
have "c / d = (c * e1) / lcm d (g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int c / real_of_int d = real_of_int (c * e1) / real_of_int (lcm d (g x))
[PROOF STEP]
by (simp add: e1_def real_of_int_div)
[PROOF STATE]
proof (state)
this:
real_of_int c / real_of_int d = real_of_int (c * e1) / real_of_int (lcm d (g x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int c / real_of_int d = real_of_int (c * e1) / real_of_int (lcm d (g x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
have "f x / g x = (f x * e2) / lcm d (g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (f x) / real_of_int (g x) = real_of_int (f x * e2) / real_of_int (lcm d (g x))
[PROOF STEP]
by (simp add: e2_def real_of_int_div)
[PROOF STATE]
proof (state)
this:
real_of_int (f x) / real_of_int (g x) = real_of_int (f x * e2) / real_of_int (lcm d (g x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (f x) / real_of_int (g x) = real_of_int (f x * e2) / real_of_int (lcm d (g x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
have "(c * e1) / lcm d (g x) + \<dots> = (c * e1 + f x * e2) / (LCM x\<in>insert x A. g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c * e1) / real_of_int (lcm d (g x)) + real_of_int (f x * e2) / real_of_int (lcm d (g x)) = real_of_int (c * e1 + f x * e2) / real_of_int (Lcm (g ` insert x A))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
(\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` A))
?x \<in> insert x A \<Longrightarrow> g ?x \<noteq> 0

goal (1 subgoal):
 1. real_of_int (c * e1) / real_of_int (lcm d (g x)) + real_of_int (f x * e2) / real_of_int (lcm d (g x)) = real_of_int (c * e1 + f x * e2) / real_of_int (Lcm (g ` insert x A))
[PROOF STEP]
by (simp add: add_divide_distrib lcm.commute d_def)
[PROOF STATE]
proof (state)
this:
real_of_int (c * e1) / real_of_int (lcm d (g x)) + real_of_int (f x * e2) / real_of_int (lcm d (g x)) = real_of_int (c * e1 + f x * e2) / real_of_int (Lcm (g ` insert x A))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>x. x \<in> F \<Longrightarrow> g x \<noteq> 0) \<Longrightarrow> \<exists>c. (\<Sum>x\<in>F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` F)); \<And>xa. xa \<in> insert x F \<Longrightarrow> g xa \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>c. (\<Sum>x\<in>insert x F. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x F))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>y\<in>insert x A. real_of_int (f y) / real_of_int (g y)) = real_of_int (c * e1 + f x * e2) / real_of_int (Lcm (g ` insert x A))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>y\<in>insert x A. real_of_int (f y) / real_of_int (g y)) = real_of_int (c * e1 + f x * e2) / real_of_int (Lcm (g ` insert x A))

goal (1 subgoal):
 1. \<exists>c. (\<Sum>x\<in>insert x A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x A))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>c. (\<Sum>x\<in>insert x A. real_of_int (f x) / real_of_int (g x)) = real_of_int c / real_of_int (Lcm (g ` insert x A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AE_measure_singleton: "measure M {x} \<noteq> 0 \<Longrightarrow> AE x in M. P x \<Longrightarrow> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Sigma_Algebra.measure M {x} \<noteq> 0; almost_everywhere M P\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
by (metis AE_emeasure_singleton measure_def emeasure_empty measure_empty)


[STATEMENT]
lemma divide_left_mono_neg: "a \<le> b
    \<Longrightarrow> c \<le> 0 \<Longrightarrow> 0 < a * b \<Longrightarrow> c / a \<le> c / b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; c \<le> (0::'a); (0::'a) < a * b\<rbrakk> \<Longrightarrow> c / a \<le> c / b
[PROOF STEP]
by (metis local.divide_left_mono local.minus_divide_left local.neg_0_le_iff_le local.neg_le_iff_le mult_commute)


[STATEMENT]
lemma isCont_sin' [simp]: "isCont f a \<Longrightarrow> isCont (\<lambda>x. sin (f x)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f a \<Longrightarrow> isCont (\<lambda>x. sin (f x)) a
[PROOF STEP]
by (rule isCont_o2 [OF _ isCont_sin])


[STATEMENT]
lemma countable_or:
  "countable A \<Longrightarrow> (\<exists> f::'a\<Rightarrow>nat. finite A \<and> inj_on f A) \<or> (\<exists> f::'a\<Rightarrow>nat. infinite A \<and> bij_betw f A UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable A \<Longrightarrow> (\<exists>f. finite A \<and> inj_on f A) \<or> (\<exists>f. infinite A \<and> bij_betw f A UNIV)
[PROOF STEP]
by (elim countable_enum_cases) fastforce+


[STATEMENT]
lemma root_rat_reform: assumes q: "quotient_of x = (a,b)"
  shows "root p (real_of_rat x) = root p (of_int (a * b ^ (p - 1))) / of_int b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
from quotient_of_denom_pos[OF q]
[PROOF STATE]
proof (chain)
picking this:
0 < b
[PROOF STEP]
have b: "0 < b"
[PROOF STATE]
proof (prove)
using this:
0 < b

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

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
hence b: "0 < real_of_int b"
[PROOF STATE]
proof (prove)
using this:
0 < b

goal (1 subgoal):
 1. 0 < real_of_int b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < real_of_int b

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
from quotient_of_div[OF q]
[PROOF STATE]
proof (chain)
picking this:
x = rat_of_int a / rat_of_int b
[PROOF STEP]
have x: "root p (real_of_rat x) = root p (a / b)"
[PROOF STATE]
proof (prove)
using this:
x = rat_of_int a / rat_of_int b

goal (1 subgoal):
 1. root p (real_of_rat x) = root p (real_of_int a / real_of_int b)
[PROOF STEP]
by (metis of_rat_divide of_rat_of_int_eq)
[PROOF STATE]
proof (state)
this:
root p (real_of_rat x) = root p (real_of_int a / real_of_int b)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root p (real_of_rat x) = root p (real_of_int a / real_of_int b)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
have "a / b = a * real_of_int b ^ (p - 1) / of_int b ^ p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int a / real_of_int b = real_of_int a * real_of_int b ^ (p - 1) / real_of_int b ^ p
[PROOF STEP]
using b False
[PROOF STATE]
proof (prove)
using this:
0 < real_of_int b
p \<noteq> 0

goal (1 subgoal):
 1. real_of_int a / real_of_int b = real_of_int a * real_of_int b ^ (p - 1) / real_of_int b ^ p
[PROOF STEP]
by (cases p, auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int a / real_of_int b = real_of_int a * real_of_int b ^ (p - 1) / real_of_int b ^ p

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int a / real_of_int b = real_of_int a * real_of_int b ^ (p - 1) / real_of_int b ^ p

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
have "root p \<dots> = root p (a * real_of_int b ^ (p - 1)) / root p (of_int b ^ p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root p (real_of_int a * real_of_int b ^ (p - 1) / real_of_int b ^ p) = root p (real_of_int a * real_of_int b ^ (p - 1)) / root p (real_of_int b ^ p)
[PROOF STEP]
by (rule real_root_divide)
[PROOF STATE]
proof (state)
this:
root p (real_of_int a * real_of_int b ^ (p - 1) / real_of_int b ^ p) = root p (real_of_int a * real_of_int b ^ (p - 1)) / root p (real_of_int b ^ p)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root p (real_of_int a * real_of_int b ^ (p - 1) / real_of_int b ^ p) = root p (real_of_int a * real_of_int b ^ (p - 1)) / root p (real_of_int b ^ p)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
have "root p (of_int b ^ p) = of_int b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root p (real_of_int b ^ p) = real_of_int b
[PROOF STEP]
using False b
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
0 < real_of_int b

goal (1 subgoal):
 1. root p (real_of_int b ^ p) = real_of_int b
[PROOF STEP]
by (metis neq0_conv real_root_pow_pos real_root_power)
[PROOF STATE]
proof (state)
this:
root p (real_of_int b ^ p) = real_of_int b

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root p (real_of_int b ^ p) = real_of_int b

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
have "a * real_of_int b ^ (p - 1) = of_int (a * b ^ (p - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int a * real_of_int b ^ (p - 1) = real_of_int (a * b ^ (p - 1))
[PROOF STEP]
by (metis of_int_mult of_int_power)
[PROOF STATE]
proof (state)
this:
real_of_int a * real_of_int b ^ (p - 1) = real_of_int (a * b ^ (p - 1))

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
 2. p \<noteq> 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b

goal (1 subgoal):
 1. root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b

goal (1 subgoal):
 1. p = 0 \<Longrightarrow> root p (real_of_rat x) = root p (real_of_int (a * b ^ (p - 1))) / real_of_int b
[PROOF STEP]
qed auto


[STATEMENT]
lemma inj_on_hom_induced_section_map:
  assumes "section_map X Y f"
  shows "inj_on (hom_induced p X {} Y {} f) (carrier (homology_group p X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (hom_induced p X {} Y {} f) (carrier (homology_group p X))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (hom_induced p X {} Y {} f) (carrier (homology_group p X))
[PROOF STEP]
obtain g where cont: "continuous_map X Y f" "continuous_map Y X g"
           and gf: "\<And>x. x \<in> topspace X \<Longrightarrow> g (f x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_map X Y f; continuous_map Y X g; \<And>x. x \<in> topspace X \<Longrightarrow> g (f x) = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
section_map X Y f

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_map X Y f; continuous_map Y X g; \<And>x. x \<in> topspace X \<Longrightarrow> g (f x) = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: section_map_def retraction_maps_def)
[PROOF STATE]
proof (state)
this:
continuous_map X Y f
continuous_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. inj_on (hom_induced p X {} Y {} f) (carrier (homology_group p X))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (hom_induced p X {} Y {} f) (carrier (homology_group p X))
[PROOF STEP]
proof (rule inj_on_inverseI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> ?g (hom_induced p X {} Y {} f x) = x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> ?g (hom_induced p X {} Y {} f x) = x
[PROOF STEP]
assume x: "x \<in> carrier (homology_group p X)"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (homology_group p X)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> ?g (hom_induced p X {} Y {} f x) = x
[PROOF STEP]
have "continuous_map X X (\<lambda>x. g (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X X (\<lambda>x. g (f x))
[PROOF STEP]
by (metis (no_types, lifting) continuous_map_eq continuous_map_id gf id_apply)
[PROOF STATE]
proof (state)
this:
continuous_map X X (\<lambda>x. g (f x))

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> ?g (hom_induced p X {} Y {} f x) = x
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier (homology_group p X)
continuous_map X X (\<lambda>x. g (f x))
[PROOF STEP]
show "hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (homology_group p X)
continuous_map X X (\<lambda>x. g (f x))

goal (1 subgoal):
 1. hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x
[PROOF STEP]
using hom_induced_compose_empty [OF cont, symmetric]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (homology_group p X)
continuous_map X X (\<lambda>x. g (f x))
hom_induced ?p Y {} X {} g \<circ> hom_induced ?p X {} Y {} f = hom_induced ?p X {} X {} (g \<circ> f)

goal (1 subgoal):
 1. hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x
[PROOF STEP]
apply (simp add: o_def fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier (homology_group p X); continuous_map X X (\<lambda>x. g (f x)); \<And>p. \<forall>x. hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = hom_induced p X {} X {} (\<lambda>x. g (f x)) x\<rbrakk> \<Longrightarrow> hom_induced p X {} X {} (\<lambda>x. g (f x)) x = x
[PROOF STEP]
apply (rule hom_induced_id_gen)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>x \<in> carrier (homology_group p X); continuous_map X X (\<lambda>x. g (f x)); \<And>p. \<forall>x. hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = hom_induced p X {} X {} (\<lambda>x. g (f x)) x\<rbrakk> \<Longrightarrow> continuous_map X X (\<lambda>x. g (f x))
 2. \<And>xa. \<lbrakk>x \<in> carrier (homology_group p X); continuous_map X X (\<lambda>x. g (f x)); \<And>p. \<forall>x. hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = hom_induced p X {} X {} (\<lambda>x. g (f x)) x; xa \<in> topspace X\<rbrakk> \<Longrightarrow> g (f xa) = xa
 3. \<lbrakk>x \<in> carrier (homology_group p X); continuous_map X X (\<lambda>x. g (f x)); \<And>p. \<forall>x. hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = hom_induced p X {} X {} (\<lambda>x. g (f x)) x\<rbrakk> \<Longrightarrow> x \<in> carrier (homology_group p X)
[PROOF STEP]
apply (auto simp: gf)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (hom_induced p X {} Y {} f) (carrier (homology_group p X))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lexord_mono':
  "\<lbrakk> (\<And> x y. f x y \<longrightarrow> g x y); (xs, ys) \<in> lexord {(x, y). f x y} \<rbrakk> \<Longrightarrow> (xs, ys) \<in> lexord {(x, y). g x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. f x y \<longrightarrow> g x y; (xs, ys) \<in> lexord {(x, y). f x y}\<rbrakk> \<Longrightarrow> (xs, ys) \<in> lexord {(x, y). g x y}
[PROOF STEP]
by (metis case_prodD case_prodI lexord_take_index_conv mem_Collect_eq)


[STATEMENT]
lemma foldr_filter:
  "foldr f (filter P xs) = foldr (\<lambda>x. if P x then f x else id) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr f (filter P xs) = foldr (\<lambda>x. if P x then f x else id) xs
[PROOF STEP]
by (simp add: foldr_conv_fold rev_filter fold_filter)


[STATEMENT]
lemma many_strongly_connected_implies_10_eq:
  assumes "many_strongly_connected x"
    shows "x;x\<^sup>T;x\<^sup>\<star> = x\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ; x\<^sup>T ; x\<^sup>\<star> = x\<^sup>+
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x ; x\<^sup>T ; x\<^sup>\<star> \<le> x\<^sup>+
 2. x\<^sup>+ \<le> x ; x\<^sup>T ; x\<^sup>\<star>
[PROOF STEP]
show "x;x\<^sup>T;x\<^sup>\<star> \<le> x\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ; x\<^sup>T ; x\<^sup>\<star> \<le> x\<^sup>+
[PROOF STEP]
by (simp add: assms comp_assoc mult_isol)
[PROOF STATE]
proof (state)
this:
x ; x\<^sup>T ; x\<^sup>\<star> \<le> x\<^sup>+

goal (1 subgoal):
 1. x\<^sup>+ \<le> x ; x\<^sup>T ; x\<^sup>\<star>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x\<^sup>+ \<le> x ; x\<^sup>T ; x\<^sup>\<star>
[PROOF STEP]
have "x\<^sup>+ \<le> x;x\<^sup>T;x;x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>+ \<le> x ; x\<^sup>T ; x ; x\<^sup>\<star>
[PROOF STEP]
using mult_isor x_leq_triple_x
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?x ; ?z \<le> ?y ; ?z
?x \<le> ?x ; ?x\<^sup>T ; ?x

goal (1 subgoal):
 1. x\<^sup>+ \<le> x ; x\<^sup>T ; x ; x\<^sup>\<star>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x\<^sup>+ \<le> x ; x\<^sup>T ; x ; x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>+ \<le> x ; x\<^sup>T ; x\<^sup>\<star>
[PROOF STEP]
thus "x\<^sup>+ \<le> x;x\<^sup>T;x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>+ \<le> x ; x\<^sup>T ; x ; x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>+ \<le> x ; x\<^sup>T ; x\<^sup>\<star>
[PROOF STEP]
by (simp add: comp_assoc mult_isol order_trans)
[PROOF STATE]
proof (state)
this:
x\<^sup>+ \<le> x ; x\<^sup>T ; x\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_mult_left:
  fixes c::"'a::real_normed_algebra"
  shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. c * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. c * f x)
[PROOF STEP]
by (rule continuous_on_mult [OF continuous_on_const])


[STATEMENT]
lemma suminf_pos: "summable f \<Longrightarrow> (\<And>n. 0 < f n) \<Longrightarrow> 0 < suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>n. (0::'a) < f n\<rbrakk> \<Longrightarrow> (0::'a) < suminf f
[PROOF STEP]
by (intro suminf_pos2[where i=0]) (auto intro: less_imp_le)


[STATEMENT]
lemma rpr_less_trans[trans]: "\<lbrakk> x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; rpr A r \<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; rpr A r\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z
[PROOF STEP]
unfolding rpr_def strict_pref_def trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<preceq> y \<and> (y, x) \<notin> r; y \<^bsub>r\<^esub>\<preceq> z \<and> (z, y) \<notin> r; complete A r \<and> refl_on A r \<and> (\<forall>x y z. x \<^bsub>r\<^esub>\<preceq> y \<longrightarrow> y \<^bsub>r\<^esub>\<preceq> z \<longrightarrow> x \<^bsub>r\<^esub>\<preceq> z)\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<preceq> z \<and> (z, x) \<notin> r
[PROOF STEP]
by blast


[STATEMENT]
lemma preserves_funPair: "preserves (funPair v w) = preserves v \<inter> preserves w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preserves (funPair v w) = preserves v \<inter> preserves w
[PROOF STEP]
by (auto simp add: preserves_def stable_def constrains_def, blast)


[STATEMENT]
theorem transcendental_standard_liouville:
  assumes "q > 1" "range p \<subseteq> {0..<q}" "frequently (\<lambda>k. p k \<noteq> 0) sequentially"
  shows   "\<not>algebraic (standard_liouville p q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> algebraic (standard_liouville p q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> algebraic (standard_liouville p q)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < q
range p \<subseteq> {0..<q}
\<exists>\<^sub>F k in sequentially. p k \<noteq> 0
[PROOF STEP]
interpret
    liouville "standard_liouville p q"
              "\<lambda>n. (\<Sum>k\<le>n. p k * q ^ (fact (Suc n) - fact (Suc k)))"
              "\<lambda>n. q ^ fact (Suc n)"
[PROOF STATE]
proof (prove)
using this:
1 < q
range p \<subseteq> {0..<q}
\<exists>\<^sub>F k in sequentially. p k \<noteq> 0

goal (1 subgoal):
 1. liouville (standard_liouville p q) (\<lambda>n. \<Sum>k\<le>n. p k * q ^ (fact (Suc n) - fact (Suc k))) (\<lambda>n. q ^ fact (Suc n))
[PROOF STEP]
by (rule standard_liouville_is_liouville)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> algebraic (standard_liouville p q)
[PROOF STEP]
from transcendental
[PROOF STATE]
proof (chain)
picking this:
\<not> algebraic (standard_liouville p q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> algebraic (standard_liouville p q)

goal (1 subgoal):
 1. \<not> algebraic (standard_liouville p q)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<not> algebraic (standard_liouville p q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem denot_sound_wrt_ctx_equiv: assumes e12: "E e1 = E e2" shows "e1 \<simeq> e2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e1 \<simeq> e2
[PROOF STEP]
using e12
[PROOF STATE]
proof (prove)
using this:
E e1 = E e2

goal (1 subgoal):
 1. e1 \<simeq> e2
[PROOF STEP]
apply (simp only: ctx_equiv_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E e1 = E e2 \<Longrightarrow> \<forall>C ob. FV (plug C e1) = {} \<and> FV (plug C e2) = {} \<longrightarrow> plug C e1 \<Down> ob = plug C e2 \<Down> ob
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}\<rbrakk> \<Longrightarrow> plug C e1 \<Down> ob = plug C e2 \<Down> ob
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e1 \<Down> ob\<rbrakk> \<Longrightarrow> plug C e2 \<Down> ob
 2. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e2 \<Down> ob\<rbrakk> \<Longrightarrow> plug C e1 \<Down> ob
[PROOF STEP]
apply (rule soundness_wrt_ctx_equiv_aux)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e1 \<Down> ob\<rbrakk> \<Longrightarrow> E (?e1.8 C ob) = E e2
 2. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e1 \<Down> ob\<rbrakk> \<Longrightarrow> FV (plug C (?e1.8 C ob)) = {}
 3. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e1 \<Down> ob\<rbrakk> \<Longrightarrow> FV (plug C e2) = {}
 4. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e1 \<Down> ob\<rbrakk> \<Longrightarrow> plug C (?e1.8 C ob) \<Down> ob
 5. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e2 \<Down> ob\<rbrakk> \<Longrightarrow> plug C e1 \<Down> ob
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e2 \<Down> ob\<rbrakk> \<Longrightarrow> plug C e1 \<Down> ob
[PROOF STEP]
apply (rule soundness_wrt_ctx_equiv_aux)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e2 \<Down> ob\<rbrakk> \<Longrightarrow> E (?e1.13 C ob) = E e1
 2. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e2 \<Down> ob\<rbrakk> \<Longrightarrow> FV (plug C (?e1.13 C ob)) = {}
 3. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e2 \<Down> ob\<rbrakk> \<Longrightarrow> FV (plug C e1) = {}
 4. \<And>C ob. \<lbrakk>E e1 = E e2; FV (plug C e1) = {}; FV (plug C e2) = {}; plug C e2 \<Down> ob\<rbrakk> \<Longrightarrow> plug C (?e1.13 C ob) \<Down> ob
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma branch_length:
  assumes "branch b (deeptree n)"
  shows "length b = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length b = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
branch b (deeptree n)

goal (1 subgoal):
 1. length b = n
[PROOF STEP]
proof (induction n arbitrary: b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. branch b (deeptree 0) \<Longrightarrow> length b = 0
 2. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
branch b (deeptree 0)

goal (2 subgoals):
 1. \<And>b. branch b (deeptree 0) \<Longrightarrow> length b = 0
 2. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
branch b (deeptree 0)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
branch b (deeptree 0)

goal (1 subgoal):
 1. length b = 0
[PROOF STEP]
using branch_inv_Leaf
[PROOF STATE]
proof (prove)
using this:
branch b (deeptree 0)
branch ?b Leaf = (?b = [])

goal (1 subgoal):
 1. length b = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length b = 0

goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
branch ?b (deeptree n) \<Longrightarrow> length ?b = n
branch b (deeptree (Suc n))

goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
branch ?b (deeptree n) \<Longrightarrow> length ?b = n
branch b (deeptree (Suc n))
[PROOF STEP]
have "branch b (Branching (deeptree n) (deeptree n))"
[PROOF STATE]
proof (prove)
using this:
branch ?b (deeptree n) \<Longrightarrow> length ?b = n
branch b (deeptree (Suc n))

goal (1 subgoal):
 1. branch b (Branching (deeptree n) (deeptree n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
branch b (Branching (deeptree n) (deeptree n))

goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
branch b (Branching (deeptree n) (deeptree n))
[PROOF STEP]
obtain a b' where p: "b = a#b'\<and> branch b' (deeptree n)"
[PROOF STATE]
proof (prove)
using this:
branch b (Branching (deeptree n) (deeptree n))

goal (1 subgoal):
 1. (\<And>a b'. b = a # b' \<and> branch b' (deeptree n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using branch_inv_Branching[of b]
[PROOF STATE]
proof (prove)
using this:
branch b (Branching (deeptree n) (deeptree n))
branch b (Branching ?l ?r) = (\<exists>a b'. b = a # b' \<and> (a \<longrightarrow> branch b' ?l) \<and> (\<not> a \<longrightarrow> branch b' ?r))

goal (1 subgoal):
 1. (\<And>a b'. b = a # b' \<and> branch b' (deeptree n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b = a # b' \<and> branch b' (deeptree n)

goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = a # b' \<and> branch b' (deeptree n)
[PROOF STEP]
have "length b' = n"
[PROOF STATE]
proof (prove)
using this:
b = a # b' \<and> branch b' (deeptree n)

goal (1 subgoal):
 1. length b' = n
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
b = a # b' \<and> branch b' (deeptree n)
branch ?b (deeptree n) \<Longrightarrow> length ?b = n
branch b (deeptree (Suc n))

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

goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. branch b (deeptree n) \<Longrightarrow> length b = n; branch b (deeptree (Suc n))\<rbrakk> \<Longrightarrow> length b = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length b' = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length b' = n

goal (1 subgoal):
 1. length b = Suc n
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
length b' = n
b = a # b' \<and> branch b' (deeptree n)

goal (1 subgoal):
 1. length b = Suc n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length b = Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pm_of_poly_smult [simp]: "pm_of_poly x (Polynomial.smult c p) = c \<cdot> pm_of_poly x p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pm_of_poly x (Polynomial.smult c p) = c \<cdot> pm_of_poly x p
[PROOF STEP]
by (rule poly_mapping_eqI) (simp add: pm_of_poly.rep_eq when_distrib)


[STATEMENT]
lemma aezfun_setD: "f \<in> aezfun_set \<Longrightarrow> finite (supp f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> aezfun_set \<Longrightarrow> finite (supp f)
[PROOF STEP]
unfolding aezfun_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> {f. finite (supp f)} \<Longrightarrow> finite (supp f)
[PROOF STEP]
by fast


[STATEMENT]
lemma half_open_segment_subset[intro, simp]:
  "{t0--<t1} \<subseteq> {t0 -- t1}"
  "x \<in> {t0--<t1} \<Longrightarrow> x \<in> {t0 -- t1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t0--<t1} \<subseteq> {t0--t1} &&& (x \<in> {t0--<t1} \<Longrightarrow> x \<in> {t0--t1})
[PROOF STEP]
by (auto simp: half_open_segment_def)


[STATEMENT]
lemma zmultiset_filter_mono:
  assumes "A \<subseteq>#\<^sub>z B"
  shows "filter_zmset f A \<subseteq>#\<^sub>z filter_zmset f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_zmset f A \<subseteq>#\<^sub>z filter_zmset f B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq>#\<^sub>z B

goal (1 subgoal):
 1. filter_zmset f A \<subseteq>#\<^sub>z filter_zmset f B
[PROOF STEP]
by (simp add: subseteq_zmset_def)


[STATEMENT]
lemma (in topological_space) nhds_discrete_open: "open {x} \<Longrightarrow> nhds x = principal {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x} \<Longrightarrow> nhds x = principal {x}
[PROOF STEP]
by (auto simp: nhds_def intro!: antisym INF_greatest INF_lower2[of "{x}"])


[STATEMENT]
lemma wf_subterm_rel:
    shows "wf subterm_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(t, u). subterm t u}
[PROOF STEP]
using subterm_implies_smaller wf_if_img_lt
[PROOF STATE]
proof (prove)
using this:
subterm ?t ?u \<Longrightarrow> local.size ?t < local.size ?u
(\<And>x y. (x, y) \<in> ?r \<Longrightarrow> ?f x < ?f y) \<Longrightarrow> wf ?r

goal (1 subgoal):
 1. wf {(t, u). subterm t u}
[PROOF STEP]
by (metis case_prod_conv mem_Collect_eq)


[STATEMENT]
lemma generated_topology_is_topology:
  fixes S:: "'a set" and B:: "'a set set"
  shows "topological_space S (generated_topology S B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topological_space S (generated_topology S B)
[PROOF STEP]
by (simp add: Int UN UNIV generated_topology_subset topological_space_def)