[STATEMENT]
lemma pathfinish_shiftpath:
  assumes "0 \<le> a"
    and "pathfinish g = pathstart g"
  shows "pathfinish (shiftpath a g) = g a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathfinish (shiftpath a g) = g a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> a
pathfinish g = pathstart g

goal (1 subgoal):
 1. pathfinish (shiftpath a g) = g a
[PROOF STEP]
unfolding pathstart_def pathfinish_def shiftpath_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> a
g 1 = g 0

goal (1 subgoal):
 1. (if a + 1 \<le> 1 then g (a + 1) else g (a + 1 - 1)) = g a
[PROOF STEP]
by auto


[STATEMENT]
lemma det3_def':
  "det3 p q r = fst p * snd q + snd p * fst r + fst q * snd r -
    snd q * fst r - snd p * fst q - fst p * snd r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det3 p q r = fst p * snd q + snd p * fst r + fst q * snd r - snd q * fst r - snd p * fst q - fst p * snd r
[PROOF STEP]
by (cases p q r rule: prod.exhaust[case_product prod.exhaust[case_product prod.exhaust]]) auto


[STATEMENT]
lemma X_I_unitary:
  shows "unitary X_I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary X_I
[PROOF STEP]
unfolding X_I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary (X \<Otimes> 1\<^sub>m 2)
[PROOF STEP]
using tensor_mat_unitary[of X "1\<^sub>m 2"] X_carrier unitary_X
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary X; Complex_Matrix.unitary (1\<^sub>m 2); 0 < dim_row X; 0 < dim_row (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (X \<Otimes> 1\<^sub>m 2)
X \<in> carrier_mat 2 2
Complex_Matrix.unitary X

goal (1 subgoal):
 1. Complex_Matrix.unitary (X \<Otimes> 1\<^sub>m 2)
[PROOF STEP]
using unitary_one
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary X; Complex_Matrix.unitary (1\<^sub>m 2); 0 < dim_row X; 0 < dim_row (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (X \<Otimes> 1\<^sub>m 2)
X \<in> carrier_mat 2 2
Complex_Matrix.unitary X
Complex_Matrix.unitary (1\<^sub>m ?n)

goal (1 subgoal):
 1. Complex_Matrix.unitary (X \<Otimes> 1\<^sub>m 2)
[PROOF STEP]
by auto


[STATEMENT]
lemma eventually_all_finite_mono:
  fixes P :: "('a::finite) \<Rightarrow> 'b \<Rightarrow> bool"
  assumes h1: "\<forall>i. eventually (P i) F"
      and h2: "\<forall>x. (\<forall>i. (P i x)) \<longrightarrow> Q x"
  shows "eventually Q F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually Q F
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eventually Q F
[PROOF STEP]
have "eventually (\<lambda>x. \<forall>i. P i x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<forall>i. P i x
[PROOF STEP]
using h1 eventually_all_finite2
[PROOF STATE]
proof (prove)
using this:
\<forall>i. eventually (P i) F
\<forall>i. eventually (?P i) ?F \<Longrightarrow> \<forall>\<^sub>F x in ?F. \<forall>i. ?P i x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<forall>i. P i x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. \<forall>i. P i x

goal (1 subgoal):
 1. eventually Q F
[PROOF STEP]
thus "eventually Q F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. \<forall>i. P i x

goal (1 subgoal):
 1. eventually Q F
[PROOF STEP]
unfolding eventually_def
[PROOF STATE]
proof (prove)
using this:
Rep_filter F (\<lambda>x. \<forall>i. P i x)

goal (1 subgoal):
 1. Rep_filter F Q
[PROOF STEP]
using h2 eventually_mono
[PROOF STATE]
proof (prove)
using this:
Rep_filter F (\<lambda>x. \<forall>i. P i x)
\<forall>x. (\<forall>i. P i x) \<longrightarrow> Q x
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

goal (1 subgoal):
 1. Rep_filter F Q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eventually Q F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "((P\<or>Q)\<longrightarrow>(P\<or>R)) \<longrightarrow> (P\<or>(Q\<longrightarrow>R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> Q \<longrightarrow> P \<or> R) \<longrightarrow> P \<or> (Q \<longrightarrow> R)
[PROOF STEP]
by blast


[STATEMENT]
theorem iffD: "A \<longleftrightarrow> B \<Longrightarrow> (A \<longrightarrow> B) \<and> (B \<longrightarrow> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B \<Longrightarrow> (A \<longrightarrow> B) \<and> (B \<longrightarrow> A)
[PROOF STEP]
by auto


[STATEMENT]
lemma desargues_config_rot_CCW:
  assumes "desargues_config A B C A' B' C' M N P R"
  shows "desargues_config B C A B' C' A' N P M R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. desargues_config B C A B' C' A' N P M R
[PROOF STEP]
by (simp add: assms desargues_config_rot_CW)


[STATEMENT]
lemma dvd_abs_mult_left_int [simp]:
  "\<bar>a\<bar> * y dvd x \<longleftrightarrow> a * y dvd x" for x y a :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>a\<bar> * y dvd x) = (a * y dvd x)
[PROOF STEP]
using abs_dvd_iff [of "a * y"] abs_dvd_iff [of "\<bar>a\<bar> * y"]
[PROOF STATE]
proof (prove)
using this:
(\<bar>a * y\<bar> dvd ?k) = (a * y dvd ?k)
(\<bar>\<bar>a\<bar> * y\<bar> dvd ?k) = (\<bar>a\<bar> * y dvd ?k)

goal (1 subgoal):
 1. (\<bar>a\<bar> * y dvd x) = (a * y dvd x)
[PROOF STEP]
by (simp add: abs_mult)


[STATEMENT]
lemma len_set_bit[Presb_simps]: "len (set_bit m P) = max (Suc m) (len P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. len (set_bit m P) = max (Suc m) (len P)
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. len (set_bit m P) \<le> max (Suc m) (len P)
 2. max (Suc m) (len P) \<le> len (set_bit m P)
[PROOF STEP]
show "len (set_bit m P) \<le> max (Suc m) (len P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. len (set_bit m P) \<le> max (Suc m) (len P)
[PROOF STEP]
by (auto simp: set_bit_def test_bit_def max_def Suc_le_eq not_less len_le_iff
      set_unset_bit_preserves_len simp del: One_nat_def)
[PROOF STATE]
proof (state)
this:
len (set_bit m P) \<le> max (Suc m) (len P)

goal (1 subgoal):
 1. max (Suc m) (len P) \<le> len (set_bit m P)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. max (Suc m) (len P) \<le> len (set_bit m P)
[PROOF STEP]
have "P < 2 ^ len (P + 2 ^ m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P < 2 ^ len (P + 2 ^ m)
[PROOF STEP]
by (rule order.strict_trans2[OF less_pow2_len]) auto
[PROOF STATE]
proof (state)
this:
P < 2 ^ len (P + 2 ^ m)

goal (1 subgoal):
 1. max (Suc m) (len P) \<le> len (set_bit m P)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P < 2 ^ len (P + 2 ^ m)

goal (1 subgoal):
 1. max (Suc m) (len P) \<le> len (set_bit m P)
[PROOF STEP]
have "m < len (P + 2 ^ m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < len (P + 2 ^ m)
[PROOF STEP]
by (rule order.strict_trans2[OF _ len_mono[of "2 ^ m"]]) auto
[PROOF STATE]
proof (state)
this:
m < len (P + 2 ^ m)

goal (1 subgoal):
 1. max (Suc m) (len P) \<le> len (set_bit m P)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
P < 2 ^ len (P + 2 ^ m)
m < len (P + 2 ^ m)
[PROOF STEP]
show "max (Suc m) (len P) \<le> len (set_bit m P)"
[PROOF STATE]
proof (prove)
using this:
P < 2 ^ len (P + 2 ^ m)
m < len (P + 2 ^ m)

goal (1 subgoal):
 1. max (Suc m) (len P) \<le> len (set_bit m P)
[PROOF STEP]
by (auto simp: set_bit_def test_bit_def max_def Suc_le_eq not_less len_le_iff)
[PROOF STATE]
proof (state)
this:
max (Suc m) (len P) \<le> len (set_bit m P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ListAskip: "preList xs Askip l s = postList xs  l s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preList xs SKIP l s = postList xs l s
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. preList [] SKIP l s = postList [] l s
 2. \<And>a xs. preList xs SKIP l s = postList xs l s \<Longrightarrow> preList (a # xs) SKIP l s = postList (a # xs) l s
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. preList xs SKIP l s = postList xs l s \<Longrightarrow> preList (a # xs) SKIP l s = postList (a # xs) l s
[PROOF STEP]
by force


[STATEMENT]
theorem wordinterval_CIDR_split1_preserve: fixes r:: "'a::len wordinterval"
  shows "wordinterval_CIDR_split1 r = (Some s, u) \<Longrightarrow> wordinterval_eq (wordinterval_union (prefix_to_wordinterval s) u) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_CIDR_split1 r = (Some s, u) \<Longrightarrow> wordinterval_eq (wordinterval_union (prefix_to_wordinterval s) u) r
[PROOF STEP]
proof(unfold wordinterval_eq_set_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wordinterval_CIDR_split1 r = (Some s, u) \<Longrightarrow> wordinterval_to_set (wordinterval_union (prefix_to_wordinterval s) u) = wordinterval_to_set r
[PROOF STEP]
assume as: "wordinterval_CIDR_split1 r = (Some s, u)"
[PROOF STATE]
proof (state)
this:
wordinterval_CIDR_split1 r = (Some s, u)

goal (1 subgoal):
 1. wordinterval_CIDR_split1 r = (Some s, u) \<Longrightarrow> wordinterval_to_set (wordinterval_union (prefix_to_wordinterval s) u) = wordinterval_to_set r
[PROOF STEP]
have ud: "u = wordinterval_setminus r (prefix_to_wordinterval s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = wordinterval_setminus r (prefix_to_wordinterval s)
[PROOF STEP]
using as[THEN wordinterval_CIDR_split1_snd]
[PROOF STATE]
proof (prove)
using this:
u = wordinterval_setminus r (prefix_to_wordinterval s)

goal (1 subgoal):
 1. u = wordinterval_setminus r (prefix_to_wordinterval s)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
u = wordinterval_setminus r (prefix_to_wordinterval s)

goal (1 subgoal):
 1. wordinterval_CIDR_split1 r = (Some s, u) \<Longrightarrow> wordinterval_to_set (wordinterval_union (prefix_to_wordinterval s) u) = wordinterval_to_set r
[PROOF STEP]
with largest_contained_prefix_subset_s1D[OF as]
[PROOF STATE]
proof (chain)
picking this:
wordinterval_to_set (prefix_to_wordinterval s) \<subseteq> wordinterval_to_set r
u = wordinterval_setminus r (prefix_to_wordinterval s)
[PROOF STEP]
show "wordinterval_to_set (wordinterval_union (prefix_to_wordinterval s) u) = wordinterval_to_set r"
[PROOF STATE]
proof (prove)
using this:
wordinterval_to_set (prefix_to_wordinterval s) \<subseteq> wordinterval_to_set r
u = wordinterval_setminus r (prefix_to_wordinterval s)

goal (1 subgoal):
 1. wordinterval_to_set (wordinterval_union (prefix_to_wordinterval s) u) = wordinterval_to_set r
[PROOF STEP]
unfolding ud
[PROOF STATE]
proof (prove)
using this:
wordinterval_to_set (prefix_to_wordinterval s) \<subseteq> wordinterval_to_set r
wordinterval_setminus r (prefix_to_wordinterval s) = wordinterval_setminus r (prefix_to_wordinterval s)

goal (1 subgoal):
 1. wordinterval_to_set (wordinterval_union (prefix_to_wordinterval s) (wordinterval_setminus r (prefix_to_wordinterval s))) = wordinterval_to_set r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wordinterval_to_set (wordinterval_union (prefix_to_wordinterval s) u) = wordinterval_to_set r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem lfp_if_cont:
  assumes "cont f" shows "lfp f =  (\<Union>n. (f ^^ n) {})" (is "_ = ?U")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = (\<Union>n. (f ^^ n) {})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp f \<subseteq> (\<Union>n. (f ^^ n) {})
 2. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
show "lfp f \<subseteq> ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
proof (rule lfp_lowerbound)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
have "f ?U = (UN n. (f^^Suc n){})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) = (\<Union>n. (f ^^ Suc n) {})
[PROOF STEP]
using chain_iterates[OF mono_if_cont[OF assms]] assms
[PROOF STATE]
proof (prove)
using this:
chain (\<lambda>n. (f ^^ n) {})
cont f

goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) = (\<Union>n. (f ^^ Suc n) {})
[PROOF STEP]
by(simp add: cont_def)
[PROOF STATE]
proof (state)
this:
f (\<Union>n. (f ^^ n) {}) = (\<Union>n. (f ^^ Suc n) {})

goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (\<Union>n. (f ^^ n) {}) = (\<Union>n. (f ^^ Suc n) {})

goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
have "\<dots> = (f^^0){} \<union> \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. (f ^^ Suc n) {}) = (f ^^ 0) {} \<union> (\<Union>n. (f ^^ Suc n) {})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Union>n. (f ^^ Suc n) {}) = (f ^^ 0) {} \<union> (\<Union>n. (f ^^ Suc n) {})

goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>n. (f ^^ Suc n) {}) = (f ^^ 0) {} \<union> (\<Union>n. (f ^^ Suc n) {})

goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
have "\<dots> = ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ 0) {} \<union> (\<Union>n. (f ^^ Suc n) {}) = (\<Union>n. (f ^^ n) {})
[PROOF STEP]
apply(auto simp del: funpow.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. x \<in> (f ^^ n) {} \<Longrightarrow> \<exists>xa. x \<in> (f ^^ Suc xa) {}
[PROOF STEP]
by (metis empty_iff funpow_0 old.nat.exhaust)
[PROOF STATE]
proof (state)
this:
(f ^^ 0) {} \<union> (\<Union>n. (f ^^ Suc n) {}) = (\<Union>n. (f ^^ n) {})

goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (\<Union>n. (f ^^ n) {}) = (\<Union>n. (f ^^ n) {})
[PROOF STEP]
show "f ?U \<subseteq> ?U"
[PROOF STATE]
proof (prove)
using this:
f (\<Union>n. (f ^^ n) {}) = (\<Union>n. (f ^^ n) {})

goal (1 subgoal):
 1. f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (\<Union>n. (f ^^ n) {}) \<subseteq> (\<Union>n. (f ^^ n) {})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lfp f \<subseteq> (\<Union>n. (f ^^ n) {})

goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
fix n p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
assume "f p \<subseteq> p"
[PROOF STATE]
proof (state)
this:
f p \<subseteq> p

goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
have "(f^^n){} \<subseteq> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ n) {} \<subseteq> p
[PROOF STEP]
proof(induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (f ^^ 0) {} \<subseteq> p
 2. \<And>n. (f ^^ n) {} \<subseteq> p \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> p
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (f ^^ 0) {} \<subseteq> p
 2. \<And>n. (f ^^ n) {} \<subseteq> p \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ 0) {} \<subseteq> p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f ^^ 0) {} \<subseteq> p

goal (1 subgoal):
 1. \<And>n. (f ^^ n) {} \<subseteq> p \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (f ^^ n) {} \<subseteq> p \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> p
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
(f ^^ n_) {} \<subseteq> p

goal (1 subgoal):
 1. \<And>n. (f ^^ n) {} \<subseteq> p \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> p
[PROOF STEP]
from monoD[OF mono_if_cont[OF assms] Suc] \<open>f p \<subseteq> p\<close>
[PROOF STATE]
proof (chain)
picking this:
f ((f ^^ n_) {}) \<subseteq> f p
f p \<subseteq> p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f ((f ^^ n_) {}) \<subseteq> f p
f p \<subseteq> p

goal (1 subgoal):
 1. (f ^^ Suc n_) {} \<subseteq> p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f ^^ Suc n_) {} \<subseteq> p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(f ^^ n) {} \<subseteq> p

goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
f ?p2 \<subseteq> ?p2 \<Longrightarrow> (f ^^ ?n2) {} \<subseteq> ?p2

goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
thus "?U \<subseteq> lfp f"
[PROOF STATE]
proof (prove)
using this:
f ?p2 \<subseteq> ?p2 \<Longrightarrow> (f ^^ ?n2) {} \<subseteq> ?p2

goal (1 subgoal):
 1. (\<Union>n. (f ^^ n) {}) \<subseteq> lfp f
[PROOF STEP]
by(auto simp: lfp_def)
[PROOF STATE]
proof (state)
this:
(\<Union>n. (f ^^ n) {}) \<subseteq> lfp f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_rel_open:
  fixes S :: "'n::euclidean_space set"
  assumes "affine S"
  shows "rel_open S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_open S
[PROOF STEP]
unfolding rel_open_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior S = S
[PROOF STEP]
using assms rel_interior_affine_hull[of S] affine_hull_eq[of S]
[PROOF STATE]
proof (prove)
using this:
affine S
rel_interior (affine hull S) = affine hull S
(affine hull S = S) = affine S

goal (1 subgoal):
 1. rel_interior S = S
[PROOF STEP]
by metis


[STATEMENT]
lemma imirror_bounds_elem_conv: "
  \<lbrakk> finite I; n \<le> l + r; Max I \<le> l + r \<rbrakk> \<Longrightarrow>
  ((nat_mirror n l r) \<in> imirror_bounds I l r) = (n \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> (nat_mirror n l r \<in> imirror_bounds I l r) = (n \<in> I)
[PROOF STEP]
apply (unfold imirror_bounds_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> (nat_mirror n l r \<in> (\<lambda>x. nat_mirror x l r) ` I) = (n \<in> I)
[PROOF STEP]
apply (rule inj_on_image_mem_iff)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> inj_on (\<lambda>x. nat_mirror x l r) ?A
 2. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> I \<subseteq> ?A
 3. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> n \<in> ?A
[PROOF STEP]
apply (rule nat_mirror_inj_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> I \<subseteq> {..l + r}
 2. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> n \<in> {..l + r}
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; n \<le> l + r; Max I \<le> l + r\<rbrakk> \<Longrightarrow> n \<in> {..l + r}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in semilattice_inf) inf_leI:
  "\<lbrakk> \<And>x. \<lbrakk> x\<le>a; x\<le>b \<rbrakk> \<Longrightarrow> x\<le>c \<rbrakk> \<Longrightarrow> inf a b \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<le> a; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> c) \<Longrightarrow> inf a b \<le> c
[PROOF STEP]
by (metis inf_le1 inf_le2)


[STATEMENT]
lemma Bell_altdef:
  assumes "finite A"
  shows "Bell (card A) = card {P. partition_on A P}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
from \<open>finite A\<close>
[PROOF STATE]
proof (chain)
picking this:
finite A
[PROOF STEP]
obtain f where bij: "bij_betw f {0..<card A} A"
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (\<And>f. bij_betw f {0..<card A} A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_bij_betw_nat_finite
[PROOF STATE]
proof (prove)
using this:
finite A
finite ?M \<Longrightarrow> \<exists>h. bij_betw h {0..<card ?M} ?M

goal (1 subgoal):
 1. (\<And>f. bij_betw f {0..<card A} A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw f {0..<card A} A

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
bij_betw f {0..<card A} A
[PROOF STEP]
have inj: "inj_on f {0..<card A}"
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<card A} A

goal (1 subgoal):
 1. inj_on f {0..<card A}
[PROOF STEP]
using bij_betw_imp_inj_on
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<card A} A
bij_betw ?f ?A ?B \<Longrightarrow> inj_on ?f ?A

goal (1 subgoal):
 1. inj_on f {0..<card A}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on f {0..<card A}

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
from bij
[PROOF STATE]
proof (chain)
picking this:
bij_betw f {0..<card A} A
[PROOF STEP]
have image_f_eq: "A = f ` {0..<card A}"
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<card A} A

goal (1 subgoal):
 1. A = f ` {0..<card A}
[PROOF STEP]
using bij_betw_imp_surj_on
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<card A} A
bij_betw ?f ?A ?B \<Longrightarrow> ?f ` ?A = ?B

goal (1 subgoal):
 1. A = f ` {0..<card A}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A = f ` {0..<card A}

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
have "\<forall>x \<in> {P. partition_on {0..<card A} P}. x \<subseteq> Pow {0..<card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{P. partition_on {0..<card A} P}. x \<subseteq> Pow {0..<card A}
[PROOF STEP]
by (auto elim: partition_onE)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{P. partition_on {0..<card A} P}. x \<subseteq> Pow {0..<card A}

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
from this inj
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{P. partition_on {0..<card A} P}. x \<subseteq> Pow {0..<card A}
inj_on f {0..<card A}
[PROOF STEP]
have "inj_on ((`) ((`) f)) {P. partition_on {0..<card A} P}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{P. partition_on {0..<card A} P}. x \<subseteq> Pow {0..<card A}
inj_on f {0..<card A}

goal (1 subgoal):
 1. inj_on ((`) ((`) f)) {P. partition_on {0..<card A} P}
[PROOF STEP]
by (intro inj_on_impl_inj_on_image[of _ "Pow {0..<card A}"]
     inj_on_impl_inj_on_image[of _ "{0..<card A}"]) blast+
[PROOF STATE]
proof (state)
this:
inj_on ((`) ((`) f)) {P. partition_on {0..<card A} P}

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on ((`) ((`) f)) {P. partition_on {0..<card A} P}

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
from inj
[PROOF STATE]
proof (chain)
picking this:
inj_on f {0..<card A}
[PROOF STEP]
have "(`) ((`) f) ` {P. partition_on {0..<card A} P} = {P. partition_on A P}"
[PROOF STATE]
proof (prove)
using this:
inj_on f {0..<card A}

goal (1 subgoal):
 1. (`) ((`) f) ` {P. partition_on {0..<card A} P} = {P. partition_on A P}
[PROOF STEP]
by (subst image_f_eq, auto elim!: set_of_partition_on_map)
[PROOF STATE]
proof (state)
this:
(`) ((`) f) ` {P. partition_on {0..<card A} P} = {P. partition_on A P}

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on ((`) ((`) f)) {P. partition_on {0..<card A} P}
(`) ((`) f) ` {P. partition_on {0..<card A} P} = {P. partition_on A P}
[PROOF STEP]
have "bij_betw ((`) ((`) f)) {P. partition_on {0..<card A} P} {P. partition_on A P}"
[PROOF STATE]
proof (prove)
using this:
inj_on ((`) ((`) f)) {P. partition_on {0..<card A} P}
(`) ((`) f) ` {P. partition_on {0..<card A} P} = {P. partition_on A P}

goal (1 subgoal):
 1. bij_betw ((`) ((`) f)) {P. partition_on {0..<card A} P} {P. partition_on A P}
[PROOF STEP]
by (auto intro: bij_betw_imageI)
[PROOF STATE]
proof (state)
this:
bij_betw ((`) ((`) f)) {P. partition_on {0..<card A} P} {P. partition_on A P}

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
from this \<open>finite A\<close>
[PROOF STATE]
proof (chain)
picking this:
bij_betw ((`) ((`) f)) {P. partition_on {0..<card A} P} {P. partition_on A P}
finite A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw ((`) ((`) f)) {P. partition_on {0..<card A} P} {P. partition_on A P}
finite A

goal (1 subgoal):
 1. Bell (card A) = card {P. partition_on A P}
[PROOF STEP]
unfolding Bell_def
[PROOF STATE]
proof (prove)
using this:
bij_betw ((`) ((`) f)) {P. partition_on {0..<card A} P} {P. partition_on A P}
finite A

goal (1 subgoal):
 1. card (Collect (partition_on {0..<card A})) = card {P. partition_on A P}
[PROOF STEP]
by (subst bij_betw_iff_card[symmetric]) (auto intro: finitely_many_partition_on)
[PROOF STATE]
proof (state)
this:
Bell (card A) = card {P. partition_on A P}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_map_real_mult [continuous_intros]:
   "\<lbrakk>continuous_map X euclideanreal f; continuous_map X euclideanreal g\<rbrakk>
   \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X euclideanreal f; continuous_map X euclideanreal g\<rbrakk> \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. f x * g x)
[PROOF STEP]
by (simp add: continuous_map_atin tendsto_mult)


[STATEMENT]
lemma smcf_cn_cov_comp_ObjMap_vsv[smc_cn_cs_intros]:
  assumes "\<GG> : \<BB> \<^sub>S\<^sub>M\<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "vsv ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vsv ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
interpret L: is_semifunctor \<alpha> \<open>op_smc \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_smc \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vsv ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
interpret R: is_semifunctor \<alpha> \<AA> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vsv ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
by
      (
        rule dghm_cn_cov_comp_ObjMap_vsv
          [
            OF
              L.smcf_is_dghm[unfolded slicing_commute[symmetric]]
              R.smcf_is_dghm[unfolded slicing_commute[symmetric]],
            unfolded slicing_commute slicing_simps
          ]
      )
[PROOF STATE]
proof (state)
this:
vsv ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_UminusGH: "finite (UNIV - GH)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (UNIV - GH)
[PROOF STEP]
by (metis finite_Diff finite_U)


[STATEMENT]
lemma reach_card_0:
  assumes "\<Sigma> \<noteq> {}"
  shows "infinite (reach \<Sigma> \<delta> q\<^sub>0) \<longleftrightarrow> card (reach \<Sigma> \<delta> q\<^sub>0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (reach \<Sigma> \<delta> q\<^sub>0) = (card (reach \<Sigma> \<delta> q\<^sub>0) = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (reach \<Sigma> \<delta> q\<^sub>0) = (card (reach \<Sigma> \<delta> q\<^sub>0) = 0)
[PROOF STEP]
have "{run \<delta> q\<^sub>0 w n | w n. range w \<subseteq> \<Sigma>} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>} \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Sigma> \<noteq> {}

goal (1 subgoal):
 1. {run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>} \<noteq> {}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
{run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>} \<noteq> {}

goal (1 subgoal):
 1. infinite (reach \<Sigma> \<delta> q\<^sub>0) = (card (reach \<Sigma> \<delta> q\<^sub>0) = 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>} \<noteq> {}

goal (1 subgoal):
 1. infinite (reach \<Sigma> \<delta> q\<^sub>0) = (card (reach \<Sigma> \<delta> q\<^sub>0) = 0)
[PROOF STEP]
unfolding reach_def card_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
{run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>} \<noteq> {}

goal (1 subgoal):
 1. infinite {run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>} = ({run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>} = {} \<or> infinite {run \<delta> q\<^sub>0 w n |w n. range w \<subseteq> \<Sigma>})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infinite (reach \<Sigma> \<delta> q\<^sub>0) = (card (reach \<Sigma> \<delta> q\<^sub>0) = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pre_trace:
  "trace pre = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace pre = 1
[PROOF STEP]
unfolding pre_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (outer_prod ket_pre ket_pre) = 1
[PROOF STEP]
apply (subst trace_outer_prod[of _ N])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ket_pre \<in> carrier_vec N
 2. inner_prod ket_pre ket_pre = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ket_pre \<in> carrier_vec N
[PROOF STEP]
unfolding ket_pre_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.vec N (\<lambda>k. if k = 0 then 1 else 0) \<in> carrier_vec N
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod ket_pre ket_pre = 1
[PROOF STEP]
using norm_pre
[PROOF STATE]
proof (prove)
using this:
inner_prod ket_pre ket_pre = 1

goal (1 subgoal):
 1. inner_prod ket_pre ket_pre = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma ack_add_simps[simp]:
  "m\<noteq>0 \<Longrightarrow> ack m 0 = ack (m-1) 1"
  "\<lbrakk>m\<noteq>0; n\<noteq>0\<rbrakk> \<Longrightarrow> ack m n = ack (m-1) (ack m (n-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<noteq> 0 \<Longrightarrow> ack m 0 = ack (m - 1) 1) &&& (\<lbrakk>m \<noteq> 0; n \<noteq> 0\<rbrakk> \<Longrightarrow> ack m n = ack (m - 1) (ack m (n - 1)))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> ack m 0 = ack (m - 1) 1
[PROOF STEP]
by (cases m) auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<noteq> 0; n \<noteq> 0\<rbrakk> \<Longrightarrow> ack m n = ack (m - 1) (ack m (n - 1))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<noteq> 0; n \<noteq> 0\<rbrakk> \<Longrightarrow> ack m n = ack (m - 1) (ack m (n - 1))
[PROOF STEP]
by (cases "(m,n)" rule: ack.cases) (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma uncountable_half_open_interval_1: "uncountable {a..<b} \<longleftrightarrow> a < b" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable {a..<b} = (a < b)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. uncountable {a..<b} \<Longrightarrow> a < b
 2. \<lbrakk>a < b; countable {a..<b}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using atLeastLessThan_empty_iff
[PROOF STATE]
proof (prove)
using this:
({?a..<?b} = {}) = (\<not> ?a < ?b)

goal (2 subgoals):
 1. uncountable {a..<b} \<Longrightarrow> a < b
 2. \<lbrakk>a < b; countable {a..<b}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; countable {a..<b}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using uncountable_open_interval [of a b]
[PROOF STATE]
proof (prove)
using this:
uncountable {a<..<b} = (a < b)

goal (1 subgoal):
 1. \<lbrakk>a < b; countable {a..<b}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (metis countable_Un_iff ivl_disj_un_singleton(3))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma locally_finite_in_subset:
  assumes "locally_finite_in X \" "\ \<subseteq> \"
  shows "locally_finite_in X \"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_finite_in X \
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. locally_finite_in X \
[PROOF STEP]
have "finite (\ \<inter> {U. U \<inter> V \<noteq> {}}) \<Longrightarrow> finite (\ \<inter> {U. U \<inter> V \<noteq> {}})" for V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\ \<inter> {U. U \<inter> V \<noteq> {}}) \<Longrightarrow> finite (\ \<inter> {U. U \<inter> V \<noteq> {}})
[PROOF STEP]
by (meson \<open>\ \<subseteq> \\<close> finite_subset inf_le1 inf_le2 le_inf_iff subset_trans)
[PROOF STATE]
proof (state)
this:
finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}}) \<Longrightarrow> finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}})

goal (1 subgoal):
 1. locally_finite_in X \
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}}) \<Longrightarrow> finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}}) \<Longrightarrow> finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}})

goal (1 subgoal):
 1. locally_finite_in X \
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}}) \<Longrightarrow> finite (\ \<inter> {U. U \<inter> ?V \<noteq> {}})
locally_finite_in X \
\ \<subseteq> \

goal (1 subgoal):
 1. locally_finite_in X \
[PROOF STEP]
unfolding locally_finite_in_def Int_def
[PROOF STATE]
proof (prove)
using this:
finite {x \<in> \. x \<in> {U. {x \<in> U. x \<in> ?V} \<noteq> {}}} \<Longrightarrow> finite {x \<in> \. x \<in> {U. {x \<in> U. x \<in> ?V} \<noteq> {}}}
\<Union> \ \<subseteq> topspace X \<and> (\<forall>x\<in>topspace X. \<exists>V. openin X V \<and> x \<in> V \<and> finite {U \<in> \. {x \<in> U. x \<in> V} \<noteq> {}})
\ \<subseteq> \

goal (1 subgoal):
 1. \<Union> \ \<subseteq> topspace X \<and> (\<forall>x\<in>topspace X. \<exists>V. openin X V \<and> x \<in> V \<and> finite {U \<in> \. {x \<in> U. x \<in> V} \<noteq> {}})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
locally_finite_in X \

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma time_closest_pair_conv_closest_pair_recurrence:
  assumes "distinct ps"
  shows "time (closest_pair_tm ps) \<le> closest_pair_time (length ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (time (closest_pair_tm ps)) \<le> closest_pair_time (length ps)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct ps

goal (1 subgoal):
 1. real (time (closest_pair_tm ps)) \<le> closest_pair_time (length ps)
[PROOF STEP]
unfolding closest_pair_time_def
[PROOF STATE]
proof (prove)
using this:
distinct ps

goal (1 subgoal):
 1. real (time (closest_pair_tm ps)) \<le> 1 + mergesort_recurrence (length ps) + closest_pair_recurrence (length ps)
[PROOF STEP]
proof (induction rule: induct_list012)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
case (3 x y zs)
[PROOF STATE]
proof (state)
this:
distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs)
distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs))
distinct (x # y # zs)

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
let ?ps = "x # y # zs"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
define xs where "xs = val (mergesort_tm fst ?ps)"
[PROOF STATE]
proof (state)
this:
xs = Time_Monad.val (mergesort_tm fst (x # y # zs))

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
have *: "distinct xs" "sorted_fst xs" "length xs = length ?ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs &&& sorted_fst xs &&& length xs = length (x # y # zs)
[PROOF STEP]
using xs_def mergesort(4)[OF "3.prems", of fst] mergesort(1)[of fst ?ps] mergesort(3)[of fst ?ps]
          sorted_fst_def mergesort_eq_val_mergesort_tm
[PROOF STATE]
proof (prove)
using this:
xs = Time_Monad.val (mergesort_tm fst (x # y # zs))
distinct (mergesort fst (x # y # zs))
sorted_wrt (\<lambda>x y. fst x \<le> fst y) (mergesort fst (x # y # zs))
length (mergesort fst (x # y # zs)) = length (x # y # zs)
sorted_fst ?ps = sorted_wrt (\<lambda>p\<^sub>0 p\<^sub>1. fst p\<^sub>0 \<le> fst p\<^sub>1) ?ps
Time_Monad.val (mergesort_tm ?f ?xs) = mergesort ?f ?xs

goal (1 subgoal):
 1. distinct xs &&& sorted_fst xs &&& length xs = length (x # y # zs)
[PROOF STEP]
by metis+
[PROOF STATE]
proof (state)
this:
distinct xs
sorted_fst xs
length xs = length (x # y # zs)

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
have "time (closest_pair_tm ?ps) = 1 + time (mergesort_tm fst ?ps) + time (closest_pair_rec_tm xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. time (closest_pair_tm (x # y # zs)) = 1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)
[PROOF STEP]
using xs_def
[PROOF STATE]
proof (prove)
using this:
xs = Time_Monad.val (mergesort_tm fst (x # y # zs))

goal (1 subgoal):
 1. time (closest_pair_tm (x # y # zs)) = 1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)
[PROOF STEP]
by (auto simp del: mergesort_tm.simps closest_pair_rec_tm.simps simp add: time_simps split: prod.split)
[PROOF STATE]
proof (state)
this:
time (closest_pair_tm (x # y # zs)) = 1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
time (closest_pair_tm (x # y # zs)) = 1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
have "... \<le> 1 + mergesort_recurrence (length ?ps) + time (closest_pair_rec_tm xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + real (time (closest_pair_rec_tm xs))
[PROOF STEP]
using time_mergesort_conv_mergesort_recurrence[of fst ?ps]
[PROOF STATE]
proof (prove)
using this:
real (time (mergesort_tm fst (x # y # zs))) \<le> mergesort_recurrence (length (x # y # zs))

goal (1 subgoal):
 1. real (1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + real (time (closest_pair_rec_tm xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + real (time (closest_pair_rec_tm xs))

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (1 + time (mergesort_tm fst (x # y # zs)) + time (closest_pair_rec_tm xs)) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + real (time (closest_pair_rec_tm xs))

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
have "... \<le> 1 + mergesort_recurrence (length ?ps) + closest_pair_recurrence (length ?ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + mergesort_recurrence (length (x # y # zs)) + real (time (closest_pair_rec_tm xs)) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
using time_closest_pair_rec_conv_closest_pair_recurrence[of xs] *
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct xs; sorted_fst xs\<rbrakk> \<Longrightarrow> real (time (closest_pair_rec_tm xs)) \<le> closest_pair_recurrence (length xs)
distinct xs
sorted_fst xs
length xs = length (x # y # zs)

goal (1 subgoal):
 1. 1 + mergesort_recurrence (length (x # y # zs)) + real (time (closest_pair_rec_tm xs)) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 + mergesort_recurrence (length (x # y # zs)) + real (time (closest_pair_rec_tm xs)) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))

goal (3 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
 3. \<And>x y zs. \<lbrakk>distinct zs \<Longrightarrow> real (time (closest_pair_tm zs)) \<le> 1 + mergesort_recurrence (length zs) + closest_pair_recurrence (length zs); distinct (y # zs) \<Longrightarrow> real (time (closest_pair_tm (y # zs))) \<le> 1 + mergesort_recurrence (length (y # zs)) + closest_pair_recurrence (length (y # zs)); distinct (x # y # zs)\<rbrakk> \<Longrightarrow> real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))

goal (1 subgoal):
 1. real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
real (time (closest_pair_tm (x # y # zs))) \<le> 1 + mergesort_recurrence (length (x # y # zs)) + closest_pair_recurrence (length (x # y # zs))

goal (2 subgoals):
 1. distinct [] \<Longrightarrow> real (time (closest_pair_tm [])) \<le> 1 + mergesort_recurrence (length []) + closest_pair_recurrence (length [])
 2. \<And>x. distinct [x] \<Longrightarrow> real (time (closest_pair_tm [x])) \<le> 1 + mergesort_recurrence (length [x]) + closest_pair_recurrence (length [x])
[PROOF STEP]
qed (auto simp: time_simps)


[STATEMENT]
lemma Image_subset_snd_image:
  "A `` B \<subseteq> snd ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A `` B \<subseteq> snd ` A
[PROOF STEP]
unfolding Image_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>B. (x, y) \<in> A} \<subseteq> {y. \<exists>x\<in>A. y = snd x}
[PROOF STEP]
by force


[STATEMENT]
lemma cong_prime_prod_zero_nat:
  "[a * b = 0] (mod p) \<Longrightarrow> prime p \<Longrightarrow> [a = 0] (mod p) \<or> [b = 0] (mod p)"
  for a :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[a * b = 0] (mod p); prime p\<rbrakk> \<Longrightarrow> [a = 0] (mod p) \<or> [b = 0] (mod p)
[PROOF STEP]
by (auto simp add: cong_altdef_nat prime_dvd_mult_iff)


[STATEMENT]
lemma prod_emb_id:
  "B \<subseteq> (\<Pi>\<^sub>E i\<in>L. space (M i)) \<Longrightarrow> prod_emb L M L B = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> (\<Pi>\<^sub>E i\<in>L. space (M i)) \<Longrightarrow> prod_emb L M L B = B
[PROOF STEP]
by (auto simp: prod_emb_def subset_eq extensional_restrict)


[STATEMENT]
lemma ran_map_graph: "ran f = Range(map_graph f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ran f = Range (map_graph f)
[PROOF STEP]
by (simp add: map_graph_def ran_def image_def)


[STATEMENT]
lemma meet_bot1[simp]:
  fixes y :: "'a :: {Finite_Meet_cpo,pcpo}"
  shows "(\<bottom> \<sqinter> y) = \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bottom> \<sqinter> y = \<bottom>
[PROOF STEP]
unfolding meet_def'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>{\<bottom>, y} = \<bottom>
[PROOF STEP]
by (metis minimal po_class.glb_bin)


[STATEMENT]
lemma tensor_mat_id:
  "tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) = 1\<^sub>m d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) = 1\<^sub>m d
[PROOF STEP]
proof (rule eq_matI, auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j. j < d \<Longrightarrow> tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (j, j) = (1::'a)
 2. \<And>i j. \<lbrakk>i < d; j < d; i \<noteq> j\<rbrakk> \<Longrightarrow> tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, j) = (0::'a)
[PROOF STEP]
show "tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, i) = 1" if "i < d" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, i) = (1::'b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
i < d

goal (1 subgoal):
 1. tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, i) = (1::'b)
[PROOF STEP]
by (simp add: tensor_mat_eval)
[PROOF STATE]
proof (state)
this:
?i3 < d \<Longrightarrow> tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (?i3, ?i3) = (1::?'b4)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d; i \<noteq> j\<rbrakk> \<Longrightarrow> tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, j) = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d; i \<noteq> j\<rbrakk> \<Longrightarrow> tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, j) = (0::'a)
[PROOF STEP]
show "tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, j) = 0" if "i < d" "j < d" "i \<noteq> j" for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, j) = (0::'b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
i < d
j < d
i \<noteq> j

goal (1 subgoal):
 1. tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (i, j) = (0::'b)
[PROOF STEP]
apply (simp add: tensor_mat_eval)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < d; j < d; i \<noteq> j\<rbrakk> \<Longrightarrow> encode1 i = encode1 j \<longrightarrow> encode2 i \<noteq> encode2 j
[PROOF STEP]
by (metis encode12_inv)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i3 < d; ?j3 < d; ?i3 \<noteq> ?j3\<rbrakk> \<Longrightarrow> tensor_mat (1\<^sub>m d1) (1\<^sub>m d2) $$ (?i3, ?j3) = (0::?'b4)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_Int [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<inter> T)
[PROOF STEP]
unfolding closed_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open (- S); open (- T)\<rbrakk> \<Longrightarrow> open (- (S \<inter> T))
[PROOF STEP]
by auto


[STATEMENT]
lemma row_upd_row_If: "row (upd_row M i x) j = (if i = j then x else row M j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.row (upd_row M i x) j = (if i = j then x else Square_Matrix.row M j)
[PROOF STEP]
by transfer (simp add: vec_eq_iff fun_eq_iff)


[STATEMENT]
lemma Inf_trans_lower:
  "\<lbrakk> t \<in> S; \<forall>u\<in>S. \<forall>P. sound P \<longrightarrow> sound (u P) \<rbrakk> \<Longrightarrow> le_trans (Inf_trans S) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> S; \<forall>u\<in>S. \<forall>P. sound P \<longrightarrow> sound (u P)\<rbrakk> \<Longrightarrow> le_trans (Inf_trans S) t
[PROOF STEP]
unfolding Inf_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> S; \<forall>u\<in>S. \<forall>P. sound P \<longrightarrow> sound (u P)\<rbrakk> \<Longrightarrow> le_trans (\<lambda>P. Inf_exp {t P |t. t \<in> S}) t
[PROOF STEP]
by(rule le_transI[OF Inf_exp_lower], blast+)


[STATEMENT]
lemma UN_disjointed_eq: "(\<Union>i. disjointed A i) = (\<Union>i. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range (disjointed A)) = \<Union> (range A)
[PROOF STEP]
by (rule UN_finite2_eq [where k=0])
     (simp add: finite_UN_disjointed_eq)


[STATEMENT]
lemma step_n_push_size_new_small [simp]: "\<lbrakk>
  invar (States dir big small);
  (step ^^ n) (States dir big (Small.push x small)) = States dir' big' small'
\<rbrakk> \<Longrightarrow> size_new small' = Suc (size_new small)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); (step ^^ n) (States dir big (Small.push x small)) = States dir' big' small'\<rbrakk> \<Longrightarrow> size_new small' = Suc (size_new small)
[PROOF STEP]
by (metis Small_Proof.size_new_push invar_states.simps invar_push_small step_n_size_new_small)


[STATEMENT]
theorem construct_tree_partial: "VARS e v D
  { construct_tree_pre x y R }
  D := 0;
  v := x;
  WHILE \<not> y \<le> v
    INV { construct_tree_inv v x y D R }
     DO e := choose_singleton (v*-v\<^sup>T \<cdot> R);
        D := D + e;
        v := v + e\<^sup>T*1
     OD
  { construct_tree_post x y D R }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {construct_tree_pre x y R}
D := 0; v := x; WHILE \<not> y \<le> v INV {construct_tree_inv v x y D R}  VAR {zero_class.zero}
DO e := choose_singleton (v * - v\<^sup>T \<cdot> R); D := D + e; v := v + e\<^sup>T * 1 OD
{construct_tree_post x y D R}
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>e v D. construct_tree_pre x y R \<Longrightarrow> construct_tree_inv x x y 0 R
 2. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> y \<le> v \<Longrightarrow> construct_tree_inv (v + choose_singleton (v * - v\<^sup>T \<cdot> R)\<^sup>T * 1) x y (D + choose_singleton (v * - v\<^sup>T \<cdot> R)) R
 3. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> \<not> y \<le> v \<Longrightarrow> construct_tree_post x y D R
[PROOF STEP]
using construct_tree_pre
[PROOF STATE]
proof (prove)
using this:
construct_tree_pre ?x ?y ?R \<Longrightarrow> construct_tree_inv ?x ?x ?y 0 ?R

goal (3 subgoals):
 1. \<And>e v D. construct_tree_pre x y R \<Longrightarrow> construct_tree_inv x x y 0 R
 2. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> y \<le> v \<Longrightarrow> construct_tree_inv (v + choose_singleton (v * - v\<^sup>T \<cdot> R)\<^sup>T * 1) x y (D + choose_singleton (v * - v\<^sup>T \<cdot> R)) R
 3. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> \<not> y \<le> v \<Longrightarrow> construct_tree_post x y D R
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> y \<le> v \<Longrightarrow> construct_tree_inv (v + choose_singleton (v * - v\<^sup>T \<cdot> R)\<^sup>T * 1) x y (D + choose_singleton (v * - v\<^sup>T \<cdot> R)) R
 2. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> \<not> y \<le> v \<Longrightarrow> construct_tree_post x y D R
[PROOF STEP]
using construct_tree_inv
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> ?y \<le> ?v; construct_tree_inv ?v ?x ?y ?D ?R\<rbrakk> \<Longrightarrow> construct_tree_inv (?v + choose_singleton (?v * - ?v\<^sup>T \<cdot> ?R)\<^sup>T * 1) ?x ?y (?D + choose_singleton (?v * - ?v\<^sup>T \<cdot> ?R)) ?R

goal (2 subgoals):
 1. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> y \<le> v \<Longrightarrow> construct_tree_inv (v + choose_singleton (v * - v\<^sup>T \<cdot> R)\<^sup>T * 1) x y (D + choose_singleton (v * - v\<^sup>T \<cdot> R)) R
 2. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> \<not> y \<le> v \<Longrightarrow> construct_tree_post x y D R
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> \<not> y \<le> v \<Longrightarrow> construct_tree_post x y D R
[PROOF STEP]
using construct_tree_post
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<le> ?v; construct_tree_inv ?v ?x ?y ?D ?R\<rbrakk> \<Longrightarrow> construct_tree_post ?x ?y ?D ?R

goal (1 subgoal):
 1. \<And>e v D. construct_tree_inv v x y D R \<and> \<not> \<not> y \<le> v \<Longrightarrow> construct_tree_post x y D R
[PROOF STEP]
by blast


[STATEMENT]
lemma "2 * (x::nat) \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * x \<noteq> 1
[PROOF STEP]
by smt


[STATEMENT]
lemma ordertype_WW: "ordertype WW (lenlex less_than) = \<omega>\<up>\<omega>"
  and ordertype_UNIV_\<omega>\<omega>: "ordertype UNIV (lenlex less_than) = \<omega>\<up>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype WW (lenlex less_than) = \<omega> \<up> \<omega> &&& ordertype UNIV (lenlex less_than) = \<omega> \<up> \<omega>
[PROOF STEP]
using ordertype_WW_1 ordertype_WW_2 ordertype_WW_3
[PROOF STATE]
proof (prove)
using this:
ordertype WW (lenlex less_than) \<le> ordertype UNIV (lenlex less_than)
ordertype UNIV (lenlex less_than) \<le> \<omega> \<up> \<omega>
\<omega> \<up> \<omega> \<le> ordertype WW (lenlex less_than)

goal (1 subgoal):
 1. ordertype WW (lenlex less_than) = \<omega> \<up> \<omega> &&& ordertype UNIV (lenlex less_than) = \<omega> \<up> \<omega>
[PROOF STEP]
by auto


[STATEMENT]
lemma One_fract_def: "1 = Fract 1 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = Fract (1::'a) (1::'a)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma SA_poly_to_Qp_poly_sub:
  assumes "f \<in> carrier (UP (SA n))"
  assumes "g \<in> carrier (UP (SA n))"
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "SA_poly_to_Qp_poly n a (compose (SA n) f g) = compose Q\<^sub>p (SA_poly_to_Qp_poly n a f) (SA_poly_to_Qp_poly n a g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (Cring_Poly.compose (SA n) f g) = Cring_Poly.compose Q\<^sub>p (SA_poly_to_Qp_poly n a f) (SA_poly_to_Qp_poly n a g)
[PROOF STEP]
unfolding SA_poly_to_Qp_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (Cring_Poly.compose (SA n) f g) = Cring_Poly.compose Q\<^sub>p (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) f) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) g)
[PROOF STEP]
using assms UP_cring.poly_lift_hom_sub[of "SA n" Q\<^sub>p "eval_hom a" f g]
        eval_hom_is_SA_hom[of a] ring_hom_ring.homh[of "SA n" Q\<^sub>p "eval_hom a"]
        SA_is_cring Qp.cring_axioms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (UP (SA n))
g \<in> carrier (UP (SA n))
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
\<lbrakk>UP_cring (SA n); cring Q\<^sub>p; eval_hom a \<in> ring_hom (SA n) Q\<^sub>p; f \<in> carrier (UP (SA n)); g \<in> carrier (UP (SA n))\<rbrakk> \<Longrightarrow> poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (Cring_Poly.compose (SA n) f g) = Cring_Poly.compose Q\<^sub>p (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) f) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) g)
a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> ring_hom_ring (SA ?n) Q\<^sub>p (eval_hom a)
ring_hom_ring (SA n) Q\<^sub>p (eval_hom a) \<Longrightarrow> eval_hom a \<in> ring_hom (SA n) Q\<^sub>p
cring (SA ?n)
cring Q\<^sub>p

goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (Cring_Poly.compose (SA n) f g) = Cring_Poly.compose Q\<^sub>p (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) f) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) g)
[PROOF STEP]
unfolding  SA_poly_to_Qp_poly_def eval_hom_def UP_cring_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (UP (SA n))
g \<in> carrier (UP (SA n))
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
\<lbrakk>cring (SA n); cring Q\<^sub>p; (\<lambda>f. f a) \<in> ring_hom (SA n) Q\<^sub>p; f \<in> carrier (UP (SA n)); g \<in> carrier (UP (SA n))\<rbrakk> \<Longrightarrow> poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) (Cring_Poly.compose (SA n) f g) = Cring_Poly.compose Q\<^sub>p (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) f) (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) g)
a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> ring_hom_ring (SA ?n) Q\<^sub>p (\<lambda>f. f a)
ring_hom_ring (SA n) Q\<^sub>p (\<lambda>f. f a) \<Longrightarrow> (\<lambda>f. f a) \<in> ring_hom (SA n) Q\<^sub>p
cring (SA ?n)
cring Q\<^sub>p

goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) (Cring_Poly.compose (SA n) f g) = Cring_Poly.compose Q\<^sub>p (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) f) (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) g)
[PROOF STEP]
by blast


[STATEMENT]
lemma Ex1_one_point [simp]:
  "(\<exists>! x. P x \<and> x = a) = P a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>!x. P x \<and> x = a) = P a
[PROOF STEP]
by auto


[STATEMENT]
lemma M_invertible: "invertible M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible M
[PROOF STEP]
unfolding invertible_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A'. M ** A' = mat 1 \<and> A' ** M = mat 1
[PROOF STEP]
using M_self_inverse
[PROOF STATE]
proof (prove)
using this:
M ** M = mat 1

goal (1 subgoal):
 1. \<exists>A'. M ** A' = mat 1 \<and> A' ** M = mat 1
[PROOF STEP]
by auto


[STATEMENT]
lemma mem_aforms_err_Cons_iff_Ex_conv: "x \<in> aforms_err e (X#XS) \<longleftrightarrow> (\<exists>y ys. x = y#ys \<and> y \<in> aform_err e X \<and> ys \<in> aforms_err e XS)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> aforms_err e (X # XS)) = (\<exists>y ys. x = y # ys \<and> y \<in> aform_err e X \<and> ys \<in> aforms_err e XS)
[PROOF STEP]
by (auto simp: aforms_err_Cons set_Cons_def)


[STATEMENT]
lemma compl: "\<forall>x \<in> carrier . \<forall>y\<in> carrier . x \<succeq> y \<or> y \<succeq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<succeq> y \<or> y \<succeq> x
[PROOF STEP]
by (metis refl_onD reflexivity total total_on_def)


[STATEMENT]
lemma product_of_basic_semialgs_is_semialg:
  assumes "k > 0"
  assumes "l > 0"
  assumes "a \<in> carrier (Q\<^sub>p[\<X>\<^bsub>n\<^esub>])"
  assumes "b \<in> carrier (Q\<^sub>p[\<X>\<^bsub>m\<^esub>])"
  shows "is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))
[PROOF STEP]
have 0:  "cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) =  basic_semialg_set (n+ m) k a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) = basic_semialg_set (n + m) k a
[PROOF STEP]
using Qp_times_basic_semialg_right assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>]) \<Longrightarrow> cartesian_product (basic_semialg_set ?n ?k ?a) (carrier (Q\<^sub>p\<^bsup>?m\<^esup>)) = basic_semialg_set (?n + ?m) ?k ?a
0 < k
0 < l
a \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
b \<in> carrier (Q\<^sub>p [\<X>\<^bsub>m\<^esub>])

goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) = basic_semialg_set (n + m) k a
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) = basic_semialg_set (n + m) k a

goal (1 subgoal):
 1. is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))
[PROOF STEP]
have 1:  "cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)  = basic_semialg_set (m + n) l (shift_vars m n b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b) = basic_semialg_set (m + n) l (shift_vars m n b)
[PROOF STEP]
using Qp_times_basic_semialg_left assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>]) \<Longrightarrow> cartesian_product (carrier (Q\<^sub>p\<^bsup>?m\<^esup>)) (basic_semialg_set ?n ?k ?a) = basic_semialg_set (?n + ?m) ?k (shift_vars ?n ?m ?a)
0 < k
0 < l
a \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
b \<in> carrier (Q\<^sub>p [\<X>\<^bsub>m\<^esub>])

goal (1 subgoal):
 1. cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b) = basic_semialg_set (m + n) l (shift_vars m n b)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b) = basic_semialg_set (m + n) l (shift_vars m n b)

goal (1 subgoal):
 1. is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))
[PROOF STEP]
have 2: "(cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b)) =
                cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter>
                 cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
have 0: "basic_semialg_set n k a \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basic_semialg_set n k a \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
using basic_semialg_set_memE(1)
[PROOF STATE]
proof (prove)
using this:
?q \<in> basic_semialg_set ?m ?n ?P \<Longrightarrow> ?q \<in> carrier (Q\<^sub>p\<^bsup>?m\<^esup>)

goal (1 subgoal):
 1. basic_semialg_set n k a \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
basic_semialg_set n k a \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
have 1: "carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)

goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
have 2: "carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
have 3: "basic_semialg_set m l b \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basic_semialg_set m l b \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
[PROOF STEP]
using basic_semialg_set_memE(1)
[PROOF STATE]
proof (prove)
using this:
?q \<in> basic_semialg_set ?m ?n ?P \<Longrightarrow> ?q \<in> carrier (Q\<^sub>p\<^bsup>?m\<^esup>)

goal (1 subgoal):
 1. basic_semialg_set m l b \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
basic_semialg_set m l b \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)

goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
using 0 1 2 3 cartesian_product_intersection[of "(basic_semialg_set n k a)" Q\<^sub>p n
                                              "(carrier (Q\<^sub>p\<^bsup>m\<^esup>))" m
                                              "(carrier (Q\<^sub>p\<^bsup>n\<^esup>))" "(basic_semialg_set m l b)"]
[PROOF STATE]
proof (prove)
using this:
basic_semialg_set n k a \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
basic_semialg_set m l b \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
\<lbrakk>basic_semialg_set n k a \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>); carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>); carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>); basic_semialg_set m l b \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)\<rbrakk> \<Longrightarrow> cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a \<inter> carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<inter> basic_semialg_set m l b)

goal (1 subgoal):
 1. cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
by (smt Collect_cong inf.absorb_iff1 inf.absorb_iff2)
[PROOF STATE]
proof (state)
this:
cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)

goal (1 subgoal):
 1. is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)

goal (1 subgoal):
 1. is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))
[PROOF STEP]
using Qp_times_basic_semialg_left_is_semialgebraic
          Qp_times_basic_semialg_right_is_semialgebraic  assms
[PROOF STATE]
proof (prove)
using this:
cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b) = cartesian_product (basic_semialg_set n k a) (carrier (Q\<^sub>p\<^bsup>m\<^esup>)) \<inter> cartesian_product (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) (basic_semialg_set m l b)
\<lbrakk>0 < ?k; ?a \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> is_semialgebraic (?n + ?m) (cartesian_product (carrier (Q\<^sub>p\<^bsup>?m\<^esup>)) (basic_semialg_set ?n ?k ?a))
\<lbrakk>0 < ?k; ?a \<in> carrier (Q\<^sub>p [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> is_semialgebraic (?n + ?m) (cartesian_product (basic_semialg_set ?n ?k ?a) (carrier (Q\<^sub>p\<^bsup>?m\<^esup>)))
0 < k
0 < l
a \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])
b \<in> carrier (Q\<^sub>p [\<X>\<^bsub>m\<^esub>])

goal (1 subgoal):
 1. is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))
[PROOF STEP]
by (metis (no_types, lifting) add.commute intersection_is_semialg)
[PROOF STATE]
proof (state)
this:
is_semialgebraic (n + m) (cartesian_product (basic_semialg_set n k a) (basic_semialg_set m l b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "123.456 = -111.111 + 200 + 30 + 4 + 5/10 + 6/100 + (7/1000::rat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 123456 / 10 ^ 3 = - (111111 / 10 ^ 3) + 200 + 30 + 4 + 5 / 10 + 6 / 100 + 7 / 1000
[PROOF STEP]
by simp


[STATEMENT]
lemma indicator_disj_union:
  "A \<inter> B = {} \<Longrightarrow> indicator (A \<union> B) x = (indicator A x + indicator B x :: 'a::linordered_semidom)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B = {} \<Longrightarrow> indicator (A \<union> B) x = indicator A x + indicator B x
[PROOF STEP]
by (auto split: split_indicator)


[STATEMENT]
lemma word_shift_nonzero:
  "\<lbrakk> (x::'a::len word) \<le> 2 ^ m; m + n < LENGTH('a::len); x \<noteq> 0\<rbrakk>
   \<Longrightarrow> x << n \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> 2 ^ m; m + n < LENGTH('a); x \<noteq> 0\<rbrakk> \<Longrightarrow> x << n \<noteq> 0
[PROOF STEP]
apply (simp only: word_neq_0_conv word_less_nat_alt
                    shiftl_t2n mod_0 unat_word_ariths
                    unat_power_lower word_le_nat_alt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x mod 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst mod_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 2 ^ n * unat x < 2 ^ LENGTH('a)
 2. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x
[PROOF STEP]
apply (rule order_le_less_trans)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 2 ^ n * unat x \<le> ?y5
 2. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> ?y5 < 2 ^ LENGTH('a)
 3. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x
[PROOF STEP]
apply (erule mult_le_mono2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 2 ^ n * 2 ^ m < 2 ^ LENGTH('a)
 2. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x
[PROOF STEP]
apply (subst power_add[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 2 ^ (n + m) < 2 ^ LENGTH('a)
 2. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x
[PROOF STEP]
apply (rule power_strict_increasing)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> n + m < LENGTH('a)
 2. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 1 < 2
 3. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 1 < 2
 2. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat x \<le> 2 ^ m; m + n < LENGTH('a); 0 < unat x\<rbrakk> \<Longrightarrow> 0 < 2 ^ n * unat x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Compl_in_sets_lebesgue: "-A \<in> sets lebesgue \<longleftrightarrow> A  \<in> sets lebesgue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- A \<in> sets lebesgue) = (A \<in> sets lebesgue)
[PROOF STEP]
by (metis Compl_eq_Diff_UNIV double_compl space_borel space_completion space_lborel Sigma_Algebra.sets.compl_sets)


[STATEMENT]
lemma openin_map_topology:
  "openin (map_topology p X) = (\<lambda>U. U \<subseteq> p ` topspace X \<and> openin X (p -` U \<inter> topspace X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (map_topology p X) = (\<lambda>U. U \<subseteq> p ` topspace X \<and> openin X (p -` U \<inter> topspace X))
[PROOF STEP]
by (auto simp: map_topology_def openin_final_topology)


[STATEMENT]
lemma distinct_cols_id:
  shows "distinct (cols (1\<^sub>m d)::'a vec list)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (cols (1\<^sub>m d))
[PROOF STEP]
by (simp add: conjugatable_vec_space.cols_id_unit_vecs vec_space.unit_vecs_distinct)


[STATEMENT]
lemma preserves_comp_2:
    assumes "A2.seq f2' f2"
    shows "(\<lambda>f1. F (f1, f2' \<cdot>\<^sub>A\<^sub>2 f2)) =
                 vertical_composite.map A1 B (\<lambda>f1. F (f1, f2)) (\<lambda>f1. F (f1, f2'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f1. F (f1, f2' \<cdot>\<^sub>A\<^sub>2 f2)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. F (f1, f2)) (\<lambda>f1. F (f1, f2'))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>f1. F (f1, f2' \<cdot>\<^sub>A\<^sub>2 f2)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. F (f1, f2)) (\<lambda>f1. F (f1, f2'))
[PROOF STEP]
interpret F': binary_functor A2 A1 B sym
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. binary_functor (\<cdot>\<^sub>A\<^sub>2) (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) local.sym
[PROOF STEP]
using assms(1) sym_is_binary_functor
[PROOF STATE]
proof (prove)
using this:
A2.seq f2' f2
binary_functor (\<cdot>\<^sub>A\<^sub>2) (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) local.sym

goal (1 subgoal):
 1. binary_functor (\<cdot>\<^sub>A\<^sub>2) (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) local.sym
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>f1. F (f1, f2' \<cdot>\<^sub>A\<^sub>2 f2)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. F (f1, f2)) (\<lambda>f1. F (f1, f2'))
[PROOF STEP]
have "(\<lambda>f1. sym (f2' \<cdot>\<^sub>A\<^sub>2 f2, f1)) =
                 vertical_composite.map A1 B (\<lambda>f1. sym (f2, f1)) (\<lambda>f1. sym (f2', f1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f1. local.sym (f2' \<cdot>\<^sub>A\<^sub>2 f2, f1)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. local.sym (f2, f1)) (\<lambda>f1. local.sym (f2', f1))
[PROOF STEP]
using assms F'.preserves_comp_1
[PROOF STATE]
proof (prove)
using this:
A2.seq f2' f2
A2.seq ?f1' ?f1.0 \<Longrightarrow> (\<lambda>f2. local.sym (?f1' \<cdot>\<^sub>A\<^sub>2 ?f1.0, f2)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f2. local.sym (?f1.0, f2)) (\<lambda>f2. local.sym (?f1', f2))

goal (1 subgoal):
 1. (\<lambda>f1. local.sym (f2' \<cdot>\<^sub>A\<^sub>2 f2, f1)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. local.sym (f2, f1)) (\<lambda>f1. local.sym (f2', f1))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>f1. local.sym (f2' \<cdot>\<^sub>A\<^sub>2 f2, f1)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. local.sym (f2, f1)) (\<lambda>f1. local.sym (f2', f1))

goal (1 subgoal):
 1. (\<lambda>f1. F (f1, f2' \<cdot>\<^sub>A\<^sub>2 f2)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. F (f1, f2)) (\<lambda>f1. F (f1, f2'))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>f1. local.sym (f2' \<cdot>\<^sub>A\<^sub>2 f2, f1)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. local.sym (f2, f1)) (\<lambda>f1. local.sym (f2', f1))

goal (1 subgoal):
 1. (\<lambda>f1. F (f1, f2' \<cdot>\<^sub>A\<^sub>2 f2)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. F (f1, f2)) (\<lambda>f1. F (f1, f2'))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>f1. F (f1, f2' \<cdot>\<^sub>A\<^sub>2 f2)) = vertical_composite.map (\<cdot>\<^sub>A\<^sub>1) (\<cdot>\<^sub>B) (\<lambda>f1. F (f1, f2)) (\<lambda>f1. F (f1, f2'))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pow_int_0[simp]: "pow_int x 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pow_int x 0 = (1::'a)
[PROOF STEP]
unfolding pow_int_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 < 0 then (1::'a) / x ^ nat (- 0) else x ^ nat 0) = (1::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma inner_Basis_sum:
  "(\<And>i. i \<in> I \<Longrightarrow> x i \<in> S) \<Longrightarrow> inner_Basis (\<Sum>i\<in>I. x i) v = (\<Sum>i\<in>I. inner_Basis (x i) v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> x i \<in> S) \<Longrightarrow> local.inner_Basis (sum x I) v = (\<Sum>i\<in>I. local.inner_Basis (x i) v)
[PROOF STEP]
apply (induction I rule: infinite_finite_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>i. i \<in> A \<Longrightarrow> x i \<in> S\<rbrakk> \<Longrightarrow> local.inner_Basis (sum x A) v = (\<Sum>i\<in>A. local.inner_Basis (x i) v)
 2. (\<And>i. i \<in> {} \<Longrightarrow> x i \<in> S) \<Longrightarrow> local.inner_Basis (sum x {}) v = (\<Sum>i\<in>{}. local.inner_Basis (x i) v)
 3. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> x i \<in> S) \<Longrightarrow> local.inner_Basis (sum x F) v = (\<Sum>i\<in>F. local.inner_Basis (x i) v); \<And>i. i \<in> insert xa F \<Longrightarrow> x i \<in> S\<rbrakk> \<Longrightarrow> local.inner_Basis (sum x (insert xa F)) v = (\<Sum>i\<in>insert xa F. local.inner_Basis (x i) v)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; local.inner_Basis (sum x F) v = (\<Sum>i\<in>F. local.inner_Basis (x i) v); \<And>i. i = xa \<or> i \<in> F \<Longrightarrow> x i \<in> S\<rbrakk> \<Longrightarrow> local.inner_Basis (x xa + sum x F) v = local.inner_Basis (x xa) v + (\<Sum>i\<in>F. local.inner_Basis (x i) v)
[PROOF STEP]
apply (subst inner_Basis_add)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; local.inner_Basis (sum x F) v = (\<Sum>i\<in>F. local.inner_Basis (x i) v); \<And>i. i = xa \<or> i \<in> F \<Longrightarrow> x i \<in> S\<rbrakk> \<Longrightarrow> x xa \<in> S
 2. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; local.inner_Basis (sum x F) v = (\<Sum>i\<in>F. local.inner_Basis (x i) v); \<And>i. i = xa \<or> i \<in> F \<Longrightarrow> x i \<in> S\<rbrakk> \<Longrightarrow> sum x F \<in> S
 3. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; local.inner_Basis (sum x F) v = (\<Sum>i\<in>F. local.inner_Basis (x i) v); \<And>i. i = xa \<or> i \<in> F \<Longrightarrow> x i \<in> S\<rbrakk> \<Longrightarrow> local.inner_Basis (x xa) v + local.inner_Basis (sum x F) v = local.inner_Basis (x xa) v + (\<Sum>i\<in>F. local.inner_Basis (x i) v)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; local.inner_Basis (sum x F) v = (\<Sum>i\<in>F. local.inner_Basis (x i) v); \<And>i. i = xa \<or> i \<in> F \<Longrightarrow> x i \<in> S\<rbrakk> \<Longrightarrow> sum x F \<in> S
[PROOF STEP]
by (metis B(2) subspace_span subspace_sum)


[STATEMENT]
lemma natceiling_le_iff:
  fixes n :: nat and r :: real
  shows "r \<le> n \<Longrightarrow> nat(ceiling r) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<le> real n \<Longrightarrow> nat \<lceil>r\<rceil> \<le> n
[PROOF STEP]
by linarith


[STATEMENT]
lemma quadruple_sum_Union_eq:
   "\<Union> ((\<lambda> x. {(a, b, c, d) | a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and>
    additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x}) ` (sumset A A)) = additive_quadruple_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x}) = additive_quadruple_set A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x}) \<subseteq> additive_quadruple_set A
 2. additive_quadruple_set A \<subseteq> (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x})
[PROOF STEP]
show "(\<Union>x\<in>sumset A A.
    {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and>
    a \<oplus> b = x \<and> c \<oplus> d = x}) \<subseteq> additive_quadruple_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x}) \<subseteq> additive_quadruple_set A
[PROOF STEP]
unfolding additive_quadruple_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x}) \<subseteq> {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d}
[PROOF STEP]
by (intro Union_least) (auto)
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x}) \<subseteq> additive_quadruple_set A

goal (1 subgoal):
 1. additive_quadruple_set A \<subseteq> (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. additive_quadruple_set A \<subseteq> (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x})
[PROOF STEP]
show "additive_quadruple_set A \<subseteq> (\<Union>x\<in>sumset A A.
    {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and>
    additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. additive_quadruple_set A \<subseteq> (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x})
[PROOF STEP]
unfolding additive_quadruple_set_def additive_quadruple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> a \<in> G \<and> b \<in> G \<and> c \<in> G \<and> d \<in> G \<and> a \<oplus> b = c \<oplus> d} \<subseteq> (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> (a \<in> G \<and> b \<in> G \<and> c \<in> G \<and> d \<in> G \<and> a \<oplus> b = c \<oplus> d) \<and> a \<oplus> b = x \<and> c \<oplus> d = x})
[PROOF STEP]
by (intro subsetI) (auto)
[PROOF STATE]
proof (state)
this:
additive_quadruple_set A \<subseteq> (\<Union>x\<in>sumset A A. {(a, b, c, d) |a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma liminf_bounded_iff:
  fixes x :: "nat \<Rightarrow> ereal"
  shows "C \<le> liminf x \<longleftrightarrow> (\<forall>B<C. \<exists>N. \<forall>n\<ge>N. B < x n)"
  (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (C \<le> liminf x) = (\<forall>B<C. \<exists>N. \<forall>n\<ge>N. B < x n)
[PROOF STEP]
unfolding le_Liminf_iff eventually_sequentially
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y<C. \<exists>N. \<forall>n\<ge>N. y < x n) = (\<forall>B<C. \<exists>N. \<forall>n\<ge>N. B < x n)
[PROOF STEP]
..


[STATEMENT]
lemma extract_var_non_zero_coeff: "extract_var p v = (\<Sum>m\<in>{m'. coeff p m' \<noteq> 0}. monom (remove_key v m) (monom (Poly_Mapping.single v (lookup m v)) (coeff p m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_var p v = (\<Sum>m\<in>{m'. coeff p m' \<noteq> (0::'a)}. monom (remove_key v m) (monom (Poly_Mapping.single v (lookup m v)) (coeff p m)))
[PROOF STEP]
using extract_var_finite_set  coeff_def finite_lookup order_refl
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{m'. coeff ?p m' \<noteq> (0::?'a)} \<subseteq> ?S; finite ?S\<rbrakk> \<Longrightarrow> extract_var ?p ?v = (\<Sum>m\<in>?S. monom (remove_key ?v m) (monom (Poly_Mapping.single ?v (lookup m ?v)) (coeff ?p m)))
coeff ?p = lookup (mapping_of ?p)
finite {k. lookup ?f k \<noteq> (0::?'b)}
?x \<le> ?x

goal (1 subgoal):
 1. extract_var p v = (\<Sum>m\<in>{m'. coeff p m' \<noteq> (0::'a)}. monom (remove_key v m) (monom (Poly_Mapping.single v (lookup m v)) (coeff p m)))
[PROOF STEP]
by (metis (no_types, lifting) Collect_cong sum.cong)


[STATEMENT]
lemma inc_matrix_one_implies_membership: "I \<subseteq> {..< length Vs} \<Longrightarrow> j < length Bs \<Longrightarrow>
    (\<And> i. i\<in>I \<Longrightarrow> (inc_mat_of Vs Bs) $$ (i, j) = 1) \<Longrightarrow> i \<in> I \<Longrightarrow> Vs ! i \<in> Bs ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<subseteq> {..<length Vs}; j < length Bs; \<And>i. i \<in> I \<Longrightarrow> inc_mat_of Vs Bs $$ (i, j) = (1::'b); i \<in> I\<rbrakk> \<Longrightarrow> Vs ! i \<in> Bs ! j
[PROOF STEP]
using inc_matrix_point_in_block subset_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < length ?Vs; ?j < length ?Bs; inc_mat_of ?Vs ?Bs $$ (?i, ?j) = (1::?'b)\<rbrakk> \<Longrightarrow> ?Vs ! ?i \<in> ?Bs ! ?j
(?A \<subseteq> ?B) = (\<forall>t. t \<in> ?A \<longrightarrow> t \<in> ?B)

goal (1 subgoal):
 1. \<lbrakk>I \<subseteq> {..<length Vs}; j < length Bs; \<And>i. i \<in> I \<Longrightarrow> inc_mat_of Vs Bs $$ (i, j) = (1::'b); i \<in> I\<rbrakk> \<Longrightarrow> Vs ! i \<in> Bs ! j
[PROOF STEP]
by blast