[STATEMENT]
lemma SETId: assumes "x |\<in>| X" shows "(Id SET X) |@| x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
have "X \<in> Obj SET"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> obj\<^bsub>SET\<^esub>
[PROOF STEP]
by (simp add: SET_def SET'_def MakeCat_def)
[PROOF STATE]
proof (state)
this:
X \<in> obj\<^bsub>SET\<^esub>

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
hence "isZFfun(Id SET X)"
[PROOF STATE]
proof (prove)
using this:
X \<in> obj\<^bsub>SET\<^esub>

goal (1 subgoal):
 1. isZFfun (id\<^bsub>SET\<^esub> X)
[PROOF STEP]
by (simp add: SETCategory Category.CatIdInMor SETmor)
[PROOF STATE]
proof (state)
this:
isZFfun (id\<^bsub>SET\<^esub> X)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
isZFfun (id\<^bsub>SET\<^esub> X)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
have "(Id SET X) = ZFfun X X (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x |\<in>| X

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
[PROOF STEP]
by (simp add: SET_def SET'_def MakeCat_def)
[PROOF STATE]
proof (state)
this:
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
isZFfun (id\<^bsub>SET\<^esub> X)
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isZFfun (id\<^bsub>SET\<^esub> X)
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isZFfun (id\<^bsub>SET\<^esub> X)
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
x |\<in>| X

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
by (simp add: ZFfunApp)
[PROOF STATE]
proof (state)
this:
id\<^bsub>SET\<^esub> X |@| x = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vimage_algebra_cong:
  assumes "X = Y"
  assumes "\<And>x. x \<in> Y \<Longrightarrow> f x = g x"
  assumes "sets M = sets N"
  shows "vimage_algebra X f M = vimage_algebra Y g N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vimage_algebra X f M = vimage_algebra Y g N
[PROOF STEP]
by (auto simp: vimage_algebra_def assms intro!: arg_cong2[where f=sigma])


[STATEMENT]
lemma length_takeWhile_less:
  "\<exists>x\<in>set xs. \<not> P x \<Longrightarrow> length (takeWhile P xs) < length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>set xs. \<not> P x \<Longrightarrow> length (takeWhile P xs) < length xs
[PROOF STEP]
by (induct xs) (auto split: if_splits)


[STATEMENT]
lemma octo_norm_imaginary: "Ree x = 0 \<Longrightarrow> x * x = -(octo_of_real (norm x))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ree x = 0 \<Longrightarrow> x * x = - (octo_of_real (norm x))\<^sup>2
[PROOF STEP]
by (simp add: octo_eq_iff octo_mult_components norm_octo_def power2_eq_square
           flip: octo_of_real_power octo_of_real_mult)


[STATEMENT]
lemma path_connectedin_Euclidean_complements:
  assumes "closedin (Euclidean_space n) S" "closedin (Euclidean_space n) T"
          "(subtopology (Euclidean_space n) S) homeomorphic_space (subtopology (Euclidean_space n) T)"
  shows "path_connectedin (Euclidean_space n) (topspace(Euclidean_space n) - S)
         \<longleftrightarrow> path_connectedin (Euclidean_space n) (topspace(Euclidean_space n) - T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin (Euclidean_space n) (topspace (Euclidean_space n) - S) = path_connectedin (Euclidean_space n) (topspace (Euclidean_space n) - T)
[PROOF STEP]
by (meson Diff_subset assms isomorphic_homology_groups_Euclidean_complements isomorphic_homology_imp_path_connectedness path_connectedin_def)


[STATEMENT]
lemma Un_0_Suc: "(\<Union>n. f n) = f 0 \<union> (\<Union>n. f (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range f) = f 0 \<union> (\<Union>n. f (Suc n))
[PROOF STEP]
by auto (metis not0_implies_Suc)


[STATEMENT]
lemma coeff_powsum_mpoly_0_right:
  "MPoly_Type.coeff (powsum_mpoly X 0) mon = (if mon = 0 then of_nat (card X) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (powsum_mpoly X 0) mon = (if mon = 0 then of_nat (card X) else (0::'a))
[PROOF STEP]
by transfer' (auto simp add: lookup_powsum_mpoly_aux)


[STATEMENT]
lemma (in Module) l_comb_mem:"\<lbrakk>ideal R A; H \<subseteq> carrier M;
       s \<in> {j. j \<le> (n::nat)} \<rightarrow> A; m \<in> {j. j \<le> n} \<rightarrow> H\<rbrakk> \<Longrightarrow>
      l_comb R M n s m \<in> carrier M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; m \<in> {j. j \<le> n} \<rightarrow> H\<rbrakk> \<Longrightarrow> l_comb R M n s m \<in> carrier M
[PROOF STEP]
apply (simp add:liear_comb_memTr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_aligned_replicate:
  fixes w::"'a::len word"
  assumes aligned: "is_aligned w n"
  and          nv: "n \<le> LENGTH('a)"
  shows   "to_bl w = (take (LENGTH('a) - n) (to_bl w)) @ replicate n False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl w = take (LENGTH('a) - n) (to_bl w) @ replicate n False
[PROOF STEP]
apply (rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (to_bl w) = length (take (LENGTH('a) - n) (to_bl w) @ replicate n False)
 2. \<And>i. i < length (to_bl w) \<Longrightarrow> to_bl w ! i = (take (LENGTH('a) - n) (to_bl w) @ replicate n False) ! i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_aligned w n
n \<le> LENGTH('a)

goal (2 subgoals):
 1. length (to_bl w) = length (take (LENGTH('a) - n) (to_bl w) @ replicate n False)
 2. \<And>i. i < length (to_bl w) \<Longrightarrow> to_bl w ! i = (take (LENGTH('a) - n) (to_bl w) @ replicate n False) ! i
[PROOF STEP]
apply (simp_all add: nth_append not_less word_size to_bl_nth is_aligned_imp_not_bit)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma same_carrierI:
  assumes "finite C"
  assumes subset: "A \<subseteq> C" "B \<subseteq> C"
  assumes trivial: "\<And>a. a \<in> C - A \<Longrightarrow> g a = \<^bold>1" "\<And>b. b \<in> C - B \<Longrightarrow> h b = \<^bold>1"
  assumes "F g C = F h C"
  shows "F g A = F h B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g A = F h B
[PROOF STEP]
using assms same_carrier [of C A B]
[PROOF STATE]
proof (prove)
using this:
finite C
A \<subseteq> C
B \<subseteq> C
?a1 \<in> C - A \<Longrightarrow> g ?a1 = \<^bold>1
?b1 \<in> C - B \<Longrightarrow> h ?b1 = \<^bold>1
F g C = F h C
\<lbrakk>finite C; A \<subseteq> C; B \<subseteq> C; \<And>a. a \<in> C - A \<Longrightarrow> ?g a = \<^bold>1; \<And>b. b \<in> C - B \<Longrightarrow> ?h b = \<^bold>1\<rbrakk> \<Longrightarrow> (F ?g A = F ?h B) = (F ?g C = F ?h C)

goal (1 subgoal):
 1. F g A = F h B
[PROOF STEP]
by simp


[STATEMENT]
lemma sup_lub:
  assumes "A \<subseteq> carrier L"
  shows "least L (\<Squnion>A) (Upper L A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_lub L (\<Squnion>A) A
[PROOF STEP]
by (metis Upper_is_closed assms least_closed least_cong supI sup_closed sup_exists weak_least_unique)


[STATEMENT]
lemma \<phi>_left_support: "x \<in> {-1 .. 0::real} \<Longrightarrow> \<phi> (l,i) ((x + real_of_int i) / 2^(l + 1)) = 1 + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {- 1..0} \<Longrightarrow> \<phi> (l, i) ((x + real_of_int i) / 2 ^ (l + 1)) = 1 + x
[PROOF STEP]
by (auto simp: \<phi>_def field_simps split: split_max)


[STATEMENT]
lemma is_rbt_fold_rbt_insert: "is_rbt t \<Longrightarrow> is_rbt (fold (\<lambda>k. rbt_insert k (f k)) xs t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_rbt t \<Longrightarrow> is_rbt (fold (\<lambda>k. rbt_insert k (f k)) xs t)
[PROOF STEP]
by(induct xs rule: rev_induct) simp_all


[STATEMENT]
lemma zdiv_le_dividend:
  \<open>0 \<le> a \<Longrightarrow> 0 < b \<Longrightarrow> a div b \<le> a\<close> for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 < b\<rbrakk> \<Longrightarrow> a div b \<le> a
[PROOF STEP]
by (metis div_by_1 int_one_le_iff_zero_less zdiv_mono2 zero_less_one)


[STATEMENT]
lemma divide_strict_left_mono_neg:
  "a < b \<Longrightarrow> c < 0 \<Longrightarrow> 0 < a*b \<Longrightarrow> c / a < c / b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; c < (0::'a); (0::'a) < a * b\<rbrakk> \<Longrightarrow> c / a < c / b
[PROOF STEP]
by (metis local.divide_strict_left_mono local.minus_divide_left local.neg_0_less_iff_less local.neg_less_iff_less mult_commute)


[STATEMENT]
lemma card_face_cycle_sets_da: "Suc (card H.face_cycle_sets) \<ge> (card G.face_cycle_sets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.face_cycle_sets \<le> Suc (card H.face_cycle_sets)
[PROOF STEP]
unfolding card_face_cycle_sets_da'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.face_cycle_sets \<le> Suc (card G.face_cycle_sets - 1 + card ({segment G.face_cycle_succ a a', segment G.face_cycle_succ a' a, {}} - {{}}))
[PROOF STEP]
using card_fcs_gt_0
[PROOF STATE]
proof (prove)
using this:
0 < card G.face_cycle_sets

goal (1 subgoal):
 1. card G.face_cycle_sets \<le> Suc (card G.face_cycle_sets - 1 + card ({segment G.face_cycle_succ a a', segment G.face_cycle_succ a' a, {}} - {{}}))
[PROOF STEP]
by linarith


[STATEMENT]
lemma spmf_Domainp_rel: "Domainp (rel_spmf R) = pred_spmf (Domainp R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp (rel_spmf R) = pred_spmf (Domainp R)
[PROOF STEP]
by(simp add: pmf.Domainp_rel option.Domainp_rel)


[STATEMENT]
lemma vector_space_pair_with_overloaded[ud_with]:
  "vector_space_pair =
    (
      \<lambda>scale\<^sub>1 scale\<^sub>2.
        vector_space_pair_with (+) 0 (-) uminus scale\<^sub>1 (+) 0 (-) uminus scale\<^sub>2
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_space_pair = (\<lambda>scale\<^sub>1. vector_space_pair_with (+) (0::'b) (-) uminus scale\<^sub>1 (+) (0::'c) (-) uminus)
[PROOF STEP]
unfolding vector_space_pair_def vector_space_pair_with_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s1 s2. vector_space s1 \<and> vector_space s2) = (\<lambda>scale\<^sub>1 scale\<^sub>2. vector_space_with (+) (0::'b) (-) uminus scale\<^sub>1 \<and> vector_space_with (+) (0::'c) (-) uminus scale\<^sub>2)
[PROOF STEP]
unfolding vector_space_with_overloaded
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s1 s2. vector_space_with (+) (0::'b) (-) uminus s1 \<and> vector_space_with (+) (0::'c) (-) uminus s2) = (\<lambda>scale\<^sub>1 scale\<^sub>2. vector_space_with (+) (0::'b) (-) uminus scale\<^sub>1 \<and> vector_space_with (+) (0::'c) (-) uminus scale\<^sub>2)
[PROOF STEP]
..


[STATEMENT]
lemma affine_alg_set_subset_zero_set:
  assumes "b \<in> as"
  shows " affine_alg_set R n as \<subseteq> (zero_set R n b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_alg_set R n as \<subseteq> V n b
[PROOF STEP]
using assms affine_alg_set_def
[PROOF STATE]
proof (prove)
using this:
b \<in> as
affine_alg_set ?R ?n ?as = {a \<in> carrier (?R\<^bsup>?n\<^esup>). \<forall>b\<in>?as. a \<in> V\<^bsub>?R\<^esub> ?n b}

goal (1 subgoal):
 1. affine_alg_set R n as \<subseteq> V n b
[PROOF STEP]
by blast


[STATEMENT]
lemma isGlbD2: "isGlb R S x \<Longrightarrow> y \<in> S \<Longrightarrow> y \<ge> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; y \<in> S\<rbrakk> \<Longrightarrow> x \<le> y
[PROOF STEP]
by (blast dest!: isGlbD1 setgeD)


[STATEMENT]
lemma urel64_mod:
assumes x: "urel64 x x'" and y: "urel64 y y'"
shows "urel64 (if y = 0 then x else 0) (if y' = 0 then x' else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel64 (if y = 0 then x else 0) (if y' = 0 then x' else 0)
[PROOF STEP]
unfolding urel64_eq[OF y urel64_0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel64 (if y' = 0 then x else 0) (if y' = 0 then x' else 0)
[PROOF STEP]
using urel64_0 x
[PROOF STATE]
proof (prove)
using this:
urel64 0 0
urel64 x x'

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


[STATEMENT]
lemma integral_return:
  fixes g :: "_ \<Rightarrow> 'a :: {banach, second_countable_topology}"
  assumes "x \<in> space M" "g \<in> borel_measurable M"
  shows "(\<integral>a. g a \<partial>return M x) = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (return M x) g = g x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>L (return M x) g = g x
[PROOF STEP]
interpret prob_space "return M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (return M x)
[PROOF STEP]
by (rule prob_space_return[OF \<open>x \<in> space M\<close>])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
have "(\<integral>a. g a \<partial>return M x) = (\<integral>a. g x \<partial>return M x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation g = expectation (\<lambda>a. g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> space M
g \<in> borel_measurable M

goal (1 subgoal):
 1. expectation g = expectation (\<lambda>a. g x)
[PROOF STEP]
by (intro integral_cong_AE) (auto simp: AE_return)
[PROOF STATE]
proof (state)
this:
expectation g = expectation (\<lambda>a. g x)

goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
expectation g = expectation (\<lambda>a. g x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
expectation g = expectation (\<lambda>a. g x)

goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
using prob_space
[PROOF STATE]
proof (prove)
using this:
expectation g = expectation (\<lambda>a. g x)
prob (space (return M x)) = 1

goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
expectation g = g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_index'_eq_conv[simp]:
  "map_index' i f xs = map_index' j g xs = (\<forall>k < length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_index' i f xs = map_index' j g xs) = (\<forall>k<length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))
[PROOF STEP]
proof (induct xs arbitrary: i j)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j. (map_index' i f [] = map_index' j g []) = (\<forall>k<length []. f (i + k) ([] ! k) = g (j + k) ([] ! k))
 2. \<And>a xs i j. (\<And>i j. (map_index' i f xs = map_index' j g xs) = (\<forall>k<length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))) \<Longrightarrow> (map_index' i f (a # xs) = map_index' j g (a # xs)) = (\<forall>k<length (a # xs). f (i + k) ((a # xs) ! k) = g (j + k) ((a # xs) ! k))
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
(map_index' ?i f xs_ = map_index' ?j g xs_) = (\<forall>k<length xs_. f (?i + k) (xs_ ! k) = g (?j + k) (xs_ ! k))

goal (2 subgoals):
 1. \<And>i j. (map_index' i f [] = map_index' j g []) = (\<forall>k<length []. f (i + k) ([] ! k) = g (j + k) ([] ! k))
 2. \<And>a xs i j. (\<And>i j. (map_index' i f xs = map_index' j g xs) = (\<forall>k<length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))) \<Longrightarrow> (map_index' i f (a # xs) = map_index' j g (a # xs)) = (\<forall>k<length (a # xs). f (i + k) ((a # xs) ! k) = g (j + k) ((a # xs) ! k))
[PROOF STEP]
from Cons(1)[of "Suc i" "Suc j"]
[PROOF STATE]
proof (chain)
picking this:
(map_index' (Suc i) f xs_ = map_index' (Suc j) g xs_) = (\<forall>k<length xs_. f (Suc i + k) (xs_ ! k) = g (Suc j + k) (xs_ ! k))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(map_index' (Suc i) f xs_ = map_index' (Suc j) g xs_) = (\<forall>k<length xs_. f (Suc i + k) (xs_ ! k) = g (Suc j + k) (xs_ ! k))

goal (1 subgoal):
 1. (map_index' i f (a_ # xs_) = map_index' j g (a_ # xs_)) = (\<forall>k<length (a_ # xs_). f (i + k) ((a_ # xs_) ! k) = g (j + k) ((a_ # xs_) ! k))
[PROOF STEP]
by (auto simp: nth_Cons split: nat.splits)
[PROOF STATE]
proof (state)
this:
(map_index' i f (a_ # xs_) = map_index' j g (a_ # xs_)) = (\<forall>k<length (a_ # xs_). f (i + k) ((a_ # xs_) ! k) = g (j + k) ((a_ # xs_) ! k))

goal (1 subgoal):
 1. \<And>i j. (map_index' i f [] = map_index' j g []) = (\<forall>k<length []. f (i + k) ([] ! k) = g (j + k) ([] ! k))
[PROOF STEP]
qed simp


[STATEMENT]
lemma floor_greatest_real: "floor(r::real) = (GREATEST i. i \<le> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>r\<rfloor> = (GREATEST i. real_of_int i \<le> r)
[PROOF STEP]
by (metis Greatest_equality le_floor_iff of_int_floor_le)


[STATEMENT]
lemma Limsup_add_ereal_right:
  "F \<noteq> bot \<Longrightarrow> abs c \<noteq> \<infinity> \<Longrightarrow> Limsup F (\<lambda>n. g n + (c :: ereal)) = Limsup F g + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<noteq> bot; \<bar>c\<bar> \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> Limsup F (\<lambda>n. g n + c) = Limsup F g + c
[PROOF STEP]
by (rule Limsup_compose_continuous_mono) (auto simp: mono_def add_mono continuous_on_def)


[STATEMENT]
lemma approx_mult_HFinite: "a \<approx> b \<Longrightarrow> c \<approx> d \<Longrightarrow> b \<in> HFinite \<Longrightarrow> d \<in> HFinite \<Longrightarrow> a * c \<approx> b * d"
  for a b c d :: "'a::real_normed_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<approx> b; c \<approx> d; b \<in> HFinite; d \<in> HFinite\<rbrakk> \<Longrightarrow> a * c \<approx> b * d
[PROOF STEP]
by (meson approx_HFinite approx_mult2 approx_mult_subst2 approx_sym)


[STATEMENT]
lemma length_eq_card_rows:
  fixes A::"'a^'columns::{mod_type}^'rows::{mod_type}"
  shows "IArray.length (matrix_to_iarray A) = CARD('rows)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (matrix_to_iarray A) = CARD('rows)
[PROOF STEP]
unfolding matrix_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray (map (vec_to_iarray \<circ> ($) A \<circ> mod_type_class.from_nat) [0..<CARD('rows)])) = CARD('rows)
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_to_bv_length_bv_to_nat:
  "length xs = n \<Longrightarrow> xs \<noteq> [] \<Longrightarrow> nat_to_bv_length (bv_to_nat xs) n = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = n; xs \<noteq> []\<rbrakk> \<Longrightarrow> nat_to_bv_length (bv_to_nat xs) n = xs
[PROOF STEP]
apply (simp only: nat_to_bv_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = n; xs \<noteq> []\<rbrakk> \<Longrightarrow> (if length (nat_to_bv (bv_to_nat xs)) \<le> n then bv_extend n \<zero> (nat_to_bv (bv_to_nat xs)) else []) = xs
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; n = length xs\<rbrakk> \<Longrightarrow> bv_extend (length xs) \<zero> (norm_unsigned xs) = xs
[PROOF STEP]
apply (simp add: bv_extend_norm_unsigned)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_scalar_sum_monomials: "q \<odot> p = (\<Sum>t\<in>keys q. monom_mult (lookup q t) t p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<odot> p = (\<Sum>t\<in>keys q. monom_mult (lookup q t) t p)
[PROOF STEP]
by (rule poly_mapping_eqI_proj, simp add: proj_sum mult_scalar_monomial[symmetric]
      sum_distrib_right[symmetric] poly_mapping_sum_monomials term_simps)


[STATEMENT]
lemma nxt_wait:
assumes "ev \<phi> xs"  shows "(nxt ^^ (wait \<phi> xs)) \<phi> xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nxt ^^ wait \<phi> xs) \<phi> xs
[PROOF STEP]
unfolding wait_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nxt ^^ (LEAST n. (nxt ^^ n) \<phi> xs)) \<phi> xs
[PROOF STEP]
using ev_ex_nxt[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. (nxt ^^ n) \<phi> xs

goal (1 subgoal):
 1. (nxt ^^ (LEAST n. (nxt ^^ n) \<phi> xs)) \<phi> xs
[PROOF STEP]
by(rule LeastI_ex)


[STATEMENT]
lemma "permutations_of_set A \<subseteq> n_permutations A (card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_set A \<subseteq> n_permutations A (card A)
[PROOF STEP]
by (simp add: length_finite_permutations_of_set n_permutations_def permutations_of_setD subsetI)


[STATEMENT]
lemma angular_component_p_int_pow:
"angular_component (\<pp> [^] (n::int)) = \<one>\<^bsub>Z\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
apply(cases "n \<ge> 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
 2. \<not> 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
apply (metis angular_component_p_nat_pow int_pow_int nonneg_int_cases)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
using angular_component_p_nat_pow[of "nat (-n)"] angular_component_inv[of "(\<pp> [^] n)"] angular_component_inv[of "\<pp> [^] (nat (-n))"]
[PROOF STATE]
proof (prove)
using this:
angular_component (\<pp> [^] nat (- n)) = \<one>\<^bsub>Z\<^sub>p\<^esub>
\<pp> [^] n \<in> nonzero Q\<^sub>p \<Longrightarrow> angular_component (inv (\<pp> [^] n)) = inv\<^bsub>Z\<^sub>p\<^esub> angular_component (\<pp> [^] n)
\<pp> [^] nat (- n) \<in> nonzero Q\<^sub>p \<Longrightarrow> angular_component (inv (\<pp> [^] nat (- n))) = inv\<^bsub>Z\<^sub>p\<^esub> angular_component (\<pp> [^] nat (- n))

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) Group.nat_pow_0 Zp.inv_one add.inverse_neutral angular_component_one int_nat_eq
      int_pow_def2 nat_0_iff nat_int nat_zminus_int p_natpow_closed(2) )


[STATEMENT]
lemma vrange_iso_is_arr':
  assumes "F : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B"
    and "B' = \<R>\<^sub>\<circ> (F\<lparr>ArrVal\<rparr>)"
    and "\<CC>' = cat_Set \<alpha>"
  shows "vrange_iso F : B' \<mapsto>\<^bsub>\<CC>'\<^esub> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vrange_iso F : B' \<mapsto>\<^bsub>\<CC>'\<^esub> A
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
F : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B

goal (1 subgoal):
 1. vrange_iso F : B' \<mapsto>\<^bsub>\<CC>'\<^esub> A
[PROOF STEP]
unfolding assms(2,3)
[PROOF STATE]
proof (prove)
using this:
F : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B

goal (1 subgoal):
 1. vrange_iso F : \<R>\<^sub>\<circ> (F\<lparr>ArrVal\<rparr>) \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> A
[PROOF STEP]
by (rule vrange_iso_is_arr)


[STATEMENT]
lemma closed_positive_orthant: "closed {x::real^'n. \<forall>i. 0 \<le>x$i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. \<forall>i. 0 \<le> x $ i}
[PROOF STEP]
by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_component)


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

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

goal (1 subgoal):
 1. x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vifintersection_vdoubleton_is[simp]: "(\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>set {i, j}. f i) = f i \<inter>\<^sub>\<circ> f j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> (VLambda (set {i, j}) f `\<^sub>\<circ> set {i, j}) = f i \<inter>\<^sub>\<circ> f j
[PROOF STEP]
by
    (
      intro vsubset_antisym vsubsetI;
      (elim vifintersectionE3 | intro vifintersectionI)
    )
    auto


[STATEMENT]
lemma int_div_same_is_1 [simp]:
  \<open>a div b = a \<longleftrightarrow> b = 1\<close> if \<open>0 < a\<close> for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a div b = a) = (b = 1)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. (a div b = a) = (b = 1)
[PROOF STEP]
by (metis div_by_1 abs_ge_zero abs_of_pos int_div_less_self neq_iff
            nonneg1_imp_zdiv_pos_iff zabs_less_one_iff)


[STATEMENT]
lemma (in proper_design) t_wise_balanceI[intro]: "\<t> \<le> \<v> \<Longrightarrow> \<t> \<ge> 1 \<Longrightarrow>
  (\<And> ps . ps \<subseteq> \<V> \<Longrightarrow> card ps = \<t>  \<Longrightarrow> \<B> index ps = \<Lambda>\<^sub>t) \<Longrightarrow> t_wise_balance \<V> \<B> \<t> \<Lambda>\<^sub>t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<t> \<le> \<v>; 1 \<le> \<t>; \<And>ps. \<lbrakk>ps \<subseteq> \<V>; card ps = \<t>\<rbrakk> \<Longrightarrow> \<B> index ps = \<Lambda>\<^sub>t\<rbrakk> \<Longrightarrow> t_wise_balance \<V> \<B> \<t> \<Lambda>\<^sub>t
[PROOF STEP]
by (unfold_locales) auto


[STATEMENT]
lemma derivation_const_eq_zero: "X (restrict0 carrier (\<lambda>x. c)) = 0"
  if "X \<in> tangent_space p" "p \<in> carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
note scaleR = diff_fun_space.linear_scale[OF _ _ tangent_space_linear_on[OF that(1)]]
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>x. x \<in> diff_fun_space \<longrightarrow> X x \<in> UNIV; ?b \<in> diff_fun_space\<rbrakk> \<Longrightarrow> X (?r *\<^sub>R ?b) = ?r *\<^sub>R X ?b

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
have "X (c *\<^sub>R (restrict0 carrier (\<lambda>x. 1))) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X (c *\<^sub>R restrict0 carrier (\<lambda>x. 1)) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))
[PROOF STEP]
by (rule scaleR) (auto intro!: restrict0_const_diff_fun_space)
[PROOF STATE]
proof (state)
this:
X (c *\<^sub>R restrict0 carrier (\<lambda>x. 1)) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X (c *\<^sub>R restrict0 carrier (\<lambda>x. 1)) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
note derivation_one_eq_zero[OF that]
[PROOF STATE]
proof (state)
this:
X (restrict0 carrier (\<lambda>x. 1)) = 0

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X (restrict0 carrier (\<lambda>x. 1)) = 0

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
note restrict0_scaleR[symmetric]
[PROOF STATE]
proof (state)
this:
?c *\<^sub>R restrict0 ?A ?f = restrict0 ?A (?c *\<^sub>R ?f)

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
X (restrict0 carrier (c *\<^sub>R (\<lambda>a. 1))) = c *\<^sub>R 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X (restrict0 carrier (c *\<^sub>R (\<lambda>a. 1))) = c *\<^sub>R 0

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
by (auto simp: scaleR_fun_def)
[PROOF STATE]
proof (state)
this:
X (restrict0 carrier (\<lambda>x. c)) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma face_of_trans [trans]: "\<lbrakk>S face_of T; T face_of u\<rbrakk> \<Longrightarrow> S face_of u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S face_of T; T face_of u\<rbrakk> \<Longrightarrow> S face_of u
[PROOF STEP]
unfolding face_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T \<and> convex S \<and> (\<forall>a\<in>T. \<forall>b\<in>T. \<forall>x\<in>S. x \<in> open_segment a b \<longrightarrow> a \<in> S \<and> b \<in> S); T \<subseteq> u \<and> convex T \<and> (\<forall>a\<in>u. \<forall>b\<in>u. \<forall>x\<in>T. x \<in> open_segment a b \<longrightarrow> a \<in> T \<and> b \<in> T)\<rbrakk> \<Longrightarrow> S \<subseteq> u \<and> convex S \<and> (\<forall>a\<in>u. \<forall>b\<in>u. \<forall>x\<in>S. x \<in> open_segment a b \<longrightarrow> a \<in> S \<and> b \<in> S)
[PROOF STEP]
by (safe; blast)


[STATEMENT]
lemma image_iff': "(\<forall>x\<in>A. f x \<in> B) = (f ` A \<subseteq> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A. f x \<in> B) = (f ` A \<subseteq> B)
[PROOF STEP]
by auto


[STATEMENT]
lemma psi_conv_pre_mangoldt: "psi n = ln (real (prod pre_mangoldt {1..n}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n = ln (real (prod pre_mangoldt {1..n}))
[PROOF STEP]
by (auto simp: psi_def mangoldt_def pre_mangoldt_def ln_prod primepow_gt_Suc_0 intro!: sum.cong)


[STATEMENT]
lemma set_sel_1_if_notfin1: "\<not>finite X \<Longrightarrow> set_sel f X Y = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite X \<Longrightarrow> set_sel f X Y = 1
[PROOF STEP]
unfolding set_sel_def set_sel_aux_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite X \<Longrightarrow> (\<Prod>x\<in>X. prod (f x) Y) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma index_image: "distinct xs \<Longrightarrow> set xs = X \<Longrightarrow> index xs ` X = {0..<size xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; set xs = X\<rbrakk> \<Longrightarrow> index xs ` X = {0..<length xs}
[PROOF STEP]
by (simp add: bij_betw_imp_surj_on bij_betw_index)


[STATEMENT]
theorem hessenberg_thereom:
  assumes "is_pappus"
  shows "desargues_prop"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. desargues_prop
[PROOF STEP]
by (smt are_perspective_from_line_def assms col_def desargues_prop_def pappus_desargues
      perspective_from_point_desargues_config)


[STATEMENT]
lemma lower_minus[simp]: "lower (minus A B) = minus (lower A) (upper B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower (A - B) = lower A - upper B
[PROOF STEP]
by (auto simp: minus_interval_def)


[STATEMENT]
lemma exec_exec_max: "\<lbrakk>s1 -c1-    n1   \<rightarrow> t1 ; s2 -c2-       n2\<rightarrow> t2\<rbrakk> \<Longrightarrow>
                       s1 -c1-max n1 n2\<rightarrow> t1 \<and> s2 -c2-max n1 n2\<rightarrow> t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s1 -c1-n1\<rightarrow> t1; s2 -c2-n2\<rightarrow> t2\<rbrakk> \<Longrightarrow> s1 -c1-max n1 n2\<rightarrow> t1 \<and> s2 -c2-max n1 n2\<rightarrow> t2
[PROOF STEP]
by (fast intro: exec_mono max.cobounded1 max.cobounded2)


[STATEMENT]
lemma word_mult_less_iff:
  fixes i :: "'a :: len word"
  assumes knz: "0 < k"
  and     uik: "unat i * unat k < 2 ^ len_of TYPE ('a)"
  and     ujk: "unat j * unat k < 2 ^ len_of TYPE ('a)"
  shows  "(i * k < j * k) = (i < j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i * k < j * k) = (i < j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < k
unat i * unat k < 2 ^ LENGTH('a)
unat j * unat k < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. (i * k < j * k) = (i < j)
[PROOF STEP]
by (rule word_mult_less_cancel)


[STATEMENT]
lemma of_hypnat_le_iff [simp]:
  "\<And>m n. of_hypnat m \<le> (of_hypnat n::'a::linordered_semidom star) \<longleftrightarrow> m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. (of_hypnat m \<le> of_hypnat n) = (m \<le> n)
[PROOF STEP]
by transfer (rule of_nat_le_iff)


[STATEMENT]
lemma leadsETo_Union_distrib:
     "F \<in> (\<Union>S) leadsTo[CC] B  =  (\<forall>A\<in>S. F \<in> A leadsTo[CC] B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<in> \<Union> S leadsTo[CC] B) = (\<forall>A\<in>S. F \<in> A leadsTo[CC] B)
[PROOF STEP]
by (blast intro: leadsETo_Union leadsETo_weaken_L)


[STATEMENT]
lemma borel_measurable_halfspacesI:
  fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
  assumes F: "borel = sigma UNIV (F ` (UNIV \<times> Basis))"
  and S_eq: "\<And>a i. S a i = f -` F (a,i) \<inter> space M"
  shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a::real. S a i \<in> sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> borel_measurable M) = (\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i a. \<lbrakk>f \<in> borel_measurable M; i \<in> Basis\<rbrakk> \<Longrightarrow> S a i \<in> sets M
 2. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
fix a :: real and i :: 'b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i a. \<lbrakk>f \<in> borel_measurable M; i \<in> Basis\<rbrakk> \<Longrightarrow> S a i \<in> sets M
 2. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
assume i: "i \<in> Basis" and f: "f \<in> borel_measurable M"
[PROOF STATE]
proof (state)
this:
i \<in> Basis
f \<in> borel_measurable M

goal (2 subgoals):
 1. \<And>i a. \<lbrakk>f \<in> borel_measurable M; i \<in> Basis\<rbrakk> \<Longrightarrow> S a i \<in> sets M
 2. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> Basis
f \<in> borel_measurable M
[PROOF STEP]
show "S a i \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis
f \<in> borel_measurable M

goal (1 subgoal):
 1. S a i \<in> sets M
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis
f \<in> M \<rightarrow>\<^sub>M sigma UNIV (F ` (UNIV \<times> Basis))

goal (1 subgoal):
 1. f -` F (a, i) \<inter> space M \<in> sets M
[PROOF STEP]
by (auto intro!: measurable_sets simp: assms(1))
[PROOF STATE]
proof (state)
this:
S a i \<in> sets M

goal (1 subgoal):
 1. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
assume a: "\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M

goal (1 subgoal):
 1. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M
[PROOF STEP]
show "f \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M

goal (1 subgoal):
 1. f \<in> borel_measurable M
[PROOF STEP]
by (auto intro!: measurable_measure_of simp: S_eq F)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simple_ports_conjunct_correct:
    "simple_match_port p1 pkt \<and> simple_match_port p2 pkt \<longleftrightarrow> simple_match_port (simpl_ports_conjunct p1 p2) pkt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (simple_match_port p1 pkt \<and> simple_match_port p2 pkt) = simple_match_port (simpl_ports_conjunct p1 p2) pkt
[PROOF STEP]
apply(cases p1, cases p2, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>p1 = (a, b); p2 = (aa, ba)\<rbrakk> \<Longrightarrow> (a \<le> pkt \<and> pkt \<le> b \<and> aa \<le> pkt \<and> pkt \<le> ba) = (a \<le> pkt \<and> aa \<le> pkt \<and> pkt \<le> b \<and> pkt \<le> ba)
[PROOF STEP]
by blast


[STATEMENT]
lemma mk_triangle_from_ss_edges:
assumes "(x, y) \<in> all_edges_between X Y" and "(x, z) \<in> all_edges_between X Z" and "(y, z) \<in> all_edges_between Y Z"
shows "(triangle_in_graph x y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. triangle_in_graph x y z
[PROOF STEP]
by (meson all_edges_betw_D3 assms triangle_in_graph_def)


[STATEMENT]
lemma  tickFree_rev : "tickFree(rev t) = (tickFree t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tickFree (rev t) = tickFree t
[PROOF STEP]
by(simp  add: tickFree_def member_def)


[STATEMENT]
theorem wls_vsubstAbs_simp[simp]:
assumes "wls s X" and
        "xs \<noteq> ys \<or> x \<notin> {y,y1}"
shows "((Abs xs x X) $[y1 // y]_ys) = Abs xs x (X #[y1 // y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs xs x X $[y1 // y]_ys = Abs xs x (X #[y1 // y]_ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
xs \<noteq> ys \<or> x \<notin> {y, y1}

goal (1 subgoal):
 1. Abs xs x X $[y1 // y]_ys = Abs xs x (X #[y1 // y]_ys)
[PROOF STEP]
unfolding vsubst_def vsubstAbs_def
[PROOF STATE]
proof (prove)
using this:
wls s X
xs \<noteq> ys \<or> x \<notin> {y, y1}

goal (1 subgoal):
 1. Abs xs x X $[Var ys y1 / y]_ys = Abs xs x (X #[Var ys y1 / y]_ys)
[PROOF STEP]
by simp


[STATEMENT]
lemma continuous_on_eq_continuous_at: "open s \<Longrightarrow> continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. isCont f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open s \<Longrightarrow> continuous_on s f = (\<forall>x\<in>s. isCont f x)
[PROOF STEP]
by (simp add: continuous_on_def continuous_at at_within_open[of _ s])


[STATEMENT]
lemma unit_disc_fix_conjugate_comp_moebius [simp]:
  assumes "unit_disc_fix M"
  shows "unit_disc_fix_f (conjugate \<circ> moebius_pt M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix_f (conjugate \<circ> moebius_pt M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M

goal (1 subgoal):
 1. unit_disc_fix_f (conjugate \<circ> moebius_pt M)
[PROOF STEP]
apply (subst conjugate_moebius)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix M \<Longrightarrow> unit_disc_fix_f (moebius_pt (conjugate_moebius M) \<circ> conjugate)
[PROOF STEP]
apply (simp add: unit_disc_fix_f_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix M \<Longrightarrow> \<exists>Ma. unit_disc_fix Ma \<and> (moebius_pt (conjugate_moebius M) \<circ> conjugate = moebius_pt Ma \<or> moebius_pt (conjugate_moebius M) \<circ> conjugate = moebius_pt Ma \<circ> conjugate)
[PROOF STEP]
apply (rule_tac x="conjugate_moebius M" in exI, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma twice_field_differentiable_at_polyn [simp, intro]:
  fixes coef :: "nat \<Rightarrow> 'a :: {real_normed_field}"
    and n :: nat
  shows "(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x
 2. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x
 2. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x

goal (1 subgoal):
 1. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
case hyp: (Suc n)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x

goal (1 subgoal):
 1. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
proof (simp, rule twice_field_differentiable_at_add)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x
 2. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
show "(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
by (rule hyp)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x

goal (1 subgoal):
 1. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
show "(\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
using twice_field_differentiable_at_compose[of "\<lambda>x. x ^ n" x "(*) (coef n)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>x. x ^ n) twice_field_differentiable_at x; (*) (coef n) twice_field_differentiable_at x ^ n\<rbrakk> \<Longrightarrow> (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x

goal (1 subgoal):
 1. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_Pair2:
  assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" and x: "x \<in> space M1"
  shows "(\<lambda>y. f (x, y)) \<in> measurable M2 M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. f (x, y)) \<in> M2 \<rightarrow>\<^sub>M M
[PROOF STEP]
using measurable_comp[OF measurable_Pair1' f, OF x]
[PROOF STATE]
proof (prove)
using this:
f \<circ> Pair x \<in> M2 \<rightarrow>\<^sub>M M

goal (1 subgoal):
 1. (\<lambda>y. f (x, y)) \<in> M2 \<rightarrow>\<^sub>M M
[PROOF STEP]
by (simp add: comp_def)


[STATEMENT]
theorem weak_Nullstellensatz:
  assumes "finite X" and "F \<subseteq> P[X]" and "\<V> F = ({}::(_ \<Rightarrow> _::alg_closed_field) set)"
  shows "ideal F = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
from assms(1, 2)
[PROOF STATE]
proof (chain)
picking this:
finite X
F \<subseteq> P[X]
[PROOF STEP]
have "\<I> (\<V> F) = \<surd>ideal F"
[PROOF STATE]
proof (prove)
using this:
finite X
F \<subseteq> P[X]

goal (1 subgoal):
 1. \<I> (\<V> F) = \<surd>ideal F
[PROOF STEP]
by (rule strong_Nullstellensatz)
[PROOF STATE]
proof (state)
this:
\<I> (\<V> F) = \<surd>ideal F

goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<I> (\<V> F) = \<surd>ideal F

goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
by (simp add: assms(3) flip: radical_ideal_eq_UNIV_iff)
[PROOF STATE]
proof (state)
this:
ideal F = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem LFP_least:
  assumes "f u = u"
  shows "smaller_interp (LFP f) u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smaller_interp (LFP f) u
[PROOF STEP]
by (simp add: DD_def assms smaller_interp_DD smaller_interp_refl)


[STATEMENT]
lemma sym : "setinterleaving(s, X, t)= setinterleaving(t, X, s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. setinterleaving (s, X, t) = setinterleaving (t, X, s)
[PROOF STEP]
by (rule setinterleaving.induct[of "\<lambda>(s,X,t). setinterleaving (s, X, t)
  = setinterleaving (t, X, s)" "(s, X, t)", simplified], auto)


[STATEMENT]
lemma zero_om [simp]: "0\<^sup>\<omega> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a)\<^sup>\<omega> = (0::'a)
[PROOF STEP]
by (metis local.s_prod_annil om_unfold_eq)


[STATEMENT]
lemma ex_eqaa:
  assumes "\<exists> A B C. (A B C AngAcute a1 \<and> A B C AngAcute a2)"
  shows "a1 = a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a1 = a2
[PROOF STEP]
using all_eqa assms is_anga_to_is_ang
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A ?B ?C Ang ?a1.0; ?A ?B ?C Ang ?a2.0\<rbrakk> \<Longrightarrow> ?a1.0 = ?a2.0
\<exists>A B C. A B C AngAcute a1 \<and> A B C AngAcute a2
?A ?B ?C AngAcute ?a \<Longrightarrow> ?A ?B ?C Ang ?a

goal (1 subgoal):
 1. a1 = a2
[PROOF STEP]
by blast


[STATEMENT]
lemma homeomorphic_ENR_iff_ENR:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "S homeomorphic T"
    shows "ENR S \<longleftrightarrow> ENR T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ENR S = ENR T
[PROOF STEP]
by (meson ENR_homeomorphic_ENR assms homeomorphic_sym)


[STATEMENT]
lemma degree_One_pdevs[simp]: "degree (One_pdevs::'a pdevs) =
    length (Basis_list::'a::executable_euclidean_space list)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree One_pdevs = length Basis_list
[PROOF STEP]
by (auto simp: degree_eq_Suc_max Basis_list_nth_nonzero Max_Collect_less_nat
      intro!: Max_eqI DIM_positive)


[STATEMENT]
lemma card_sumset_0_iff': "card (sumset A B) = 0 \<longleftrightarrow> card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
proof (cases "infinite (A \<inter> G) \<or> infinite (B \<inter> G)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. infinite (A \<inter> G) \<or> infinite (B \<inter> G) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
 2. \<not> (infinite (A \<inter> G) \<or> infinite (B \<inter> G)) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
infinite (A \<inter> G) \<or> infinite (B \<inter> G)

goal (2 subgoals):
 1. infinite (A \<inter> G) \<or> infinite (B \<inter> G) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
 2. \<not> (infinite (A \<inter> G) \<or> infinite (B \<inter> G)) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite (A \<inter> G) \<or> infinite (B \<inter> G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (A \<inter> G) \<or> infinite (B \<inter> G)

goal (1 subgoal):
 1. (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
by (metis card_eq_0_iff infinite_sumset_iff sumset_empty')
[PROOF STATE]
proof (state)
this:
(card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)

goal (1 subgoal):
 1. \<not> (infinite (A \<inter> G) \<or> infinite (B \<inter> G)) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
qed (auto simp: sumset_eq)


[STATEMENT]
lemma max_of_list_append [simp]:
  "max_of_list (xs @ ys) = max (max_of_list xs) (max_of_list ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_of_list (xs @ ys) = max (max_of_list xs) (max_of_list ys)
[PROOF STEP]
apply (simp add: max_of_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr max xs (foldr max ys 0) = max (foldr max xs 0) (foldr max ys 0)
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. foldr max [] (foldr max ys 0) = max (foldr max [] 0) (foldr max ys 0)
 2. \<And>a xs. foldr max xs (foldr max ys 0) = max (foldr max xs 0) (foldr max ys 0) \<Longrightarrow> foldr max (a # xs) (foldr max ys 0) = max (foldr max (a # xs) 0) (foldr max ys 0)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma matrix_to_blinfun_scaleR:
  "matrix_to_blinfun (c *\<^sub>R (f :: real^_^_)) = c *\<^sub>R matrix_to_blinfun f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_blinfun (c *\<^sub>R f) = c *\<^sub>R matrix_to_blinfun f
[PROOF STEP]
by (auto intro!: blinfun_eqI simp: matrix_to_blinfun_mult blinfun.scaleR_left
      matrix_vector_mult_add_rdistrib scaleR_matrix_vector_assoc[symmetric])


[STATEMENT]
lemma nlistToTree_inv:
  "\<forall> x \<in> set nl. is_measured_node x \<Longrightarrow> is_measured_ftree (nlistToTree nl)"
  "\<forall> x \<in> set nl. is_leveln_node n x \<Longrightarrow> is_leveln_ftree n (nlistToTree nl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set nl. is_measured_node x \<Longrightarrow> is_measured_ftree (nlistToTree nl)) &&& (\<forall>x\<in>set nl. is_leveln_node n x \<Longrightarrow> is_leveln_ftree n (nlistToTree nl))
[PROOF STEP]
by (unfold nlistToTree_def, induct nl, auto simp add: nlcons_invmeas)
     (induct nl, auto simp add: nlcons_invlevel)


[STATEMENT]
lemma append_one_genPrefix:
     "[| (xs,ys) \<in> genPrefix r;  length xs < length ys;  refl r |]
      ==> (xs @ [ys ! length xs], ys) \<in> genPrefix r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(xs, ys) \<in> genPrefix r; length xs < length ys; refl r\<rbrakk> \<Longrightarrow> (xs @ [ys ! length xs], ys) \<in> genPrefix r
[PROOF STEP]
by (blast intro: aolemma [THEN mp])


[STATEMENT]
lemma dg_prod_ArrE:
  assumes "f \<in>\<^sub>\<circ> (\<Prod>\<^sub>D\<^sub>Gi\<in>\<^sub>\<circ>I. \<AA> i)\<lparr>Arr\<rparr>"
  obtains "vsv f" and "\<D>\<^sub>\<circ> f = I" and "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>vsv f; \<D>\<^sub>\<circ> f = I; \<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in>\<^sub>\<circ> dg_prod I \<AA>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<lbrakk>vsv f; \<D>\<^sub>\<circ> f = I; \<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest: dg_prod_ArrD)


[STATEMENT]
lemma not_prime_imp_ex_prod_nat:
  assumes "m > 1" "\<not> prime (m::nat)"
  shows   "\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
[PROOF STEP]
have "\<not>Factorial_Ring.irreducible m"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m

goal (1 subgoal):
 1. \<not> comm_semiring_1_class.irreducible m
[PROOF STEP]
by (simp flip: prime_elem_iff_irreducible)
[PROOF STATE]
proof (state)
this:
\<not> comm_semiring_1_class.irreducible m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
\<not> comm_semiring_1_class.irreducible m
[PROOF STEP]
obtain n k where nk: "m = n * k" "n \<noteq> 1" "k \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
\<not> comm_semiring_1_class.irreducible m

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>m = n * k; n \<noteq> 1; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: Factorial_Ring.irreducible_def)
[PROOF STATE]
proof (state)
this:
m = n * k
n \<noteq> 1
k \<noteq> 1

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m = n * k
n \<noteq> 1
k \<noteq> 1

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from this assms
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < m
\<not> prime m
[PROOF STEP]
have "n > 0" "k > 0"
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < m
\<not> prime m

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with nk
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
0 < n
0 < k
[PROOF STEP]
have "n > 1" "k > 1"
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
0 < n
0 < k

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < n
1 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
1 < n
1 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from assms nk
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
m = n * k
n \<noteq> 1
k \<noteq> 1
[PROOF STEP]
have "n dvd m" "k dvd m"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
m = n * k
n \<noteq> 1
k \<noteq> 1

goal (1 subgoal):
 1. n dvd m &&& k dvd m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n dvd m
k dvd m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
n dvd m
k dvd m
[PROOF STEP]
have "n \<le> m" "k \<le> m"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
n dvd m
k dvd m

goal (1 subgoal):
 1. n \<le> m &&& k \<le> m
[PROOF STEP]
by (auto intro!: dvd_imp_le)
[PROOF STATE]
proof (state)
this:
n \<le> m
k \<le> m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n \<le> m
k \<le> m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk \<open>n > 1\<close> \<open>k > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k
[PROOF STEP]
have "n \<noteq> m" "k \<noteq> m"
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k

goal (1 subgoal):
 1. n \<noteq> m &&& k \<noteq> m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n \<noteq> m
k \<noteq> m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n \<le> m
k \<le> m
n \<noteq> m
k \<noteq> m
[PROOF STEP]
have "n < m" "k < m"
[PROOF STATE]
proof (prove)
using this:
n \<le> m
k \<le> m
n \<noteq> m
k \<noteq> m

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k
n < m
k < m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_mult_vec_mat[simp]: "j < dim_col A \<Longrightarrow> (v \<^sub>v* A) $ j = v \<bullet> col A j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < dim_col A \<Longrightarrow> (v \<^sub>v* A) $ j = v \<bullet> col A j
[PROOF STEP]
by (auto simp: mult_vec_mat_def)


[STATEMENT]
lemma nat_card_le_Max: "card (A::nat set) \<le> Suc (Max A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A \<le> Suc (Max A)
[PROOF STEP]
apply (case_tac "finite A")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite A \<Longrightarrow> card A \<le> Suc (Max A)
 2. infinite A \<Longrightarrow> card A \<le> Suc (Max A)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infinite A \<Longrightarrow> card A \<le> Suc (Max A)
 2. finite A \<Longrightarrow> card A \<le> Suc (Max A)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> card A \<le> Suc (Max A)
[PROOF STEP]
apply (cut_tac card_mono[OF finite_atMost, of A "Max A"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; card A \<le> card {..Max A}\<rbrakk> \<Longrightarrow> card A \<le> Suc (Max A)
 2. finite A \<Longrightarrow> A \<subseteq> {..Max A}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> A \<subseteq> {..Max A}
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_unit_gauss_cnj_iff [simp]: "gauss_cnj z dvd 1 \<longleftrightarrow> z dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (gauss_cnj z dvd 1) = (z dvd 1)
[PROOF STEP]
by (simp add: is_unit_gauss_int_iff')


[STATEMENT]
lemma is_unifier_alt:
  assumes "finite AA"
  shows "is_unifier \<sigma> AA \<longleftrightarrow> (\<forall>A \<in> AA. \<forall>B \<in> AA. A \<cdot>a \<sigma> = B \<cdot>a \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unifier \<sigma> AA = (\<forall>A\<in>AA. \<forall>B\<in>AA. A \<cdot>a \<sigma> = B \<cdot>a \<sigma>)
[PROOF STEP]
unfolding is_unifier_def subst_atms_def card_le_one_alt[OF finite_imageI[OF assms(1)]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>A. A \<cdot>a \<sigma>) ` AA = {} \<or> (\<exists>x. (\<lambda>A. A \<cdot>a \<sigma>) ` AA = {x})) = (\<forall>A\<in>AA. \<forall>B\<in>AA. A \<cdot>a \<sigma> = B \<cdot>a \<sigma>)
[PROOF STEP]
by (rule iffI, metis empty_iff insert_iff insert_image, blast)


[STATEMENT]
lemma token_run_merge:
  "\<lbrakk>x \<le> n; y \<le> n; token_run x n = token_run y n\<rbrakk> \<Longrightarrow> token_run x (n + m) = token_run y (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> n; y \<le> n; token_run x n = token_run y n\<rbrakk> \<Longrightarrow> token_run x (n + m) = token_run y (n + m)
[PROOF STEP]
using token_run_merge_Suc[of x _ y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<le> ?n; y \<le> ?n; token_run x ?n = token_run y ?n\<rbrakk> \<Longrightarrow> token_run x (Suc ?n) = token_run y (Suc ?n)

goal (1 subgoal):
 1. \<lbrakk>x \<le> n; y \<le> n; token_run x n = token_run y n\<rbrakk> \<Longrightarrow> token_run x (n + m) = token_run y (n + m)
[PROOF STEP]
by (induction m) auto


[STATEMENT]
lemma gkernTr2:"\<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> gker\<^bsub>F,G\<^esub> f; y \<in> gker\<^bsub>F,G\<^esub> f\<rbrakk>
   \<Longrightarrow> (x \<cdot>\<^bsub>F\<^esub> y) \<in> gker\<^bsub>F,G\<^esub> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> gker\<^bsub>F,G\<^esub> f; y \<in> gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> x \<cdot>\<^bsub>F\<^esub> y \<in> gker\<^bsub>F,G\<^esub> f
[PROOF STEP]
apply (simp add:gkernel_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F \<and> f x = \<one>\<^bsub>G\<^esub>; y \<in> carrier F \<and> f y = \<one>\<^bsub>G\<^esub>\<rbrakk> \<Longrightarrow> x \<cdot>\<^bsub>F\<^esub> y \<in> carrier F \<and> f (x \<cdot>\<^bsub>F\<^esub> y) = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (simp add:gHom, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; f x = \<one>\<^bsub>G\<^esub>; y \<in> carrier F; f y = \<one>\<^bsub>G\<^esub>\<rbrakk> \<Longrightarrow> x \<cdot>\<^bsub>F\<^esub> y \<in> carrier F \<and> \<one>\<^bsub>G\<^esub> \<cdot>\<^bsub>G\<^esub> \<one>\<^bsub>G\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (simp add:Group.mult_closed,
       frule Group.unit_closed[of "G"],
       simp add:Group.l_unit[of "G"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arb_finite_subset: "finite Y \<Longrightarrow> \<exists>X :: 'a set. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
assume fin: "finite Y"
[PROOF STATE]
proof (state)
this:
finite Y

goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite Y
[PROOF STEP]
obtain X where "X \<subseteq> UNIV - Y" "finite X" "n \<le> card X"
[PROOF STATE]
proof (prove)
using this:
finite Y

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>X \<subseteq> UNIV - Y; finite X; n \<le> card X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using infinite_UNIV
[PROOF STATE]
proof (prove)
using this:
finite Y
infinite UNIV

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>X \<subseteq> UNIV - Y; finite X; n \<le> card X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Compl_eq_Diff_UNIV finite_compl infinite_arbitrarily_large order_refl)
[PROOF STATE]
proof (state)
this:
X \<subseteq> UNIV - Y
finite X
n \<le> card X

goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> UNIV - Y
finite X
n \<le> card X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> UNIV - Y
finite X
n \<le> card X

goal (1 subgoal):
 1. \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_ge_right: assumes x: "x \<in> carrier R" and y: "y \<in> carrier R" shows "Max x y \<succeq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max x y \<succeq> y
[PROOF STEP]
by (unfold max_comm[OF x y], rule max_ge[OF y x])


[STATEMENT]
lemma HNatInfinite_FreeUltrafilterNat_iff:
  "(star_n X \<in> HNatInfinite) = (\<forall>u. eventually (\<lambda>n. u < X n) \<U>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_n X \<in> HNatInfinite) = (\<forall>u. \<forall>\<^sub>F n in \<U>. u < X n)
[PROOF STEP]
by (rule iffI [OF HNatInfinite_FreeUltrafilterNat FreeUltrafilterNat_HNatInfinite])


[STATEMENT]
lemma linf_norm_vec_of_list:
  "\<parallel>vec_of_list xs\<parallel>\<^sub>\<infinity> = max_list (map abs xs @ [0])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>vec_of_list xs\<parallel>\<^sub>\<infinity> = Missing_Lemmas.max_list (map abs xs @ [0::'a])
[PROOF STEP]
by (simp add: linf_norm_vec_def)


[STATEMENT]
lemma sum_pos: "finite M \<Longrightarrow> \<forall>x\<in>M. 0 \<le> f x \<Longrightarrow> y \<in> M \<Longrightarrow> 0 < (f y::_::ordered_comm_monoid_add) \<Longrightarrow> 0 < (\<Sum>x\<in>M. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite M; \<forall>x\<in>M. (0::'b) \<le> f x; y \<in> M; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f M
[PROOF STEP]
proof (induct M rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>x\<in>{}. (0::'b) \<le> f x; y \<in> {}; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{}. (0::'b) \<le> f x
y \<in> {}
(0::'b) < f y

goal (2 subgoals):
 1. \<lbrakk>\<forall>x\<in>{}. (0::'b) \<le> f x; y \<in> {}; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{}. (0::'b) \<le> f x
y \<in> {}
(0::'b) < f y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{}. (0::'b) \<le> f x
y \<in> {}
(0::'b) < f y

goal (1 subgoal):
 1. (0::'b) < sum f {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'b) < sum f {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F
\<forall>x\<in>insert x F. (0::'b) \<le> f x
y \<in> insert x F
(0::'b) < f y

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
\<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F
\<forall>x\<in>insert x F. (0::'b) \<le> f x
y \<in> insert x F
(0::'b) < f y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F
\<forall>x\<in>insert x F. (0::'b) \<le> f x
y \<in> insert x F
(0::'b) < f y

goal (1 subgoal):
 1. (0::'b) < sum f (insert x F)
[PROOF STEP]
by (cases "0 < f x") (auto intro: sum_nonneg add_pos_nonneg add_nonneg_pos)
[PROOF STATE]
proof (state)
this:
(0::'b) < sum f (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma consistent_prv_eql_tms_times_rev:
assumes "consistent" "prv (eql (tms (Num m) (Num n)) (Num k))"
shows "k = m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = m * n
[PROOF STEP]
by (metis Num assms consistent_def eql not_times_prv_neg_eql_tms num tms prv_neg_fls subsetCE)


[STATEMENT]
lemma exp_less_mono:
  fixes x y :: real
  assumes "x < y"
  shows "exp x < exp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
from \<open>x < y\<close>
[PROOF STATE]
proof (chain)
picking this:
x < y
[PROOF STEP]
have "0 < y - x"
[PROOF STATE]
proof (prove)
using this:
x < y

goal (1 subgoal):
 1. 0 < y - x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < y - x

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < y - x
[PROOF STEP]
have "1 < exp (y - x)"
[PROOF STATE]
proof (prove)
using this:
0 < y - x

goal (1 subgoal):
 1. 1 < exp (y - x)
[PROOF STEP]
by (rule exp_gt_one)
[PROOF STATE]
proof (state)
this:
1 < exp (y - x)

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < exp (y - x)
[PROOF STEP]
have "1 < exp y / exp x"
[PROOF STATE]
proof (prove)
using this:
1 < exp (y - x)

goal (1 subgoal):
 1. 1 < exp y / exp x
[PROOF STEP]
by (simp only: exp_diff)
[PROOF STATE]
proof (state)
this:
1 < exp y / exp x

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < exp y / exp x
[PROOF STEP]
show "exp x < exp y"
[PROOF STATE]
proof (prove)
using this:
1 < exp y / exp x

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp x < exp y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma flow0_path_connected_time:
  assumes "ts \<subseteq> existence_ivl0 x" "path_connected ts"
  shows "path_connected (flow0 x ` ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
have "continuous_on ts (flow0 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ts (flow0 x)
[PROOF STEP]
by (meson assms continuous_on_sequentially flow_continuous_on subsetD)
[PROOF STATE]
proof (state)
this:
continuous_on ts (flow0 x)

goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
from path_connected_continuous_image[OF this assms(2)]
[PROOF STATE]
proof (chain)
picking this:
path_connected (flow0 x ` ts)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path_connected (flow0 x ` ts)

goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
path_connected (flow0 x ` ts)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prodinf_finite:
  assumes N: "finite N"
    and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 1"
  shows "prodinf f = (\<Prod>n\<in>N. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prodinf f = prod f N
[PROOF STEP]
using has_prod_finite[OF assms, THEN has_prod_unique]
[PROOF STATE]
proof (prove)
using this:
(\<And>n. n \<notin> N \<Longrightarrow> ?n2 n \<notin> N) \<Longrightarrow> (\<Prod>n\<in>N. f (?n2 n)) = (\<Prod>n. f (?n2 n))

goal (1 subgoal):
 1. prodinf f = prod f N
[PROOF STEP]
by simp


[STATEMENT]
lemma fin_dim[simp]: "fin_dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_dim
[PROOF STEP]
unfolding fin_dim_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A. finite A \<and> A \<subseteq> carrier_vec n \<and> local.span A = carrier_vec n
[PROOF STEP]
apply (intro eqTrueI exI conjI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite ?A
 2. ?A \<subseteq> carrier_vec n
 3. local.span ?A = carrier_vec n
[PROOF STEP]
using span_unit_vecs_is_carrier unit_vecs_carrier
[PROOF STATE]
proof (prove)
using this:
local.span (set (unit_vecs n)) = carrier_vec n
set (unit_vecs ?n) \<subseteq> carrier_vec ?n

goal (3 subgoals):
 1. finite ?A
 2. ?A \<subseteq> carrier_vec n
 3. local.span ?A = carrier_vec n
[PROOF STEP]
by auto


[STATEMENT]
lemma int_of_rat_0[simp]:"int_of_rat 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_rat 0 = 0
[PROOF STEP]
by (metis id_apply int_of_rat_id o_def of_int_0)


[STATEMENT]
lemma idiv_imod_equality: "(m::enat) div n * n + m mod n + k = m + k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m div n * n + m mod n + k = m + k
[PROOF STEP]
by (case_tac m, simp_all) (case_tac n, simp_all)


[STATEMENT]
lemma splitDigit_inv:
  "\<lbrakk>
  \<And>(a::'a) (b::'a). p a \<Longrightarrow> p (a + b);
  \<not> p i;
  is_measured_digit d;
  is_leveln_digit n d;
  p (i + gmd (d ::('e,'a::monoid_add) Digit));
  splitDigit p i d = (l, nd, r)
  \<rbrakk> \<Longrightarrow>
  \<not> p (i + (gmnl l))
  \<and>
  p (i + (gmnl l) + (gmn nd))
  \<and>
  (\<forall> x \<in> set l. (is_measured_node x \<and> is_leveln_node n x))
  \<and>
  (\<forall> x \<in> set r. (is_measured_node x \<and> is_leveln_node n x))
  \<and>
  (is_measured_node nd \<and> is_leveln_node n nd )
  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
fix p i d n l nd r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
assume assms: "\<And>a b. p a \<Longrightarrow> p (a + b)" "\<not> p i" "is_measured_digit d"
    "p (i + gmd d)" "splitDigit p i d = (l, nd, r)"
    "is_leveln_digit n d"
[PROOF STATE]
proof (state)
this:
p ?a \<Longrightarrow> p (?a + ?b)
\<not> p i
is_measured_digit d
p (i + gmd d)
splitDigit p i d = (l, nd, r)
is_leveln_digit n d

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
from assms(3, 4)
[PROOF STATE]
proof (chain)
picking this:
is_measured_digit d
p (i + gmd d)
[PROOF STEP]
have v1: "p (i + gmnl (digitToNlist d))"
[PROOF STATE]
proof (prove)
using this:
is_measured_digit d
p (i + gmd d)

goal (1 subgoal):
 1. p (i + gmnl (digitToNlist d))
[PROOF STEP]
by (simp add: gmnl_gmd)
[PROOF STATE]
proof (state)
this:
p (i + gmnl (digitToNlist d))

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
note snc = splitNlist_correct [of p i "digitToNlist d" l nd r]
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; p (i + gmnl (digitToNlist d)); splitNlist p i (digitToNlist d) = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
from assms(5)
[PROOF STATE]
proof (chain)
picking this:
splitDigit p i d = (l, nd, r)
[PROOF STEP]
have v2: "splitNlist p i (digitToNlist d) = (l, nd, r)"
[PROOF STATE]
proof (prove)
using this:
splitDigit p i d = (l, nd, r)

goal (1 subgoal):
 1. splitNlist p i (digitToNlist d) = (l, nd, r)
[PROOF STEP]
by (simp add: splitDigit_def)
[PROOF STATE]
proof (state)
this:
splitNlist p i (digitToNlist d) = (l, nd, r)

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
note snc1 = snc[OF assms(1) assms(2) v1 v2]
[PROOF STATE]
proof (state)
this:
(\<And>a b. p a \<Longrightarrow> p a) \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
hence v3: "\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and>
             digitToNlist d = l @ nd # r"
[PROOF STATE]
proof (prove)
using this:
(\<And>a b. p a \<Longrightarrow> p a) \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
from assms(3,6)
[PROOF STATE]
proof (chain)
picking this:
is_measured_digit d
is_leveln_digit n d
[PROOF STEP]
have
    v4:" \<forall> x \<in> set (digitToNlist d). is_measured_node x"
    " \<forall> x \<in> set (digitToNlist d). is_leveln_node n x"
[PROOF STATE]
proof (prove)
using this:
is_measured_digit d
is_leveln_digit n d

goal (1 subgoal):
 1. \<forall>x\<in>set (digitToNlist d). is_measured_node x &&& \<forall>x\<in>set (digitToNlist d). is_leveln_node n x
[PROOF STEP]
by(auto simp add: digitToNlist_inv)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set (digitToNlist d). is_measured_node x
\<forall>x\<in>set (digitToNlist d). is_leveln_node n x

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
with v3
[PROOF STATE]
proof (chain)
picking this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set (digitToNlist d). is_measured_node x
\<forall>x\<in>set (digitToNlist d). is_leveln_node n x
[PROOF STEP]
have v5: "\<forall> x \<in> set l. (is_measured_node x \<and> is_leveln_node n x)"
    "\<forall> x \<in> set r. (is_measured_node x \<and> is_leveln_node n x)"
    "is_measured_node nd \<and> is_leveln_node n nd"
[PROOF STATE]
proof (prove)
using this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set (digitToNlist d). is_measured_node x
\<forall>x\<in>set (digitToNlist d). is_leveln_node n x

goal (1 subgoal):
 1. \<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x &&& \<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x &&& is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
with v3 v5
[PROOF STATE]
proof (chain)
picking this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
show
    "\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and>
    (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and>
    (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and>
    is_measured_node nd \<and> is_leveln_node n nd"
[PROOF STATE]
proof (prove)
using this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd

goal (1 subgoal):
 1. \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma atoms_pltl_AND [simp]:
  assumes fin: "finite (\<Phi>::'a pltl set)"
  shows "atoms_pltl (AND \<Phi>) = (\<Union>\<phi>\<in>\<Phi>. atoms_pltl \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
fix \<psi>::"'a pltl"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
assume "fold_graph And_ltlp True_ltlp \<Phi> \<psi>"
[PROOF STATE]
proof (state)
this:
fold_graph And_ltlp true\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
hence "atoms_pltl \<psi> = (\<Union>\<phi>\<in>\<Phi>. atoms_pltl \<phi>)"
[PROOF STATE]
proof (prove)
using this:
fold_graph And_ltlp true\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. atoms_pltl \<psi> = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
by (rule fold_graph.induct) auto
[PROOF STATE]
proof (state)
this:
atoms_pltl \<psi> = \<Union> (atoms_pltl ` \<Phi>)

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> atoms_pltl ?\<psi>2 = \<Union> (atoms_pltl ` \<Phi>)

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
with fold_graph_AND[OF fin]
[PROOF STATE]
proof (chain)
picking this:
fold_graph And_ltlp true\<^sub>p \<Phi> (AND \<Phi>)
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> atoms_pltl ?\<psi>2 = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fold_graph And_ltlp true\<^sub>p \<Phi> (AND \<Phi>)
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> atoms_pltl ?\<psi>2 = \<Union> (atoms_pltl ` \<Phi>)

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_in_hom [intro, simp]:
    assumes "obj a"
    shows "\<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>" and "\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright> &&& \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
 2. \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
show "\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
using assms unit_in_vhom
[PROOF STATE]
proof (prove)
using this:
obj a
obj ?a \<Longrightarrow> \<guillemotleft>\<i>[?a] : ?a \<star> ?a \<Rightarrow> ?a\<guillemotright>

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
[PROOF STEP]
thus "\<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>"
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
obj a

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
[PROOF STEP]
by (metis arrI in_hhom_def obj_simps(2-3) vconn_implies_hpar(1-4))
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma CARD_option [card_simps]:
  "CARD('a option) = card_option CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a option) = card_option CARD('a)
[PROOF STEP]
by(simp add: card_option_def card_UNIV_option)


[STATEMENT]
lemma integer_division:
  "PRE (\<lambda>s::nat store. x \<ge> 0)
    (''q'' ::= (\<lambda>s. 0));
    (''r'' ::= (\<lambda>s. x));
    (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0)
     DO
      (''q'' ::= (\<lambda>s. s ''q'' + 1));
      (''r'' ::= (\<lambda>s. s ''r'' - y))
      OD)
   POST (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0 \<and> s ''r'' < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rdom \<lceil>\<lambda>s. zero_class.zero \<le> x\<rceil> \<subseteq> wp ((''q'' ::= (\<lambda>s. zero_class.zero)) ; (''r'' ::= (\<lambda>s. x)) ; (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> zero_class.zero \<le> s ''r'') DO (''q'' ::= (\<lambda>s. s ''q'' + 1)) ; (''r'' ::= (\<lambda>s. s ''r'' - y)) OD)) \<lceil>\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> zero_class.zero \<le> s ''r'' \<and> s ''r'' < y\<rceil>
[PROOF STEP]
by (rule ppath_aka.fbox_whilei_break, auto)


[STATEMENT]
lemma "First (autodiff logistic x) = exp (- x) / (1 + exp (- x)) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. First (autodiff logistic x) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
(* Move to hyperdual variant: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. First (autodiff logistic x) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
apply (simp only: autodiff.simps hyperdual_to_derivs.simps derivs.sel hypext_logistic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eps1 (hyp_logistic (\<beta> x)) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
(* Unfold extensions of functions that have a hyperdual variant (all except exp): *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eps1 (hyp_logistic (\<beta> x)) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
apply (simp only: hyp_logistic_def inverse_hyperdual.code hyperdual.sel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Eps1 (1 + (*h* exp) (- \<beta> x)) / (Base (1 + (*h* exp) (- \<beta> x)))\<^sup>2 = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
(* Finish by expanding the extension of exp and hyperdual computations: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Eps1 (1 + (*h* exp) (- \<beta> x)) / (Base (1 + (*h* exp) (- \<beta> x)))\<^sup>2 = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
apply (simp add: hyperdualx_def hypext_exp_Hyperdual hyperdual_bases)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma exists_k_mod:
  fixes c::"'a::unique_euclidean_ring"
  shows "\<exists>k. a mod c = a + k * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. a mod c = a + k * c
[PROOF STEP]
by (metis add.commute diff_add_cancel diff_minus_eq_add
      mult_div_mod_eq mult.commute mult_minus_left)


[STATEMENT]
lemma H_range: "0 \<le> H x" "H x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> H x &&& H x \<le> 1
[PROOF STEP]
by (auto simp: H_def h_range)


[STATEMENT]
lemma flatten_sigma_2_sf_subset:
  "sf (\<phi>[M]\<^sub>\<Sigma>\<^sub>2) \<subseteq> (\<Union>\<psi>\<in>sf \<phi>. sf (\<psi>[M]\<^sub>\<Sigma>\<^sub>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sf \<phi>[M]\<^sub>\<Sigma>\<^sub>2 \<subseteq> (\<Union>\<psi>\<in>sf \<phi>. sf \<psi>[M]\<^sub>\<Sigma>\<^sub>2)
[PROOF STEP]
by (induction \<phi>) auto