[STATEMENT]
lemma compact_convex_hull:
  fixes S :: "'a::euclidean_space set"
  assumes "compact S"
  shows "compact (convex hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (convex hull S)
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> compact (convex hull S)
 2. S \<noteq> {} \<Longrightarrow> compact (convex hull S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> compact (convex hull S)
 2. S \<noteq> {} \<Longrightarrow> compact (convex hull S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {}

goal (1 subgoal):
 1. compact (convex hull S)
[PROOF STEP]
using compact_empty
[PROOF STATE]
proof (prove)
using this:
S = {}
compact {}

goal (1 subgoal):
 1. compact (convex hull S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compact (convex hull S)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> compact (convex hull S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> compact (convex hull S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> compact (convex hull S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain w where "w \<in> S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>w. w \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> compact (convex hull S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (convex hull S)
[PROOF STEP]
unfolding caratheodory[of S]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> DIM('a) + 1 \<and> x \<in> convex hull Sa}
[PROOF STEP]
proof (induct ("DIM('a) + 1"))
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> 0 \<and> x \<in> convex hull Sa}
 2. \<And>n. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa} \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> 0 \<and> x \<in> convex hull Sa}
 2. \<And>n. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa} \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
have *: "{x.\<exists>sa. finite sa \<and> sa \<subseteq> S \<and> card sa \<le> 0 \<and> x \<in> convex hull sa} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>sa. finite sa \<and> sa \<subseteq> S \<and> card sa \<le> 0 \<and> x \<in> convex hull sa} = {}
[PROOF STEP]
using compact_empty
[PROOF STATE]
proof (prove)
using this:
compact {}

goal (1 subgoal):
 1. {x. \<exists>sa. finite sa \<and> sa \<subseteq> S \<and> card sa \<le> 0 \<and> x \<in> convex hull sa} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. \<exists>sa. finite sa \<and> sa \<subseteq> S \<and> card sa \<le> 0 \<and> x \<in> convex hull sa} = {}

goal (2 subgoals):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> 0 \<and> x \<in> convex hull Sa}
 2. \<And>n. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa} \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> 0 \<and> x \<in> convex hull Sa}
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> 0 \<and> x \<in> convex hull Sa}

goal (1 subgoal):
 1. \<And>n. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa} \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa} \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa}

goal (1 subgoal):
 1. \<And>n. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa} \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
 2. n \<noteq> 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
 2. n \<noteq> 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
have "{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = S
[PROOF STEP]
unfolding set_eq_iff and mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T) = (x \<in> S)
[PROOF STEP]
proof (rule, rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> x \<in> S
 2. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> x \<in> S
 2. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
assume "\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T"
[PROOF STATE]
proof (state)
this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T

goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> x \<in> S
 2. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
obtain T where T: "finite T" "T \<subseteq> S" "card T \<le> Suc n" "x \<in> convex hull T"
[PROOF STATE]
proof (prove)
using this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>finite T; T \<subseteq> S; card T \<le> Suc n; x \<in> convex hull T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite T
T \<subseteq> S
card T \<le> Suc n
x \<in> convex hull T

goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> x \<in> S
 2. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
show "x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
proof (cases "card T = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card T = 0 \<Longrightarrow> x \<in> S
 2. card T \<noteq> 0 \<Longrightarrow> x \<in> S
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
card T = 0

goal (2 subgoals):
 1. card T = 0 \<Longrightarrow> x \<in> S
 2. card T \<noteq> 0 \<Longrightarrow> x \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card T = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card T = 0

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
using T(4)
[PROOF STATE]
proof (prove)
using this:
card T = 0
x \<in> convex hull T

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
unfolding card_0_eq[OF T(1)]
[PROOF STATE]
proof (prove)
using this:
T = {}
x \<in> convex hull T

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. card T \<noteq> 0 \<Longrightarrow> x \<in> S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card T \<noteq> 0 \<Longrightarrow> x \<in> S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
card T \<noteq> 0

goal (1 subgoal):
 1. card T \<noteq> 0 \<Longrightarrow> x \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card T \<noteq> 0
[PROOF STEP]
have "card T = Suc 0"
[PROOF STATE]
proof (prove)
using this:
card T \<noteq> 0

goal (1 subgoal):
 1. card T = Suc 0
[PROOF STEP]
using T(3) \<open>n=0\<close>
[PROOF STATE]
proof (prove)
using this:
card T \<noteq> 0
card T \<le> Suc n
n = 0

goal (1 subgoal):
 1. card T = Suc 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card T = Suc 0

goal (1 subgoal):
 1. card T \<noteq> 0 \<Longrightarrow> x \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card T = Suc 0
[PROOF STEP]
obtain a where "T = {a}"
[PROOF STATE]
proof (prove)
using this:
card T = Suc 0

goal (1 subgoal):
 1. (\<And>a. T = {a} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding card_Suc_eq
[PROOF STATE]
proof (prove)
using this:
\<exists>b B. T = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {})

goal (1 subgoal):
 1. (\<And>a. T = {a} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
T = {a}

goal (1 subgoal):
 1. card T \<noteq> 0 \<Longrightarrow> x \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T = {a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
T = {a}

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
using T(2,4)
[PROOF STATE]
proof (prove)
using this:
T = {a}
T \<subseteq> S
x \<in> convex hull T

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> S

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

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
assume "x\<in>S"
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
show "\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T"
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
by (rule_tac x="{x}" in exI) (use convex_hull_singleton in auto)
[PROOF STATE]
proof (state)
this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = S

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
 2. n \<noteq> 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = S

goal (1 subgoal):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = S
compact S

goal (1 subgoal):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
have "{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} =
        {(1 - u) *\<^sub>R x + u *\<^sub>R y | x y u.
          0 \<le> u \<and> u \<le> 1 \<and> x \<in> S \<and> y \<in> {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> x \<in> convex hull T}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = {(1 - u) *\<^sub>R x + u *\<^sub>R y |x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> S \<and> y \<in> {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> x \<in> convex hull T}}
[PROOF STEP]
unfolding set_eq_iff and mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T) = (\<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T))
[PROOF STEP]
proof (rule, rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
 2. \<And>x. \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T) \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
 2. \<And>x. \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T) \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
assume "\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and>
          0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)"
[PROOF STATE]
proof (state)
this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)

goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
 2. \<And>x. \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T) \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
obtain u v c T where obt: "x = (1 - c) *\<^sub>R u + c *\<^sub>R v"
          "0 \<le> c \<and> c \<le> 1" "u \<in> S" "finite T" "T \<subseteq> S" "card T \<le> n"  "v \<in> convex hull T"
[PROOF STATE]
proof (prove)
using this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)

goal (1 subgoal):
 1. (\<And>c u v T. \<lbrakk>x = (1 - c) *\<^sub>R u + c *\<^sub>R v; 0 \<le> c \<and> c \<le> 1; u \<in> S; finite T; T \<subseteq> S; card T \<le> n; v \<in> convex hull T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (1 - c) *\<^sub>R u + c *\<^sub>R v
0 \<le> c \<and> c \<le> 1
u \<in> S
finite T
T \<subseteq> S
card T \<le> n
v \<in> convex hull T

goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
 2. \<And>x. \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T) \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = (1 - c) *\<^sub>R u + c *\<^sub>R v
0 \<le> c \<and> c \<le> 1
u \<in> S
finite T
T \<subseteq> S
card T \<le> n
v \<in> convex hull T

goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
 2. \<And>x. \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T) \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
have "(1 - c) *\<^sub>R u + c *\<^sub>R v \<in> convex hull insert u T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - c) *\<^sub>R u + c *\<^sub>R v \<in> convex hull insert u T
[PROOF STEP]
by (meson convexD_alt convex_convex_hull hull_inc hull_mono in_mono insertCI obt(2) obt(7) subset_insertI)
[PROOF STATE]
proof (state)
this:
(1 - c) *\<^sub>R u + c *\<^sub>R v \<in> convex hull insert u T

goal (2 subgoals):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
 2. \<And>x. \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T) \<Longrightarrow> \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x = (1 - c) *\<^sub>R u + c *\<^sub>R v
0 \<le> c \<and> c \<le> 1
u \<in> S
finite T
T \<subseteq> S
card T \<le> n
v \<in> convex hull T
(1 - c) *\<^sub>R u + c *\<^sub>R v \<in> convex hull insert u T
[PROOF STEP]
show "\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T"
[PROOF STATE]
proof (prove)
using this:
x = (1 - c) *\<^sub>R u + c *\<^sub>R v
0 \<le> c \<and> c \<le> 1
u \<in> S
finite T
T \<subseteq> S
card T \<le> n
v \<in> convex hull T
(1 - c) *\<^sub>R u + c *\<^sub>R v \<in> convex hull insert u T

goal (1 subgoal):
 1. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
by (rule_tac x="insert u T" in exI) (auto simp: card_insert_if)
[PROOF STATE]
proof (state)
this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T

goal (1 subgoal):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
[PROOF STEP]
assume "\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T"
[PROOF STATE]
proof (state)
this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T

goal (1 subgoal):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T
[PROOF STEP]
obtain T where T: "finite T" "T \<subseteq> S" "card T \<le> Suc n" "x \<in> convex hull T"
[PROOF STATE]
proof (prove)
using this:
\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>finite T; T \<subseteq> S; card T \<le> Suc n; x \<in> convex hull T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite T
T \<subseteq> S
card T \<le> Suc n
x \<in> convex hull T

goal (1 subgoal):
 1. \<And>x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T \<Longrightarrow> \<exists>xa y u. x = (1 - u) *\<^sub>R xa + u *\<^sub>R y \<and> 0 \<le> u \<and> u \<le> 1 \<and> xa \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> y \<in> convex hull T)
[PROOF STEP]
show "\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and>
          0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
proof (cases "card T = Suc n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card T = Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
 2. card T \<noteq> Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
card T \<noteq> Suc n

goal (2 subgoals):
 1. card T = Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
 2. card T \<noteq> Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card T \<noteq> Suc n
[PROOF STEP]
have "card T \<le> n"
[PROOF STATE]
proof (prove)
using this:
card T \<noteq> Suc n

goal (1 subgoal):
 1. card T \<le> n
[PROOF STEP]
using T(3)
[PROOF STATE]
proof (prove)
using this:
card T \<noteq> Suc n
card T \<le> Suc n

goal (1 subgoal):
 1. card T \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card T \<le> n

goal (2 subgoals):
 1. card T = Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
 2. card T \<noteq> Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card T \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card T \<le> n

goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
using \<open>w\<in>S\<close> and T
[PROOF STATE]
proof (prove)
using this:
card T \<le> n
w \<in> S
finite T
T \<subseteq> S
card T \<le> Suc n
x \<in> convex hull T

goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
by (rule_tac x=w in exI, rule_tac x=x in exI, rule_tac x=1 in exI) auto
[PROOF STATE]
proof (state)
this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)

goal (1 subgoal):
 1. card T = Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card T = Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
card T = Suc n

goal (1 subgoal):
 1. card T = Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card T = Suc n
[PROOF STEP]
obtain a u where au: "T = insert a u" "a\<notin>u"
[PROOF STATE]
proof (prove)
using this:
card T = Suc n

goal (1 subgoal):
 1. (\<And>a u. \<lbrakk>T = insert a u; a \<notin> u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis card_le_Suc_iff order_refl)
[PROOF STATE]
proof (state)
this:
T = insert a u
a \<notin> u

goal (1 subgoal):
 1. card T = Suc n \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
proof (cases "u = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u = {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
 2. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
u = {}

goal (2 subgoals):
 1. u = {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
 2. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u = {}
[PROOF STEP]
have "x = a"
[PROOF STATE]
proof (prove)
using this:
u = {}

goal (1 subgoal):
 1. x = a
[PROOF STEP]
using T(4)[unfolded au]
[PROOF STATE]
proof (prove)
using this:
u = {}
x \<in> convex hull insert a u

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

goal (2 subgoals):
 1. u = {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
 2. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
unfolding \<open>x = a\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v c. a = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
using T \<open>n \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
finite T
T \<subseteq> S
card T \<le> Suc n
x \<in> convex hull T
n \<noteq> 0

goal (1 subgoal):
 1. \<exists>u v c. a = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
unfolding au
[PROOF STATE]
proof (prove)
using this:
finite (insert a u)
insert a u \<subseteq> S
card (insert a u) \<le> Suc n
x \<in> convex hull insert a u
n \<noteq> 0

goal (1 subgoal):
 1. \<exists>u v c. a = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
by (rule_tac x=a in exI, rule_tac x=a in exI, rule_tac x=1 in exI) force
[PROOF STATE]
proof (state)
this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)

goal (1 subgoal):
 1. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
u \<noteq> {}

goal (1 subgoal):
 1. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
obtain ux vx b where obt: "ux\<ge>0" "vx\<ge>0" "ux + vx = 1"
              "b \<in> convex hull u" "x = ux *\<^sub>R a + vx *\<^sub>R b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ux vx b. \<lbrakk>0 \<le> ux; 0 \<le> vx; ux + vx = 1; b \<in> convex hull u; x = ux *\<^sub>R a + vx *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using T(4)[unfolded au convex_hull_insert[OF False]]
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. \<exists>ua\<ge>0. \<exists>v\<ge>0. \<exists>b. ua + v = 1 \<and> b \<in> convex hull u \<and> x = ua *\<^sub>R a + v *\<^sub>R b}

goal (1 subgoal):
 1. (\<And>ux vx b. \<lbrakk>0 \<le> ux; 0 \<le> vx; ux + vx = 1; b \<in> convex hull u; x = ux *\<^sub>R a + vx *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> ux
0 \<le> vx
ux + vx = 1
b \<in> convex hull u
x = ux *\<^sub>R a + vx *\<^sub>R b

goal (1 subgoal):
 1. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
have *: "1 - vx = ux"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - vx = ux
[PROOF STEP]
using obt(3)
[PROOF STATE]
proof (prove)
using this:
ux + vx = 1

goal (1 subgoal):
 1. 1 - vx = ux
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 - vx = ux

goal (1 subgoal):
 1. u \<noteq> {} \<Longrightarrow> \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
using obt T(1-3) card_insert_disjoint[OF _ au(2)]
[PROOF STATE]
proof (prove)
using this:
0 \<le> ux
0 \<le> vx
ux + vx = 1
b \<in> convex hull u
x = ux *\<^sub>R a + vx *\<^sub>R b
finite T
T \<subseteq> S
card T \<le> Suc n
finite u \<Longrightarrow> card (insert a u) = Suc (card u)

goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
unfolding au *
[PROOF STATE]
proof (prove)
using this:
0 \<le> ux
0 \<le> vx
ux + vx = 1
b \<in> convex hull u
x = ux *\<^sub>R a + vx *\<^sub>R b
finite (insert a u)
insert a u \<subseteq> S
card (insert a u) \<le> Suc n
finite u \<Longrightarrow> card (insert a u) = Suc (card u)

goal (1 subgoal):
 1. \<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)
[PROOF STEP]
by (rule_tac x=a in exI, rule_tac x=b in exI, rule_tac x=vx in exI) force
[PROOF STATE]
proof (state)
this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> 0 \<le> c \<and> c \<le> 1 \<and> u \<in> S \<and> (\<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> v \<in> convex hull T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = {(1 - u) *\<^sub>R x + u *\<^sub>R y |x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> S \<and> y \<in> {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> x \<in> convex hull T}}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = {(1 - u) *\<^sub>R x + u *\<^sub>R y |x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> S \<and> y \<in> {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> x \<in> convex hull T}}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = {(1 - u) *\<^sub>R x + u *\<^sub>R y |x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> S \<and> y \<in> {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> x \<in> convex hull T}}

goal (1 subgoal):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
using compact_convex_combinations[OF assms Suc]
[PROOF STATE]
proof (prove)
using this:
{x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> Suc n \<and> x \<in> convex hull T} = {(1 - u) *\<^sub>R x + u *\<^sub>R y |x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> S \<and> y \<in> {x. \<exists>T. finite T \<and> T \<subseteq> S \<and> card T \<le> n \<and> x \<in> convex hull T}}
compact {(1 - u) *\<^sub>R x + u *\<^sub>R y |x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> S \<and> y \<in> {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> n \<and> x \<in> convex hull Sa}}

goal (1 subgoal):
 1. compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
compact {x. \<exists>Sa. finite Sa \<and> Sa \<subseteq> S \<and> card Sa \<le> Suc n \<and> x \<in> convex hull Sa}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
compact (convex hull S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma orbit_unfold_image:
  "orbit f a = (\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}" (is "_ = ?A")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit f a = (\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}
[PROOF STEP]
proof (rule sym, rule card_subset_eq)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite (orbit f a)
 2. (\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a} \<subseteq> orbit f a
 3. card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = card (orbit f a)
[PROOF STEP]
show "finite (orbit f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (orbit f a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (orbit f a)

goal (2 subgoals):
 1. (\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a} \<subseteq> orbit f a
 2. card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = card (orbit f a)
[PROOF STEP]
show "?A \<subseteq> orbit f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a} \<subseteq> orbit f a
[PROOF STEP]
by (auto simp add: orbit_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a} \<subseteq> orbit f a

goal (1 subgoal):
 1. card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = card (orbit f a)
[PROOF STEP]
from inj_on_apply_range [of f a]
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>m. (f ^ m) \<langle>$\<rangle> a) {..<order f a}
[PROOF STEP]
have "card ?A = order f a"
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>m. (f ^ m) \<langle>$\<rangle> a) {..<order f a}

goal (1 subgoal):
 1. card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = order f a
[PROOF STEP]
by (auto simp add: card_image)
[PROOF STATE]
proof (state)
this:
card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = order f a

goal (1 subgoal):
 1. card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = card (orbit f a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = order f a
[PROOF STEP]
show "card ?A = card (orbit f a)"
[PROOF STATE]
proof (prove)
using this:
card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = order f a

goal (1 subgoal):
 1. card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = card (orbit f a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card ((\<lambda>n. (f ^ n) \<langle>$\<rangle> a) ` {..<order f a}) = card (orbit f a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_of_rat[simp]: "int_of_rat (rat_of_int x) = x" "z \<in> \<int> \<Longrightarrow> rat_of_int (int_of_rat z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_rat (rat_of_int x) = x &&& (z \<in> \<int> \<Longrightarrow> rat_of_int (int_of_rat z) = z)
[PROOF STEP]
proof (force simp: int_of_rat_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> \<int> \<Longrightarrow> rat_of_int (int_of_rat z) = z
[PROOF STEP]
assume "z \<in> \<int>"
[PROOF STATE]
proof (state)
this:
z \<in> \<int>

goal (1 subgoal):
 1. z \<in> \<int> \<Longrightarrow> rat_of_int (int_of_rat z) = z
[PROOF STEP]
thus "rat_of_int (int_of_rat z) = z"
[PROOF STATE]
proof (prove)
using this:
z \<in> \<int>

goal (1 subgoal):
 1. rat_of_int (int_of_rat z) = z
[PROOF STEP]
unfolding int_of_rat_def
[PROOF STATE]
proof (prove)
using this:
z \<in> \<int>

goal (1 subgoal):
 1. rat_of_int (fst (quotient_of z)) = z
[PROOF STEP]
by (metis Ints_cases Pair_inject quotient_of_int surjective_pairing)
[PROOF STATE]
proof (state)
this:
rat_of_int (int_of_rat z) = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_monomial_uminus: "is_monomial (-p) \<longleftrightarrow> is_monomial p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_monomial (- p) = is_monomial p
[PROOF STEP]
unfolding is_monomial_def keys_uminus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (keys p) = 1) = (card (keys p) = 1)
[PROOF STEP]
..


[STATEMENT]
lemma distinct_remove_nth:
  assumes "distinct xs"
  shows "distinct (remove_nth i xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (remove_nth i xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs

goal (1 subgoal):
 1. distinct (remove_nth i xs)
[PROOF STEP]
proof (induct xs arbitrary: i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. distinct [] \<Longrightarrow> distinct (remove_nth i [])
 2. \<And>a xs i. \<lbrakk>\<And>i. distinct xs \<Longrightarrow> distinct (remove_nth i xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> distinct (remove_nth i (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
distinct []

goal (2 subgoals):
 1. \<And>i. distinct [] \<Longrightarrow> distinct (remove_nth i [])
 2. \<And>a xs i. \<lbrakk>\<And>i. distinct xs \<Longrightarrow> distinct (remove_nth i xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> distinct (remove_nth i (a # xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distinct []

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

goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<And>i. distinct xs \<Longrightarrow> distinct (remove_nth i xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> distinct (remove_nth i (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<And>i. distinct xs \<Longrightarrow> distinct (remove_nth i xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> distinct (remove_nth i (a # xs))
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
distinct xs \<Longrightarrow> distinct (remove_nth ?i xs)
distinct (a # xs)

goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<And>i. distinct xs \<Longrightarrow> distinct (remove_nth i xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> distinct (remove_nth i (a # xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct xs \<Longrightarrow> distinct (remove_nth ?i xs)
distinct (a # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distinct xs \<Longrightarrow> distinct (remove_nth ?i xs)
distinct (a # xs)

goal (1 subgoal):
 1. distinct (remove_nth i (a # xs))
[PROOF STEP]
by (cases i) (auto simp add: set_remove_nth_subset rev_subsetD)
[PROOF STATE]
proof (state)
this:
distinct (remove_nth i (a # xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finprod_permute:
  assumes p: "p permutes S"
  and f: "f \<in> S \<rightarrow> carrier G"
  shows "finprod G f S = finprod G (f \<circ> p) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G f S = finprod G (f \<circ> p) S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finprod G f S = finprod G (f \<circ> p) S
[PROOF STEP]
from \<open>p permutes S\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes S
[PROOF STEP]
have "inj p"
[PROOF STATE]
proof (prove)
using this:
p permutes S

goal (1 subgoal):
 1. inj p
[PROOF STEP]
by (rule permutes_inj)
[PROOF STATE]
proof (state)
this:
inj p

goal (1 subgoal):
 1. finprod G f S = finprod G (f \<circ> p) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj p
[PROOF STEP]
have "inj_on p S"
[PROOF STATE]
proof (prove)
using this:
inj p

goal (1 subgoal):
 1. inj_on p S
[PROOF STEP]
by (auto intro: subset_inj_on)
[PROOF STATE]
proof (state)
this:
inj_on p S

goal (1 subgoal):
 1. finprod G f S = finprod G (f \<circ> p) S
[PROOF STEP]
from finprod_reindex[OF _ this, unfolded permutes_image[OF p], OF f]
[PROOF STATE]
proof (chain)
picking this:
finprod G f S = (\<Otimes>x\<in>S. f (p x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finprod G f S = (\<Otimes>x\<in>S. f (p x))

goal (1 subgoal):
 1. finprod G f S = finprod G (f \<circ> p) S
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
finprod G f S = (\<Otimes>x\<in>S. f (p x))

goal (1 subgoal):
 1. finprod G f S = (\<Otimes>x\<in>S. f (p x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finprod G f S = finprod G (f \<circ> p) S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_int_diff [simp]: "\<guillemotleft>i - j\<guillemotright> = \<guillemotleft>i\<guillemotright> \<ominus> \<guillemotleft>j\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>i - j\<guillemotright> = \<guillemotleft>i\<guillemotright> \<ominus> \<guillemotleft>j\<guillemotright>
[PROOF STEP]
by (simp only: diff_conv_add_uminus of_int_add) (simp add: minus_eq)


[STATEMENT]
lemma  stoch_proc_filt_space:
  shows "space (stoch_proc_filt M X N n) = space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (stoch_proc_filt M X N n) = space M
[PROOF STEP]
unfolding stoch_proc_filt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (gen_subalgebra M (sigma_sets (space M) (\<Union>i\<in>{m. m \<le> n}. {X i -` A \<inter> space M |A. A \<in> sets N}))) = space M
[PROOF STEP]
by (simp add:gen_subalgebra_space)


[STATEMENT]
lemma dvd_by_all2: "\<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N"
  for M :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N
[PROOF STEP]
proof (induct M)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> 0 \<longrightarrow> m dvd N
 2. \<And>M. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N \<Longrightarrow> \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> 0 \<longrightarrow> m dvd N
 2. \<And>M. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N \<Longrightarrow> \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> 0 \<longrightarrow> m dvd N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N>0. \<forall>m. 0 < m \<and> m \<le> 0 \<longrightarrow> m dvd N

goal (1 subgoal):
 1. \<And>M. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N \<Longrightarrow> \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N \<Longrightarrow> \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N
[PROOF STEP]
case (Suc M)
[PROOF STATE]
proof (state)
this:
\<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N

goal (1 subgoal):
 1. \<And>M. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N \<Longrightarrow> \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N
[PROOF STEP]
obtain N where "N>0" and "\<And>m. 0 < m \<and> m \<le> M \<Longrightarrow> m dvd N"
[PROOF STATE]
proof (prove)
using this:
\<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>0 < N; \<And>m. 0 < m \<and> m \<le> M \<Longrightarrow> m dvd N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < N
0 < ?m \<and> ?m \<le> M \<Longrightarrow> ?m dvd N

goal (1 subgoal):
 1. \<And>M. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N \<Longrightarrow> \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < N
0 < ?m \<and> ?m \<le> M \<Longrightarrow> ?m dvd N
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < N
0 < ?m \<and> ?m \<le> M \<Longrightarrow> ?m dvd N

goal (1 subgoal):
 1. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N
[PROOF STEP]
by (metis nat_0_less_mult_iff zero_less_Suc dvd_mult dvd_mult2 dvd_refl le_Suc_eq)
[PROOF STATE]
proof (state)
this:
\<exists>N>0. \<forall>m. 0 < m \<and> m \<le> Suc M \<longrightarrow> m dvd N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma residuated_iff_conjugate: "residuated_pair f g = conjugation_pair f (\<lambda>x. -g(-x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated_pair f g = conjugation_pair f (\<lambda>x. - g (- x))
[PROOF STEP]
apply (clarsimp simp: conjugation_pair_def residuated_pair_def inf_bot_iff_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. (f x \<le> y) = (x \<le> g y)) = (\<forall>x y. (f x \<le> - y) = (x \<le> g (- y)))
[PROOF STEP]
by (metis double_compl)


[STATEMENT]
lemma (in Graph) isSimplePath_append[split_path_simps]:
  "isSimplePath s (p1@p2) t
    \<longleftrightarrow> (\<exists>u.
      isSimplePath s p1 u
    \<and> isSimplePath u p2 t
    \<and> set (pathVertices_fwd s p1) \<inter> set (pathVertices_fwd u p2) = {u})"
  (is "_ \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isSimplePath s (p1 @ p2) t = (\<exists>u. isSimplePath s p1 u \<and> isSimplePath u p2 t \<and> set (pathVertices_fwd s p1) \<inter> set (pathVertices_fwd u p2) = {u})
[PROOF STEP]
unfolding isSimplePath_fwd
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (isPath s (p1 @ p2) t \<and> distinct (pathVertices_fwd s (p1 @ p2))) = (\<exists>u. (isPath s p1 u \<and> distinct (pathVertices_fwd s p1)) \<and> (isPath u p2 t \<and> distinct (pathVertices_fwd u p2)) \<and> set (pathVertices_fwd s p1) \<inter> set (pathVertices_fwd u p2) = {u})
[PROOF STEP]
apply (cases p1 rule: rev_cases; simp; cases p2; simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys y. \<lbrakk>p1 = ys @ [y]; p2 = []\<rbrakk> \<Longrightarrow> (isPath s (ys @ [y]) t \<and> distinct (pathVertices_fwd s ys) \<and> snd y \<notin> set (pathVertices_fwd s ys)) = (isPath s (ys @ [y]) t \<and> distinct (pathVertices_fwd s ys) \<and> snd y \<notin> set (pathVertices_fwd s ys) \<and> insert (snd y) (set (pathVertices_fwd s ys)) \<inter> {t} = {t})
 2. \<And>ys y a list. \<lbrakk>p1 = ys @ [y]; p2 = a # list\<rbrakk> \<Longrightarrow> (isPath s (ys @ y # a # list) t \<and> distinct (pathVertices_fwd s ys) \<and> snd y \<notin> set (pathVertices_fwd (snd a) list) \<and> distinct (pathVertices_fwd (snd a) list) \<and> snd y \<notin> set (pathVertices_fwd s ys) \<and> set (pathVertices_fwd s ys) \<inter> set (pathVertices_fwd (snd a) list) = {}) = (\<exists>u. isPath s (ys @ [y]) u \<and> distinct (pathVertices_fwd s ys) \<and> snd y \<notin> set (pathVertices_fwd s ys) \<and> isPath u (a # list) t \<and> u \<notin> set (pathVertices_fwd (snd a) list) \<and> distinct (pathVertices_fwd (snd a) list) \<and> insert (snd y) (set (pathVertices_fwd s ys)) \<inter> insert u (set (pathVertices_fwd (snd a) list)) = {u})
[PROOF STEP]
by (auto simp: split_path_simps)


[STATEMENT]
lemma null_sym_diff_transitive:
  assumes "A \<Delta> B \<in> null_sets M" "B \<Delta> C \<in> null_sets M"
      and [measurable]: "A \<in> sets M" "C \<in> sets M"
  shows "A \<Delta> C \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<Delta> C \<in> null_sets M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<Delta> C \<in> null_sets M
[PROOF STEP]
have "A \<Delta> B \<union> B \<Delta> C \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<Delta> B \<union> B \<Delta> C \<in> null_sets M
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
A \<Delta> B \<in> null_sets M
B \<Delta> C \<in> null_sets M

goal (1 subgoal):
 1. A \<Delta> B \<union> B \<Delta> C \<in> null_sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<Delta> B \<union> B \<Delta> C \<in> null_sets M

goal (1 subgoal):
 1. A \<Delta> C \<in> null_sets M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<Delta> B \<union> B \<Delta> C \<in> null_sets M

goal (1 subgoal):
 1. A \<Delta> C \<in> null_sets M
[PROOF STEP]
have "A \<Delta> C \<subseteq> A \<Delta> B \<union> B \<Delta> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<Delta> C \<subseteq> A \<Delta> B \<union> B \<Delta> C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<Delta> C \<subseteq> A \<Delta> B \<union> B \<Delta> C

goal (1 subgoal):
 1. A \<Delta> C \<in> null_sets M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A \<Delta> B \<union> B \<Delta> C \<in> null_sets M
A \<Delta> C \<subseteq> A \<Delta> B \<union> B \<Delta> C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<Delta> B \<union> B \<Delta> C \<in> null_sets M
A \<Delta> C \<subseteq> A \<Delta> B \<union> B \<Delta> C

goal (1 subgoal):
 1. A \<Delta> C \<in> null_sets M
[PROOF STEP]
by (meson null_sets_subset assms(3) assms(4) sets.Diff sets.Un)
[PROOF STATE]
proof (state)
this:
A \<Delta> C \<in> null_sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lex_conv:
  "lex r =
    {(xs,ys). length xs = length ys \<and>
    (\<exists>xys x y xs' ys'. xs = xys @ x # xs' \<and> ys = xys @ y # ys' \<and> (x, y) \<in> r)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lex r = {(xs, ys). length xs = length ys \<and> (\<exists>xys x y xs' ys'. xs = xys @ x # xs' \<and> ys = xys @ y # ys' \<and> (x, y) \<in> r)}
[PROOF STEP]
by (force simp add: lex_def lexn_conv)


[STATEMENT]
theorem nn_integral_monotone_convergence_SUP_AE:
  assumes f: "\<And>i. AE x in M. f i x \<le> f (Suc i) x" "\<And>i. f i \<in> borel_measurable M"
  shows "(\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M) = (SUP i. integral\<^sup>N M (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
AE x in M. f ?i x \<le> f (Suc ?i) x
f ?i \<in> borel_measurable M
[PROOF STEP]
have "AE x in M. \<forall>i. f i x \<le> f (Suc i) x"
[PROOF STATE]
proof (prove)
using this:
AE x in M. f ?i x \<le> f (Suc ?i) x
f ?i \<in> borel_measurable M

goal (1 subgoal):
 1. AE x in M. \<forall>i. f i x \<le> f (Suc i) x
[PROOF STEP]
by (simp add: AE_all_countable)
[PROOF STATE]
proof (state)
this:
AE x in M. \<forall>i. f i x \<le> f (Suc i) x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
from this[THEN AE_E]
[PROOF STATE]
proof (chain)
picking this:
(\<And>N. \<lbrakk>{x \<in> space M. \<not> (\<forall>i. f i x \<le> f (Suc i) x)} \<subseteq> N; emeasure M N = 0; N \<in> sets M\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain N
    where N: "{x \<in> space M. \<not> (\<forall>i. f i x \<le> f (Suc i) x)} \<subseteq> N" "emeasure M N = 0" "N \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
(\<And>N. \<lbrakk>{x \<in> space M. \<not> (\<forall>i. f i x \<le> f (Suc i) x)} \<subseteq> N; emeasure M N = 0; N \<in> sets M\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>{x \<in> space M. \<not> (\<forall>i. f i x \<le> f (Suc i) x)} \<subseteq> N; emeasure M N = 0; N \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> space M. \<not> (\<forall>i. f i x \<le> f (Suc i) x)} \<subseteq> N
emeasure M N = 0
N \<in> sets M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
let ?f = "\<lambda>i x. if x \<in> space M - N then f i x else 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
have f_eq: "AE x in M. \<forall>i. ?f i x = f i x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. \<forall>i. (if x \<in> space M - N then f i x else 0) = f i x
[PROOF STEP]
using N
[PROOF STATE]
proof (prove)
using this:
{x \<in> space M. \<not> (\<forall>i. f i x \<le> f (Suc i) x)} \<subseteq> N
emeasure M N = 0
N \<in> sets M

goal (1 subgoal):
 1. AE x in M. \<forall>i. (if x \<in> space M - N then f i x else 0) = f i x
[PROOF STEP]
by (auto intro!: AE_I[of _ _ N])
[PROOF STATE]
proof (state)
this:
AE x in M. \<forall>i. (if x \<in> space M - N then f i x else 0) = f i x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. \<forall>i. (if x \<in> space M - N then f i x else 0) = f i x
[PROOF STEP]
have "(\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M) = (\<integral>\<^sup>+ x. (SUP i. ?f i x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
AE x in M. \<forall>i. (if x \<in> space M - N then f i x else 0) = f i x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = \<integral>\<^sup>+ x. (SUP i. if x \<in> space M - N then f i x else 0) \<partial>M
[PROOF STEP]
by (auto intro!: nn_integral_cong_AE)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = \<integral>\<^sup>+ x. (SUP i. if x \<in> space M - N then f i x else 0) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = \<integral>\<^sup>+ x. (SUP i. if x \<in> space M - N then f i x else 0) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
have "\<dots> = (SUP i. (\<integral>\<^sup>+ x. ?f i x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. if x \<in> space M - N then f i x else 0) \<partial>M = (SUP i. \<integral>\<^sup>+ x. (if x \<in> space M - N then f i x else 0) \<partial>M)
[PROOF STEP]
proof (rule nn_integral_monotone_convergence_SUP)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. incseq (\<lambda>i x. if x \<in> space M - N then f i x else 0)
 2. \<And>i. (\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M
[PROOF STEP]
show "incseq ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>i x. if x \<in> space M - N then f i x else 0)
[PROOF STEP]
using N(1)
[PROOF STATE]
proof (prove)
using this:
{x \<in> space M. \<not> (\<forall>i. f i x \<le> f (Suc i) x)} \<subseteq> N

goal (1 subgoal):
 1. incseq (\<lambda>i x. if x \<in> space M - N then f i x else 0)
[PROOF STEP]
by (force intro!: incseq_SucI le_funI)
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>i x. if x \<in> space M - N then f i x else 0)

goal (1 subgoal):
 1. \<And>i. (\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>i x. if x \<in> space M - N then f i x else 0)

goal (1 subgoal):
 1. \<And>i. (\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. (\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M
[PROOF STEP]
show "(\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M
[PROOF STEP]
using f N(3)
[PROOF STATE]
proof (prove)
using this:
AE x in M. f ?i x \<le> f (Suc ?i) x
f ?i \<in> borel_measurable M
N \<in> sets M

goal (1 subgoal):
 1. (\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M
[PROOF STEP]
by (intro measurable_If_set) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> space M - N then f i x else 0) \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> space M - N then f ?i2 x else 0) \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (SUP i. if x \<in> space M - N then f i x else 0) \<partial>M = (SUP i. \<integral>\<^sup>+ x. (if x \<in> space M - N then f i x else 0) \<partial>M)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (SUP i. if x \<in> space M - N then f i x else 0) \<partial>M = (SUP i. \<integral>\<^sup>+ x. (if x \<in> space M - N then f i x else 0) \<partial>M)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
have "\<dots> = (SUP i. (\<integral>\<^sup>+ x. f i x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. \<integral>\<^sup>+ x. (if x \<in> space M - N then f i x else 0) \<partial>M) = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
using f_eq
[PROOF STATE]
proof (prove)
using this:
AE x in M. \<forall>i. (if x \<in> space M - N then f i x else 0) = f i x

goal (1 subgoal):
 1. (SUP i. \<integral>\<^sup>+ x. (if x \<in> space M - N then f i x else 0) \<partial>M) = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
by (force intro!: arg_cong[where f = "\<lambda>f. Sup (range f)"] nn_integral_cong_AE ext)
[PROOF STATE]
proof (state)
this:
(SUP i. \<integral>\<^sup>+ x. (if x \<in> space M - N then f i x else 0) \<partial>M) = (SUP i. integral\<^sup>N M (f i))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M = (SUP i. integral\<^sup>N M (f i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma preal_add_assoc: "((x::preal) + y) + z = x + (y + z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y + z = x + (y + z)
[PROOF STEP]
apply (simp add: preal_add_def mem_add_set)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_set (add_set (Rep_preal x) (Rep_preal y)) (Rep_preal z) = add_set (Rep_preal x) (add_set (Rep_preal y) (Rep_preal z))
[PROOF STEP]
apply (force simp: add_set_def ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma split_merge: "\<lbrakk>A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X; X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D\<rbrakk> \<Longrightarrow> (A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X; X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D\<rbrakk> \<Longrightarrow> A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X; X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D\<rbrakk> \<Longrightarrow> A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D
[PROOF STEP]
assume a1: "X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D"
[PROOF STATE]
proof (state)
this:
X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D

goal (1 subgoal):
 1. \<lbrakk>A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X; X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D\<rbrakk> \<Longrightarrow> A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D
[PROOF STEP]
assume "A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X"
[PROOF STATE]
proof (state)
this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X

goal (1 subgoal):
 1. \<lbrakk>A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X; X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D\<rbrakk> \<Longrightarrow> A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X
[PROOF STEP]
have "A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A D * true"
[PROOF STATE]
proof (prove)
using this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X

goal (1 subgoal):
 1. A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A D * true
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X
X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D

goal (1 subgoal):
 1. A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A D * true
[PROOF STEP]
by (meson ent_disjI1_direct ent_frame_fwd enttD entt_def_true)
[PROOF STATE]
proof (state)
this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A D * true

goal (1 subgoal):
 1. \<lbrakk>A \<or>\<^sub>A B \<Longrightarrow>\<^sub>t X; X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D\<rbrakk> \<Longrightarrow> A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A D * true
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A D * true

goal (1 subgoal):
 1. A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A D * true
X \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D

goal (1 subgoal):
 1. A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D
[PROOF STEP]
by (metis (no_types) Assertions.ent_disjI2 ent_disjE enttD enttI semigroup.assoc sup.semigroup_axioms)
[PROOF STATE]
proof (state)
this:
A \<or>\<^sub>A B \<or>\<^sub>A C \<Longrightarrow>\<^sub>t D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_closure [simp]: "dim (closure s) = dim s" (is "?dc = ?d")
  for s :: "'a::euclidean_space set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (closure s) = dim s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (closure s) = dim s
[PROOF STEP]
have "?dc \<le> ?d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (closure s) \<le> dim s
[PROOF STEP]
using closure_minimal[OF span_superset, of s]
[PROOF STATE]
proof (prove)
using this:
closed (span s) \<Longrightarrow> closure s \<subseteq> span s

goal (1 subgoal):
 1. dim (closure s) \<le> dim s
[PROOF STEP]
using closed_subspace[OF subspace_span, of s]
[PROOF STATE]
proof (prove)
using this:
closed (span s) \<Longrightarrow> closure s \<subseteq> span s
closed (span s)

goal (1 subgoal):
 1. dim (closure s) \<le> dim s
[PROOF STEP]
using dim_subset[of "closure s" "span s"]
[PROOF STATE]
proof (prove)
using this:
closed (span s) \<Longrightarrow> closure s \<subseteq> span s
closed (span s)
closure s \<subseteq> span s \<Longrightarrow> dim (closure s) \<le> dim (span s)

goal (1 subgoal):
 1. dim (closure s) \<le> dim s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim (closure s) \<le> dim s

goal (1 subgoal):
 1. dim (closure s) = dim s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim (closure s) \<le> dim s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim (closure s) \<le> dim s

goal (1 subgoal):
 1. dim (closure s) = dim s
[PROOF STEP]
using dim_subset[OF closure_subset, of s]
[PROOF STATE]
proof (prove)
using this:
dim (closure s) \<le> dim s
dim s \<le> dim (closure s)

goal (1 subgoal):
 1. dim (closure s) = dim s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim (closure s) = dim s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powa_powrat_eq:
  assumes "a \<ge> 1" shows "a powa (of_rat q) = a pow\<^sub>\<rat> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a powa real_of_rat q = a pow\<^sub>\<rat> q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a powa real_of_rat q = a pow\<^sub>\<rat> q
[PROOF STEP]
have "(\<lambda>n. a pow\<^sub>\<rat> incseq_of (real_of_rat q) n) \<longlonglongrightarrow> a pow\<^sub>\<rat> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> incseq_of (real_of_rat q) n) \<longlonglongrightarrow> a pow\<^sub>\<rat> q
[PROOF STEP]
using powa_indep_incseq_of' assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> ?a; incseq ?r; (\<lambda>n. real_of_rat (?r n)) \<longlonglongrightarrow> ?x; (\<lambda>n. ?a pow\<^sub>\<rat> ?r n) \<longlonglongrightarrow> ?y\<rbrakk> \<Longrightarrow> (\<lambda>n. ?a pow\<^sub>\<rat> incseq_of ?x n) \<longlonglongrightarrow> ?y
1 \<le> a

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> incseq_of (real_of_rat q) n) \<longlonglongrightarrow> a pow\<^sub>\<rat> q
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (real_of_rat q) n) \<longlonglongrightarrow> a pow\<^sub>\<rat> q

goal (1 subgoal):
 1. a powa real_of_rat q = a pow\<^sub>\<rat> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (real_of_rat q) n) \<longlonglongrightarrow> a pow\<^sub>\<rat> q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (real_of_rat q) n) \<longlonglongrightarrow> a pow\<^sub>\<rat> q

goal (1 subgoal):
 1. a powa real_of_rat q = a pow\<^sub>\<rat> q
[PROOF STEP]
using powa_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (real_of_rat q) n) \<longlonglongrightarrow> a pow\<^sub>\<rat> q
?a powa ?x = (THE y. (\<lambda>n. ?a pow\<^sub>\<rat> incseq_of ?x n) \<longlonglongrightarrow> y)

goal (1 subgoal):
 1. a powa real_of_rat q = a pow\<^sub>\<rat> q
[PROOF STEP]
by (metis Lim_def limI)
[PROOF STATE]
proof (state)
this:
a powa real_of_rat q = a pow\<^sub>\<rat> q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_closure_iff_infdist_zero:
  assumes "A \<noteq> {}"
  shows "x \<in> closure A \<longleftrightarrow> infdist x A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> closure A) = (infdist x A = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> closure A \<Longrightarrow> infdist x A = 0
 2. infdist x A = 0 \<Longrightarrow> x \<in> closure A
[PROOF STEP]
assume "x \<in> closure A"
[PROOF STATE]
proof (state)
this:
x \<in> closure A

goal (2 subgoals):
 1. x \<in> closure A \<Longrightarrow> infdist x A = 0
 2. infdist x A = 0 \<Longrightarrow> x \<in> closure A
[PROOF STEP]
show "infdist x A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x A = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infdist x A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "infdist x A \<noteq> 0"
[PROOF STATE]
proof (state)
this:
infdist x A \<noteq> 0

goal (1 subgoal):
 1. infdist x A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
with infdist_nonneg[of x A]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> infdist x A
infdist x A \<noteq> 0
[PROOF STEP]
have "infdist x A > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> infdist x A
infdist x A \<noteq> 0

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

goal (1 subgoal):
 1. infdist x A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < infdist x A
[PROOF STEP]
have "ball x (infdist x A) \<inter> closure A = {}"
[PROOF STATE]
proof (prove)
using this:
0 < infdist x A

goal (1 subgoal):
 1. ball x (infdist x A) \<inter> closure A = {}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>0 < infdist x A; dist x xa < infdist x A; xa \<in> closure A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (metis \<open>x \<in> closure A\<close> closure_approachable dist_commute infdist_le not_less)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
ball x (infdist x A) \<inter> closure A = {}

goal (1 subgoal):
 1. infdist x A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball x (infdist x A) \<inter> closure A = {}
[PROOF STEP]
have "x \<notin> closure A"
[PROOF STATE]
proof (prove)
using this:
ball x (infdist x A) \<inter> closure A = {}

goal (1 subgoal):
 1. x \<notin> closure A
[PROOF STEP]
by (metis \<open>0 < infdist x A\<close> centre_in_ball disjoint_iff_not_equal)
[PROOF STATE]
proof (state)
this:
x \<notin> closure A

goal (1 subgoal):
 1. infdist x A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> closure A
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<notin> closure A

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>x \<in> closure A\<close>
[PROOF STATE]
proof (prove)
using this:
x \<notin> closure A
x \<in> closure 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:
infdist x A = 0

goal (1 subgoal):
 1. infdist x A = 0 \<Longrightarrow> x \<in> closure A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infdist x A = 0 \<Longrightarrow> x \<in> closure A
[PROOF STEP]
assume x: "infdist x A = 0"
[PROOF STATE]
proof (state)
this:
infdist x A = 0

goal (1 subgoal):
 1. infdist x A = 0 \<Longrightarrow> x \<in> closure A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infdist x A = 0
[PROOF STEP]
obtain a where "a \<in> A"
[PROOF STATE]
proof (prove)
using this:
infdist x A = 0

goal (1 subgoal):
 1. (\<And>a. a \<in> A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by atomize_elim (metis all_not_in_conv assms)
[PROOF STATE]
proof (state)
this:
a \<in> A

goal (1 subgoal):
 1. infdist x A = 0 \<Longrightarrow> x \<in> closure A
[PROOF STEP]
show "x \<in> closure A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> closure A
[PROOF STEP]
unfolding closure_approachable
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>y\<in>A. dist y x < e
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>y\<in>A. dist y x < e
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < e; \<not> (\<exists>y\<in>A. dist y x < e)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix e :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < e; \<not> (\<exists>y\<in>A. dist y x < e)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < e; \<not> (\<exists>y\<in>A. dist y x < e)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<exists>y\<in>A. dist y x < e)"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>y\<in>A. dist y x < e)

goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < e; \<not> (\<exists>y\<in>A. dist y x < e)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>y\<in>A. dist y x < e)
[PROOF STEP]
have "infdist x A \<ge> e"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>y\<in>A. dist y x < e)

goal (1 subgoal):
 1. e \<le> infdist x A
[PROOF STEP]
using \<open>a \<in> A\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>y\<in>A. dist y x < e)
a \<in> A

goal (1 subgoal):
 1. e \<le> infdist x A
[PROOF STEP]
unfolding infdist_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>y\<in>A. dist y x < e)
a \<in> A

goal (1 subgoal):
 1. e \<le> (if A = {} then 0 else Inf (dist x ` A))
[PROOF STEP]
by (force simp: dist_commute intro: cINF_greatest)
[PROOF STATE]
proof (state)
this:
e \<le> infdist x A

goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < e; \<not> (\<exists>y\<in>A. dist y x < e)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with x \<open>e > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
infdist x A = 0
0 < e
e \<le> infdist x A
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
infdist x A = 0
0 < e
e \<le> infdist x A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> closure A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_bts_dfs_rev:
  "set (bts_dfs f (rev ts)) = set (bts_dfs f ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (bts_dfs f (rev ts)) = set (bts_dfs f ts)
[PROOF STEP]
by (induct ts) auto


[STATEMENT]
lemma mini_first [rule_format]:
 "xs \<noteq> [] \<longrightarrow> i < mini xs key \<longrightarrow>
    key (xs ! mini xs key) < key (xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<longrightarrow> i < mini xs key \<longrightarrow> key (xs ! mini xs key) < key (xs ! i)
[PROOF STEP]
by (induction xs arbitrary: i, simp_all add: Let_def, (rule impI)+,
 erule conjE, simp add: not_le nth_Cons split: nat.split)


[STATEMENT]
lemma bounded_exec':
  fixes ss w a b
  assumes w_n_nil: " w \<noteq> [] "
       and step_hdw: " (a, b) \<in> set (step (hd w) (ss ! hd w)) "
       and w_lt_n:"\<forall>p\<in>set w. p < n "
      shows" a < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w \<noteq> []
(a, b) \<in> set (step (hd w) (ss ! hd w))
\<forall>p\<in>set w. p < n

goal (1 subgoal):
 1. a < n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>w \<noteq> []; (a, b) \<in> set (step (hd w) (ss ! hd w)); \<forall>p\<in>set w. p < n\<rbrakk> \<Longrightarrow> a < n
[PROOF STEP]
from w_lt_n
[PROOF STATE]
proof (chain)
picking this:
\<forall>p\<in>set w. p < n
[PROOF STEP]
have "hd w < n"
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set w. p < n

goal (1 subgoal):
 1. hd w < n
[PROOF STEP]
using w_n_nil
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set w. p < n
w \<noteq> []

goal (1 subgoal):
 1. hd w < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hd w < n

goal (1 subgoal):
 1. \<lbrakk>w \<noteq> []; (a, b) \<in> set (step (hd w) (ss ! hd w)); \<forall>p\<in>set w. p < n\<rbrakk> \<Longrightarrow> a < n
[PROOF STEP]
with bounded_exec
[PROOF STATE]
proof (chain)
picking this:
bounded step n
hd w < n
[PROOF STEP]
have "( \<forall>\<tau>. \<forall>(q,\<tau>') \<in> set (step (hd w) \<tau>). q<n)"
[PROOF STATE]
proof (prove)
using this:
bounded step n
hd w < n

goal (1 subgoal):
 1. \<forall>\<tau>. \<forall>(q, \<tau>')\<in>set (step (hd w) \<tau>). q < n
[PROOF STEP]
by (auto simp add:bounded_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<tau>. \<forall>(q, \<tau>')\<in>set (step (hd w) \<tau>). q < n

goal (1 subgoal):
 1. \<lbrakk>w \<noteq> []; (a, b) \<in> set (step (hd w) (ss ! hd w)); \<forall>p\<in>set w. p < n\<rbrakk> \<Longrightarrow> a < n
[PROOF STEP]
with step_hdw
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> set (step (hd w) (ss ! hd w))
\<forall>\<tau>. \<forall>(q, \<tau>')\<in>set (step (hd w) \<tau>). q < n
[PROOF STEP]
show "a < n"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> set (step (hd w) (ss ! hd w))
\<forall>\<tau>. \<forall>(q, \<tau>')\<in>set (step (hd w) \<tau>). q < n

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_permutations_step:
  assumes "xs \<noteq> []"
  shows "set (permutations xs) = (\<Union>x \<in> set xs. Cons x ` set (permutations (remove1 x xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (permutations xs) = (\<Union>x\<in>set xs. (#) x ` set (permutations (remove1 x xs)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. set (permutations xs) = (\<Union>x\<in>set xs. (#) x ` set (permutations (remove1 x xs)))
[PROOF STEP]
by (cases xs) (auto simp: permutations_Cons)


[STATEMENT]
lemma subgroup_generated_is_subset:
  fixes H
  shows "subgroup_generated H \<subseteq> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup_generated H \<subseteq> G
[PROOF STEP]
using generate_into_G subgroup_generated_def
[PROOF STATE]
proof (prove)
using this:
?a \<in> generate (G \<inter> ?H) \<Longrightarrow> ?a \<in> G
subgroup_generated ?S = generate (G \<inter> ?S)

goal (1 subgoal):
 1. subgroup_generated H \<subseteq> G
[PROOF STEP]
by blast


[STATEMENT]
lemma infin_imp_iNextWeak_eq_iNext: "\<lbrakk> infinite I; t0 \<in> I \<rbrakk> \<Longrightarrow> (\<circle>\<^sub>W t t0 I. P t) = (\<circle> t t0 I. P t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite I; t0 \<in> I\<rbrakk> \<Longrightarrow> iNextWeak t0 I P = iNext t0 I P
[PROOF STEP]
by (simp add: infin_imp_iNextWeak_iNextStrong_eq_iNext)


[STATEMENT]
lemma primepow_decompose:
  fixes n :: "'a :: factorial_semiring_multiplicative"
  assumes "primepow n"
  shows   "aprimedivisor n ^ multiplicity (aprimedivisor n) n = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
primepow n
[PROOF STEP]
have "n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
primepow n

goal (1 subgoal):
 1. n \<noteq> (0::'a)
[PROOF STEP]
by (intro notI) (auto simp: primepow_def)
[PROOF STATE]
proof (state)
this:
n \<noteq> (0::'a)

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
hence "n = unit_factor n * prod_mset (prime_factorization n)"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> (0::'a)

goal (1 subgoal):
 1. n = unit_factor n * \<Prod>\<^sub># (prime_factorization n)
[PROOF STEP]
by (subst prod_mset_prime_factorization) simp_all
[PROOF STATE]
proof (state)
this:
n = unit_factor n * \<Prod>\<^sub># (prime_factorization n)

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n = unit_factor n * \<Prod>\<^sub># (prime_factorization n)

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
primepow n
[PROOF STEP]
have "unit_factor n = 1"
[PROOF STATE]
proof (prove)
using this:
primepow n

goal (1 subgoal):
 1. unit_factor n = (1::'a)
[PROOF STEP]
by (auto simp: primepow_def unit_factor_power)
[PROOF STATE]
proof (state)
this:
unit_factor n = (1::'a)

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unit_factor n = (1::'a)

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
have "prime_factorization n =
               replicate_mset (multiplicity (aprimedivisor n) n) (aprimedivisor n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization n = replicate_mset (multiplicity (aprimedivisor n) n) (aprimedivisor n)
[PROOF STEP]
by (intro prime_factorization_primepow assms)
[PROOF STATE]
proof (state)
this:
prime_factorization n = replicate_mset (multiplicity (aprimedivisor n) n) (aprimedivisor n)

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factorization n = replicate_mset (multiplicity (aprimedivisor n) n) (aprimedivisor n)

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
have "prod_mset \<dots> = aprimedivisor n ^ multiplicity (aprimedivisor n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>\<^sub># (replicate_mset (multiplicity (aprimedivisor n) n) (aprimedivisor n)) = aprimedivisor n ^ multiplicity (aprimedivisor n) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Prod>\<^sub># (replicate_mset (multiplicity (aprimedivisor n) n) (aprimedivisor n)) = aprimedivisor n ^ multiplicity (aprimedivisor n) n

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n = (1::'a) * aprimedivisor n ^ multiplicity (aprimedivisor n) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = (1::'a) * aprimedivisor n ^ multiplicity (aprimedivisor n) n

goal (1 subgoal):
 1. aprimedivisor n ^ multiplicity (aprimedivisor n) n = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
aprimedivisor n ^ multiplicity (aprimedivisor n) n = n

goal:
No subgoals!
[PROOF STEP]
qed