[STATEMENT]
lemma div_right_ineq:
 assumes "(x::nat) < y*z"
 shows " (x div y) < z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x div y < z
[PROOF STEP]
using assms div_left_ineq mult.commute
[PROOF STATE]
proof (prove)
using this:
x < y * z
?x < ?y * ?z \<Longrightarrow> ?x div ?z < ?y
?a * ?b = ?b * ?a

goal (1 subgoal):
 1. x div y < z
[PROOF STEP]
by (metis)


[STATEMENT]
lemma packing_alt_def_all: "\<forall> ps \<subseteq> \<V> . card ps = \<t> \<longrightarrow> \<B> index ps \<le> \<Lambda>\<^sub>t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ps\<subseteq>\<V>. card ps = \<t> \<longrightarrow> \<B> index ps \<le> \<Lambda>\<^sub>t
[PROOF STEP]
using packing
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?ps \<subseteq> \<V>; card ?ps = \<t>\<rbrakk> \<Longrightarrow> \<B> index ?ps \<le> \<Lambda>\<^sub>t

goal (1 subgoal):
 1. \<forall>ps\<subseteq>\<V>. card ps = \<t> \<longrightarrow> \<B> index ps \<le> \<Lambda>\<^sub>t
[PROOF STEP]
by auto


[STATEMENT]
lemma hbex_One [simp]: "(\<exists>x\<^bold>\<in>1. P x) = P 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HBex 1 P = P 0
[PROOF STEP]
by (simp add: One_hf_eq_succ)


[STATEMENT]
lemma matrix_append_rows_eq_if_preserves:
  assumes A: "A \<in> carrier_mat (m+p) n" and B: "B \<in> carrier_mat p n"
    and eq: "\<forall>i\<in>{m..<m+p}.\<forall>j<n. A$$(i,j) = B $$ (i-m,j)"
  shows "A = mat_of_rows n [Matrix.row A i. i \<leftarrow> [0..<m]] @\<^sub>r B" (is "_ = ?A' @\<^sub>r _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B
[PROOF STEP]
proof (rule eq_matI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. dim_row A = dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
 3. dim_col A = dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
[PROOF STEP]
have A': "?A' \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows n (map (row A) [0..<m]) \<in> carrier_mat m n
[PROOF STEP]
by (simp add: mat_of_rows_def)
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A) [0..<m]) \<in> carrier_mat m n

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. dim_row A = dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
 3. dim_col A = dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
[PROOF STEP]
hence A'B: "?A' @\<^sub>r B \<in> carrier_mat (m+p) n"
[PROOF STATE]
proof (prove)
using this:
mat_of_rows n (map (row A) [0..<m]) \<in> carrier_mat m n

goal (1 subgoal):
 1. mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B \<in> carrier_mat (m + p) n
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
mat_of_rows n (map (row A) [0..<m]) \<in> carrier_mat m n
B \<in> carrier_mat p n

goal (1 subgoal):
 1. mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B \<in> carrier_mat (m + p) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B \<in> carrier_mat (m + p) n

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. dim_row A = dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
 3. dim_col A = dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
[PROOF STEP]
show "dim_row A = dim_row (?A' @\<^sub>r B)" and "dim_col A = dim_col (?A' @\<^sub>r B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) &&& dim_col A = dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
[PROOF STEP]
using A'B A
[PROOF STATE]
proof (prove)
using this:
mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B \<in> carrier_mat (m + p) n
A \<in> carrier_mat (m + p) n

goal (1 subgoal):
 1. dim_row A = dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) &&& dim_col A = dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row A = dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
dim_col A = dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
assume i: "i < dim_row (?A' @\<^sub>r B)"
    and j: "j < dim_col (?A' @\<^sub>r B)"
[PROOF STATE]
proof (state)
this:
i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)
j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
have jn: "j<n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (m + p) n

goal (1 subgoal):
 1. j < n
[PROOF STEP]
by (metis append_rows_def dim_col_mat(1) index_mat_four_block(3) index_zero_mat(3)
        j mat_of_rows_def nat_arith.rule0)
[PROOF STATE]
proof (state)
this:
j < n

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
let ?xs = "(map (Matrix.row A) [0..<m])"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B); j < dim_col (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B)\<rbrakk> \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
show "A $$ (i, j) = (?A' @\<^sub>r B) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
proof (cases "i<m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < m

goal (2 subgoals):
 1. i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
have "(?A' @\<^sub>r B) $$ (i, j) = ?A' $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = mat_of_rows n (map (row A) [0..<m]) $$ (i, j)
[PROOF STEP]
by (metis (no_types, lifting) Nat.add_0_right True append_rows_def diff_zero i
          index_mat_four_block index_zero_mat(3) j length_map length_upt mat_of_rows_carrier(2))
[PROOF STATE]
proof (state)
this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = mat_of_rows n (map (row A) [0..<m]) $$ (i, j)

goal (2 subgoals):
 1. i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = mat_of_rows n (map (row A) [0..<m]) $$ (i, j)

goal (2 subgoals):
 1. i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
have "... = ?xs ! i $v j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows n (map (row A) [0..<m]) $$ (i, j) = map (row A) [0..<m] ! i $v j
[PROOF STEP]
by (rule mat_of_rows_index, insert i True j, auto simp add: append_rows_def)
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A) [0..<m]) $$ (i, j) = map (row A) [0..<m] ! i $v j

goal (2 subgoals):
 1. i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A) [0..<m]) $$ (i, j) = map (row A) [0..<m] ! i $v j

goal (2 subgoals):
 1. i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
have "... = A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (row A) [0..<m] ! i $v j = A $$ (i, j)
[PROOF STEP]
by (rule map_first_rows_index, insert assms A True i jn, auto)
[PROOF STATE]
proof (state)
this:
map (row A) [0..<m] ! i $v j = A $$ (i, j)

goal (2 subgoals):
 1. i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
 2. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = A $$ (i, j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = A $$ (i, j)

goal (1 subgoal):
 1. A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)

goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < m

goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
have "(?A' @\<^sub>r B) $$ (i, j) = B $$ (i-m,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = B $$ (i - m, j)
[PROOF STEP]
by (smt (z3) A' carrier_matD(1) False append_rows_def i index_mat_four_block j jn length_map
          length_upt mat_of_rows_carrier(2,3))
[PROOF STATE]
proof (state)
this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = B $$ (i - m, j)

goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = B $$ (i - m, j)

goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
have "... = A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B $$ (i - m, j) = A $$ (i, j)
[PROOF STEP]
by (metis False append_rows_def B eq atLeastLessThan_iff carrier_matD(1) diff_zero i
          index_mat_four_block(2) index_zero_mat(2) jn le_add1 length_map length_upt
          linordered_semidom_class.add_diff_inverse mat_of_rows_carrier(2))
[PROOF STATE]
proof (state)
this:
B $$ (i - m, j) = A $$ (i, j)

goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = A $$ (i, j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j) = A $$ (i, j)

goal (1 subgoal):
 1. A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A $$ (i, j) = (mat_of_rows n (map (row A) [0..<m]) @\<^sub>r B) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l6:
  "-x \<sqinter> --x = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x \<sqinter> - - x = bot
[PROOF STEP]
by (metis l3 l5 a_inf_complement_bot a_stone il_inf_left_unit il_inf_right_dist_sup il_inf_right_unit il_less_eq il_sub_inf_right_isotone il_unit_bot)


[STATEMENT]
lemma poly_eq_fold_coeffs:
  \<open>poly p = fold_coeffs (\<lambda>a f x. a + x * f x) p (\<lambda>x. 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p = fold_coeffs (\<lambda>a f x. a + x * f x) p (\<lambda>x. 0::'a)
[PROOF STEP]
by (induction p) (auto simp add: fun_eq_iff poly_def)


[STATEMENT]
lemma list_to_lpoly_dim_less: "length cs \<ge> dim_poly (list_to_lpoly cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_poly (list_to_lpoly cs) \<le> length cs
[PROOF STEP]
using dimpoly_all_zero_limit sum_list_map_upto_coeff_limit
[PROOF STATE]
proof (prove)
using this:
(\<And>i. ?d \<le> i \<Longrightarrow> Abstract_Linear_Poly.coeff ?x i = 0) \<Longrightarrow> dim_poly ?x \<le> ?d
length ?L \<le> ?i \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly ?L) ?i = 0

goal (1 subgoal):
 1. dim_poly (list_to_lpoly cs) \<le> length cs
[PROOF STEP]
by blast


[STATEMENT]
lemma isPath_append[split_path_simps]:
  "isPath u (p1 @ p2) v \<longleftrightarrow> (\<exists>w. isPath u p1 w \<and> isPath w p2 v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isPath u (p1 @ p2) v = (\<exists>w. isPath u p1 w \<and> isPath w p2 v)
[PROOF STEP]
by (induction p1 arbitrary: u) auto


[STATEMENT]
lemma show8:
  fixes d ::"nat\<Rightarrow>real " and a :: "nat\<Rightarrow>int" and s k::nat
  assumes "A > 1" and d: "\<forall>n. d n> 1"  and a:"\<forall>n. a n>0" and "s>0"
    and "convergent_prod d"
    and assu2: "\<forall>n \<ge> s. A / of_int (a n) powr (1 / of_int (2^n)) > (\<Prod>j. d (n + j))"
  shows "\<forall>n\<ge>s. (\<Prod>j. d (j+n)) < A / (MAX j\<in>{s..n}. of_int (a j) powr (1 / of_int (2 ^ j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n\<ge>s. (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
proof (intro strip)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
assume "s \<le> n"
[PROOF STATE]
proof (state)
this:
s \<le> n

goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
define sp where "sp \<equiv> (\<lambda>n. \<Prod>j. d (j+n))"
[PROOF STATE]
proof (state)
this:
sp \<equiv> \<lambda>n. \<Prod>j. d (j + n)

goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
define ff where "ff \<equiv> (\<lambda>(j::nat). (real_of_int (a j)) powr(1 /of_int (2^j)))"
[PROOF STATE]
proof (state)
this:
ff \<equiv> \<lambda>j. real_of_int (a j) powr (1 / real_of_int (2 ^ j))

goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
have "sp i \<ge> sp n" when "i\<le>n" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
have "(\<Prod>j. d (j + i)) = (\<Prod>ia. d (ia + (n - i) + i)) * (\<Prod>ia<n - i. d (ia + i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>j. d (j + i)) = (\<Prod>ia. d (ia + (n - i) + i)) * (\<Prod>ia<n - i. d (ia + i))
[PROOF STEP]
proof (rule prodinf_split_initial_segment)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convergent_prod (\<lambda>j. d (j + i))
 2. \<And>ia. ia < n - i \<Longrightarrow> d (ia + i) \<noteq> 0
[PROOF STEP]
show "convergent_prod (\<lambda>j. d (j + i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod (\<lambda>j. d (j + i))
[PROOF STEP]
using \<open>convergent_prod d\<close> convergent_prod_iff_shift[of d i]
[PROOF STATE]
proof (prove)
using this:
convergent_prod d
convergent_prod (\<lambda>ia. d (ia + i)) = convergent_prod d

goal (1 subgoal):
 1. convergent_prod (\<lambda>j. d (j + i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convergent_prod (\<lambda>j. d (j + i))

goal (1 subgoal):
 1. \<And>ia. ia < n - i \<Longrightarrow> d (ia + i) \<noteq> 0
[PROOF STEP]
show "\<And>j. j < n - i \<Longrightarrow> d (j + i) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j < n - i \<Longrightarrow> d (j + i) \<noteq> 0
[PROOF STEP]
by (metis d not_one_less_zero)
[PROOF STATE]
proof (state)
this:
?j < n - i \<Longrightarrow> d (?j + i) \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Prod>j. d (j + i)) = (\<Prod>ia. d (ia + (n - i) + i)) * (\<Prod>ia<n - i. d (ia + i))

goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>j. d (j + i)) = (\<Prod>ia. d (ia + (n - i) + i)) * (\<Prod>ia<n - i. d (ia + i))
[PROOF STEP]
have "sp i = sp n * (\<Prod>j<n - i. d (i + j))"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>j. d (j + i)) = (\<Prod>ia. d (ia + (n - i) + i)) * (\<Prod>ia<n - i. d (ia + i))

goal (1 subgoal):
 1. sp i = sp n * (\<Prod>j<n - i. d (i + j))
[PROOF STEP]
unfolding sp_def
[PROOF STATE]
proof (prove)
using this:
(\<Prod>j. d (j + i)) = (\<Prod>ia. d (ia + (n - i) + i)) * (\<Prod>ia<n - i. d (ia + i))

goal (1 subgoal):
 1. (\<Prod>j. d (j + i)) = (\<Prod>j. d (j + n)) * (\<Prod>j<n - i. d (i + j))
[PROOF STEP]
using \<open>n\<ge>i\<close>
[PROOF STATE]
proof (prove)
using this:
(\<Prod>j. d (j + i)) = (\<Prod>ia. d (ia + (n - i) + i)) * (\<Prod>ia<n - i. d (ia + i))
i \<le> n

goal (1 subgoal):
 1. (\<Prod>j. d (j + i)) = (\<Prod>j. d (j + n)) * (\<Prod>j<n - i. d (i + j))
[PROOF STEP]
by (auto simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
sp i = sp n * (\<Prod>j<n - i. d (i + j))

goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sp i = sp n * (\<Prod>j<n - i. d (i + j))

goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
have "sp i>1" "sp n>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < sp i &&& 1 < sp n
[PROOF STEP]
unfolding sp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < (\<Prod>j. d (j + i)) &&& 1 < (\<Prod>j. d (j + n))
[PROOF STEP]
using convergent_prod_iff_shift \<open>convergent_prod d\<close> d
[PROOF STATE]
proof (prove)
using this:
convergent_prod (\<lambda>i. ?f (i + ?n)) = convergent_prod ?f
convergent_prod d
\<forall>n. 1 < d n

goal (1 subgoal):
 1. 1 < (\<Prod>j. d (j + i)) &&& 1 < (\<Prod>j. d (j + n))
[PROOF STEP]
by (auto intro!:less_1_prodinf)
[PROOF STATE]
proof (state)
this:
1 < sp i
1 < sp n

goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < sp i
1 < sp n

goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
have "(\<Prod>j<n - i. d (i + j)) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> (\<Prod>j<n - i. d (i + j))
[PROOF STEP]
using d less_imp_le
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 1 < d n
?x < ?y \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. 1 \<le> (\<Prod>j<n - i. d (i + j))
[PROOF STEP]
by (auto intro: prod_ge_1)
[PROOF STATE]
proof (state)
this:
1 \<le> (\<Prod>j<n - i. d (i + j))

goal (1 subgoal):
 1. sp n \<le> sp i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sp i = sp n * (\<Prod>j<n - i. d (i + j))
1 < sp i
1 < sp n
1 \<le> (\<Prod>j<n - i. d (i + j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sp i = sp n * (\<Prod>j<n - i. d (i + j))
1 < sp i
1 < sp n
1 \<le> (\<Prod>j<n - i. d (i + j))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i \<le> n \<Longrightarrow> sp n \<le> sp ?i

goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?i \<le> n \<Longrightarrow> sp n \<le> sp ?i

goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
have "\<forall>j\<ge>s. A / ff j > sp j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j\<ge>s. sp j < A / ff j
[PROOF STEP]
unfolding ff_def sp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j\<ge>s. (\<Prod>ja. d (ja + j)) < A / real_of_int (a j) powr (1 / real_of_int (2 ^ j))
[PROOF STEP]
using assu2
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>s. (\<Prod>j. d (n + j)) < A / real_of_int (a n) powr (1 / real_of_int (2 ^ n))

goal (1 subgoal):
 1. \<forall>j\<ge>s. (\<Prod>ja. d (ja + j)) < A / real_of_int (a j) powr (1 / real_of_int (2 ^ j))
[PROOF STEP]
by (auto simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
\<forall>j\<ge>s. sp j < A / ff j

goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?i \<le> n \<Longrightarrow> sp n \<le> sp ?i
\<forall>j\<ge>s. sp j < A / ff j
[PROOF STEP]
have "\<forall>j. s\<le>j \<and> j\<le>n \<longrightarrow> A / ff j > sp n"
[PROOF STATE]
proof (prove)
using this:
?i \<le> n \<Longrightarrow> sp n \<le> sp ?i
\<forall>j\<ge>s. sp j < A / ff j

goal (1 subgoal):
 1. \<forall>j. s \<le> j \<and> j \<le> n \<longrightarrow> sp n < A / ff j
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>j. s \<le> j \<and> j \<le> n \<longrightarrow> sp n < A / ff j

goal (1 subgoal):
 1. \<And>n. s \<le> n \<Longrightarrow> (\<Prod>j. d (j + n)) < A / (MAX j\<in>{s..n}. real_of_int (a j) powr (1 / real_of_int (2 ^ j)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>j. s \<le> j \<and> j \<le> n \<longrightarrow> sp n < A / ff j
[PROOF STEP]
show "sp n< A / Max (ff ` {s..n})"
[PROOF STATE]
proof (prove)
using this:
\<forall>j. s \<le> j \<and> j \<le> n \<longrightarrow> sp n < A / ff j

goal (1 subgoal):
 1. sp n < A / Max (ff ` {s..n})
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) Max_in \<open>n\<ge>s\<close> atLeastAtMost_iff empty_iff
        finite_atLeastAtMost finite_imageI imageE image_is_empty order_refl)
[PROOF STATE]
proof (state)
this:
sp n < A / Max (ff ` {s..n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma partitions_remove1:
  assumes partitions: "p partitions n"
  assumes gr0: "0 < p k"
  shows "p(k := p k - 1) partitions (n - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p(k := p k - 1) partitions n - k
[PROOF STEP]
proof (rule partitionsI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. (p(k := p k - 1)) i \<noteq> 0 \<Longrightarrow> 1 \<le> i \<and> i \<le> n - k
 2. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. (p(k := p k - 1)) i \<noteq> 0 \<Longrightarrow> 1 \<le> i \<and> i \<le> n - k
 2. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
assume "(p(k := p k - 1)) i \<noteq> 0"
[PROOF STATE]
proof (state)
this:
(p(k := p k - 1)) i \<noteq> 0

goal (2 subgoals):
 1. \<And>i. (p(k := p k - 1)) i \<noteq> 0 \<Longrightarrow> 1 \<le> i \<and> i \<le> n - k
 2. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(p(k := p k - 1)) i \<noteq> 0
[PROOF STEP]
show "1 \<le> i \<and> i \<le> n - k"
[PROOF STATE]
proof (prove)
using this:
(p(k := p k - 1)) i \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> i \<and> i \<le> n - k
[PROOF STEP]
using partitions_remove1_bounds partitions gr0
[PROOF STATE]
proof (prove)
using this:
(p(k := p k - 1)) i \<noteq> 0
\<lbrakk>?p partitions ?n; 0 < ?p ?k; (?p(?k := ?p ?k - 1)) ?i \<noteq> 0\<rbrakk> \<Longrightarrow> 1 \<le> ?i \<and> ?i \<le> ?n - ?k
p partitions n
0 < p k

goal (1 subgoal):
 1. 1 \<le> i \<and> i \<le> n - k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 \<le> i \<and> i \<le> n - k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
from partitions gr0
[PROOF STATE]
proof (chain)
picking this:
p partitions n
0 < p k
[PROOF STEP]
have "k \<le> n"
[PROOF STATE]
proof (prove)
using this:
p partitions n
0 < p k

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

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
have "(\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = (\<Sum>i\<le>n. (p(k := p k - 1)) i * i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = (\<Sum>i\<le>n. (p(k := p k - 1)) i * i)
[PROOF STEP]
using partitions_remove1_bounds partitions gr0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p partitions ?n; 0 < ?p ?k; (?p(?k := ?p ?k - 1)) ?i \<noteq> 0\<rbrakk> \<Longrightarrow> 1 \<le> ?i \<and> ?i \<le> ?n - ?k
p partitions n
0 < p k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = (\<Sum>i\<le>n. (p(k := p k - 1)) i * i)
[PROOF STEP]
by (auto intro!: sum.mono_neutral_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = (\<Sum>i\<le>n. (p(k := p k - 1)) i * i)

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = (\<Sum>i\<le>n. (p(k := p k - 1)) i * i)

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
have "... = (p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. (p(k := p k - 1)) i * i) = (p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i)
[PROOF STEP]
using \<open>k \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. (\<Sum>i\<le>n. (p(k := p k - 1)) i * i) = (p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i)
[PROOF STEP]
by (simp add: sum_atMost_remove_nat[where k="k"])
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. (p(k := p k - 1)) i * i) = (p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i)

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. (p(k := p k - 1)) i * i) = (p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i)

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
have "... = p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i) = p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k
[PROOF STEP]
using gr0
[PROOF STATE]
proof (prove)
using this:
0 < p k

goal (1 subgoal):
 1. (p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i) = p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k
[PROOF STEP]
by (simp add: diff_mult_distrib)
[PROOF STATE]
proof (state)
this:
(p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i) = p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(p k - 1) * k + (\<Sum>i\<in>{..n} - {k}. (p(k := p k - 1)) i * i) = p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
have "... = (\<Sum>i\<le>n. p i * i) - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k = (\<Sum>i\<le>n. p i * i) - k
[PROOF STEP]
using \<open>k \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k = (\<Sum>i\<le>n. p i * i) - k
[PROOF STEP]
by (simp add: sum_atMost_remove_nat[of k])
[PROOF STATE]
proof (state)
this:
p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k = (\<Sum>i\<le>n. p i * i) - k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p k * k + (\<Sum>i\<in>{..n} - {k}. p i * i) - k = (\<Sum>i\<le>n. p i * i) - k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
from partitions
[PROOF STATE]
proof (chain)
picking this:
p partitions n
[PROOF STEP]
have "... = n - k"
[PROOF STATE]
proof (prove)
using this:
p partitions n

goal (1 subgoal):
 1. (\<Sum>i\<le>n. p i * i) - k = n - k
[PROOF STEP]
by (auto elim: partitionsE)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. p i * i) - k = n - k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
show "(\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k

goal (1 subgoal):
 1. (\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n - k. (p(k := p k - 1)) i * i) = n - k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bubble_sort: "y \<cdot> x \<le> x \<cdot> y \<Longrightarrow> (x + y)\<^sup>\<star> = x\<^sup>\<star> \<cdot> y\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<cdot> x \<le> x \<cdot> y \<Longrightarrow> (x + y)\<^sup>\<star> = x\<^sup>\<star> \<cdot> y\<^sup>\<star>
[PROOF STEP]
by (fastforce intro: star_sim4)


[STATEMENT]
lemma Im6_tendsto_upperbound:
   "\<lbrakk>(f \<longlongrightarrow> limit) net; \<forall>\<^sub>F x in net. Im6 (f x) \<le> b; net \<noteq> bot\<rbrakk> \<Longrightarrow> Im6 limit \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> limit) net; \<forall>\<^sub>F x in net. Im6 (f x) \<le> b; net \<noteq> bot\<rbrakk> \<Longrightarrow> Im6 limit \<le> b
[PROOF STEP]
by (blast intro: tendsto_upperbound [OF tendsto_Im6])


[STATEMENT]
lemma lookup_empty: "lookup (empty ko) k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (local.empty ko) k = (0::'b)
[PROOF STEP]
by (simp add: lookup_def)


[STATEMENT]
lemma iTILL_sub: "k \<ominus> [\<dots>n] = (if n \<le> k then [k - n\<dots>,n] else [\<dots>k])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<ominus> [\<dots>n] = (if n \<le> k then [k - n\<dots>,n] else [\<dots>k])
[PROOF STEP]
by (force simp add: set_eq_iff iT_Minus_mem_iff iT_iff)


[STATEMENT]
lemma is_ground_cls_as_atms: "is_ground_cls C \<longleftrightarrow> (\<forall>A \<in> atms_of C. is_ground_atm A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_ground_cls C = Ball (atms_of C) is_ground_atm
[PROOF STEP]
by (auto simp: atms_of_def is_ground_cls_def is_ground_lit_def)


[STATEMENT]
lemma lexer_correct_None:
  shows "s \<notin> lang r \<longleftrightarrow> lexer r s = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<notin> lang r) = (lexer r s = None)
[PROOF STEP]
apply(induct s arbitrary: r)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>r. ([] \<notin> lang r) = (lexer r [] = None)
 2. \<And>a s r. (\<And>r. (s \<notin> lang r) = (lexer r s = None)) \<Longrightarrow> (a # s \<notin> lang r) = (lexer r (a # s) = None)
[PROOF STEP]
apply(simp add: nullable_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s r. (\<And>r. (s \<notin> lang r) = (lexer r s = None)) \<Longrightarrow> (a # s \<notin> lang r) = (lexer r (a # s) = None)
[PROOF STEP]
apply(drule_tac x="deriv a r" in meta_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s r. (s \<notin> lang (deriv a r)) = (lexer (deriv a r) s = None) \<Longrightarrow> (a # s \<notin> lang r) = (lexer r (a # s) = None)
[PROOF STEP]
apply(auto simp add: lang_deriv Deriv_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma S_compatible_le_scheme_lists:
  fixes A A' :: "type_scheme list"
  shows "A' \<le> A \<Longrightarrow> $S A' \<le> $ S A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' \<le> A \<Longrightarrow> $ S A' \<le> $ S A
[PROOF STEP]
apply (unfold le_env_def app_subst_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length A = length A' \<and> (\<forall>i<length A'. A' ! i \<le> A ! i) \<Longrightarrow> length (map ($ S) A) = length (map ($ S) A') \<and> (\<forall>i<length (map ($ S) A'). map ($ S) A' ! i \<le> map ($ S) A ! i)
[PROOF STEP]
apply (simp cong add: conj_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length A = length A' \<and> (\<forall>i<length A'. A' ! i \<le> A ! i) \<Longrightarrow> \<forall>i<length A'. $ S (A' ! i) \<le> $ S (A ! i)
[PROOF STEP]
apply (fast intro!: S_compatible_le_scheme)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ordinal_oLog_exp: "oSuc 0 < b \<Longrightarrow> oLog b (b ** x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. oSuc 0 < b \<Longrightarrow> oLog b (b ** x) = x
[PROOF STEP]
by (simp add: oLog_def normal.oInv_inverse[OF normal_exp])


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


[STATEMENT]
lemma cardinal_eqpoll: "elts (vcard a) \<approx> elts a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (vcard a) \<approx> elts a
[PROOF STEP]
unfolding vcard_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (LEAST i. Ord i \<and> elts i \<approx> elts a) \<approx> elts a
[PROOF STEP]
using ordertype_eqpoll [of "elts a"] Ord_LeastI
[PROOF STATE]
proof (prove)
using this:
small (elts a) \<Longrightarrow> elts (ordertype (elts a) VWF) \<approx> elts a
\<lbrakk>Ord ?k; ?P ?k\<rbrakk> \<Longrightarrow> ?P (LEAST i. Ord i \<and> ?P i)

goal (1 subgoal):
 1. elts (LEAST i. Ord i \<and> elts i \<approx> elts a) \<approx> elts a
[PROOF STEP]
by (meson Ord_ordertype small_elts)


[STATEMENT]
lemma product_swap_mset: "image_mset prod.swap (A \<times># B) = B \<times># A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset prod.swap (A \<times># B) = B \<times># A
[PROOF STEP]
by (induction A) (auto simp add: Times_mset_single_left Times_mset_single_right
      Times_insert_right Times_insert_left)


[STATEMENT]
lemma Nats_less_HNatInfinite: "x \<in> Nats \<Longrightarrow> y \<in> HNatInfinite \<Longrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<nat>; y \<in> HNatInfinite\<rbrakk> \<Longrightarrow> x < y
[PROOF STEP]
by (auto simp add: Nats_def star_of_less_HNatInfinite)


[STATEMENT]
lemma pow_primroot: assumes "x \<noteq> \<epsilon>" shows "\<rho> (x\<^sup>@Suc k) = \<rho> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<rho> (x \<^sup>@ Suc k) = \<rho> x
[PROOF STEP]
using  comm_primroots'[OF nemp_Suc_pow_nemp, OF assms assms, of k, folded pow_Suc2 pow_Suc]
[PROOF STATE]
proof (prove)
using this:
x \<^sup>@ Suc (Suc k) = x \<^sup>@ Suc (Suc k) \<Longrightarrow> \<rho> (x \<^sup>@ Suc k) = \<rho> x

goal (1 subgoal):
 1. \<rho> (x \<^sup>@ Suc k) = \<rho> x
[PROOF STEP]
by blast


[STATEMENT]
lemma upper_times:
  "upper (times A B) = Max {lower A * lower B, lower A * upper B, upper A * lower B, upper A * upper B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper (A * B) = Max {lower A * lower B, lower A * upper B, upper A * lower B, upper A * upper B}
[PROOF STEP]
by transfer (auto simp: Let_def)


[STATEMENT]
lemma sets_count_space_eq_sigma:
  "countable S \<Longrightarrow> sets (count_space S) = sets (sigma S ((\<lambda>s. {s})`S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable S \<Longrightarrow> sets (count_space S) = sets (sigma S ((\<lambda>s. {s}) ` S))
[PROOF STEP]
by (subst sets_measure_of) (auto simp: sigma_sets_singletons)


[STATEMENT]
lemma inext_induct: "
  \<lbrakk> P (iMin I); \<And>n. \<lbrakk> n \<in> I; P n \<rbrakk> \<Longrightarrow> P (inext n I); n \<in> I \<rbrakk> \<Longrightarrow> P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P (iMin I); \<And>n. \<lbrakk>n \<in> I; P n\<rbrakk> \<Longrightarrow> P (inext n I); n \<in> I\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply (rule_tac f="\<lambda>n. I \<rightarrow> n" and I=I in image_nat_induct)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>P (iMin I); \<And>n. \<lbrakk>n \<in> I; P n\<rbrakk> \<Longrightarrow> P (inext n I); n \<in> I\<rbrakk> \<Longrightarrow> P (I \<rightarrow> 0)
 2. \<And>na. \<lbrakk>P (iMin I); \<And>n. \<lbrakk>n \<in> I; P n\<rbrakk> \<Longrightarrow> P (inext n I); n \<in> I; P (I \<rightarrow> na)\<rbrakk> \<Longrightarrow> P (I \<rightarrow> Suc na)
 3. \<lbrakk>P (iMin I); \<And>n. \<lbrakk>n \<in> I; P n\<rbrakk> \<Longrightarrow> P (inext n I); n \<in> I\<rbrakk> \<Longrightarrow> surj_on (inext_nth I) UNIV I
 4. \<lbrakk>P (iMin I); \<And>n. \<lbrakk>n \<in> I; P n\<rbrakk> \<Longrightarrow> P (inext n I); n \<in> I\<rbrakk> \<Longrightarrow> n \<in> I
[PROOF STEP]
apply (simp add: inext_nth_closed[OF in_imp_not_empty] inext_nth_surj_on)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma powr_realpow: "0 < x \<Longrightarrow> x powr (real n) = x^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> x powr real n = x ^ n
[PROOF STEP]
by (induction n) (simp_all add: ac_simps powr_add)


[STATEMENT]
theorem F'map_cong: "\<lbrakk>\<And>z. z \<in> F'set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F'set2 x \<Longrightarrow> f2 z = g2 z; \<And>z. z \<in> F'set3 x \<Longrightarrow> f3 z = g3 z\<rbrakk>
  \<Longrightarrow> F'map f1 f2 f3 x = F'map g1 g2 g3 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>z. z \<in> F'set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F'set2 x \<Longrightarrow> f2 z = g2 z; \<And>z. z \<in> F'set3 x \<Longrightarrow> f3 z = g3 z\<rbrakk> \<Longrightarrow> F'map f1 f2 f3 x = F'map g1 g2 g3 x
[PROOF STEP]
apply (rule F.map_cong0)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>z1. \<lbrakk>\<And>z. z \<in> F'set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F'set2 x \<Longrightarrow> f2 z = g2 z; \<And>z. z \<in> F'set3 x \<Longrightarrow> f3 z = g3 z; z1 \<in> F'set3 x\<rbrakk> \<Longrightarrow> f3 z1 = g3 z1
 2. \<And>z2. \<lbrakk>\<And>z. z \<in> F'set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F'set2 x \<Longrightarrow> f2 z = g2 z; \<And>z. z \<in> F'set3 x \<Longrightarrow> f3 z = g3 z; z2 \<in> F'set1 x\<rbrakk> \<Longrightarrow> f1 z2 = g1 z2
 3. \<And>z3. \<lbrakk>\<And>z. z \<in> F'set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F'set2 x \<Longrightarrow> f2 z = g2 z; \<And>z. z \<in> F'set3 x \<Longrightarrow> f3 z = g3 z; z3 \<in> F'set2 x\<rbrakk> \<Longrightarrow> f2 z3 = g2 z3
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma swaprows_mat_Unit: assumes k: "k < n" and l: "l < n"
  shows "swaprows_mat n k l \<in> Units (ring_mat TYPE('a :: semiring_1) n b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows_mat n k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. swaprows_mat n k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
interpret m: semiring "ring_mat TYPE('a) n b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semiring (ring_mat TYPE('a) n b)
[PROOF STEP]
by (rule semiring_mat)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. swaprows_mat n k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows_mat n k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
unfolding Units_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows_mat n k l \<in> {y \<in> carrier (ring_mat TYPE('a) n b). \<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> y = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> y \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>}
[PROOF STEP]
by (rule, rule conjI[OF _ bexI[of _ "swaprows_mat n k l"]],
    auto simp: ring_mat_def swaprows_mat_inv[OF k l] swaprows_mat_inv[OF l k])
[PROOF STATE]
proof (state)
this:
swaprows_mat n k l \<in> Units (ring_mat TYPE('a) n b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sin_inj_pi:
  "- (pi/2) \<le> x \<Longrightarrow> x \<le> pi/2 \<Longrightarrow> - (pi/2) \<le> y \<Longrightarrow> y \<le> pi/2 \<Longrightarrow> sin x = sin y \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- (pi / 2) \<le> x; x \<le> pi / 2; - (pi / 2) \<le> y; y \<le> pi / 2; sin x = sin y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis arcsin_sin)


[STATEMENT]
lemma fls_residue_deriv_times_lr_inverse_eq_subdegree:
  fixes   f g :: "'a::ring_1 fls"
  assumes "y * (f $$ fls_subdegree f) = 1" "(f $$ fls_subdegree f) * y = 1"
  shows   "fls_residue (fls_deriv f * fls_right_inverse f y)  = of_int (fls_subdegree f)"
  and     "fls_residue (fls_deriv f * fls_left_inverse f y)   = of_int (fls_subdegree f)"
  and     "fls_residue (fls_left_inverse f y * fls_deriv f)   = of_int (fls_subdegree f)"
  and     "fls_residue (fls_right_inverse f y * fls_deriv f)  = of_int (fls_subdegree f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fls_residue (fls_deriv f * fls_right_inverse f y) = of_int (fls_subdegree f) &&& fls_residue (fls_deriv f * fls_left_inverse f y) = of_int (fls_subdegree f)) &&& fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f) &&& fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int (fls_subdegree f)
 2. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int (fls_subdegree f)
 3. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
 4. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
define df :: int where "df \<equiv> fls_subdegree f"
[PROOF STATE]
proof (state)
this:
df \<equiv> fls_subdegree f

goal (4 subgoals):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int (fls_subdegree f)
 2. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int (fls_subdegree f)
 3. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
 4. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
define B X :: "'a fls"
    where "B \<equiv> fls_base_factor f"
    and   "X \<equiv> (fls_X_intpow df :: 'a fls)"
[PROOF STATE]
proof (state)
this:
B \<equiv> fls_base_factor f
X \<equiv> fls_X_intpow df

goal (4 subgoals):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int (fls_subdegree f)
 2. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int (fls_subdegree f)
 3. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
 4. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
define D L R :: "'a fls"
    where "D \<equiv> fls_deriv B"
    and   "L \<equiv> fls_left_inverse B y"
    and   "R \<equiv> fls_right_inverse B y"
[PROOF STATE]
proof (state)
this:
D \<equiv> fls_deriv B
L \<equiv> fls_left_inverse B y
R \<equiv> fls_right_inverse B y

goal (4 subgoals):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int (fls_subdegree f)
 2. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int (fls_subdegree f)
 3. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
 4. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
have intpow_diff: "fls_X_intpow (df - 1) = X * fls_X_inv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_X_intpow (df - 1) = X * fls_X_inv
[PROOF STEP]
using fls_X_intpow_diff_conv_times[of df 1]
[PROOF STATE]
proof (prove)
using this:
fls_X_intpow (df - 1) = fls_X_intpow df * fls_X_intpow (- 1)

goal (1 subgoal):
 1. fls_X_intpow (df - 1) = X * fls_X_inv
[PROOF STEP]
by (simp add: X_def fls_X_inv_conv_shift_1)
[PROOF STATE]
proof (state)
this:
fls_X_intpow (df - 1) = X * fls_X_inv

goal (4 subgoals):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int (fls_subdegree f)
 2. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int (fls_subdegree f)
 3. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
 4. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
show "fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
have subdegree_DR: "fls_subdegree (D * R) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fls_subdegree (D * R)
[PROOF STEP]
using fls_base_factor_subdegree[of f] fls_base_factor_subdegree[of "fls_right_inverse f y"]
            assms(1) fls_right_inverse_base_factor[of y f] fls_mult_subdegree_ge_0[of D R]
[PROOF STATE]
proof (prove)
using this:
fls_subdegree (fls_base_factor f) = 0
fls_subdegree (fls_base_factor (fls_right_inverse f y)) = 0
y * f $$ fls_subdegree f = (1::'a)
y \<noteq> (0::'a) \<Longrightarrow> fls_right_inverse (fls_base_factor f) y = fls_base_factor (fls_right_inverse f y)
\<lbrakk>0 \<le> fls_subdegree D; 0 \<le> fls_subdegree R\<rbrakk> \<Longrightarrow> 0 \<le> fls_subdegree (D * R)

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (D * R)
[PROOF STEP]
by    (force simp: fls_deriv_subdegree0 D_def R_def B_def)
[PROOF STATE]
proof (state)
this:
0 \<le> fls_subdegree (D * R)

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
have decomp: "f = X * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = X * B
[PROOF STEP]
unfolding X_def B_def df_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = fls_X_intpow (fls_subdegree f) * fls_base_factor f
[PROOF STEP]
by (rule fls_base_factor_X_power_decompose(2)[of f])
[PROOF STATE]
proof (state)
this:
f = X * B

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
hence "fls_deriv f = X * D + of_int df * X * fls_X_inv * B"
[PROOF STATE]
proof (prove)
using this:
f = X * B

goal (1 subgoal):
 1. fls_deriv f = X * D + of_int df * X * fls_X_inv * B
[PROOF STEP]
using intpow_diff fls_deriv_mult[of X B]
[PROOF STATE]
proof (prove)
using this:
f = X * B
fls_X_intpow (df - 1) = X * fls_X_inv
fls_deriv (X * B) = X * fls_deriv B + fls_deriv X * B

goal (1 subgoal):
 1. fls_deriv f = X * D + of_int df * X * fls_X_inv * B
[PROOF STEP]
by    (simp add: fls_deriv_X_intpow X_def B_def D_def mult.assoc)
[PROOF STATE]
proof (state)
this:
fls_deriv f = X * D + of_int df * X * fls_X_inv * B

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fls_deriv f = X * D + of_int df * X * fls_X_inv * B

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
[PROOF STEP]
have "fls_right_inverse (X * B) y = R * fls_right_inverse X 1"
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)

goal (1 subgoal):
 1. fls_right_inverse (X * B) y = R * fls_right_inverse X (1::'a)
[PROOF STEP]
using fls_base_factor_base[of f] fls_lr_inverse_mult_ring1(2)[of 1 X]
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_base_factor f $$ fls_subdegree (fls_base_factor f) = f $$ fls_subdegree f
\<lbrakk>(1::'a) * X $$ fls_subdegree X = (1::'a); X $$ fls_subdegree X * (1::'a) = (1::'a); ?y * ?g $$ fls_subdegree ?g = (1::'a); ?g $$ fls_subdegree ?g * ?y = (1::'a)\<rbrakk> \<Longrightarrow> fls_right_inverse (X * ?g) (?y * (1::'a)) = fls_right_inverse ?g ?y * fls_right_inverse X (1::'a)

goal (1 subgoal):
 1. fls_right_inverse (X * B) y = R * fls_right_inverse X (1::'a)
[PROOF STEP]
by    (simp add: X_def B_def R_def)
[PROOF STATE]
proof (state)
this:
fls_right_inverse (X * B) y = R * fls_right_inverse X (1::'a)

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fls_deriv f = X * D + of_int df * X * fls_X_inv * B
fls_right_inverse (X * B) y = R * fls_right_inverse X (1::'a)
[PROOF STEP]
have
      "fls_deriv f * fls_right_inverse f y =
        (D + of_int df * fls_X_inv * B) * R * (X * fls_right_inverse X 1)"
[PROOF STATE]
proof (prove)
using this:
fls_deriv f = X * D + of_int df * X * fls_X_inv * B
fls_right_inverse (X * B) y = R * fls_right_inverse X (1::'a)

goal (1 subgoal):
 1. fls_deriv f * fls_right_inverse f y = (D + of_int df * fls_X_inv * B) * R * (X * fls_right_inverse X (1::'a))
[PROOF STEP]
by (simp add: decomp algebra_simps X_def fls_X_intpow_times_comm)
[PROOF STATE]
proof (state)
this:
fls_deriv f * fls_right_inverse f y = (D + of_int df * fls_X_inv * B) * R * (X * fls_right_inverse X (1::'a))

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fls_deriv f * fls_right_inverse f y = (D + of_int df * fls_X_inv * B) * R * (X * fls_right_inverse X (1::'a))

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
have "\<dots> = D * R + of_int df * fls_X_inv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (D + of_int df * fls_X_inv * B) * R * (X * fls_right_inverse X (1::'a)) = D * R + of_int df * fls_X_inv
[PROOF STEP]
using fls_right_inverse[of X 1]
            assms fls_base_factor_base[of f] fls_right_inverse[of B y]
[PROOF STATE]
proof (prove)
using this:
X $$ fls_subdegree X * (1::'a) = (1::'a) \<Longrightarrow> X * fls_right_inverse X (1::'a) = 1
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_base_factor f $$ fls_subdegree (fls_base_factor f) = f $$ fls_subdegree f
B $$ fls_subdegree B * y = (1::'a) \<Longrightarrow> B * fls_right_inverse B y = 1

goal (1 subgoal):
 1. (D + of_int df * fls_X_inv * B) * R * (X * fls_right_inverse X (1::'a)) = D * R + of_int df * fls_X_inv
[PROOF STEP]
by    (simp add: X_def distrib_right mult.assoc B_def R_def)
[PROOF STATE]
proof (state)
this:
(D + of_int df * fls_X_inv * B) * R * (X * fls_right_inverse X (1::'a)) = D * R + of_int df * fls_X_inv

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fls_deriv f * fls_right_inverse f y = D * R + of_int df * fls_X_inv
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fls_deriv f * fls_right_inverse f y = D * R + of_int df * fls_X_inv

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
using subdegree_DR
[PROOF STATE]
proof (prove)
using this:
fls_deriv f * fls_right_inverse f y = D * R + of_int df * fls_X_inv
0 \<le> fls_subdegree (D * R)

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df

goal (3 subgoals):
 1. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int (fls_subdegree f)
 2. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
 3. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
[PROOF STEP]
show "fls_residue (fls_deriv f * fls_left_inverse f y) = of_int df"
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int df
[PROOF STEP]
using fls_left_inverse_eq_fls_right_inverse[of y f]
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_residue (fls_deriv f * fls_right_inverse f y) = of_int df
\<lbrakk>y * f $$ fls_subdegree f = (1::'a); f $$ fls_subdegree f * ?y = (1::'a)\<rbrakk> \<Longrightarrow> fls_left_inverse f y = fls_right_inverse f ?y

goal (1 subgoal):
 1. fls_residue (fls_deriv f * fls_left_inverse f y) = of_int df
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_residue (fls_deriv f * fls_left_inverse f y) = of_int df

goal (2 subgoals):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
 2. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
show "fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
have subdegree_LD: "fls_subdegree (L * D) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fls_subdegree (L * D)
[PROOF STEP]
using fls_base_factor_subdegree[of f] fls_base_factor_subdegree[of "fls_left_inverse f y"]
            assms(1) fls_left_inverse_base_factor[of y f] fls_mult_subdegree_ge_0[of L D]
[PROOF STATE]
proof (prove)
using this:
fls_subdegree (fls_base_factor f) = 0
fls_subdegree (fls_base_factor (fls_left_inverse f y)) = 0
y * f $$ fls_subdegree f = (1::'a)
y \<noteq> (0::'a) \<Longrightarrow> fls_left_inverse (fls_base_factor f) y = fls_base_factor (fls_left_inverse f y)
\<lbrakk>0 \<le> fls_subdegree L; 0 \<le> fls_subdegree D\<rbrakk> \<Longrightarrow> 0 \<le> fls_subdegree (L * D)

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (L * D)
[PROOF STEP]
by    (force simp: fls_deriv_subdegree0 D_def L_def B_def)
[PROOF STATE]
proof (state)
this:
0 \<le> fls_subdegree (L * D)

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
have decomp: "f = B * X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = B * X
[PROOF STEP]
unfolding X_def B_def df_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = fls_base_factor f * fls_X_intpow (fls_subdegree f)
[PROOF STEP]
by (rule fls_base_factor_X_power_decompose(1)[of f])
[PROOF STATE]
proof (state)
this:
f = B * X

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
hence "fls_deriv f = D * X + B * of_int df * X * fls_X_inv"
[PROOF STATE]
proof (prove)
using this:
f = B * X

goal (1 subgoal):
 1. fls_deriv f = D * X + B * of_int df * X * fls_X_inv
[PROOF STEP]
using intpow_diff fls_deriv_mult[of B X]
[PROOF STATE]
proof (prove)
using this:
f = B * X
fls_X_intpow (df - 1) = X * fls_X_inv
fls_deriv (B * X) = B * fls_deriv X + fls_deriv B * X

goal (1 subgoal):
 1. fls_deriv f = D * X + B * of_int df * X * fls_X_inv
[PROOF STEP]
by    (simp add: fls_deriv_X_intpow X_def D_def B_def mult.assoc)
[PROOF STATE]
proof (state)
this:
fls_deriv f = D * X + B * of_int df * X * fls_X_inv

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fls_deriv f = D * X + B * of_int df * X * fls_X_inv

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
[PROOF STEP]
have "fls_left_inverse (B * X) y = fls_left_inverse X 1 * L"
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)

goal (1 subgoal):
 1. fls_left_inverse (B * X) y = fls_left_inverse X (1::'a) * L
[PROOF STEP]
using fls_base_factor_base[of f] fls_lr_inverse_mult_ring1(1)[of _ _ 1 X]
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_base_factor f $$ fls_subdegree (fls_base_factor f) = f $$ fls_subdegree f
\<lbrakk>?x * ?f $$ fls_subdegree ?f = (1::'a); ?f $$ fls_subdegree ?f * ?x = (1::'a); (1::'a) * X $$ fls_subdegree X = (1::'a); X $$ fls_subdegree X * (1::'a) = (1::'a)\<rbrakk> \<Longrightarrow> fls_left_inverse (?f * X) ((1::'a) * ?x) = fls_left_inverse X (1::'a) * fls_left_inverse ?f ?x

goal (1 subgoal):
 1. fls_left_inverse (B * X) y = fls_left_inverse X (1::'a) * L
[PROOF STEP]
by    (simp add: X_def B_def L_def)
[PROOF STATE]
proof (state)
this:
fls_left_inverse (B * X) y = fls_left_inverse X (1::'a) * L

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fls_deriv f = D * X + B * of_int df * X * fls_X_inv
fls_left_inverse (B * X) y = fls_left_inverse X (1::'a) * L
[PROOF STEP]
have
      "fls_left_inverse f y * fls_deriv f =
        fls_left_inverse X 1 * X * L * (D + B * (of_int df * fls_X_inv))"
[PROOF STATE]
proof (prove)
using this:
fls_deriv f = D * X + B * of_int df * X * fls_X_inv
fls_left_inverse (B * X) y = fls_left_inverse X (1::'a) * L

goal (1 subgoal):
 1. fls_left_inverse f y * fls_deriv f = fls_left_inverse X (1::'a) * X * L * (D + B * (of_int df * fls_X_inv))
[PROOF STEP]
by (simp add: decomp algebra_simps X_def fls_X_intpow_times_comm)
[PROOF STATE]
proof (state)
this:
fls_left_inverse f y * fls_deriv f = fls_left_inverse X (1::'a) * X * L * (D + B * (of_int df * fls_X_inv))

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fls_left_inverse f y * fls_deriv f = fls_left_inverse X (1::'a) * X * L * (D + B * (of_int df * fls_X_inv))

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
have "\<dots> = L * D + of_int df * fls_X_inv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_left_inverse X (1::'a) * X * L * (D + B * (of_int df * fls_X_inv)) = L * D + of_int df * fls_X_inv
[PROOF STEP]
using assms fls_left_inverse[of 1 X] fls_base_factor_base[of f] fls_left_inverse[of y B]
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
(1::'a) * X $$ fls_subdegree X = (1::'a) \<Longrightarrow> fls_left_inverse X (1::'a) * X = 1
fls_base_factor f $$ fls_subdegree (fls_base_factor f) = f $$ fls_subdegree f
y * B $$ fls_subdegree B = (1::'a) \<Longrightarrow> fls_left_inverse B y * B = 1

goal (1 subgoal):
 1. fls_left_inverse X (1::'a) * X * L * (D + B * (of_int df * fls_X_inv)) = L * D + of_int df * fls_X_inv
[PROOF STEP]
by   (simp add: X_def distrib_left mult.assoc[symmetric] L_def B_def)
[PROOF STATE]
proof (state)
this:
fls_left_inverse X (1::'a) * X * L * (D + B * (of_int df * fls_X_inv)) = L * D + of_int df * fls_X_inv

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fls_left_inverse f y * fls_deriv f = L * D + of_int df * fls_X_inv
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fls_left_inverse f y * fls_deriv f = L * D + of_int df * fls_X_inv

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
using subdegree_LD
[PROOF STATE]
proof (prove)
using this:
fls_left_inverse f y * fls_deriv f = L * D + of_int df * fls_X_inv
0 \<le> fls_subdegree (L * D)

goal (1 subgoal):
 1. fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df

goal (1 subgoal):
 1. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int (fls_subdegree f)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
show "fls_residue (fls_right_inverse f y * fls_deriv f) = of_int df"
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df

goal (1 subgoal):
 1. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
using fls_left_inverse_eq_fls_right_inverse[of y f]
[PROOF STATE]
proof (prove)
using this:
y * f $$ fls_subdegree f = (1::'a)
f $$ fls_subdegree f * y = (1::'a)
fls_residue (fls_left_inverse f y * fls_deriv f) = of_int df
\<lbrakk>y * f $$ fls_subdegree f = (1::'a); f $$ fls_subdegree f * ?y = (1::'a)\<rbrakk> \<Longrightarrow> fls_left_inverse f y = fls_right_inverse f ?y

goal (1 subgoal):
 1. fls_residue (fls_right_inverse f y * fls_deriv f) = of_int df
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_residue (fls_right_inverse f y * fls_deriv f) = of_int df

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "dist x y + dist x z \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> dist x y + dist x z
[PROOF STEP]
by metric


[STATEMENT]
lemma set_integrable_norm:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes f: "set_integrable M k f" shows "set_integrable M k (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M k (\<lambda>x. norm (f x))
[PROOF STEP]
using integrable_norm f
[PROOF STATE]
proof (prove)
using this:
integrable ?M ?f \<Longrightarrow> integrable ?M (\<lambda>x. norm (?f x))
set_integrable M k f

goal (1 subgoal):
 1. set_integrable M k (\<lambda>x. norm (f x))
[PROOF STEP]
by (force simp add: set_integrable_def)


[STATEMENT]
lemma keys_flatten_subset: "keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
have "keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. keys (punit.monom_mult 1 t (lookup p t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. keys (punit.monom_mult (1::'b) t (lookup p t)))
[PROOF STEP]
unfolding flatten_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (\<Sum>t\<in>keys p. punit.monom_mult (1::'b) t (lookup p t)) \<subseteq> (\<Union>t\<in>keys p. keys (punit.monom_mult (1::'b) t (lookup p t)))
[PROOF STEP]
by (rule keys_sum_subset)
[PROOF STATE]
proof (state)
this:
keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. keys (punit.monom_mult (1::'b) t (lookup p t)))

goal (1 subgoal):
 1. keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. keys (punit.monom_mult (1::'b) t (lookup p t)))

goal (1 subgoal):
 1. keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
from subset_refl
[PROOF STATE]
proof (chain)
picking this:
?A \<subseteq> ?A
[PROOF STEP]
have "\<dots> \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))"
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> ?A

goal (1 subgoal):
 1. (\<Union>t\<in>keys p. keys (punit.monom_mult (1::'b) t (lookup p t))) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
by (rule UN_mono) (rule punit.keys_monom_mult_subset[simplified])
[PROOF STATE]
proof (state)
this:
(\<Union>t\<in>keys p. keys (punit.monom_mult (1::'b) t (lookup p t))) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))

goal (1 subgoal):
 1. keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))

goal (1 subgoal):
 1. keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
keys (flatten p) \<subseteq> (\<Union>t\<in>keys p. (+) t ` keys (lookup p t))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_divide_X_intpow:
  fixes f :: "'a::division_ring fls"
  shows "f / (fls_X_intpow i) = fls_shift i f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f / fls_X_intpow i = fls_shift i f
[PROOF STEP]
by    (rule fls_divide_X_intpow'[OF inverse_1])


[STATEMENT]
lemma iprev_nth_image: "
  \<lbrakk> finite I; I \<noteq> {}; strict_mono_on f I \<rbrakk> \<Longrightarrow> (f ` I) \<leftarrow> n = f (I \<leftarrow> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}; SetInterval2.strict_mono_on f I\<rbrakk> \<Longrightarrow> (f ` I) \<leftarrow> n = f (I \<leftarrow> n)
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; I \<noteq> {}; SetInterval2.strict_mono_on f I\<rbrakk> \<Longrightarrow> (f ` I) \<leftarrow> 0 = f (I \<leftarrow> 0)
 2. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}; SetInterval2.strict_mono_on f I\<rbrakk> \<Longrightarrow> (f ` I) \<leftarrow> n = f (I \<leftarrow> n); finite I; I \<noteq> {}; SetInterval2.strict_mono_on f I\<rbrakk> \<Longrightarrow> (f ` I) \<leftarrow> Suc n = f (I \<leftarrow> Suc n)
[PROOF STEP]
apply (simp add: Max_mono_on2 strict_mono_on_imp_mono_on)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}; SetInterval2.strict_mono_on f I\<rbrakk> \<Longrightarrow> (f ` I) \<leftarrow> n = f (I \<leftarrow> n); finite I; I \<noteq> {}; SetInterval2.strict_mono_on f I\<rbrakk> \<Longrightarrow> (f ` I) \<leftarrow> Suc n = f (I \<leftarrow> Suc n)
[PROOF STEP]
apply (simp add: iprev_image iprev_nth_closed)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma multpw_cancelL:
  assumes "refl ns" "trans ns" shows "(Z + X, Z + Y) \<in> multpw ns \<longleftrightarrow> (X, Y) \<in> multpw ns"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Z + X, Z + Y) \<in> multpw ns) = ((X, Y) \<in> multpw ns)
[PROOF STEP]
using multpw_cancel[OF assms, of X Z Y]
[PROOF STATE]
proof (prove)
using this:
((X + Z, Y + Z) \<in> multpw ns) = ((X, Y) \<in> multpw ns)

goal (1 subgoal):
 1. ((Z + X, Z + Y) \<in> multpw ns) = ((X, Y) \<in> multpw ns)
[PROOF STEP]
by (simp only: union_commute)


[STATEMENT]
lemma Zero_In_SUCC: "{OrdP k} \<turnstile> Zero IN SUCC k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {OrdP k} \<turnstile> Zero IN SUCC k
[PROOF STEP]
by (rule OrdP_linear [OF OrdP_Zero OrdP_SUCC_I]) (force simp: SUCC_def)+


[STATEMENT]
lemma split_zip_ex[no_atp]: "(\<exists> x. P x) \<longleftrightarrow> (\<exists> y z. length y = length z \<and> P (y || z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P x) = (\<exists>y z. length y = length z \<and> P (y || z))
[PROOF STEP]
by (fastforce iff: split_zip)


[STATEMENT]
lemma (in cpx_sq_mat) proj_measurement_proj:
  assumes "proj_measurement p M"
and "i < p"
shows "projector (meas_outcome_prj (M i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projector (meas_outcome_prj (M i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
proj_measurement p M
i < p

goal (1 subgoal):
 1. projector (meas_outcome_prj (M i))
[PROOF STEP]
unfolding proj_measurement_def
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>i. meas_outcome_val (M i)) {..<p} \<and> (\<forall>j<p. meas_outcome_prj (M j) \<in> fc_mats \<and> projector (meas_outcome_prj (M j))) \<and> (\<forall>i<p. \<forall>j<p. i \<noteq> j \<longrightarrow> meas_outcome_prj (M i) * meas_outcome_prj (M j) = 0\<^sub>m dimR dimR) \<and> local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<p} = 1\<^sub>m dimR
i < p

goal (1 subgoal):
 1. projector (meas_outcome_prj (M i))
[PROOF STEP]
by simp


[STATEMENT]
lemma box_sem [simp]:"fml_sem I (Box \<alpha> \<phi>) = {\<nu>. \<forall> \<omega>. (\<nu>, \<omega>) \<in> prog_sem I \<alpha> \<longrightarrow> \<omega> \<in> fml_sem I \<phi>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fml_sem I ([[\<alpha>]]\<phi>) = {\<nu>. \<forall>\<omega>. (\<nu>, \<omega>) \<in> prog_sem I \<alpha> \<longrightarrow> \<omega> \<in> fml_sem I \<phi>}
[PROOF STEP]
unfolding Box_def fml_sem.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v. v \<notin> {uu_. \<exists>\<nu> \<omega>. uu_ = \<nu> \<and> (\<nu>, \<omega>) \<in> prog_sem I \<alpha> \<and> \<omega> \<in> {v. v \<notin> fml_sem I \<phi>}}} = {\<nu>. \<forall>\<omega>. (\<nu>, \<omega>) \<in> prog_sem I \<alpha> \<longrightarrow> \<omega> \<in> fml_sem I \<phi>}
[PROOF STEP]
using Collect_cong
[PROOF STATE]
proof (prove)
using this:
(\<And>x. ?P x = ?Q x) \<Longrightarrow> {x. ?P x} = {x. ?Q x}

goal (1 subgoal):
 1. {v. v \<notin> {uu_. \<exists>\<nu> \<omega>. uu_ = \<nu> \<and> (\<nu>, \<omega>) \<in> prog_sem I \<alpha> \<and> \<omega> \<in> {v. v \<notin> fml_sem I \<phi>}}} = {\<nu>. \<forall>\<omega>. (\<nu>, \<omega>) \<in> prog_sem I \<alpha> \<longrightarrow> \<omega> \<in> fml_sem I \<phi>}
[PROOF STEP]
by (auto)


[STATEMENT]
lemma BseqD: "Bseq X \<Longrightarrow> \<exists>K. 0 < K \<and> (\<forall>n. norm (X n) \<le> K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq X \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
by (simp add: Bseq_def)


[STATEMENT]
lemma sum_adj: \<open>(sum a F)* = sum (\<lambda>i. (a i)*) F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum a F* = (\<Sum>i\<in>F. a i*)
[PROOF STEP]
apply (induction rule:infinite_finite_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> sum a A* = (\<Sum>i\<in>A. a i*)
 2. sum a {}* = (\<Sum>i\<in>{}. a i*)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; sum a F* = (\<Sum>i\<in>F. a i*)\<rbrakk> \<Longrightarrow> sum a (insert x F)* = (\<Sum>i\<in>insert x F. a i*)
[PROOF STEP]
by (auto simp add: adj_plus)


[STATEMENT]
lemma hom_induced_compose':
  assumes "continuous_map X Y f" "f ` S \<subseteq> T" "continuous_map Y Z g" "g ` T \<subseteq> U"
  shows "hom_induced p Y T Z U g (hom_induced p X S Y T f x) = hom_induced p X S Z U (g \<circ> f) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p Y T Z U g (hom_induced p X S Y T f x) = hom_induced p X S Z U (g \<circ> f) x
[PROOF STEP]
using hom_induced_compose [OF assms]
[PROOF STATE]
proof (prove)
using this:
hom_induced ?p X S Z U (g \<circ> f) = hom_induced ?p Y T Z U g \<circ> hom_induced ?p X S Y T f

goal (1 subgoal):
 1. hom_induced p Y T Z U g (hom_induced p X S Y T f x) = hom_induced p X S Z U (g \<circ> f) x
[PROOF STEP]
by simp


[STATEMENT]
lemma K_subset: assumes "i \<le> j" shows "K i j \<in> {i..j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K i j \<in> {i..j}
[PROOF STEP]
using mins_subset K_def
[PROOF STATE]
proof (prove)
using this:
mins ?i ?j \<subseteq> {?i + 1..?j}
K ?i ?j \<equiv> if ?i = ?j then ?i else Max (mins ?i ?j)

goal (1 subgoal):
 1. K i j \<in> {i..j}
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); ?P4\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
 2. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); \<not> ?P4\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
[PROOF STEP]
assume "i = j"
[PROOF STATE]
proof (state)
this:
i = j

goal (2 subgoals):
 1. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); ?P4\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
 2. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); \<not> ?P4\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = j

goal (1 subgoal):
 1. K i j \<in> {i..j}
[PROOF STEP]
using K_def
[PROOF STATE]
proof (prove)
using this:
i = j
K ?i ?j \<equiv> if ?i = ?j then ?i else Max (mins ?i ?j)

goal (1 subgoal):
 1. K i j \<in> {i..j}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
K i j \<in> {i..j}

goal (1 subgoal):
 1. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); i \<noteq> j\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); i \<noteq> j\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
[PROOF STEP]
assume "\<not>i = j"
[PROOF STATE]
proof (state)
this:
i \<noteq> j

goal (1 subgoal):
 1. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); i \<noteq> j\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
[PROOF STEP]
hence "K i j \<in> {i+1..j}"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j

goal (1 subgoal):
 1. K i j \<in> {i + 1..j}
[PROOF STEP]
using mins_subset K_def \<open>i \<le> j\<close>
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j
mins ?i ?j \<subseteq> {?i + 1..?j}
K ?i ?j \<equiv> if ?i = ?j then ?i else Max (mins ?i ?j)
i \<le> j

goal (1 subgoal):
 1. K i j \<in> {i + 1..j}
[PROOF STEP]
by (metis Max_in finite_mins less_le mins_nonempty subsetCE)
[PROOF STATE]
proof (state)
this:
K i j \<in> {i + 1..j}

goal (1 subgoal):
 1. \<lbrakk>\<And>i j. mins i j \<subseteq> {i + 1..j}; \<And>i j. K i j \<equiv> if i = j then i else Max (mins i j); i \<noteq> j\<rbrakk> \<Longrightarrow> K i j \<in> {i..j}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
K i j \<in> {i + 1..j}

goal (1 subgoal):
 1. K i j \<in> {i..j}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
K i j \<in> {i..j}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma FreeUltrafilterNat_HNatInfinite:
  "\<forall>u. eventually (\<lambda>n. u < X n) \<U> \<Longrightarrow> star_n X \<in> HNatInfinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u. \<forall>\<^sub>F n in \<U>. u < X n \<Longrightarrow> star_n X \<in> HNatInfinite
[PROOF STEP]
by (auto simp add: star_less_def starP2_star_n HNatInfinite_iff SHNat_eq hypnat_of_nat_eq)


[STATEMENT]
lemma oexp_Partial_order: "Partial_order oexp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partial_order oexp
[PROOF STEP]
unfolding partial_order_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Preorder oexp \<and> antisym oexp
[PROOF STEP]
using oexp_Preorder oexp_antisym
[PROOF STATE]
proof (prove)
using this:
Preorder oexp
antisym oexp

goal (1 subgoal):
 1. Preorder oexp \<and> antisym oexp
[PROOF STEP]
by blast


[STATEMENT]
lemma set_of_times: "set_of (X * Y) = {x * y | x y. x \<in> set_of X \<and> y \<in> set_of Y}"
  for X Y::"'a :: {linordered_ring, real_normed_algebra, linear_continuum_topology} interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (X * Y) = {x * y |x y. x \<in>\<^sub>i X \<and> y \<in>\<^sub>i Y}
[PROOF STEP]
by (auto intro!: times_in_intervalI elim!: times_in_intervalE)


[STATEMENT]
lemma numeral_approx_iff [simp]:
  "(numeral v \<approx> (numeral w :: 'a::{numeral,real_normed_vector} star)) = (numeral v = (numeral w :: 'a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral v \<approx> numeral w) = (numeral v = numeral w)
[PROOF STEP]
by (metis star_of_approx_iff star_of_numeral)


[STATEMENT]
lemma proj_image[simp]: "(proj \<phi>) ` (Collect P) = Collect (P///\<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj \<phi> ` Collect P = Collect (P /// \<phi>)
[PROOF STEP]
unfolding proj_P2R_raw quotientP_def quotient_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. P2R \<phi> `` {x}) ` Collect P = Collect (S2P (\<Union>x\<in>Collect P. {P2R \<phi> `` {x}}))
[PROOF STEP]
by auto


[STATEMENT]
lemma ntrunc_Lim [simp]: "ntrunc (Suc k) (Old_Datatype.Lim rs) = Old_Datatype.Lim (\<lambda>x. ntrunc k (rs x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ntrunc (Suc k) (Old_Datatype.Lim rs) = Old_Datatype.Lim (\<lambda>x. ntrunc k (rs x))
[PROOF STEP]
unfolding Lim_def ntrunc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n \<in> \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` rs x}. ndepth n < Suc k} = \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` {n \<in> rs x. ndepth n < k}}
[PROOF STEP]
apply(rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {n \<in> \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` rs x}. ndepth n < Suc k} \<subseteq> \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` {n \<in> rs x. ndepth n < k}}
 2. \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` {n \<in> rs x. ndepth n < k}} \<subseteq> {n \<in> \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` rs x}. ndepth n < Suc k}
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x X xa xb. \<lbrakk>ndepth (Push_Node (Inl xa) xb) < Suc k; xb \<in> rs xa\<rbrakk> \<Longrightarrow> Push_Node (Inl xa) xb \<in> \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` {n \<in> rs x. ndepth n < k}}
 2. \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` {n \<in> rs x. ndepth n < k}} \<subseteq> {n \<in> \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` rs x}. ndepth n < Suc k}
[PROOF STEP]
apply(auto simp add: ndepth_Push_Node_Inl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cong_cong_lcm_nat: "[x = y] (mod a) \<Longrightarrow> [x = y] (mod b) \<Longrightarrow> [x = y] (mod lcm a b)"
  for x y :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[x = y] (mod a); [x = y] (mod b)\<rbrakk> \<Longrightarrow> [x = y] (mod lcm a b)
[PROOF STEP]
by (meson cong_altdef_nat' lcm_least)


[STATEMENT]
lemma polychain_Cons:
  "polychain (y # ys) = (if ys = [] then True else snd y = fst (ys ! 0) \<and> polychain ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polychain (y # ys) = (if ys = [] then True else snd y = fst (ys ! 0) \<and> polychain ys)
[PROOF STEP]
by (auto simp: polychain_def nth_Cons split: nat.split)


[STATEMENT]
lemma extensionalityI:
  assumes "f \<in> extensional A"
    and "g \<in> extensional A"
    and "\<And>x. x \<in> A \<Longrightarrow> f x = g x"
  shows "f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> extensional A
g \<in> extensional A
?x \<in> A \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. f = g
[PROOF STEP]
by (force simp add: fun_eq_iff extensional_def)


[STATEMENT]
lemma rstar_below_sstar:
  assumes "has_least_prefixpoint (Rf y)"
      and "has_least_prefixpoint (Sf y)"
    shows "rstar y \<le> sstar y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
have "y \<le> sstar y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> sstar y
[PROOF STEP]
using assms(2) pmu_unfold
[PROOF STATE]
proof (prove)
using this:
has_least_prefixpoint (Sf y)
has_least_prefixpoint ?f \<Longrightarrow> ?f (p\<mu> ?f) \<le> p\<mu> ?f

goal (1 subgoal):
 1. y \<le> sstar y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
y \<le> sstar y

goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
hence "Rf y (sstar y) \<le> Sf y (sstar y)"
[PROOF STATE]
proof (prove)
using this:
y \<le> sstar y

goal (1 subgoal):
 1. Rf y (sstar y) \<le> Sf y (sstar y)
[PROOF STEP]
by (meson sup.cobounded1 sup.mono mult_left_isotone)
[PROOF STATE]
proof (state)
this:
Rf y (sstar y) \<le> Sf y (sstar y)

goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Rf y (sstar y) \<le> Sf y (sstar y)

goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
have "... \<le> sstar y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sf y (sstar y) \<le> sstar y
[PROOF STEP]
using assms(2) pmu_unfold
[PROOF STATE]
proof (prove)
using this:
has_least_prefixpoint (Sf y)
has_least_prefixpoint ?f \<Longrightarrow> ?f (p\<mu> ?f) \<le> p\<mu> ?f

goal (1 subgoal):
 1. Sf y (sstar y) \<le> sstar y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Sf y (sstar y) \<le> sstar y

goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Rf y (sstar y) \<le> sstar y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Rf y (sstar y) \<le> sstar y

goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
using assms(1) is_least_prefixpoint_def least_prefixpoint
[PROOF STATE]
proof (prove)
using this:
Rf y (sstar y) \<le> sstar y
has_least_prefixpoint (Rf y)
is_least_prefixpoint ?f ?x \<equiv> ?f ?x \<le> ?x \<and> (\<forall>y. ?f y \<le> y \<longrightarrow> ?x \<le> y)
has_least_prefixpoint ?f \<Longrightarrow> is_least_prefixpoint ?f (p\<mu> ?f)

goal (1 subgoal):
 1. rstar y \<le> sstar y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rstar y \<le> sstar y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma imirror_iMin: "finite I \<Longrightarrow> iMin (imirror I) = iMin I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> iMin (imirror I) = iMin I
[PROOF STEP]
apply (case_tac "I = {}", simp add: imirror_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> iMin (imirror I) = iMin I
[PROOF STEP]
apply (simp add: imirror_eq_imirror_bounds imirror_bounds_iMin le_add1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bijective_invT : "bij_betw invT H G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw invT H G
[PROOF STEP]
using inj_on_invT invT_onto
[PROOF STATE]
proof (prove)
using this:
inj_on invT H
invT ` H = G

goal (1 subgoal):
 1. bij_betw invT H G
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on invT H
invT ` H = G

goal (1 subgoal):
 1. inj_on invT H \<and> invT ` H = G
[PROOF STEP]
by fast


[STATEMENT]
lemma subst_bvs1'_decr: "\<forall>x\<in>set us. is_closed x  \<Longrightarrow> \<not> loose_bvar1 t k
  \<Longrightarrow> subst_bvs1' (decr k t) k us = decr k (subst_bvs1' t (Suc k) us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set us. is_closed x; \<not> loose_bvar1 t k\<rbrakk> \<Longrightarrow> subst_bvs1' (decr k t) k us = decr k (subst_bvs1' t (Suc k) us)
[PROOF STEP]
by (induction k t arbitrary: us rule: decr.induct) (auto simp add: is_open_def)


[STATEMENT]
lemma exp_boundaries: "exp x \<in> { lb_exp prec x .. ub_exp prec x }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
proof (cases "0 < x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
 2. \<not> 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < x

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
 2. \<not> 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
hence "x \<le> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < x

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

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
 2. \<not> 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
from exp_boundaries'[OF this]
[PROOF STATE]
proof (chain)
picking this:
exp (real_of_float x) \<in> {real_of_float (lb_exp ?prec x)..real_of_float (ub_exp ?prec x)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
exp (real_of_float x) \<in> {real_of_float (lb_exp ?prec x)..real_of_float (ub_exp ?prec x)}

goal (1 subgoal):
 1. exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < x

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
hence "-x \<le> 0"
[PROOF STATE]
proof (prove)
using this:
0 < x

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

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
have "lb_exp prec x \<le> exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
[PROOF STEP]
from exp_boundaries'[OF \<open>-x \<le> 0\<close>]
[PROOF STATE]
proof (chain)
picking this:
exp (real_of_float (- x)) \<in> {real_of_float (lb_exp ?prec (- x))..real_of_float (ub_exp ?prec (- x))}
[PROOF STEP]
have ub_exp: "exp (- real_of_float x) \<le> ub_exp prec (-x)"
[PROOF STATE]
proof (prove)
using this:
exp (real_of_float (- x)) \<in> {real_of_float (lb_exp ?prec (- x))..real_of_float (ub_exp ?prec (- x))}

goal (1 subgoal):
 1. exp (- real_of_float x) \<le> real_of_float (ub_exp prec (- x))
[PROOF STEP]
unfolding atLeastAtMost_iff minus_float.rep_eq
[PROOF STATE]
proof (prove)
using this:
real_of_float (lb_exp ?prec (- x)) \<le> exp (real_of_float (- x)) \<and> exp (real_of_float (- x)) \<le> real_of_float (ub_exp ?prec (- x))

goal (1 subgoal):
 1. exp (- real_of_float x) \<le> real_of_float (ub_exp prec (- x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
exp (- real_of_float x) \<le> real_of_float (ub_exp prec (- x))

goal (1 subgoal):
 1. real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
[PROOF STEP]
have "float_divl prec 1 (ub_exp prec (-x)) \<le> 1 / ub_exp prec (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> 1 / real_of_float (ub_exp prec (- x))
[PROOF STEP]
using float_divl[where x=1]
[PROOF STATE]
proof (prove)
using this:
real_of_float (float_divl ?prec 1 ?y) \<le> real_of_float 1 / real_of_float ?y

goal (1 subgoal):
 1. real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> 1 / real_of_float (ub_exp prec (- x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> 1 / real_of_float (ub_exp prec (- x))

goal (1 subgoal):
 1. real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> 1 / real_of_float (ub_exp prec (- x))

goal (1 subgoal):
 1. real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
[PROOF STEP]
have "\<dots> \<le> exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real_of_float (ub_exp prec (- x)) \<le> exp (real_of_float x)
[PROOF STEP]
using ub_exp[unfolded inverse_le_iff_le[OF order_less_le_trans[OF exp_gt_zero ub_exp]
          exp_gt_zero, symmetric]]
[PROOF STATE]
proof (prove)
using this:
inverse (real_of_float (ub_exp prec (- x))) \<le> inverse (exp (- real_of_float x))

goal (1 subgoal):
 1. 1 / real_of_float (ub_exp prec (- x)) \<le> exp (real_of_float x)
[PROOF STEP]
unfolding exp_minus nonzero_inverse_inverse_eq[OF exp_not_eq_zero] inverse_eq_divide
[PROOF STATE]
proof (prove)
using this:
1 / real_of_float (ub_exp prec (- x)) \<le> 1 / (1 / exp (real_of_float x))

goal (1 subgoal):
 1. 1 / real_of_float (ub_exp prec (- x)) \<le> exp (real_of_float x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / real_of_float (ub_exp prec (- x)) \<le> exp (real_of_float x)

goal (1 subgoal):
 1. real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> exp (real_of_float x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> exp (real_of_float x)

goal (1 subgoal):
 1. real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
[PROOF STEP]
unfolding lb_exp.simps if_P[OF True]
[PROOF STATE]
proof (prove)
using this:
real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> exp (real_of_float x)

goal (1 subgoal):
 1. real_of_float (float_divl prec 1 (ub_exp prec (- x))) \<le> exp (real_of_float x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_float (lb_exp prec x) \<le> exp (real_of_float x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real_of_float (lb_exp prec x) \<le> exp (real_of_float x)

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_float (lb_exp prec x) \<le> exp (real_of_float x)

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
have "exp x \<le> ub_exp prec x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
have "\<not> 0 < -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 0 < - x
[PROOF STEP]
using \<open>0 < x\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x

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

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
from exp_boundaries'[OF \<open>-x \<le> 0\<close>]
[PROOF STATE]
proof (chain)
picking this:
exp (real_of_float (- x)) \<in> {real_of_float (lb_exp ?prec (- x))..real_of_float (ub_exp ?prec (- x))}
[PROOF STEP]
have lb_exp: "lb_exp prec (-x) \<le> exp (- real_of_float x)"
[PROOF STATE]
proof (prove)
using this:
exp (real_of_float (- x)) \<in> {real_of_float (lb_exp ?prec (- x))..real_of_float (ub_exp ?prec (- x))}

goal (1 subgoal):
 1. real_of_float (lb_exp prec (- x)) \<le> exp (- real_of_float x)
[PROOF STEP]
unfolding atLeastAtMost_iff minus_float.rep_eq
[PROOF STATE]
proof (prove)
using this:
real_of_float (lb_exp ?prec (- x)) \<le> exp (real_of_float (- x)) \<and> exp (real_of_float (- x)) \<le> real_of_float (ub_exp ?prec (- x))

goal (1 subgoal):
 1. real_of_float (lb_exp prec (- x)) \<le> exp (- real_of_float x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_float (lb_exp prec (- x)) \<le> exp (- real_of_float x)

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
have "exp x \<le> (1 :: float) / lb_exp prec (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float 1 / real_of_float (lb_exp prec (- x))
[PROOF STEP]
using lb_exp lb_exp_pos[OF \<open>\<not> 0 < -x\<close>, of prec]
[PROOF STATE]
proof (prove)
using this:
real_of_float (lb_exp prec (- x)) \<le> exp (- real_of_float x)
0 < lb_exp prec (- x)

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float 1 / real_of_float (lb_exp prec (- x))
[PROOF STEP]
by (simp del: lb_exp.simps add: exp_minus field_simps)
[PROOF STATE]
proof (state)
this:
exp (real_of_float x) \<le> real_of_float 1 / real_of_float (lb_exp prec (- x))

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (real_of_float x) \<le> real_of_float 1 / real_of_float (lb_exp prec (- x))

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
have "\<dots> \<le> float_divr prec 1 (lb_exp prec (-x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float 1 / real_of_float (lb_exp prec (- x)) \<le> real_of_float (float_divr prec 1 (lb_exp prec (- x)))
[PROOF STEP]
using float_divr
[PROOF STATE]
proof (prove)
using this:
real_of_float ?x / real_of_float ?y \<le> real_of_float (float_divr ?prec ?x ?y)

goal (1 subgoal):
 1. real_of_float 1 / real_of_float (lb_exp prec (- x)) \<le> real_of_float (float_divr prec 1 (lb_exp prec (- x)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_float 1 / real_of_float (lb_exp prec (- x)) \<le> real_of_float (float_divr prec 1 (lb_exp prec (- x)))

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (real_of_float x) \<le> real_of_float (float_divr prec 1 (lb_exp prec (- x)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
exp (real_of_float x) \<le> real_of_float (float_divr prec 1 (lb_exp prec (- x)))

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
unfolding ub_exp.simps if_P[OF True]
[PROOF STATE]
proof (prove)
using this:
exp (real_of_float x) \<le> real_of_float (float_divr prec 1 (lb_exp prec (- x)))

goal (1 subgoal):
 1. exp (real_of_float x) \<le> real_of_float (float_divr prec 1 (lb_exp prec (- x)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
exp (real_of_float x) \<le> real_of_float (ub_exp prec x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
exp (real_of_float x) \<le> real_of_float (ub_exp prec x)

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
exp (real_of_float x) \<le> real_of_float (ub_exp prec x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_float (lb_exp prec x) \<le> exp (real_of_float x)
exp (real_of_float x) \<le> real_of_float (ub_exp prec x)

goal (1 subgoal):
 1. exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
exp (real_of_float x) \<in> {real_of_float (lb_exp prec x)..real_of_float (ub_exp prec x)}

goal:
No subgoals!
[PROOF STEP]
qed