[STATEMENT]
lemma safety_conj:
  assumes "safety P"
  assumes "safety Q"
  shows "safety (P \<^bold>\<and> Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. safety (\<lambda>s. P s \<and> Q s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
safety P
safety Q

goal (1 subgoal):
 1. safety (\<lambda>s. P s \<and> Q s)
[PROOF STEP]
unfolding safety_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<sigma>. \<not> P \<sigma> \<longrightarrow> (\<exists>i. \<forall>\<beta>. \<not> P (stake i \<sigma> @- \<beta>))
\<forall>\<sigma>. \<not> Q \<sigma> \<longrightarrow> (\<exists>i. \<forall>\<beta>. \<not> Q (stake i \<sigma> @- \<beta>))

goal (1 subgoal):
 1. \<forall>\<sigma>. \<not> (P \<sigma> \<and> Q \<sigma>) \<longrightarrow> (\<exists>i. \<forall>\<beta>. \<not> (P (stake i \<sigma> @- \<beta>) \<and> Q (stake i \<sigma> @- \<beta>)))
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_cutoff_zero [simp]: "fps_cutoff n 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_cutoff n 0 = 0
[PROOF STEP]
by (simp add: fps_eq_iff)


[STATEMENT]
lemma rbl_pred: "rbl_pred (rev (bin_to_bl n bin)) = rev (bin_to_bl n (bin - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbl_pred (rev (bin_to_bl n bin)) = rev (bin_to_bl n (bin - 1))
[PROOF STEP]
proof (unfold bin_to_bl_def, induction n arbitrary: bin)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>bin. rbl_pred (rev (bin_to_bl_aux 0 bin [])) = rev (bin_to_bl_aux 0 (bin - 1) [])
 2. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>bin. rbl_pred (rev (bin_to_bl_aux 0 bin [])) = rev (bin_to_bl_aux 0 (bin - 1) [])
 2. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbl_pred (rev (bin_to_bl_aux 0 bin [])) = rev (bin_to_bl_aux 0 (bin - 1) [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rbl_pred (rev (bin_to_bl_aux 0 bin [])) = rev (bin_to_bl_aux 0 (bin - 1) [])

goal (1 subgoal):
 1. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
rbl_pred (rev (bin_to_bl_aux n ?bin [])) = rev (bin_to_bl_aux n (?bin - 1) [])

goal (1 subgoal):
 1. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
obtain b k where \<open>bin = of_bool b + 2 * k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b k. bin = of_bool b + 2 * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using bin_exhaust
[PROOF STATE]
proof (prove)
using this:
(\<And>x b. ?bin = of_bool b + 2 * x \<Longrightarrow> ?Q) \<Longrightarrow> ?Q

goal (1 subgoal):
 1. (\<And>b k. bin = of_bool b + 2 * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bin = of_bool b + 2 * k

goal (1 subgoal):
 1. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bin = of_bool b + 2 * k

goal (1 subgoal):
 1. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
have \<open>(2 * k - 1) div 2 = k - 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * k - 1) div 2 = k - 1
[PROOF STEP]
using even_succ_div_2 [of \<open>2 * (k - 1)\<close>]
[PROOF STATE]
proof (prove)
using this:
even (2 * (k - 1)) \<Longrightarrow> (1 + 2 * (k - 1)) div 2 = 2 * (k - 1) div 2

goal (1 subgoal):
 1. (2 * k - 1) div 2 = k - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(2 * k - 1) div 2 = k - 1

goal (1 subgoal):
 1. \<And>n bin. (\<And>bin. rbl_pred (rev (bin_to_bl_aux n bin [])) = rev (bin_to_bl_aux n (bin - 1) [])) \<Longrightarrow> rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bin = of_bool b + 2 * k
(2 * k - 1) div 2 = k - 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bin = of_bool b + 2 * k
(2 * k - 1) div 2 = k - 1

goal (1 subgoal):
 1. rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
using Suc [of \<open>bin div 2\<close>]
[PROOF STATE]
proof (prove)
using this:
bin = of_bool b + 2 * k
(2 * k - 1) div 2 = k - 1
rbl_pred (rev (bin_to_bl_aux n (bin div 2) [])) = rev (bin_to_bl_aux n (bin div 2 - 1) [])

goal (1 subgoal):
 1. rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])
[PROOF STEP]
by simp (auto simp add: bin_to_bl_aux_alt)
[PROOF STATE]
proof (state)
this:
rbl_pred (rev (bin_to_bl_aux (Suc n) bin [])) = rev (bin_to_bl_aux (Suc n) (bin - 1) [])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_digit_simps[simp] :
  "n < 10 \<Longrightarrow> is_digit n"
  "\<not>(n < 10) \<Longrightarrow> \<not>(is_digit n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n < 10 \<Longrightarrow> is_digit n) &&& (\<not> n < 10 \<Longrightarrow> \<not> is_digit n)
[PROOF STEP]
unfolding is_digit_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n < 10 \<Longrightarrow> n < 10) &&& (\<not> n < 10 \<Longrightarrow> \<not> n < 10)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma upt_add_eq_append': "i \<le> j \<Longrightarrow> j \<le> k \<Longrightarrow> [i..<k] = [i..<j] @ [j..<k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> [i..<k] = [i..<j] @ [j..<k]
[PROOF STEP]
using upt_add_eq_append[of i j "k - j"]
[PROOF STATE]
proof (prove)
using this:
i \<le> j \<Longrightarrow> [i..<j + (k - j)] = [i..<j] @ [j..<j + (k - j)]

goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> [i..<k] = [i..<j] @ [j..<k]
[PROOF STEP]
by simp


[STATEMENT]
lemma Scons_inject2: "Scons M N = Scons M' N' ==> N=N'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Scons M N = Scons M' N' \<Longrightarrow> N = N'
[PROOF STEP]
apply (erule equalityE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Scons M N \<subseteq> Scons M' N'; Scons M' N' \<subseteq> Scons M N\<rbrakk> \<Longrightarrow> N = N'
[PROOF STEP]
apply (iprover intro: equalityI Scons_inject_lemma2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma minus_one_cong_solve:
  fixes n x :: nat
  assumes "1 < n"
    and eq: "[x = n - 1] (mod n)" "[x * y = 1] (mod n)"
    and coprime: "coprime x n" "coprime y n"
  shows "[y = n - 1](mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
have "0 < x mod n" "0 < y mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x mod n &&& 0 < y mod n
[PROOF STEP]
using coprime coprime_imp_mod_not_zero \<open>1 < n\<close>
[PROOF STATE]
proof (prove)
using this:
coprime x n
coprime y n
\<lbrakk>1 < ?n; coprime ?x ?n\<rbrakk> \<Longrightarrow> 0 < ?x mod ?n
1 < n

goal (1 subgoal):
 1. 0 < x mod n &&& 0 < y mod n
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
0 < x mod n
0 < y mod n

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < x mod n
0 < y mod n

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
have "x mod n < n" "y mod n < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod n < n &&& y mod n < n
[PROOF STEP]
using \<open>1 < n\<close>
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. x mod n < n &&& y mod n < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x mod n < n
y mod n < n

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x mod n < n
y mod n < n

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
have "[x mod n = n - 1] (mod n)" "[x mod n * (y mod n) = 1] (mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [x mod n = n - 1] (mod n) &&& [x mod n * (y mod n) = 1] (mod n)
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
[x = n - 1] (mod n)
[x * y = 1] (mod n)

goal (1 subgoal):
 1. [x mod n = n - 1] (mod n) &&& [x mod n * (y mod n) = 1] (mod n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[x mod n = n - 1] (mod n)
[x mod n * (y mod n) = 1] (mod n)

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[x mod n = n - 1] (mod n)
[x mod n * (y mod n) = 1] (mod n)

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
have "coprime (x mod n) n" "coprime (y mod n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (x mod n) n &&& coprime (y mod n) n
[PROOF STEP]
using coprime coprime_mod_left_iff \<open>1 < n\<close>
[PROOF STATE]
proof (prove)
using this:
coprime x n
coprime y n
?b \<noteq> (0::?'a) \<Longrightarrow> coprime (?a mod ?b) ?b = coprime ?a ?b
1 < n

goal (1 subgoal):
 1. coprime (x mod n) n &&& coprime (y mod n) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (x mod n) n
coprime (y mod n) n

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < x mod n
0 < y mod n
x mod n < n
y mod n < n
[x mod n = n - 1] (mod n)
[x mod n * (y mod n) = 1] (mod n)
coprime (x mod n) n
coprime (y mod n) n
[PROOF STEP]
have "[y mod n = n - 1] (mod n)"
[PROOF STATE]
proof (prove)
using this:
0 < x mod n
0 < y mod n
x mod n < n
y mod n < n
[x mod n = n - 1] (mod n)
[x mod n * (y mod n) = 1] (mod n)
coprime (x mod n) n
coprime (y mod n) n

goal (1 subgoal):
 1. [y mod n = n - 1] (mod n)
[PROOF STEP]
using minus_one_cong_solve_weak[OF \<open>1 < n\<close>, of "x mod n" "y mod n"]
[PROOF STATE]
proof (prove)
using this:
0 < x mod n
0 < y mod n
x mod n < n
y mod n < n
[x mod n = n - 1] (mod n)
[x mod n * (y mod n) = 1] (mod n)
coprime (x mod n) n
coprime (y mod n) n
\<lbrakk>x mod n \<in> totatives n; y mod n \<in> totatives n; [x mod n = n - 1] (mod n); [x mod n * (y mod n) = 1] (mod n)\<rbrakk> \<Longrightarrow> y mod n = n - 1

goal (1 subgoal):
 1. [y mod n = n - 1] (mod n)
[PROOF STEP]
by (auto simp: totatives_def)
[PROOF STATE]
proof (state)
this:
[y mod n = n - 1] (mod n)

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[y mod n = n - 1] (mod n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[y mod n = n - 1] (mod n)

goal (1 subgoal):
 1. [y = n - 1] (mod n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[y = n - 1] (mod n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wfLexLessState:
  fixes decisionVars :: "Variable set" and F0 :: "Formula"
  assumes "finite decisionVars"
  shows "wf (lexLessState F0 decisionVars)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (lexLessState F0 decisionVars)
[PROOF STEP]
unfolding wf_eq_minimal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Q x. x \<in> Q \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. (y, z) \<in> lexLessState F0 decisionVars \<longrightarrow> y \<notin> Q)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>Q x. x \<in> Q \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. (y, z) \<in> lexLessState F0 decisionVars \<longrightarrow> y \<notin> Q)
[PROOF STEP]
show "\<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
fix Q :: "State set" and state :: State
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
assume "state \<in> Q"
[PROOF STATE]
proof (state)
this:
state \<in> Q

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
let ?Q1 = "{M::LiteralTrail. \<exists> state. state \<in> Q \<and> (getM state) = M}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
from \<open>state \<in> Q\<close>
[PROOF STATE]
proof (chain)
picking this:
state \<in> Q
[PROOF STEP]
have "getM state \<in> ?Q1"
[PROOF STATE]
proof (prove)
using this:
state \<in> Q

goal (1 subgoal):
 1. getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
from \<open>finite decisionVars\<close>
[PROOF STATE]
proof (chain)
picking this:
finite decisionVars
[PROOF STEP]
have "finite (vars F0 \<union> decisionVars)"
[PROOF STATE]
proof (prove)
using this:
finite decisionVars

goal (1 subgoal):
 1. finite (vars F0 \<union> decisionVars)
[PROOF STEP]
using finiteVarsFormula[of "F0"]
[PROOF STATE]
proof (prove)
using this:
finite decisionVars
finite (vars F0)

goal (1 subgoal):
 1. finite (vars F0 \<union> decisionVars)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (vars F0 \<union> decisionVars)

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
hence "wf (lexLessRestricted (vars F0 \<union> decisionVars))"
[PROOF STATE]
proof (prove)
using this:
finite (vars F0 \<union> decisionVars)

goal (1 subgoal):
 1. wf (lexLessRestricted (vars F0 \<union> decisionVars))
[PROOF STEP]
using  wfLexLessRestricted[of "vars F0 \<union> decisionVars"]
[PROOF STATE]
proof (prove)
using this:
finite (vars F0 \<union> decisionVars)
finite (vars F0 \<union> decisionVars) \<Longrightarrow> wf (lexLessRestricted (vars F0 \<union> decisionVars))

goal (1 subgoal):
 1. wf (lexLessRestricted (vars F0 \<union> decisionVars))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
wf (lexLessRestricted (vars F0 \<union> decisionVars))

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
with \<open>getM state \<in> ?Q1\<close>
[PROOF STATE]
proof (chain)
picking this:
getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}
wf (lexLessRestricted (vars F0 \<union> decisionVars))
[PROOF STEP]
obtain Mmin where "Mmin \<in> ?Q1" "\<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> ?Q1"
[PROOF STATE]
proof (prove)
using this:
getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}
wf (lexLessRestricted (vars F0 \<union> decisionVars))

goal (1 subgoal):
 1. (\<And>Mmin. \<lbrakk>Mmin \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}; \<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding wf_eq_minimal
[PROOF STATE]
proof (prove)
using this:
getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}
\<forall>Q x. x \<in> Q \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. (y, z) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> y \<notin> Q)

goal (1 subgoal):
 1. (\<And>Mmin. \<lbrakk>Mmin \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}; \<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply (erule_tac x="?Q1" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>Mmin. \<lbrakk>Mmin \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}; \<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}\<rbrakk> \<Longrightarrow> thesis; getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}; \<forall>x. x \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M} \<longrightarrow> (\<exists>z\<in>{M. \<exists>state. state \<in> Q \<and> getM state = M}. \<forall>y. (y, z) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> y \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
apply (erule_tac x="getM state" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>Mmin. \<lbrakk>Mmin \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}; \<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}\<rbrakk> \<Longrightarrow> thesis; getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}; getM state \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M} \<longrightarrow> (\<exists>z\<in>{M. \<exists>state. state \<in> Q \<and> getM state = M}. \<forall>y. (y, z) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> y \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mmin \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}
\<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
from \<open>Mmin \<in> ?Q1\<close>
[PROOF STATE]
proof (chain)
picking this:
Mmin \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}
[PROOF STEP]
obtain stateMin
        where "stateMin \<in> Q" "(getM stateMin) = Mmin"
[PROOF STATE]
proof (prove)
using this:
Mmin \<in> {M. \<exists>state. state \<in> Q \<and> getM state = M}

goal (1 subgoal):
 1. (\<And>stateMin. \<lbrakk>stateMin \<in> Q; getM stateMin = Mmin\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
stateMin \<in> Q
getM stateMin = Mmin

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
have "\<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q
[PROOF STEP]
fix state'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q
[PROOF STEP]
show "(state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (state', stateMin) \<in> lexLessState F0 decisionVars \<Longrightarrow> state' \<notin> Q
[PROOF STEP]
assume "(state', stateMin) \<in> lexLessState F0 decisionVars"
[PROOF STATE]
proof (state)
this:
(state', stateMin) \<in> lexLessState F0 decisionVars

goal (1 subgoal):
 1. (state', stateMin) \<in> lexLessState F0 decisionVars \<Longrightarrow> state' \<notin> Q
[PROOF STEP]
hence "(getM state', getM stateMin) \<in> lexLessRestricted (vars F0 \<union> decisionVars)"
[PROOF STATE]
proof (prove)
using this:
(state', stateMin) \<in> lexLessState F0 decisionVars

goal (1 subgoal):
 1. (getM state', getM stateMin) \<in> lexLessRestricted (vars F0 \<union> decisionVars)
[PROOF STEP]
unfolding lexLessState_def
[PROOF STATE]
proof (prove)
using this:
(state', stateMin) \<in> {(stateA, stateB). (getM stateA, getM stateB) \<in> lexLessRestricted (vars F0 \<union> decisionVars)}

goal (1 subgoal):
 1. (getM state', getM stateMin) \<in> lexLessRestricted (vars F0 \<union> decisionVars)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(getM state', getM stateMin) \<in> lexLessRestricted (vars F0 \<union> decisionVars)

goal (1 subgoal):
 1. (state', stateMin) \<in> lexLessState F0 decisionVars \<Longrightarrow> state' \<notin> Q
[PROOF STEP]
from \<open>\<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> ?Q1\<close>
            \<open>(getM state', getM stateMin) \<in> lexLessRestricted (vars F0 \<union> decisionVars)\<close> \<open>getM stateMin = Mmin\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}
(getM state', getM stateMin) \<in> lexLessRestricted (vars F0 \<union> decisionVars)
getM stateMin = Mmin
[PROOF STEP]
have "getM state' \<notin> ?Q1"
[PROOF STATE]
proof (prove)
using this:
\<forall>M'. (M', Mmin) \<in> lexLessRestricted (vars F0 \<union> decisionVars) \<longrightarrow> M' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}
(getM state', getM stateMin) \<in> lexLessRestricted (vars F0 \<union> decisionVars)
getM stateMin = Mmin

goal (1 subgoal):
 1. getM state' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
getM state' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}

goal (1 subgoal):
 1. (state', stateMin) \<in> lexLessState F0 decisionVars \<Longrightarrow> state' \<notin> Q
[PROOF STEP]
with \<open>getM stateMin = Mmin\<close>
[PROOF STATE]
proof (chain)
picking this:
getM stateMin = Mmin
getM state' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}
[PROOF STEP]
show "state' \<notin> Q"
[PROOF STATE]
proof (prove)
using this:
getM stateMin = Mmin
getM state' \<notin> {M. \<exists>state. state \<in> Q \<and> getM state = M}

goal (1 subgoal):
 1. state' \<notin> Q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
state' \<notin> Q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
with \<open>stateMin \<in> Q\<close>
[PROOF STATE]
proof (chain)
picking this:
stateMin \<in> Q
\<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q
[PROOF STEP]
have "\<exists> stateMin \<in> Q. (\<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)"
[PROOF STATE]
proof (prove)
using this:
stateMin \<in> Q
\<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q

goal (1 subgoal):
 1. \<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?state2 \<in> ?Q2 \<Longrightarrow> \<exists>stateMin\<in>?Q2. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> ?Q2

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?state2 \<in> ?Q2 \<Longrightarrow> \<exists>stateMin\<in>?Q2. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> ?Q2

goal (1 subgoal):
 1. \<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>Q state. state \<in> Q \<longrightarrow> (\<exists>stateMin\<in>Q. \<forall>state'. (state', stateMin) \<in> lexLessState F0 decisionVars \<longrightarrow> state' \<notin> Q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_norm1[simp]: "abs (norm1 v) = norm1 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>norm1 v\<bar> = norm1 v
[PROOF STEP]
using norm1_ge_0[of v]
[PROOF STATE]
proof (prove)
using this:
0 \<le> norm1 v

goal (1 subgoal):
 1. \<bar>norm1 v\<bar> = norm1 v
[PROOF STEP]
by arith


[STATEMENT]
lemma countably_inf_bij:
  assumes inf_a_uni: "infinite (UNIV :: ('a ::countable) set)"
  assumes inf_b_uni: "infinite (UNIV :: ('b ::countable) set)"
  shows "\<exists>b_of_a :: 'a \<Rightarrow> 'b. bij b_of_a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
let ?S = "UNIV :: (('a::countable)) set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
have "countable ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable UNIV

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable UNIV

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
have "infinite ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
using inf_a_uni
[PROOF STATE]
proof (prove)
using this:
infinite UNIV

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

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
countable UNIV
infinite UNIV
[PROOF STEP]
obtain nat_of_a where QWER: "bij (nat_of_a :: 'a \<Rightarrow> nat)"
[PROOF STATE]
proof (prove)
using this:
countable UNIV
infinite UNIV

goal (1 subgoal):
 1. (\<And>nat_of_a. bij nat_of_a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using countableE_infinite[of ?S]
[PROOF STATE]
proof (prove)
using this:
countable UNIV
infinite UNIV
\<lbrakk>countable UNIV; infinite UNIV; \<And>e. bij e \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>nat_of_a. bij nat_of_a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij nat_of_a

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
let ?T = "UNIV :: (('b::countable)) set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
have "countable ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable UNIV

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable UNIV

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
have "infinite ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
using inf_b_uni
[PROOF STATE]
proof (prove)
using this:
infinite UNIV

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

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
countable UNIV
infinite UNIV
[PROOF STEP]
obtain nat_of_b where TYUI: "bij (nat_of_b :: 'b \<Rightarrow> nat)"
[PROOF STATE]
proof (prove)
using this:
countable UNIV
infinite UNIV

goal (1 subgoal):
 1. (\<And>nat_of_b. bij nat_of_b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using countableE_infinite[of ?T]
[PROOF STATE]
proof (prove)
using this:
countable UNIV
infinite UNIV
\<lbrakk>countable UNIV; infinite UNIV; \<And>e. bij e \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>nat_of_b. bij nat_of_b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij nat_of_b

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
let ?b_of_a = "\<lambda>a. (inv nat_of_b) (nat_of_a a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
have bij_nat_of_b: "\<forall>n. nat_of_b (inv nat_of_b n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. nat_of_b (inv nat_of_b n) = n
[PROOF STEP]
using TYUI bij_betw_inv_into_right
[PROOF STATE]
proof (prove)
using this:
bij nat_of_b
\<lbrakk>bij_betw ?f ?A ?A'; ?a' \<in> ?A'\<rbrakk> \<Longrightarrow> ?f (inv_into ?A ?f ?a') = ?a'

goal (1 subgoal):
 1. \<forall>n. nat_of_b (inv nat_of_b n) = n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>n. nat_of_b (inv nat_of_b n) = n

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
have "\<forall>a. inv nat_of_a (nat_of_a a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. inv nat_of_a (nat_of_a a) = a
[PROOF STEP]
by (meson QWER UNIV_I bij_betw_inv_into_left)
[PROOF STATE]
proof (state)
this:
\<forall>a. inv nat_of_a (nat_of_a a) = a

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>a. inv nat_of_a (nat_of_a a) = a
[PROOF STEP]
have "inj (\<lambda>a. inv nat_of_b (nat_of_a a))"
[PROOF STATE]
proof (prove)
using this:
\<forall>a. inv nat_of_a (nat_of_a a) = a

goal (1 subgoal):
 1. inj (\<lambda>a. inv nat_of_b (nat_of_a a))
[PROOF STEP]
using bij_nat_of_b injI
[PROOF STATE]
proof (prove)
using this:
\<forall>a. inv nat_of_a (nat_of_a a) = a
\<forall>n. nat_of_b (inv nat_of_b n) = n
(\<And>x y. ?f x = ?f y \<Longrightarrow> x = y) \<Longrightarrow> inj ?f

goal (1 subgoal):
 1. inj (\<lambda>a. inv nat_of_b (nat_of_a a))
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
inj (\<lambda>a. inv nat_of_b (nat_of_a a))

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj (\<lambda>a. inv nat_of_b (nat_of_a a))

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
have "range (\<lambda>a. inv nat_of_b (nat_of_a a)) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj (\<lambda>a. inv nat_of_b (nat_of_a a))
[PROOF STEP]
by (metis QWER TYUI bij_def image_image inj_imp_surj_inv)
[PROOF STATE]
proof (state)
this:
surj (\<lambda>a. inv nat_of_b (nat_of_a a))

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj (\<lambda>a. inv nat_of_b (nat_of_a a))
surj (\<lambda>a. inv nat_of_b (nat_of_a a))
[PROOF STEP]
have "bij ?b_of_a"
[PROOF STATE]
proof (prove)
using this:
inj (\<lambda>a. inv nat_of_b (nat_of_a a))
surj (\<lambda>a. inv nat_of_b (nat_of_a a))

goal (1 subgoal):
 1. bij (\<lambda>a. inv nat_of_b (nat_of_a a))
[PROOF STEP]
unfolding bij_def
[PROOF STATE]
proof (prove)
using this:
inj (\<lambda>a. inv nat_of_b (nat_of_a a))
surj (\<lambda>a. inv nat_of_b (nat_of_a a))

goal (1 subgoal):
 1. inj (\<lambda>a. inv nat_of_b (nat_of_a a)) \<and> surj (\<lambda>a. inv nat_of_b (nat_of_a a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bij (\<lambda>a. inv nat_of_b (nat_of_a a))

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij (\<lambda>a. inv nat_of_b (nat_of_a a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij (\<lambda>a. inv nat_of_b (nat_of_a a))

goal (1 subgoal):
 1. \<exists>b_of_a. bij b_of_a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>b_of_a. bij b_of_a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enum_mono: "i \<le> n \<Longrightarrow> j \<le> n \<Longrightarrow> enum i \<le> enum j \<longleftrightarrow> i \<le> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> n; j \<le> n\<rbrakk> \<Longrightarrow> (enum i \<le> enum j) = (i \<le> j)
[PROOF STEP]
by (auto simp: enum_def le_fun_def in_upd_image Ball_def[symmetric])


[STATEMENT]
lemma sorted_wrt_dist_last_insort_key_eq:
  assumes "sorted_wrt_dist p ps" "insort_key (\<lambda>q. dist q p) q ps \<noteq> ps @ [q]"
  shows "last (insort_key (\<lambda>q. dist q p) q ps) = last ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (insort_key (\<lambda>q. dist q p) q ps) = last ps
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted_wrt_dist p ps
insort_key (\<lambda>q. dist q p) q ps \<noteq> ps @ [q]

goal (1 subgoal):
 1. last (insort_key (\<lambda>q. dist q p) q ps) = last ps
[PROOF STEP]
unfolding sorted_wrt_dist_def
[PROOF STATE]
proof (prove)
using this:
sorted_wrt (\<lambda>p\<^sub>0 p\<^sub>1. dist p\<^sub>0 p \<le> dist p\<^sub>1 p) ps
insort_key (\<lambda>q. dist q p) q ps \<noteq> ps @ [q]

goal (1 subgoal):
 1. last (insort_key (\<lambda>q. dist q p) q ps) = last ps
[PROOF STEP]
by (induction ps) (auto)


[STATEMENT]
lemma akra_bazzi_termI [intro?]:
  assumes "e > 0" "(\<lambda>x. h x) \<in> O(\<lambda>x. real x / ln (real x) powr (1+e))"
          "\<And>x. x \<ge> x\<^sub>1 \<Longrightarrow> t x \<ge> x\<^sub>0" "\<And>x. x \<ge> x\<^sub>1 \<Longrightarrow> t x < x"
          "\<And>x. x \<ge> x\<^sub>1 \<Longrightarrow> b*x + h x = real (t x)"
  shows "akra_bazzi_term x\<^sub>0 x\<^sub>1 b t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. akra_bazzi_term x\<^sub>0 x\<^sub>1 b t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < e
h \<in> O(\<lambda>x. real x / ln (real x) powr (1 + e))
x\<^sub>1 \<le> ?x \<Longrightarrow> x\<^sub>0 \<le> t ?x
x\<^sub>1 \<le> ?x \<Longrightarrow> t ?x < ?x
x\<^sub>1 \<le> ?x \<Longrightarrow> b * real ?x + h ?x = real (t ?x)

goal (1 subgoal):
 1. akra_bazzi_term x\<^sub>0 x\<^sub>1 b t
[PROOF STEP]
unfolding akra_bazzi_term_def
[PROOF STATE]
proof (prove)
using this:
0 < e
h \<in> O(\<lambda>x. real x / ln (real x) powr (1 + e))
x\<^sub>1 \<le> ?x \<Longrightarrow> x\<^sub>0 \<le> t ?x
x\<^sub>1 \<le> ?x \<Longrightarrow> t ?x < ?x
x\<^sub>1 \<le> ?x \<Longrightarrow> b * real ?x + h ?x = real (t ?x)

goal (1 subgoal):
 1. \<exists>e h. 0 < e \<and> h \<in> O(\<lambda>x. real x / ln (real x) powr (1 + e)) \<and> (\<forall>x\<ge>x\<^sub>1. x\<^sub>0 \<le> t x \<and> t x < x \<and> b * real x + h x = real (t x))
[PROOF STEP]
by blast


[STATEMENT]
lemma (in RModule) RModuleIsoI :
  assumes "GroupIso M T N"
          "\<And>r m. r \<in> R \<Longrightarrow> m \<in> M \<Longrightarrow> T (r \<cdot> m) = smult' r (T m)"
  shows   "RModuleIso R smult M smult' T N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RModuleIso R (\<cdot>) M smult' T N
[PROOF STEP]
proof (rule RModuleIso.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. RModuleHom R (\<cdot>) M smult' T
 2. RModuleIso_axioms M T N
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
GroupIso M T N
\<lbrakk>?r2 \<in> R; ?m2 \<in> M\<rbrakk> \<Longrightarrow> T (?r2 \<cdot> ?m2) = smult' ?r2 (T ?m2)
[PROOF STEP]
show "RModuleHom R (\<cdot>) M smult' T"
[PROOF STATE]
proof (prove)
using this:
GroupIso M T N
\<lbrakk>?r2 \<in> R; ?m2 \<in> M\<rbrakk> \<Longrightarrow> T (?r2 \<cdot> ?m2) = smult' ?r2 (T ?m2)

goal (1 subgoal):
 1. RModuleHom R (\<cdot>) M smult' T
[PROOF STEP]
using GroupIso.axioms(1) RModuleHomI
[PROOF STATE]
proof (prove)
using this:
GroupIso M T N
\<lbrakk>?r2 \<in> R; ?m2 \<in> M\<rbrakk> \<Longrightarrow> T (?r2 \<cdot> ?m2) = smult' ?r2 (T ?m2)
GroupIso ?G ?T ?H \<Longrightarrow> GroupHom ?G ?T
\<lbrakk>GroupHom M ?T; \<And>r m. \<lbrakk>r \<in> R; m \<in> M\<rbrakk> \<Longrightarrow> ?T (r \<cdot> m) = ?smult' r (?T m)\<rbrakk> \<Longrightarrow> RModuleHom R (\<cdot>) M ?smult' ?T

goal (1 subgoal):
 1. RModuleHom R (\<cdot>) M smult' T
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
RModuleHom R (\<cdot>) M smult' T

goal (1 subgoal):
 1. RModuleIso_axioms M T N
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
GroupIso M T N
[PROOF STEP]
show "RModuleIso_axioms M T N"
[PROOF STATE]
proof (prove)
using this:
GroupIso M T N

goal (1 subgoal):
 1. RModuleIso_axioms M T N
[PROOF STEP]
using GroupIso.bijective
[PROOF STATE]
proof (prove)
using this:
GroupIso M T N
GroupIso ?G ?T ?H \<Longrightarrow> bij_betw ?T ?G ?H

goal (1 subgoal):
 1. RModuleIso_axioms M T N
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
RModuleIso_axioms M T N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Polys_closed_plus: "p \<in> P[X] \<Longrightarrow> q \<in> P[X] \<Longrightarrow> p + q \<in> P[X]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> P[X]; q \<in> P[X]\<rbrakk> \<Longrightarrow> p + q \<in> P[X]
[PROOF STEP]
using indets_plus_subset[of p q]
[PROOF STATE]
proof (prove)
using this:
indets (p + q) \<subseteq> indets p \<union> indets q

goal (1 subgoal):
 1. \<lbrakk>p \<in> P[X]; q \<in> P[X]\<rbrakk> \<Longrightarrow> p + q \<in> P[X]
[PROOF STEP]
by (auto simp: Polys_alt PPs_def)


[STATEMENT]
lemma lhd_hamming [simp]: "lhd hamming = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lhd hamming = 1
[PROOF STEP]
unfolding hamming_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lhd (hamming' ()) = 1
[PROOF STEP]
by(subst hamming'.simps) simp


[STATEMENT]
lemma exponent_p_a_m_k_equation:
  fixes p :: nat
  assumes "0 < m" "0 < k" "p \<noteq> 0" "k < p^a"
    shows "multiplicity p (p^a * m - k) = multiplicity p (p^a - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (p ^ a * m - k) = multiplicity p (p ^ a - k)
[PROOF STEP]
proof (rule multiplicity_cong [OF iffI])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
assume *: "p ^ r dvd p ^ a * m - k"
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
show "p ^ r dvd p ^ a - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
have "k \<le> p ^ a * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> p ^ a * m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a

goal (1 subgoal):
 1. k \<le> p ^ a * m
[PROOF STEP]
by (meson nat_dvd_not_less dvd_triv_left leI mult_pos_pos order.strict_trans)
[PROOF STATE]
proof (state)
this:
k \<le> p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<le> p ^ a * m
[PROOF STEP]
have "r \<le> a"
[PROOF STATE]
proof (prove)
using this:
k \<le> p ^ a * m

goal (1 subgoal):
 1. r \<le> a
[PROOF STEP]
by (meson "*" \<open>0 < k\<close> \<open>k < p^a\<close> dvd_diffD1 dvd_triv_left leI less_imp_le_nat nat_dvd_not_less power_le_dvd)
[PROOF STATE]
proof (state)
this:
r \<le> a

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<le> a
[PROOF STEP]
have "p^r dvd p^a * m"
[PROOF STATE]
proof (prove)
using this:
r \<le> a

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m
[PROOF STEP]
by (simp add: le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
by (meson \<open>k \<le> p ^ a * m\<close> \<open>r \<le> a\<close> * dvd_diffD1 dvd_diff_nat le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
assume *: "p ^ r dvd p ^ a - k"
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a
p ^ r dvd p ^ a - k
[PROOF STEP]
have "r \<le> a"
[PROOF STATE]
proof (prove)
using this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. r \<le> a
[PROOF STEP]
by (metis diff_diff_cancel less_imp_le_nat nat_dvd_not_less nat_le_linear power_le_dvd zero_less_diff)
[PROOF STATE]
proof (state)
this:
r \<le> a

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
show "p ^ r dvd p ^ a * m - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
have "p^r dvd p^a*m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m
[PROOF STEP]
by (simp add: \<open>r \<le> a\<close> le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p ^ r dvd p ^ a * m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
by (meson assms * dvd_diffD1 dvd_diff_nat le_imp_power_dvd less_imp_le_nat \<open>r \<le> a\<close>)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma total_ordered_subset: "B \<subseteq> A \<Longrightarrow> total_ordered_set B (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> total_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
using total_quasi_ordered_subset antisymmetric_subset
[PROOF STATE]
proof (prove)
using this:
?B \<subseteq> A \<Longrightarrow> total_quasi_ordered_set ?B (\<sqsubseteq>)
?B \<subseteq> A \<Longrightarrow> antisymmetric ?B (\<sqsubseteq>)

goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> total_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
by (intro total_ordered_set.intro)


[STATEMENT]
lemma vint_no_zero_divisors_law:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "x *\<^sub>\<int> y = 0\<^sub>\<int>"
  shows "x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>
[PROOF STEP]
have "x' * y' = 0 \<Longrightarrow> x' = 0 \<or> y' = 0" for x' y' z' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' * y' = 0 \<Longrightarrow> x' = 0 \<or> y' = 0
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
?x' * ?y' = 0 \<Longrightarrow> ?x' = 0 \<or> ?y' = 0

goal (1 subgoal):
 1. x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>

goal (1 subgoal):
 1. x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = 0\<^sub>\<int> \<or> y = 0\<^sub>\<int>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) ord_ge_1:
  assumes finite: "finite (carrier G)" and a: "a \<in> carrier G"
  shows "ord a \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> ord a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> ord a
[PROOF STEP]
have "((\<lambda>n::nat. a [^] n) ` {0<..}) \<subseteq> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([^]) a ` {0<..} \<subseteq> carrier G
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G

goal (1 subgoal):
 1. ([^]) a ` {0<..} \<subseteq> carrier G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
([^]) a ` {0<..} \<subseteq> carrier G

goal (1 subgoal):
 1. 1 \<le> ord a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
([^]) a ` {0<..} \<subseteq> carrier G
[PROOF STEP]
have "finite ((\<lambda>n::nat. a [^] n) ` {0<..})"
[PROOF STATE]
proof (prove)
using this:
([^]) a ` {0<..} \<subseteq> carrier G

goal (1 subgoal):
 1. finite (([^]) a ` {0<..})
[PROOF STEP]
using finite_subset finite
[PROOF STATE]
proof (prove)
using this:
([^]) a ` {0<..} \<subseteq> carrier G
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
finite (carrier G)

goal (1 subgoal):
 1. finite (([^]) a ` {0<..})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (([^]) a ` {0<..})

goal (1 subgoal):
 1. 1 \<le> ord a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (([^]) a ` {0<..})
[PROOF STEP]
have "\<not> inj_on (\<lambda>n::nat. a [^] n) {0<..}"
[PROOF STATE]
proof (prove)
using this:
finite (([^]) a ` {0<..})

goal (1 subgoal):
 1. \<not> inj_on (([^]) a) {0<..}
[PROOF STEP]
using finite_imageD infinite_Ioi
[PROOF STATE]
proof (prove)
using this:
finite (([^]) a ` {0<..})
\<lbrakk>finite (?f ` ?A); inj_on ?f ?A\<rbrakk> \<Longrightarrow> finite ?A
infinite {?a<..}

goal (1 subgoal):
 1. \<not> inj_on (([^]) a) {0<..}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> inj_on (([^]) a) {0<..}

goal (1 subgoal):
 1. 1 \<le> ord a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> inj_on (([^]) a) {0<..}
[PROOF STEP]
obtain i j::nat where "i \<noteq> j" "a [^] i = a [^] j"
[PROOF STATE]
proof (prove)
using this:
\<not> inj_on (([^]) a) {0<..}

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i \<noteq> j; a [^] i = a [^] j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
i \<noteq> j
a [^] i = a [^] j

goal (1 subgoal):
 1. 1 \<le> ord a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> j
a [^] i = a [^] j
[PROOF STEP]
have "\<exists>n::nat. n>0 \<and> a [^] n = \<one>"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j
a [^] i = a [^] j

goal (1 subgoal):
 1. \<exists>n>0. a [^] n = \<one>
[PROOF STEP]
by (metis a diffs0_imp_equal pow_eq_div2 neq0_conv)
[PROOF STATE]
proof (state)
this:
\<exists>n>0. a [^] n = \<one>

goal (1 subgoal):
 1. 1 \<le> ord a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n>0. a [^] n = \<one>
[PROOF STEP]
have "ord a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>n>0. a [^] n = \<one>

goal (1 subgoal):
 1. ord a \<noteq> 0
[PROOF STEP]
by (simp add: ord_eq_0 [OF a])
[PROOF STATE]
proof (state)
this:
ord a \<noteq> 0

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in fbrelation) fconverse_eq_frel[intro, simp]:
  assumes "\<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r"
  shows "r\<inverse>\<^sub>\<bullet> = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r\<inverse>\<^sub>\<bullet> = r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
[?a, ?b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [?b, ?a]\<^sub>\<circ> \<in>\<^sub>\<circ> r

goal (1 subgoal):
 1. r\<inverse>\<^sub>\<bullet> = r
[PROOF STEP]
apply (intro vsubset_antisym; intro vsubsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; \<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; x \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<bullet>\<rbrakk> \<Longrightarrow> x \<in>\<^sub>\<circ> r
 2. \<And>x. \<lbrakk>\<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; \<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; x \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> x \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<bullet>
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; \<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; x_ \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<bullet>\<rbrakk> \<Longrightarrow> x_ \<in>\<^sub>\<circ> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; \<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; x \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> x \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<bullet>
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; \<And>a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<Longrightarrow> [b, a]\<^sub>\<circ> \<in>\<^sub>\<circ> r; x_ \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> x_ \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<bullet>
[PROOF STEP]
by (metis fconverseE fconverseI fconverse_fconverse)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma  det_zero_row:
  fixes A :: "'a::{idom, ring_char_0}^'n^'n" and F :: "'b::{field}^'m^'m"
  shows "row i A = 0 \<Longrightarrow> det A = 0" and "row j F = 0 \<Longrightarrow> det F = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row i A = 0 \<Longrightarrow> det A = (0::'a)) &&& (row j F = 0 \<Longrightarrow> det F = (0::'b))
[PROOF STEP]
by (force simp: row_def det_def vec_eq_iff sign_nz intro!: sum.neutral)+


[STATEMENT]
lemma analz_insert_Hash [simp]:
     "analz (insert (Hash X) H) = insert (Hash X) (analz H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (insert (Hash X) H) = insert (Hash X) (analz H)
[PROOF STEP]
apply (rule analz_insert_eq_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert (Hash X) H) \<Longrightarrow> x \<in> insert (Hash X) (analz H)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cnj_0_eq[simp]: "(cnj a = 0) = (a = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cnj_class.cnj a = (0::'a)) = (a = (0::'a))
[PROOF STEP]
proof auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'a) = cnj_class.cnj a \<Longrightarrow> a = cnj_class.cnj a
[PROOF STEP]
assume cnj_rw: "0 = cnj a"
[PROOF STATE]
proof (state)
this:
(0::'a) = cnj_class.cnj a

goal (1 subgoal):
 1. (0::'a) = cnj_class.cnj a \<Longrightarrow> a = cnj_class.cnj a
[PROOF STEP]
have "cnj (cnj a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (cnj_class.cnj a) = a
[PROOF STEP]
using cnj_idem
[PROOF STATE]
proof (prove)
using this:
cnj_class.cnj (cnj_class.cnj ?a) = ?a

goal (1 subgoal):
 1. cnj_class.cnj (cnj_class.cnj a) = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (cnj_class.cnj a) = a

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

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = a
[PROOF STEP]
unfolding cnj_rw
[PROOF STATE]
proof (prove)
using this:
cnj_class.cnj (cnj_class.cnj a) = a

goal (1 subgoal):
 1. cnj_class.cnj (cnj_class.cnj a) = a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (0::'a) = a

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

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

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

goal (1 subgoal):
 1. a = cnj_class.cnj a
[PROOF STEP]
using cnj_rw
[PROOF STATE]
proof (prove)
using this:
a = (0::'a)
(0::'a) = cnj_class.cnj a

goal (1 subgoal):
 1. a = cnj_class.cnj a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a = cnj_class.cnj a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_comp_portfolio:
  assumes "portfolio pf1"
shows "portfolio (qty_mult_comp pf1 qty)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. portfolio (qty_mult_comp pf1 qty)
[PROOF STEP]
unfolding portfolio_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (support_set (qty_mult_comp pf1 qty))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (support_set (qty_mult_comp pf1 qty))
[PROOF STEP]
have "support_set (qty_mult_comp pf1 qty) \<subseteq> (support_set pf1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. support_set (qty_mult_comp pf1 qty) \<subseteq> support_set pf1
[PROOF STEP]
by (simp add: mult_comp_support_set)
[PROOF STATE]
proof (state)
this:
support_set (qty_mult_comp pf1 qty) \<subseteq> support_set pf1

goal (1 subgoal):
 1. finite (support_set (qty_mult_comp pf1 qty))
[PROOF STEP]
thus "finite (support_set (qty_mult_comp pf1 qty))"
[PROOF STATE]
proof (prove)
using this:
support_set (qty_mult_comp pf1 qty) \<subseteq> support_set pf1

goal (1 subgoal):
 1. finite (support_set (qty_mult_comp pf1 qty))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
support_set (qty_mult_comp pf1 qty) \<subseteq> support_set pf1
portfolio pf1

goal (1 subgoal):
 1. finite (support_set (qty_mult_comp pf1 qty))
[PROOF STEP]
unfolding portfolio_def
[PROOF STATE]
proof (prove)
using this:
support_set (qty_mult_comp pf1 qty) \<subseteq> support_set pf1
finite (support_set pf1)

goal (1 subgoal):
 1. finite (support_set (qty_mult_comp pf1 qty))
[PROOF STEP]
using infinite_super
[PROOF STATE]
proof (prove)
using this:
support_set (qty_mult_comp pf1 qty) \<subseteq> support_set pf1
finite (support_set pf1)
\<lbrakk>?S \<subseteq> ?T; infinite ?S\<rbrakk> \<Longrightarrow> infinite ?T

goal (1 subgoal):
 1. finite (support_set (qty_mult_comp pf1 qty))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (support_set (qty_mult_comp pf1 qty))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_unit_vecs_is_carrier: "span (set (unit_vecs n)) = carrier_vec n" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span (set (unit_vecs n)) = carrier_vec n
[PROOF STEP]
proof (rule;rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> local.span (set (unit_vecs n)) \<Longrightarrow> x \<in> carrier_vec n
 2. \<And>x. x \<in> carrier_vec n \<Longrightarrow> x \<in> local.span (set (unit_vecs n))
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> local.span (set (unit_vecs n)) \<Longrightarrow> x \<in> carrier_vec n
 2. \<And>x. x \<in> carrier_vec n \<Longrightarrow> x \<in> local.span (set (unit_vecs n))
[PROOF STEP]
assume vsU: "v \<in> ?L"
[PROOF STATE]
proof (state)
this:
v \<in> local.span (set (unit_vecs n))

goal (2 subgoals):
 1. \<And>x. x \<in> local.span (set (unit_vecs n)) \<Longrightarrow> x \<in> carrier_vec n
 2. \<And>x. x \<in> carrier_vec n \<Longrightarrow> x \<in> local.span (set (unit_vecs n))
[PROOF STEP]
show "v \<in> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
obtain a
      where v: "v = lincomb a (set (unit_vecs n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. v = lincomb a (set (unit_vecs n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using vsU
[PROOF STATE]
proof (prove)
using this:
v \<in> local.span (set (unit_vecs n))

goal (1 subgoal):
 1. (\<And>a. v = lincomb a (set (unit_vecs n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding finite_span[OF finite_set unit_vecs_carrier]
[PROOF STATE]
proof (prove)
using this:
v \<in> {uu_. \<exists>a. uu_ = lincomb a (set (unit_vecs n))}

goal (1 subgoal):
 1. (\<And>a. v = lincomb a (set (unit_vecs n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = lincomb a (set (unit_vecs n))

goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v = lincomb a (set (unit_vecs n))

goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
using lincomb_closed[OF unit_vecs_carrier]
[PROOF STATE]
proof (prove)
using this:
v = lincomb a (set (unit_vecs n))
lincomb ?a (set (unit_vecs n)) \<in> carrier_vec n

goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n

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

goal (1 subgoal):
 1. \<And>x. x \<in> carrier_vec n \<Longrightarrow> x \<in> local.span (set (unit_vecs n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier_vec n \<Longrightarrow> x \<in> local.span (set (unit_vecs n))
[PROOF STEP]
fix v::"'a vec"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier_vec n \<Longrightarrow> x \<in> local.span (set (unit_vecs n))
[PROOF STEP]
assume v: "v \<in> ?R"
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>x. x \<in> carrier_vec n \<Longrightarrow> x \<in> local.span (set (unit_vecs n))
[PROOF STEP]
show "v \<in> ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.span (set (unit_vecs n))
[PROOF STEP]
unfolding span_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> {lincomb a A |a A. finite A \<and> A \<subseteq> set (unit_vecs n)}
[PROOF STEP]
using lincomb_coordinates[OF v,symmetric]
[PROOF STATE]
proof (prove)
using this:
v = lincomb (\<lambda>u. v $ (THE i. u = unit_vec n i)) (set (unit_vecs n))

goal (1 subgoal):
 1. v \<in> {lincomb a A |a A. finite A \<and> A \<subseteq> set (unit_vecs n)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> local.span (set (unit_vecs n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ENR_sphere:
  fixes a :: "'a::euclidean_space"
  shows "ENR(sphere a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ENR (sphere a r)
[PROOF STEP]
proof (cases "0 < r")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < r \<Longrightarrow> ENR (sphere a r)
 2. \<not> 0 < r \<Longrightarrow> ENR (sphere a r)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < r

goal (2 subgoals):
 1. 0 < r \<Longrightarrow> ENR (sphere a r)
 2. \<not> 0 < r \<Longrightarrow> ENR (sphere a r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < r
[PROOF STEP]
have "sphere a r retract_of -{a}"
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. sphere a r retract_of - {a}
[PROOF STEP]
by (simp add: sphere_retract_of_punctured_universe)
[PROOF STATE]
proof (state)
this:
sphere a r retract_of - {a}

goal (2 subgoals):
 1. 0 < r \<Longrightarrow> ENR (sphere a r)
 2. \<not> 0 < r \<Longrightarrow> ENR (sphere a r)
[PROOF STEP]
with open_delete
[PROOF STATE]
proof (chain)
picking this:
open ?s \<Longrightarrow> open (?s - {?x})
sphere a r retract_of - {a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
open ?s \<Longrightarrow> open (?s - {?x})
sphere a r retract_of - {a}

goal (1 subgoal):
 1. ENR (sphere a r)
[PROOF STEP]
by (auto simp: ENR_def)
[PROOF STATE]
proof (state)
this:
ENR (sphere a r)

goal (1 subgoal):
 1. \<not> 0 < r \<Longrightarrow> ENR (sphere a r)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < r \<Longrightarrow> ENR (sphere a r)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < r

goal (1 subgoal):
 1. \<not> 0 < r \<Longrightarrow> ENR (sphere a r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < r

goal (1 subgoal):
 1. ENR (sphere a r)
[PROOF STEP]
using finite_imp_ENR
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < r
finite ?S \<Longrightarrow> ENR ?S

goal (1 subgoal):
 1. ENR (sphere a r)
[PROOF STEP]
by (metis finite_insert infinite_imp_nonempty less_linear sphere_eq_empty sphere_trivial)
[PROOF STATE]
proof (state)
this:
ENR (sphere a r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_orbit_list':
  assumes "permutation f" shows "distinct (orbit_list f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (orbit_list f x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
permutation f

goal (1 subgoal):
 1. distinct (orbit_list f x)
[PROOF STEP]
by (simp add: permutation_self_in_orbit distinct_orbit_list)


[STATEMENT]
lemma Gram_Schmidt_cons:
  "Gram_Schmidt (a#xs) = Gram_Schmidt_step a (Gram_Schmidt xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gram_Schmidt (a # xs) = Gram_Schmidt_step a (Gram_Schmidt xs)
[PROOF STEP]
unfolding Gram_Schmidt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr Gram_Schmidt_step (a # xs) [] = Gram_Schmidt_step a (foldr Gram_Schmidt_step xs [])
[PROOF STEP]
by auto


[STATEMENT]
lemma islimpt_Ioc [simp]:
  fixes a :: real
  assumes "a<b"
  shows "x islimpt {a<..b} \<longleftrightarrow> x \<in> {a..b}"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt {a<..b} = (x \<in> {a..b})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x islimpt {a<..b} \<Longrightarrow> x \<in> {a..b}
 2. x \<in> {a..b} \<Longrightarrow> x islimpt {a<..b}
[PROOF STEP]
show "?lhs \<Longrightarrow> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt {a<..b} \<Longrightarrow> x \<in> {a..b}
[PROOF STEP]
by (metis assms closed_atLeastAtMost closed_limpt closure_greaterThanAtMost closure_subset islimpt_subset)
[PROOF STATE]
proof (state)
this:
x islimpt {a<..b} \<Longrightarrow> x \<in> {a..b}

goal (1 subgoal):
 1. x \<in> {a..b} \<Longrightarrow> x islimpt {a<..b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> {a..b} \<Longrightarrow> x islimpt {a<..b}
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
x \<in> {a..b}

goal (1 subgoal):
 1. x \<in> {a..b} \<Longrightarrow> x islimpt {a<..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a..b}
[PROOF STEP]
have "x \<in> closure {a<..<b}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..b}

goal (1 subgoal):
 1. x \<in> closure {a<..<b}
[PROOF STEP]
using assms closure_greaterThanLessThan
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..b}
a < b
?a < ?b \<Longrightarrow> closure {?a<..<?b} = {?a..?b}

goal (1 subgoal):
 1. x \<in> closure {a<..<b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> closure {a<..<b}

goal (1 subgoal):
 1. x \<in> {a..b} \<Longrightarrow> x islimpt {a<..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> closure {a<..<b}
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
x \<in> closure {a<..<b}

goal (1 subgoal):
 1. x islimpt {a<..b}
[PROOF STEP]
by (metis (no_types) Diff_empty Diff_insert0 interior_lessThanAtMost interior_limit_point interior_subset islimpt_in_closure islimpt_subset)
[PROOF STATE]
proof (state)
this:
x islimpt {a<..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SA_nonzero_set_is_semialgebraic:
  assumes "f \<in> carrier (SA n)"
  shows "is_semialgebraic n (SA_nonzero_set n f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n (SA_nonzero_set n f)
[PROOF STEP]
using assms semialg_level_set_is_semialg[of f n \<zero>]
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
\<lbrakk>f \<in> carrier (SA n); \<zero> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}

goal (1 subgoal):
 1. is_semialgebraic n (SA_nonzero_set n f)
[PROOF STEP]
unfolding SA_nonzero_set_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
\<lbrakk>f \<in> carrier (SA n); \<zero> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}

goal (1 subgoal):
 1. is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>}
[PROOF STEP]
using nonzero_evimage_closed
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
\<lbrakk>f \<in> carrier (SA n); \<zero> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}
?f \<in> carrier (SA ?n) \<Longrightarrow> is_semialgebraic ?n {x \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>). ?f x \<noteq> \<zero>}

goal (1 subgoal):
 1. is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>}
[PROOF STEP]
by blast


[STATEMENT]
lemma col_ket_vec_index [simp]:
  assumes "i < dim_row v"
  shows "|col v 0\<rangle> $$ (i,0) = v $$ (i,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |col v 0\<rangle> $$ (i, 0) = v $$ (i, 0)
[PROOF STEP]
using assms ket_vec_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row v
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)

goal (1 subgoal):
 1. |col v 0\<rangle> $$ (i, 0) = v $$ (i, 0)
[PROOF STEP]
by (simp add: col_def)


[STATEMENT]
lemma [simp]: "s_of_ns (ns_of_s s) = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s_of_ns (ns_of_s s) = s
[PROOF STEP]
apply(induct s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. s_of_ns (ns_of_s []) = []
 2. \<And>a s. s_of_ns (ns_of_s s) = s \<Longrightarrow> s_of_ns (ns_of_s (a # s)) = a # s
[PROOF STEP]
apply(simp add: s_of_ns_def ns_of_s_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s. s_of_ns (ns_of_s s) = s \<Longrightarrow> s_of_ns (ns_of_s (a # s)) = a # s
[PROOF STEP]
apply(simp add: s_of_ns_def ns_of_s_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in group) triv_subgroup:
  shows "subgroup {\<one>} G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup {\<one>} G
[PROOF STEP]
unfolding subgroup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({\<one>} \<subseteq> carrier G \<and> (\<forall>x y. x \<in> {\<one>} \<longrightarrow> y \<in> {\<one>} \<longrightarrow> x \<otimes> y \<in> {\<one>})) \<and> \<one> \<in> {\<one>} \<and> (\<forall>x. x \<in> {\<one>} \<longrightarrow> inv x \<in> {\<one>})
[PROOF STEP]
by auto


[STATEMENT]
lemma cut_ge_Min_all: "t \<le> iMin I \<Longrightarrow> I \<down>\<ge> t = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<le> iMin I \<Longrightarrow> I \<down>\<ge> t = I
[PROOF STEP]
apply (simp add: i_cut_defs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<le> iMin I \<Longrightarrow> {x \<in> I. t \<le> x} = I
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>t \<le> iMin I; x \<in> I\<rbrakk> \<Longrightarrow> t \<le> x
[PROOF STEP]
apply (drule iMin_le, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inj_on_o_eq_o: "
  inj_on f (range g \<union> range h) \<Longrightarrow>
  (f \<circ> g = f \<circ> h) = (g = h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (range g \<union> range h) \<Longrightarrow> (f \<circ> g = f \<circ> h) = (g = h)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>inj_on f (range g \<union> range h); f \<circ> g = f \<circ> h\<rbrakk> \<Longrightarrow> g = h
 2. \<lbrakk>inj_on f (range g \<union> range h); g = h\<rbrakk> \<Longrightarrow> f \<circ> g = f \<circ> h
[PROOF STEP]
apply (rule o_inj_on, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f (range g \<union> range h); g = h\<rbrakk> \<Longrightarrow> f \<circ> g = f \<circ> h
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma least_UpperI:
  fixes L (structure)
  assumes above: "!! x. x \<in> A \<Longrightarrow> x \<sqsubseteq> s"
    and below: "!! y. y \<in> Upper L A \<Longrightarrow> s \<sqsubseteq> y"
    and L: "A \<subseteq> carrier L"  "s \<in> carrier L"
  shows "least L s (Upper L A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
have "Upper L A \<subseteq> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Upper L A \<subseteq> carrier L
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Upper L A \<subseteq> carrier L

goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Upper L A \<subseteq> carrier L

goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
from above L
[PROOF STATE]
proof (chain)
picking this:
?x \<in> A \<Longrightarrow> ?x \<sqsubseteq> s
A \<subseteq> carrier L
s \<in> carrier L
[PROOF STEP]
have "s \<in> Upper L A"
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> ?x \<sqsubseteq> s
A \<subseteq> carrier L
s \<in> carrier L

goal (1 subgoal):
 1. s \<in> Upper L A
[PROOF STEP]
by (simp add: Upper_def)
[PROOF STATE]
proof (state)
this:
s \<in> Upper L A

goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
s \<in> Upper L A

goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
from below
[PROOF STATE]
proof (chain)
picking this:
?y \<in> Upper L A \<Longrightarrow> s \<sqsubseteq> ?y
[PROOF STEP]
have "\<forall>x \<in> Upper L A. s \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
using this:
?y \<in> Upper L A \<Longrightarrow> s \<sqsubseteq> ?y

goal (1 subgoal):
 1. \<forall>x\<in>Upper L A. s \<sqsubseteq> x
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>Upper L A. s \<sqsubseteq> x

goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Upper L A \<subseteq> carrier L
s \<in> Upper L A
\<forall>x\<in>Upper L A. s \<sqsubseteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Upper L A \<subseteq> carrier L
s \<in> Upper L A
\<forall>x\<in>Upper L A. s \<sqsubseteq> x

goal (1 subgoal):
 1. is_lub L s A
[PROOF STEP]
by (simp add: least_def)
[PROOF STATE]
proof (state)
this:
is_lub L s A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_poly_sum:
  assumes "f 0 = 0" and "\<And>a b. f (a + b) = f a + f b"
  shows "map_poly f (sum g A) = (\<Sum>a\<in>A. map_poly f (g a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly f (sum g A) = (\<Sum>a\<in>A. map_poly f (g a))
[PROOF STEP]
by (induct A rule: infinite_finite_induct) (simp_all add: map_poly_plus assms)


[STATEMENT]
lemma DirProds_is_finite_group:
  assumes "\<And>i. i\<in>I \<Longrightarrow> finite_group (G i)" "finite I"
  shows "finite_group (DirProds G I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_group (DirProds G I)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite_group (DirProds G I)
[PROOF STEP]
have "group (G i)" if "i\<in>I" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G i)
[PROOF STEP]
using assms(1)[OF that]
[PROOF STATE]
proof (prove)
using this:
finite_group (G i)

goal (1 subgoal):
 1. Group.group (G i)
[PROOF STEP]
unfolding finite_group_def
[PROOF STATE]
proof (prove)
using this:
Group.group (G i) \<and> finite_group_axioms (G i)

goal (1 subgoal):
 1. Group.group (G i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. finite_group (DirProds G I)
[PROOF STEP]
from DirProds_is_group[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i \<in> ?I \<Longrightarrow> ?i1 i \<in> I) \<Longrightarrow> Group.group (DirProds (\<lambda>i. G (?i1 i)) ?I)
[PROOF STEP]
interpret DP: group "DirProds G I"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> ?I \<Longrightarrow> ?i1 i \<in> I) \<Longrightarrow> Group.group (DirProds (\<lambda>i. G (?i1 i)) ?I)

goal (1 subgoal):
 1. Group.group (DirProds G I)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite_group (DirProds G I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_group (DirProds G I)
[PROOF STEP]
proof(unfold_locales)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (carrier (DirProds G I))
[PROOF STEP]
have "order (DirProds G I) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (DirProds G I) \<noteq> 0
[PROOF STEP]
proof(unfold DirProds_order[OF assms(2)])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prod (order \<circ> G) I \<noteq> 0
[PROOF STEP]
have "(order \<circ> G) i \<noteq> 0" if "i\<in>I" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (order \<circ> G) i \<noteq> 0
[PROOF STEP]
using assms(1)[OF that]
[PROOF STATE]
proof (prove)
using this:
finite_group (G i)

goal (1 subgoal):
 1. (order \<circ> G) i \<noteq> 0
[PROOF STEP]
by (simp add: finite_group.order_gt_0)
[PROOF STATE]
proof (state)
this:
?i1 \<in> I \<Longrightarrow> (order \<circ> G) ?i1 \<noteq> 0

goal (1 subgoal):
 1. prod (order \<circ> G) I \<noteq> 0
[PROOF STEP]
thus "prod (order \<circ> G) I \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
?i1 \<in> I \<Longrightarrow> (order \<circ> G) ?i1 \<noteq> 0

goal (1 subgoal):
 1. prod (order \<circ> G) I \<noteq> 0
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
prod (order \<circ> G) I \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
order (DirProds G I) \<noteq> 0

goal (1 subgoal):
 1. finite (carrier (DirProds G I))
[PROOF STEP]
thus "finite (carrier (DirProds G I))"
[PROOF STATE]
proof (prove)
using this:
order (DirProds G I) \<noteq> 0

goal (1 subgoal):
 1. finite (carrier (DirProds G I))
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
card (carrier (DirProds G I)) \<noteq> 0

goal (1 subgoal):
 1. finite (carrier (DirProds G I))
[PROOF STEP]
by (meson card.infinite)
[PROOF STATE]
proof (state)
this:
finite (carrier (DirProds G I))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite_group (DirProds G I)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_mult_distrib1: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<cdot> (x - y) = a \<cdot> x - a \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> a \<cdot> (x - y) = a \<cdot> x - a \<cdot> y
[PROOF STEP]
by (simp add: diff_eq1 negate_eq1 add_mult_distrib1 mult_assoc2)


[STATEMENT]
lemma hyp_minus_inverse_comm:
  fixes a :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  shows "inverse (- a) = - inverse a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (- a) = - inverse a
[PROOF STEP]
proof (cases "Base a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Base a = (0::'a) \<Longrightarrow> inverse (- a) = - inverse a
 2. Base a \<noteq> (0::'a) \<Longrightarrow> inverse (- a) = - inverse a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Base a = (0::'a)

goal (2 subgoals):
 1. Base a = (0::'a) \<Longrightarrow> inverse (- a) = - inverse a
 2. Base a \<noteq> (0::'a) \<Longrightarrow> inverse (- a) = - inverse a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Base a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Base a = (0::'a)

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

goal (1 subgoal):
 1. Base a \<noteq> (0::'a) \<Longrightarrow> inverse (- a) = - inverse a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Base a \<noteq> (0::'a) \<Longrightarrow> inverse (- a) = - inverse a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Base a \<noteq> (0::'a)

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

goal (1 subgoal):
 1. inverse (- a) = - inverse a
[PROOF STEP]
by (simp, simp add: nonzero_minus_divide_right)
[PROOF STATE]
proof (state)
this:
inverse (- a) = - inverse a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decompose_prod_root_unity: fixes p :: "complex poly"
  assumes p: "p = prod_root_unity ks * f"
  and d: "decompose_prod_root_unity p = (ks',g)"
  and f: "\<And> x. cmod x = 1 \<Longrightarrow> poly f x \<noteq> 0"
  and p0: "p \<noteq> 0"
shows "p = prod_root_unity ks' * f \<and> f = g \<and> set ks = set ks'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = prod_root_unity ks' * f \<and> f = g \<and> set ks = set ks'
[PROOF STEP]
proof (rule decompose_prod_root_unity_main[OF p d[unfolded decompose_prod_root_unity_def] f])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. cmod x = 1 \<Longrightarrow> cmod x = 1
 2. \<And>k'. degree p < k' \<Longrightarrow> \<not> root_unity k' dvd p
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. cmod x = 1 \<Longrightarrow> cmod x = 1
 2. \<And>k'. degree p < k' \<Longrightarrow> \<not> root_unity k' dvd p
[PROOF STEP]
assume deg: "degree p < k"
[PROOF STATE]
proof (state)
this:
degree p < k

goal (2 subgoals):
 1. \<And>x. cmod x = 1 \<Longrightarrow> cmod x = 1
 2. \<And>k'. degree p < k' \<Longrightarrow> \<not> root_unity k' dvd p
[PROOF STEP]
hence "degree p < degree (root_unity k)"
[PROOF STATE]
proof (prove)
using this:
degree p < k

goal (1 subgoal):
 1. degree p < degree (root_unity k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree p < degree (root_unity k)

goal (2 subgoals):
 1. \<And>x. cmod x = 1 \<Longrightarrow> cmod x = 1
 2. \<And>k'. degree p < k' \<Longrightarrow> \<not> root_unity k' dvd p
[PROOF STEP]
with p0
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
degree p < degree (root_unity k)
[PROOF STEP]
show "\<not> root_unity k dvd p"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
degree p < degree (root_unity k)

goal (1 subgoal):
 1. \<not> root_unity k dvd p
[PROOF STEP]
by (simp add: poly_divides_conv0)
[PROOF STATE]
proof (state)
this:
\<not> root_unity k dvd p

goal (1 subgoal):
 1. \<And>x. cmod x = 1 \<Longrightarrow> cmod x = 1
[PROOF STEP]
qed


[STATEMENT]
lemma vi_eq_partial: "eps > 0 \<Longrightarrow> value_iteration_partial eps v = value_iteration eps v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < eps \<Longrightarrow> value_iteration_partial eps v = value_iteration eps v
[PROOF STEP]
proof (induction eps v rule: value_iteration.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>eps v. \<lbrakk>\<lbrakk>\<not> (2 * l * dist v (\<L>\<^sub>b v) < eps * (1 - l) \<or> eps \<le> 0); 0 < eps\<rbrakk> \<Longrightarrow> value_iteration_partial eps (\<L>\<^sub>b v) = value_iteration eps (\<L>\<^sub>b v); 0 < eps\<rbrakk> \<Longrightarrow> value_iteration_partial eps v = value_iteration eps v
[PROOF STEP]
case (1 eps v)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> (2 * l * dist v (\<L>\<^sub>b v) < eps * (1 - l) \<or> eps \<le> 0); 0 < eps\<rbrakk> \<Longrightarrow> value_iteration_partial eps (\<L>\<^sub>b v) = value_iteration eps (\<L>\<^sub>b v)
0 < eps

goal (1 subgoal):
 1. \<And>eps v. \<lbrakk>\<lbrakk>\<not> (2 * l * dist v (\<L>\<^sub>b v) < eps * (1 - l) \<or> eps \<le> 0); 0 < eps\<rbrakk> \<Longrightarrow> value_iteration_partial eps (\<L>\<^sub>b v) = value_iteration eps (\<L>\<^sub>b v); 0 < eps\<rbrakk> \<Longrightarrow> value_iteration_partial eps v = value_iteration eps v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<not> (2 * l * dist v (\<L>\<^sub>b v) < eps * (1 - l) \<or> eps \<le> 0); 0 < eps\<rbrakk> \<Longrightarrow> value_iteration_partial eps (\<L>\<^sub>b v) = value_iteration eps (\<L>\<^sub>b v)
0 < eps
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> (2 * l * dist v (\<L>\<^sub>b v) < eps * (1 - l) \<or> eps \<le> 0); 0 < eps\<rbrakk> \<Longrightarrow> value_iteration_partial eps (\<L>\<^sub>b v) = value_iteration eps (\<L>\<^sub>b v)
0 < eps

goal (1 subgoal):
 1. value_iteration_partial eps v = value_iteration eps v
[PROOF STEP]
by (auto simp: Let_def value_iteration.simps value_iteration_partial.simps)
[PROOF STATE]
proof (state)
this:
value_iteration_partial eps v = value_iteration eps v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem union_sets:
  "VARS p r s t
  [ union_sets_precondition p x y \<and> p0 = p ]
  t := find_set_path_compression p x;
  p := fst t;
  r := snd t;
  t := find_set_path_compression p y;
  p := fst t;
  s := snd t;
  p[r] := s
  [ union_sets_postcondition p x y p0 ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [union_sets_precondition p x y \<and> p0 = p]
t := find_set_path_compression p x; p := fst t; r := snd t; t := find_set_path_compression p y; p := fst t; s := snd t; p := (p[r\<longmapsto>s])
[union_sets_postcondition p x y p0]
[PROOF STEP]
proof vcg_tc_simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
let ?t1 = "find_set_path_compression p0 x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
let ?p1 = "fst ?t1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
let ?r = "snd ?t1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
let ?t2 = "find_set_path_compression ?p1 y"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
let ?p2 = "fst ?t2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
let ?s = "snd ?t2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
let ?p = "?p2[?r\<longmapsto>?s]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
assume 1: "union_sets_precondition p0 x y"
[PROOF STATE]
proof (state)
this:
union_sets_precondition p0 x y

goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
hence 2: "path_compression_postcondition ?p1 x ?r p0"
[PROOF STATE]
proof (prove)
using this:
union_sets_precondition p0 x y

goal (1 subgoal):
 1. path_compression_postcondition (fst (find_set_path_compression p0 x)) x (snd (find_set_path_compression p0 x)) p0
[PROOF STEP]
by (simp add: find_set_precondition_def union_sets_precondition_def find_set_path_compression_function)
[PROOF STATE]
proof (state)
this:
path_compression_postcondition (fst (find_set_path_compression p0 x)) x (snd (find_set_path_compression p0 x)) p0

goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
hence "path_compression_postcondition ?p2 y ?s ?p1"
[PROOF STATE]
proof (prove)
using this:
path_compression_postcondition (fst (find_set_path_compression p0 x)) x (snd (find_set_path_compression p0 x)) p0

goal (1 subgoal):
 1. path_compression_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) y (snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) (fst (find_set_path_compression p0 x))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
path_compression_postcondition (fst (find_set_path_compression p0 x)) x (snd (find_set_path_compression p0 x)) p0
union_sets_precondition p0 x y

goal (1 subgoal):
 1. path_compression_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) y (snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) (fst (find_set_path_compression p0 x))
[PROOF STEP]
by (meson find_set_precondition_def union_sets_precondition_def find_set_path_compression_function path_compression_postcondition_def path_compression_precondition_def prod.collapse)
[PROOF STATE]
proof (state)
this:
path_compression_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) y (snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) (fst (find_set_path_compression p0 x))

goal (1 subgoal):
 1. union_sets_precondition p0 x y \<Longrightarrow> union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
thus "union_sets_postcondition (?p2[?r\<longmapsto>?s]) x y p0"
[PROOF STATE]
proof (prove)
using this:
path_compression_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) y (snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) (fst (find_set_path_compression p0 x))

goal (1 subgoal):
 1. union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
path_compression_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) y (snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)) (fst (find_set_path_compression p0 x))
union_sets_precondition p0 x y
path_compression_postcondition (fst (find_set_path_compression p0 x)) x (snd (find_set_path_compression p0 x)) p0

goal (1 subgoal):
 1. union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0
[PROOF STEP]
by (simp add: union_sets_1)
[PROOF STATE]
proof (state)
this:
union_sets_postcondition (fst (find_set_path_compression (fst (find_set_path_compression p0 x)) y)[snd (find_set_path_compression p0 x)\<longmapsto>snd (find_set_path_compression (fst (find_set_path_compression p0 x)) y)]) x y p0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma res_diff_in_val_ring_imp_in_val_ring:
  assumes "a \<in> \<O>\<^sub>p"
  assumes "b \<in> carrier Q\<^sub>p"
  assumes "a \<ominus> b \<in> \<O>\<^sub>p"
  shows "b \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> \<O>\<^sub>p
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<in> \<O>\<^sub>p
[PROOF STEP]
have "b = a \<ominus> (a \<ominus> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = a \<ominus> (a \<ominus> b)
[PROOF STEP]
unfolding a_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = a \<oplus> \<ominus> (a \<oplus> \<ominus> b)
[PROOF STEP]
using assms val_ring_memE(2)[of a] Qp.r_neg2 Q\<^sub>p_def Qp.minus_sum
[PROOF STATE]
proof (prove)
using this:
a \<in> \<O>\<^sub>p
b \<in> carrier Q\<^sub>p
a \<ominus> b \<in> \<O>\<^sub>p
a \<in> \<O>\<^sub>p \<Longrightarrow> a \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<oplus> (\<ominus> ?x \<oplus> ?y) = ?y
Q\<^sub>p \<equiv> Frac Z\<^sub>p
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?b \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> \<ominus> (?a \<oplus> ?b) = \<ominus> ?a \<oplus> \<ominus> ?b

goal (1 subgoal):
 1. b = a \<oplus> \<ominus> (a \<oplus> \<ominus> b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = a \<ominus> (a \<ominus> b)

goal (1 subgoal):
 1. b \<in> \<O>\<^sub>p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
b = a \<ominus> (a \<ominus> b)

goal (1 subgoal):
 1. b \<in> \<O>\<^sub>p
[PROOF STEP]
using assms val_ring_minus_closed[of a "a \<ominus> b"]
[PROOF STATE]
proof (prove)
using this:
b = a \<ominus> (a \<ominus> b)
a \<in> \<O>\<^sub>p
b \<in> carrier Q\<^sub>p
a \<ominus> b \<in> \<O>\<^sub>p
\<lbrakk>a \<in> \<O>\<^sub>p; a \<ominus> b \<in> \<O>\<^sub>p\<rbrakk> \<Longrightarrow> a \<ominus> (a \<ominus> b) \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. b \<in> \<O>\<^sub>p
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
b \<in> \<O>\<^sub>p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in seminorm) minus:
  assumes "vectorspace V"
  shows "x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
interpret vectorspace V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace V
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
assume x: "x \<in> V"
[PROOF STATE]
proof (state)
this:
x \<in> V

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
have "- x = - 1 \<cdot> x"
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. - x = - 1 \<cdot> x
[PROOF STEP]
by (simp only: negate_eq1)
[PROOF STATE]
proof (state)
this:
- x = - 1 \<cdot> x

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- x = - 1 \<cdot> x

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
have "\<parallel>\<dots>\<parallel> = \<bar>- 1\<bar> * \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. \<parallel>- 1 \<cdot> x\<parallel> = \<bar>- 1\<bar> * \<parallel>x\<parallel>
[PROOF STEP]
by (rule abs_homogenous)
[PROOF STATE]
proof (state)
this:
\<parallel>- 1 \<cdot> x\<parallel> = \<bar>- 1\<bar> * \<parallel>x\<parallel>

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>- 1 \<cdot> x\<parallel> = \<bar>- 1\<bar> * \<parallel>x\<parallel>

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
have "\<dots> = \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>- 1\<bar> * \<parallel>x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>- 1\<bar> * \<parallel>x\<parallel> = \<parallel>x\<parallel>

goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<parallel>- x\<parallel> = \<parallel>x\<parallel>

goal (1 subgoal):
 1. \<parallel>- x\<parallel> = \<parallel>x\<parallel>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<parallel>- x\<parallel> = \<parallel>x\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed