[STATEMENT]
lemma LIMSEQ_abs_realpow_zero2: "\<bar>c\<bar> < 1 \<Longrightarrow> (\<lambda>n. c ^ n :: real) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>c\<bar> < 1 \<Longrightarrow> (^) c \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule LIMSEQ_power_zero) simp


[STATEMENT]
lemma adjoint_one:
  shows "adjoint (1\<^sub>m n) = (1\<^sub>m n::complex mat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m n); j < dim_col (1\<^sub>m n)\<rbrakk> \<Longrightarrow> adjoint (1\<^sub>m n) $$ (i, j) = 1\<^sub>m n $$ (i, j)
 2. dim_row (adjoint (1\<^sub>m n)) = dim_row (1\<^sub>m n)
 3. dim_col (adjoint (1\<^sub>m n)) = dim_col (1\<^sub>m n)
[PROOF STEP]
by (auto simp add: adjoint_eval)


[STATEMENT]
lemma point_not_equal_aux:
  assumes "is_point p"
      and "is_point q"
    shows "p\<noteq>q \<longleftrightarrow> p \<cdot> -q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<noteq> q) = (p \<cdot> - q \<noteq> 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<noteq> q \<Longrightarrow> p \<cdot> - q \<noteq> 0
 2. p \<cdot> - q \<noteq> 0 \<Longrightarrow> p \<noteq> q
[PROOF STEP]
show "p \<noteq> q \<Longrightarrow> p \<cdot> - q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> p \<cdot> - q \<noteq> 0
[PROOF STEP]
proof (rule contrapos_nn)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<noteq> q \<Longrightarrow> \<not> ?Q
 2. \<lbrakk>p \<noteq> q; p \<cdot> - q = 0\<rbrakk> \<Longrightarrow> ?Q
[PROOF STEP]
assume "p \<cdot> -q = 0"
[PROOF STATE]
proof (state)
this:
p \<cdot> - q = 0

goal (2 subgoals):
 1. p \<noteq> q \<Longrightarrow> \<not> ?Q
 2. \<lbrakk>p \<noteq> q; p \<cdot> - q = 0\<rbrakk> \<Longrightarrow> ?Q
[PROOF STEP]
thus "p = q"
[PROOF STATE]
proof (prove)
using this:
p \<cdot> - q = 0

goal (1 subgoal):
 1. p = q
[PROOF STEP]
using assms galois_aux2 is_point_def point_singleton
[PROOF STATE]
proof (prove)
using this:
p \<cdot> - q = 0
is_point p
is_point q
(?x \<cdot> - ?y = 0) = (?x \<le> ?y)
is_point ?x \<equiv> is_vector ?x \<and> is_inj ?x \<and> ?x \<noteq> 0
\<lbrakk>is_point ?p; is_vector ?v; ?v \<noteq> 0; ?v \<le> ?p\<rbrakk> \<Longrightarrow> ?v = ?p

goal (1 subgoal):
 1. p = q
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
p = q

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> p \<noteq> q
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<noteq> q \<Longrightarrow> p \<cdot> - q \<noteq> 0

goal (1 subgoal):
 1. p \<cdot> - q \<noteq> 0 \<Longrightarrow> p \<noteq> q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<cdot> - q \<noteq> 0 \<Longrightarrow> p \<noteq> q
[PROOF STEP]
show "p \<cdot> - q \<noteq> 0 \<Longrightarrow> p \<noteq> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<cdot> - q \<noteq> 0 \<Longrightarrow> p \<noteq> q
[PROOF STEP]
using inf_compl_bot
[PROOF STATE]
proof (prove)
using this:
?x \<cdot> - ?x = 0

goal (1 subgoal):
 1. p \<cdot> - q \<noteq> 0 \<Longrightarrow> p \<noteq> q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<cdot> - q \<noteq> 0 \<Longrightarrow> p \<noteq> q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_closedin_eq:
      "connected S \<longleftrightarrow>
           \<not>(\<exists>E1 E2.
                 closedin (top_of_set S) E1 \<and>
                 closedin (top_of_set S) E2 \<and>
                 E1 \<union> E2 = S \<and> E1 \<inter> E2 = {} \<and>
                 E1 \<noteq> {} \<and> E2 \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected S = (\<nexists>E1 E2. closedin (top_of_set S) E1 \<and> closedin (top_of_set S) E2 \<and> E1 \<union> E2 = S \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})
[PROOF STEP]
unfolding connected_closedin
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>E1 E2. closedin (top_of_set S) E1 \<and> closedin (top_of_set S) E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {}) = (\<nexists>E1 E2. closedin (top_of_set S) E1 \<and> closedin (top_of_set S) E2 \<and> E1 \<union> E2 = S \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})
[PROOF STEP]
by (metis Un_subset_iff closedin_imp_subset subset_antisym)


[STATEMENT]
lemma less_le_not_le_type:
  "\<tau> < \<sigma> \<longleftrightarrow> \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau>"
  for \<tau> \<sigma> :: "'a type"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<tau> < \<sigma>) = (\<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<tau> < \<sigma> \<Longrightarrow> \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau>
 2. \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau> \<Longrightarrow> \<tau> < \<sigma>
[PROOF STEP]
show "\<tau> < \<sigma> \<Longrightarrow> \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> < \<sigma> \<Longrightarrow> \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau>
[PROOF STEP]
apply (auto simp add: less_type_def less_eq_type_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<sqsubset>)\<^sup>+\<^sup>+ \<tau> \<sigma>; (\<sqsubset>)\<^sup>*\<^sup>* \<sigma> \<tau>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis (mono_tags) subtype_irrefl less_type_def tranclp_rtranclp_tranclp)
[PROOF STATE]
proof (state)
this:
\<tau> < \<sigma> \<Longrightarrow> \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau>

goal (1 subgoal):
 1. \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau> \<Longrightarrow> \<tau> < \<sigma>
[PROOF STEP]
show "\<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau> \<Longrightarrow> \<tau> < \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau> \<Longrightarrow> \<tau> < \<sigma>
[PROOF STEP]
apply (auto simp add: less_type_def less_eq_type_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<sqsubset>)\<^sup>*\<^sup>* \<tau> \<sigma>; \<not> (\<sqsubset>)\<^sup>*\<^sup>* \<sigma> \<tau>\<rbrakk> \<Longrightarrow> (\<sqsubset>)\<^sup>+\<^sup>+ \<tau> \<sigma>
[PROOF STEP]
by (metis rtranclpD)
[PROOF STATE]
proof (state)
this:
\<tau> \<le> \<sigma> \<and> \<not> \<sigma> \<le> \<tau> \<Longrightarrow> \<tau> < \<sigma>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_vector_derivative_divide[derivative_intros]:
  fixes a :: "'a::real_normed_field"
  shows "(f has_vector_derivative x) F \<Longrightarrow> ((\<lambda>x. f x / a) has_vector_derivative (x / a)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_vector_derivative x) F \<Longrightarrow> ((\<lambda>x. f x / a) has_vector_derivative x / a) F
[PROOF STEP]
using has_vector_derivative_mult_left [of f x F "inverse a"]
[PROOF STATE]
proof (prove)
using this:
(f has_vector_derivative x) F \<Longrightarrow> ((\<lambda>x. f x * inverse a) has_vector_derivative x * inverse a) F

goal (1 subgoal):
 1. (f has_vector_derivative x) F \<Longrightarrow> ((\<lambda>x. f x / a) has_vector_derivative x / a) F
[PROOF STEP]
by (simp add: field_class.field_divide_inverse)


[STATEMENT]
lemma no_better_thansubset_rel :
  assumes "x \<in> carrier" and "y \<in> carrier"
  assumes "no_better_than y carrier relation \<subseteq> no_better_than x carrier relation"
  shows "x \<succeq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<succeq> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<succeq> y
[PROOF STEP]
have  "{a \<in> carrier. y \<succeq> a} \<subseteq> {a \<in> carrier. x \<succeq> a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> carrier. y \<succeq> a} \<subseteq> {a \<in> carrier. x \<succeq> a}
[PROOF STEP]
by (metis (no_types) assms(3) no_better_than_def)
[PROOF STATE]
proof (state)
this:
{a \<in> carrier. y \<succeq> a} \<subseteq> {a \<in> carrier. x \<succeq> a}

goal (1 subgoal):
 1. x \<succeq> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{a \<in> carrier. y \<succeq> a} \<subseteq> {a \<in> carrier. x \<succeq> a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{a \<in> carrier. y \<succeq> a} \<subseteq> {a \<in> carrier. x \<succeq> a}

goal (1 subgoal):
 1. x \<succeq> y
[PROOF STEP]
by (metis (mono_tags, lifting) Collect_mono_iff assms(2) compl)
[PROOF STATE]
proof (state)
this:
x \<succeq> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_elem_Suc_im:
  assumes "i < card S"
  shows "nth_elem (Suc ` S) i = Suc (nth_elem S i) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_elem (Suc ` S) i = Suc (nth_elem S i)
[PROOF STEP]
using set_to_list_Suc_map
[PROOF STATE]
proof (prove)
using this:
finite ?S \<Longrightarrow> sorted_list_of_set (Suc ` ?S) = map Suc (sorted_list_of_set ?S)

goal (1 subgoal):
 1. nth_elem (Suc ` S) i = Suc (nth_elem S i)
[PROOF STEP]
by (metis assms card_ge_0_finite dual_order.strict_trans not_gr0 nth_elem.elims nth_map set_to_list_length)


[STATEMENT]
lemma column_transpose_matrix: "column_of_matrix (transpose_matrix A) n = transpose_matrix (row_of_matrix A n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column_of_matrix (transpose_matrix A) n = transpose_matrix (row_of_matrix A n)
[PROOF STEP]
apply (simp add:  Rep_matrix_inject[THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (column_of_matrix (transpose_matrix A) n) = Rep_matrix (transpose_matrix (row_of_matrix A n))
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. Rep_matrix (column_of_matrix (transpose_matrix A) n) x xa = Rep_matrix (transpose_matrix (row_of_matrix A n)) x xa
[PROOF STEP]
by simp


[STATEMENT]
lemma common_root_len_gcd: "u \<in> t* \<Longrightarrow> v \<in> t* \<Longrightarrow> \<^bold>|t\<^bold>| dvd ( gcd \<^bold>|u\<^bold>| \<^bold>|v\<^bold>| )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<in> t*; v \<in> t*\<rbrakk> \<Longrightarrow> \<^bold>|t\<^bold>| dvd gcd \<^bold>|u\<^bold>| \<^bold>|v\<^bold>|
[PROOF STEP]
by (simp add: root_len_dvd)


[STATEMENT]
theorem path_compression:
  "VARS p t w
  [ path_compression_precondition p x y \<and> p0 = p ]
  w := x;
  WHILE y \<noteq> p[[w]]
    INV { path_compression_invariant p x y p0 w }
    VAR { (p\<^sup>T\<^sup>\<star> * w)\<down> }
     DO t := w;
        w := p[[w]];
        p[t] := y
     OD
  [ path_compression_postcondition p x y p0 ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [path_compression_precondition p x y \<and> p0 = p]
w := x; WHILE y \<noteq> p[[w]] INV {path_compression_invariant p x y p0 w}  VAR {(p\<^sup>T\<^sup>\<star> * w)\<down>}
DO t := w; w := p[[w]]; p := (p[t\<longmapsto>y]) OD
[path_compression_postcondition p x y p0]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. path_compression_precondition p0 x y \<Longrightarrow> path_compression_invariant p0 x y p0 x
 2. \<And>p w. path_compression_invariant p x y p0 w \<and> y \<noteq> p[[w]] \<Longrightarrow> path_compression_invariant (p[w\<longmapsto>y]) x y p0 (p[[w]]) \<and> ((p[w\<longmapsto>y])\<^sup>T\<^sup>\<star> * (p[[w]]))\<down> < (p\<^sup>T\<^sup>\<star> * w)\<down>
 3. \<And>p w. path_compression_invariant p x y p0 w \<and> y = p[[w]] \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
apply (fact path_compression_1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p w. path_compression_invariant p x y p0 w \<and> y \<noteq> p[[w]] \<Longrightarrow> path_compression_invariant (p[w\<longmapsto>y]) x y p0 (p[[w]]) \<and> ((p[w\<longmapsto>y])\<^sup>T\<^sup>\<star> * (p[[w]]))\<down> < (p\<^sup>T\<^sup>\<star> * w)\<down>
 2. \<And>p w. path_compression_invariant p x y p0 w \<and> y = p[[w]] \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
apply (fact path_compression_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p w. path_compression_invariant p x y p0 w \<and> y = p[[w]] \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
using path_compression_3
[PROOF STATE]
proof (prove)
using this:
path_compression_invariant ?p ?x (?p[[?w]]) ?p0.0 ?w \<Longrightarrow> path_compression_postcondition ?p ?x (?p[[?w]]) ?p0.0

goal (1 subgoal):
 1. \<And>p w. path_compression_invariant p x y p0 w \<and> y = p[[w]] \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
by auto


[STATEMENT]
lemma absolutely_integrable_periodic_offset:
  fixes f :: "real \<Rightarrow> real"
  assumes f: "f absolutely_integrable_on {a..b}" and periodic: "\<And>x. f(x + (b-a)) = f x"
  shows "(\<lambda>x. f(x + c)) absolutely_integrable_on {a..b}" "(\<lambda>x. f(c + x)) absolutely_integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (x + c)) absolutely_integrable_on {a..b} &&& (\<lambda>x. f (c + x)) absolutely_integrable_on {a..b}
[PROOF STEP]
using assms integrable_periodic_offset [of a b "f"]
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on {a..b}
f (?x + (b - a)) = f ?x
\<lbrakk>integrable (lebesgue_on {a..b}) f; \<And>x. f (x + (b - a)) = f x\<rbrakk> \<Longrightarrow> integrable (lebesgue_on {a..b}) (\<lambda>x. f (x + ?c))

goal (1 subgoal):
 1. (\<lambda>x. f (x + c)) absolutely_integrable_on {a..b} &&& (\<lambda>x. f (c + x)) absolutely_integrable_on {a..b}
[PROOF STEP]
by (auto simp: integrable_restrict_space set_integrable_def add.commute [of c])


[STATEMENT]
lemma lesseq_vecI: assumes "v \<in> carrier_vec n" "w \<in> carrier_vec n"
  "\<And> i. i < n \<Longrightarrow> v $ i \<le> w $ i"
shows "v \<le> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<le> w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n
?i < n \<Longrightarrow> v $ ?i \<le> w $ ?i

goal (1 subgoal):
 1. v \<le> w
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n
?i < n \<Longrightarrow> v $ ?i \<le> w $ ?i

goal (1 subgoal):
 1. dim_vec v = dim_vec w \<and> (\<forall>i<dim_vec w. v $ i \<le> w $ i)
[PROOF STEP]
by auto


[STATEMENT]
lemma ccspan_Times: \<open>ccspan (S \<times> T) = ccsubspace_Times (ccspan S) (ccspan T)\<close> if \<open>0 \<in> S\<close> and \<open>0 \<in> T\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (S \<times> T) = ccsubspace_Times (ccspan S) (ccspan T)
[PROOF STEP]
proof (transfer fixing: S T)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<in> S
(0::'b) \<in> T
[PROOF STEP]
have \<open>closure (cspan (S \<times> T)) = closure (cspan S \<times> cspan T)\<close>
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<in> S
(0::'b) \<in> T

goal (1 subgoal):
 1. closure (cspan (S \<times> T)) = closure (cspan S \<times> cspan T)
[PROOF STEP]
by (simp add: cspan_Times)
[PROOF STATE]
proof (state)
this:
closure (cspan (S \<times> T)) = closure (cspan S \<times> cspan T)

goal (1 subgoal):
 1. closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure (cspan (S \<times> T)) = closure (cspan S \<times> cspan T)

goal (1 subgoal):
 1. closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
have \<open>\<dots> = closure (cspan S) \<times> closure (cspan T)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cspan S \<times> cspan T) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
using closure_Times
[PROOF STATE]
proof (prove)
using this:
closure (?A \<times> ?B) = closure ?A \<times> closure ?B

goal (1 subgoal):
 1. closure (cspan S \<times> cspan T) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closure (cspan S \<times> cspan T) = closure (cspan S) \<times> closure (cspan T)

goal (1 subgoal):
 1. closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
show \<open>closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)\<close>
[PROOF STATE]
proof (prove)
using this:
closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)

goal (1 subgoal):
 1. closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
closure (cspan (S \<times> T)) = closure (cspan S) \<times> closure (cspan T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lucas_lehmer_distrib_left:
  assumes "m > 1"
  shows "lucas_lehmer_mult m z (lucas_lehmer_add m x y) =
         lucas_lehmer_add m (lucas_lehmer_mult m z x) (lucas_lehmer_mult m z y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_mult m z (lucas_lehmer_add m x y) = lucas_lehmer_add m (lucas_lehmer_mult m z x) (lucas_lehmer_mult m z y)
[PROOF STEP]
using lucas_lehmer_distrib_right[of m x y z] assms
[PROOF STATE]
proof (prove)
using this:
1 < m \<Longrightarrow> lucas_lehmer_mult m (lucas_lehmer_add m x y) z = lucas_lehmer_add m (lucas_lehmer_mult m x z) (lucas_lehmer_mult m y z)
1 < m

goal (1 subgoal):
 1. lucas_lehmer_mult m z (lucas_lehmer_add m x y) = lucas_lehmer_add m (lucas_lehmer_mult m z x) (lucas_lehmer_mult m z y)
[PROOF STEP]
by (simp add: lucas_lehmer_mult_commute)


[STATEMENT]
lemma (in finite_measure) finite_measure_mono_AE:
  assumes imp: "AE x in M. x \<in> A \<longrightarrow> x \<in> B" and B: "B \<in> sets M"
  shows "measure M A \<le> measure M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M A \<le> Sigma_Algebra.measure M B
[PROOF STEP]
using assms emeasure_mono_AE[OF imp B]
[PROOF STATE]
proof (prove)
using this:
AE x\<in>A in M. x \<in> B
B \<in> sets M
emeasure M A \<le> emeasure M B

goal (1 subgoal):
 1. Sigma_Algebra.measure M A \<le> Sigma_Algebra.measure M B
[PROOF STEP]
by (simp add: emeasure_eq_measure)


[STATEMENT]
lemma all_bi_edges_2: "X \<inter> Y = {} \<Longrightarrow> e \<in> all_bi_edges X Y \<Longrightarrow> card e = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<inter> Y = {}; e \<in> all_bi_edges X Y\<rbrakk> \<Longrightarrow> card e = 2
[PROOF STEP]
using card_2_iff
[PROOF STATE]
proof (prove)
using this:
(card ?S = 2) = (\<exists>x y. ?S = {x, y} \<and> x \<noteq> y)

goal (1 subgoal):
 1. \<lbrakk>X \<inter> Y = {}; e \<in> all_bi_edges X Y\<rbrakk> \<Longrightarrow> card e = 2
[PROOF STEP]
by (auto simp add: all_bi_edges_alt2)


[STATEMENT]
lemma map_iterator_rev_linord_foldli_conv :
    "map_iterator_rev_linord iti m \<longleftrightarrow>
     (\<exists>l0. distinct (map fst l0) \<and> m = map_of l0 \<and> sorted (rev (map fst l0)) \<and> iti = foldli l0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_iterator_rev_linord iti m = (\<exists>l0. distinct (map fst l0) \<and> m = map_of l0 \<and> sorted (rev (map fst l0)) \<and> iti = foldli l0)
[PROOF STEP]
unfolding set_iterator_map_rev_linord_def map_iterator_genord_foldli_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>l0. distinct (map fst l0) \<and> m = map_of l0 \<and> sorted_wrt (\<lambda>(k, uu_) (k', uu_). k' \<le> k) l0 \<and> iti = foldli l0) = (\<exists>l0. distinct (map fst l0) \<and> m = map_of l0 \<and> sorted (rev (map fst l0)) \<and> iti = foldli l0)
[PROOF STEP]
by (simp add: sorted_wrt_keys_map_fst)


[STATEMENT]
lemma Gamma_one_half_complex: "Gamma (1/2 :: complex) = of_real (sqrt pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma (1 / 2) = complex_of_real (sqrt pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gamma (1 / 2) = complex_of_real (sqrt pi)
[PROOF STEP]
have "Gamma (1/2 :: complex) = Gamma (of_real (1/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma (1 / 2) = Gamma (complex_of_real (1 / 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Gamma (1 / 2) = Gamma (complex_of_real (1 / 2))

goal (1 subgoal):
 1. Gamma (1 / 2) = complex_of_real (sqrt pi)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Gamma (1 / 2) = Gamma (complex_of_real (1 / 2))

goal (1 subgoal):
 1. Gamma (1 / 2) = complex_of_real (sqrt pi)
[PROOF STEP]
have "\<dots> = of_real (sqrt pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma (complex_of_real (1 / 2)) = complex_of_real (sqrt pi)
[PROOF STEP]
by (simp only: Gamma_complex_of_real Gamma_one_half_real)
[PROOF STATE]
proof (state)
this:
Gamma (complex_of_real (1 / 2)) = complex_of_real (sqrt pi)

goal (1 subgoal):
 1. Gamma (1 / 2) = complex_of_real (sqrt pi)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Gamma (1 / 2) = complex_of_real (sqrt pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Gamma (1 / 2) = complex_of_real (sqrt pi)

goal (1 subgoal):
 1. Gamma (1 / 2) = complex_of_real (sqrt pi)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Gamma (1 / 2) = complex_of_real (sqrt pi)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem basis_sub_gen:  "\<langle>S\<rangle> = \<langle>G\<rangle> \<Longrightarrow> \<BB> G \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>S\<rangle> = \<langle>G\<rangle> \<Longrightarrow> \<BB> G \<subseteq> S
[PROOF STEP]
using basis_of_hull basis_sub
[PROOF STATE]
proof (prove)
using this:
\<BB> \<langle>?G\<rangle> = \<BB> ?G
\<BB> ?G \<subseteq> ?G

goal (1 subgoal):
 1. \<langle>S\<rangle> = \<langle>G\<rangle> \<Longrightarrow> \<BB> G \<subseteq> S
[PROOF STEP]
by metis


[STATEMENT]
lemma has_sum_cnj_iff[simp]:
  fixes f :: \<open>'a \<Rightarrow> complex\<close>
  shows \<open>has_sum (\<lambda>x. cnj (f x)) M (cnj a) \<longleftrightarrow> has_sum f M a\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum (\<lambda>x. cnj (f x)) M (cnj a) = has_sum f M a
[PROOF STEP]
by (simp add: has_sum_def lim_cnj del: cnj_sum add: cnj_sum[symmetric, abs_def, of f])


[STATEMENT]
lemma span_redundant: "x \<in> span S \<Longrightarrow> span (insert x S) = span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> span S \<Longrightarrow> span (insert x S) = span S
[PROOF STEP]
unfolding span_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> subspace hull S \<Longrightarrow> subspace hull insert x S = subspace hull S
[PROOF STEP]
by (rule hull_redundant)


[STATEMENT]
lemma zip_path_append_left_right : "length p1 = length p2 \<Longrightarrow> zip_path (p1@(left_path p)) (p2@(right_path p)) = (zip_path p1 p2)@p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length p1 = length p2 \<Longrightarrow> zip_path (p1 @ left_path p) (p2 @ right_path p) = zip_path p1 p2 @ p
[PROOF STEP]
proof (induction p1 p2 rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. zip_path ([] @ left_path p) ([] @ right_path p) = zip_path [] [] @ p
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p\<rbrakk> \<Longrightarrow> zip_path ((x # xs) @ left_path p) ((y # ys) @ right_path p) = zip_path (x # xs) (y # ys) @ p
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. zip_path ([] @ left_path p) ([] @ right_path p) = zip_path [] [] @ p
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p\<rbrakk> \<Longrightarrow> zip_path ((x # xs) @ left_path p) ((y # ys) @ right_path p) = zip_path (x # xs) (y # ys) @ p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip_path ([] @ left_path p) ([] @ right_path p) = zip_path [] [] @ p
[PROOF STEP]
by (induction p; simp)
[PROOF STATE]
proof (state)
this:
zip_path ([] @ left_path p) ([] @ right_path p) = zip_path [] [] @ p

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p\<rbrakk> \<Longrightarrow> zip_path ((x # xs) @ left_path p) ((y # ys) @ right_path p) = zip_path (x # xs) (y # ys) @ p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p\<rbrakk> \<Longrightarrow> zip_path ((x # xs) @ left_path p) ((y # ys) @ right_path p) = zip_path (x # xs) (y # ys) @ p
[PROOF STEP]
case (Cons x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p\<rbrakk> \<Longrightarrow> zip_path ((x # xs) @ left_path p) ((y # ys) @ right_path p) = zip_path (x # xs) (y # ys) @ p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length xs = length ys
zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
zip_path (xs @ left_path p) (ys @ right_path p) = zip_path xs ys @ p

goal (1 subgoal):
 1. zip_path ((x # xs) @ left_path p) ((y # ys) @ right_path p) = zip_path (x # xs) (y # ys) @ p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
zip_path ((x # xs) @ left_path p) ((y # ys) @ right_path p) = zip_path (x # xs) (y # ys) @ p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma singleton_ge_zero[simp]: "(0 <= singleton_matrix j i x) = ((0::'a::{order,zero}) <= x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> singleton_matrix j i x) = ((0::'a) \<le> x)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> singleton_matrix j i x \<Longrightarrow> (0::'a) \<le> x
 2. (0::'a) \<le> x \<Longrightarrow> 0 \<le> singleton_matrix j i x
[PROOF STEP]
apply (simp add: le_matrix_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>ja ia. (0::'a) \<le> (if j = ja \<and> i = ia then x else (0::'a)) \<Longrightarrow> (0::'a) \<le> x
 2. (0::'a) \<le> x \<Longrightarrow> 0 \<le> singleton_matrix j i x
[PROOF STEP]
apply (drule_tac j=j and i=i in spec2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (0::'a) \<le> (if j = j \<and> i = i then x else (0::'a)) \<Longrightarrow> (0::'a) \<le> x
 2. (0::'a) \<le> x \<Longrightarrow> 0 \<le> singleton_matrix j i x
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> x \<Longrightarrow> 0 \<le> singleton_matrix j i x
[PROOF STEP]
apply (simp add: le_matrix_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma out_degree_app_iso_eq:
  assumes "digraph_isomorphism hom" and "u \<in> verts G"
  shows "out_degree (app_iso hom G) (iso_verts hom u) = out_degree G u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_degree (app_iso hom G) (iso_verts hom u) = out_degree G u
[PROOF STEP]
unfolding out_degree_def out_arcs_app_iso_eq[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (iso_arcs hom ` out_arcs G u) = card (out_arcs G u)
[PROOF STEP]
proof (rule card_image)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (iso_arcs hom) (out_arcs G u)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
digraph_isomorphism hom
u \<in> verts G
[PROOF STEP]
show "inj_on (iso_arcs hom) (out_arcs G u)"
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
u \<in> verts G

goal (1 subgoal):
 1. inj_on (iso_arcs hom) (out_arcs G u)
[PROOF STEP]
unfolding digraph_isomorphism_def
[PROOF STATE]
proof (prove)
using this:
wf_digraph G \<and> inj_on (iso_verts hom) (verts G) \<and> inj_on (iso_arcs hom) (arcs G) \<and> (\<forall>a\<in>arcs G. iso_verts hom (tail G a) = iso_tail hom (iso_arcs hom a) \<and> iso_verts hom (head G a) = iso_head hom (iso_arcs hom a))
u \<in> verts G

goal (1 subgoal):
 1. inj_on (iso_arcs hom) (out_arcs G u)
[PROOF STEP]
by - (rule subset_inj_on, auto)
[PROOF STATE]
proof (state)
this:
inj_on (iso_arcs hom) (out_arcs G u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma intersect_nodes_finite[intro]:
    assumes "finite (NBTA.nodes A)" "finite (NBTA.nodes B)"
    shows "finite (NBTA.nodes (intersect A B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (NBTA.nodes (intersect A B))
[PROOF STEP]
using intersect'_nodes_finite assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (NBTA.nodes ?A); finite (NBTA.nodes ?B)\<rbrakk> \<Longrightarrow> finite (NGBTA.nodes (intersect' ?A ?B))
finite (NBTA.nodes A)
finite (NBTA.nodes B)

goal (1 subgoal):
 1. finite (NBTA.nodes (intersect A B))
[PROOF STEP]
by simp


[STATEMENT]
theorem inorder_delete:
  "sorted1(inorder t) \<Longrightarrow> inorder (delete x t) = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted1 (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (AVL_Map.delete x t) = AList_Upd_Del.del_list x (Tree2.inorder t)
[PROOF STEP]
by(induction t)
  (auto simp: del_list_simps inorder_balL inorder_balR
      inorder_split_maxD split: prod.splits)


[STATEMENT]
lemma suminf_add_ereal:
  fixes f g :: "nat \<Rightarrow> ereal"
  assumes "\<And>i. 0 \<le> f i" "\<And>i. 0 \<le> g i"
  shows "(\<Sum>i. f i + g i) = suminf f + suminf g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. f i + g i) = suminf f + suminf g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i. f i + g i) = suminf f + suminf g
[PROOF STEP]
have "(SUP n. \<Sum>i<n. f i + g i) = (SUP n. sum f {..<n}) + (SUP n. sum g {..<n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP n. \<Sum>i<n. f i + g i) = (SUP n. sum f {..<n}) + (SUP n. sum g {..<n})
[PROOF STEP]
unfolding sum.distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP n. sum f {..<n} + sum g {..<n}) = (SUP n. sum f {..<n}) + (SUP n. sum g {..<n})
[PROOF STEP]
by (intro assms add_nonneg_nonneg SUP_ereal_add_pos incseq_sumI sum_nonneg ballI)
[PROOF STATE]
proof (state)
this:
(SUP n. \<Sum>i<n. f i + g i) = (SUP n. sum f {..<n}) + (SUP n. sum g {..<n})

goal (1 subgoal):
 1. (\<Sum>i. f i + g i) = suminf f + suminf g
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> f ?i
0 \<le> g ?i
(SUP n. \<Sum>i<n. f i + g i) = (SUP n. sum f {..<n}) + (SUP n. sum g {..<n})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> f ?i
0 \<le> g ?i
(SUP n. \<Sum>i<n. f i + g i) = (SUP n. sum f {..<n}) + (SUP n. sum g {..<n})

goal (1 subgoal):
 1. (\<Sum>i. f i + g i) = suminf f + suminf g
[PROOF STEP]
by (subst (1 2 3) suminf_ereal_eq_SUP) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i. f i + g i) = suminf f + suminf g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gbinomial_sum_lower_neg: "(\<Sum>k\<le>m. (a gchoose k) * (- 1) ^ k) = (- 1) ^ m * (a - 1 gchoose m)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
have "?lhs = (\<Sum>k\<le>m. -(a + 1) + of_nat k gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (\<Sum>k\<le>m. - (a + (1::'a)) + of_nat k gchoose k)
[PROOF STEP]
by (intro sum.cong[OF refl]) (subst gbinomial_negated_upper, simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (\<Sum>k\<le>m. - (a + (1::'a)) + of_nat k gchoose k)

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (\<Sum>k\<le>m. - (a + (1::'a)) + of_nat k gchoose k)

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
have "\<dots>  = - a + of_nat m gchoose m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. - (a + (1::'a)) + of_nat k gchoose k) = - a + of_nat m gchoose m
[PROOF STEP]
by (subst gbinomial_parallel_sum) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. - (a + (1::'a)) + of_nat k gchoose k) = - a + of_nat m gchoose m

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. - (a + (1::'a)) + of_nat k gchoose k) = - a + of_nat m gchoose m

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a + of_nat m gchoose m = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
by (subst gbinomial_negated_upper) (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
- a + of_nat m gchoose m = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (a gchoose k) * (- (1::'a)) ^ k) = (- (1::'a)) ^ m * (a - (1::'a) gchoose m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sigma_mset_Int_distrib1: "Sigma_mset (I \<inter># J) C = Sigma_mset I C \<inter># Sigma_mset J C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_mset (I \<inter># J) C = Sigma_mset I C \<inter># Sigma_mset J C
[PROOF STEP]
by (auto simp: multiset_eq_iff count_sum_mset count_image_mset_Pair sum_mset_if_eq_constant
    Sigma_mset_def iterate_op_plus min_def not_in_iff)


[STATEMENT]
lemma cauchyD: "cauchy X \<Longrightarrow> 0 < r \<Longrightarrow> \<exists>k. \<forall>m\<ge>k. \<forall>n\<ge>k. \<bar>X m - X n\<bar> < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cauchy X; 0 < r\<rbrakk> \<Longrightarrow> \<exists>k. \<forall>m\<ge>k. \<forall>n\<ge>k. \<bar>X m - X n\<bar> < r
[PROOF STEP]
unfolding cauchy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>r>0. \<exists>k. \<forall>m\<ge>k. \<forall>n\<ge>k. \<bar>X m - X n\<bar> < r; 0 < r\<rbrakk> \<Longrightarrow> \<exists>k. \<forall>m\<ge>k. \<forall>n\<ge>k. \<bar>X m - X n\<bar> < r
[PROOF STEP]
by simp


[STATEMENT]
lemma nth_length_takeWhile_less:
  "\<lbrakk> sorted xs; distinct xs; (\<exists> a \<in> set xs. a \<ge> n) \<rbrakk> \<Longrightarrow> xs ! length (takeWhile (\<lambda>x. x < n) xs) \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted xs; distinct xs; \<exists>a\<in>set xs. n \<le> a\<rbrakk> \<Longrightarrow> n \<le> xs ! length (takeWhile (\<lambda>x. x < n) xs)
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma mult_strict_mono':
  assumes "a < b" and "c < d" and "0 \<le> a" and "0 \<le> c"
  shows "a * c < b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
by (rule mult_strict_mono) (insert assms, auto)


[STATEMENT]
lemma path_image_subpath_commute:
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
  shows "path_image(subpath u v g) = path_image(subpath v u g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (subpath u v g) = path_image (subpath v u g)
[PROOF STEP]
by (simp add: path_image_subpath_gen closed_segment_eq_real_ivl)


[STATEMENT]
lemma compact_frontier_bounded[intro]:
  fixes S :: "'a::heine_borel set"
  shows "bounded S \<Longrightarrow> compact (frontier S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<Longrightarrow> compact (frontier S)
[PROOF STEP]
unfolding frontier_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<Longrightarrow> compact (closure S - interior S)
[PROOF STEP]
using compact_eq_bounded_closed
[PROOF STATE]
proof (prove)
using this:
compact ?S = (bounded ?S \<and> closed ?S)

goal (1 subgoal):
 1. bounded S \<Longrightarrow> compact (closure S - interior S)
[PROOF STEP]
by blast


[STATEMENT]
lemma ceiling_less_neg_numeral [simp]: "\<lceil>x\<rceil> < - numeral v \<longleftrightarrow> x \<le> - numeral v - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> < - numeral v) = (x \<le> - numeral v - (1::'a))
[PROOF STEP]
by (simp add: ceiling_less_iff)


[STATEMENT]
lemma carrier_product_group [simp]: "carrier(product_group I G) = (\<Pi>\<^sub>E i\<in>I. carrier (G i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (product_group I G) = (\<Pi>\<^sub>E i\<in>I. carrier (G i))
[PROOF STEP]
by (simp add: product_group_def)


[STATEMENT]
lemma N_prime_ge:
  assumes "prime p"
  shows   "N p \<ge> 1 / (q\<^sup>2 * (q - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
have "1 / (q ^ 2 * (q - 1)) = N 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) = N 2
[PROOF STEP]
using q_gt_1
[PROOF STATE]
proof (prove)
using this:
1 < q

goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) = N 2
[PROOF STEP]
by (auto simp: N_prime N_1 field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
1 / (q\<^sup>2 * (q - 1)) = N 2

goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / (q\<^sup>2 * (q - 1)) = N 2

goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
have "\<dots> \<le> N p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N 2 \<le> N p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. N 2 \<le> N p
[PROOF STEP]
by (intro N_prime_mono) (auto simp: prime_ge_2_int)
[PROOF STATE]
proof (state)
this:
N 2 \<le> N p

goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 / (q\<^sup>2 * (q - 1)) \<le> N p

goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 / (q\<^sup>2 * (q - 1)) \<le> N p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_segment_Un:
  fixes a b c::real
  assumes "b \<in> closed_segment a c"
  shows "closed_segment a b \<union> closed_segment b c = closed_segment a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a--b} \<union> {b--c} = {a--c}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b \<in> {a--c}

goal (1 subgoal):
 1. {a--b} \<union> {b--c} = {a--c}
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl)


[STATEMENT]
lemma inner_quad_ge: "2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b"
  for a b::"'a::euclidean_space"\<comment> \<open>generalize?\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b
[PROOF STEP]
by (subst (1 2 3) euclidean_inner)
      (auto simp add: sum.distrib[symmetric] sum_distrib_left intro!: sum_mono real_quad_ge)
[PROOF STATE]
proof (state)
this:
2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deg_fun_eq_0_iff:
  assumes "finite (supp_fun (s::'a \<Rightarrow> 'b::add_linorder_min))"
  shows "deg_fun s = 0 \<longleftrightarrow> s = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deg_fun s = (0::'b)) = (s = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. deg_fun s = (0::'b) \<Longrightarrow> s = 0
 2. s = 0 \<Longrightarrow> deg_fun s = (0::'b)
[PROOF STEP]
assume "deg_fun s = 0"
[PROOF STATE]
proof (state)
this:
deg_fun s = (0::'b)

goal (2 subgoals):
 1. deg_fun s = (0::'b) \<Longrightarrow> s = 0
 2. s = 0 \<Longrightarrow> deg_fun s = (0::'b)
[PROOF STEP]
hence *: "(\<Sum>x\<in>(supp_fun s). s x) = 0"
[PROOF STATE]
proof (prove)
using this:
deg_fun s = (0::'b)

goal (1 subgoal):
 1. sum s (supp_fun s) = (0::'b)
[PROOF STEP]
by (simp only: deg_fun_def)
[PROOF STATE]
proof (state)
this:
sum s (supp_fun s) = (0::'b)

goal (2 subgoals):
 1. deg_fun s = (0::'b) \<Longrightarrow> s = 0
 2. s = 0 \<Longrightarrow> deg_fun s = (0::'b)
[PROOF STEP]
have **: "\<And>x. 0 \<le> s x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (0::'b) \<le> s x
[PROOF STEP]
by (rule zero_min)
[PROOF STATE]
proof (state)
this:
(0::'b) \<le> s ?x

goal (2 subgoals):
 1. deg_fun s = (0::'b) \<Longrightarrow> s = 0
 2. s = 0 \<Longrightarrow> deg_fun s = (0::'b)
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
sum s (supp_fun s) = (0::'b)
[PROOF STEP]
have "\<And>x. x \<in> supp_fun s \<Longrightarrow> s x = 0"
[PROOF STATE]
proof (prove)
using this:
sum s (supp_fun s) = (0::'b)

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = (0::'b)
[PROOF STEP]
by (simp only: sum_nonneg_eq_0_iff[OF assms **])
[PROOF STATE]
proof (state)
this:
?x \<in> supp_fun s \<Longrightarrow> s ?x = (0::'b)

goal (2 subgoals):
 1. deg_fun s = (0::'b) \<Longrightarrow> s = 0
 2. s = 0 \<Longrightarrow> deg_fun s = (0::'b)
[PROOF STEP]
thus "s = 0"
[PROOF STATE]
proof (prove)
using this:
?x \<in> supp_fun s \<Longrightarrow> s ?x = (0::'b)

goal (1 subgoal):
 1. s = 0
[PROOF STEP]
by (rule fun_eq_zeroI)
[PROOF STATE]
proof (state)
this:
s = 0

goal (1 subgoal):
 1. s = 0 \<Longrightarrow> deg_fun s = (0::'b)
[PROOF STEP]
qed simp


[STATEMENT]
lemma integral_const_real [simp]:
  fixes a b :: real
  shows "integral {a..b} (\<lambda>x. c) = content {a..b} *\<^sub>R c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..b} (\<lambda>x. c) = content {a..b} *\<^sub>R c
[PROOF STEP]
by (metis box_real(2) integral_const)


[STATEMENT]
lemma least_eq:
    fixes A B :: "'a :: wellorder set"
    assumes "A \<noteq> {}" "B \<noteq> {}"
    assumes "\<And> i. i \<le> least A \<Longrightarrow> i \<le> least B \<Longrightarrow> i \<in> A \<longleftrightarrow> i \<in> B"
    shows "least A = least B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least A = least B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
B \<noteq> {}
\<lbrakk>?i \<le> least A; ?i \<le> least B\<rbrakk> \<Longrightarrow> (?i \<in> A) = (?i \<in> B)

goal (1 subgoal):
 1. least A = least B
[PROOF STEP]
by (auto intro: antisym least_le)


[STATEMENT]
lemma scalar_product_append[simp]: "scalar_product ns (xs @ ys) =
  scalar_product (take (length xs) ns) xs + scalar_product (drop (length xs) ns) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_product ns (xs @ ys) = scalar_product (take (length xs) ns) xs + scalar_product (drop (length xs) ns) ys
[PROOF STEP]
by (induct xs arbitrary: ns) (auto split: list.splits)


[STATEMENT]
lemma desargues_config_3D_coplanar_4 :
  assumes "desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>"
  shows "rk {A, B, C, \<alpha>} = 3" and "rk {A', B', C', \<alpha>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3 &&& rk {A', B', C', \<alpha>} = 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rk {A, B, C, \<alpha>} = 3
 2. rk {A', B', C', \<alpha>} = 3
[PROOF STEP]
show "rk {A, B, C, \<alpha>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3
[PROOF STEP]
using assms desargues_config_3D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>] coplanar_4
[PROOF STATE]
proof (prove)
using this:
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> 4 \<le> rk {A, B, C, A', B', C'} \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2
\<lbrakk>rk {?A, ?B, ?C} = 3; rk {?B, ?C, ?\<alpha>} = 2\<rbrakk> \<Longrightarrow> rk {?A, ?B, ?C, ?\<alpha>} = 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>} = 3
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>} = 3

goal (1 subgoal):
 1. rk {A', B', C', \<alpha>} = 3
[PROOF STEP]
show "rk {A', B', C', \<alpha>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A', B', C', \<alpha>} = 3
[PROOF STEP]
using assms desargues_config_3D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>] coplanar_4
[PROOF STATE]
proof (prove)
using this:
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> 4 \<le> rk {A, B, C, A', B', C'} \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2
\<lbrakk>rk {?A, ?B, ?C} = 3; rk {?B, ?C, ?\<alpha>} = 2\<rbrakk> \<Longrightarrow> rk {?A, ?B, ?C, ?\<alpha>} = 3

goal (1 subgoal):
 1. rk {A', B', C', \<alpha>} = 3
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rk {A', B', C', \<alpha>} = 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_field_derivative_powr_of_int:
  fixes z :: complex
  assumes gderiv:"(g has_field_derivative gd) (at z within S)" and "g z\<noteq>0"
  shows "((\<lambda>z. g z powr of_int n) has_field_derivative (n * g z powr (of_int n - 1) * gd)) (at z within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
define dd where "dd = of_int n * g z powr (of_int (n - 1)) * gd"
[PROOF STATE]
proof (state)
this:
dd = of_int n * g z powr of_int (n - 1) * gd

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
obtain e where "e>0" and e_dist:"\<forall>y\<in>S. dist z y < e \<longrightarrow> g y \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<forall>y\<in>S. dist z y < e \<longrightarrow> g y \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using DERIV_continuous[OF gderiv,THEN continuous_within_avoid] \<open>g z\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
g z \<noteq> ?a \<Longrightarrow> \<exists>e>0. \<forall>y\<in>S. dist z y < e \<longrightarrow> g y \<noteq> ?a
g z \<noteq> 0

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<forall>y\<in>S. dist z y < e \<longrightarrow> g y \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e
\<forall>y\<in>S. dist z y < e \<longrightarrow> g y \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have ?thesis when "n\<ge>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
define dd' where "dd' = of_int n * g z ^ (nat n - 1) * gd"
[PROOF STATE]
proof (state)
this:
dd' = of_int n * g z ^ (nat n - 1) * gd

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have "dd=dd'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dd = dd'
[PROOF STEP]
proof (cases "n=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dd = dd'
 2. n \<noteq> 0 \<Longrightarrow> dd = dd'
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dd = dd'
 2. n \<noteq> 0 \<Longrightarrow> dd = dd'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have "n-1 \<ge>0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. 0 \<le> n - 1
[PROOF STEP]
using \<open>n\<ge>0\<close>
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
0 \<le> n

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

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dd = dd'
 2. n \<noteq> 0 \<Longrightarrow> dd = dd'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> n - 1
[PROOF STEP]
have "g z powr (of_int (n - 1)) = g z ^ (nat n - 1)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> n - 1

goal (1 subgoal):
 1. g z powr of_int (n - 1) = g z ^ (nat n - 1)
[PROOF STEP]
using powr_of_int[OF \<open>g z\<noteq>0\<close>,of "n-1"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> n - 1
g z powr of_int (n - 1) = (if 0 \<le> n - 1 then g z ^ nat (n - 1) else inverse (g z ^ nat (- (n - 1))))

goal (1 subgoal):
 1. g z powr of_int (n - 1) = g z ^ (nat n - 1)
[PROOF STEP]
by (simp add: nat_diff_distrib')
[PROOF STATE]
proof (state)
this:
g z powr of_int (n - 1) = g z ^ (nat n - 1)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dd = dd'
 2. n \<noteq> 0 \<Longrightarrow> dd = dd'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g z powr of_int (n - 1) = g z ^ (nat n - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g z powr of_int (n - 1) = g z ^ (nat n - 1)

goal (1 subgoal):
 1. dd = dd'
[PROOF STEP]
unfolding dd_def dd'_def
[PROOF STATE]
proof (prove)
using this:
g z powr of_int (n - 1) = g z ^ (nat n - 1)

goal (1 subgoal):
 1. of_int n * g z powr of_int (n - 1) * gd = of_int n * g z ^ (nat n - 1) * gd
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dd = dd'

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> dd = dd'
[PROOF STEP]
qed (simp add:dd_def dd'_def)
[PROOF STATE]
proof (state)
this:
dd = dd'

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dd = dd'
[PROOF STEP]
have "((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
                \<longleftrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)"
[PROOF STATE]
proof (prove)
using this:
dd = dd'

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S) = ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S) = ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S) = ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>z. g z ^ nat n) has_field_derivative dd') (at z within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S) = ((\<lambda>z. g z ^ nat n) has_field_derivative dd') (at z within S)
[PROOF STEP]
proof (rule has_field_derivative_cong_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at z within S. g x powr of_int n = g x ^ nat n
 2. g z powr of_int n = g z ^ nat n
[PROOF STEP]
show "\<forall>\<^sub>F x in at z within S. g x powr of_int n = g x ^ nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at z within S. g x powr of_int n = g x ^ nat n
[PROOF STEP]
unfolding eventually_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>x\<in>S. x \<noteq> z \<and> dist x z < d \<longrightarrow> g x powr of_int n = g x ^ nat n
[PROOF STEP]
apply (rule exI[where x=e])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e \<and> (\<forall>x\<in>S. x \<noteq> z \<and> dist x z < e \<longrightarrow> g x powr of_int n = g x ^ nat n)
[PROOF STEP]
using powr_of_int that \<open>e>0\<close> e_dist
[PROOF STATE]
proof (prove)
using this:
?z \<noteq> 0 \<Longrightarrow> ?z powr of_int ?n = (if 0 \<le> ?n then ?z ^ nat ?n else inverse (?z ^ nat (- ?n)))
0 \<le> n
0 < e
\<forall>y\<in>S. dist z y < e \<longrightarrow> g y \<noteq> 0

goal (1 subgoal):
 1. 0 < e \<and> (\<forall>x\<in>S. x \<noteq> z \<and> dist x z < e \<longrightarrow> g x powr of_int n = g x ^ nat n)
[PROOF STEP]
by (simp add: dist_commute)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at z within S. g x powr of_int n = g x ^ nat n

goal (1 subgoal):
 1. g z powr of_int n = g z ^ nat n
[PROOF STEP]
qed (use powr_of_int \<open>g z\<noteq>0\<close> that in simp)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S) = ((\<lambda>z. g z ^ nat n) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S) = ((\<lambda>z. g z ^ nat n) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have "\<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. g z ^ nat n) has_field_derivative dd') (at z within S)
[PROOF STEP]
unfolding dd'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. g z ^ nat n) has_field_derivative of_int n * g z ^ (nat n - 1) * gd) (at z within S)
[PROOF STEP]
using gderiv that
[PROOF STATE]
proof (prove)
using this:
(g has_field_derivative gd) (at z within S)
0 \<le> n

goal (1 subgoal):
 1. ((\<lambda>z. g z ^ nat n) has_field_derivative of_int n * g z ^ (nat n - 1) * gd) (at z within S)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z ^ nat n) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
[PROOF STEP]
have "((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
unfolding dd_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr of_int (n - 1) * gd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> n \<Longrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> n \<Longrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have ?thesis when "n<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
define dd' where "dd' = of_int n / g z ^ (nat (1 - n)) * gd"
[PROOF STATE]
proof (state)
this:
dd' = of_int n / g z ^ nat (1 - n) * gd

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have "dd=dd'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dd = dd'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dd = dd'
[PROOF STEP]
have "g z powr of_int (n - 1) = inverse (g z ^ nat (1-n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g z powr of_int (n - 1) = inverse (g z ^ nat (1 - n))
[PROOF STEP]
using powr_of_int[OF \<open>g z\<noteq>0\<close>,of "n-1"] that
[PROOF STATE]
proof (prove)
using this:
g z powr of_int (n - 1) = (if 0 \<le> n - 1 then g z ^ nat (n - 1) else inverse (g z ^ nat (- (n - 1))))
n < 0

goal (1 subgoal):
 1. g z powr of_int (n - 1) = inverse (g z ^ nat (1 - n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g z powr of_int (n - 1) = inverse (g z ^ nat (1 - n))

goal (1 subgoal):
 1. dd = dd'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g z powr of_int (n - 1) = inverse (g z ^ nat (1 - n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g z powr of_int (n - 1) = inverse (g z ^ nat (1 - n))

goal (1 subgoal):
 1. dd = dd'
[PROOF STEP]
unfolding dd_def dd'_def
[PROOF STATE]
proof (prove)
using this:
g z powr of_int (n - 1) = inverse (g z ^ nat (1 - n))

goal (1 subgoal):
 1. of_int n * g z powr of_int (n - 1) * gd = of_int n / g z ^ nat (1 - n) * gd
[PROOF STEP]
by (simp add: divide_inverse)
[PROOF STATE]
proof (state)
this:
dd = dd'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dd = dd'

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dd = dd'
[PROOF STEP]
have "((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
                \<longleftrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)"
[PROOF STATE]
proof (prove)
using this:
dd = dd'

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S) = ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S) = ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S) = ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>z. inverse (g z ^ nat (-n))) has_field_derivative dd') (at z within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S) = ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)
[PROOF STEP]
proof (rule has_field_derivative_cong_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at z within S. g x powr of_int n = inverse (g x ^ nat (- n))
 2. g z powr of_int n = inverse (g z ^ nat (- n))
[PROOF STEP]
show "\<forall>\<^sub>F x in at z within S. g x powr of_int n = inverse (g x ^ nat (- n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at z within S. g x powr of_int n = inverse (g x ^ nat (- n))
[PROOF STEP]
unfolding eventually_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>x\<in>S. x \<noteq> z \<and> dist x z < d \<longrightarrow> g x powr of_int n = inverse (g x ^ nat (- n))
[PROOF STEP]
apply (rule exI[where x=e])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e \<and> (\<forall>x\<in>S. x \<noteq> z \<and> dist x z < e \<longrightarrow> g x powr of_int n = inverse (g x ^ nat (- n)))
[PROOF STEP]
using powr_of_int that \<open>e>0\<close> e_dist
[PROOF STATE]
proof (prove)
using this:
?z \<noteq> 0 \<Longrightarrow> ?z powr of_int ?n = (if 0 \<le> ?n then ?z ^ nat ?n else inverse (?z ^ nat (- ?n)))
n < 0
0 < e
\<forall>y\<in>S. dist z y < e \<longrightarrow> g y \<noteq> 0

goal (1 subgoal):
 1. 0 < e \<and> (\<forall>x\<in>S. x \<noteq> z \<and> dist x z < e \<longrightarrow> g x powr of_int n = inverse (g x ^ nat (- n)))
[PROOF STEP]
by (simp add: dist_commute)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at z within S. g x powr of_int n = inverse (g x ^ nat (- n))

goal (1 subgoal):
 1. g z powr of_int n = inverse (g z ^ nat (- n))
[PROOF STEP]
qed (use powr_of_int \<open>g z\<noteq>0\<close> that in simp)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S) = ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd') (at z within S) = ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
have "\<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)
[PROOF STEP]
have "nat (- n) + nat (1 - n) - Suc 0 = nat (- n) + nat (- n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat (- n) + nat (1 - n) - Suc 0 = nat (- n) + nat (- n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat (- n) + nat (1 - n) - Suc 0 = nat (- n) + nat (- n)

goal (1 subgoal):
 1. ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat (- n) + nat (1 - n) - Suc 0 = nat (- n) + nat (- n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nat (- n) + nat (1 - n) - Suc 0 = nat (- n) + nat (- n)

goal (1 subgoal):
 1. ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)
[PROOF STEP]
unfolding dd'_def
[PROOF STATE]
proof (prove)
using this:
nat (- n) + nat (1 - n) - Suc 0 = nat (- n) + nat (- n)

goal (1 subgoal):
 1. ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative of_int n / g z ^ nat (1 - n) * gd) (at z within S)
[PROOF STEP]
using gderiv that \<open>g z\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
nat (- n) + nat (1 - n) - Suc 0 = nat (- n) + nat (- n)
(g has_field_derivative gd) (at z within S)
n < 0
g z \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative of_int n / g z ^ nat (1 - n) * gd) (at z within S)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp add:field_split_simps power_add[symmetric])
[PROOF STATE]
proof (state)
this:
((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>z. inverse (g z ^ nat (- n))) has_field_derivative dd') (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
[PROOF STEP]
have "((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. g z powr of_int n) has_field_derivative dd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
unfolding dd_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr of_int (n - 1) * gd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
n < 0 \<Longrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 \<le> n \<Longrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
n < 0 \<Longrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> n \<Longrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
n < 0 \<Longrightarrow> ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)

goal (1 subgoal):
 1. ((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
((\<lambda>z. g z powr of_int n) has_field_derivative of_int n * g z powr (of_int n - 1) * gd) (at z within S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_T_const[simp]: "emeasure (T s) (space St) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (T s) (space St) = 1
[PROOF STEP]
using T.emeasure_space_1[of s]
[PROOF STATE]
proof (prove)
using this:
emeasure (T s) (space (T s)) = 1

goal (1 subgoal):
 1. emeasure (T s) (space St) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma locally_compact_closed_Int_open:
  fixes S :: "'a :: euclidean_space set"
  shows "locally compact S \<longleftrightarrow> (\<exists>U V. closed U \<and> open V \<and> S = U \<inter> V)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally compact S = (\<exists>U V. closed U \<and> open V \<and> S = U \<inter> V)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. locally compact S \<Longrightarrow> \<exists>U V. closed U \<and> open V \<and> S = U \<inter> V
 2. \<exists>U V. closed U \<and> open V \<and> S = U \<inter> V \<Longrightarrow> locally compact S
[PROOF STEP]
show "?lhs \<Longrightarrow> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally compact S \<Longrightarrow> \<exists>U V. closed U \<and> open V \<and> S = U \<inter> V
[PROOF STEP]
by (metis closed_closure inf_commute locally_compact_open_Int_closure)
[PROOF STATE]
proof (state)
this:
locally compact S \<Longrightarrow> \<exists>U V. closed U \<and> open V \<and> S = U \<inter> V

goal (1 subgoal):
 1. \<exists>U V. closed U \<and> open V \<and> S = U \<inter> V \<Longrightarrow> locally compact S
[PROOF STEP]
show "?rhs \<Longrightarrow> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U V. closed U \<and> open V \<and> S = U \<inter> V \<Longrightarrow> locally compact S
[PROOF STEP]
by (meson closed_imp_locally_compact locally_compact_Int open_imp_locally_compact)
[PROOF STATE]
proof (state)
this:
\<exists>U V. closed U \<and> open V \<and> S = U \<inter> V \<Longrightarrow> locally compact S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_of_uint32_shift: "int_of_uint32 (drop_bit k n) = (int_of_uint32 n) div (2 ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_uint32 (drop_bit k n) = int_of_uint32 n div 2 ^ k
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n. uint (drop_bit k n) = uint n div 2 ^ k
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n. take_bit LENGTH(32) ((drop_bit k \<circ> take_bit LENGTH(32)) n) = take_bit LENGTH(32) n div 2 ^ k
[PROOF STEP]
apply (simp add: take_bit_drop_bit min_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n. 0 < k \<longrightarrow> drop_bit k (take_bit 32 n) = take_bit 32 n div 2 ^ k
[PROOF STEP]
apply (simp add: drop_bit_eq_div)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mono_ccINF:
  "countable I \<Longrightarrow> f (INF i \<in> I. A i) \<le> (INF x \<in> I. f (A x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable I \<Longrightarrow> f (Inf (A ` I)) \<le> (INF x\<in>I. f (A x))
[PROOF STEP]
by (intro countable_complete_lattice_class.ccINF_greatest monoD[OF \<open>mono f\<close>] ccINF_lower)


[STATEMENT]
lemma minus_diff_sym_hmset: "m - (m - n) = n - (n - m)" for m n :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m - (m - n) = n - (n - m)
[PROOF STEP]
unfolding minus_hmultiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMSet (hmsetmset m - hmsetmset (HMSet (hmsetmset m - hmsetmset n))) = HMSet (hmsetmset n - hmsetmset (HMSet (hmsetmset n - hmsetmset m)))
[PROOF STEP]
by (simp flip: inter_mset_def ac_simps)


[STATEMENT]
lemma supremum_smaller_subset:
  assumes "finite S"
  shows "less_eq (supremum (smaller_subset x S)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. less_eq (supremum (smaller_subset x S)) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. less_eq (supremum (smaller_subset x S)) x
[PROOF STEP]
proof (induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. less_eq (supremum (smaller_subset x {})) x
 2. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; less_eq (supremum (smaller_subset x F)) x\<rbrakk> \<Longrightarrow> less_eq (supremum (smaller_subset x (insert xa F))) x
[PROOF STEP]
case (insert y F)
[PROOF STATE]
proof (state)
this:
finite F
y \<notin> F
less_eq (supremum (smaller_subset x F)) x

goal (2 subgoals):
 1. less_eq (supremum (smaller_subset x {})) x
 2. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; less_eq (supremum (smaller_subset x F)) x\<rbrakk> \<Longrightarrow> less_eq (supremum (smaller_subset x (insert xa F))) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
y \<notin> F
less_eq (supremum (smaller_subset x F)) x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
y \<notin> F
less_eq (supremum (smaller_subset x F)) x

goal (1 subgoal):
 1. less_eq (supremum (smaller_subset x (insert y F))) x
[PROOF STEP]
by (cases "less_eq y x") (auto simp: upper_bound)
[PROOF STATE]
proof (state)
this:
less_eq (supremum (smaller_subset x (insert y F))) x

goal (1 subgoal):
 1. less_eq (supremum (smaller_subset x {})) x
[PROOF STEP]
qed simp


[STATEMENT]
lemma ID_ccompare_interval:
  "\<lbrakk> ID CCOMPARE('a) = Some c; finite (UNIV :: 'a set) \<rbrakk>
  \<Longrightarrow> class.linorder_proper_interval (le_of_comp c) (lt_of_comp c) cproper_interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ID ccompare = Some c; finite UNIV\<rbrakk> \<Longrightarrow> class.linorder_proper_interval (le_of_comp c) (lt_of_comp c) cproper_interval
[PROOF STEP]
using cproper_interval
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ID ccompare \<noteq> None; finite UNIV\<rbrakk> \<Longrightarrow> class.proper_interval cless cproper_interval

goal (1 subgoal):
 1. \<lbrakk>ID ccompare = Some c; finite UNIV\<rbrakk> \<Longrightarrow> class.linorder_proper_interval (le_of_comp c) (lt_of_comp c) cproper_interval
[PROOF STEP]
by(simp add: ID_ccompare class.linorder_proper_interval_def)


[STATEMENT]
lemma stopping_time_cong: "(\<And>t x. x \<in> space (F t) \<Longrightarrow> T x = S x) \<Longrightarrow> stopping_time F T = stopping_time F S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t x. x \<in> space (F t) \<Longrightarrow> T x = S x) \<Longrightarrow> stopping_time F T = stopping_time F S
[PROOF STEP]
unfolding stopping_time_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t x. x \<in> space (F t) \<Longrightarrow> T x = S x) \<Longrightarrow> (\<forall>t. Measurable.pred (F t) (\<lambda>x. T x \<le> t)) = (\<forall>t. Measurable.pred (F t) (\<lambda>x. S x \<le> t))
[PROOF STEP]
by (intro arg_cong[where f=All] ext measurable_cong) simp


[STATEMENT]
lemma continuous_transform_within:
  fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space"
  assumes "continuous (at x within s) f"
    and "0 < d"
    and "x \<in> s"
    and "\<And>x'. \<lbrakk>x' \<in> s; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'"
  shows "continuous (at x within s) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at x within s) g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous (at x within s) f
0 < d
x \<in> s
\<lbrakk>?x' \<in> s; dist ?x' x < d\<rbrakk> \<Longrightarrow> f ?x' = g ?x'

goal (1 subgoal):
 1. continuous (at x within s) g
[PROOF STEP]
unfolding continuous_within
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f x) (at x within s)
0 < d
x \<in> s
\<lbrakk>?x' \<in> s; dist ?x' x < d\<rbrakk> \<Longrightarrow> f ?x' = g ?x'

goal (1 subgoal):
 1. (g \<longlongrightarrow> g x) (at x within s)
[PROOF STEP]
by (force intro: Lim_transform_within)


[STATEMENT]
lemma map_sort:
  assumes "mono f"
  shows "sort (map f xs) = map f (sort xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sort (map f xs) = map f (sort xs)
[PROOF STEP]
apply (rule properties_for_sort)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mset (map f (sort xs)) = mset (map f xs)
 2. sorted (map f (sort xs))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (map f (sort xs))
[PROOF STEP]
by (rule sorted_mono_map, simp, simp add:assms)


[STATEMENT]
lemma zfact_iso_inv_0:
  assumes n_ge_0: "n > 0"
  shows "zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub> = 0
[PROOF STEP]
unfolding zfact_iso_inv_def zfact_iso_0[OF n_ge_0, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_into {..<n} (zfact_iso n) (zfact_iso n 0) = 0
[PROOF STEP]
using n_ge_0
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. inv_into {..<n} (zfact_iso n) (zfact_iso n 0) = 0
[PROOF STEP]
by (rule inv_into_f_f[OF zfact_iso_inj], simp add:mod_ring_def)


[STATEMENT]
lemma ord_Suc_0_right [simp]: "ord (n::nat) (Suc 0) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord n (Suc 0) = 1
[PROOF STEP]
using ord_divides[of 1 1 n]
[PROOF STATE]
proof (prove)
using this:
[1 ^ 1 = 1] (mod n) = is_unit (ord n 1)

goal (1 subgoal):
 1. ord n (Suc 0) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma (in domain) pow_non_zero:
  "x \<in> carrier R \<Longrightarrow> x \<noteq> \<zero> \<Longrightarrow> x [^] (n :: nat) \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> x [^] n \<noteq> \<zero>
[PROOF STEP]
using integral
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<otimes> ?b = \<zero>; ?a \<in> carrier R; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> ?a = \<zero> \<or> ?b = \<zero>

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> x [^] n \<noteq> \<zero>
[PROOF STEP]
by (induction n, auto)


[STATEMENT]
lemma mat_of_col_dim[simp]: "dim_row (mat_of_col v) = dim_vec v"
  "dim_col (mat_of_col v) = 1"
  "mat_of_col v \<in> carrier_mat (dim_vec v) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_of_col v) = dim_vec v &&& dim_col (mat_of_col v) = 1 &&& mat_of_col v \<in> carrier_mat (dim_vec v) 1
[PROOF STEP]
unfolding mat_of_col_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_of_row v)\<^sup>T = dim_vec v &&& dim_col (mat_of_row v)\<^sup>T = 1 &&& (mat_of_row v)\<^sup>T \<in> carrier_mat (dim_vec v) 1
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_sum_legendre_aux:
  assumes "prime p"
  shows   "finite {m. m > 0 \<and> real (p ^ m) \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {m. 0 < m \<and> real (p ^ m) \<le> x}
[PROOF STEP]
by (rule finite_subset[OF _ exponents_le_finite[where k = 1 and l = 0 and p = p]])
     (use assms prime_gt_1_nat[of p] in auto)


[STATEMENT]
lemma interval_integral_eq_integral:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  shows "a \<le> b \<Longrightarrow> set_integrable lborel {a..b} f \<Longrightarrow> LBINT x=a..b. f x = integral {a..b} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; set_integrable lborel {a..b} f\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel (ereal a) (ereal b) f = integral {a..b} f
[PROOF STEP]
by (subst interval_integral_Icc, simp) (rule set_borel_integral_eq_integral)


[STATEMENT]
lemma add_frac_eq:
  assumes "x \<in> carrier R" "y \<in> carrier R" "z \<in> carrier R" "w \<in> carrier R"
    and "y \<noteq> \<zero>" "z \<noteq> \<zero>"
  shows "x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
z \<in> carrier R
w \<in> carrier R
y \<noteq> \<zero>
z \<noteq> \<zero>
[PROOF STEP]
have "x \<oslash> y \<oplus> w \<oslash> z = x \<otimes> inv y \<otimes> (z \<otimes> inv z) \<oplus> w \<otimes> inv z \<otimes> (y \<otimes> inv y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
z \<in> carrier R
w \<in> carrier R
y \<noteq> \<zero>
z \<noteq> \<zero>

goal (1 subgoal):
 1. x \<oslash> y \<oplus> w \<oslash> z = x \<otimes> inv y \<otimes> (z \<otimes> inv z) \<oplus> w \<otimes> inv z \<otimes> (y \<otimes> inv y)
[PROOF STEP]
by (simp add: m_div_def)
[PROOF STATE]
proof (state)
this:
x \<oslash> y \<oplus> w \<oslash> z = x \<otimes> inv y \<otimes> (z \<otimes> inv z) \<oplus> w \<otimes> inv z \<otimes> (y \<otimes> inv y)

goal (1 subgoal):
 1. x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<oslash> y \<oplus> w \<oslash> z = x \<otimes> inv y \<otimes> (z \<otimes> inv z) \<oplus> w \<otimes> inv z \<otimes> (y \<otimes> inv y)

goal (1 subgoal):
 1. x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
z \<in> carrier R
w \<in> carrier R
y \<noteq> \<zero>
z \<noteq> \<zero>
[PROOF STEP]
have "\<dots> = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
z \<in> carrier R
w \<in> carrier R
y \<noteq> \<zero>
z \<noteq> \<zero>

goal (1 subgoal):
 1. x \<otimes> inv y \<otimes> (z \<otimes> inv z) \<oplus> w \<otimes> inv z \<otimes> (y \<otimes> inv y) = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
by (simp add: m_div_def nonzero_inverse_mult_distrib r_distr m_ac integral_iff del: r_inv)
[PROOF STATE]
proof (state)
this:
x \<otimes> inv y \<otimes> (z \<otimes> inv z) \<oplus> w \<otimes> inv z \<otimes> (y \<otimes> inv y) = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)

goal (1 subgoal):
 1. x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)

goal (1 subgoal):
 1. x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<oslash> y \<oplus> w \<oslash> z = (x \<otimes> z \<oplus> w \<otimes> y) \<oslash> (y \<otimes> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integer_word8_bounded_eq:
   assumes "0 \<le> i"
    and "i \<le> 2 ^ LENGTH(8) - 1"
  shows "integer_of_word8 (word8_of_integer i) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_word8 (word8_of_integer i) = i
[PROOF STEP]
unfolding word8_of_integer_def integer_of_word8_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_word (word_of_integer i) = i
[PROOF STEP]
using integer_word_bounded_eq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?i; ?i \<le> 2 ^ LENGTH(?'a) - 1\<rbrakk> \<Longrightarrow> integer_of_word (word_of_integer ?i) = ?i
0 \<le> i
i \<le> 2 ^ LENGTH(8) - 1

goal (1 subgoal):
 1. integer_of_word (word_of_integer i) = i
[PROOF STEP]
by blast


[STATEMENT]
lemma gfp_eq_fixp:
  fixes f :: "'a :: complete_lattice \<Rightarrow> 'a"
  assumes f: "monotone (\<ge>) (\<ge>) f"
  shows "gfp f = ccpo.fixp Inf (\<ge>) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp f = ccpo.fixp Inf (\<lambda>x y. y \<le> x) f
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. gfp f \<le> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f
 2. ccpo.fixp Inf (\<lambda>x y. y \<le> x) f \<le> gfp f
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
monotone (\<lambda>x y. y \<le> x) (\<lambda>x y. y \<le> x) f
[PROOF STEP]
have f': "mono f"
[PROOF STATE]
proof (prove)
using this:
monotone (\<lambda>x y. y \<le> x) (\<lambda>x y. y \<le> x) f

goal (1 subgoal):
 1. mono f
[PROOF STEP]
by(simp add: mono_def monotone_def)
[PROOF STATE]
proof (state)
this:
mono f

goal (2 subgoals):
 1. gfp f \<le> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f
 2. ccpo.fixp Inf (\<lambda>x y. y \<le> x) f \<le> gfp f
[PROOF STEP]
interpret ccpo Inf "(\<ge>)" "mk_less (\<ge>) :: 'a \<Rightarrow> _"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.ccpo Inf (\<lambda>x y. y \<le> x) (mk_less (\<lambda>x y. y \<le> x))
[PROOF STEP]
by(rule ccpo)(rule complete_lattice.lattice_partial_function_definition[OF dual_complete_lattice])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. gfp f \<le> fixp f
 2. fixp f \<le> gfp f
[PROOF STEP]
show "ccpo.fixp Inf (\<ge>) f \<le> gfp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fixp f \<le> gfp f
[PROOF STEP]
by(rule gfp_upperbound)(subst fixp_unfold[OF f], rule order_refl)
[PROOF STATE]
proof (state)
this:
fixp f \<le> gfp f

goal (1 subgoal):
 1. gfp f \<le> fixp f
[PROOF STEP]
show "gfp f \<le> ccpo.fixp Inf (\<ge>) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp f \<le> fixp f
[PROOF STEP]
by(rule fixp_lowerbound[OF f])(subst gfp_unfold[OF f'], rule order_refl)
[PROOF STATE]
proof (state)
this:
gfp f \<le> fixp f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma height_bal_list:
  "n \<le> length xs \<Longrightarrow> height (bal_list n xs) = nat \<lceil>log 2 (n + 1)\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length xs \<Longrightarrow> height (bal_list n xs) = nat \<lceil>log 2 (real (n + 1))\<rceil>
[PROOF STEP]
unfolding bal_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length xs \<Longrightarrow> height (fst (bal n xs)) = nat \<lceil>log 2 (real (n + 1))\<rceil>
[PROOF STEP]
by (metis height_bal prod.collapse)


[STATEMENT]
lemma "(\<Inter>x \<in> C. f x \<inter> g x) = \<Inter>(f ` C) \<inter> \<Inter>(g ` C)"
  \<comment> \<open>Inter-image, called \<open>Int_Inter_image\<close> in Main HOL\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>x\<in>C. f x \<inter> g x) = \<Inter> (f ` C) \<inter> \<Inter> (g ` C)
[PROOF STEP]
by blast


[STATEMENT]
lemma isTrue_prv_PPf_prf_or_neg:
"prf \<in> proof \<Longrightarrow> \<phi> \<in> fmla \<Longrightarrow> Fvars \<phi> = {} \<Longrightarrow>
    bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>) \<or> bprv (neg (PPf (encPf prf) \<langle>\<phi>\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prf \<in> proof; \<phi> \<in> fmla; Fvars \<phi> = {}\<rbrakk> \<Longrightarrow> bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>) \<or> bprv (neg (PPf (encPf prf) \<langle>\<phi>\<rangle>))
[PROOF STEP]
using not_prfOf_PPf prfOf_PPf
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?prf \<in> proof; ?\<phi> \<in> fmla; Fvars ?\<phi> = {}; \<not> prfOf ?prf ?\<phi>\<rbrakk> \<Longrightarrow> bprv (neg (PPf (encPf ?prf) \<langle>?\<phi>\<rangle>))
\<lbrakk>?prf \<in> proof; ?\<phi> \<in> fmla; Fvars ?\<phi> = {}; prfOf ?prf ?\<phi>\<rbrakk> \<Longrightarrow> bprv (PPf (encPf ?prf) \<langle>?\<phi>\<rangle>)

goal (1 subgoal):
 1. \<lbrakk>prf \<in> proof; \<phi> \<in> fmla; Fvars \<phi> = {}\<rbrakk> \<Longrightarrow> bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>) \<or> bprv (neg (PPf (encPf prf) \<langle>\<phi>\<rangle>))
[PROOF STEP]
by blast


[STATEMENT]
lemma ldropn_ltake: "ldropn n (ltake m xs) = ltake (m - enat n) (ldropn n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ldropn n (ltake m xs) = ltake (m - enat n) (ldropn n xs)
[PROOF STEP]
by(induct n arbitrary: m xs)(auto simp add: zero_enat_def[symmetric] ltake_LCons ldropn_Suc eSuc_enat[symmetric] iadd_Suc_right split: llist.split co.enat.split_asm)


[STATEMENT]
lemma analytic_on_divide [analytic_intros]:
  assumes f: "f analytic_on S"
      and g: "g analytic_on S"
      and nz: "(\<And>z. z \<in> S \<Longrightarrow> g z \<noteq> 0)"
    shows "(\<lambda>z. f z / g z) analytic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. f z / g z) analytic_on S
[PROOF STEP]
unfolding divide_inverse
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. f z * inverse (g z)) analytic_on S
[PROOF STEP]
by (metis analytic_on_inverse analytic_on_mult f g nz)


[STATEMENT]
lemma sum_tree_list_children: "\<forall>t \<in> set ts. t \<noteq> Leaf \<Longrightarrow>
  (\<Sum>t\<leftarrow>ts. k * size t) = (\<Sum>t \<leftarrow> map left ts @ map right ts. k * size t) + k * length ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>set ts. t \<noteq> \<langle>\<rangle> \<Longrightarrow> (\<Sum>t\<leftarrow>ts. k * size t) = (\<Sum>t\<leftarrow>map left ts @ map right ts. k * size t) + k * length ts
[PROOF STEP]
by(induction ts)(auto simp add: neq_Leaf_iff algebra_simps)


[STATEMENT]
lemma open_affinity:
  fixes S :: "'a::real_normed_vector set"
  assumes "open S"  "c \<noteq> 0"
  shows "open ((\<lambda>x. a + c *\<^sub>R x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open ((\<lambda>x. a + c *\<^sub>R x) ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open ((\<lambda>x. a + c *\<^sub>R x) ` S)
[PROOF STEP]
have *: "(\<lambda>x. a + c *\<^sub>R x) = (\<lambda>x. a + x) \<circ> (\<lambda>x. c *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + c *\<^sub>R x) = (+) a \<circ> (*\<^sub>R) c
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + c *\<^sub>R x) = (\<lambda>x. a + c *\<^sub>R x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a + c *\<^sub>R x) = (+) a \<circ> (*\<^sub>R) c

goal (1 subgoal):
 1. open ((\<lambda>x. a + c *\<^sub>R x) ` S)
[PROOF STEP]
have "(+) a ` (*\<^sub>R) c ` S = ((+) a \<circ> (*\<^sub>R) c) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) a ` (*\<^sub>R) c ` S = ((+) a \<circ> (*\<^sub>R) c) ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(+) a ` (*\<^sub>R) c ` S = ((+) a \<circ> (*\<^sub>R) c) ` S

goal (1 subgoal):
 1. open ((\<lambda>x. a + c *\<^sub>R x) ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(+) a ` (*\<^sub>R) c ` S = ((+) a \<circ> (*\<^sub>R) c) ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(+) a ` (*\<^sub>R) c ` S = ((+) a \<circ> (*\<^sub>R) c) ` S

goal (1 subgoal):
 1. open ((\<lambda>x. a + c *\<^sub>R x) ` S)
[PROOF STEP]
using assms open_translation[of "(*\<^sub>R) c ` S" a]
[PROOF STATE]
proof (prove)
using this:
(+) a ` (*\<^sub>R) c ` S = ((+) a \<circ> (*\<^sub>R) c) ` S
open S
c \<noteq> 0
open ((*\<^sub>R) c ` S) \<Longrightarrow> open ((+) a ` (*\<^sub>R) c ` S)

goal (1 subgoal):
 1. open ((\<lambda>x. a + c *\<^sub>R x) ` S)
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
(+) a ` (*\<^sub>R) c ` S = ((+) a \<circ> (*\<^sub>R) c) ` S
open S
c \<noteq> 0
open ((*\<^sub>R) c ` S) \<Longrightarrow> open ((+) a ` (*\<^sub>R) c ` S)

goal (1 subgoal):
 1. open (((+) a \<circ> (*\<^sub>R) c) ` S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open ((\<lambda>x. a + c *\<^sub>R x) ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma asymp_equiv_cong:
  assumes "eventually (\<lambda>x. f1 x = f2 x) F" "eventually (\<lambda>x. g1 x = g2 x) F"
  shows   "f1 \<sim>[F] g1 \<longleftrightarrow> f2 \<sim>[F] g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f1 \<sim>[F] g1) = (f2 \<sim>[F] g2)
[PROOF STEP]
unfolding asymp_equiv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if f1 x = (0::'b) \<and> g1 x = (0::'b) then 1::'b else f1 x / g1 x) \<longlongrightarrow> (1::'b)) F = ((\<lambda>x. if f2 x = (0::'b) \<and> g2 x = (0::'b) then 1::'b else f2 x / g2 x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
proof (rule tendsto_cong, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (if f1 x = (0::'b) \<and> g1 x = (0::'b) then 1::'b else f1 x / g1 x) = (if f2 x = (0::'b) \<and> g2 x = (0::'b) then 1::'b else f2 x / g2 x)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (if f1 x = (0::'b) \<and> g1 x = (0::'b) then 1::'b else f1 x / g1 x) = (if f2 x = (0::'b) \<and> g2 x = (0::'b) then 1::'b else f2 x / g2 x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f1 x = f2 x
\<forall>\<^sub>F x in F. g1 x = g2 x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f1 x = f2 x
\<forall>\<^sub>F x in F. g1 x = g2 x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (if f1 x = (0::'b) \<and> g1 x = (0::'b) then 1::'b else f1 x / g1 x) = (if f2 x = (0::'b) \<and> g2 x = (0::'b) then 1::'b else f2 x / g2 x)
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. (if f1 x = (0::'b) \<and> g1 x = (0::'b) then 1::'b else f1 x / g1 x) = (if f2 x = (0::'b) \<and> g2 x = (0::'b) then 1::'b else f2 x / g2 x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sigma2_lemma [simp]:
  shows "rec_eval (rec_sigma2 f) [x, y1, y2] = (\<Sum> z \<le> x. rec_eval f  [z, y1, y2])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_sigma2 f) [x, y1, y2] = (\<Sum>z\<le>x. rec_eval f [z, y1, y2])
[PROOF STEP]
by (induct x) (simp_all add: rec_sigma2_def)


[STATEMENT]
lemma Eps1_inverse [simp]:
  "Base (x::'a::real_normed_field hyperdual) \<noteq> 0 \<Longrightarrow> Eps1 (inverse x) = - Eps1 x * (1 / (Base x)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Base x \<noteq> (0::'a) \<Longrightarrow> Eps1 (inverse x) = - Eps1 x * ((1::'a) / (Base x)\<^sup>2)
[PROOF STEP]
by simp


[STATEMENT]
lemma bigo_const_mult4: "c \<noteq> 0 \<Longrightarrow> O(f) \<subseteq> O(\<lambda>x. c * f x)"
  for c :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> O(f) \<subseteq> O(\<lambda>x. c * f x)
[PROOF STEP]
apply (rule bigo_elt_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> f \<in> O(\<lambda>x. c * f x)
[PROOF STEP]
apply (rule bigo_const_mult3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> c \<noteq> (0::'a)
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poly_prod_0: "finite ps \<Longrightarrow> poly (prod f ps) x = (0 :: 'a :: field) \<longleftrightarrow> (\<exists> p \<in> ps. poly (f p) x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ps \<Longrightarrow> (poly (prod f ps) x = (0::'a)) = (\<exists>p\<in>ps. poly (f p) x = (0::'a))
[PROOF STEP]
by (induct ps rule: finite_induct, auto)