[STATEMENT]
lemma span_swap:
  assumes finE[simp]: "finite E"
      and E[simp]: "E \<subseteq> carrier V"
      and u[simp]: "u : carrier V"
      and usE: "u \<notin> span E"
      and v[simp]: "v : carrier V"
      and usEv: "u : span (insert v E)"
  shows "span (insert u E) \<subseteq> span (insert v E)" (is "?L \<subseteq> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
have Eu[simp]: "insert u E \<subseteq> carrier V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert u E \<subseteq> carrier V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert u E \<subseteq> carrier V

goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
have Ev[simp]: "insert v E \<subseteq> carrier V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert v E \<subseteq> carrier V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert v E \<subseteq> carrier V

goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
have finEu: "finite (insert u E)" and finEv: "finite (insert v E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (insert u E) &&& finite (insert v E)
[PROOF STEP]
using finE
[PROOF STATE]
proof (prove)
using this:
finite E

goal (1 subgoal):
 1. finite (insert u E) &&& finite (insert v E)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (insert u E)
finite (insert v E)

goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
have uE: "u \<notin> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<notin> E
[PROOF STEP]
using usE span_mem
[PROOF STATE]
proof (prove)
using this:
u \<notin> span E
\<lbrakk>?E \<subseteq> carrier V; ?u \<in> ?E\<rbrakk> \<Longrightarrow> ?u \<in> span ?E

goal (1 subgoal):
 1. u \<notin> E
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
u \<notin> E

goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
have vE: "v \<notin> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> E
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<in> E \<Longrightarrow> False
[PROOF STEP]
assume "v : E"
[PROOF STATE]
proof (state)
this:
v \<in> E

goal (1 subgoal):
 1. v \<in> E \<Longrightarrow> False
[PROOF STEP]
hence EvE: "insert v E = E"
[PROOF STATE]
proof (prove)
using this:
v \<in> E

goal (1 subgoal):
 1. insert v E = E
[PROOF STEP]
using insert_absorb
[PROOF STATE]
proof (prove)
using this:
v \<in> E
?a \<in> ?A \<Longrightarrow> insert ?a ?A = ?A

goal (1 subgoal):
 1. insert v E = E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert v E = E

goal (1 subgoal):
 1. v \<in> E \<Longrightarrow> False
[PROOF STEP]
hence "u : span E"
[PROOF STATE]
proof (prove)
using this:
insert v E = E

goal (1 subgoal):
 1. u \<in> span E
[PROOF STEP]
using usEv
[PROOF STATE]
proof (prove)
using this:
insert v E = E
u \<in> span (insert v E)

goal (1 subgoal):
 1. u \<in> span E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<in> span E

goal (1 subgoal):
 1. v \<in> E \<Longrightarrow> False
[PROOF STEP]
thus "False"
[PROOF STATE]
proof (prove)
using this:
u \<in> span E

goal (1 subgoal):
 1. False
[PROOF STEP]
using usE
[PROOF STATE]
proof (prove)
using this:
u \<in> span E
u \<notin> span E

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v \<notin> E

goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
obtain ua
    where ua[simp]: "ua : (insert v E) \<rightarrow> carrier K"
      and uua: "u = lincomb ua (insert v E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ua. \<lbrakk>ua \<in> insert v E \<rightarrow> carrier K; u = lincomb ua (insert v E)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using usEv finite_span[OF finEv Ev]
[PROOF STATE]
proof (prove)
using this:
u \<in> span (insert v E)
span (insert v E) = {lincomb a (insert v E) |a. a \<in> insert v E \<rightarrow> carrier K}

goal (1 subgoal):
 1. (\<And>ua. \<lbrakk>ua \<in> insert v E \<rightarrow> carrier K; u = lincomb ua (insert v E)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ua \<in> insert v E \<rightarrow> carrier K
u = lincomb ua (insert v E)

goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
hence uaE[simp]: "ua : E \<rightarrow> carrier K" and [simp]: "ua v : carrier K"
[PROOF STATE]
proof (prove)
using this:
ua \<in> insert v E \<rightarrow> carrier K
u = lincomb ua (insert v E)

goal (1 subgoal):
 1. ua \<in> E \<rightarrow> carrier K &&& ua v \<in> carrier K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ua \<in> E \<rightarrow> carrier K
ua v \<in> carrier K

goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
show "?L \<subseteq> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert u E) \<subseteq> span (insert v E)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> span (insert u E) \<Longrightarrow> x \<in> span (insert v E)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> span (insert u E) \<Longrightarrow> x \<in> span (insert v E)
[PROOF STEP]
assume "x : ?L"
[PROOF STATE]
proof (state)
this:
x \<in> span (insert u E)

goal (1 subgoal):
 1. \<And>x. x \<in> span (insert u E) \<Longrightarrow> x \<in> span (insert v E)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> span (insert u E)
[PROOF STEP]
obtain xa
    where xa: "xa : insert u E \<rightarrow> carrier K"
      and xxa: "x = lincomb xa (insert u E)"
[PROOF STATE]
proof (prove)
using this:
x \<in> span (insert u E)

goal (1 subgoal):
 1. (\<And>xa. \<lbrakk>xa \<in> insert u E \<rightarrow> carrier K; x = lincomb xa (insert u E)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding finite_span[OF finEu Eu]
[PROOF STATE]
proof (prove)
using this:
x \<in> {lincomb a (insert u E) |a. a \<in> insert u E \<rightarrow> carrier K}

goal (1 subgoal):
 1. (\<And>xa. \<lbrakk>xa \<in> insert u E \<rightarrow> carrier K; x = lincomb xa (insert u E)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xa \<in> insert u E \<rightarrow> carrier K
x = lincomb xa (insert u E)

goal (1 subgoal):
 1. \<And>x. x \<in> span (insert u E) \<Longrightarrow> x \<in> span (insert v E)
[PROOF STEP]
hence xaE[simp]: "xa : E \<rightarrow> carrier K" and xau[simp]: "xa u : carrier K"
[PROOF STATE]
proof (prove)
using this:
xa \<in> insert u E \<rightarrow> carrier K
x = lincomb xa (insert u E)

goal (1 subgoal):
 1. xa \<in> E \<rightarrow> carrier K &&& xa u \<in> carrier K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xa \<in> E \<rightarrow> carrier K
xa u \<in> carrier K

goal (1 subgoal):
 1. \<And>x. x \<in> span (insert u E) \<Longrightarrow> x \<in> span (insert v E)
[PROOF STEP]
show "x : span (insert v E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> span (insert v E)
[PROOF STEP]
unfolding finite_span[OF finEv Ev]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {lincomb a (insert v E) |a. a \<in> insert v E \<rightarrow> carrier K}
[PROOF STEP]
proof (rule,intro exI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = lincomb ?a3 (insert v E)
 2. ?a3 \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
define a where "a = (\<lambda>e. xa u \<otimes>\<^bsub>K\<^esub> ua e)"
[PROOF STATE]
proof (state)
this:
a = (\<lambda>e. xa u \<otimes>\<^bsub>K\<^esub> ua e)

goal (2 subgoals):
 1. x = lincomb ?a3 (insert v E)
 2. ?a3 \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
define a' where "a' = (\<lambda>e. a e \<oplus>\<^bsub>K\<^esub> xa e)"
[PROOF STATE]
proof (state)
this:
a' = (\<lambda>e. a e \<oplus>\<^bsub>K\<^esub> xa e)

goal (2 subgoals):
 1. x = lincomb ?a3 (insert v E)
 2. ?a3 \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
define a'' where "a'' = (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else a' e)"
[PROOF STATE]
proof (state)
this:
a'' = (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else a' e)

goal (2 subgoals):
 1. x = lincomb ?a3 (insert v E)
 2. ?a3 \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
have aE: "a : E \<rightarrow> carrier K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> E \<rightarrow> carrier K
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>e. xa u \<otimes>\<^bsub>K\<^esub> ua e) \<in> E \<rightarrow> carrier K
[PROOF STEP]
using xau uaE u
[PROOF STATE]
proof (prove)
using this:
xa u \<in> carrier K
ua \<in> E \<rightarrow> carrier K
u \<in> carrier V

goal (1 subgoal):
 1. (\<lambda>e. xa u \<otimes>\<^bsub>K\<^esub> ua e) \<in> E \<rightarrow> carrier K
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> E \<rightarrow> carrier K

goal (2 subgoals):
 1. x = lincomb ?a3 (insert v E)
 2. ?a3 \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
hence a'E: "a' : E \<rightarrow> carrier K"
[PROOF STATE]
proof (prove)
using this:
a \<in> E \<rightarrow> carrier K

goal (1 subgoal):
 1. a' \<in> E \<rightarrow> carrier K
[PROOF STEP]
unfolding a'_def
[PROOF STATE]
proof (prove)
using this:
a \<in> E \<rightarrow> carrier K

goal (1 subgoal):
 1. (\<lambda>e. a e \<oplus>\<^bsub>K\<^esub> xa e) \<in> E \<rightarrow> carrier K
[PROOF STEP]
using xaE
[PROOF STATE]
proof (prove)
using this:
a \<in> E \<rightarrow> carrier K
xa \<in> E \<rightarrow> carrier K

goal (1 subgoal):
 1. (\<lambda>e. a e \<oplus>\<^bsub>K\<^esub> xa e) \<in> E \<rightarrow> carrier K
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a' \<in> E \<rightarrow> carrier K

goal (2 subgoals):
 1. x = lincomb ?a3 (insert v E)
 2. ?a3 \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
thus a'': "a'' : insert v E \<rightarrow> carrier K"
[PROOF STATE]
proof (prove)
using this:
a' \<in> E \<rightarrow> carrier K

goal (1 subgoal):
 1. a'' \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
unfolding a''_def
[PROOF STATE]
proof (prove)
using this:
a' \<in> E \<rightarrow> carrier K

goal (1 subgoal):
 1. (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else a' e) \<in> insert v E \<rightarrow> carrier K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a'' \<in> insert v E \<rightarrow> carrier K

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have restr: "restrict a' E = restrict a'' E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict a' E = restrict a'' E
[PROOF STEP]
unfolding a''_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict a' E = (\<lambda>e\<in>E. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else a' e)
[PROOF STEP]
using vE
[PROOF STATE]
proof (prove)
using this:
v \<notin> E

goal (1 subgoal):
 1. restrict a' E = (\<lambda>e\<in>E. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else a' e)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
restrict a' E = restrict a'' E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "x = xa u \<odot>\<^bsub>V\<^esub> u \<oplus>\<^bsub>V\<^esub> lincomb xa E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = xa u \<odot>\<^bsub>V\<^esub> u \<oplus>\<^bsub>V\<^esub> lincomb xa E
[PROOF STEP]
using xxa lincomb_insert2 finE E xa uE u
[PROOF STATE]
proof (prove)
using this:
x = lincomb xa (insert u E)
\<lbrakk>finite ?S; ?S \<subseteq> carrier V; ?a \<in> insert ?v ?S \<rightarrow> carrier K; ?v \<notin> ?S; ?v \<in> carrier V\<rbrakk> \<Longrightarrow> lincomb ?a (insert ?v ?S) = ?a ?v \<odot>\<^bsub>V\<^esub> ?v \<oplus>\<^bsub>V\<^esub> lincomb ?a ?S
finite E
E \<subseteq> carrier V
xa \<in> insert u E \<rightarrow> carrier K
u \<notin> E
u \<in> carrier V

goal (1 subgoal):
 1. x = xa u \<odot>\<^bsub>V\<^esub> u \<oplus>\<^bsub>V\<^esub> lincomb xa E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = xa u \<odot>\<^bsub>V\<^esub> u \<oplus>\<^bsub>V\<^esub> lincomb xa E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = xa u \<odot>\<^bsub>V\<^esub> u \<oplus>\<^bsub>V\<^esub> lincomb xa E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have
        "xa u \<odot>\<^bsub>V\<^esub> u = xa u \<odot>\<^bsub>V\<^esub> lincomb ua (insert v E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa u \<odot>\<^bsub>V\<^esub> u = xa u \<odot>\<^bsub>V\<^esub> lincomb ua (insert v E)
[PROOF STEP]
using uua
[PROOF STATE]
proof (prove)
using this:
u = lincomb ua (insert v E)

goal (1 subgoal):
 1. xa u \<odot>\<^bsub>V\<^esub> u = xa u \<odot>\<^bsub>V\<^esub> lincomb ua (insert v E)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xa u \<odot>\<^bsub>V\<^esub> u = xa u \<odot>\<^bsub>V\<^esub> lincomb ua (insert v E)

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
xa u \<odot>\<^bsub>V\<^esub> u = xa u \<odot>\<^bsub>V\<^esub> lincomb ua (insert v E)

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "lincomb ua (insert v E) = ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb ua (insert v E) = ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E
[PROOF STEP]
using lincomb_insert2 finE E ua vE v
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?S; ?S \<subseteq> carrier V; ?a \<in> insert ?v ?S \<rightarrow> carrier K; ?v \<notin> ?S; ?v \<in> carrier V\<rbrakk> \<Longrightarrow> lincomb ?a (insert ?v ?S) = ?a ?v \<odot>\<^bsub>V\<^esub> ?v \<oplus>\<^bsub>V\<^esub> lincomb ?a ?S
finite E
E \<subseteq> carrier V
ua \<in> insert v E \<rightarrow> carrier K
v \<notin> E
v \<in> carrier V

goal (1 subgoal):
 1. lincomb ua (insert v E) = ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb ua (insert v E) = ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb ua (insert v E) = ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "xa u \<odot>\<^bsub>V\<^esub> ... = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> xa u \<odot>\<^bsub>V\<^esub> lincomb ua E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E) = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> xa u \<odot>\<^bsub>V\<^esub> lincomb ua E
[PROOF STEP]
using smult_r_distr
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier K; ?x \<in> carrier V; ?y \<in> carrier V\<rbrakk> \<Longrightarrow> ?a \<odot>\<^bsub>V\<^esub> (?x \<oplus>\<^bsub>V\<^esub> ?y) = ?a \<odot>\<^bsub>V\<^esub> ?x \<oplus>\<^bsub>V\<^esub> ?a \<odot>\<^bsub>V\<^esub> ?y

goal (1 subgoal):
 1. xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E) = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> xa u \<odot>\<^bsub>V\<^esub> lincomb ua E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E) = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> xa u \<odot>\<^bsub>V\<^esub> lincomb ua E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb ua E) = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> xa u \<odot>\<^bsub>V\<^esub> lincomb ua E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "xa u \<odot>\<^bsub>V\<^esub> lincomb ua E = lincomb a E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa u \<odot>\<^bsub>V\<^esub> lincomb ua E = lincomb a E
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa u \<odot>\<^bsub>V\<^esub> lincomb ua E = lincomb (\<lambda>e. xa u \<otimes>\<^bsub>K\<^esub> ua e) E
[PROOF STEP]
using lincomb_distrib[OF E]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> E \<rightarrow> carrier K; ?c \<in> carrier K\<rbrakk> \<Longrightarrow> ?c \<odot>\<^bsub>V\<^esub> lincomb ?a E = lincomb (\<lambda>u. ?c \<otimes>\<^bsub>K\<^esub> ?a u) E

goal (1 subgoal):
 1. xa u \<odot>\<^bsub>V\<^esub> lincomb ua E = lincomb (\<lambda>e. xa u \<otimes>\<^bsub>K\<^esub> ua e) E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xa u \<odot>\<^bsub>V\<^esub> lincomb ua E = lincomb a E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E
[PROOF STEP]
have "x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> (lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E)"
[PROOF STATE]
proof (prove)
using this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E

goal (1 subgoal):
 1. x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> (lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E)
[PROOF STEP]
using a_assoc xau v aE xaE
[PROOF STATE]
proof (prove)
using this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E
\<lbrakk>?x \<in> carrier V; ?y \<in> carrier V; ?z \<in> carrier V\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>V\<^esub> ?y \<oplus>\<^bsub>V\<^esub> ?z = ?x \<oplus>\<^bsub>V\<^esub> (?y \<oplus>\<^bsub>V\<^esub> ?z)
xa u \<in> carrier K
v \<in> carrier V
a \<in> E \<rightarrow> carrier K
xa \<in> E \<rightarrow> carrier K

goal (1 subgoal):
 1. x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> (lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> (lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E)

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> (lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E)

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E = lincomb a' E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E = lincomb a' E
[PROOF STEP]
unfolding a'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E = lincomb (\<lambda>e. a e \<oplus>\<^bsub>K\<^esub> xa e) E
[PROOF STEP]
using lincomb_sum[OF finE E aE xaE]
[PROOF STATE]
proof (prove)
using this:
lincomb (\<lambda>v. a v \<oplus>\<^bsub>K\<^esub> xa v) E = lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E

goal (1 subgoal):
 1. lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E = lincomb (\<lambda>e. a e \<oplus>\<^bsub>K\<^esub> xa e) E
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E = lincomb a' E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb a E \<oplus>\<^bsub>V\<^esub> lincomb xa E = lincomb a' E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "... = lincomb a'' E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a' E = lincomb a'' E
[PROOF STEP]
using lincomb_restrict[OF E a'E ] restr
[PROOF STATE]
proof (prove)
using this:
restrict a' E = restrict ?b E \<Longrightarrow> lincomb a' E = lincomb ?b E
restrict a' E = restrict a'' E

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

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a'' E
[PROOF STEP]
have "x = ((xa u \<otimes>\<^bsub>K\<^esub> ua v) \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a'' E"
[PROOF STATE]
proof (prove)
using this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a'' E

goal (1 subgoal):
 1. x = xa u \<otimes>\<^bsub>K\<^esub> ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E
[PROOF STEP]
using smult_assoc1
[PROOF STATE]
proof (prove)
using this:
x = xa u \<odot>\<^bsub>V\<^esub> (ua v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a'' E
\<lbrakk>?a \<in> carrier K; ?b \<in> carrier K; ?x \<in> carrier V\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>K\<^esub> ?b \<odot>\<^bsub>V\<^esub> ?x = ?a \<odot>\<^bsub>V\<^esub> (?b \<odot>\<^bsub>V\<^esub> ?x)

goal (1 subgoal):
 1. x = xa u \<otimes>\<^bsub>K\<^esub> ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = xa u \<otimes>\<^bsub>K\<^esub> ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = xa u \<otimes>\<^bsub>K\<^esub> ua v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "xa u \<otimes>\<^bsub>K\<^esub> ua v = a'' v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa u \<otimes>\<^bsub>K\<^esub> ua v = a'' v
[PROOF STEP]
unfolding a''_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa u \<otimes>\<^bsub>K\<^esub> ua v = (if v = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else a' v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
xa u \<otimes>\<^bsub>K\<^esub> ua v = a'' v

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
xa u \<otimes>\<^bsub>K\<^esub> ua v = a'' v

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
have "(a'' v \<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> lincomb a'' E = lincomb a'' (insert v E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a'' v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E = lincomb a'' (insert v E)
[PROOF STEP]
using lincomb_insert2[OF finE E a'' vE]
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier V \<Longrightarrow> lincomb a'' (insert v E) = a'' v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E

goal (1 subgoal):
 1. a'' v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E = lincomb a'' (insert v E)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a'' v \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a'' E = lincomb a'' (insert v E)

goal (1 subgoal):
 1. x = lincomb (\<lambda>e. if e = v then xa u \<otimes>\<^bsub>K\<^esub> ua v else xa u \<otimes>\<^bsub>K\<^esub> ua e \<oplus>\<^bsub>K\<^esub> xa e) (insert v E)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = lincomb a'' (insert v E)
[PROOF STEP]
show "x = lincomb a'' (insert v E)"
[PROOF STATE]
proof (prove)
using this:
x = lincomb a'' (insert v E)

goal (1 subgoal):
 1. x = lincomb a'' (insert v E)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = lincomb a'' (insert v E)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
span (insert u E) \<subseteq> span (insert v E)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fin_gens_imp_fin_algebra:
  assumes "finite Xs"
  assumes "S = \<Union> Xs"
  shows "finite (gen_boolean_algebra S Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (gen_boolean_algebra S Xs)
[PROOF STEP]
using finite_set_imp_finite_atoms[of Xs] assms gen_boolean_algebra_generated_by_atoms[of Xs S]
[PROOF STATE]
proof (prove)
using this:
finite Xs \<Longrightarrow> finite (atoms_of Xs)
finite Xs
S = \<Union> Xs
\<lbrakk>finite Xs; S = \<Union> Xs\<rbrakk> \<Longrightarrow> gen_boolean_algebra S Xs = \<Union> ` Pow (atoms_of Xs)

goal (1 subgoal):
 1. finite (gen_boolean_algebra S Xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma perm_inv:
  assumes f: "f \<in> perm"
  shows "(inv f) \<in> perm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f \<in> perm
[PROOF STEP]
apply (rule permI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. bij (inv f)
 2. \<forall>\<^sub>\<infinity>x. inv f x = x
 3. \<And>a. sort_of (inv f a) = sort_of a
[PROOF STEP]
apply (rule bij_imp_bij_inv)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. bij f
 2. \<forall>\<^sub>\<infinity>x. inv f x = x
 3. \<And>a. sort_of (inv f a) = sort_of a
[PROOF STEP]
apply (rule perm_is_bij [OF f])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>\<^sub>\<infinity>x. inv f x = x
 2. \<And>a. sort_of (inv f a) = sort_of a
[PROOF STEP]
apply (rule MOST_mono [OF perm_MOST [OF f]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. f x = x \<Longrightarrow> inv f x = x
 2. \<And>a. sort_of (inv f a) = sort_of a
[PROOF STEP]
apply (erule subst, rule inv_f_f)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. inj f
 2. \<And>a. sort_of (inv f a) = sort_of a
[PROOF STEP]
apply (rule bij_is_inj [OF perm_is_bij [OF f]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. sort_of (inv f a) = sort_of a
[PROOF STEP]
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. sort_of (f (inv f a)) = sort_of a
[PROOF STEP]
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma segm_sub_morph: "snd (Rep_segment x) = fst (Rep_segment y) \<Longrightarrow> segm x \<union> segm y \<le> segm (x \<cdot> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Rep_segment x) = fst (Rep_segment y) \<Longrightarrow> segm x \<union> segm y \<subseteq> segm (x \<oplus> y)
[PROOF STEP]
apply (simp add: segm_def times_segment.rep_eq, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>snd (Rep_segment x) = fst (Rep_segment y); fst (Rep_segment x) \<le> xa; xa \<le> fst (Rep_segment y)\<rbrakk> \<Longrightarrow> xa \<le> snd (Rep_segment y)
 2. \<And>xa. \<lbrakk>snd (Rep_segment x) = fst (Rep_segment y); fst (Rep_segment y) \<le> xa; xa \<le> snd (Rep_segment y)\<rbrakk> \<Longrightarrow> fst (Rep_segment x) \<le> xa
[PROOF STEP]
using Rep_segment dual_order.trans
[PROOF STATE]
proof (prove)
using this:
Rep_segment ?x \<in> {x. fst x \<le> snd x}
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>snd (Rep_segment x) = fst (Rep_segment y); fst (Rep_segment x) \<le> xa; xa \<le> fst (Rep_segment y)\<rbrakk> \<Longrightarrow> xa \<le> snd (Rep_segment y)
 2. \<And>xa. \<lbrakk>snd (Rep_segment x) = fst (Rep_segment y); fst (Rep_segment y) \<le> xa; xa \<le> snd (Rep_segment y)\<rbrakk> \<Longrightarrow> fst (Rep_segment x) \<le> xa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>snd (Rep_segment x) = fst (Rep_segment y); fst (Rep_segment y) \<le> xa; xa \<le> snd (Rep_segment y)\<rbrakk> \<Longrightarrow> fst (Rep_segment x) \<le> xa
[PROOF STEP]
by (metis (mono_tags, lifting) Rep_segment dual_order.trans mem_Collect_eq)


[STATEMENT]
lemma mat_plus_comm: "mat_plus m1 m2 = mat_plus m2 m1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_plus m1 m2 = mat_plus m2 m1
[PROOF STEP]
unfolding mat_plusI_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1)
[PROOF STEP]
proof (induct m1 arbitrary: m2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip [] m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 [])
 2. \<And>a m1 m2. (\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1)) \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (a # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (a # m1))
[PROOF STEP]
case (Cons v m1)
[PROOF STATE]
proof (state)
this:
map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 ?m2.0) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip ?m2.0 m1)

goal (2 subgoals):
 1. \<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip [] m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 [])
 2. \<And>a m1 m2. (\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1)) \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (a # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (a # m1))
[PROOF STEP]
note oCons = this
[PROOF STATE]
proof (state)
this:
map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 ?m2.0) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip ?m2.0 m1)

goal (2 subgoals):
 1. \<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip [] m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 [])
 2. \<And>a m1 m2. (\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1)) \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (a # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (a # m1))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 ?m2.0) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip ?m2.0 m1)

goal (1 subgoal):
 1. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
proof (cases m2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = []\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
 2. \<And>a list. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = a # list\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
case (Cons w m2a)
[PROOF STATE]
proof (state)
this:
m2 = w # m2a

goal (2 subgoals):
 1. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = []\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
 2. \<And>a list. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = a # list\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
hence "mat_plus (v # m1) m2 = vec_plus v w # mat_plus m1 m2a"
[PROOF STATE]
proof (prove)
using this:
m2 = w # m2a

goal (1 subgoal):
 1. mat_plus (v # m1) m2 = vec_plus v w # mat_plus m1 m2a
[PROOF STEP]
by (auto simp: mat_plusI_def)
[PROOF STATE]
proof (state)
this:
mat_plus (v # m1) m2 = vec_plus v w # mat_plus m1 m2a

goal (2 subgoals):
 1. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = []\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
 2. \<And>a list. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = a # list\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_plus (v # m1) m2 = vec_plus v w # mat_plus m1 m2a

goal (2 subgoals):
 1. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = []\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
 2. \<And>a list. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = a # list\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
have "\<dots> = vec_plus w v # mat_plus m1 m2a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_plus v w # mat_plus m1 m2a = vec_plus w v # mat_plus m1 m2a
[PROOF STEP]
using vec_plus_comm
[PROOF STATE]
proof (prove)
using this:
vec_plus ?x ?y = vec_plus ?y ?x

goal (1 subgoal):
 1. vec_plus v w # mat_plus m1 m2a = vec_plus w v # mat_plus m1 m2a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_plus v w # mat_plus m1 m2a = vec_plus w v # mat_plus m1 m2a

goal (2 subgoals):
 1. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = []\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
 2. \<And>a list. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = a # list\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_plus (v # m1) m2 = vec_plus w v # mat_plus m1 m2a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat_plus (v # m1) m2 = vec_plus w v # mat_plus m1 m2a

goal (1 subgoal):
 1. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
using Cons oCons
[PROOF STATE]
proof (prove)
using this:
mat_plus (v # m1) m2 = vec_plus w v # mat_plus m1 m2a
m2 = w # m2a
map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 ?m2.0) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip ?m2.0 m1)

goal (1 subgoal):
 1. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
by (auto simp: mat_plusI_def)
[PROOF STATE]
proof (state)
this:
map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))

goal (1 subgoal):
 1. \<lbrakk>\<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m1 m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 m1); m2 = []\<rbrakk> \<Longrightarrow> map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip (v # m1) m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 (v # m1))

goal (1 subgoal):
 1. \<And>m2. map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip [] m2) = map (\<lambda>uv. vec_plus (fst uv) (snd uv)) (zip m2 [])
[PROOF STEP]
qed simp


[STATEMENT]
lemma is_SupI [intro?]: "(\<And>x. x \<in> A \<Longrightarrow> x \<sqsubseteq> sup) \<Longrightarrow>
    (\<And>z. (\<forall>x \<in> A. x \<sqsubseteq> z) \<Longrightarrow> sup \<sqsubseteq> z) \<Longrightarrow> is_Sup A sup"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> A \<Longrightarrow> x \<sqsubseteq> sup; \<And>z. \<forall>x\<in>A. x \<sqsubseteq> z \<Longrightarrow> sup \<sqsubseteq> z\<rbrakk> \<Longrightarrow> is_Sup A sup
[PROOF STEP]
by (unfold is_Sup_def) blast


[STATEMENT]
lemma ord_of_nat_plus[nat_omega_simps]: "a\<^sub>\<nat> + b\<^sub>\<nat> = (a + b)\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a\<^sub>\<nat> + b\<^sub>\<nat> = (a + b)\<^sub>\<nat>
[PROOF STEP]
by (induct b) (simp_all add: plus_V_succ_right)


[STATEMENT]
lemma (in topology) empty_open [iff]: "{} open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} open
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {} open
[PROOF STEP]
have "\<Union>{} open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {} open
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<Union> {} open

goal (1 subgoal):
 1. {} open
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> {} open

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum4sq_int_nat_eq: "sum4sq_nat a b c d = sum4sq_int (a, b, c, d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (sum4sq_nat a b c d) = sum4sq_int (int a, int b, int c, int d)
[PROOF STEP]
unfolding sum4sq_nat_def sum4sq_int_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (a\<^sup>2 + b\<^sup>2 + c\<^sup>2 + d\<^sup>2) = (case (int a, int b, int c, int d) of (a, b, c, d) \<Rightarrow> a\<^sup>2 + b\<^sup>2 + c\<^sup>2 + d\<^sup>2)
[PROOF STEP]
by simp


[STATEMENT]
lemma downclosed_set_iff: "downclosed_set X = (\<forall>x \<in> X. \<forall>y. y \<le> x \<longrightarrow> y \<in> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. downclosed_set X = (\<forall>x\<in>X. \<forall>y\<le>x. y \<in> X)
[PROOF STEP]
unfolding downclosed_set_def downsets_def Fix_def downset_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<in> {x. {y. Bex x ((\<le>) y)} = x}) = (\<forall>x\<in>X. \<forall>y\<le>x. y \<in> X)
[PROOF STEP]
by auto


[STATEMENT]
lemma to_stream_nat_case: "to_stream (case_nat x X) = x ## to_stream X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_stream (case_nat x X) = x ## to_stream X
[PROOF STEP]
unfolding to_stream_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smap (case_nat x X) nats = x ## smap X nats
[PROOF STEP]
by (subst siterate.ctr) (simp add: smap_siterate[symmetric] stream.map_comp comp_def)


[STATEMENT]
lemma all2_neq_Inl_ex_eq_Inr[dest]: "(\<forall>a b. x \<noteq> Inl (a, b)) \<Longrightarrow> (\<exists>r. x = Inr r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b. x \<noteq> Inl (a, b) \<Longrightarrow> \<exists>r. x = Inr r
[PROOF STEP]
by (cases x) auto


[STATEMENT]
lemma sum_of_pr_is_pr2: "p \<in> PrimRec2 \<Longrightarrow> (\<lambda> n m. sum (\<lambda> x. p x m) {i. i<n}) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
assume p_is_pr: "p \<in> PrimRec2"
[PROOF STATE]
proof (state)
this:
p \<in> PrimRec2

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
define f where "f n m = sum (\<lambda> x. p x m) {i. i<n}" for n m
[PROOF STATE]
proof (state)
this:
f ?n ?m = (\<Sum>x\<in>{i. i < ?n}. p x ?m)

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
define g :: "nat \<Rightarrow> nat" where "g x = 0" for x
[PROOF STATE]
proof (state)
this:
g ?x = 0

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
have g_is_pr: "g \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> PrimRec1
[PROOF STEP]
by (unfold g_def, rule const_is_pr [where ?n=0])
[PROOF STATE]
proof (state)
this:
g \<in> PrimRec1

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
have f_at_0: "\<forall> x. f 0 x = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f 0 x = g x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f 0 x = g x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f 0 x = g x
[PROOF STEP]
from f_def g_def
[PROOF STATE]
proof (chain)
picking this:
f ?n ?m = (\<Sum>x\<in>{i. i < ?n}. p x ?m)
g ?x = 0
[PROOF STEP]
show "f 0 x = g x"
[PROOF STATE]
proof (prove)
using this:
f ?n ?m = (\<Sum>x\<in>{i. i < ?n}. p x ?m)
g ?x = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x. f 0 x = g x

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
define h where "h a b c = p a c + b" for a b c
[PROOF STATE]
proof (state)
this:
h ?a ?b ?c = p ?a ?c + ?b

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
from p_is_pr
[PROOF STATE]
proof (chain)
picking this:
p \<in> PrimRec2
[PROOF STEP]
have h_is_pr: "h \<in> PrimRec3"
[PROOF STATE]
proof (prove)
using this:
p \<in> PrimRec2

goal (1 subgoal):
 1. h \<in> PrimRec3
[PROOF STEP]
unfolding h_def
[PROOF STATE]
proof (prove)
using this:
p \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>a b c. p a c + b) \<in> PrimRec3
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
h \<in> PrimRec3

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
have f_at_Suc: "\<forall> x y. f (Suc y) x = h y (f y x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. f (Suc y) x = h y (f y x) x
[PROOF STEP]
proof (rule allI, rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. f (Suc y) x = h y (f y x) x
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. f (Suc y) x = h y (f y x) x
[PROOF STEP]
show "f (Suc y) x = h y (f y x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
from f_def
[PROOF STATE]
proof (chain)
picking this:
f ?n ?m = (\<Sum>x\<in>{i. i < ?n}. p x ?m)
[PROOF STEP]
have S1: "f (Suc y) x = sum (\<lambda> z. p z x)  {i. i < Suc y}"
[PROOF STATE]
proof (prove)
using this:
f ?n ?m = (\<Sum>x\<in>{i. i < ?n}. p x ?m)

goal (1 subgoal):
 1. f (Suc y) x = (\<Sum>z\<in>{i. i < Suc y}. p z x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (Suc y) x = (\<Sum>z\<in>{i. i < Suc y}. p z x)

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
have S2: "{i. i < Suc y} = {i. i < y} \<union> {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < Suc y} = {i. i < y} \<union> {y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < Suc y} = {i. i < y} \<union> {y}

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
have S3: "finite {i. i < y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i < y}
[PROOF STEP]
by (rule finite_interval)
[PROOF STATE]
proof (state)
this:
finite {i. i < y}

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
have S4: "y \<notin> {i. i < y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<notin> {i. i < y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<notin> {i. i < y}

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
define g1 where "g1 z = p z x" for z
[PROOF STATE]
proof (state)
this:
g1 ?z = p ?z x

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
from S1 S2 g1_def
[PROOF STATE]
proof (chain)
picking this:
f (Suc y) x = (\<Sum>z\<in>{i. i < Suc y}. p z x)
{i. i < Suc y} = {i. i < y} \<union> {y}
g1 ?z = p ?z x
[PROOF STEP]
have "f (Suc y) x = sum g1 ({i. (i::nat) < y} \<union> {y})"
[PROOF STATE]
proof (prove)
using this:
f (Suc y) x = (\<Sum>z\<in>{i. i < Suc y}. p z x)
{i. i < Suc y} = {i. i < y} \<union> {y}
g1 ?z = p ?z x

goal (1 subgoal):
 1. f (Suc y) x = sum g1 ({i. i < y} \<union> {y})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (Suc y) x = sum g1 ({i. i < y} \<union> {y})

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (Suc y) x = sum g1 ({i. i < y} \<union> {y})

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
from S3 S4 sum.insert
[PROOF STATE]
proof (chain)
picking this:
finite {i. i < y}
y \<notin> {i. i < y}
\<lbrakk>finite ?A; ?x \<notin> ?A\<rbrakk> \<Longrightarrow> sum ?g (insert ?x ?A) = ?g ?x + sum ?g ?A
[PROOF STEP]
have "\<dots> = g1 y + sum g1 {i. i<y}"
[PROOF STATE]
proof (prove)
using this:
finite {i. i < y}
y \<notin> {i. i < y}
\<lbrakk>finite ?A; ?x \<notin> ?A\<rbrakk> \<Longrightarrow> sum ?g (insert ?x ?A) = ?g ?x + sum ?g ?A

goal (1 subgoal):
 1. sum g1 ({i. i < y} \<union> {y}) = g1 y + sum g1 {i. i < y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum g1 ({i. i < y} \<union> {y}) = g1 y + sum g1 {i. i < y}

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum g1 ({i. i < y} \<union> {y}) = g1 y + sum g1 {i. i < y}

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
from f_def g1_def
[PROOF STATE]
proof (chain)
picking this:
f ?n ?m = (\<Sum>x\<in>{i. i < ?n}. p x ?m)
g1 ?z = p ?z x
[PROOF STEP]
have "\<dots> = g1 y + f y x"
[PROOF STATE]
proof (prove)
using this:
f ?n ?m = (\<Sum>x\<in>{i. i < ?n}. p x ?m)
g1 ?z = p ?z x

goal (1 subgoal):
 1. g1 y + sum g1 {i. i < y} = g1 y + f y x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g1 y + sum g1 {i. i < y} = g1 y + f y x

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g1 y + sum g1 {i. i < y} = g1 y + f y x

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
from h_def g1_def
[PROOF STATE]
proof (chain)
picking this:
h ?a ?b ?c = p ?a ?c + ?b
g1 ?z = p ?z x
[PROOF STEP]
have "\<dots> = h y (f y x) x"
[PROOF STATE]
proof (prove)
using this:
h ?a ?b ?c = p ?a ?c + ?b
g1 ?z = p ?z x

goal (1 subgoal):
 1. g1 y + f y x = h y (f y x) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g1 y + f y x = h y (f y x) x

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (Suc y) x = h y (f y x) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (Suc y) x = h y (f y x) x

goal (1 subgoal):
 1. f (Suc y) x = h y (f y x) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (Suc y) x = h y (f y x) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (Suc y) x = h y (f y x) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x y. f (Suc y) x = h y (f y x) x

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
from g_is_pr h_is_pr f_at_0 f_at_Suc
[PROOF STATE]
proof (chain)
picking this:
g \<in> PrimRec1
h \<in> PrimRec3
\<forall>x. f 0 x = g x
\<forall>x y. f (Suc y) x = h y (f y x) x
[PROOF STEP]
have f_is_pr: "f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
g \<in> PrimRec1
h \<in> PrimRec3
\<forall>x. f 0 x = g x
\<forall>x y. f (Suc y) x = h y (f y x) x

goal (1 subgoal):
 1. f \<in> PrimRec2
[PROOF STEP]
by (rule pr_rec_scheme)
[PROOF STATE]
proof (state)
this:
f \<in> PrimRec2

goal (1 subgoal):
 1. p \<in> PrimRec2 \<Longrightarrow> (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
with f_def [abs_def]
[PROOF STATE]
proof (chain)
picking this:
f \<equiv> \<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m
f \<in> PrimRec2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<equiv> \<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m
f \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n m. \<Sum>x\<in>{i. i < n}. p x m) \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma while_option_finite_increasing_Some:
  fixes f :: "'a::order \<Rightarrow> 'a"
  assumes "mono f" and "finite (UNIV :: 'a set)" and "s \<le> f s"
  shows "\<exists>P. while_option (\<lambda>A. f A \<noteq> A) f s = Some P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. while_option (\<lambda>A. f A \<noteq> A) f s = Some P
[PROOF STEP]
by (rule wf_rel_while_option_Some[where R="{(x, y). y < x}" and P="\<lambda>A. A \<le> f A" and s="s"])
   (auto simp: assms monoD intro: wf_finite_greater[where C="UNIV::'a set", simplified])


[STATEMENT]
lemma disj_com_Cn: \<open>Cn({p .\<or>. q}) = Cn({q .\<or>. p})\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cn {p .\<or>. q} = Cn {q .\<or>. p}
[PROOF STEP]
unfolding Cn_same
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C. ({p .\<or>. q} \<subseteq> Cn C) = ({q .\<or>. p} \<subseteq> Cn C)
[PROOF STEP]
using disj_com
[PROOF STATE]
proof (prove)
using this:
(?A \<turnstile> ?p .\<or>. ?q) = (?A \<turnstile> ?q .\<or>. ?p)

goal (1 subgoal):
 1. \<forall>C. ({p .\<or>. q} \<subseteq> Cn C) = ({q .\<or>. p} \<subseteq> Cn C)
[PROOF STEP]
by simp


[STATEMENT]
lemma closedin_path_components_of_locally_path_connected_space:
   "\<lbrakk>locally_path_connected_space X; c \<in> path_components_of X\<rbrakk> \<Longrightarrow> closedin X c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>locally_path_connected_space X; c \<in> path_components_of X\<rbrakk> \<Longrightarrow> closedin X c
[PROOF STEP]
by (simp add: closedin_def complement_path_components_of_Union openin_path_components_of_locally_path_connected_space openin_clauses(3) path_components_of_subset)


[STATEMENT]
lemma minus_one_in_totatives:
  assumes "n \<ge> 2"
  shows "n - 1 \<in> totatives n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n - 1 \<in> totatives n
[PROOF STEP]
using assms coprime_diff_one_left_nat [of n]
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
0 < n \<Longrightarrow> coprime (n - 1) n

goal (1 subgoal):
 1. n - 1 \<in> totatives n
[PROOF STEP]
by (simp add: in_totatives_iff)


[STATEMENT]
lemma urel32_normalize:
assumes x: "urel32 x y"
shows "urel32 (if x = 0 then 0 else 1) (if y = 0 then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel32 (if x = 0 then 0 else 1) (if y = 0 then 0 else 1)
[PROOF STEP]
unfolding urel32_eq[OF x urel32_0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel32 (if y = 0 then 0 else 1) (if y = 0 then 0 else 1)
[PROOF STEP]
using urel32_0 urel32_1
[PROOF STATE]
proof (prove)
using this:
urel32 0 0
urel32 1 1

goal (1 subgoal):
 1. urel32 (if y = 0 then 0 else 1) (if y = 0 then 0 else 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma smallD:
  "f \<in> l F (g) \<Longrightarrow> c > 0 \<Longrightarrow> eventually (\<lambda>x. R (norm (f x)) (c * (norm (g x)))) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> l F g; 0 < c\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))
[PROOF STEP]
unfolding l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {f. \<forall>c>0. \<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))}; 0 < c\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))
[PROOF STEP]
by blast


[STATEMENT]
lemma winding_number_offset: "winding_number p z = winding_number (\<lambda>w. p w - z) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number p z = winding_number (\<lambda>w. p w - z) 0
[PROOF STEP]
unfolding winding_number_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME n. \<forall>e>0. \<exists>pa. winding_number_prop p z e pa n) = (SOME n. \<forall>e>0. \<exists>pa. winding_number_prop (\<lambda>w. p w - z) 0 e pa n)
[PROOF STEP]
proof (intro ext arg_cong [where f = Eps] arg_cong [where f = All] imp_cong refl, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop p z e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop (\<lambda>w. p w - z) 0 e pa n
 2. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
fix n e g
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop p z e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop (\<lambda>w. p w - z) 0 e pa n
 2. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
assume "0 < e" and g: "winding_number_prop p z e g n"
[PROOF STATE]
proof (state)
this:
0 < e
winding_number_prop p z e g n

goal (2 subgoals):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop p z e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop (\<lambda>w. p w - z) 0 e pa n
 2. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
winding_number_prop p z e g n
[PROOF STEP]
show "\<exists>r. winding_number_prop (\<lambda>w. p w - z) 0 e r n"
[PROOF STATE]
proof (prove)
using this:
0 < e
winding_number_prop p z e g n

goal (1 subgoal):
 1. \<exists>r. winding_number_prop (\<lambda>w. p w - z) 0 e r n
[PROOF STEP]
by (rule_tac x="\<lambda>t. g t - z" in exI)
       (force simp: winding_number_prop_def contour_integral_integral valid_path_def path_defs
                vector_derivative_def has_vector_derivative_diff_const piecewise_C1_differentiable_diff C1_differentiable_imp_piecewise)
[PROOF STATE]
proof (state)
this:
\<exists>r. winding_number_prop (\<lambda>w. p w - z) 0 e r n

goal (1 subgoal):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
fix n e g
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
assume "0 < e" and g: "winding_number_prop (\<lambda>w. p w - z) 0 e g n"
[PROOF STATE]
proof (state)
this:
0 < e
winding_number_prop (\<lambda>w. p w - z) 0 e g n

goal (1 subgoal):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
winding_number_prop (\<lambda>w. p w - z) 0 e g n
[PROOF STEP]
have "winding_number_prop p z e (\<lambda>t. g t + z) n"
[PROOF STATE]
proof (prove)
using this:
0 < e
winding_number_prop (\<lambda>w. p w - z) 0 e g n

goal (1 subgoal):
 1. winding_number_prop p z e (\<lambda>t. g t + z) n
[PROOF STEP]
apply (simp add: winding_number_prop_def contour_integral_integral valid_path_def path_defs
        piecewise_C1_differentiable_add vector_derivative_def has_vector_derivative_add_const C1_differentiable_imp_piecewise)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < e; g piecewise_C1_differentiable_on {0..1} \<and> 0 \<notin> g ` {0..1} \<and> g 0 = p 0 - z \<and> g 1 = p 1 - z \<and> (\<forall>t\<in>{0..1}. cmod (p t - z - g t) < e) \<and> integral {0..1} (\<lambda>x. (SOME f'. (g has_vector_derivative f') (at x)) / g x) = 2 * complex_of_real pi * \<i> * n\<rbrakk> \<Longrightarrow> z \<notin> (\<lambda>t. g t + z) ` {0..1} \<and> (\<forall>t\<in>{0..1}. cmod (p t - (g t + z)) < e)
[PROOF STEP]
apply (force simp: algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
winding_number_prop p z e (\<lambda>t. g t + z) n

goal (1 subgoal):
 1. \<And>n e pa. \<lbrakk>0 < e; winding_number_prop (\<lambda>w. p w - z) 0 e pa n\<rbrakk> \<Longrightarrow> \<exists>pa. winding_number_prop p z e pa n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
winding_number_prop p z e (\<lambda>t. g t + z) n
[PROOF STEP]
show "\<exists>r. winding_number_prop p z e r n"
[PROOF STATE]
proof (prove)
using this:
winding_number_prop p z e (\<lambda>t. g t + z) n

goal (1 subgoal):
 1. \<exists>r. winding_number_prop p z e r n
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>r. winding_number_prop p z e r n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compact_components:
  fixes s :: "'a::heine_borel set"
  shows "\<lbrakk>compact s; c \<in> components s\<rbrakk> \<Longrightarrow> compact c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>compact s; c \<in> components s\<rbrakk> \<Longrightarrow> compact c
[PROOF STEP]
by (meson bounded_subset closed_components in_components_subset compact_eq_bounded_closed)


[STATEMENT]
lemma Liminf_filtermap_eq: "inj f \<Longrightarrow> Liminf (filtermap f F) g = Liminf F (\<lambda>x. g (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f \<Longrightarrow> Liminf (filtermap f F) g = Liminf F (\<lambda>x. g (f x))
[PROOF STEP]
using Liminf_filtermap_le[of f F g] Liminf_filtermap_ge[of f F g]
[PROOF STATE]
proof (prove)
using this:
Liminf (filtermap f F) g \<le> Liminf F (\<lambda>x. g (f x))
inj f \<Longrightarrow> Liminf F (\<lambda>x. g (f x)) \<le> Liminf (filtermap f F) g

goal (1 subgoal):
 1. inj f \<Longrightarrow> Liminf (filtermap f F) g = Liminf F (\<lambda>x. g (f x))
[PROOF STEP]
by simp


[STATEMENT]
lemma set_bind_conv_fold: "set xs \<bind> f = fold ((\<union>) \<circ> f) xs {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs \<bind> f = fold ((\<union>) \<circ> f) xs {}
[PROOF STEP]
by(induct xs rule: rev_induct)(simp_all add: insert_bind_set)


[STATEMENT]
lemma lipschitz_bound_maxmin: "(tmax - tmin) * L < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tmax - tmin) * L < 1
[PROOF STEP]
using lipschitz_bound[of tmax tmin]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>tmax \<in> T; tmin \<in> T\<rbrakk> \<Longrightarrow> \<bar>tmax - tmin\<bar> * L < 1

goal (1 subgoal):
 1. (tmax - tmin) * L < 1
[PROOF STEP]
by auto


[STATEMENT]
lemma isCont_divide[continuous_intros, simp]:
  fixes f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_field"
  assumes "isCont f a" "isCont g a" "g a \<noteq> 0"
  shows "isCont (\<lambda>x. (f x) / g x) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. f x / g x) a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isCont f a
isCont g a
g a \<noteq> (0::'b)

goal (1 subgoal):
 1. isCont (\<lambda>x. f x / g x) a
[PROOF STEP]
unfolding continuous_at
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>a\<rightarrow> f a
g \<midarrow>a\<rightarrow> g a
g a \<noteq> (0::'b)

goal (1 subgoal):
 1. (\<lambda>x. f x / g x) \<midarrow>a\<rightarrow> f a / g a
[PROOF STEP]
by (rule tendsto_divide)


[STATEMENT]
lemma zeta_tail_bigo':
  fixes s :: real
  assumes s: "s > 1"
  shows   "(\<lambda>n. Re (hurwitz_zeta (real n) s)) \<in> O(\<lambda>x. real x powr (1 - s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
have "(\<lambda>n. Re (hurwitz_zeta (real n) s)) \<in> \<Theta>(\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> \<Theta>(\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) (complex_of_real s)))
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_ge_at_top[of 1]])
       (auto simp: of_nat_diff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> \<Theta>(\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) (complex_of_real s)))

goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> \<Theta>(\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) (complex_of_real s)))

goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
have "(\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) s)) \<in> O(\<lambda>x. real (x - 1) powr (1 - s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) (complex_of_real s))) \<in> O(\<lambda>x. real (x - 1) powr (1 - s))
[PROOF STEP]
by (rule landau_o.big.compose[OF zeta_tail_bigo[OF assms]]) real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) (complex_of_real s))) \<in> O(\<lambda>x. real (x - 1) powr (1 - s))

goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Re (hurwitz_zeta (real (n - 1) + 1) (complex_of_real s))) \<in> O(\<lambda>x. real (x - 1) powr (1 - s))

goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
have "(\<lambda>x. real (x - 1) powr (1 - s)) \<in> O(\<lambda>x. real x powr (1 - s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (x - 1) powr (1 - s)) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (x - 1) powr (1 - s)) \<in> O(\<lambda>x. real x powr (1 - s))

goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))

goal (1 subgoal):
 1. (\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Re (hurwitz_zeta (real n) (complex_of_real s))) \<in> O(\<lambda>x. real x powr (1 - s))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scaleC_mono':
  "a \<le> b \<Longrightarrow> c \<le> d \<Longrightarrow> 0 \<le> a \<Longrightarrow> 0 \<le> c \<Longrightarrow> a *\<^sub>C c \<le> b *\<^sub>C d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; c \<le> d; 0 \<le> a; (0::'a) \<le> c\<rbrakk> \<Longrightarrow> a *\<^sub>C c \<le> b *\<^sub>C d
[PROOF STEP]
by (rule scaleC_mono) (auto intro: order.trans)


[STATEMENT]
lemma imp_graph_nodes: "imp_graph cnf \<subseteq> lits_of_cnf cnf \<times> lits_of_cnf cnf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. imp_graph cnf \<subseteq> lits_of_cnf cnf \<times> lits_of_cnf cnf
[PROOF STEP]
unfolding imp_graph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (edges_of_clause ` cnf) \<subseteq> lits_of_cnf cnf \<times> lits_of_cnf cnf
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>x \<in> cnf; (a, b) \<in> edges_of_clause x\<rbrakk> \<Longrightarrow> a \<in> lits_of_cnf cnf \<and> b \<in> lits_of_cnf cnf
[PROOF STEP]
subgoal for l1 l2 cl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cl \<in> cnf; (l1, l2) \<in> edges_of_clause cl\<rbrakk> \<Longrightarrow> l1 \<in> lits_of_cnf cnf \<and> l2 \<in> lits_of_cnf cnf
[PROOF STEP]
by (cases cl; cases l1; cases l2)(fastforce simp: lits_of_cnf_def vars_of_cnf_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hom_pairwise: "f \<in> hom G (DirProd H K) \<longleftrightarrow> (fst \<circ> f) \<in> hom G H \<and> (snd \<circ> f) \<in> hom G K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> hom G (H \<times>\<times> K)) = (fst \<circ> f \<in> hom G H \<and> snd \<circ> f \<in> hom G K)
[PROOF STEP]
apply (auto simp: hom_def mult_DirProd' dest: Pi_mem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>fst \<circ> f \<in> carrier G \<rightarrow> carrier H; \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. fst (f (x \<otimes>\<^bsub>G\<^esub> y)) = fst (f x) \<otimes>\<^bsub>H\<^esub> fst (f y); snd \<circ> f \<in> carrier G \<rightarrow> carrier K; \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. snd (f (x \<otimes>\<^bsub>G\<^esub> y)) = snd (f x) \<otimes>\<^bsub>K\<^esub> snd (f y); x \<in> carrier G\<rbrakk> \<Longrightarrow> f x \<in> carrier H \<times> carrier K
 2. \<And>x y. \<lbrakk>fst \<circ> f \<in> carrier G \<rightarrow> carrier H; \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. fst (f (x \<otimes>\<^bsub>G\<^esub> y)) = fst (f x) \<otimes>\<^bsub>H\<^esub> fst (f y); snd \<circ> f \<in> carrier G \<rightarrow> carrier K; \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. snd (f (x \<otimes>\<^bsub>G\<^esub> y)) = snd (f x) \<otimes>\<^bsub>K\<^esub> snd (f y); x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> f (x \<otimes>\<^bsub>G\<^esub> y) = (fst (f x) \<otimes>\<^bsub>H\<^esub> fst (f y), snd (f x) \<otimes>\<^bsub>K\<^esub> snd (f y))
[PROOF STEP]
apply (metis Product_Type.mem_Times_iff comp_eq_dest_lhs funcset_mem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>fst \<circ> f \<in> carrier G \<rightarrow> carrier H; \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. fst (f (x \<otimes>\<^bsub>G\<^esub> y)) = fst (f x) \<otimes>\<^bsub>H\<^esub> fst (f y); snd \<circ> f \<in> carrier G \<rightarrow> carrier K; \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. snd (f (x \<otimes>\<^bsub>G\<^esub> y)) = snd (f x) \<otimes>\<^bsub>K\<^esub> snd (f y); x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> f (x \<otimes>\<^bsub>G\<^esub> y) = (fst (f x) \<otimes>\<^bsub>H\<^esub> fst (f y), snd (f x) \<otimes>\<^bsub>K\<^esub> snd (f y))
[PROOF STEP]
by (metis mult_DirProd prod.collapse)


[STATEMENT]
lemma SA_Units_closed:
  assumes "f \<in> (Units (SA n))"
  shows "f \<in> carrier (SA n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier (SA n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> Units (SA n)

goal (1 subgoal):
 1. f \<in> carrier (SA n)
[PROOF STEP]
unfolding Units_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {y \<in> carrier (SA n). \<exists>x\<in>carrier (SA n). x \<otimes>\<^bsub>SA n\<^esub> y = \<one>\<^bsub>SA n\<^esub> \<and> y \<otimes>\<^bsub>SA n\<^esub> x = \<one>\<^bsub>SA n\<^esub>}

goal (1 subgoal):
 1. f \<in> carrier (SA n)
[PROOF STEP]
by blast


[STATEMENT]
lemma insert_null_sets_lebesgue_on_iff [simp]:
  assumes "a \<in> S" "S \<in> sets lebesgue"
  shows "insert a N \<in> null_sets (lebesgue_on S) \<longleftrightarrow> N \<in> null_sets (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (insert a N \<in> null_sets (lebesgue_on S)) = (N \<in> null_sets (lebesgue_on S))
[PROOF STEP]
by (simp add: assms null_sets_restrict_space)


[STATEMENT]
lemma map_indets_monomial:
  "map_indets f (monomial c t) = monomial c (\<Sum>x\<in>keys t. Poly_Mapping.single (f x) (lookup t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_indets f (monomial c t) = monomial c (\<Sum>x\<in>keys t. monomial (lookup t x) (f x))
[PROOF STEP]
by (simp add: map_indets_def poly_subst_monomial subst_pp_def monomial_power_map_scale
      punit.monom_mult_monomial flip: punit.monomial_prod_sum)


[STATEMENT]
lemma circle_circline:
  assumes "cl = circle \<mu> r" and "r \<ge> 0"
  shows "cl = circline 1 (-\<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)
[PROOF STEP]
have "complex_of_real ((cmod \<mu>)\<^sup>2 - r\<^sup>2) = \<mu> * cnj \<mu> - complex_of_real (r\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cor ((cmod \<mu>)\<^sup>2 - r\<^sup>2) = \<mu> * cnj \<mu> - cor (r\<^sup>2)
[PROOF STEP]
by (auto simp add: complex_mult_cnj_cmod)
[PROOF STATE]
proof (state)
this:
cor ((cmod \<mu>)\<^sup>2 - r\<^sup>2) = \<mu> * cnj \<mu> - cor (r\<^sup>2)

goal (1 subgoal):
 1. cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)
[PROOF STEP]
thus "cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
cor ((cmod \<mu>)\<^sup>2 - r\<^sup>2) = \<mu> * cnj \<mu> - cor (r\<^sup>2)

goal (1 subgoal):
 1. cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cor ((cmod \<mu>)\<^sup>2 - r\<^sup>2) = \<mu> * cnj \<mu> - cor (r\<^sup>2)
cl = circle \<mu> r
0 \<le> r

goal (1 subgoal):
 1. cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)
[PROOF STEP]
using circle_equation[of r \<mu>]
[PROOF STATE]
proof (prove)
using this:
cor ((cmod \<mu>)\<^sup>2 - r\<^sup>2) = \<mu> * cnj \<mu> - cor (r\<^sup>2)
cl = circle \<mu> r
0 \<le> r
0 \<le> r \<Longrightarrow> circle \<mu> r = {z. z * cnj z - z * cnj \<mu> - cnj z * \<mu> + \<mu> * cnj \<mu> - cor (r * r) = 0}

goal (1 subgoal):
 1. cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)
[PROOF STEP]
unfolding circline_def power2_eq_square
[PROOF STATE]
proof (prove)
using this:
cor (cmod \<mu> * cmod \<mu> - r * r) = \<mu> * cnj \<mu> - cor (r * r)
cl = circle \<mu> r
0 \<le> r
0 \<le> r \<Longrightarrow> circle \<mu> r = {z. z * cnj z - z * cnj \<mu> - cnj z * \<mu> + \<mu> * cnj \<mu> - cor (r * r) = 0}

goal (1 subgoal):
 1. cl = {z. cor 1 * z * cnj z + cnj (- \<mu>) * z + - \<mu> * cnj z + cor (cmod \<mu> * cmod \<mu> - r * r) = 0}
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
cl = circline 1 (- \<mu>) ((cmod \<mu>)\<^sup>2 - r\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_1_element:
  assumes "card E = 1"
  shows "\<exists>a. E = {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
card E = 1
[PROOF STEP]
obtain a where "a \<in> E"
[PROOF STATE]
proof (prove)
using this:
card E = 1

goal (1 subgoal):
 1. (\<And>a. a \<in> E \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<in> E

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
let ?E' = "E - {a}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
have "finite ?E'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (E - {a})
[PROOF STEP]
using assms card_ge_0_finite
[PROOF STATE]
proof (prove)
using this:
card E = 1
0 < card ?A \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (E - {a})
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
finite (E - {a})

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
hence "card (insert a ?E') = 1 + card ?E'"
[PROOF STATE]
proof (prove)
using this:
finite (E - {a})

goal (1 subgoal):
 1. card (insert a (E - {a})) = 1 + card (E - {a})
[PROOF STEP]
using card.insert_remove
[PROOF STATE]
proof (prove)
using this:
finite (E - {a})
finite ?A \<Longrightarrow> card (insert ?x ?A) = Suc (card (?A - {?x}))

goal (1 subgoal):
 1. card (insert a (E - {a})) = 1 + card (E - {a})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card (insert a (E - {a})) = 1 + card (E - {a})

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (insert a (E - {a})) = 1 + card (E - {a})

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
have "E = insert a ?E'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E = insert a (E - {a})
[PROOF STEP]
using \<open>a \<in> E\<close>
[PROOF STATE]
proof (prove)
using this:
a \<in> E

goal (1 subgoal):
 1. E = insert a (E - {a})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
E = insert a (E - {a})

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (insert a (E - {a})) = 1 + card (E - {a})
E = insert a (E - {a})
[PROOF STEP]
have "card E = 1 + card ?E'"
[PROOF STATE]
proof (prove)
using this:
card (insert a (E - {a})) = 1 + card (E - {a})
E = insert a (E - {a})

goal (1 subgoal):
 1. card E = 1 + card (E - {a})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card E = 1 + card (E - {a})

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
hence "card ?E' = 0"
[PROOF STATE]
proof (prove)
using this:
card E = 1 + card (E - {a})

goal (1 subgoal):
 1. card (E - {a}) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card E = 1 + card (E - {a})
card E = 1

goal (1 subgoal):
 1. card (E - {a}) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (E - {a}) = 0

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
hence "?E' = {}"
[PROOF STATE]
proof (prove)
using this:
card (E - {a}) = 0

goal (1 subgoal):
 1. E - {a} = {}
[PROOF STEP]
using \<open>finite ?E'\<close>
[PROOF STATE]
proof (prove)
using this:
card (E - {a}) = 0
finite (E - {a})

goal (1 subgoal):
 1. E - {a} = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
E - {a} = {}

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
E - {a} = {}

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
using \<open>a \<in> E\<close>
[PROOF STATE]
proof (prove)
using this:
E - {a} = {}
a \<in> E

goal (1 subgoal):
 1. \<exists>a. E = {a}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. E = {a}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interior_closed_Un_empty_interior:
  assumes cS: "closed S"
    and iT: "interior T = {}"
  shows "interior (S \<union> T) = interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (S \<union> T) = interior S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. interior (S \<union> T) \<subseteq> interior S
 2. interior S \<subseteq> interior (S \<union> T)
[PROOF STEP]
show "interior S \<subseteq> interior (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior S \<subseteq> interior (S \<union> T)
[PROOF STEP]
by (rule interior_mono) (rule Un_upper1)
[PROOF STATE]
proof (state)
this:
interior S \<subseteq> interior (S \<union> T)

goal (1 subgoal):
 1. interior (S \<union> T) \<subseteq> interior S
[PROOF STEP]
show "interior (S \<union> T) \<subseteq> interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (S \<union> T) \<subseteq> interior S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior (S \<union> T) \<Longrightarrow> x \<in> interior S
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior (S \<union> T) \<Longrightarrow> x \<in> interior S
[PROOF STEP]
assume "x \<in> interior (S \<union> T)"
[PROOF STATE]
proof (state)
this:
x \<in> interior (S \<union> T)

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

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

goal (1 subgoal):
 1. \<And>x. x \<in> interior (S \<union> T) \<Longrightarrow> x \<in> interior S
[PROOF STEP]
show "x \<in> interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> interior S
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> interior S \<Longrightarrow> False
[PROOF STEP]
assume "x \<notin> interior S"
[PROOF STATE]
proof (state)
this:
x \<notin> interior S

goal (1 subgoal):
 1. x \<notin> interior S \<Longrightarrow> False
[PROOF STEP]
with \<open>x \<in> R\<close> \<open>open R\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> R
open R
x \<notin> interior S
[PROOF STEP]
obtain y where "y \<in> R - S"
[PROOF STATE]
proof (prove)
using this:
x \<in> R
open R
x \<notin> interior S

goal (1 subgoal):
 1. (\<And>y. y \<in> R - S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding interior_def
[PROOF STATE]
proof (prove)
using this:
x \<in> R
open R
x \<notin> \<Union> {T. open T \<and> T \<subseteq> S}

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

goal (1 subgoal):
 1. x \<notin> interior S \<Longrightarrow> False
[PROOF STEP]
from \<open>open R\<close> \<open>closed S\<close>
[PROOF STATE]
proof (chain)
picking this:
open R
closed S
[PROOF STEP]
have "open (R - S)"
[PROOF STATE]
proof (prove)
using this:
open R
closed S

goal (1 subgoal):
 1. open (R - S)
[PROOF STEP]
by (rule open_Diff)
[PROOF STATE]
proof (state)
this:
open (R - S)

goal (1 subgoal):
 1. x \<notin> interior S \<Longrightarrow> False
[PROOF STEP]
from \<open>R \<subseteq> S \<union> T\<close>
[PROOF STATE]
proof (chain)
picking this:
R \<subseteq> S \<union> T
[PROOF STEP]
have "R - S \<subseteq> T"
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> S \<union> T

goal (1 subgoal):
 1. R - S \<subseteq> T
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
R - S \<subseteq> T

goal (1 subgoal):
 1. x \<notin> interior S \<Longrightarrow> False
[PROOF STEP]
from \<open>y \<in> R - S\<close> \<open>open (R - S)\<close> \<open>R - S \<subseteq> T\<close> \<open>interior T = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
y \<in> R - S
open (R - S)
R - S \<subseteq> T
interior T = {}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y \<in> R - S
open (R - S)
R - S \<subseteq> T
interior T = {}

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding interior_def
[PROOF STATE]
proof (prove)
using this:
y \<in> R - S
open (R - S)
R - S \<subseteq> T
\<Union> {Ta. open Ta \<and> Ta \<subseteq> T} = {}

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
interior (S \<union> T) \<subseteq> interior S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [iff]: "(s -c1;c2-n\<rightarrow> u) = (\<exists>t. s -c1-n\<rightarrow> t \<and> t -c2-n\<rightarrow> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s -c1; c2-n\<rightarrow> u) = (\<exists>t. s -c1-n\<rightarrow> t \<and> t -c2-n\<rightarrow> u)
[PROOF STEP]
by(best elim: execn.cases intro:execn.intros)


[STATEMENT]
lemma stc_minus: "y \<in> HFinite \<Longrightarrow> stc(-y) = -stc(y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> HFinite \<Longrightarrow> stc (- y) = - stc y
[PROOF STEP]
by (simp add: stc_unique stc_SComplex stc_approx_self approx_minus)


[STATEMENT]
lemma asymp_equiv_at_top_imp_at_right:
  "(\<lambda>x. f (a + inverse x)) \<sim>[at_top] (\<lambda>x. g (a + inverse x)) \<Longrightarrow> f \<sim>[at_right a] g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (a + inverse x)) \<sim>[at_top] (\<lambda>x. g (a + inverse x)) \<Longrightarrow> f \<sim>[at_right a] g
[PROOF STEP]
by (simp add: at_right_to_top' asymp_equiv_filtermap_iff)


[STATEMENT]
lemma fresh_variable_types: "\<exists>n. new_tv n (t::typ)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. new_tv n t
[PROOF STEP]
apply (unfold new_tv_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. \<forall>m. m \<in> free_tv t \<longrightarrow> m < n
[PROOF STEP]
apply (induction t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<exists>n. \<forall>m. m \<in> free_tv (TVar x) \<longrightarrow> m < n
 2. \<And>t1 t2. \<lbrakk>\<exists>n. \<forall>m. m \<in> free_tv t1 \<longrightarrow> m < n; \<exists>n. \<forall>m. m \<in> free_tv t2 \<longrightarrow> m < n\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>m. m \<in> free_tv (t1 -> t2) \<longrightarrow> m < n
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t1 t2. \<lbrakk>\<exists>n. \<forall>m. m \<in> free_tv t1 \<longrightarrow> m < n; \<exists>n. \<forall>m. m \<in> free_tv t2 \<longrightarrow> m < n\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>m. m \<in> free_tv (t1 -> t2) \<longrightarrow> m < n
[PROOF STEP]
by (metis less_trans linorder_cases new_tv_Fun new_tv_def)


[STATEMENT]
lemma list_all2_check_before: "list_all2 (\<lambda>x y. triple_eq_pair x y f g) xs (zip ys zs) \<Longrightarrow>
  (\<And>y. y \<in> set ys \<Longrightarrow> \<not>enat y + right I < nt) \<Longrightarrow> x \<in> set xs \<Longrightarrow> \<not>check_before I nt x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 (\<lambda>x y. triple_eq_pair x y f g) xs (zip ys zs); \<And>y. y \<in> set ys \<Longrightarrow> \<not> enat y + right I < enat nt; x \<in> set xs\<rbrakk> \<Longrightarrow> \<not> check_before I nt x
[PROOF STEP]
by (auto simp: in_set_zip elim!: list_all2_in_setE triple_eq_pair.elims)


[STATEMENT]
lemma (in linordered_nonzero_semiring) prod_nonneg: "(\<forall>a\<in>A. 0 \<le> f a) \<Longrightarrow> 0 \<le> prod f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>A. (0::'a) \<le> f a \<Longrightarrow> (0::'a) \<le> prod f A
[PROOF STEP]
by (induct A rule: infinite_finite_induct) simp_all


[STATEMENT]
lemma fmap_neq:
  fixes s :: "('a, bool) fmap" and s' :: "('a, bool) fmap"
  assumes "(fmdom' s = fmdom' s')"
  shows "((s \<noteq> s') \<longleftrightarrow> (\<exists>v\<in>(fmdom' s). fmlookup s v \<noteq> fmlookup s' v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<noteq> s') = (\<exists>v\<in>fmdom' s. fmlookup s v \<noteq> fmlookup s' v)
[PROOF STEP]
using assms fmap_ext fmdom'_notD
[PROOF STATE]
proof (prove)
using this:
fmdom' s = fmdom' s'
(\<And>x. fmlookup ?m x = fmlookup ?n x) \<Longrightarrow> ?m = ?n
?x \<notin> fmdom' ?m \<Longrightarrow> fmlookup ?m ?x = None

goal (1 subgoal):
 1. (s \<noteq> s') = (\<exists>v\<in>fmdom' s. fmlookup s v \<noteq> fmlookup s' v)
[PROOF STEP]
by metis

\<comment> \<open>NOTE added lemma.\<close>


[STATEMENT]
lemma bag_bound_V: "t \<in> V\<^bsub>T\<^esub> \<Longrightarrow> card (bag t) \<le> card V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> V\<^bsub>T\<^esub> \<Longrightarrow> card (bag t) \<le> card V
[PROOF STEP]
by (simp add: bags_in_V card_mono finite_vertex_set)


[STATEMENT]
lemma mkuexpr_plus [mkuexpr]: "mk\<^sub>e (\<lambda> s. f s + g s) = mk\<^sub>e f + mk\<^sub>e g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk\<^sub>e (\<lambda>s. f s + g s) = mk\<^sub>e f + mk\<^sub>e g
[PROOF STEP]
by (simp add: plus_uexpr_def, transfer, simp)


[STATEMENT]
lemma isCont_divide[continuous_intros, simp]:
  fixes f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_field"
  assumes "isCont f a" "isCont g a" "g a \<noteq> 0"
  shows "isCont (\<lambda>x. (f x) / g x) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. f x / g x) a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isCont f a
isCont g a
g a \<noteq> (0::'b)

goal (1 subgoal):
 1. isCont (\<lambda>x. f x / g x) a
[PROOF STEP]
unfolding continuous_at
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>a\<rightarrow> f a
g \<midarrow>a\<rightarrow> g a
g a \<noteq> (0::'b)

goal (1 subgoal):
 1. (\<lambda>x. f x / g x) \<midarrow>a\<rightarrow> f a / g a
[PROOF STEP]
by (rule tendsto_divide)


[STATEMENT]
lemma smc_prod_composable_arrs_dg_prod:
  "composable_arrs (\<Prod>\<^sub>D\<^sub>Gi\<in>\<^sub>\<circ>I. \<AA> i) = composable_arrs (\<Prod>\<^sub>S\<^sub>M\<^sub>Ci\<in>\<^sub>\<circ>I. \<AA> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composable_arrs (dg_prod I \<AA>) = composable_arrs (smc_prod I \<AA>)
[PROOF STEP]
unfolding composable_arrs_def smc_prod_dg_prod_is_arr
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.set {[g, f]\<^sub>\<circ> |g f. \<exists>a b c. g : b \<mapsto>\<^bsub>smc_prod I \<AA>\<^esub> c \<and> f : a \<mapsto>\<^bsub>smc_prod I \<AA>\<^esub> b} = ZFC_in_HOL.set {[g, f]\<^sub>\<circ> |g f. \<exists>a b c. g : b \<mapsto>\<^bsub>smc_prod I \<AA>\<^esub> c \<and> f : a \<mapsto>\<^bsub>smc_prod I \<AA>\<^esub> b}
[PROOF STEP]
by simp


[STATEMENT]
lemma comm_drop_exps_conv: "u\<^sup>@Suc m \<cdot> v\<^sup>@Suc k = v\<^sup>@Suc k \<cdot> u\<^sup>@Suc m \<longleftrightarrow> u \<cdot> v = v \<cdot> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<^sup>@ Suc m \<cdot> v \<^sup>@ Suc k = v \<^sup>@ Suc k \<cdot> u \<^sup>@ Suc m) = (u \<cdot> v = v \<cdot> u)
[PROOF STEP]
by (meson comm_add_exps comm_drop_exps)


[STATEMENT]
lemma to_language_Un[simp]: "to_language (A \<union> B) = Plus (to_language A) (to_language B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_language (A \<union> B) = Plus (to_language A) (to_language B)
[PROOF STEP]
by (coinduction arbitrary: A B) (auto simp: Collect_disj_eq)