[STATEMENT]
lemma function_set_finite:
  assumes "finite R"
  assumes "finite A"
  shows "finite {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}" (is "finite ?F")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
finite R

goal (1 subgoal):
 1. finite {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}
[PROOF STEP]
proof (induction R rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {f. (\<forall>x. x \<notin> {} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A)}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. finite {f. (\<forall>x. x \<notin> {} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A)}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
have "{f. (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A) \<and> (\<forall>x. x \<notin> {} \<longrightarrow> f x = c)} \<subseteq> {\<lambda>x. c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A) \<and> (\<forall>x. x \<notin> {} \<longrightarrow> f x = c)} \<subseteq> {\<lambda>x. c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f. (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A) \<and> (\<forall>x. x \<notin> {} \<longrightarrow> f x = c)} \<subseteq> {\<lambda>x. c}

goal (2 subgoals):
 1. finite {f. (\<forall>x. x \<notin> {} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A)}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
{f. (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A) \<and> (\<forall>x. x \<notin> {} \<longrightarrow> f x = c)} \<subseteq> {\<lambda>x. c}

goal (1 subgoal):
 1. finite {f. (\<forall>x. x \<notin> {} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A)}
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
{f. (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A) \<and> (\<forall>x. x \<notin> {} \<longrightarrow> f x = c)} \<subseteq> {\<lambda>x. c}
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {f. (\<forall>x. x \<notin> {} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {f. (\<forall>x. x \<notin> {} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> {} \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
case (insert r R)
[PROOF STATE]
proof (state)
this:
finite R
r \<notin> R
finite {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
let ?F = "{f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
let ?F' = "{f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
have "?F \<subseteq> {f(r := a) | f a. f \<in> ?F' \<and> a \<in> A}" (is "_ \<subseteq> ?X")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<subseteq> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<Longrightarrow> x \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<Longrightarrow> x \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
assume "f \<in> ?F"
[PROOF STATE]
proof (state)
this:
f \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. \<And>x. x \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<Longrightarrow> x \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
hence "f(r := c) \<in> ?F'" and "f r \<in> A"
[PROOF STATE]
proof (prove)
using this:
f \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. f(r := c) \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} &&& f r \<in> A
[PROOF STEP]
using insert(2)
[PROOF STATE]
proof (prove)
using this:
f \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)}
r \<notin> R

goal (1 subgoal):
 1. f(r := c) \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} &&& f r \<in> A
[PROOF STEP]
by (simp, blast)
[PROOF STATE]
proof (state)
this:
f(r := c) \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}
f r \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<Longrightarrow> x \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
hence "f(r := c, r := (f r)) \<in> ?X"
[PROOF STATE]
proof (prove)
using this:
f(r := c) \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}
f r \<in> A

goal (1 subgoal):
 1. f(r := c, r := f r) \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f(r := c, r := f r) \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. \<And>x. x \<in> {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<Longrightarrow> x \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
thus "f \<in> ?X"
[PROOF STATE]
proof (prove)
using this:
f(r := c, r := f r) \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. f \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<in> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<subseteq> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<subseteq> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
have "finite (?F' \<times> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A)
[PROOF STEP]
using assms(2) insert(3)
[PROOF STATE]
proof (prove)
using this:
finite A
finite {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. finite ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
have "(\<lambda>(f,a). f(r:=a)) ` (?F' \<times> A) = ?X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(f, a). f(r := a)) ` ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A) = {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>(f, a). f(r := a)) ` ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A) = {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
hence "finite ?X"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(f, a). f(r := a)) ` ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A) = {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. finite {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
using finite_imageI[OF \<open>finite (?F' \<times> A)\<close>, of "(\<lambda>(f,a). f(r:=a))"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(f, a). f(r := a)) ` ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A) = {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
finite ((\<lambda>(f, a). f(r := a)) ` ({f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<times> A))

goal (1 subgoal):
 1. finite {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finite {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<subseteq> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
finite {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
[PROOF STEP]
have "finite ?F"
[PROOF STATE]
proof (prove)
using this:
{f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)} \<subseteq> {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}
finite {f(r := a) |f a. f \<in> {f. (\<forall>x. x \<notin> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<longrightarrow> f x \<in> A)} \<and> a \<in> A}

goal (1 subgoal):
 1. finite {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)}
[PROOF STEP]
by (blast intro: finite_subset)
[PROOF STATE]
proof (state)
this:
finite {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {f. (\<forall>x. x \<notin> F \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> F \<longrightarrow> f x \<in> A)}\<rbrakk> \<Longrightarrow> finite {f. (\<forall>xa. xa \<notin> insert x F \<longrightarrow> f xa = c) \<and> (\<forall>xa. xa \<in> insert x F \<longrightarrow> f xa \<in> A)}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite {f. (\<forall>x. x \<notin> R \<union> {r} \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> {r} \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. finite {f. (\<forall>x. x \<notin> insert r R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> insert r R \<longrightarrow> f x \<in> A)}
[PROOF STEP]
unfolding insert_def
[PROOF STATE]
proof (prove)
using this:
finite {f. (\<forall>x. x \<notin> R \<union> ({x. x = r} \<union> {}) \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> R \<union> ({x. x = r} \<union> {}) \<longrightarrow> f x \<in> A)}

goal (1 subgoal):
 1. finite {f. (\<forall>x. x \<notin> {x. x = r} \<union> R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> {x. x = r} \<union> R \<longrightarrow> f x \<in> A)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {f. (\<forall>x. x \<notin> insert r R \<longrightarrow> f x = c) \<and> (\<forall>x. x \<in> insert r R \<longrightarrow> f x \<in> A)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma spectral_radius_upper_bound [simp]:
  "(spectral_radius x)^n \<le> norm(x^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spectral_radius x ^ n \<le> norm (x ^ n)
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> spectral_radius x ^ n \<le> norm (x ^ n)
 2. \<not> ?P \<Longrightarrow> spectral_radius x ^ n \<le> norm (x ^ n)
[PROOF STEP]
assume "\<not>(n = 0)"
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> spectral_radius x ^ n \<le> norm (x ^ n)
 2. \<not> ?P \<Longrightarrow> spectral_radius x ^ n \<le> norm (x ^ n)
[PROOF STEP]
have "root n (norm(x^n)) \<ge> spectral_radius x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spectral_radius x \<le> root n (norm (x ^ n))
[PROOF STEP]
using spectral_radius_aux \<open>n \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
?t \<in> {root n (norm (?x ^ n)) |n. 0 < n} \<Longrightarrow> spectral_radius ?x \<le> ?t
?t \<in> {root n (norm (?x ^ n)) |n. 0 < n} \<Longrightarrow> 0 \<le> ?t
bdd_below {root n (norm (?x ^ n)) |n. 0 < n}
{root n (norm (?x ^ n)) |n. 0 < n} \<noteq> {}
0 \<le> Inf {root n (norm (?x ^ n)) |n. 0 < n}
n \<noteq> 0

goal (1 subgoal):
 1. spectral_radius x \<le> root n (norm (x ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
spectral_radius x \<le> root n (norm (x ^ n))

goal (2 subgoals):
 1. ?P \<Longrightarrow> spectral_radius x ^ n \<le> norm (x ^ n)
 2. \<not> ?P \<Longrightarrow> spectral_radius x ^ n \<le> norm (x ^ n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
spectral_radius x \<le> root n (norm (x ^ n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
spectral_radius x \<le> root n (norm (x ^ n))

goal (1 subgoal):
 1. spectral_radius x ^ n \<le> norm (x ^ n)
[PROOF STEP]
by (metis \<open>n \<noteq> 0\<close> spectral_radius_nonneg norm_ge_zero not_gr0 power_mono real_root_pow_pos2)
[PROOF STATE]
proof (state)
this:
spectral_radius x ^ n \<le> norm (x ^ n)

goal (1 subgoal):
 1. \<not> n \<noteq> 0 \<Longrightarrow> spectral_radius x ^ n \<le> norm (x ^ n)
[PROOF STEP]
qed (simp)


[STATEMENT]
lemma subsumption_and_semantics :
  assumes "subsumes C D"
  assumes "validate_clause I C"
  shows "validate_clause I D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<Turnstile> D
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subsumes C D
I \<Turnstile> C

goal (1 subgoal):
 1. I \<Turnstile> D
[PROOF STEP]
unfolding subsumes_def
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> D
I \<Turnstile> C

goal (1 subgoal):
 1. I \<Turnstile> D
[PROOF STEP]
by auto


[STATEMENT]
lemma emeasure_lborel_countable:
  fixes A :: "'a::euclidean_space set"
  assumes "countable A"
  shows "emeasure lborel A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel A = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure lborel A = 0
[PROOF STEP]
have "A \<subseteq> (\<Union>i. {from_nat_into A i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> (\<Union>i. {from_nat_into A i})
[PROOF STEP]
using from_nat_into_surj assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable ?A; ?a \<in> ?A\<rbrakk> \<Longrightarrow> \<exists>n. from_nat_into ?A n = ?a
countable A

goal (1 subgoal):
 1. A \<subseteq> (\<Union>i. {from_nat_into A i})
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
A \<subseteq> (\<Union>i. {from_nat_into A i})

goal (1 subgoal):
 1. emeasure lborel A = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> (\<Union>i. {from_nat_into A i})
[PROOF STEP]
have "emeasure lborel A \<le> emeasure lborel (\<Union>i. {from_nat_into A i})"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> (\<Union>i. {from_nat_into A i})

goal (1 subgoal):
 1. emeasure lborel A \<le> emeasure lborel (\<Union>i. {from_nat_into A i})
[PROOF STEP]
by (intro emeasure_mono) auto
[PROOF STATE]
proof (state)
this:
emeasure lborel A \<le> emeasure lborel (\<Union>i. {from_nat_into A i})

goal (1 subgoal):
 1. emeasure lborel A = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure lborel A \<le> emeasure lborel (\<Union>i. {from_nat_into A i})

goal (1 subgoal):
 1. emeasure lborel A = 0
[PROOF STEP]
have "emeasure lborel (\<Union>i. {from_nat_into A i}) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel (\<Union>i. {from_nat_into A i}) = 0
[PROOF STEP]
by (rule emeasure_UN_eq_0) auto
[PROOF STATE]
proof (state)
this:
emeasure lborel (\<Union>i. {from_nat_into A i}) = 0

goal (1 subgoal):
 1. emeasure lborel A = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel A \<le> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure lborel A \<le> 0

goal (1 subgoal):
 1. emeasure lborel A = 0
[PROOF STEP]
by (auto simp add: )
[PROOF STATE]
proof (state)
this:
emeasure lborel A = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_ivl_affine_of_ivlE:
  assumes "k \<in> {l .. u}"
  obtains e where "e \<in> UNIV \<rightarrow> {-1 .. 1}" "k = aform_val e (aform_of_ivl l u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>e \<in> UNIV \<rightarrow> {- 1..1}; k = aform_val e (aform_of_ivl l u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof atomize_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
define e where [abs_def]: "e i = (let b = if i <length (Basis_list::'a list) then
    (the (map_of (zip [0..<length (Basis_list::'a list)] (Basis_list::'a list)) i)) else 0 in
      ((k - (l + u) /\<^sub>R 2) \<bullet> b) / (((u - l) /\<^sub>R 2) \<bullet> b))" for i
[PROOF STATE]
proof (state)
this:
e \<equiv> \<lambda>i. let b = if i < length Basis_list then the (map_of (zip [0..<length Basis_list] Basis_list) i) else (0::'a) in (k - (l + u) /\<^sub>R 2) \<bullet> b / (((u - l) /\<^sub>R 2) \<bullet> b)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
let ?B = "Basis_list::'a list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "k = (1 / 2) *\<^sub>R (l + u) +
      (\<Sum>b \<in> Basis. (if (u - l) \<bullet> b = 0 then 0 else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b)) *\<^sub>R b)"
    (is "_ = _ + ?dots")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = (1 / 2) *\<^sub>R (l + u) + (\<Sum>b\<in>Basis. (if (u - l) \<bullet> b = 0 then 0 else (k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<in> {l..u}

goal (1 subgoal):
 1. k = (1 / 2) *\<^sub>R (l + u) + (\<Sum>b\<in>Basis. (if (u - l) \<bullet> b = 0 then 0 else (k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)
[PROOF STEP]
by (force simp add: algebra_simps eucl_le[where 'a='a] intro!: euclidean_eqI[where 'a='a])
[PROOF STATE]
proof (state)
this:
k = (1 / 2) *\<^sub>R (l + u) + (\<Sum>b\<in>Basis. (if (u - l) \<bullet> b = 0 then 0 else (k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k = (1 / 2) *\<^sub>R (l + u) + (\<Sum>b\<in>Basis. (if (u - l) \<bullet> b = 0 then 0 else (k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have
    "?dots = (\<Sum>b \<in> Basis. (if (u - l) \<bullet> b = 0 then 0 else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. (if (u - l) \<bullet> b = 0 then 0 else (k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>b\<in>Basis. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)
[PROOF STEP]
by (auto intro!: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. (if (u - l) \<bullet> b = 0 then 0 else (k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>b\<in>Basis. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. (if (u - l) \<bullet> b = 0 then 0 else (k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>b\<in>Basis. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "\<dots> = (\<Sum>b \<leftarrow> ?B. (if (u - l) \<bullet> b = 0 then 0 else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>b\<leftarrow>Basis_list. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)
[PROOF STEP]
by (auto simp: sum_list_distinct_conv_sum_set)
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>b\<leftarrow>Basis_list. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>b\<leftarrow>Basis_list. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "\<dots> =
    (\<Sum>i = 0..<length ?B.
        (if (u - l) \<bullet> ?B ! i = 0 then 0 else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> ?B ! i) *\<^sub>R ?B ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<leftarrow>Basis_list. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>i = 0..<length Basis_list. if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)
[PROOF STEP]
by (auto simp: sum_list_sum_nth)
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<leftarrow>Basis_list. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>i = 0..<length Basis_list. if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<leftarrow>Basis_list. if (u - l) \<bullet> b = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> b) *\<^sub>R b) = (\<Sum>i = 0..<length Basis_list. if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "\<dots> =
    (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs).
        (if (u - l) \<bullet> Basis_list ! i = 0 then 0
        else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<length Basis_list. if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i) = (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs). if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)
[PROOF STEP]
using degree_inner_scaleR_pdevs_le[of "u - l"]
[PROOF STATE]
proof (prove)
using this:
degree (inner_scaleR_pdevs (u - l) One_pdevs) \<le> degree One_pdevs

goal (1 subgoal):
 1. (\<Sum>i = 0..<length Basis_list. if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i) = (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs). if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)
[PROOF STEP]
by (intro sum.mono_neutral_cong_right) (auto dest!: degree)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length Basis_list. if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i) = (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs). if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length Basis_list. if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i) = (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs). if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "(1 / 2) *\<^sub>R (l + u) +
    (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs).
        (if (u - l) \<bullet> Basis_list ! i = 0 then 0
        else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i)) =
      aform_val e (aform_of_ivl l u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>R (l + u) + (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs). if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i) = aform_val e (aform_of_ivl l u)
[PROOF STEP]
using degree_inner_scaleR_pdevs_le[of "u - l"]
[PROOF STATE]
proof (prove)
using this:
degree (inner_scaleR_pdevs (u - l) One_pdevs) \<le> degree One_pdevs

goal (1 subgoal):
 1. (1 / 2) *\<^sub>R (l + u) + (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs). if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i) = aform_val e (aform_of_ivl l u)
[PROOF STEP]
by (auto simp: aform_val_def aform_of_ivl_def pdevs_of_ivl_def map_of_zip_upto_length_eq_nth
      e_def Let_def pdevs_val_sum
      intro!: sum.cong)
[PROOF STATE]
proof (state)
this:
(1 / 2) *\<^sub>R (l + u) + (\<Sum>i = 0..<degree (inner_scaleR_pdevs (u - l) One_pdevs). if (u - l) \<bullet> Basis_list ! i = 0 then 0::'a else ((k - (1 / 2) *\<^sub>R (l + u)) \<bullet> Basis_list ! i) *\<^sub>R Basis_list ! i) = aform_val e (aform_of_ivl l u)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "k = aform_val e (aform_of_ivl l u)"
[PROOF STATE]
proof (prove)
using this:
k = aform_val e (aform_of_ivl l u)

goal (1 subgoal):
 1. k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k = aform_val e (aform_of_ivl l u)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
k = aform_val e (aform_of_ivl l u)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
k = aform_val e (aform_of_ivl l u)

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
fix k l u::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
assume *: "l \<le> k" "k \<le> u"
[PROOF STATE]
proof (state)
this:
l \<le> k
k \<le> u

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
let ?m = "l / 2 + u / 2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "\<bar>k - ?m\<bar> \<le> \<bar>if k \<le> ?m then ?m - l else u - ?m\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>if k \<le> l / 2 + u / 2 then l / 2 + u / 2 - l else u - (l / 2 + u / 2)\<bar>
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
l \<le> k
k \<le> u

goal (1 subgoal):
 1. \<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>if k \<le> l / 2 + u / 2 then l / 2 + u / 2 - l else u - (l / 2 + u / 2)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>if k \<le> l / 2 + u / 2 then l / 2 + u / 2 - l else u - (l / 2 + u / 2)\<bar>

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>if k \<le> l / 2 + u / 2 then l / 2 + u / 2 - l else u - (l / 2 + u / 2)\<bar>

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "\<dots> \<le> \<bar>u / 2 - l / 2\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>if k \<le> l / 2 + u / 2 then l / 2 + u / 2 - l else u - (l / 2 + u / 2)\<bar> \<le> \<bar>u / 2 - l / 2\<bar>
[PROOF STEP]
by (auto simp: abs_real_def)
[PROOF STATE]
proof (state)
this:
\<bar>if k \<le> l / 2 + u / 2 then l / 2 + u / 2 - l else u - (l / 2 + u / 2)\<bar> \<le> \<bar>u / 2 - l / 2\<bar>

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>u / 2 - l / 2\<bar>
[PROOF STEP]
have "\<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>u / 2 - l/2\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>u / 2 - l / 2\<bar>

goal (1 subgoal):
 1. \<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>u / 2 - l / 2\<bar>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>k - (l / 2 + u / 2)\<bar> \<le> \<bar>u / 2 - l / 2\<bar>

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?la2 \<le> ?ka2; ?ka2 \<le> ?ua2\<rbrakk> \<Longrightarrow> \<bar>?ka2 - (?la2 / 2 + ?ua2 / 2)\<bar> \<le> \<bar>?ua2 / 2 - ?la2 / 2\<bar>

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
note midpoint_abs = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?la2 \<le> ?ka2; ?ka2 \<le> ?ua2\<rbrakk> \<Longrightarrow> \<bar>?ka2 - (?la2 / 2 + ?ua2 / 2)\<bar> \<le> \<bar>?ua2 / 2 - ?la2 / 2\<bar>

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "e \<in> UNIV \<rightarrow> {- 1..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<in> UNIV \<rightarrow> {- 1..1}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<in> {l..u}

goal (1 subgoal):
 1. e \<in> UNIV \<rightarrow> {- 1..1}
[PROOF STEP]
unfolding e_def Let_def
[PROOF STATE]
proof (prove)
using this:
k \<in> {l..u}

goal (1 subgoal):
 1. (\<lambda>i. (k - (l + u) /\<^sub>R 2) \<bullet> (if i < length Basis_list then the (map_of (zip [0..<length Basis_list] Basis_list) i) else (0::'a)) / (((u - l) /\<^sub>R 2) \<bullet> (if i < length Basis_list then the (map_of (zip [0..<length Basis_list] Basis_list) i) else (0::'a)))) \<in> UNIV \<rightarrow> {- 1..1}
[PROOF STEP]
by (intro Pi_I divide_atLeastAtMost_1_absI)
      (auto simp: map_of_zip_upto_length_eq_nth eucl_le[where 'a='a]
        divide_le_eq_1 not_less inner_Basis algebra_simps intro!: midpoint_abs
        dest!: nth_mem)
[PROOF STATE]
proof (state)
this:
e \<in> UNIV \<rightarrow> {- 1..1}

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
k = aform_val e (aform_of_ivl l u)
e \<in> UNIV \<rightarrow> {- 1..1}
[PROOF STEP]
show "\<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)"
[PROOF STATE]
proof (prove)
using this:
k = aform_val e (aform_of_ivl l u)
e \<in> UNIV \<rightarrow> {- 1..1}

goal (1 subgoal):
 1. \<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>e. e \<in> UNIV \<rightarrow> {- 1..1} \<and> k = aform_val e (aform_of_ivl l u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dimension_independent [intro]: "independent K Us \<Longrightarrow> dimension (length Us) K (Span K Us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.independent K Us \<Longrightarrow> dimension (length Us) K (Span K Us)
[PROOF STEP]
proof (induct Us)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. local.independent K [] \<Longrightarrow> dimension (length []) K (Span K [])
 2. \<And>a Us. \<lbrakk>local.independent K Us \<Longrightarrow> dimension (length Us) K (Span K Us); local.independent K (a # Us)\<rbrakk> \<Longrightarrow> dimension (length (a # Us)) K (Span K (a # Us))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
local.independent K []

goal (2 subgoals):
 1. local.independent K [] \<Longrightarrow> dimension (length []) K (Span K [])
 2. \<And>a Us. \<lbrakk>local.independent K Us \<Longrightarrow> dimension (length Us) K (Span K Us); local.independent K (a # Us)\<rbrakk> \<Longrightarrow> dimension (length (a # Us)) K (Span K (a # Us))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
local.independent K []

goal (1 subgoal):
 1. dimension (length []) K (Span K [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dimension (length []) K (Span K [])

goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>local.independent K Us \<Longrightarrow> dimension (length Us) K (Span K Us); local.independent K (a # Us)\<rbrakk> \<Longrightarrow> dimension (length (a # Us)) K (Span K (a # Us))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>local.independent K Us \<Longrightarrow> dimension (length Us) K (Span K Us); local.independent K (a # Us)\<rbrakk> \<Longrightarrow> dimension (length (a # Us)) K (Span K (a # Us))
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
local.independent K Us_ \<Longrightarrow> dimension (length Us_) K (Span K Us_)
local.independent K (a_ # Us_)

goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>local.independent K Us \<Longrightarrow> dimension (length Us) K (Span K Us); local.independent K (a # Us)\<rbrakk> \<Longrightarrow> dimension (length (a # Us)) K (Span K (a # Us))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
local.independent K Us_ \<Longrightarrow> dimension (length Us_) K (Span K Us_)
local.independent K (a_ # Us_)

goal (1 subgoal):
 1. dimension (length (a_ # Us_)) K (Span K (a_ # Us_))
[PROOF STEP]
using Suc_dim independent_backwards[OF Cons(2)]
[PROOF STATE]
proof (prove)
using this:
local.independent K Us_ \<Longrightarrow> dimension (length Us_) K (Span K Us_)
local.independent K (a_ # Us_)
\<lbrakk>?v \<in> carrier R; ?v \<notin> ?E; dimension ?n ?K ?E\<rbrakk> \<Longrightarrow> dimension (Suc ?n) ?K (line_extension ?K ?v ?E)
a_ \<notin> Span K Us_
local.independent K Us_
a_ \<in> carrier R

goal (1 subgoal):
 1. dimension (length (a_ # Us_)) K (Span K (a_ # Us_))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dimension (length (a_ # Us_)) K (Span K (a_ # Us_))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subgraphs_finite:
  assumes "finite_graph G"
  shows "finite (subgraphs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subgraphs G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (subgraphs G)
[PROOF STEP]
have "subgraphs G = {(V', E'). V' \<subseteq> uverts G \<and> E' \<subseteq> uedges G}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraphs G = {(V', E'). V' \<subseteq> uverts G \<and> E' \<subseteq> uedges G}
[PROOF STEP]
unfolding subgraphs_def subgraph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {G'. uverts G' \<subseteq> uverts G \<and> uedges G' \<subseteq> uedges G} = {(V', E'). V' \<subseteq> uverts G \<and> E' \<subseteq> uedges G}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
subgraphs G = {(V', E'). V' \<subseteq> uverts G \<and> E' \<subseteq> uedges G}

goal (1 subgoal):
 1. finite (subgraphs G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subgraphs G = {(V', E'). V' \<subseteq> uverts G \<and> E' \<subseteq> uedges G}

goal (1 subgoal):
 1. finite (subgraphs G)
[PROOF STEP]
have "finite (uverts G)" "finite (uedges G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (uverts G) &&& finite (uedges G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_graph G

goal (1 subgoal):
 1. finite (uverts G) &&& finite (uedges G)
[PROOF STEP]
unfolding finite_graph_def
[PROOF STATE]
proof (prove)
using this:
finite (uverts G) \<and> finite (uedges G)

goal (1 subgoal):
 1. finite (uverts G) &&& finite (uedges G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (uverts G)
finite (uedges G)

goal (1 subgoal):
 1. finite (subgraphs G)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subgraphs G = {(V', E'). V' \<subseteq> uverts G \<and> E' \<subseteq> uedges G}
finite (uverts G)
finite (uedges G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subgraphs G = {(V', E'). V' \<subseteq> uverts G \<and> E' \<subseteq> uedges G}
finite (uverts G)
finite (uedges G)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compare_expansions_EQ_imp_bigo:
  assumes "compare_expansions F G = (EQ, c, c')" "trimmed G"
          "(f expands_to F) basis" "(g expands_to G) basis" "basis_wf basis"
  shows   "f \<in> O(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
compare_expansions F G = (EQ, c, c')
[PROOF STEP]
have c: "c = fst (dominant_term F)" "c' = fst (dominant_term G)"
[PROOF STATE]
proof (prove)
using this:
compare_expansions F G = (EQ, c, c')

goal (1 subgoal):
 1. c = fst (dominant_term F) &&& c' = fst (dominant_term G)
[PROOF STEP]
by (auto simp: compare_expansions_def split: cmp_result.splits)
[PROOF STATE]
proof (state)
this:
c = fst (dominant_term F)
c' = fst (dominant_term G)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
(f expands_to F) basis
[PROOF STEP]
have [simp]: "expansion_level TYPE('a) = length basis"
[PROOF STATE]
proof (prove)
using this:
(f expands_to F) basis

goal (1 subgoal):
 1. expansion_level TYPE('a) = length basis
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_length)
[PROOF STATE]
proof (state)
this:
expansion_level TYPE('a) = length basis

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
have "f \<in> \<Theta>(eval F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<Theta>(eval F)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compare_expansions F G = (EQ, c, c')
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis

goal (1 subgoal):
 1. f \<in> \<Theta>(eval F)
[PROOF STEP]
by (intro bigthetaI_cong) (auto simp: expands_to.simps eq_commute)
[PROOF STATE]
proof (state)
this:
f \<in> \<Theta>(eval F)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f \<in> \<Theta>(eval F)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
have "eval F \<in> O(eval_monom (1, snd (dominant_term F)) basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F \<in> O(eval_monom (1, snd (dominant_term F)) basis)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compare_expansions F G = (EQ, c, c')
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis

goal (1 subgoal):
 1. eval F \<in> O(eval_monom (1, snd (dominant_term F)) basis)
[PROOF STEP]
by (intro dominant_term_bigo assms) (auto simp: expands_to.simps)
[PROOF STATE]
proof (state)
this:
eval F \<in> O(eval_monom (1, snd (dominant_term F)) basis)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval F \<in> O(eval_monom (1, snd (dominant_term F)) basis)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
have "eval_monom (1, snd (dominant_term F)) basis =
               eval_monom (1, snd (dominant_term G)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_monom (1, snd (dominant_term F)) basis = eval_monom (1, snd (dominant_term G)) basis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compare_expansions F G = (EQ, c, c')
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis

goal (1 subgoal):
 1. eval_monom (1, snd (dominant_term F)) basis = eval_monom (1, snd (dominant_term G)) basis
[PROOF STEP]
by (intro eval_monom_eq) (auto simp: compare_expansions_def case_prod_unfold
                                length_dominant_term split: cmp_result.splits)
[PROOF STATE]
proof (state)
this:
eval_monom (1, snd (dominant_term F)) basis = eval_monom (1, snd (dominant_term G)) basis

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval_monom (1, snd (dominant_term F)) basis = eval_monom (1, snd (dominant_term G)) basis

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
have "\<dots> \<in> O(eval_monom (dominant_term G) basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_monom (1, snd (dominant_term G)) basis \<in> O(eval_monom (dominant_term G) basis)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
trimmed G

goal (1 subgoal):
 1. eval_monom (1, snd (dominant_term G)) basis \<in> O(eval_monom (dominant_term G) basis)
[PROOF STEP]
by (auto simp add: eval_monom_def case_prod_unfold dest: trimmed_imp_dominant_term_nz)
[PROOF STATE]
proof (state)
this:
eval_monom (1, snd (dominant_term G)) basis \<in> O(eval_monom (dominant_term G) basis)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval_monom (1, snd (dominant_term G)) basis \<in> O(eval_monom (dominant_term G) basis)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
have "eval_monom (dominant_term G) basis \<in> \<Theta>(eval G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_monom (dominant_term G) basis \<in> \<Theta>(eval G)
[PROOF STEP]
by (rule asymp_equiv_imp_bigtheta, rule asymp_equiv_symI, rule dominant_term)
       (insert assms, auto simp: expands_to.simps)
[PROOF STATE]
proof (state)
this:
eval_monom (dominant_term G) basis \<in> \<Theta>(eval G)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval_monom (dominant_term G) basis \<in> \<Theta>(eval G)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
have "eval G \<in> \<Theta>(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval G \<in> \<Theta>(g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compare_expansions F G = (EQ, c, c')
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis

goal (1 subgoal):
 1. eval G \<in> \<Theta>(g)
[PROOF STEP]
by (intro bigthetaI_cong) (auto simp: expands_to.simps)
[PROOF STATE]
proof (state)
this:
eval G \<in> \<Theta>(g)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f \<in> O(g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> O(g)

goal (1 subgoal):
 1. f \<in> O(g)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f \<in> O(g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interior_image_subset:
  assumes "inj f" "\<And>x. continuous (at x) f"
  shows "interior (f ` S) \<subseteq> f ` (interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (f ` S) \<subseteq> f ` interior S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
assume "x \<in> interior (f ` S)"
[PROOF STATE]
proof (state)
this:
x \<in> interior (f ` S)

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> interior (f ` S)
[PROOF STEP]
obtain T where as: "open T" "x \<in> T" "T \<subseteq> f ` S"
[PROOF STATE]
proof (prove)
using this:
x \<in> interior (f ` S)

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>open T; x \<in> T; T \<subseteq> f ` S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
open T
x \<in> T
T \<subseteq> f ` S

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open T
x \<in> T
T \<subseteq> f ` S
[PROOF STEP]
have "x \<in> f ` S"
[PROOF STATE]
proof (prove)
using this:
open T
x \<in> T
T \<subseteq> f ` S

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

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> f ` S
[PROOF STEP]
obtain y where y: "y \<in> S" "x = f y"
[PROOF STATE]
proof (prove)
using this:
x \<in> f ` S

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

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
have "open (f -` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f -` T)
[PROOF STEP]
using assms \<open>open T\<close>
[PROOF STATE]
proof (prove)
using this:
inj f
isCont f ?x
open T

goal (1 subgoal):
 1. open (f -` T)
[PROOF STEP]
by (simp add: continuous_at_imp_continuous_on open_vimage)
[PROOF STATE]
proof (state)
this:
open (f -` T)

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
open (f -` T)

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
have "y \<in> vimage f T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> f -` T
[PROOF STEP]
using \<open>x = f y\<close> \<open>x \<in> T\<close>
[PROOF STATE]
proof (prove)
using this:
x = f y
x \<in> T

goal (1 subgoal):
 1. y \<in> f -` T
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<in> f -` T

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y \<in> f -` T

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
have "vimage f T \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` T \<subseteq> S
[PROOF STEP]
using \<open>T \<subseteq> image f S\<close> \<open>inj f\<close>
[PROOF STATE]
proof (prove)
using this:
T \<subseteq> f ` S
inj f

goal (1 subgoal):
 1. f -` T \<subseteq> S
[PROOF STEP]
unfolding inj_on_def subset_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>T. x \<in> f ` S
\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. f x = f y \<longrightarrow> x = y

goal (1 subgoal):
 1. \<forall>x\<in>f -` T. x \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f -` T \<subseteq> S

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
open (f -` T)
y \<in> f -` T
f -` T \<subseteq> S
[PROOF STEP]
have "y \<in> interior S"
[PROOF STATE]
proof (prove)
using this:
open (f -` T)
y \<in> f -` T
f -` T \<subseteq> S

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

goal (1 subgoal):
 1. \<And>x. x \<in> interior (f ` S) \<Longrightarrow> x \<in> f ` interior S
[PROOF STEP]
with \<open>x = f y\<close>
[PROOF STATE]
proof (chain)
picking this:
x = f y
y \<in> interior S
[PROOF STEP]
show "x \<in> f ` interior S"
[PROOF STATE]
proof (prove)
using this:
x = f y
y \<in> interior S

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subtree_elem_count_l:
  assumes "\<forall>x\<in># (relations_mset (Join l r)). count (relations_mset (Join l r)) x = 1"
      and "x \<in># relations_mset l"
    shows "count (relations_mset l) x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (relations_mset l) x = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. count (relations_mset l) x = 1
[PROOF STEP]
have 0: "count (relations_mset l) x \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> count (relations_mset l) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>#relations_mset (Join l r). count (relations_mset (Join l r)) x = 1
x \<in># relations_mset l

goal (1 subgoal):
 1. 1 \<le> count (relations_mset l) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> count (relations_mset l) x

goal (1 subgoal):
 1. count (relations_mset l) x = 1
[PROOF STEP]
have "count (relations_mset l) x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (relations_mset l) x \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>#relations_mset (Join l r). count (relations_mset (Join l r)) x = 1
x \<in># relations_mset l

goal (1 subgoal):
 1. count (relations_mset l) x \<le> 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
count (relations_mset l) x \<le> 1

goal (1 subgoal):
 1. count (relations_mset l) x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count (relations_mset l) x \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
count (relations_mset l) x \<le> 1

goal (1 subgoal):
 1. count (relations_mset l) x = 1
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
count (relations_mset l) x \<le> 1
1 \<le> count (relations_mset l) x

goal (1 subgoal):
 1. count (relations_mset l) x = 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
count (relations_mset l) x = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_ereal_realD:
  fixes f :: "'a \<Rightarrow> ereal"
  assumes "x \<noteq> 0"
    and tendsto: "((\<lambda>x. ereal (real_of_ereal (f x))) \<longlongrightarrow> x) net"
  shows "(f \<longlongrightarrow> x) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> x) net
[PROOF STEP]
proof (intro topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in net. f x \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in net. f x \<in> S
[PROOF STEP]
assume S: "open S" "x \<in> S"
[PROOF STATE]
proof (state)
this:
open S
x \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in net. f x \<in> S
[PROOF STEP]
with \<open>x \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
open S
x \<in> S
[PROOF STEP]
have "open (S - {0})" "x \<in> S - {0}"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0
open S
x \<in> S

goal (1 subgoal):
 1. open (S - {0}) &&& x \<in> S - {0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open (S - {0})
x \<in> S - {0}

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in net. f x \<in> S
[PROOF STEP]
from tendsto[THEN topological_tendstoD, OF this]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in net. ereal (real_of_ereal (f x)) \<in> S - {0}
[PROOF STEP]
show "eventually (\<lambda>x. f x \<in> S) net"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in net. ereal (real_of_ereal (f x)) \<in> S - {0}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in net. f x \<in> S
[PROOF STEP]
by (rule eventually_rev_mp) (auto simp: ereal_real)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in net. f x \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_sorted_edge_distinct:
  assumes "finite S"
  obtains L where "distinct L" "sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L" "S = set L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>L. \<lbrakk>distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L; S = set L\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>L. \<lbrakk>distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L; S = set L\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>L. \<lbrakk>distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L; S = set L\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>L.  distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> S = set L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> S = set L
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. \<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> S = set L
[PROOF STEP]
apply(induct S)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> {} = set L
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> F = set L\<rbrakk> \<Longrightarrow> \<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> insert x F = set L
[PROOF STEP]
apply(clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> F = set L\<rbrakk> \<Longrightarrow> \<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> insert x F = set L
[PROOF STEP]
apply(clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x L. \<lbrakk>x \<notin> set L; distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L\<rbrakk> \<Longrightarrow> \<exists>La. distinct La \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) La \<and> insert x (set L) = set La
[PROOF STEP]
subgoal for x L
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> set L; distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L\<rbrakk> \<Longrightarrow> \<exists>La. distinct La \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) La \<and> insert x (set L) = set La
[PROOF STEP]
apply(rule exI[where x="in_sort_edge x L"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> set L; distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L\<rbrakk> \<Longrightarrow> distinct (in_sort_edge x L) \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) (in_sort_edge x L) \<and> insert x (set L) = set (in_sort_edge x L)
[PROOF STEP]
by (auto simp: in_sort_edge in_sort_edge_distinct)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> S = set L

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L; S = set L\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> S = set L

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>distinct L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L; S = set L\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>distinct ?L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) ?L; S = set ?L\<rbrakk> \<Longrightarrow> thesis
\<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> S = set L
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct ?L; sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) ?L; S = set ?L\<rbrakk> \<Longrightarrow> thesis
\<exists>L. distinct L \<and> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<and> S = set L

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dghm_proj_fst_ArrMap_app[dg_cs_simps]:
  assumes "[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
  shows "\<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>1 \<AA> \<BB>\<lparr>ArrMap\<rparr>\<lparr>g, f\<rparr>\<^sub>\<bullet> = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>1 \<AA> \<BB>\<lparr>ArrMap\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet> = g
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>1 \<AA> \<BB>\<lparr>ArrMap\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet> = g
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
have "[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = 0 then \<AA> else \<BB>)\<lparr>Arr\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. [g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)
[PROOF STEP]
unfolding dg_prod_2_def dg_prod_components
[PROOF STATE]
proof (prove)
using this:
[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)

goal (1 subgoal):
 1. [g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)

goal (1 subgoal):
 1. \<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>1 \<AA> \<BB>\<lparr>ArrMap\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet> = g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)
[PROOF STEP]
show "\<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>1 \<AA> \<BB>\<lparr>ArrMap\<rparr>\<lparr>g, f\<rparr>\<^sub>\<bullet> = g"
[PROOF STATE]
proof (prove)
using this:
[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)

goal (1 subgoal):
 1. \<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>1 \<AA> \<BB>\<lparr>ArrMap\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet> = g
[PROOF STEP]
unfolding dghm_proj_fst_def dghm_proj_components dg_prod_components
[PROOF STATE]
proof (prove)
using this:
[g, f]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)

goal (1 subgoal):
 1. (\<lambda>f\<in>\<^sub>\<circ>\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>. f\<lparr>[]\<^sub>\<circ>\<rparr>) \<lparr>g, f\<rparr>\<^sub>\<bullet> = g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>1 \<AA> \<BB>\<lparr>ArrMap\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet> = g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_rev: "\<lbrakk> distinct xs; x \<in> set xs \<rbrakk> \<Longrightarrow>
  index (rev xs) x = length xs - index xs x - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; x \<in> set xs\<rbrakk> \<Longrightarrow> index (rev xs) x = length xs - index xs x - 1
[PROOF STEP]
by (induct xs) (auto simp: index_append)


[STATEMENT]
lemma min_per_len_diff: "min_period w = \<^bold>|w\<^bold>| - \<^bold>|max_border w\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_period w = \<^bold>|w\<^bold>| - \<^bold>|max_border w\<^bold>|
[PROOF STEP]
unfolding min_period_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>|\<pi> w\<^bold>| = \<^bold>|w\<^bold>| - \<^bold>|max_border w\<^bold>|
[PROOF STEP]
using lenarg[OF min_per_max_border,unfolded lenmorph,of w]
[PROOF STATE]
proof (prove)
using this:
\<^bold>|\<pi> w\<^bold>| + \<^bold>|max_border w\<^bold>| = \<^bold>|w\<^bold>|

goal (1 subgoal):
 1. \<^bold>|\<pi> w\<^bold>| = \<^bold>|w\<^bold>| - \<^bold>|max_border w\<^bold>|
[PROOF STEP]
by linarith


[STATEMENT]
lemma prv_eqv_neg_prv_fls:
  "\<phi> \<in> fmla \<Longrightarrow>
prv (eqv \<phi> (neg \<phi>)) \<Longrightarrow> prv fls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; prv (eqv \<phi> (neg \<phi>))\<rbrakk> \<Longrightarrow> prv fls
[PROOF STEP]
by (metis cnj fls neg neg_def prv_cnj_imp_monoR2 prv_eqv_imp_transi prv_imp_cnj prv_imp_eqvER prv_imp_mp prv_imp_neg_rev)


[STATEMENT]
theorem n_sequence_enum_distinct:
  "distinct xs \<Longrightarrow> distinct (n_sequence_enum xs n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> distinct (n_sequence_enum xs n)
[PROOF STEP]
by (induct n) (auto simp: Cons_distinct_concat_map)


[STATEMENT]
lemma lepoll_trans [trans]: "\<lbrakk>A \<lesssim> B; B \<lesssim> C\<rbrakk> \<Longrightarrow> A \<lesssim> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<lesssim> B; B \<lesssim> C\<rbrakk> \<Longrightarrow> A \<lesssim> C
[PROOF STEP]
apply (clarsimp simp: lepoll_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f fa. \<lbrakk>inj_on f A; f ` A \<subseteq> B; inj_on fa B; fa ` B \<subseteq> C\<rbrakk> \<Longrightarrow> \<exists>f. inj_on f A \<and> f ` A \<subseteq> C
[PROOF STEP]
apply (rename_tac f g)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>inj_on f A; f ` A \<subseteq> B; inj_on g B; g ` B \<subseteq> C\<rbrakk> \<Longrightarrow> \<exists>f. inj_on f A \<and> f ` A \<subseteq> C
[PROOF STEP]
apply (rule_tac x="g \<circ> f" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>inj_on f A; f ` A \<subseteq> B; inj_on g B; g ` B \<subseteq> C\<rbrakk> \<Longrightarrow> inj_on (g \<circ> f) A \<and> (g \<circ> f) ` A \<subseteq> C
[PROOF STEP]
apply (auto simp: image_subset_iff inj_on_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma supp_list_append:
  fixes xs :: "'a list"
  and   ys :: "'a list"
  shows "supp (xs@ys) = (supp xs)\<union>(supp ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (xs @ ys) = supp xs \<union> supp ys
[PROOF STEP]
by (induct xs) (auto simp add: supp_list_nil supp_list_cons)


[STATEMENT]
lemma (in abelian_group) a_l_coset_swap:
     "\<lbrakk>y \<in> x <+ H;  x \<in> carrier G;  subgroup H (add_monoid G)\<rbrakk> \<Longrightarrow> x \<in> y <+ H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> x <+ H; x \<in> carrier G; subgroup H (add_monoid G)\<rbrakk> \<Longrightarrow> x \<in> y <+ H
[PROOF STEP]
by (rule group.l_coset_swap [OF a_group,
    folded a_l_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma finite_vimage_Suc_iff: "finite (Suc -` F) \<longleftrightarrow> finite F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Suc -` F) = finite F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (Suc -` F) \<Longrightarrow> finite F
 2. finite F \<Longrightarrow> finite (Suc -` F)
[PROOF STEP]
have "F \<subseteq> insert 0 (Suc ` Suc -` F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<subseteq> insert 0 (Suc ` Suc -` F)
[PROOF STEP]
using nat.nchotomy
[PROOF STATE]
proof (prove)
using this:
\<forall>nat. nat = 0 \<or> (\<exists>x2. nat = Suc x2)

goal (1 subgoal):
 1. F \<subseteq> insert 0 (Suc ` Suc -` F)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
F \<subseteq> insert 0 (Suc ` Suc -` F)

goal (2 subgoals):
 1. finite (Suc -` F) \<Longrightarrow> finite F
 2. finite F \<Longrightarrow> finite (Suc -` F)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
F \<subseteq> insert 0 (Suc ` Suc -` F)

goal (2 subgoals):
 1. finite (Suc -` F) \<Longrightarrow> finite F
 2. finite F \<Longrightarrow> finite (Suc -` F)
[PROOF STEP]
assume "finite (Suc -` F)"
[PROOF STATE]
proof (state)
this:
finite (Suc -` F)

goal (2 subgoals):
 1. finite (Suc -` F) \<Longrightarrow> finite F
 2. finite F \<Longrightarrow> finite (Suc -` F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (Suc -` F)
[PROOF STEP]
have "finite (insert 0 (Suc ` Suc -` F))"
[PROOF STATE]
proof (prove)
using this:
finite (Suc -` F)

goal (1 subgoal):
 1. finite (insert 0 (Suc ` Suc -` F))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (insert 0 (Suc ` Suc -` F))

goal (2 subgoals):
 1. finite (Suc -` F) \<Longrightarrow> finite F
 2. finite F \<Longrightarrow> finite (Suc -` F)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
F \<subseteq> insert 0 (Suc ` Suc -` F)
finite (insert 0 (Suc ` Suc -` F))
[PROOF STEP]
show "finite F"
[PROOF STATE]
proof (prove)
using this:
F \<subseteq> insert 0 (Suc ` Suc -` F)
finite (insert 0 (Suc ` Suc -` F))

goal (1 subgoal):
 1. finite F
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
F \<subseteq> insert 0 (Suc ` Suc -` F)
finite (insert 0 (Suc ` Suc -` F))
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite F

goal (1 subgoal):
 1. finite F \<Longrightarrow> finite (Suc -` F)
[PROOF STEP]
qed (force intro: finite_vimageI inj_Suc)


[STATEMENT]
lemma Mertens_convergent: "convergent (\<lambda>n::nat. \<MM> n - ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>x. \<MM> (real x) - ln (real x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent (\<lambda>x. \<MM> (real x) - ln (real x))
[PROOF STEP]
obtain c where c: "summable (\<lambda>n. (\<MM> n - ln n + c) / n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. summable (\<lambda>x. (\<MM> (real x) - ln (real x) + c) / real x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: mertens_summable)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>x. (\<MM> (real x) - ln (real x) + c) / real x)

goal (1 subgoal):
 1. convergent (\<lambda>x. \<MM> (real x) - ln (real x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>x. (\<MM> (real x) - ln (real x) + c) / real x)
[PROOF STEP]
obtain l where l: "(\<lambda>n. (\<MM> n - ln n + c) / n) sums l"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>x. (\<MM> (real x) - ln (real x) + c) / real x)

goal (1 subgoal):
 1. (\<And>l. (\<lambda>x. (\<MM> (real x) - ln (real x) + c) / real x) sums l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: summable_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (\<MM> (real x) - ln (real x) + c) / real x) sums l

goal (1 subgoal):
 1. convergent (\<lambda>x. \<MM> (real x) - ln (real x))
[PROOF STEP]
have *: "(\<lambda>n. \<MM> n - ln n + c) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<MM> (real x) - ln (real x) + c) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule sum_goestozero_theorem[OF c]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<MM> (real x) - ln (real x) + c) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. convergent (\<lambda>x. \<MM> (real x) - ln (real x))
[PROOF STEP]
hence "(\<lambda>n. \<MM> n - ln n) \<longlonglongrightarrow> -c"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<MM> (real x) - ln (real x) + c) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>x. \<MM> (real x) - ln (real x)) \<longlonglongrightarrow> - c
[PROOF STEP]
by (simp add: tendsto_iff dist_norm)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<MM> (real x) - ln (real x)) \<longlonglongrightarrow> - c

goal (1 subgoal):
 1. convergent (\<lambda>x. \<MM> (real x) - ln (real x))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<MM> (real x) - ln (real x)) \<longlonglongrightarrow> - c

goal (1 subgoal):
 1. convergent (\<lambda>x. \<MM> (real x) - ln (real x))
[PROOF STEP]
by (rule convergentI)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>x. \<MM> (real x) - ln (real x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homotopy_eqv_separation:
  fixes S :: "'a::euclidean_space set" and T :: "'a set"
  assumes "S homotopy_eqv T" and "compact S" and "compact T"
  shows "connected(- S) \<longleftrightarrow> connected(- T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (- S) = connected (- T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. connected (- S) = connected (- T)
[PROOF STEP]
consider "DIM('a) = 1" | "2 \<le> DIM('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>DIM('a) = 1 \<Longrightarrow> thesis; 2 \<le> DIM('a) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (metis DIM_ge_Suc0 One_nat_def Suc_1 dual_order.antisym not_less_eq_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>DIM('a) = 1 \<Longrightarrow> ?thesis; 2 \<le> DIM('a) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. connected (- S) = connected (- T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>DIM('a) = 1 \<Longrightarrow> ?thesis; 2 \<le> DIM('a) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>DIM('a) = 1 \<Longrightarrow> ?thesis; 2 \<le> DIM('a) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. connected (- S) = connected (- T)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. DIM('a) = 1 \<Longrightarrow> connected (- S) = connected (- T)
 2. 2 \<le> DIM('a) \<Longrightarrow> connected (- S) = connected (- T)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
DIM('a) = 1

goal (2 subgoals):
 1. DIM('a) = 1 \<Longrightarrow> connected (- S) = connected (- T)
 2. 2 \<le> DIM('a) \<Longrightarrow> connected (- S) = connected (- T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
DIM('a) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
DIM('a) = 1

goal (1 subgoal):
 1. connected (- S) = connected (- T)
[PROOF STEP]
using bounded_connected_Compl_1 compact_imp_bounded homotopy_eqv_empty1 homotopy_eqv_empty2 assms
[PROOF STATE]
proof (prove)
using this:
DIM('a) = 1
\<lbrakk>bounded ?S; connected (- ?S); DIM(?'a) = 1\<rbrakk> \<Longrightarrow> ?S = {}
compact ?U \<Longrightarrow> bounded ?U
(?S homotopy_eqv {}) = (?S = {})
({} homotopy_eqv ?S) = (?S = {})
S homotopy_eqv T
compact S
compact T

goal (1 subgoal):
 1. connected (- S) = connected (- T)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
connected (- S) = connected (- T)

goal (1 subgoal):
 1. 2 \<le> DIM('a) \<Longrightarrow> connected (- S) = connected (- T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 \<le> DIM('a) \<Longrightarrow> connected (- S) = connected (- T)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
2 \<le> DIM('a)

goal (1 subgoal):
 1. 2 \<le> DIM('a) \<Longrightarrow> connected (- S) = connected (- T)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
S homotopy_eqv T
compact S
compact T
2 \<le> DIM('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S homotopy_eqv T
compact S
compact T
2 \<le> DIM('a)

goal (1 subgoal):
 1. connected (- S) = connected (- T)
[PROOF STEP]
by (simp add: Borsuk_separation_theorem homotopy_eqv_cohomotopic_triviality_null)
[PROOF STATE]
proof (state)
this:
connected (- S) = connected (- T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
connected (- S) = connected (- T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_eq_set_of_iff: "X = Y \<longleftrightarrow> set_of X = set_of Y" for X Y::"'a::order interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X = Y) = (set_of X = set_of Y)
[PROOF STEP]
by (auto simp: set_of_eq interval_eq_iff)


[STATEMENT]
lemma of_nat_0 [simp]: "\<guillemotleft>0\<guillemotright>\<^sub>\<nat> = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>0\<guillemotright>\<^sub>\<nat> = \<zero>
[PROOF STEP]
by (simp add: of_natural_def)


[STATEMENT]
lemma LIM_offset_zero: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>h. f (a + h)) \<midarrow>0\<rightarrow> L"
  for a :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>h. f (a + h)) \<midarrow>0::'a\<rightarrow> L
[PROOF STEP]
by (drule LIM_offset [where k = a]) (simp add: add.commute)


[STATEMENT]
lemma image_replicate_mset [simp]:
  "image_mset f (replicate_mset n a) = replicate_mset n (f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (replicate_mset n a) = replicate_mset n (f a)
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma hausdorff_distanceI2:
  assumes "\<And>x. x \<in> A \<Longrightarrow> \<exists>y\<in>B. dist x y \<le> D"
          "\<And>x. x \<in> B \<Longrightarrow> \<exists>y\<in>A. dist x y \<le> D"
          "D \<ge> 0"
  shows "hausdorff_distance A B \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance A B \<le> D
[PROOF STEP]
proof (rule hausdorff_distanceI[OF _ _ \<open>D \<ge> 0\<close>])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> infdist x B \<le> D
 2. \<And>x. x \<in> B \<Longrightarrow> infdist x A \<le> D
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> infdist x B \<le> D
 2. \<And>x. x \<in> B \<Longrightarrow> infdist x A \<le> D
[PROOF STEP]
assume "x \<in> A"
[PROOF STATE]
proof (state)
this:
x \<in> A

goal (2 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> infdist x B \<le> D
 2. \<And>x. x \<in> B \<Longrightarrow> infdist x A \<le> D
[PROOF STEP]
show "infdist x B \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x B \<le> D
[PROOF STEP]
using assms(1)[OF \<open>x \<in> A\<close>] infdist_le2
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>B. dist x y \<le> D
\<lbrakk>?a \<in> ?A; dist ?x ?a \<le> ?d\<rbrakk> \<Longrightarrow> infdist ?x ?A \<le> ?d

goal (1 subgoal):
 1. infdist x B \<le> D
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
infdist x B \<le> D

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> infdist x A \<le> D
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> infdist x A \<le> D
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> infdist x A \<le> D
[PROOF STEP]
assume "x \<in> B"
[PROOF STATE]
proof (state)
this:
x \<in> B

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> infdist x A \<le> D
[PROOF STEP]
show "infdist x A \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x A \<le> D
[PROOF STEP]
using assms(2)[OF \<open>x \<in> B\<close>] infdist_le2
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>A. dist x y \<le> D
\<lbrakk>?a \<in> ?A; dist ?x ?a \<le> ?d\<rbrakk> \<Longrightarrow> infdist ?x ?A \<le> ?d

goal (1 subgoal):
 1. infdist x A \<le> D
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
infdist x A \<le> D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gcd_int_nonpos_iff [simp]: "gcd x (y :: int) \<le> 0 \<longleftrightarrow> x = 0 \<and> y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (gcd x y \<le> 0) = (x = 0 \<and> y = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. gcd x y \<le> 0 \<Longrightarrow> x = 0 \<and> y = 0
 2. x = 0 \<and> y = 0 \<Longrightarrow> gcd x y \<le> 0
[PROOF STEP]
assume "gcd x y \<le> 0"
[PROOF STATE]
proof (state)
this:
gcd x y \<le> 0

goal (2 subgoals):
 1. gcd x y \<le> 0 \<Longrightarrow> x = 0 \<and> y = 0
 2. x = 0 \<and> y = 0 \<Longrightarrow> gcd x y \<le> 0
[PROOF STEP]
with gcd_ge_0_int[of x y]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> gcd x y
gcd x y \<le> 0
[PROOF STEP]
have "gcd x y = 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> gcd x y
gcd x y \<le> 0

goal (1 subgoal):
 1. gcd x y = 0
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
gcd x y = 0

goal (2 subgoals):
 1. gcd x y \<le> 0 \<Longrightarrow> x = 0 \<and> y = 0
 2. x = 0 \<and> y = 0 \<Longrightarrow> gcd x y \<le> 0
[PROOF STEP]
thus "x = 0 \<and> y = 0"
[PROOF STATE]
proof (prove)
using this:
gcd x y = 0

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

goal (1 subgoal):
 1. x = 0 \<and> y = 0 \<Longrightarrow> gcd x y \<le> 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma listrel1_eq_len: "(xs,ys) \<in> listrel1 r \<Longrightarrow> length xs = length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> listrel1 r \<Longrightarrow> length xs = length ys
[PROOF STEP]
unfolding listrel1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> {(xs, ys). \<exists>us z z' vs. xs = us @ z # vs \<and> (z, z') \<in> r \<and> ys = us @ z' # vs} \<Longrightarrow> length xs = length ys
[PROOF STEP]
by auto


[STATEMENT]
lemma subset_PiE:
   "PiE I S \<subseteq> PiE I T \<longleftrightarrow> PiE I S = {} \<or> (\<forall>i \<in> I. S i \<subseteq> T i)" (is "?lhs \<longleftrightarrow> _ \<or> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
[PROOF STEP]
proof (cases "PiE I S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Pi\<^sub>E I S = {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
 2. Pi\<^sub>E I S \<noteq> {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E I S \<noteq> {}

goal (2 subgoals):
 1. Pi\<^sub>E I S = {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
 2. Pi\<^sub>E I S \<noteq> {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E I S \<noteq> {}

goal (2 subgoals):
 1. Pi\<^sub>E I S = {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
 2. Pi\<^sub>E I S \<noteq> {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
[PROOF STEP]
have "?lhs = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (\<forall>i\<in>I. S i \<subseteq> T i)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T \<Longrightarrow> \<forall>i\<in>I. S i \<subseteq> T i
 2. \<forall>i\<in>I. S i \<subseteq> T i \<Longrightarrow> Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T

goal (2 subgoals):
 1. Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T \<Longrightarrow> \<forall>i\<in>I. S i \<subseteq> T i
 2. \<forall>i\<in>I. S i \<subseteq> T i \<Longrightarrow> Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T
[PROOF STEP]
have "\<And>i. i\<in>I \<Longrightarrow> S i \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> S i \<noteq> {}
[PROOF STEP]
using False PiE_eq_empty_iff
[PROOF STATE]
proof (prove)
using this:
Pi\<^sub>E I S \<noteq> {}
(Pi\<^sub>E ?I ?F = {}) = (\<exists>i\<in>?I. ?F i = {})

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> S i \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> S ?i \<noteq> {}

goal (2 subgoals):
 1. Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T \<Longrightarrow> \<forall>i\<in>I. S i \<subseteq> T i
 2. \<forall>i\<in>I. S i \<subseteq> T i \<Longrightarrow> Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T
[PROOF STEP]
with L
[PROOF STATE]
proof (chain)
picking this:
Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T
?i \<in> I \<Longrightarrow> S ?i \<noteq> {}
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T
?i \<in> I \<Longrightarrow> S ?i \<noteq> {}

goal (1 subgoal):
 1. \<forall>i\<in>I. S i \<subseteq> T i
[PROOF STEP]
by (simp add: PiE_Int PiE_eq_iff inf.absorb_iff2)
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. S i \<subseteq> T i

goal (1 subgoal):
 1. \<forall>i\<in>I. S i \<subseteq> T i \<Longrightarrow> Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (\<forall>i\<in>I. S i \<subseteq> T i)

goal (2 subgoals):
 1. Pi\<^sub>E I S = {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
 2. Pi\<^sub>E I S \<noteq> {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Pi\<^sub>E I S \<noteq> {}
(Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (\<forall>i\<in>I. S i \<subseteq> T i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Pi\<^sub>E I S \<noteq> {}
(Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (\<forall>i\<in>I. S i \<subseteq> T i)

goal (1 subgoal):
 1. (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))

goal (1 subgoal):
 1. Pi\<^sub>E I S = {} \<Longrightarrow> (Pi\<^sub>E I S \<subseteq> Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<or> (\<forall>i\<in>I. S i \<subseteq> T i))
[PROOF STEP]
qed simp


[STATEMENT]
lemma sum_equal_iff:
  fixes A :: hf shows "A+B = C+D \<longleftrightarrow> A=C \<and> B=D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A + B = C + D) = (A = C \<and> B = D)
[PROOF STEP]
by (auto simp: hf_ext sum_subset_iff)


[STATEMENT]
lemma sums_mult2: "f sums a \<Longrightarrow> (\<lambda>n. f n * c) sums (a * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums a \<Longrightarrow> (\<lambda>n. f n * c) sums (a * c)
[PROOF STEP]
by (rule bounded_linear.sums [OF bounded_linear_mult_left])


[STATEMENT]
lemma finite_range_prod:
  assumes fst: "finite (range (fst \<circ> f))"
  and     snd: "finite (range (snd \<circ> f))"
  shows "finite (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (range f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (range f)
[PROOF STEP]
from fst snd
[PROOF STATE]
proof (chain)
picking this:
finite (range (fst \<circ> f))
finite (range (snd \<circ> f))
[PROOF STEP]
have "finite (range (fst \<circ> f) \<times> range (snd \<circ> f))"
[PROOF STATE]
proof (prove)
using this:
finite (range (fst \<circ> f))
finite (range (snd \<circ> f))

goal (1 subgoal):
 1. finite (range (fst \<circ> f) \<times> range (snd \<circ> f))
[PROOF STEP]
by (rule finite_SigmaI)
[PROOF STATE]
proof (state)
this:
finite (range (fst \<circ> f) \<times> range (snd \<circ> f))

goal (1 subgoal):
 1. finite (range f)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (range (fst \<circ> f) \<times> range (snd \<circ> f))

goal (1 subgoal):
 1. finite (range f)
[PROOF STEP]
by (rule finite_subset[OF range_prod])
[PROOF STATE]
proof (state)
this:
finite (range f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma float_divr_nonpos_pos_upper_bound:
  "real_of_float x \<le> 0 \<Longrightarrow> 0 \<le> real_of_float y \<Longrightarrow> real_of_float (float_divr prec x y) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>real_of_float x \<le> 0; 0 \<le> real_of_float y\<rbrakk> \<Longrightarrow> real_of_float (float_divr prec x y) \<le> 0
[PROOF STEP]
by transfer (rule real_divr_nonpos_pos_upper_bound)


[STATEMENT]
lemma wf_tuple_Suc_fviD: "wf_tuple (Suc n) (Formula.fvi b \<phi>) v \<Longrightarrow> wf_tuple n (Formula.fvi (Suc b) \<phi>) (tl v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_tuple (Suc n) (Formula.fvi b \<phi>) v \<Longrightarrow> wf_tuple n (Formula.fvi (Suc b) \<phi>) (tl v)
[PROOF STEP]
unfolding wf_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length v = Suc n \<and> (\<forall>i<Suc n. (v ! i = None) = (i \<notin> Formula.fvi b \<phi>)) \<Longrightarrow> length (tl v) = n \<and> (\<forall>i<n. (tl v ! i = None) = (i \<notin> Formula.fvi (Suc b) \<phi>))
[PROOF STEP]
by (simp add: fvi_Suc nth_tl)


[STATEMENT]
lemma stable_INT:
    "(!!i. i \<in> I ==> F \<in> stable (A i)) ==> F \<in> stable (\<Inter>i \<in> I. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> F \<in> UNITY.stable (A i)) \<Longrightarrow> F \<in> UNITY.stable (\<Inter> (A ` I))
[PROOF STEP]
apply (unfold stable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> F \<in> A i co A i) \<Longrightarrow> F \<in> \<Inter> (A ` I) co \<Inter> (A ` I)
[PROOF STEP]
apply (blast intro: constrains_INT)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done