[STATEMENT]
lemma array_foldl_new_array:
  "array_foldl f b (new_array a n) = foldl (\<lambda>b (k, v). f k b v) b (zip [0..<n] (replicate n a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. array_foldl f b (new_array a n) = foldl (\<lambda>b (k, v). f k b v) b (zip [0..<n] (replicate n a))
[PROOF STEP]
by(simp add: new_array_def array_foldl_def)


[STATEMENT]
lemma bij_fst_inv_inv_eq: "bij f \<Longrightarrow> fst (inv (%(x, u). inv f x) z) = f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij f \<Longrightarrow> fst (inv (\<lambda>(x, u). inv f x) z) = f z
[PROOF STEP]
apply (rule fst_inv_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bij f \<Longrightarrow> surj (\<lambda>a. case a of (x, u) \<Rightarrow> inv f x)
 2. \<And>x y. bij f \<Longrightarrow> f (case (x, y) of (x, u) \<Rightarrow> inv f x) = x
[PROOF STEP]
apply (rule_tac f = "%z. (f z, h z)" for h in surjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. bij f \<Longrightarrow> (case (f x, ?h7 x) of (x, u) \<Rightarrow> inv f x) = x
 2. \<And>x y. bij f \<Longrightarrow> f (case (x, y) of (x, u) \<Rightarrow> inv f x) = x
[PROOF STEP]
apply (simp add: bij_is_inj inv_f_f)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. bij f \<Longrightarrow> f (case (x, y) of (x, u) \<Rightarrow> inv f x) = x
[PROOF STEP]
apply (simp add: bij_is_surj surj_f_inv_f)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in factorial_monoid) associated_fcount:
  assumes acarr: "a \<in> carrier G"
    and bcarr: "b \<in> carrier G"
    and asc: "a \<sim> b"
  shows "factorcount G a = factorcount G b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factorcount G a = factorcount G b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G
b \<in> carrier G
a \<sim> b

goal (1 subgoal):
 1. factorcount G a = factorcount G b
[PROOF STEP]
by (auto simp: associated_def factorial_monoid.divides_fcount factorial_monoid_axioms le_antisym)


[STATEMENT]
lemma mono_restriction_is_mono: "mono f \<Longrightarrow> mono (\<lambda>S. f (S \<inter> V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> mono (\<lambda>S. f (S \<inter> V))
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<subseteq> y \<longrightarrow> f x \<le> f y \<Longrightarrow> \<forall>x y. x \<subseteq> y \<longrightarrow> f (x \<inter> V) \<le> f (y \<inter> V)
[PROOF STEP]
by (meson inf_mono monoD subset_refl)


[STATEMENT]
lemma Set_filter_rbt_filter:
  "Set.filter P (Set t) = rbt_filter P t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Set.filter P (Set t) = rbt_filter P t
[PROOF STEP]
by (simp add: fold_keys_def Set_filter_fold rbt_filter_def
  finite_fold_fold_keys[OF comp_fun_commute_filter_fold])


[STATEMENT]
lemma ran_distinct:
  assumes dist: "distinct (map fst al)"
  shows "ran (map_of al) = snd ` set al"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ran (map_of al) = snd ` set al
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct (map fst al)

goal (1 subgoal):
 1. ran (map_of al) = snd ` set al
[PROOF STEP]
proof (induct al)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct (map fst []) \<Longrightarrow> ran (map_of []) = snd ` set []
 2. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
distinct (map fst [])

goal (2 subgoals):
 1. distinct (map fst []) \<Longrightarrow> ran (map_of []) = snd ` set []
 2. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst [])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distinct (map fst [])

goal (1 subgoal):
 1. ran (map_of []) = snd ` set []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ran (map_of []) = snd ` set []

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
case (Cons kv al)
[PROOF STATE]
proof (state)
this:
distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al
distinct (map fst (kv # al))

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al
distinct (map fst (kv # al))
[PROOF STEP]
have "ran (map_of al) = snd ` set al"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al
distinct (map fst (kv # al))

goal (1 subgoal):
 1. ran (map_of al) = snd ` set al
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ran (map_of al) = snd ` set al

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ran (map_of al) = snd ` set al

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
from Cons.prems
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst (kv # al))
[PROOF STEP]
have "map_of al (fst kv) = None"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (kv # al))

goal (1 subgoal):
 1. map_of al (fst kv) = None
[PROOF STEP]
by (simp add: map_of_eq_None_iff)
[PROOF STATE]
proof (state)
this:
map_of al (fst kv) = None

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ran (map_of al) = snd ` set al
map_of al (fst kv) = None
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ran (map_of al) = snd ` set al
map_of al (fst kv) = None

goal (1 subgoal):
 1. ran (map_of (kv # al)) = snd ` set (kv # al)
[PROOF STEP]
by (simp only: map_of.simps ran_map_upd) simp
[PROOF STATE]
proof (state)
this:
ran (map_of (kv # al)) = snd ` set (kv # al)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma replaceEquivalentByEquivalent:
  fixes formula :: Formula and formula' :: Formula and formula1 :: Formula and formula2 :: Formula
  assumes "equivalentFormulae formula formula'"
  shows "equivalentFormulae (formula1 @ formula @ formula2) (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalentFormulae (formula1 @ formula @ formula2) (formula1 @ formula' @ formula2)
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>valuation. model valuation (formula1 @ formula @ formula2) = model valuation (formula1 @ formula' @ formula2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>valuation. model valuation (formula1 @ formula @ formula2) = model valuation (formula1 @ formula' @ formula2)
[PROOF STEP]
fix v :: Valuation
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>valuation. model valuation (formula1 @ formula @ formula2) = model valuation (formula1 @ formula' @ formula2)
[PROOF STEP]
show "model v (formula1 @ formula @ formula2) = model v (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. model v (formula1 @ formula @ formula2) = model v (formula1 @ formula' @ formula2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
assume "model v (formula1 @ formula @ formula2)"
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula @ formula2)

goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
hence *: "consistent v" "formulaTrue formula1 v" "formulaTrue formula v" "formulaTrue formula2 v"
[PROOF STATE]
proof (prove)
using this:
model v (formula1 @ formula @ formula2)

goal (1 subgoal):
 1. (consistent v &&& formulaTrue formula1 v) &&& formulaTrue formula v &&& formulaTrue formula2 v
[PROOF STEP]
by (auto simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
consistent v
formulaTrue formula1 v
formulaTrue formula v
formulaTrue formula2 v

goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
from \<open>consistent v\<close> \<open>formulaTrue formula v\<close> \<open>equivalentFormulae formula formula'\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent v
formulaTrue formula v
equivalentFormulae formula formula'
[PROOF STEP]
have "formulaTrue formula' v"
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula v
equivalentFormulae formula formula'

goal (1 subgoal):
 1. formulaTrue formula' v
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula v
\<forall>valuation. model valuation formula = model valuation formula'

goal (1 subgoal):
 1. formulaTrue formula' v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
formulaTrue formula' v

goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
thus "model v (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula' v

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula' v
consistent v
formulaTrue formula1 v
formulaTrue formula v
formulaTrue formula2 v

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2)
[PROOF STEP]
by (simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula' @ formula2)

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
assume "model v (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula' @ formula2)

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
hence *: "consistent v" "formulaTrue formula1 v" "formulaTrue formula' v" "formulaTrue formula2 v"
[PROOF STATE]
proof (prove)
using this:
model v (formula1 @ formula' @ formula2)

goal (1 subgoal):
 1. (consistent v &&& formulaTrue formula1 v) &&& formulaTrue formula' v &&& formulaTrue formula2 v
[PROOF STEP]
by (auto simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
consistent v
formulaTrue formula1 v
formulaTrue formula' v
formulaTrue formula2 v

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
from \<open>consistent v\<close> \<open>formulaTrue formula' v\<close> \<open>equivalentFormulae formula formula'\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent v
formulaTrue formula' v
equivalentFormulae formula formula'
[PROOF STEP]
have "formulaTrue formula v"
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula' v
equivalentFormulae formula formula'

goal (1 subgoal):
 1. formulaTrue formula v
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula' v
\<forall>valuation. model valuation formula = model valuation formula'

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

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
thus "model v (formula1 @ formula @ formula2)"
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula v

goal (1 subgoal):
 1. model v (formula1 @ formula @ formula2)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula v
consistent v
formulaTrue formula1 v
formulaTrue formula' v
formulaTrue formula2 v

goal (1 subgoal):
 1. model v (formula1 @ formula @ formula2)
[PROOF STEP]
by (simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula @ formula2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula @ formula2) = model v (formula1 @ formula' @ formula2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_cong: "
  \<forall>x. f x = g x \<Longrightarrow> (\<forall>x. P (f x)) = (\<forall>x. P (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f x = g x \<Longrightarrow> (\<forall>x. P (f x)) = (\<forall>x. P (g x))
[PROOF STEP]
by simp


[STATEMENT]
lemma list_nth_append7:
assumes "i - length x < Suc (length y)"
       and "i - Suc (length x) < Suc (length y)"
shows    "i < Suc (Suc (length x + length y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < Suc (Suc (length x + length y))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i - length x < Suc (length y)
i - Suc (length x) < Suc (length y)

goal (1 subgoal):
 1. i < Suc (Suc (length x + length y))
[PROOF STEP]
by arith


[STATEMENT]
lemma NatMultiples_product_factor_multiple: "
  \<lbrakk> a \<in> F; b \<in> NatMultiples F \<rbrakk> \<Longrightarrow> a * b \<in> NatMultiples F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> F; b \<in> NatMultiples F\<rbrakk> \<Longrightarrow> a * b \<in> NatMultiples F
[PROOF STEP]
by (rule NatMultiples_Product)


[STATEMENT]
lemma balanced_net_shallow_model: "balanced_net (shallow_model Y Z M N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. balanced_net (shallow_model Y Z M N)
[PROOF STEP]
unfolding shallow_model_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. balanced_net (Conv (Y, Z) (shallow_model' Z M N))
[PROOF STEP]
by (simp add: balanced_net_Conv balanced_net_shallow_model')


[STATEMENT]
lemma degree_take_n:
"degree (take_deg n f) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (take_deg n f) < n
[PROOF STEP]
unfolding take_deg_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (Poly (take n (coeffs f))) < n
[PROOF STEP]
by (metis coeff_Poly_eq deg_qr_n deg_qr_pos degree_0 leading_coeff_0_iff
  nth_default_take of_nat_eq_iff)


[STATEMENT]
lemma invertibleI [intro]:
  "\<lbrakk> u \<cdot> v = \<one>; v \<cdot> u = \<one>; u \<in> M; v \<in> M \<rbrakk> \<Longrightarrow> invertible u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<cdot> v = \<one>; v \<cdot> u = \<one>; u \<in> M; v \<in> M\<rbrakk> \<Longrightarrow> invertible u
[PROOF STEP]
unfolding invertible_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<cdot> v = \<one>; v \<cdot> u = \<one>; u \<in> M; v \<in> M\<rbrakk> \<Longrightarrow> \<exists>v\<in>M. u \<cdot> v = \<one> \<and> v \<cdot> u = \<one>
[PROOF STEP]
by fast


[STATEMENT]
lemma nat_term_compD2:
  assumes "nat_term_comp cmp" and "fst (rep_nat_term u) = fst (rep_nat_term v)" and "snd (rep_nat_term u) < snd (rep_nat_term v)"
  shows "cmp u v = Lt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmp u v = Lt
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
nat_term_comp cmp
fst (rep_nat_term u) = fst (rep_nat_term v)
snd (rep_nat_term u) < snd (rep_nat_term v)

goal (1 subgoal):
 1. cmp u v = Lt
[PROOF STEP]
unfolding nat_term_comp_def fst_conv snd_conv
[PROOF STATE]
proof (prove)
using this:
(\<forall>u v. snd (rep_nat_term u) = snd (rep_nat_term v) \<longrightarrow> fst (rep_nat_term u) = 0 \<longrightarrow> cmp u v \<noteq> Gt) \<and> (\<forall>u v. fst (rep_nat_term u) = fst (rep_nat_term v) \<longrightarrow> snd (rep_nat_term u) < snd (rep_nat_term v) \<longrightarrow> cmp u v = Lt) \<and> (\<forall>t u v. cmp u v = Lt \<longrightarrow> cmp (splus t u) (splus t v) = Lt) \<and> (\<forall>u v a b. fst (rep_nat_term u) = fst (rep_nat_term a) \<longrightarrow> fst (rep_nat_term v) = fst (rep_nat_term b) \<longrightarrow> snd (rep_nat_term u) = snd (rep_nat_term v) \<longrightarrow> snd (rep_nat_term a) = snd (rep_nat_term b) \<longrightarrow> cmp a b = Lt \<longrightarrow> cmp u v = Lt)
fst (rep_nat_term u) = fst (rep_nat_term v)
snd (rep_nat_term u) < snd (rep_nat_term v)

goal (1 subgoal):
 1. cmp u v = Lt
[PROOF STEP]
by blast


[STATEMENT]
lemma permutep_mult [simp]:
  "(\<And>x y. f (x + y) = f x + f y) \<Longrightarrow> permutep f (m1 * m2) = permutep f m1 * permutep f m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. f (x + y) = f x + f y) \<Longrightarrow> permutep f (m1 * m2) = permutep f m1 * permutep f m2
[PROOF STEP]
unfolding Const\<^sub>0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. f (x + y) = f x + f y) \<Longrightarrow> permutep f (m1 * m2) = permutep f m1 * permutep f m2
[PROOF STEP]
by transfer' (auto simp: when_def fun_eq_iff prod_fun_compose_bij)


[STATEMENT]
lemma list_of_vec_mult:
  fixes v :: \<open>complex vec\<close>
  shows \<open>list_of_vec (c \<cdot>\<^sub>v v) = map ((*) c) (list_of_vec v)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec (c \<cdot>\<^sub>v v) = map ((*) c) (list_of_vec v)
[PROOF STEP]
by (metis (mono_tags, lifting) index_smult_vec(1) index_smult_vec(2) length_list_of_vec length_map nth_equalityI nth_list_of_vec nth_map)


[STATEMENT]
lemma lm070:
  "{ R \<union> {(x, y)} | y . y \<in> A } \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)
[PROOF STEP]
by force


[STATEMENT]
lemma integral_mult_left[simp]:
  fixes c :: "_::{real_normed_algebra,second_countable_topology}"
  shows "(c \<noteq> 0 \<Longrightarrow> integrable M f) \<Longrightarrow> (\<integral> x. f x * c \<partial>M) = integral\<^sup>L M f * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<noteq> (0::'b) \<Longrightarrow> integrable M f) \<Longrightarrow> LINT x|M. f x * c = integral\<^sup>L M f * c
[PROOF STEP]
by (intro has_bochner_integral_integral_eq has_bochner_integral_integrable has_bochner_integral_mult_left)


[STATEMENT]
lemma absolutely_integrable_spike_set:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes f: "f absolutely_integrable_on S" and neg: "negligible {x \<in> S - T. f x \<noteq> 0}" "negligible {x \<in> T - S. f x \<noteq> 0}"
  shows "f absolutely_integrable_on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f absolutely_integrable_on T
[PROOF STEP]
using absolutely_integrable_spike_set_eq f neg
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>negligible {x \<in> ?S - ?T. ?f x \<noteq> (0::?'b)}; negligible {x \<in> ?T - ?S. ?f x \<noteq> (0::?'b)}\<rbrakk> \<Longrightarrow> (?f absolutely_integrable_on ?S) = (?f absolutely_integrable_on ?T)
f absolutely_integrable_on S
negligible {x \<in> S - T. f x \<noteq> (0::'b)}
negligible {x \<in> T - S. f x \<noteq> (0::'b)}

goal (1 subgoal):
 1. f absolutely_integrable_on T
[PROOF STEP]
by blast


[STATEMENT]
lemma join_double_iso: "x \<le> y \<Longrightarrow> w + x + z \<le> w + y + z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> w + x + z \<le> w + y + z
[PROOF STEP]
by (metis le_iff_inf sup_inf_distrib1 sup_inf_distrib2)


[STATEMENT]
lemma set_cons_eq_empty[iff]: "set_Cons a b = {} \<longleftrightarrow> a = {} \<or> b = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set_Cons a b = {}) = (a = {} \<or> b = {})
[PROOF STEP]
by (auto simp: set_Cons_def)


[STATEMENT]
lemma starfun_ln_HFinite: "\<lbrakk>x \<in> HFinite; 1 \<le> x\<rbrakk> \<Longrightarrow> ( *f* real_ln) x \<in> HFinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> HFinite; 1 \<le> x\<rbrakk> \<Longrightarrow> (*f* real_ln) x \<in> HFinite
[PROOF STEP]
by (metis HFinite_HInfinite_iff less_le_trans starfun_exp_HInfinite starfun_exp_ln_iff starfun_ln_ge_zero zero_less_one)


[STATEMENT]
lemma (in finite) just_cash_UNIV_is_balanced:
  assumes "\<forall> a . \<exists> c . \<L> a = just_cash c"
  shows "\<exists> c . balanced \<L> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. balanced \<L> c
[PROOF STEP]
unfolding balanced_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. sum \<L> UNIV = just_cash c
[PROOF STEP]
using
      assms
      just_cash_summation [where A=UNIV]
[PROOF STATE]
proof (prove)
using this:
\<forall>a. \<exists>c. \<L> a = just_cash c
\<forall>a\<in>UNIV. \<exists>c. ?\<L> a = just_cash c \<Longrightarrow> \<exists>c. sum ?\<L> UNIV = just_cash c

goal (1 subgoal):
 1. \<exists>c. sum \<L> UNIV = just_cash c
[PROOF STEP]
by simp


[STATEMENT]
lemma intpow_zero [simp]: "x ^\<^sub>Z 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^\<^sub>Z 0 = (1::'a)
[PROOF STEP]
by (simp add: intpow_def)


[STATEMENT]
lemma compare_real_of_rat: "compare (real_of_rat x) (of_rat y) = compare x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compare (real_of_rat x) (real_of_rat y) = compare x y
[PROOF STEP]
unfolding compare_rat_def compare_real_def comparator_of_def of_rat_less
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x < y then Lt else if real_of_rat x = real_of_rat y then Eq else Gt) = (if x < y then Lt else if x = y then Eq else Gt)
[PROOF STEP]
by auto


[STATEMENT]
lemma kcomp_distl: "f \<circ>\<^sub>K (g \<squnion> h) = (f \<circ>\<^sub>K g) \<squnion> (f \<circ>\<^sub>K h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ>\<^sub>K (g \<squnion> h) = f \<circ>\<^sub>K g \<squnion> f \<circ>\<^sub>K h
[PROOF STEP]
unfolding kcomp_klift fun_eq_iff comp_def sup_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. bd\<^sub>\<F> (\<lambda>x. g x \<union> h x) (f x) = bd\<^sub>\<F> g (f x) \<union> bd\<^sub>\<F> h (f x)
[PROOF STEP]
by (simp add: UN_Un_distrib klift_prop)


[STATEMENT]
lemma count_list_pow: "count_list (w\<^sup>@k) a = k * (count_list w a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list (w \<^sup>@ k) a = k * count_list w a
[PROOF STEP]
by (induction k, simp, (simp add: count_list_append))


[STATEMENT]
lemma zero_spaceN_subset_spaceN:
  "zero_space\<^sub>N N \<subseteq> space\<^sub>N N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero_space\<^sub>N N \<subseteq> space\<^sub>N N
[PROOF STEP]
by (simp add: spaceN_iff zero_spaceN_iff subset_eq)


[STATEMENT]
lemma row_spaceE:
  assumes "x \<in> row_space A"
  obtains v where "v \<in> carrier_vec (dim_row A)" and "x = v \<^sub>v* A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec (dim_row A); x = v \<^sub>v* A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> row_space A

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec (dim_row A); x = v \<^sub>v* A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding row_space_def
[PROOF STATE]
proof (prove)
using this:
x \<in> (\<lambda>v. v \<^sub>v* A) ` carrier_vec (dim_row A)

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec (dim_row A); x = v \<^sub>v* A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma to_fract_1 [simp]: "to_fract 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fract (1::'a) = 1
[PROOF STEP]
by (simp add: to_fract_def eq_fract One_fract_def)


[STATEMENT]
lemma iMODb_iprev: "
  \<lbrakk> t \<in> [r, mod m, c]; r < t \<rbrakk> \<Longrightarrow>
  iprev t [r, mod m, c] = t - m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> [ r, mod m, c ]; r < t\<rbrakk> \<Longrightarrow> iprev t [ r, mod m, c ] = t - m
[PROOF STEP]
apply (case_tac "m = 0", simp add: iMODb_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> [ r, mod m, c ]; r < t; m \<noteq> 0\<rbrakk> \<Longrightarrow> iprev t [ r, mod m, c ] = t - m
[PROOF STEP]
apply (clarsimp simp add: iprev_def iMODb_cut_less iT_iff iT_Max iT_not_empty minus_mod_eq_mult_div [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r < t; 0 < m; t mod m = r mod m; t \<le> r + m * c\<rbrakk> \<Longrightarrow> r + (t - Suc (r + (t - Suc r) mod m)) = t - m
[PROOF STEP]
apply (simp del: add_Suc_right add: add_Suc_right[symmetric] mod_eq_imp_diff_mod_eq_divisor)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r < t; 0 < m; t mod m = r mod m; t \<le> r + m * c\<rbrakk> \<Longrightarrow> r + (t - (r + m)) = t - m
[PROOF STEP]
apply (simp add: less_mod_eq_imp_add_divisor_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem f2_alg_correct:
  assumes "\<epsilon> \<in> {0<..<1}"
  assumes "\<delta> > 0"
  assumes "set as \<subseteq> {..<n}"
  defines "\<Omega> \<equiv> fold (\<lambda>a state. state \<bind> f2_update a) as (f2_init \<delta> \<epsilon> n) \<bind> f2_result"
  shows "\<P>(\<omega> in measure_pmf \<Omega>. \<bar>\<omega> - F 2 as\<bar> \<le> \<delta> * F 2 as) \<ge> 1-of_rat \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - real_of_rat \<epsilon> \<le> measure_pmf.prob \<Omega> {\<omega> \<in> space (measure_pmf \<Omega>). \<bar>\<omega> - F 2 as\<bar> \<le> \<delta> * F 2 as}
[PROOF STEP]
using f2_alg_correct'[OF assms(1,2,3)] \<Omega>_def
[PROOF STATE]
proof (prove)
using this:
1 - real_of_rat \<epsilon> \<le> measure_pmf.prob (fold (\<lambda>a state. state \<bind> f2_update a) as (f2_init \<delta> \<epsilon> n) \<bind> f2_result) {\<omega> \<in> space (measure_pmf (fold (\<lambda>a state. state \<bind> f2_update a) as (f2_init \<delta> \<epsilon> n) \<bind> f2_result)). \<bar>\<omega> - F 2 as\<bar> \<le> \<delta> * F 2 as}
\<Omega> \<equiv> fold (\<lambda>a state. state \<bind> f2_update a) as (f2_init \<delta> \<epsilon> n) \<bind> f2_result

goal (1 subgoal):
 1. 1 - real_of_rat \<epsilon> \<le> measure_pmf.prob \<Omega> {\<omega> \<in> space (measure_pmf \<Omega>). \<bar>\<omega> - F 2 as\<bar> \<le> \<delta> * F 2 as}
[PROOF STEP]
by auto


[STATEMENT]
theorem HEndPhase0_HInv4a:
  "\<lbrakk> HEndPhase0 s s' p; HInv4a s q; HInv4d s p;
     Inv2a s;  Inv1 s;   Inv2a s; Inv2c s\<rbrakk>
  \<Longrightarrow> HInv4a s' q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>HEndPhase0 s s' p; HInv4a s q; HInv4d s p; Inv2a s; Inv1 s; Inv2a s; Inv2c s\<rbrakk> \<Longrightarrow> HInv4a s' q
[PROOF STEP]
by(blast dest: HEndPhase0_HInv4a_p HEndPhase0_HInv4a_q)


[STATEMENT]
lemma idiff_enat_eq_enat_iff: "x - enat n = enat m \<longleftrightarrow> (\<exists>k. x = enat k \<and> k - n = m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - enat n = enat m) = (\<exists>k. x = enat k \<and> k - n = m)
[PROOF STEP]
by (cases x) simp_all


[STATEMENT]
lemma can_merge_by_intersection_code[code] :
  "can_merge_by_intersection x1 x2 = ts.bex x1 (\<lambda> \<alpha> . ts.memb \<alpha> x2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. can_merge_by_intersection x1 x2 = ts.bex x1 (\<lambda>\<alpha>. ts.memb \<alpha> x2)
[PROOF STEP]
unfolding can_merge_by_intersection.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<alpha>. ts.memb \<alpha> x1 \<and> ts.memb \<alpha> x2) = ts.bex x1 (\<lambda>\<alpha>. ts.memb \<alpha> x2)
[PROOF STEP]
unfolding ts.memb_correct[OF ts.invar]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<alpha>'. \<alpha>' \<in> ts.\<alpha> x1 \<and> \<alpha>' \<in> ts.\<alpha> x2) = ts.bex x1 (\<lambda>\<alpha>'. \<alpha>' \<in> ts.\<alpha> x2)
[PROOF STEP]
unfolding ts.bex_correct[OF ts.invar]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<alpha>'. \<alpha>' \<in> ts.\<alpha> x1 \<and> \<alpha>' \<in> ts.\<alpha> x2) = (\<exists>\<alpha>'\<in>ts.\<alpha> x1. \<alpha>' \<in> ts.\<alpha> x2)
[PROOF STEP]
by (meson notin_fset)


[STATEMENT]
theorem subgroupI:
  fixes G
  assumes subset [THEN subsetD, intro]: "G \<subseteq> M"
    and [intro]: "\<one> \<in> G"
    and [intro]: "\<And>g h. \<lbrakk> g \<in> G; h \<in> G \<rbrakk> \<Longrightarrow> g \<cdot> h \<in> G"
    and [intro]: "\<And>g. g \<in> G \<Longrightarrow> invertible g"
    and [intro]: "\<And>g. g \<in> G \<Longrightarrow> inverse g \<in> G"
  shows "subgroup G M (\<cdot>) \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup G M (\<cdot>) \<one>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup G M (\<cdot>) \<one>
[PROOF STEP]
interpret sub: monoid G "(\<cdot>)" \<one>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid G (\<cdot>) \<one>
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup G M (\<cdot>) \<one>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup G M (\<cdot>) \<one>
[PROOF STEP]
proof unfold_locales
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. G \<subseteq> M
 2. \<And>a b. \<lbrakk>a \<in> G; b \<in> G\<rbrakk> \<Longrightarrow> a \<cdot> b \<in> G
 3. \<one> \<in> G
 4. \<And>u. u \<in> G \<Longrightarrow> sub.invertible u
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. G \<subseteq> M
 2. \<And>a b. \<lbrakk>a \<in> G; b \<in> G\<rbrakk> \<Longrightarrow> a \<cdot> b \<in> G
 3. \<one> \<in> G
 4. \<And>u. u \<in> G \<Longrightarrow> sub.invertible u
[PROOF STEP]
assume [intro]: "u \<in> G"
[PROOF STATE]
proof (state)
this:
u \<in> G

goal (4 subgoals):
 1. G \<subseteq> M
 2. \<And>a b. \<lbrakk>a \<in> G; b \<in> G\<rbrakk> \<Longrightarrow> a \<cdot> b \<in> G
 3. \<one> \<in> G
 4. \<And>u. u \<in> G \<Longrightarrow> sub.invertible u
[PROOF STEP]
show "sub.invertible u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sub.invertible u
[PROOF STEP]
using invertible_left_inverse invertible_right_inverse
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>invertible ?u; ?u \<in> M\<rbrakk> \<Longrightarrow> inverse ?u \<cdot> ?u = \<one>
\<lbrakk>invertible ?u; ?u \<in> M\<rbrakk> \<Longrightarrow> ?u \<cdot> inverse ?u = \<one>

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

goal (3 subgoals):
 1. G \<subseteq> M
 2. \<And>a b. \<lbrakk>a \<in> G; b \<in> G\<rbrakk> \<Longrightarrow> a \<cdot> b \<in> G
 3. \<one> \<in> G
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
subgroup G M (\<cdot>) \<one>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma divmod_integer_code [code]: \<^marker>\<open>contributor \<open>Ren? Thiemann\<close>\<close> \<^marker>\<open>contributor \<open>Akihisa Yamada\<close>\<close>
  "divmod_integer k l =
   (if k = 0 then (0, 0)
    else if l > 0 then
            (if k > 0 then Code_Numeral.divmod_abs k l
             else case Code_Numeral.divmod_abs k l of (r, s) \<Rightarrow>
                  if s = 0 then (- r, 0) else (- r - 1, l - s))
    else if l = 0 then (0, k)
    else apsnd uminus
            (if k < 0 then Code_Numeral.divmod_abs k l
             else case Code_Numeral.divmod_abs k l of (r, s) \<Rightarrow>
                  if s = 0 then (- r, 0) else (- r - 1, - l - s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if 0 < l then if 0 < k then divmod_abs k l else case divmod_abs k l of (r, s) \<Rightarrow> if s = 0 then (- r, 0) else (- r - 1, l - s) else if l = 0 then (0, k) else apsnd uminus (if k < 0 then divmod_abs k l else case divmod_abs k l of (r, s) \<Rightarrow> if s = 0 then (- r, 0) else (- r - 1, - l - s)))
[PROOF STEP]
by (cases l "0 :: integer" rule: linorder_cases)
    (auto split: prod.splits simp add: divmod_integer_eq_cases)


[STATEMENT]
theorem wfTransitionRelation:
  fixes decisionVars :: "Variable set" and F0 :: "Formula" and state0 :: "State"
  assumes "finite decisionVars" and "isInitialState state0 F0"
  shows "wf {(stateB, stateA).
             (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> (transition stateA stateB F0 decisionVars)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
(*----------------------------------------------------------------------------*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
let ?rel = "{(stateB, stateA).
                  (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> (transition stateA stateB F0 decisionVars)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
let ?rel'= "terminationLess F0 decisionVars"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
have "\<forall>x y. (x, y) \<in> ?rel \<longrightarrow> (x, y) \<in> ?rel'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
fix stateA::State and stateB::State
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
assume "(stateB, stateA) \<in> ?rel"
[PROOF STATE]
proof (state)
this:
(stateB, stateA) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}

goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
hence "(stateB, stateA) \<in> ?rel'"
[PROOF STATE]
proof (prove)
using this:
(stateB, stateA) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}

goal (1 subgoal):
 1. (stateB, stateA) \<in> terminationLess F0 decisionVars
[PROOF STEP]
using \<open>isInitialState state0 F0\<close>
[PROOF STATE]
proof (prove)
using this:
(stateB, stateA) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
isInitialState state0 F0

goal (1 subgoal):
 1. (stateB, stateA) \<in> terminationLess F0 decisionVars
[PROOF STEP]
using invariantsHoldInValidRunsFromInitialState[of "state0" "F0" "stateA" "decisionVars"]
[PROOF STATE]
proof (prove)
using this:
(stateB, stateA) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
isInitialState state0 F0
\<lbrakk>isInitialState state0 F0; (state0, stateA) \<in> transitionRelation F0 decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState stateA F0 decisionVars

goal (1 subgoal):
 1. (stateB, stateA) \<in> terminationLess F0 decisionVars
[PROOF STEP]
using stateIsDecreasedByValidTransitions[of "stateA" "F0" "decisionVars" "stateB"]
[PROOF STATE]
proof (prove)
using this:
(stateB, stateA) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
isInitialState state0 F0
\<lbrakk>isInitialState state0 F0; (state0, stateA) \<in> transitionRelation F0 decisionVars\<rbrakk> \<Longrightarrow> invariantsHoldInState stateA F0 decisionVars
\<lbrakk>invariantsHoldInState stateA F0 decisionVars; transition stateA stateB F0 decisionVars\<rbrakk> \<Longrightarrow> (stateB, stateA) \<in> terminationLess F0 decisionVars

goal (1 subgoal):
 1. (stateB, stateA) \<in> terminationLess F0 decisionVars
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(stateB, stateA) \<in> terminationLess F0 decisionVars

goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?stateB2, ?stateA2) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<Longrightarrow> (?stateB2, ?stateA2) \<in> terminationLess F0 decisionVars

goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(?stateB2, ?stateA2) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<Longrightarrow> (?stateB2, ?stateA2) \<in> terminationLess F0 decisionVars

goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars

goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars

goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
have "wf ?rel'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (terminationLess F0 decisionVars)
[PROOF STEP]
using \<open>finite decisionVars\<close>
[PROOF STATE]
proof (prove)
using this:
finite decisionVars

goal (1 subgoal):
 1. wf (terminationLess F0 decisionVars)
[PROOF STEP]
by (rule wfTerminationLess)
[PROOF STATE]
proof (state)
this:
wf (terminationLess F0 decisionVars)

goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
wf (terminationLess F0 decisionVars)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
wf (terminationLess F0 decisionVars)

goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
using wellFoundedEmbed[of "?rel" "?rel'"]
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars
wf (terminationLess F0 decisionVars)
\<lbrakk>\<forall>x y. (x, y) \<in> {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars} \<longrightarrow> (x, y) \<in> terminationLess F0 decisionVars; wf (terminationLess F0 decisionVars)\<rbrakk> \<Longrightarrow> wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}

goal (1 subgoal):
 1. wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
wf {(stateB, stateA). (state0, stateA) \<in> transitionRelation F0 decisionVars \<and> transition stateA stateB F0 decisionVars}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prop_match: "\<lbrakk> list_all P al; \<not>P e; \<not>P e'; list_all P bl \<rbrakk> \<Longrightarrow> (al@e#bl = al'@e'#bl') \<longleftrightarrow> (al=al' \<and> e=e' \<and> bl=bl')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all P al; \<not> P e; \<not> P e'; list_all P bl\<rbrakk> \<Longrightarrow> (al @ e # bl = al' @ e' # bl') = (al = al' \<and> e = e' \<and> bl = bl')
[PROOF STEP]
apply (rule iffI, induct al arbitrary: al')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>al'. \<lbrakk>list_all P []; \<not> P e; \<not> P e'; list_all P bl; [] @ e # bl = al' @ e' # bl'\<rbrakk> \<Longrightarrow> [] = al' \<and> e = e' \<and> bl = bl'
 2. \<And>a al al'. \<lbrakk>\<And>al'. \<lbrakk>list_all P al; \<not> P e; \<not> P e'; list_all P bl; al @ e # bl = al' @ e' # bl'\<rbrakk> \<Longrightarrow> al = al' \<and> e = e' \<and> bl = bl'; list_all P (a # al); \<not> P e; \<not> P e'; list_all P bl; (a # al) @ e # bl = al' @ e' # bl'\<rbrakk> \<Longrightarrow> a # al = al' \<and> e = e' \<and> bl = bl'
 3. \<lbrakk>list_all P al; \<not> P e; \<not> P e'; list_all P bl; al = al' \<and> e = e' \<and> bl = bl'\<rbrakk> \<Longrightarrow> al @ e # bl = al' @ e' # bl'
[PROOF STEP]
apply (case_tac al', fastforce, fastforce)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_of_map_pair_entry: "map_of (map (\<lambda>k. (k, f k)) xs) x = (if x \<in> list.set xs then Some (f x) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (map (\<lambda>k. (k, f k)) xs) x = (if x \<in> set xs then Some (f x) else None)
[PROOF STEP]
by (induction xs; auto)


[STATEMENT]
lemma push_bit_minus_numeral [simp]:
  \<open>push_bit (numeral l) (- numeral k) = push_bit (pred_numeral l) (- numeral (Num.Bit0 k))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (numeral l) (- numeral k) = push_bit (pred_numeral l) (- numeral (num.Bit0 k))
[PROOF STEP]
by (simp only: numeral_eq_Suc push_bit_Suc_minus_numeral)


[STATEMENT]
lemma iT_Plus_neg_mem_iff: "(x \<in> I \<oplus>- k) = (x + k \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> I \<oplus>- k) = (x + k \<in> I)
[PROOF STEP]
by (simp add: iT_Plus_neg_def)


[STATEMENT]
lemma ennreal_mult: "0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> ennreal (a * b) = ennreal a * ennreal b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 \<le> b\<rbrakk> \<Longrightarrow> ennreal (a * b) = ennreal a * ennreal b
[PROOF STEP]
by transfer (simp add: max_absorb2)


[STATEMENT]
lemma lex_sym_eqI: "lex a b \<Longrightarrow> lex b a \<Longrightarrow> a = b"
  and lex_sym_eq_iff: "lex a b \<Longrightarrow> lex b a \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>Counterclockwise_2D_Arbitrary.lex a b; Counterclockwise_2D_Arbitrary.lex b a\<rbrakk> \<Longrightarrow> a = b) &&& (Counterclockwise_2D_Arbitrary.lex a b \<Longrightarrow> Counterclockwise_2D_Arbitrary.lex b a = (a = b))
[PROOF STEP]
by (auto simp: lex_def)


[STATEMENT]
lemma conjr1_sup: "z \<rhd> (x \<squnion> y) = (z \<rhd> x) \<squnion> (z \<rhd> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<rhd> x \<squnion> y = (z \<rhd> x) \<squnion> (z \<rhd> y)
[PROOF STEP]
by (metis residuated_sup residuated_conjr1)


[STATEMENT]
lemma him_1 [simp]: "HIm 1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HIm 1 = 0
[PROOF STEP]
by (metis him_of_real of_real_1)


[STATEMENT]
lemma (in Corps) ApproximationTr2:"\<lbrakk>valuation K v; aa \<in> carrier K; aa \<noteq> \<zero>;
     0 \<le> (v aa)\<rbrakk> \<Longrightarrow> (int N) *\<^sub>a(v aa) \<le> (v (1\<^sub>r \<plusminus> -\<^sub>a ((1\<^sub>r \<plusminus> -\<^sub>a (aa^\<^bsup>K N\<^esup>))^\<^bsup>K N\<^esup>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; aa \<in> carrier K; aa \<noteq> \<zero>; 0 \<le> v aa\<rbrakk> \<Longrightarrow> int N *\<^sub>a v aa \<le> v (1\<^sub>r \<plusminus> -\<^sub>a (1\<^sub>r \<plusminus> -\<^sub>a aa^\<^bsup>K N\<^esup>)^\<^bsup>K N\<^esup>)
[PROOF STEP]
apply (cut_tac field_is_ring, frule Ring.ring_is_ag[of "K"],
       case_tac "N = 0",
       frule val_nonzero_z[of v "aa"], assumption+, erule exE, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>z. \<lbrakk>valuation K v; aa \<in> carrier K; aa \<noteq> \<zero>; 0 \<le> ant z; Ring K; aGroup K; N = 0; v aa = ant z\<rbrakk> \<Longrightarrow> 0 \<le> v (1\<^sub>r \<plusminus> -\<^sub>a 1\<^sub>r)
 2. \<lbrakk>valuation K v; aa \<in> carrier K; aa \<noteq> \<zero>; 0 \<le> v aa; Ring K; aGroup K; N \<noteq> 0\<rbrakk> \<Longrightarrow> int N *\<^sub>a v aa \<le> v (1\<^sub>r \<plusminus> -\<^sub>a (1\<^sub>r \<plusminus> -\<^sub>a aa^\<^bsup>K N\<^esup>)^\<^bsup>K N\<^esup>)
[PROOF STEP]
apply(frule Ring.ring_one[of "K"], simp add:aGroup.ag_r_inv1,
       simp add:value_of_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; aa \<in> carrier K; aa \<noteq> \<zero>; 0 \<le> v aa; Ring K; aGroup K; N \<noteq> 0\<rbrakk> \<Longrightarrow> int N *\<^sub>a v aa \<le> v (1\<^sub>r \<plusminus> -\<^sub>a (1\<^sub>r \<plusminus> -\<^sub>a aa^\<^bsup>K N\<^esup>)^\<^bsup>K N\<^esup>)
[PROOF STEP]
apply (frule_tac n = N in Ring.npClose[of "K" "aa"], assumption+,
       frule ApproximationTr[of v "-\<^sub>a (aa^\<^bsup>K N\<^esup>)" "N - Suc 0"],
       rule aGroup.ag_mOp_closed, assumption+, simp add:val_minus_eq,
       subst val_exp_ring[THEN sym, of v], assumption+,
       simp add:asprod_pos_pos)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; aa \<in> carrier K; aa \<noteq> \<zero>; 0 \<le> v aa; Ring K; aGroup K; N \<noteq> 0; aa^\<^bsup>K N\<^esup> \<in> carrier K; v (-\<^sub>a aa^\<^bsup>K N\<^esup>) \<le> v (1\<^sub>r \<plusminus> -\<^sub>a (1\<^sub>r \<plusminus> -\<^sub>a aa^\<^bsup>K N\<^esup>)^\<^bsup>K Suc (N - Suc 0)\<^esup>)\<rbrakk> \<Longrightarrow> int N *\<^sub>a v aa \<le> v (1\<^sub>r \<plusminus> -\<^sub>a (1\<^sub>r \<plusminus> -\<^sub>a aa^\<^bsup>K N\<^esup>)^\<^bsup>K N\<^esup>)
[PROOF STEP]
apply (simp add:val_minus_eq, simp add:val_exp_ring[THEN sym])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma double_graph_is_semialg:
  assumes "n > 0"
  assumes "is_semialg_function n f"
  assumes "is_semialg_function n g"
  shows "is_semialgebraic (n+2) (double_graph n f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic (n + 2) (double_graph n f g)
[PROOF STEP]
using double_graph_rep[of g n f] assms restricted_graph_is_semialgebraic[of n "g \<circ> take n" "graph n f"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>g \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p; f \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> double_graph n f g = restricted_graph (n + 1) (g \<circ> take n) (graph n f)
0 < n
is_semialg_function n f
is_semialg_function n g
\<lbrakk>is_semialg_function n (g \<circ> take n); is_semialgebraic n (graph n f)\<rbrakk> \<Longrightarrow> is_semialgebraic (n + 1) (restricted_graph n (g \<circ> take n) (graph n f))

goal (1 subgoal):
 1. is_semialgebraic (n + 2) (double_graph n f g)
[PROOF STEP]
by (metis (no_types, lifting) Suc_eq_plus1 add_Suc_right is_semialg_function_closed
      less_add_same_cancel1 less_numeral_extra(1) one_add_one restricted_graph_is_semialgebraic
      comp_take_is_semialg semialg_graph)


[STATEMENT]
lemma irreducible_mult_unit_left:
  "is_unit a \<Longrightarrow> irreducible (a * p) \<longleftrightarrow> irreducible p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit a \<Longrightarrow> irreducible (a * p) = irreducible p
[PROOF STEP]
by (auto simp: irreducible_altdef mult.commute[of a] is_unit_mult_iff
        mult_unit_dvd_iff dvd_mult_unit_iff)


[STATEMENT]
lemma complex_mod_triangle_sub: "cmod w \<le> cmod (w + z) + norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod w \<le> cmod (w + z) + cmod z
[PROOF STEP]
using complex_mod_triangle_ineq2[of "w + z" "-z"]
[PROOF STATE]
proof (prove)
using this:
cmod (w + z + - z) - cmod (w + z) \<le> cmod (- z)

goal (1 subgoal):
 1. cmod w \<le> cmod (w + z) + cmod z
[PROOF STEP]
by auto


[STATEMENT]
lemma SK_simp_aux:
  \<open>SK c p b (Suc (Suc t)) k =
    S2 (steps c p (Suc (Suc t))) k * b ^ Suc (Suc t) + SK c p b (Suc t) k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SK c p b (Suc (Suc t)) k = S2 (steps c p (Suc (Suc t))) k * b ^ Suc (Suc t) + SK c p b (Suc t) k
[PROOF STEP]
by (induction t arbitrary: c) (auto simp: step_commutative algebra_simps)


[STATEMENT]
lemma atLeastLessThan_eq_atLeastAtMost_diff: "{a\<le>\<^sub>a..<\<^sub>ab} = {a\<le>\<^sub>a..\<le>\<^sub>ab} - {b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a\<le>\<^sub>a..<\<^sub>ab} = {a\<le>\<^sub>a..\<le>\<^sub>ab} - {b}
[PROOF STEP]
unfolding interval_def ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> UNIV. a \<le>\<^sub>a x} \<inter> {x \<in> UNIV. x <\<^sub>a b} = {x \<in> UNIV. a \<le>\<^sub>a x} \<inter> {x \<in> UNIV. x \<le>\<^sub>a b} - {b}
[PROOF STEP]
by (auto simp: less_imp_le le_less)


[STATEMENT]
lemma length_nil: "length [] = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [] = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma word_of_nat_le:
  "n \<le> unat x \<Longrightarrow> of_nat n \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> unat x \<Longrightarrow> word_of_nat n \<le> x
[PROOF STEP]
apply (simp add: word_le_nat_alt unat_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> unat x \<Longrightarrow> n mod 2 ^ LENGTH('a) \<le> unat x
[PROOF STEP]
apply (erule order_trans[rotated])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n mod 2 ^ LENGTH('a) \<le> n
[PROOF STEP]
apply (simp add: take_bit_eq_mod)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma contractible_space_top_of_set [simp]:"contractible_space (top_of_set S) \<longleftrightarrow> contractible S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contractible_space (top_of_set S) = contractible S
[PROOF STEP]
by (auto simp: contractible_space_def contractible_def)


[STATEMENT]
lemma LeadsTo_weaken:
     "[| F \<in> A LeadsTo A';
         B  \<subseteq> A;   A' \<subseteq> B' |]
      ==> F \<in> B LeadsTo B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto>w A'; B \<subseteq> A; A' \<subseteq> B'\<rbrakk> \<Longrightarrow> F \<in> B \<longmapsto>w B'
[PROOF STEP]
by (blast intro: LeadsTo_weaken_R LeadsTo_weaken_L LeadsTo_Trans)


[STATEMENT]
lemma lattice_latticeof: "lattice (latticeof r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice (latticeof r)
[PROOF STEP]
by (auto simp add: lattice_def latticeof_def)


[STATEMENT]
lemma isomorphic_group_triviality1:
  assumes "G \<cong> H" "group H" "trivial_group G"
  shows "trivial_group H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
G \<cong> H
Group.group H
trivial_group G

goal (1 subgoal):
 1. trivial_group H
[PROOF STEP]
by (auto simp: trivial_group_def is_iso_def iso_def group.is_monoid Group.group_def bij_betw_def hom_one)


[STATEMENT]
lemma frontier_real_Ici [simp]:
  fixes a :: real
  shows "frontier {a..} = {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier {a..} = {a}
[PROOF STEP]
unfolding frontier_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure {a..} - interior {a..} = {a}
[PROOF STEP]
by (auto simp: interior_real_atLeast)


[STATEMENT]
lemma is_lub_bool: "S <<| (True \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S <<| (True \<in> S)
[PROOF STEP]
unfolding is_lub_def is_ub_def below_bool_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y\<in>S. y \<longrightarrow> True \<in> S) \<and> (\<forall>u. (\<forall>y\<in>S. y \<longrightarrow> u) \<longrightarrow> True \<in> S \<longrightarrow> u)
[PROOF STEP]
by auto


[STATEMENT]
lemma ipurge_tr_all:
 "(ipurge_tr I D u xs = xs) = (\<not> (\<exists>v \<in> D ` set xs. (u, v) \<in> I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ipurge_tr I D u xs = xs) = (\<not> (\<exists>v\<in>D ` set xs. (u, v) \<in> I))
[PROOF STEP]
by (subst ipurge_tr_aux_single_dom [symmetric], simp add: ipurge_tr_aux_all)


[STATEMENT]
lemma stream_smap_nats: "s = smap (snth s) nats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = smap ((!!) s) nats
[PROOF STEP]
using stream_smap_fromN[where n = 0]
[PROOF STATE]
proof (prove)
using this:
?s = smap (\<lambda>j. Let (j - 0) ((!!) ?s)) nats

goal (1 subgoal):
 1. s = smap ((!!) s) nats
[PROOF STEP]
by simp


[STATEMENT]
lemma infnorm_mul: "infnorm (a *\<^sub>R x) = \<bar>a\<bar> * infnorm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infnorm (a *\<^sub>R x) = \<bar>a\<bar> * infnorm x
[PROOF STEP]
unfolding infnorm_Max
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MAX i\<in>Basis. \<bar>a *\<^sub>R x \<bullet> i\<bar>) = \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)
[PROOF STEP]
proof (safe intro!: Max_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<And>y i. i \<in> Basis \<Longrightarrow> \<bar>a *\<^sub>R x \<bullet> i\<bar> \<le> \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)
 3. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
let ?B = "(\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<And>y i. i \<in> Basis \<Longrightarrow> \<bar>a *\<^sub>R x \<bullet> i\<bar> \<le> \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)
 3. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<And>y i. i \<in> Basis \<Longrightarrow> \<bar>a *\<^sub>R x \<bullet> i\<bar> \<le> \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)
 3. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
fix b :: 'a
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<And>y i. i \<in> Basis \<Longrightarrow> \<bar>a *\<^sub>R x \<bullet> i\<bar> \<le> \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)
 3. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
assume "b \<in> Basis"
[PROOF STATE]
proof (state)
this:
b \<in> Basis

goal (3 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<And>y i. i \<in> Basis \<Longrightarrow> \<bar>a *\<^sub>R x \<bullet> i\<bar> \<le> \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)
 3. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> Basis
[PROOF STEP]
show "\<bar>a *\<^sub>R x \<bullet> b\<bar> \<le> \<bar>a\<bar> * Max ?B"
[PROOF STATE]
proof (prove)
using this:
b \<in> Basis

goal (1 subgoal):
 1. \<bar>a *\<^sub>R x \<bullet> b\<bar> \<le> \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)
[PROOF STEP]
by (simp add: abs_mult mult_left_mono)
[PROOF STATE]
proof (state)
this:
\<bar>a *\<^sub>R x \<bullet> b\<bar> \<le> \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>)

goal (2 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
from Max_in[of ?B]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite ((\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis); (\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis \<noteq> {}\<rbrakk> \<Longrightarrow> (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
obtain b where "b \<in> Basis" "Max ?B = \<bar>x \<bullet> b\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ((\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis); (\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis \<noteq> {}\<rbrakk> \<Longrightarrow> (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> Basis; (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) = \<bar>x \<bullet> b\<bar>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp del: Max_in)
[PROOF STATE]
proof (state)
this:
b \<in> Basis
(MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) = \<bar>x \<bullet> b\<bar>

goal (2 subgoals):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
 2. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> Basis
(MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) = \<bar>x \<bullet> b\<bar>
[PROOF STEP]
show "\<bar>a\<bar> * Max ((\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis"
[PROOF STATE]
proof (prove)
using this:
b \<in> Basis
(MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) = \<bar>x \<bullet> b\<bar>

goal (1 subgoal):
 1. \<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
by (intro image_eqI[where x=b]) (auto simp: abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis

goal (1 subgoal):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> * (MAX i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<in> (\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis

goal (1 subgoal):
 1. finite ((\<lambda>i. \<bar>a *\<^sub>R x \<bullet> i\<bar>) ` Basis)
[PROOF STEP]
qed simp


[STATEMENT]
lemma degree_head[simp]: "degree (head p) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial_Expression.degree (head p) = 0
[PROOF STEP]
by (induct p rule: head.induct) auto


[STATEMENT]
lemma bdd_lookup_subsetbdd:
  assumes "wf_nfa N (length ws)"
  and "nfa_is_node N q"
  and "a < length (fst N)"
  shows "bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i< length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
fix w :: "bool list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
assume H: "length w = length ws"
[PROOF STATE]
proof (state)
this:
length w = length ws

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)
[PROOF STEP]
have "\<forall>bd \<in> set (fst N). bdd_all (nfa_is_node N) bd"
[PROOF STATE]
proof (prove)
using this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)

goal (1 subgoal):
 1. \<forall>bd\<in>set (fst N). bdd_all (nfa_is_node N) bd
[PROOF STEP]
by (simp add: wf_nfa_def list_all_iff)
[PROOF STATE]
proof (state)
this:
\<forall>bd\<in>set (fst N). bdd_all (nfa_is_node N) bd

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>bd\<in>set (fst N). bdd_all (nfa_is_node N) bd

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)
[PROOF STEP]
have "\<forall>bd \<in> set (fst N). bddh (length ws) bd"
[PROOF STATE]
proof (prove)
using this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)

goal (1 subgoal):
 1. \<forall>bd\<in>set (fst N). bddh (length ws) bd
[PROOF STEP]
by (simp add: wf_nfa_def list_all_iff)
[PROOF STATE]
proof (state)
this:
\<forall>bd\<in>set (fst N). bddh (length ws) bd

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>bd\<in>set (fst N). bddh (length ws) bd

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
note H
[PROOF STATE]
proof (state)
this:
length w = length ws

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>bd\<in>set (fst N). bdd_all (nfa_is_node N) bd
\<forall>bd\<in>set (fst N). bddh (length ws) bd
length w = length ws
[PROOF STEP]
have "\<forall>bd \<in> set (fst N). nfa_is_node N (bdd_lookup bd w)"
[PROOF STATE]
proof (prove)
using this:
\<forall>bd\<in>set (fst N). bdd_all (nfa_is_node N) bd
\<forall>bd\<in>set (fst N). bddh (length ws) bd
length w = length ws

goal (1 subgoal):
 1. \<forall>bd\<in>set (fst N). nfa_is_node N (bdd_lookup bd w)
[PROOF STEP]
by (simp add: bdd_all_bdd_lookup)
[PROOF STATE]
proof (state)
this:
\<forall>bd\<in>set (fst N). nfa_is_node N (bdd_lookup bd w)

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
length ?w2 = length ws \<Longrightarrow> \<forall>bd\<in>set (fst N). nfa_is_node N (bdd_lookup bd ?w2)

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)
length ?w2 = length ws \<Longrightarrow> \<forall>bd\<in>set (fst N). nfa_is_node N (bdd_lookup bd ?w2)
[PROOF STEP]
have "bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = ((\<exists>i < length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a) \<or> bdd_lookup (nfa_emptybdd (length q)) ws ! a)"
[PROOF STATE]
proof (prove)
using this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)
length ?w2 = length ws \<Longrightarrow> \<forall>bd\<in>set (fst N). nfa_is_node N (bdd_lookup bd ?w2)

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = ((\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a) \<or> bdd_lookup (nfa_emptybdd (length q)) ws ! a)
[PROOF STEP]
by (simp add: bdd_lookup_subsetbdd' nfa_is_node_def wf_nfa_def list_all_iff nfa_emptybdd_def)
[PROOF STATE]
proof (state)
this:
bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = ((\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a) \<or> bdd_lookup (nfa_emptybdd (length q)) ws ! a)

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)
bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = ((\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a) \<or> bdd_lookup (nfa_emptybdd (length q)) ws ! a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
wf_nfa N (length ws)
nfa_is_node N q
a < length (fst N)
bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = ((\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a) \<or> bdd_lookup (nfa_emptybdd (length q)) ws ! a)

goal (1 subgoal):
 1. bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)
[PROOF STEP]
by (auto simp: nfa_emptybdd_def nfa_is_node_def)
[PROOF STATE]
proof (state)
this:
bdd_lookup (subsetbdd (fst N) q (nfa_emptybdd (length q))) ws ! a = (\<exists>i<length q. q ! i \<and> bdd_lookup (fst N ! i) ws ! a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma divide_right_mono_neg: "a \<le> b
    \<Longrightarrow> c \<le> 0 \<Longrightarrow> b / c \<le> a / c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; c \<le> (0::'a)\<rbrakk> \<Longrightarrow> b / c \<le> a / c
[PROOF STEP]
by (metis local.divide_cancel_right local.divide_strict_right_mono_neg local.dual_order.strict_implies_order local.eq_refl local.le_imp_less_or_eq)


[STATEMENT]
lemma ordst_ordstNS_trans:
"ordst X Y \<Longrightarrow> ordstNS Y Z \<Longrightarrow> ordst X Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ordst X Y; ordstNS Y Z\<rbrakk> \<Longrightarrow> ordst X Z
[PROOF STEP]
by (metis ordstNS_def ordst_trans)


[STATEMENT]
lemma NSCauchyI:
  "(\<And>M N. M \<in> HNatInfinite \<Longrightarrow> N \<in> HNatInfinite \<Longrightarrow> starfun X M \<approx> starfun X N) \<Longrightarrow> NSCauchy X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M N. \<lbrakk>M \<in> HNatInfinite; N \<in> HNatInfinite\<rbrakk> \<Longrightarrow> (*f* X) M \<approx> (*f* X) N) \<Longrightarrow> NSCauchy X
[PROOF STEP]
by (simp add: NSCauchy_def)


[STATEMENT]
lemma connected_Int_frontier:
     "\<lbrakk>connected s; s \<inter> t \<noteq> {}; s - t \<noteq> {}\<rbrakk> \<Longrightarrow> (s \<inter> frontier t \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected s; s \<inter> t \<noteq> {}; s - t \<noteq> {}\<rbrakk> \<Longrightarrow> s \<inter> frontier t \<noteq> {}
[PROOF STEP]
apply (simp add: frontier_interiors connected_openin, safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<forall>E1. openin (top_of_set s) E1 \<longrightarrow> (\<forall>E2. E1 \<inter> E2 = {} \<longrightarrow> s \<subseteq> E1 \<union> E2 \<longrightarrow> openin (top_of_set s) E2 \<longrightarrow> E1 = {} \<or> E2 = {}); x \<in> s; x \<notin> t; s \<inter> (- interior t - interior (- t)) = {}; \<not> False; xa \<in> s; xa \<in> t\<rbrakk> \<Longrightarrow> xa \<in> {}
[PROOF STEP]
apply (drule_tac x="s \<inter> interior t" in spec, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>x \<in> s; x \<notin> t; s \<inter> (- interior t - interior (- t)) = {}; \<not> False; xa \<in> s; xa \<in> t; \<not> openin (top_of_set s) (s \<inter> interior t)\<rbrakk> \<Longrightarrow> xa \<in> {}
 2. \<And>x xa. \<lbrakk>x \<in> s; x \<notin> t; s \<inter> (- interior t - interior (- t)) = {}; \<not> False; xa \<in> s; xa \<in> t; \<forall>E2. s \<inter> interior t \<inter> E2 = {} \<longrightarrow> s \<subseteq> s \<inter> interior t \<union> E2 \<longrightarrow> openin (top_of_set s) E2 \<longrightarrow> s \<inter> interior t = {} \<or> E2 = {}\<rbrakk> \<Longrightarrow> xa \<in> {}
[PROOF STEP]
apply (drule_tac [2] x="s \<inter> interior (-t)" in spec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>x \<in> s; x \<notin> t; s \<inter> (- interior t - interior (- t)) = {}; \<not> False; xa \<in> s; xa \<in> t; \<not> openin (top_of_set s) (s \<inter> interior t)\<rbrakk> \<Longrightarrow> xa \<in> {}
 2. \<And>x xa. \<lbrakk>x \<in> s; x \<notin> t; s \<inter> (- interior t - interior (- t)) = {}; \<not> False; xa \<in> s; xa \<in> t; s \<inter> interior t \<inter> (s \<inter> interior (- t)) = {} \<longrightarrow> s \<subseteq> s \<inter> interior t \<union> s \<inter> interior (- t) \<longrightarrow> openin (top_of_set s) (s \<inter> interior (- t)) \<longrightarrow> s \<inter> interior t = {} \<or> s \<inter> interior (- t) = {}\<rbrakk> \<Longrightarrow> xa \<in> {}
[PROOF STEP]
apply (auto simp: disjoint_eq_subset_Compl dest: interior_subset [THEN subsetD])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma union_le_mono2: "B < D \<Longrightarrow> C + B < C + (D::'a::preorder multiset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B < D \<Longrightarrow> C + B < C + D
[PROOF STEP]
apply (unfold less_multiset_def multp_def mult_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B, D) \<in> (mult1 {(x, y). x < y})\<^sup>+ \<Longrightarrow> (C + B, C + D) \<in> (mult1 {(x, y). x < y})\<^sup>+
[PROOF STEP]
apply (erule trancl_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y. (B, y) \<in> mult1 {(x, y). x < y} \<Longrightarrow> (C + B, C + y) \<in> (mult1 {a. case a of (a, b) \<Rightarrow> a < b})\<^sup>+
 2. \<And>y z. \<lbrakk>(B, y) \<in> (mult1 {(x, y). x < y})\<^sup>+; (y, z) \<in> mult1 {(x, y). x < y}; (C + B, C + y) \<in> (mult1 {a. case a of (a, b) \<Rightarrow> a < b})\<^sup>+\<rbrakk> \<Longrightarrow> (C + B, C + z) \<in> (mult1 {a. case a of (a, b) \<Rightarrow> a < b})\<^sup>+
[PROOF STEP]
apply (blast intro: mult1_union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(B, y) \<in> (mult1 {(x, y). x < y})\<^sup>+; (y, z) \<in> mult1 {(x, y). x < y}; (C + B, C + y) \<in> (mult1 {a. case a of (a, b) \<Rightarrow> a < b})\<^sup>+\<rbrakk> \<Longrightarrow> (C + B, C + z) \<in> (mult1 {a. case a of (a, b) \<Rightarrow> a < b})\<^sup>+
[PROOF STEP]
apply (blast intro: mult1_union trancl_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pderiv_minus: "pderiv (- p :: 'a :: idom poly) = - pderiv p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (- p) = - pderiv p
[PROOF STEP]
by (rule poly_eqI) (simp add: coeff_pderiv algebra_simps)


[STATEMENT]
lemma eventually_gt_ereal_at_top: "c \<noteq> \<infinity> \<Longrightarrow> eventually (\<lambda>x. ereal x > c) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in at_top. c < ereal x
[PROOF STEP]
by (cases c) auto


[STATEMENT]
lemma weak_convexD [dest]:
  assumes "weak_convex_pref Pr" and "x \<succeq>[Pr] y" and "0 < u" and "0 < v" and "u + v = 1"
  shows "u *\<^sub>R x + v *\<^sub>R y \<succeq>[Pr] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u *\<^sub>R x + v *\<^sub>R y \<succeq>[Pr] y
[PROOF STEP]
using assms weak_convex_pref_def
[PROOF STATE]
proof (prove)
using this:
weak_convex_pref Pr
x \<succeq>[Pr] y
0 < u
0 < v
u + v = 1
weak_convex_pref ?Pr = (\<forall>x y. x \<succeq>[?Pr] y \<longrightarrow> (\<forall>\<alpha> \<beta>. \<alpha> + \<beta> = 1 \<and> 0 < \<alpha> \<and> 0 < \<beta> \<longrightarrow> \<alpha> *\<^sub>R x + \<beta> *\<^sub>R y \<succeq>[?Pr] y))

goal (1 subgoal):
 1. u *\<^sub>R x + v *\<^sub>R y \<succeq>[Pr] y
[PROOF STEP]
by blast


[STATEMENT]
lemma monadic_filter_rev_rule:
      assumes "\<And>x. x\<in>set l \<Longrightarrow> P x \<le> (spec r. r=Q x)"
      shows "monadic_filter_rev P l \<le> (spec r. r=filter_rev Q l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monadic_filter_rev P l \<le> (spec r. r = filter_rev Q l)
[PROOF STEP]
using monadic_filter_rev_aux_rule[where a="[]"] assms
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> set ?l \<Longrightarrow> ?P x \<le> (spec r. r = ?Q x)) \<Longrightarrow> monadic_filter_rev_aux [] ?P ?l \<le> (spec r. r = filter_rev_aux [] ?Q ?l)
?x1 \<in> set l \<Longrightarrow> P ?x1 \<le> (spec r. r = Q ?x1)

goal (1 subgoal):
 1. monadic_filter_rev P l \<le> (spec r. r = filter_rev Q l)
[PROOF STEP]
by (auto simp: monadic_filter_rev_def filter_rev_def)


[STATEMENT]
lemma pure_eq_iff:
  "(\<forall>h' x. h \<turnstile> f \<rightarrow>\<^sub>r x \<longrightarrow> h \<turnstile> f \<rightarrow>\<^sub>h h' \<longrightarrow> h = h') \<longleftrightarrow> pure f h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>h' x. h \<turnstile> f \<rightarrow>\<^sub>r x \<longrightarrow> h \<turnstile> f \<rightarrow>\<^sub>h h' \<longrightarrow> h = h') = pure f h
[PROOF STEP]
by(auto simp add: pure_def)


[STATEMENT]
lemma list2policyR_End: "p \<notin> dom (Cp a) \<Longrightarrow>
        Cp (list2policyR (a # list)) p = (Cp a \<Oplus> list2policy (map Cp list)) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<notin> dom (Cp a) \<Longrightarrow> Cp (list2policyR (a # list)) p = (Cp a \<Oplus> list2policy (map Cp list)) p
[PROOF STEP]
by (rule list2policyR.induct)
    (simp_all add: Cp.simps dom_def map_add_def list2policy_def split: option.splits)


[STATEMENT]
lemma Fix_lsl_left_slsided: "Fix \<nu> = {(x::'a::unital_quantale). lsd x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fix \<nu> = {x. lsd x}
[PROOF STEP]
unfolding Fix_def lsl_def lsd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<top> \<cdot> x = x} = {x. \<top> \<cdot> x \<le> x}
[PROOF STEP]
using order.eq_iff le_top
[PROOF STATE]
proof (prove)
using this:
(?a = ?b) = (?a \<le> ?b \<and> ?b \<le> ?a)
?x \<le> \<top> \<cdot> ?x

goal (1 subgoal):
 1. {x. \<top> \<cdot> x = x} = {x. \<top> \<cdot> x \<le> x}
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Module) sc_assoc:"\<lbrakk>a \<in> carrier R; b \<in> carrier R;
 m \<in> carrier M\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) \<cdot>\<^sub>s m =  a \<cdot>\<^sub>s ( b \<cdot>\<^sub>s m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; m \<in> carrier M\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) \<cdot>\<^sub>s m = a \<cdot>\<^sub>s (b \<cdot>\<^sub>s m)
[PROOF STEP]
apply (simp add:sprod_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma clinear_o_antilinear: "antilinear f \<Longrightarrow> clinear g \<Longrightarrow> antilinear (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>antilinear f; clinear g\<rbrakk> \<Longrightarrow> antilinear (g \<circ> f)
[PROOF STEP]
apply (rule antilinearI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>antilinear f; clinear g\<rbrakk> \<Longrightarrow> (g \<circ> f) (x + y) = (g \<circ> f) x + (g \<circ> f) y
 2. \<And>c x. \<lbrakk>antilinear f; clinear g\<rbrakk> \<Longrightarrow> (g \<circ> f) (c *\<^sub>C x) = cnj c *\<^sub>C (g \<circ> f) x
[PROOF STEP]
apply (simp add: additive.add complex_vector.linear_add antilinear_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c x. \<lbrakk>antilinear f; clinear g\<rbrakk> \<Longrightarrow> (g \<circ> f) (c *\<^sub>C x) = cnj c *\<^sub>C (g \<circ> f) x
[PROOF STEP]
by (simp add: complex_vector.linear_scale antilinear.scaleC)


[STATEMENT]
lemma invertible_snd_QR_decomposition:
  fixes A::"real^'n::{mod_type}^'m::{mod_type}"
  assumes r: "rank A = ncols A"
  shows "invertible (snd (QR_decomposition A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (snd (QR_decomposition A))
[PROOF STEP]
proof (rule upper_triangular_invertible)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. upper_triangular (snd (QR_decomposition A))
 2. \<forall>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
show "upper_triangular (snd (QR_decomposition A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_triangular (snd (QR_decomposition A))
[PROOF STEP]
using upper_triangular_snd_QR_decomposition[OF r]
[PROOF STATE]
proof (prove)
using this:
upper_triangular (snd (QR_decomposition A))

goal (1 subgoal):
 1. upper_triangular (snd (QR_decomposition A))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
upper_triangular (snd (QR_decomposition A))

goal (1 subgoal):
 1. \<forall>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
show "\<forall>i. snd (QR_decomposition A) $ i $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
proof (rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
have ind: "vec.independent (columns (Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (columns (Gram_Schmidt_matrix A))
[PROOF STEP]
by (metis full_rank_imp_is_basis2
        independent_columns_Gram_Schmidt_matrix r)
[PROOF STATE]
proof (state)
this:
vec.independent (columns (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
hence zero_not_in: "0 \<notin> (columns (Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (prove)
using this:
vec.independent (columns (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. 0 \<notin> columns (Gram_Schmidt_matrix A)
[PROOF STEP]
by (metis vec.dependent_zero)
[PROOF STATE]
proof (state)
this:
0 \<notin> columns (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
hence c:"column i (Gram_Schmidt_matrix A) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<notin> columns (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. column i (Gram_Schmidt_matrix A) \<noteq> 0
[PROOF STEP]
unfolding columns_def
[PROOF STATE]
proof (prove)
using this:
0 \<notin> {column i (Gram_Schmidt_matrix A) |i. i \<in> UNIV}

goal (1 subgoal):
 1. column i (Gram_Schmidt_matrix A) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
column i (Gram_Schmidt_matrix A) \<noteq> 0

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
have "snd (QR_decomposition A) $ i $ i = column i (fst (QR_decomposition A)) \<bullet> column i A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (QR_decomposition A) $ i $ i = column i (fst (QR_decomposition A)) \<bullet> column i A
[PROOF STEP]
unfolding QR_decomposition_def Let_def snd_conv fst_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Finite_Cartesian_Product.transpose (divide_by_norm (Gram_Schmidt_matrix A)) ** A) $ i $ i = column i (divide_by_norm (Gram_Schmidt_matrix A)) \<bullet> column i A
[PROOF STEP]
unfolding matrix_matrix_mult_inner_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row i (Finite_Cartesian_Product.transpose (divide_by_norm (Gram_Schmidt_matrix A))) \<bullet> column i A = column i (divide_by_norm (Gram_Schmidt_matrix A)) \<bullet> column i A
[PROOF STEP]
unfolding row_transpose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i (divide_by_norm (Gram_Schmidt_matrix A)) \<bullet> column i A = column i (divide_by_norm (Gram_Schmidt_matrix A)) \<bullet> column i A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
snd (QR_decomposition A) $ i $ i = column i (fst (QR_decomposition A)) \<bullet> column i A

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
snd (QR_decomposition A) $ i $ i = column i (fst (QR_decomposition A)) \<bullet> column i A

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
have "... = norm (column i (Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i (fst (QR_decomposition A)) \<bullet> column i A = norm (column i (Gram_Schmidt_matrix A))
[PROOF STEP]
unfolding norm_uk_eq[OF r, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (column i (Gram_Schmidt_matrix A)) = norm (column i (Gram_Schmidt_matrix A))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
column i (fst (QR_decomposition A)) \<bullet> column i A = norm (column i (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
column i (fst (QR_decomposition A)) \<bullet> column i A = norm (column i (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
have "... \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (column i (Gram_Schmidt_matrix A)) \<noteq> 0
[PROOF STEP]
by (rule ccontr, simp add: c)
[PROOF STATE]
proof (state)
this:
norm (column i (Gram_Schmidt_matrix A)) \<noteq> 0

goal (1 subgoal):
 1. \<And>i. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
show "snd (QR_decomposition A) $ i $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
snd (QR_decomposition A) $ i $ i \<noteq> 0

goal (1 subgoal):
 1. snd (QR_decomposition A) $ i $ i \<noteq> 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
snd (QR_decomposition A) $ i $ i \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i. snd (QR_decomposition A) $ i $ i \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma valid_UV_lists_arg_min_ex_aux:
  "\<lbrakk>finite ys; ys \<noteq> {}; ys = {x. \<exists>as bs cs. as@U@bs@V@cs = x \<and> set x = xs \<and> distinct x}\<rbrakk>
    \<Longrightarrow> \<exists>y \<in> ys. \<forall>z \<in> ys. (f :: 'a list \<Rightarrow> real) y \<le> f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite ys; ys \<noteq> {}; ys = {x. \<exists>as bs cs. as @ U @ bs @ V @ cs = x \<and> set x = xs \<and> distinct x}\<rbrakk> \<Longrightarrow> \<exists>y\<in>ys. \<forall>z\<in>ys. f y \<le> f z
[PROOF STEP]
using arg_min_if_finite(1)[of ys f] arg_min_least[of ys, where ?f = f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ys; ys \<noteq> {}\<rbrakk> \<Longrightarrow> arg_min_on f ys \<in> ys
\<lbrakk>finite ys; ys \<noteq> {}; ?y \<in> ys\<rbrakk> \<Longrightarrow> f (arg_min_on f ys) \<le> f ?y

goal (1 subgoal):
 1. \<lbrakk>finite ys; ys \<noteq> {}; ys = {x. \<exists>as bs cs. as @ U @ bs @ V @ cs = x \<and> set x = xs \<and> distinct x}\<rbrakk> \<Longrightarrow> \<exists>y\<in>ys. \<forall>z\<in>ys. f y \<le> f z
[PROOF STEP]
by auto


[STATEMENT]
lemma AE_I2[simp, intro]:
  "(\<And>x. x \<in> space M \<Longrightarrow> P x) \<Longrightarrow> AE x in M. P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> space M \<Longrightarrow> P x) \<Longrightarrow> almost_everywhere M P
[PROOF STEP]
using AE_space
[PROOF STATE]
proof (prove)
using this:
AE x in ?M. x \<in> space ?M

goal (1 subgoal):
 1. (\<And>x. x \<in> space M \<Longrightarrow> P x) \<Longrightarrow> almost_everywhere M P
[PROOF STEP]
by force


[STATEMENT]
lemma SUP_enat_add_right:
  assumes "I \<noteq> {}"
  shows "(SUP i\<in>I. c + f i :: enat) = c + (SUP i\<in>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>i\<in>I. c + f i) = c + \<Squnion> (f ` I)
[PROOF STEP]
using SUP_enat_add_left[OF assms, of f c]
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>i\<in>I. f i + c) = \<Squnion> (f ` I) + c

goal (1 subgoal):
 1. (\<Squnion>i\<in>I. c + f i) = c + \<Squnion> (f ` I)
[PROOF STEP]
by(simp add: add.commute)


[STATEMENT]
lemma subst_comp_scheme_list:
  "$ R ($ S A::type_scheme list) = $ (\<lambda>x. $ R (S x)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $ R ($ S A) = $ (\<lambda>x. $ R (S x)) A
[PROOF STEP]
unfolding app_subst_list
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ($ R) (map ($ S) A) = map ($ (\<lambda>x. $ R (S x))) A
[PROOF STEP]
proof (induct A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. map ($ R) (map ($ S) []) = map ($ (\<lambda>x. $ R (S x))) []
 2. \<And>a A. map ($ R) (map ($ S) A) = map ($ (\<lambda>x. $ R (S x))) A \<Longrightarrow> map ($ R) (map ($ S) (a # A)) = map ($ (\<lambda>x. $ R (S x))) (a # A)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. map ($ R) (map ($ S) []) = map ($ (\<lambda>x. $ R (S x))) []
 2. \<And>a A. map ($ R) (map ($ S) A) = map ($ (\<lambda>x. $ R (S x))) A \<Longrightarrow> map ($ R) (map ($ S) (a # A)) = map ($ (\<lambda>x. $ R (S x))) (a # A)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ($ R) (map ($ S) []) = map ($ (\<lambda>x. $ R (S x))) []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map ($ R) (map ($ S) []) = map ($ (\<lambda>x. $ R (S x))) []

goal (1 subgoal):
 1. \<And>a A. map ($ R) (map ($ S) A) = map ($ (\<lambda>x. $ R (S x))) A \<Longrightarrow> map ($ R) (map ($ S) (a # A)) = map ($ (\<lambda>x. $ R (S x))) (a # A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a A. map ($ R) (map ($ S) A) = map ($ (\<lambda>x. $ R (S x))) A \<Longrightarrow> map ($ R) (map ($ S) (a # A)) = map ($ (\<lambda>x. $ R (S x))) (a # A)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
map ($ R) (map ($ S) A_) = map ($ (\<lambda>x. $ R (S x))) A_

goal (1 subgoal):
 1. \<And>a A. map ($ R) (map ($ S) A) = map ($ (\<lambda>x. $ R (S x))) A \<Longrightarrow> map ($ R) (map ($ S) (a # A)) = map ($ (\<lambda>x. $ R (S x))) (a # A)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
map ($ R) (map ($ S) A_) = map ($ (\<lambda>x. $ R (S x))) A_

goal (1 subgoal):
 1. map ($ R) (map ($ S) (a_ # A_)) = map ($ (\<lambda>x. $ R (S x))) (a_ # A_)
[PROOF STEP]
by (simp add: subst_comp_type_scheme)
[PROOF STATE]
proof (state)
this:
map ($ R) (map ($ S) (a_ # A_)) = map ($ (\<lambda>x. $ R (S x))) (a_ # A_)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cycle_no_points:
  assumes "cycle x"
    shows "start_points x = 0"
      and "end_points x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. start_points x = 0 &&& end_points x = 0
[PROOF STEP]
by (metis assms inf_compl_bot many_strongly_connected_implies_no_start_end_points)+


[STATEMENT]
lemma fls_mult_one:
  fixes f :: "'a::{comm_monoid_add, mult_zero, monoid_mult} fls"
  shows "1 * f = f"
  and   "f * 1 = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * f = f &&& f * 1 = f
[PROOF STEP]
using fls_conv_base_factor_to_fps_shift_subdegree[of f]
[PROOF STATE]
proof (prove)
using this:
f = fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f))

goal (1 subgoal):
 1. 1 * f = f &&& f * 1 = f
[PROOF STEP]
by    (simp_all add: fls_times_def fps_one_mult)


[STATEMENT]
lemma picard_lindeloef_constant: "picard_lindeloef (\<lambda>t s. c) UNIV UNIV t\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. picard_lindeloef (\<lambda>t s. c) UNIV UNIV t\<^sub>0
[PROOF STEP]
apply(unfold_locales, simp_all add: local_lipschitz_def lipschitz_on_def, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x t. \<exists>u>0. (\<exists>ta. dist t ta \<le> u) \<longrightarrow> (\<exists>L\<ge>0. \<forall>xa\<in>cball x u. \<forall>y\<in>cball x u. 0 \<le> L * dist xa y)
[PROOF STEP]
by (rule_tac x=1 in exI, clarsimp, rule_tac x="1/2" in exI, simp)


[STATEMENT]
lemma OPT2_length: "length (OPT2 \<sigma> [x, y]) = length \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (OPT2 \<sigma> [x, y]) = length \<sigma>
[PROOF STEP]
apply(induct \<sigma> arbitrary: x y)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. length (OPT2 [] [x, y]) = length []
 2. \<And>a \<sigma> x y. (\<And>x y. length (OPT2 \<sigma> [x, y]) = length \<sigma>) \<Longrightarrow> length (OPT2 (a # \<sigma>) [x, y]) = length (a # \<sigma>)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a \<sigma> x y. (\<And>x y. length (OPT2 \<sigma> [x, y]) = length \<sigma>) \<Longrightarrow> length (OPT2 (a # \<sigma>) [x, y]) = length (a # \<sigma>)
[PROOF STEP]
apply(case_tac \<sigma>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a \<sigma> x y. \<lbrakk>\<And>x y. length (OPT2 \<sigma> [x, y]) = length \<sigma>; \<sigma> = []\<rbrakk> \<Longrightarrow> length (OPT2 (a # \<sigma>) [x, y]) = length (a # \<sigma>)
 2. \<And>a \<sigma> x y aa list. \<lbrakk>\<And>x y. length (OPT2 \<sigma> [x, y]) = length \<sigma>; \<sigma> = aa # list\<rbrakk> \<Longrightarrow> length (OPT2 (a # \<sigma>) [x, y]) = length (a # \<sigma>)
[PROOF STEP]
by(auto)


[STATEMENT]
theorem eig_weak_consensus:
  assumes run: "SHORun EIG_M rho HOs SHOs"
      and commR: "\<forall>r. EIG_commPerRd (HOs r) (SHOs r)"
      and commG: "EIG_commGlobal HOs SHOs"
  shows "weak_consensus (\<lambda>p. the (vals (rho 0 p) root_node)) decide rho"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_consensus (\<lambda>p. the (vals (rho 0 p) root_node)) decide rho
[PROOF STEP]
unfolding weak_consensus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>v. (\<forall>p. the (vals (rho 0 p) root_node) = v) \<longrightarrow> (\<forall>n p w. decide (rho n p) = Some w \<longrightarrow> w = v)) \<and> (\<forall>m n p q v w. decide (rho m p) = Some v \<and> decide (rho n q) = Some w \<longrightarrow> v = w) \<and> (\<forall>p. \<exists>n. decide (rho n p) \<noteq> None)
[PROOF STEP]
using Validity[OF run commR]
        Agreement[OF run commG commR]
        Termination[OF run]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>q. the (vals (rho 0 q) root_node) = ?v; decide (rho ?r ?p) = Some ?w\<rbrakk> \<Longrightarrow> ?v = ?w
\<lbrakk>decide (rho ?m ?p) = Some ?v; decide (rho ?n ?q) = Some ?w\<rbrakk> \<Longrightarrow> ?v = ?w
\<exists>r v. decide (rho r ?p) = Some v

goal (1 subgoal):
 1. (\<forall>v. (\<forall>p. the (vals (rho 0 p) root_node) = v) \<longrightarrow> (\<forall>n p w. decide (rho n p) = Some w \<longrightarrow> w = v)) \<and> (\<forall>m n p q v w. decide (rho m p) = Some v \<and> decide (rho n q) = Some w \<longrightarrow> v = w) \<and> (\<forall>p. \<exists>n. decide (rho n p) \<noteq> None)
[PROOF STEP]
by auto


[STATEMENT]
lemma dual_complemented_lattice:
  "class.complemented_lattice (\<lambda>x y. x \<squnion> (- y)) uminus (\<squnion>) (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) (\<sqinter>) \<top> \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.complemented_lattice (\<lambda>x y. x \<squnion> - y) uminus (\<squnion>) (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) (\<sqinter>) \<top> \<bottom>
[PROOF STEP]
proof (rule class.complemented_lattice.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. class.bounded_lattice (\<squnion>) (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) (\<sqinter>) \<top> \<bottom>
 2. class.complemented_lattice_axioms (\<lambda>x y. x \<squnion> - y) uminus (\<squnion>) (\<sqinter>) \<top> \<bottom>
[PROOF STEP]
show "class.bounded_lattice (\<squnion>) (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) (\<sqinter>) \<top> \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.bounded_lattice (\<squnion>) (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) (\<sqinter>) \<top> \<bottom>
[PROOF STEP]
by (rule dual_bounded_lattice)
[PROOF STATE]
proof (state)
this:
class.bounded_lattice (\<squnion>) (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) (\<sqinter>) \<top> \<bottom>

goal (1 subgoal):
 1. class.complemented_lattice_axioms (\<lambda>x y. x \<squnion> - y) uminus (\<squnion>) (\<sqinter>) \<top> \<bottom>
[PROOF STEP]
show "class.complemented_lattice_axioms (\<lambda>x y. x \<squnion> - y) uminus (\<squnion>) (\<sqinter>) \<top> \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.complemented_lattice_axioms (\<lambda>x y. x \<squnion> - y) uminus (\<squnion>) (\<sqinter>) \<top> \<bottom>
[PROOF STEP]
by (unfold_locales, auto simp add: diff_eq)
[PROOF STATE]
proof (state)
this:
class.complemented_lattice_axioms (\<lambda>x y. x \<squnion> - y) uminus (\<squnion>) (\<sqinter>) \<top> \<bottom>

goal:
No subgoals!
[PROOF STEP]
qed