[STATEMENT]
lemma special_hyperplane_span:
  fixes S :: "'n::euclidean_space set"
  assumes "k \<in> Basis"
  shows "{x. k \<bullet> x = 0} = span (Basis - {k})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. k \<bullet> x = 0} = span (Basis - {k})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. k \<bullet> x = 0} = span (Basis - {k})
[PROOF STEP]
have *: "x \<in> span (Basis - {k})" if "k \<bullet> x = 0" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> span (Basis - {k})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> span (Basis - {k})
[PROOF STEP]
have "x = (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b)
[PROOF STEP]
by (simp add: euclidean_representation)
[PROOF STATE]
proof (state)
this:
x = (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. x \<in> span (Basis - {k})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. x \<in> span (Basis - {k})
[PROOF STEP]
have "... = (\<Sum>b \<in> Basis - {k}. (x \<bullet> b) *\<^sub>R b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b) = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)
[PROOF STEP]
by (auto simp: sum.remove [of _ k] inner_commute assms that)
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b) = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. x \<in> span (Basis - {k})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)
[PROOF STEP]
have "x = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)"
[PROOF STATE]
proof (prove)
using this:
x = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. x = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. x \<in> span (Basis - {k})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = (\<Sum>b\<in>Basis - {k}. (x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. x \<in> span (Basis - {k})
[PROOF STEP]
by (simp add: span_finite)
[PROOF STATE]
proof (state)
this:
x \<in> span (Basis - {k})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
k \<bullet> ?x = 0 \<Longrightarrow> ?x \<in> span (Basis - {k})

goal (1 subgoal):
 1. {x. k \<bullet> x = 0} = span (Basis - {k})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. k \<bullet> x = 0} = span (Basis - {k})
[PROOF STEP]
apply (rule span_subspace [symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. Basis - {k} \<subseteq> {x. k \<bullet> x = 0}
 2. {x. k \<bullet> x = 0} \<subseteq> span (Basis - {k})
 3. subspace {x. k \<bullet> x = 0}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<in> Basis

goal (3 subgoals):
 1. Basis - {k} \<subseteq> {x. k \<bullet> x = 0}
 2. {x. k \<bullet> x = 0} \<subseteq> span (Basis - {k})
 3. subspace {x. k \<bullet> x = 0}
[PROOF STEP]
apply (auto simp: inner_not_same_Basis intro: * subspace_hyperplane)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
{x. k \<bullet> x = 0} = span (Basis - {k})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtrancl_on_sym:
  assumes "sym r" shows "sym (rtrancl_on F r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (rtrancl_on F r)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sym r

goal (1 subgoal):
 1. sym (rtrancl_on F r)
[PROOF STEP]
by (auto simp: sym_conv_converse_eq intro: symI dest: rtrancl_on_converseI)


[STATEMENT]
lemma fls_subdegree_leI: "f $$ n \<noteq> 0 \<Longrightarrow> fls_subdegree f \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f $$ n \<noteq> (0::'a) \<Longrightarrow> fls_subdegree f \<le> n
[PROOF STEP]
using Least1_le[OF unique_fls_subdegree]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f1 \<noteq> 0; ?f1 $$ ?z \<noteq> (0::?'a1)\<rbrakk> \<Longrightarrow> (LEAST n. ?f1 $$ n \<noteq> (0::?'a1)) \<le> ?z

goal (1 subgoal):
 1. f $$ n \<noteq> (0::'a) \<Longrightarrow> fls_subdegree f \<le> n
[PROOF STEP]
by    (auto simp: fls_subdegree_def)


[STATEMENT]
lemma isometry_with_fixed_point_is_elliptic:
  assumes "isometry f" "f x = x"
  shows "elliptic_isometry f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elliptic_isometry f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. elliptic_isometry f
[PROOF STEP]
have *: "(f^^n) x = x" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ n) x = x
[PROOF STEP]
apply (induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f ^^ 0) x = x
 2. \<And>n. (f ^^ n) x = x \<Longrightarrow> (f ^^ Suc n) x = x
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
f x = x

goal (2 subgoals):
 1. (f ^^ 0) x = x
 2. \<And>n. (f ^^ n) x = x \<Longrightarrow> (f ^^ Suc n) x = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f ^^ ?n) x = x

goal (1 subgoal):
 1. elliptic_isometry f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elliptic_isometry f
[PROOF STEP]
apply (rule elliptic_isometryI[of _ x, OF _ assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded {(f ^^ n) x |n. True}
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded {uu_. \<exists>n. uu_ = x \<and> True}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
elliptic_isometry f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_lt_neutral: "a + b < b \<Longrightarrow> a < \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + b < b \<Longrightarrow> a < \<one>
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>a + b < b; \<not> a < \<one>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "a + b < b" "\<not> a < \<one>"
[PROOF STATE]
proof (state)
this:
a + b < b
\<not> a < \<one>

goal (1 subgoal):
 1. \<lbrakk>a + b < b; \<not> a < \<one>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "a \<ge> \<one>"
[PROOF STATE]
proof (prove)
using this:
a + b < b
\<not> a < \<one>

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

goal (1 subgoal):
 1. \<lbrakk>a + b < b; \<not> a < \<one>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from add_mono[OF this, of b b] \<open>a + b < b\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<le> b \<Longrightarrow> \<one> + b \<le> a + b
a + b < b
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
b \<le> b \<Longrightarrow> \<one> + b \<le> a + b
a + b < b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniform_limit_on_UNION:
  assumes "finite S"
  assumes "\<And>s. s \<in> S \<Longrightarrow> uniform_limit (h s) f g F"
  shows "uniform_limit (\<Union>(h ` S)) f g F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit (\<Union> (h ` S)) f g F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S
?s \<in> S \<Longrightarrow> uniform_limit (h ?s) f g F

goal (1 subgoal):
 1. uniform_limit (\<Union> (h ` S)) f g F
[PROOF STEP]
by induct (auto intro: uniform_limit_on_empty uniform_limit_on_Un)


[STATEMENT]
lemma ternary_ternary_eval_idempotence_Not:
  "ternary_ternary_eval (TernaryNot (TernaryNot a)) = ternary_ternary_eval a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ternary_ternary_eval (TernaryNot (TernaryNot a)) = ternary_ternary_eval a
[PROOF STEP]
by (simp add: eval_ternary_idempotence_Not)


[STATEMENT]
lemma unitary_diag_imp_unitarily_equiv[simp]:
assumes "unitary_diag A B U"
shows "unitarily_equiv A B U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitarily_equiv A B U
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitary_diag A B U

goal (1 subgoal):
 1. unitarily_equiv A B U
[PROOF STEP]
unfolding unitary_diag_def
[PROOF STATE]
proof (prove)
using this:
unitarily_equiv A B U \<and> diagonal_mat B

goal (1 subgoal):
 1. unitarily_equiv A B U
[PROOF STEP]
by simp


[STATEMENT]
lemma coprime_dvd_aux:
  assumes "gcd m n = Suc 0" "na dvd n" "ma dvd m" "mb dvd m" "nb dvd n" and eq: "ma * na = mb * nb"
  shows "ma = mb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ma = mb
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ma = mb
[PROOF STEP]
have "gcd na mb = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd na mb = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
gcd m n = Suc 0
na dvd n
ma dvd m
mb dvd m
nb dvd n
ma * na = mb * nb

goal (1 subgoal):
 1. gcd na mb = 1
[PROOF STEP]
by (metis One_nat_def gcd.commute gcd_nat.mono is_unit_gcd_iff)
[PROOF STATE]
proof (state)
this:
gcd na mb = 1

goal (1 subgoal):
 1. ma = mb
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
gcd na mb = 1

goal (1 subgoal):
 1. ma = mb
[PROOF STEP]
have "gcd nb ma = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd nb ma = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
gcd m n = Suc 0
na dvd n
ma dvd m
mb dvd m
nb dvd n
ma * na = mb * nb

goal (1 subgoal):
 1. gcd nb ma = 1
[PROOF STEP]
by (metis One_nat_def gcd.commute gcd_nat.mono is_unit_gcd_iff)
[PROOF STATE]
proof (state)
this:
gcd nb ma = 1

goal (1 subgoal):
 1. ma = mb
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
gcd na mb = 1
gcd nb ma = 1
[PROOF STEP]
show "ma = mb"
[PROOF STATE]
proof (prove)
using this:
gcd na mb = 1
gcd nb ma = 1

goal (1 subgoal):
 1. ma = mb
[PROOF STEP]
by (metis eq gcd_mult_distrib_nat mult.commute nat_mult_1_right)
[PROOF STATE]
proof (state)
this:
ma = mb

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem ustar_inductr:
  assumes "Q \<sqsubseteq> R" "Q \<sqsubseteq> Q ;; P"
  shows "Q \<sqsubseteq> R ;; P\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q \<sqsubseteq> R ;; P\<^sup>\<star>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Q \<sqsubseteq> R ;; P\<^sup>\<star>
[PROOF STEP]
have "R ;; P\<^sup>\<star> = (\<Sqinter> i. R ;; P \<^bold>^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R ;; P\<^sup>\<star> = \<Or>range (\<lambda>i. R ;; power.power II (;;) P i)
[PROOF STEP]
by (simp add: ustar_def UINF_as_Sup_collect' seq_SUP_distl)
[PROOF STATE]
proof (state)
this:
R ;; P\<^sup>\<star> = \<Or>range (\<lambda>i. R ;; power.power II (;;) P i)

goal (1 subgoal):
 1. Q \<sqsubseteq> R ;; P\<^sup>\<star>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R ;; P\<^sup>\<star> = \<Or>range (\<lambda>i. R ;; power.power II (;;) P i)

goal (1 subgoal):
 1. Q \<sqsubseteq> R ;; P\<^sup>\<star>
[PROOF STEP]
have "Q \<sqsubseteq> ..."
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q \<sqsubseteq> \<Or>range (\<lambda>i. R ;; power.power II (;;) P i)
[PROOF STEP]
by (simp add: SUP_least assms upower_inductr)
[PROOF STATE]
proof (state)
this:
Q \<sqsubseteq> \<Or>range (\<lambda>i. R ;; power.power II (;;) P i)

goal (1 subgoal):
 1. Q \<sqsubseteq> R ;; P\<^sup>\<star>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Q \<sqsubseteq> R ;; P\<^sup>\<star>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Q \<sqsubseteq> R ;; P\<^sup>\<star>

goal (1 subgoal):
 1. Q \<sqsubseteq> R ;; P\<^sup>\<star>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Q \<sqsubseteq> R ;; P\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compatible_complement_pair2:
  assumes [simp]: \<open>compatible F G\<close>
  shows \<open>compatible G (complement (F;G))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compatible G (complement (F;G))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compatible G (complement (F;G))
[PROOF STEP]
have \<open>compatible (F;G) (complement (F;G))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compatible (F;G) (complement (F;G))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compatible (F;G) (complement (F;G))

goal (1 subgoal):
 1. compatible G (complement (F;G))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compatible (F;G) (complement (F;G))
[PROOF STEP]
have \<open>compatible ((F;G) o Snd) (complement (F;G))\<close>
[PROOF STATE]
proof (prove)
using this:
compatible (F;G) (complement (F;G))

goal (1 subgoal):
 1. compatible ((F;G) \<circ> Snd) (complement (F;G))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compatible ((F;G) \<circ> Snd) (complement (F;G))

goal (1 subgoal):
 1. compatible G (complement (F;G))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compatible ((F;G) \<circ> Snd) (complement (F;G))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
compatible ((F;G) \<circ> Snd) (complement (F;G))

goal (1 subgoal):
 1. compatible G (complement (F;G))
[PROOF STEP]
by (auto simp: register_pair_Snd)
[PROOF STATE]
proof (state)
this:
compatible G (complement (F;G))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_noteq_1_has_more:
  assumes card:"Cond ES"
  and e_in: "(X, xrhs) \<in> ES"
  and finite: "finite ES"
  shows "\<exists>(Y, yrhs) \<in> ES. (X, xrhs) \<noteq> (Y, yrhs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>(Y, yrhs)\<in>ES. (X, xrhs) \<noteq> (Y, yrhs)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>(Y, yrhs)\<in>ES. (X, xrhs) \<noteq> (Y, yrhs)
[PROOF STEP]
have "card ES > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < card ES
[PROOF STEP]
using card e_in finite
[PROOF STATE]
proof (prove)
using this:
Cond ES
(X, xrhs) \<in> ES
finite ES

goal (1 subgoal):
 1. 1 < card ES
[PROOF STEP]
by (cases "card ES") (auto)
[PROOF STATE]
proof (state)
this:
1 < card ES

goal (1 subgoal):
 1. \<exists>(Y, yrhs)\<in>ES. (X, xrhs) \<noteq> (Y, yrhs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < card ES
[PROOF STEP]
have "card (ES - {(X, xrhs)}) > 0"
[PROOF STATE]
proof (prove)
using this:
1 < card ES

goal (1 subgoal):
 1. 0 < card (ES - {(X, xrhs)})
[PROOF STEP]
using finite e_in
[PROOF STATE]
proof (prove)
using this:
1 < card ES
finite ES
(X, xrhs) \<in> ES

goal (1 subgoal):
 1. 0 < card (ES - {(X, xrhs)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < card (ES - {(X, xrhs)})

goal (1 subgoal):
 1. \<exists>(Y, yrhs)\<in>ES. (X, xrhs) \<noteq> (Y, yrhs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < card (ES - {(X, xrhs)})
[PROOF STEP]
have "(ES - {(X, xrhs)}) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
0 < card (ES - {(X, xrhs)})

goal (1 subgoal):
 1. ES - {(X, xrhs)} \<noteq> {}
[PROOF STEP]
using finite
[PROOF STATE]
proof (prove)
using this:
0 < card (ES - {(X, xrhs)})
finite ES

goal (1 subgoal):
 1. ES - {(X, xrhs)} \<noteq> {}
[PROOF STEP]
by (rule_tac notI, simp)
[PROOF STATE]
proof (state)
this:
ES - {(X, xrhs)} \<noteq> {}

goal (1 subgoal):
 1. \<exists>(Y, yrhs)\<in>ES. (X, xrhs) \<noteq> (Y, yrhs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ES - {(X, xrhs)} \<noteq> {}
[PROOF STEP]
show "\<exists>(Y, yrhs) \<in> ES. (X, xrhs) \<noteq> (Y, yrhs)"
[PROOF STATE]
proof (prove)
using this:
ES - {(X, xrhs)} \<noteq> {}

goal (1 subgoal):
 1. \<exists>(Y, yrhs)\<in>ES. (X, xrhs) \<noteq> (Y, yrhs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>(Y, yrhs)\<in>ES. (X, xrhs) \<noteq> (Y, yrhs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nfv_card: "nfv \<phi> = card (fv_fo_fmla \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfv \<phi> = card (fv_fo_fmla \<phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nfv \<phi> = card (fv_fo_fmla \<phi>)
[PROOF STEP]
have "distinct (fv_fo_fmla_list \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (fv_fo_fmla_list \<phi>)
[PROOF STEP]
using sorted_distinct_fv_list
[PROOF STATE]
proof (prove)
using this:
sorted_distinct (fv_fo_fmla_list ?\<phi>)

goal (1 subgoal):
 1. distinct (fv_fo_fmla_list \<phi>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (fv_fo_fmla_list \<phi>)

goal (1 subgoal):
 1. nfv \<phi> = card (fv_fo_fmla \<phi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (fv_fo_fmla_list \<phi>)
[PROOF STEP]
have "length (fv_fo_fmla_list \<phi>) = card (set (fv_fo_fmla_list \<phi>))"
[PROOF STATE]
proof (prove)
using this:
distinct (fv_fo_fmla_list \<phi>)

goal (1 subgoal):
 1. length (fv_fo_fmla_list \<phi>) = card (set (fv_fo_fmla_list \<phi>))
[PROOF STEP]
using distinct_card
[PROOF STATE]
proof (prove)
using this:
distinct (fv_fo_fmla_list \<phi>)
distinct ?xs \<Longrightarrow> card (set ?xs) = length ?xs

goal (1 subgoal):
 1. length (fv_fo_fmla_list \<phi>) = card (set (fv_fo_fmla_list \<phi>))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
length (fv_fo_fmla_list \<phi>) = card (set (fv_fo_fmla_list \<phi>))

goal (1 subgoal):
 1. nfv \<phi> = card (fv_fo_fmla \<phi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length (fv_fo_fmla_list \<phi>) = card (set (fv_fo_fmla_list \<phi>))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (fv_fo_fmla_list \<phi>) = card (set (fv_fo_fmla_list \<phi>))

goal (1 subgoal):
 1. nfv \<phi> = card (fv_fo_fmla \<phi>)
[PROOF STEP]
unfolding fv_fo_fmla_list_set
[PROOF STATE]
proof (prove)
using this:
length (fv_fo_fmla_list \<phi>) = card (fv_fo_fmla \<phi>)

goal (1 subgoal):
 1. nfv \<phi> = card (fv_fo_fmla \<phi>)
[PROOF STEP]
by (auto simp: nfv_def)
[PROOF STATE]
proof (state)
this:
nfv \<phi> = card (fv_fo_fmla \<phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_le_antisym: "\<lbrakk> f \<subseteq>\<^sub>m g; g \<subseteq>\<^sub>m f \<rbrakk> \<Longrightarrow> f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<subseteq>\<^sub>m g; g \<subseteq>\<^sub>m f\<rbrakk> \<Longrightarrow> f = g
[PROOF STEP]
unfolding map_le_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>a\<in>dom f. f a = g a; \<forall>a\<in>dom g. g a = f a\<rbrakk> \<Longrightarrow> f = g
[PROOF STEP]
by (metis ext domIff)


[STATEMENT]
lemma restrict_count_space_subset:
  "A \<subseteq> B \<Longrightarrow> restrict_space (count_space B) A = count_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> restrict_space (count_space B) A = count_space A
[PROOF STEP]
by (subst restrict_count_space) (simp_all add: Int_absorb2)


[STATEMENT]
lemma pmaxsimpchainD_distinct: "pmaxsimpchain xs \<Longrightarrow> distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmaxsimpchain xs \<Longrightarrow> distinct xs
[PROOF STEP]
using pmaxsimpchain_def
[PROOF STATE]
proof (prove)
using this:
pmaxsimpchain ?xs \<equiv> Ball (set ?xs) maxsimp \<and> padjacentchain ?xs

goal (1 subgoal):
 1. pmaxsimpchain xs \<Longrightarrow> distinct xs
[PROOF STEP]
by fast


[STATEMENT]
lemma smult_map_poly: "smult a = map_poly ((*) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult a = map_poly ((*) a)
[PROOF STEP]
by (rule ext, rule poly_eqI, subst coeff_map_poly, auto)


[STATEMENT]
lemma matrix_point_in_block: "i < \<v> \<Longrightarrow> j < \<b> \<Longrightarrow> N $$ (i, j) = 1 \<Longrightarrow> \<V>s ! i \<in> \<B>s ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < \<v>; j < \<b>; N $$ (i, j) = 1\<rbrakk> \<Longrightarrow> \<V>s ! i \<in> \<B>s ! j
[PROOF STEP]
by (metis blocks_list_length points_list_length  inc_matrix_point_in_block)


[STATEMENT]
lemma a_very_costrict: "ad x = 1 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ad x = (1::'a)) = (x = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ad x = (1::'a) \<Longrightarrow> x = 0
 2. x = 0 \<Longrightarrow> ad x = (1::'a)
[PROOF STEP]
assume a: "ad x = 1"
[PROOF STATE]
proof (state)
this:
ad x = (1::'a)

goal (2 subgoals):
 1. ad x = (1::'a) \<Longrightarrow> x = 0
 2. x = 0 \<Longrightarrow> ad x = (1::'a)
[PROOF STEP]
hence "0 = ad x \<cdot> x"
[PROOF STATE]
proof (prove)
using this:
ad x = (1::'a)

goal (1 subgoal):
 1. 0 = ad x \<cdot> x
[PROOF STEP]
using a_zero_def
[PROOF STATE]
proof (prove)
using this:
ad x = (1::'a)
0 = ad (1::'a)

goal (1 subgoal):
 1. 0 = ad x \<cdot> x
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 = ad x \<cdot> x

goal (2 subgoals):
 1. ad x = (1::'a) \<Longrightarrow> x = 0
 2. x = 0 \<Longrightarrow> ad x = (1::'a)
[PROOF STEP]
thus "x = 0"
[PROOF STATE]
proof (prove)
using this:
0 = ad x \<cdot> x

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

goal (1 subgoal):
 1. x = 0 \<Longrightarrow> ad x = (1::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = 0 \<Longrightarrow> ad x = (1::'a)
[PROOF STEP]
assume "x = 0"
[PROOF STATE]
proof (state)
this:
x = 0

goal (1 subgoal):
 1. x = 0 \<Longrightarrow> ad x = (1::'a)
[PROOF STEP]
thus "ad x = 1"
[PROOF STATE]
proof (prove)
using this:
x = 0

goal (1 subgoal):
 1. ad x = (1::'a)
[PROOF STEP]
using a_zero_def am_d_def dm.dom_one
[PROOF STATE]
proof (prove)
using this:
x = 0
0 = ad (1::'a)
d ?x = ad (ad ?x)
d (1::'a) = (1::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_rat_le_1_iff [simp]: "(of_rat r :: 'a::linordered_field) \<le> 1 \<longleftrightarrow> r \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r \<le> (1::'a)) = (r \<le> 1)
[PROOF STEP]
using of_rat_less_eq [of r 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat r \<le> of_rat 1) = (r \<le> 1)

goal (1 subgoal):
 1. (of_rat r \<le> (1::'a)) = (r \<le> 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma injective:"\<lbrakk> inj_on f A; x \<in> A; y \<in> A; x \<noteq> y \<rbrakk> \<Longrightarrow> f x \<noteq> f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A; x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> f x \<noteq> f y
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A; x \<in> A; y \<in> A; x \<noteq> y; f x = f y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add:inj_on_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in comm_group) relations_zero_imp_pow_not_one:
  assumes "a \<in> A" "\<forall>f\<in>(relations A). f a = 0"
  shows "\<forall>z::int \<noteq> 0. a [^] z \<noteq> \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z. z \<noteq> 0 \<longrightarrow> a [^] z \<noteq> \<one>
[PROOF STEP]
proof (rule ccontr; safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>\<not> False; z \<noteq> 0; a [^] z = \<one>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix z::int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>\<not> False; z \<noteq> 0; a [^] z = \<one>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume z: "z \<noteq> 0" "a [^] z = \<one>"
[PROOF STATE]
proof (state)
this:
z \<noteq> 0
a [^] z = \<one>

goal (1 subgoal):
 1. \<And>z. \<lbrakk>\<not> False; z \<noteq> 0; a [^] z = \<one>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "restrict ((\<lambda>x. 0)(a := z)) A \<in> relations A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict ((\<lambda>x. 0)(a := z)) A \<in> relations A
[PROOF STEP]
by (intro in_relationsI finprod_one_eqI, use z in auto)
[PROOF STATE]
proof (state)
this:
restrict ((\<lambda>x. 0)(a := z)) A \<in> relations A

goal (1 subgoal):
 1. \<And>z. \<lbrakk>\<not> False; z \<noteq> 0; a [^] z = \<one>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
restrict ((\<lambda>x. 0)(a := z)) A \<in> relations A

goal (1 subgoal):
 1. False
[PROOF STEP]
using z assms
[PROOF STATE]
proof (prove)
using this:
restrict ((\<lambda>x. 0)(a := z)) A \<in> relations A
z \<noteq> 0
a [^] z = \<one>
a \<in> A
\<forall>f\<in>relations A. f a = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_generated_pair_UNIV:
  assumes sa_tb_u: "s*a+t*b = u" and u: "u dvd 1"
  shows "ideal_generated {a,b} = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {a, b} = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ideal_generated {a, b} = UNIV
[PROOF STEP]
have f: "finite {a,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a, b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {a, b}

goal (1 subgoal):
 1. ideal_generated {a, b} = UNIV
[PROOF STEP]
obtain inv_u where inv_u: "inv_u * u = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>inv_u. inv_u * u = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using u
[PROOF STATE]
proof (prove)
using this:
u dvd (1::'a)

goal (1 subgoal):
 1. (\<And>inv_u. inv_u * u = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. (1::'a) = u * k

goal (1 subgoal):
 1. (\<And>inv_u. inv_u * u = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis mult.commute)
[PROOF STATE]
proof (state)
this:
inv_u * u = (1::'a)

goal (1 subgoal):
 1. ideal_generated {a, b} = UNIV
[PROOF STEP]
have "x \<in> ideal_generated {a,b}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> ideal_generated {a, b}
[PROOF STEP]
proof (cases "a = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<Longrightarrow> x \<in> ideal_generated {a, b}
 2. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. a = b \<Longrightarrow> x \<in> ideal_generated {a, b}
 2. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. x \<in> ideal_generated {a, b}
[PROOF STEP]
by (metis UNIV_I dvd_def dvd_ideal_generated_singleton' ideal_generated_unit insert_absorb2
          mult.commute sa_tb_u semiring_normalization_rules(34) subsetI subset_antisym u)
[PROOF STATE]
proof (state)
this:
x \<in> ideal_generated {a, b}

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
note a_not_b = False
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
let ?f = "\<lambda>y. if y = a then inv_u * x * s else inv_u * x * t"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
have "(\<Sum>i\<in>{a,b}. ?f i * i) = ?f a * a + ?f b * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{a, b}. (if i = a then inv_u * x * s else inv_u * x * t) * i) = (if a = a then inv_u * x * s else inv_u * x * t) * a + (if b = a then inv_u * x * s else inv_u * x * t) * b
[PROOF STEP]
by (rule sum_two_elements[OF a_not_b])
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{a, b}. (if i = a then inv_u * x * s else inv_u * x * t) * i) = (if a = a then inv_u * x * s else inv_u * x * t) * a + (if b = a then inv_u * x * s else inv_u * x * t) * b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{a, b}. (if i = a then inv_u * x * s else inv_u * x * t) * i) = (if a = a then inv_u * x * s else inv_u * x * t) * a + (if b = a then inv_u * x * s else inv_u * x * t) * b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
have "... = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a = a then inv_u * x * s else inv_u * x * t) * a + (if b = a then inv_u * x * s else inv_u * x * t) * b = x
[PROOF STEP]
using a_not_b sa_tb_u inv_u
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
s * a + t * b = u
inv_u * u = (1::'a)

goal (1 subgoal):
 1. (if a = a then inv_u * x * s else inv_u * x * t) * a + (if b = a then inv_u * x * s else inv_u * x * t) * b = x
[PROOF STEP]
by (auto, metis mult_ac(1) mult_ac(2) ring_distribs(1) semiring_normalization_rules(12))
[PROOF STATE]
proof (state)
this:
(if a = a then inv_u * x * s else inv_u * x * t) * a + (if b = a then inv_u * x * s else inv_u * x * t) * b = x

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> x \<in> ideal_generated {a, b}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>{a, b}. (if i = a then inv_u * x * s else inv_u * x * t) * i) = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{a, b}. (if i = a then inv_u * x * s else inv_u * x * t) * i) = x

goal (1 subgoal):
 1. x \<in> ideal_generated {a, b}
[PROOF STEP]
unfolding ideal_explicit2[OF f]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{a, b}. (if i = a then inv_u * x * s else inv_u * x * t) * i) = x

goal (1 subgoal):
 1. x \<in> {y. \<exists>f. (\<Sum>i\<in>{a, b}. f i * i) = y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> ideal_generated {a, b}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> ideal_generated {a, b}

goal (1 subgoal):
 1. ideal_generated {a, b} = UNIV
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> ideal_generated {a, b}

goal (1 subgoal):
 1. ideal_generated {a, b} = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ideal_generated {a, b} = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma endo_comp:
  assumes "ChamberComplexEndomorphism X g"
  shows   "ChamberComplexEndomorphism X (g\<circ>f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ChamberComplexEndomorphism X (g \<circ> f)
[PROOF STEP]
proof (rule ChamberComplexEndomorphism.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ChamberComplexMorphism X X (g \<circ> f)
 2. ChamberComplexEndomorphism_axioms X (g \<circ> f)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
ChamberComplexEndomorphism X g
[PROOF STEP]
show "ChamberComplexMorphism X X (g\<circ>f)"
[PROOF STATE]
proof (prove)
using this:
ChamberComplexEndomorphism X g

goal (1 subgoal):
 1. ChamberComplexMorphism X X (g \<circ> f)
[PROOF STEP]
using comp ChamberComplexEndomorphism.axioms
[PROOF STATE]
proof (prove)
using this:
ChamberComplexEndomorphism X g
ChamberComplexMorphism X ?Z ?g \<Longrightarrow> ChamberComplexMorphism X ?Z (?g \<circ> f)
ChamberComplexEndomorphism ?X ?f \<Longrightarrow> ChamberComplexMorphism ?X ?X ?f
ChamberComplexEndomorphism ?X ?f \<Longrightarrow> ChamberComplexEndomorphism_axioms ?X ?f

goal (1 subgoal):
 1. ChamberComplexMorphism X X (g \<circ> f)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
ChamberComplexMorphism X X (g \<circ> f)

goal (1 subgoal):
 1. ChamberComplexEndomorphism_axioms X (g \<circ> f)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
ChamberComplexEndomorphism X g
[PROOF STEP]
show "ChamberComplexEndomorphism_axioms X (g\<circ>f)"
[PROOF STATE]
proof (prove)
using this:
ChamberComplexEndomorphism X g

goal (1 subgoal):
 1. ChamberComplexEndomorphism_axioms X (g \<circ> f)
[PROOF STEP]
using trivial_outside ChamberComplexEndomorphism.trivial_outside
[PROOF STATE]
proof (prove)
using this:
ChamberComplexEndomorphism X g
?v \<notin> \<Union> X \<Longrightarrow> f ?v = ?v
\<lbrakk>ChamberComplexEndomorphism ?X ?f; ?v \<notin> \<Union> ?X\<rbrakk> \<Longrightarrow> ?f ?v = ?v

goal (1 subgoal):
 1. ChamberComplexEndomorphism_axioms X (g \<circ> f)
[PROOF STEP]
by    unfold_locales auto
[PROOF STATE]
proof (state)
this:
ChamberComplexEndomorphism_axioms X (g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_le_card: assumes "V \<subseteq> span W" "finite W" shows "dim V \<le> card W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
obtain A where "independent A" "A \<subseteq> V" "V \<subseteq> span A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>independent A; A \<subseteq> V; V \<subseteq> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using maximal_independent_subset[of V]
[PROOF STATE]
proof (prove)
using this:
(\<And>B. \<lbrakk>B \<subseteq> V; independent B; V \<subseteq> span B\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>independent A; A \<subseteq> V; V \<subseteq> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
independent A
A \<subseteq> V
V \<subseteq> span A

goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
with assms independent_span_bound[of W A] basis_card_eq_dim[of A V]
[PROOF STATE]
proof (chain)
picking this:
V \<subseteq> span W
finite W
\<lbrakk>finite W; independent A; A \<subseteq> span W\<rbrakk> \<Longrightarrow> finite A \<and> card A \<le> card W
\<lbrakk>A \<subseteq> V; V \<subseteq> span A; independent A\<rbrakk> \<Longrightarrow> card A = dim V
independent A
A \<subseteq> V
V \<subseteq> span A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
V \<subseteq> span W
finite W
\<lbrakk>finite W; independent A; A \<subseteq> span W\<rbrakk> \<Longrightarrow> finite A \<and> card A \<le> card W
\<lbrakk>A \<subseteq> V; V \<subseteq> span A; independent A\<rbrakk> \<Longrightarrow> card A = dim V
independent A
A \<subseteq> V
V \<subseteq> span A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma slice_len[simp]: "\<lbrakk> from \<le> to; to \<le> length xs \<rbrakk> \<Longrightarrow> length (slice from to xs) = to - from"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>from \<le> to; to \<le> length xs\<rbrakk> \<Longrightarrow> length (slice from to xs) = to - from
[PROOF STEP]
unfolding slice_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>from \<le> to; to \<le> length xs\<rbrakk> \<Longrightarrow> length (take (to - from) (drop from xs)) = to - from
[PROOF STEP]
by simp


[STATEMENT]
lemma dotprod_0_right [simp]:
  "xs \<bullet> zeroes (length xs) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<bullet> zeroes (length xs) = 0
[PROOF STEP]
by (induct xs) (simp_all)


[STATEMENT]
lemma log2_lm3: "log2 u < x \<Longrightarrow> c_in x u = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
assume A: "log2 u < x"
[PROOF STATE]
proof (state)
this:
log2 u < x

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
log2 u < x
[PROOF STEP]
have S1: "(log2 u)+1 \<le> x"
[PROOF STATE]
proof (prove)
using this:
log2 u < x

goal (1 subgoal):
 1. log2 u + 1 \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
log2 u + 1 \<le> x

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
have S2: "1 \<le> (2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> 2

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
log2 u + 1 \<le> x
1 \<le> 2
[PROOF STEP]
have S3: "(2::nat)^ ((log2 u)+1) \<le> 2^x"
[PROOF STATE]
proof (prove)
using this:
log2 u + 1 \<le> x
1 \<le> 2

goal (1 subgoal):
 1. 2 ^ (log2 u + 1) \<le> 2 ^ x
[PROOF STEP]
by (rule power_increasing)
[PROOF STATE]
proof (state)
this:
2 ^ (log2 u + 1) \<le> 2 ^ x

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
have S4: "u < (2::nat)^ ((log2 u)+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u < 2 ^ (log2 u + 1)
[PROOF STEP]
by (rule log2_gt)
[PROOF STATE]
proof (state)
this:
u < 2 ^ (log2 u + 1)

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
from S3 S4
[PROOF STATE]
proof (chain)
picking this:
2 ^ (log2 u + 1) \<le> 2 ^ x
u < 2 ^ (log2 u + 1)
[PROOF STEP]
have S5: "u < 2^x"
[PROOF STATE]
proof (prove)
using this:
2 ^ (log2 u + 1) \<le> 2 ^ x
u < 2 ^ (log2 u + 1)

goal (1 subgoal):
 1. u < 2 ^ x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u < 2 ^ x

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u < 2 ^ x
[PROOF STEP]
have S6: "u div 2^x = 0"
[PROOF STATE]
proof (prove)
using this:
u < 2 ^ x

goal (1 subgoal):
 1. u div 2 ^ x = 0
[PROOF STEP]
by (rule div_less)
[PROOF STATE]
proof (state)
this:
u div 2 ^ x = 0

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
have "c_in x u = (u div 2^x) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_in x u = u div 2 ^ x mod 2
[PROOF STEP]
by (simp add: c_in_def)
[PROOF STATE]
proof (state)
this:
c_in x u = u div 2 ^ x mod 2

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c_in x u = u div 2 ^ x mod 2

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
from S6
[PROOF STATE]
proof (chain)
picking this:
u div 2 ^ x = 0
[PROOF STEP]
have "\<dots> = 0 mod 2"
[PROOF STATE]
proof (prove)
using this:
u div 2 ^ x = 0

goal (1 subgoal):
 1. u div 2 ^ x mod 2 = 0 mod 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u div 2 ^ x mod 2 = 0 mod 2

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u div 2 ^ x mod 2 = 0 mod 2

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 mod 2 = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 mod 2 = 0

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
c_in x u = 0
[PROOF STEP]
have ?thesis
[PROOF STATE]
proof (prove)
using this:
c_in x u = 0

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

goal (1 subgoal):
 1. log2 u < x \<Longrightarrow> c_in x u = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
c_in x u = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_minus_self_iff: "a \<le> - a \<longleftrightarrow> a \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> - a) = (a \<le> (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a \<le> - a) = (a \<le> (0::'a))
[PROOF STEP]
from add_le_cancel_left [of "uminus a" "plus a a" zero]
[PROOF STATE]
proof (chain)
picking this:
(- a + (a + a) \<le> - a + (0::'a)) = (a + a \<le> (0::'a))
[PROOF STEP]
have "a \<le> - a \<longleftrightarrow> a + a \<le> 0"
[PROOF STATE]
proof (prove)
using this:
(- a + (a + a) \<le> - a + (0::'a)) = (a + a \<le> (0::'a))

goal (1 subgoal):
 1. (a \<le> - a) = (a + a \<le> (0::'a))
[PROOF STEP]
by (simp flip: add.assoc)
[PROOF STATE]
proof (state)
this:
(a \<le> - a) = (a + a \<le> (0::'a))

goal (1 subgoal):
 1. (a \<le> - a) = (a \<le> (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a \<le> - a) = (a + a \<le> (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a \<le> - a) = (a + a \<le> (0::'a))

goal (1 subgoal):
 1. (a \<le> - a) = (a \<le> (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a \<le> - a) = (a \<le> (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_radiant_minus_2pi:
  "of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>
[PROOF STEP]
have "of_radiant (\<omega> - 2 * pi) = of_radiant (\<omega> - 2 * pi + 2 * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi) = of_radiant (\<omega> - 2 * pi + 2 * pi)
[PROOF STEP]
by (simp only: of_radiant_plus_2pi)
[PROOF STATE]
proof (state)
this:
of_radiant (\<omega> - 2 * pi) = of_radiant (\<omega> - 2 * pi + 2 * pi)

goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_radiant (\<omega> - 2 * pi) = of_radiant (\<omega> - 2 * pi + 2 * pi)

goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>
[PROOF STEP]
have "\<dots> = of_radiant \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi + 2 * pi) = of_radiant \<omega>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_radiant (\<omega> - 2 * pi + 2 * pi) = of_radiant \<omega>

goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>

goal (1 subgoal):
 1. of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
of_radiant (\<omega> - 2 * pi) = of_radiant \<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_closed_uminus:
  fixes S :: "ereal set"
  assumes "closed S"
  shows "closed (uminus ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (uminus ` S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
closed S

goal (1 subgoal):
 1. closed (uminus ` S)
[PROOF STEP]
unfolding closed_def ereal_uminus_complement[symmetric]
[PROOF STATE]
proof (prove)
using this:
open (- S)

goal (1 subgoal):
 1. open (uminus ` (- S))
[PROOF STEP]
by (rule ereal_open_uminus)


[STATEMENT]
lemma limit_inter_empty:
  assumes fin: "finite (range w)"
  assumes hyp: "limit w \<inter> S = {}"
  shows "\<forall>\<^sub>\<infinity>n. w n \<notin> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>\<infinity>n. w n \<notin> S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>\<infinity>n. w n \<notin> S
[PROOF STEP]
from fin
[PROOF STATE]
proof (chain)
picking this:
finite (range w)
[PROOF STEP]
obtain k where k_def: "limit w = range (suffix k w)"
[PROOF STATE]
proof (prove)
using this:
finite (range w)

goal (1 subgoal):
 1. (\<And>k. limit w = range (suffix k w) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using limit_is_suffix
[PROOF STATE]
proof (prove)
using this:
finite (range w)
finite (range ?x) \<Longrightarrow> \<exists>k. limit ?x = range (suffix k ?x)

goal (1 subgoal):
 1. (\<And>k. limit w = range (suffix k w) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
limit w = range (suffix k w)

goal (1 subgoal):
 1. \<forall>\<^sub>\<infinity>n. w n \<notin> S
[PROOF STEP]
have "w (k + k') \<notin> S" for k'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w (k + k') \<notin> S
[PROOF STEP]
using hyp
[PROOF STATE]
proof (prove)
using this:
limit w \<inter> S = {}

goal (1 subgoal):
 1. w (k + k') \<notin> S
[PROOF STEP]
unfolding k_def suffix_def image_def
[PROOF STATE]
proof (prove)
using this:
{y. \<exists>x\<in>UNIV. y = w (k + x)} \<inter> S = {}

goal (1 subgoal):
 1. w (k + k') \<notin> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
w (k + ?k') \<notin> S

goal (1 subgoal):
 1. \<forall>\<^sub>\<infinity>n. w n \<notin> S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
w (k + ?k') \<notin> S

goal (1 subgoal):
 1. \<forall>\<^sub>\<infinity>n. w n \<notin> S
[PROOF STEP]
unfolding MOST_nat_le
[PROOF STATE]
proof (prove)
using this:
w (k + ?k') \<notin> S

goal (1 subgoal):
 1. \<exists>m. \<forall>n\<ge>m. w n \<notin> S
[PROOF STEP]
using le_Suc_ex
[PROOF STATE]
proof (prove)
using this:
w (k + ?k') \<notin> S
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n

goal (1 subgoal):
 1. \<exists>m. \<forall>n\<ge>m. w n \<notin> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>\<infinity>n. w n \<notin> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ts_ord_mult_isol: "n x \<sqsubseteq> n y \<Longrightarrow> n z \<cdot> n x \<sqsubseteq> n z \<cdot> n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n x \<sqsubseteq> n y \<Longrightarrow> n z \<cdot> n x \<sqsubseteq> n z \<cdot> n y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n x \<sqsubseteq> n y \<Longrightarrow> n z \<cdot> n x \<sqsubseteq> n z \<cdot> n y
[PROOF STEP]
assume "n x \<sqsubseteq> n y"
[PROOF STATE]
proof (state)
this:
n x \<sqsubseteq> n y

goal (1 subgoal):
 1. n x \<sqsubseteq> n y \<Longrightarrow> n z \<cdot> n x \<sqsubseteq> n z \<cdot> n y
[PROOF STEP]
hence "n (n (n z \<cdot> n x) \<cdot> n (n z \<cdot> n y)) = n z \<cdot> n y"
[PROOF STATE]
proof (prove)
using this:
n x \<sqsubseteq> n y

goal (1 subgoal):
 1. n (n (n z \<cdot> n x) \<cdot> n (n z \<cdot> n y)) = n z \<cdot> n y
[PROOF STEP]
by (metis mult_t_closed n_add_idem n_distrib1 ts_ord_def n_add_op_def)
[PROOF STATE]
proof (state)
this:
n (n (n z \<cdot> n x) \<cdot> n (n z \<cdot> n y)) = n z \<cdot> n y

goal (1 subgoal):
 1. n x \<sqsubseteq> n y \<Longrightarrow> n z \<cdot> n x \<sqsubseteq> n z \<cdot> n y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n (n (n z \<cdot> n x) \<cdot> n (n z \<cdot> n y)) = n z \<cdot> n y

goal (1 subgoal):
 1. n z \<cdot> n x \<sqsubseteq> n z \<cdot> n y
[PROOF STEP]
by (metis mult_t_closed ts_ord_def)
[PROOF STATE]
proof (state)
this:
n z \<cdot> n x \<sqsubseteq> n z \<cdot> n y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in information_space) finite_entropy_integrable_transform:
  "finite_entropy S X Px \<Longrightarrow> distributed M T Y Py \<Longrightarrow> (\<And>x. x \<in> space T \<Longrightarrow> 0 \<le> Py x) \<Longrightarrow>
    X = (\<lambda>x. f (Y x)) \<Longrightarrow> f \<in> measurable T S \<Longrightarrow> integrable T (\<lambda>x. Py x * log b (Px (f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite_entropy S X Px; distributed M T Y (\<lambda>x. ennreal (Py x)); \<And>x. x \<in> space T \<Longrightarrow> 0 \<le> Py x; X = (\<lambda>x. f (Y x)); f \<in> T \<rightarrow>\<^sub>M S\<rbrakk> \<Longrightarrow> integrable T (\<lambda>x. Py x * log b (Px (f x)))
[PROOF STEP]
using distributed_transform_integrable[of M T Y Py S X Px f "\<lambda>x. log b (Px x)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distributed M T Y (\<lambda>x. ennreal (Py x)); \<And>x. x \<in> space T \<Longrightarrow> 0 \<le> Py x; distributed M S X (\<lambda>x. ennreal (Px x)); \<And>x. x \<in> space S \<Longrightarrow> 0 \<le> Px x; X = (\<lambda>x. f (Y x)); f \<in> T \<rightarrow>\<^sub>M S; (\<lambda>x. log b (Px x)) \<in> borel_measurable S\<rbrakk> \<Longrightarrow> integrable S (\<lambda>x. Px x * log b (Px x)) = integrable T (\<lambda>x. Py x * log b (Px (f x)))

goal (1 subgoal):
 1. \<lbrakk>finite_entropy S X Px; distributed M T Y (\<lambda>x. ennreal (Py x)); \<And>x. x \<in> space T \<Longrightarrow> 0 \<le> Py x; X = (\<lambda>x. f (Y x)); f \<in> T \<rightarrow>\<^sub>M S\<rbrakk> \<Longrightarrow> integrable T (\<lambda>x. Py x * log b (Px (f x)))
[PROOF STEP]
using distributed_real_measurable[of S Px M X]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distributed M T Y (\<lambda>x. ennreal (Py x)); \<And>x. x \<in> space T \<Longrightarrow> 0 \<le> Py x; distributed M S X (\<lambda>x. ennreal (Px x)); \<And>x. x \<in> space S \<Longrightarrow> 0 \<le> Px x; X = (\<lambda>x. f (Y x)); f \<in> T \<rightarrow>\<^sub>M S; (\<lambda>x. log b (Px x)) \<in> borel_measurable S\<rbrakk> \<Longrightarrow> integrable S (\<lambda>x. Px x * log b (Px x)) = integrable T (\<lambda>x. Py x * log b (Px (f x)))
\<lbrakk>\<And>x. x \<in> space S \<Longrightarrow> 0 \<le> Px x; distributed M S X (\<lambda>x. ennreal (Px x))\<rbrakk> \<Longrightarrow> Px \<in> borel_measurable S

goal (1 subgoal):
 1. \<lbrakk>finite_entropy S X Px; distributed M T Y (\<lambda>x. ennreal (Py x)); \<And>x. x \<in> space T \<Longrightarrow> 0 \<le> Py x; X = (\<lambda>x. f (Y x)); f \<in> T \<rightarrow>\<^sub>M S\<rbrakk> \<Longrightarrow> integrable T (\<lambda>x. Py x * log b (Px (f x)))
[PROOF STEP]
by (auto simp: finite_entropy_def)