[STATEMENT]
theorem pltl_stutter_invariant:
  "stutter_invariant \<phi> \<longleftrightarrow>
   (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> \<longleftrightarrow> \<sigma> \<Turnstile>\<^sub>p \<phi>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
assume "stutter_invariant \<phi>"
[PROOF STATE]
proof (state)
this:
stutter_invariant \<phi>

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
hence "\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> \<longleftrightarrow> \<sigma> \<Turnstile>\<^sub>p \<phi>)"
[PROOF STATE]
proof (prove)
using this:
stutter_invariant \<phi>

goal (1 subgoal):
 1. \<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
by (rule stutter_invariant_next_free) blast
[PROOF STATE]
proof (state)
this:
\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
stutter_invariant \<phi> \<Longrightarrow> \<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
stutter_invariant \<phi> \<Longrightarrow> \<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
stutter_invariant \<phi> \<Longrightarrow> \<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
fix \<psi>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
assume 1: "next_free \<psi>" and 2: "\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> \<longleftrightarrow> \<sigma> \<Turnstile>\<^sub>p \<phi>"
[PROOF STATE]
proof (state)
this:
next_free \<psi>
\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
next_free \<psi>
[PROOF STEP]
have "stutter_invariant \<psi>"
[PROOF STATE]
proof (prove)
using this:
next_free \<psi>

goal (1 subgoal):
 1. stutter_invariant \<psi>
[PROOF STEP]
by (rule next_free_stutter_invariant)
[PROOF STATE]
proof (state)
this:
stutter_invariant \<psi>

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
with 2
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>
stutter_invariant \<psi>
[PROOF STEP]
have "stutter_invariant \<phi>"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>
stutter_invariant \<psi>

goal (1 subgoal):
 1. stutter_invariant \<phi>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
stutter_invariant \<phi>

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>next_free ?\<psi>2; \<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = \<sigma> \<Turnstile>\<^sub>p \<phi>\<rbrakk> \<Longrightarrow> stutter_invariant \<phi>

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
stutter_invariant \<phi> \<Longrightarrow> \<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>)
\<lbrakk>next_free ?\<psi>2; \<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = \<sigma> \<Turnstile>\<^sub>p \<phi>\<rbrakk> \<Longrightarrow> stutter_invariant \<phi>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
stutter_invariant \<phi> \<Longrightarrow> \<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>)
\<lbrakk>next_free ?\<psi>2; \<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = \<sigma> \<Turnstile>\<^sub>p \<phi>\<rbrakk> \<Longrightarrow> stutter_invariant \<phi>

goal (1 subgoal):
 1. stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
stutter_invariant \<phi> = (\<exists>\<psi>. next_free \<psi> \<and> atoms_pltl \<psi> \<subseteq> atoms_pltl \<phi> \<and> (\<forall>\<sigma>. \<sigma> \<Turnstile>\<^sub>p \<psi> = \<sigma> \<Turnstile>\<^sub>p \<phi>))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sin_n_Im_cis_pow_n: "sin (real n * a) = Im (cis a ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (real n * a) = Im (cis a ^ n)
[PROOF STEP]
by (auto simp add: DeMoivre)


[STATEMENT]
lemma bool1: "(\<not> True) = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> True) = False
[PROOF STEP]
by blast


[STATEMENT]
lemma "strassen_cost \<in> O(\<lambda>n. real n powr log 2 7)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strassen_cost \<in> O(\<lambda>n. real n powr log 2 7)
[PROOF STEP]
by (master_theorem 1 p': 2) (auto simp: powr_divide eventually_at_top_linorder)


[STATEMENT]
lemma suminf_sum: "(\<And>i. i \<in> I \<Longrightarrow> summable (f i)) \<Longrightarrow> (\<Sum>n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. \<Sum>n. f i n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> summable (f i)) \<Longrightarrow> (\<Sum>n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
using sums_unique[OF sums_sum, OF summable_sums]
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> I \<Longrightarrow> summable (f i)) \<Longrightarrow> (\<Sum>i\<in>I. suminf (f i)) = (\<Sum>n. \<Sum>i\<in>I. f i n)

goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> summable (f i)) \<Longrightarrow> (\<Sum>n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. \<Sum>n. f i n)
[PROOF STEP]
by simp


[STATEMENT]
lemma rel_star_def: "X^* = (\<Union>n. rel_dioid.power X n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X\<^sup>* = \<Union> (range (rel_dioid.power X))
[PROOF STEP]
by (simp add: power_is_relpow rtrancl_is_UN_relpow)


[STATEMENT]
lemma Z_inv [simp]:
  "Z * Z = 1\<^sub>m 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Z * Z = 1\<^sub>m 2
[PROOF STEP]
apply(simp add: Z_def times_mat_def one_mat_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat 2 2 (\<lambda>(i, j). row (mat 2 2 (\<lambda>(i, j). if i \<noteq> j then 0 else if i = 0 then 1 else - 1)) i \<bullet> col (mat 2 2 (\<lambda>(i, j). if i \<noteq> j then 0 else if i = 0 then 1 else - 1)) j) = mat 2 2 (\<lambda>(i, j). if i = j then 1 else 0)
[PROOF STEP]
apply(rule cong_mat)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 2 = 2
 2. 2 = 2
 3. \<And>i j. \<lbrakk>i < 2; j < 2\<rbrakk> \<Longrightarrow> (case (i, j) of (i, j) \<Rightarrow> row (mat 2 2 (\<lambda>(i, j). if i \<noteq> j then 0 else if i = 0 then 1 else - 1)) i \<bullet> col (mat 2 2 (\<lambda>(i, j). if i \<noteq> j then 0 else if i = 0 then 1 else - 1)) j) = (case (i, j) of (i, j) \<Rightarrow> if i = j then 1 else 0)
[PROOF STEP]
by(auto simp: scalar_prod_def)


[STATEMENT]
lemma gauss_cnj_mult_self: "gauss_cnj z * z = of_nat (gauss_int_norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_cnj z * z = of_nat (gauss_int_norm z)
[PROOF STEP]
by (subst mult.commute, rule self_mult_gauss_cnj)


[STATEMENT]
lemma "\<forall>x::'a::linordered_field. \<exists>y > \<bar>23 * x - 9\<bar>. \<forall>z > \<bar>3 * y - 19 * \<bar>x\<bar>\<bar>. x + z > 2 * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<exists>y>\<bar>(23::'a) * x - (9::'a)\<bar>. \<forall>z>\<bar>(3::'a) * y - (19::'a) * \<bar>x\<bar>\<bar>. (2::'a) * y < x + z
[PROOF STEP]
by ferrack


[STATEMENT]
lemma two_block_non_interfering_row_comp2:
  assumes "i <dim_row (two_block_non_interfering A B)"
    and "i \<ge> dim_row A"
  shows "row (two_block_non_interfering A B) i = (0\<^sub>v (dim_col A)) @\<^sub>v row B (i - dim_row A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (two_block_non_interfering A B) i = 0\<^sub>v (dim_col A) @\<^sub>v row B (i - dim_row A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row (two_block_non_interfering A B)
dim_row A \<le> i

goal (1 subgoal):
 1. row (two_block_non_interfering A B) i = 0\<^sub>v (dim_col A) @\<^sub>v row B (i - dim_row A)
[PROOF STEP]
by (auto)


[STATEMENT]
lemma LBINT_I0c_exp_mscale_sin:
  "LBINT x=0..t. exp (-(u * x)) * sin x =
    (1 / (1 + u^2)) * (1 - exp (-(u * t)) * (u * sin t + cos t))" (is "_ = ?F t")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x=0..ereal t. exp (- (u * x)) * sin x = 1 / (1 + u\<^sup>2) * (1 - exp (- (u * t)) * (u * sin t + cos t))
[PROOF STEP]
unfolding zero_ereal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x=ereal 0..ereal t. exp (- (u * x)) * sin x = 1 / (1 + u\<^sup>2) * (1 - exp (- (u * t)) * (u * sin t + cos t))
[PROOF STEP]
proof (subst interval_integral_FTC_finite)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. continuous_on {min 0 t..max 0 t} (\<lambda>x. exp (- (u * x)) * sin x)
 2. \<And>x. \<lbrakk>min 0 t \<le> x; x \<le> max 0 t\<rbrakk> \<Longrightarrow> (?F has_vector_derivative exp (- (u * x)) * sin x) (at x within {min 0 t..max 0 t})
 3. ?F t - ?F 0 = 1 / (1 + u\<^sup>2) * (1 - exp (- (u * t)) * (u * sin t + cos t))
[PROOF STEP]
show "(?F has_vector_derivative exp (- (u * x)) * sin x) (at x within {min 0 t..max 0 t})" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>a. 1 / (1 + u\<^sup>2) * (1 - exp (- (u * a)) * (u * sin a + cos a))) has_vector_derivative exp (- (u * x)) * sin x) (at x within {min 0 t..max 0 t})
[PROOF STEP]
by (auto intro!: derivative_eq_intros
             simp: has_real_derivative_iff_has_vector_derivative[symmetric] power2_eq_square)
       (simp_all add: field_simps add_nonneg_eq_0_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>a. 1 / (1 + u\<^sup>2) * (1 - exp (- (u * a)) * (u * sin a + cos a))) has_vector_derivative exp (- (u * ?x)) * sin ?x) (at ?x within {min 0 t..max 0 t})

goal (2 subgoals):
 1. continuous_on {min 0 t..max 0 t} (\<lambda>x. exp (- (u * x)) * sin x)
 2. 1 / (1 + u\<^sup>2) * (1 - exp (- (u * t)) * (u * sin t + cos t)) - 1 / (1 + u\<^sup>2) * (1 - exp (- (u * 0)) * (u * sin 0 + cos 0)) = 1 / (1 + u\<^sup>2) * (1 - exp (- (u * t)) * (u * sin t + cos t))
[PROOF STEP]
qed (auto intro: continuous_at_imp_continuous_on)


[STATEMENT]
lemma hcomplex_mult_right_cancel: "c \<noteq> 0 \<Longrightarrow> a * c = b * c \<longleftrightarrow> a = b"
  for a b c :: hcomplex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> (a * c = b * c) = (a = b)
[PROOF STEP]
by simp


[STATEMENT]
lemma lm026:
  "Union \<circ> finestpart = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> \<circ> finestpart = id
[PROOF STEP]
using finestpart_def finestPartUnion
[PROOF STATE]
proof (prove)
using this:
finestpart ?X = (\<lambda>x. {x}) ` ?X
?X = \<Union> (finestpart ?X)

goal (1 subgoal):
 1. \<Union> \<circ> finestpart = id
[PROOF STEP]
by fastforce


[STATEMENT]
lemma iT_Minus_card_le: "finite I \<Longrightarrow> card (k \<ominus> I) \<le> card I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> card (k \<ominus> I) \<le> card I
[PROOF STEP]
by (subst iT_Minus_card, rule cut_le_card)


[STATEMENT]
lemma (in ring) generate_ring_min_subring2:
  assumes "H \<subseteq> carrier R"
  shows "generate_ring R H = \<Inter>{K. subring K R \<and> H \<subseteq> K}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate_ring R H = \<Inter> {K. subring K R \<and> H \<subseteq> K}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. generate_ring R H \<subseteq> \<Inter> {K. subring K R \<and> H \<subseteq> K}
 2. \<Inter> {K. subring K R \<and> H \<subseteq> K} \<subseteq> generate_ring R H
[PROOF STEP]
have "subring (generate_ring R H) R \<and> H \<subseteq> generate_ring R H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subring (generate_ring R H) R \<and> H \<subseteq> generate_ring R H
[PROOF STEP]
by (simp add: assms generate_ringE(2) generate_ring_is_subring)
[PROOF STATE]
proof (state)
this:
subring (generate_ring R H) R \<and> H \<subseteq> generate_ring R H

goal (2 subgoals):
 1. generate_ring R H \<subseteq> \<Inter> {K. subring K R \<and> H \<subseteq> K}
 2. \<Inter> {K. subring K R \<and> H \<subseteq> K} \<subseteq> generate_ring R H
[PROOF STEP]
thus "\<Inter>{K. subring K R \<and> H \<subseteq> K} \<subseteq> generate_ring R H"
[PROOF STATE]
proof (prove)
using this:
subring (generate_ring R H) R \<and> H \<subseteq> generate_ring R H

goal (1 subgoal):
 1. \<Inter> {K. subring K R \<and> H \<subseteq> K} \<subseteq> generate_ring R H
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Inter> {K. subring K R \<and> H \<subseteq> K} \<subseteq> generate_ring R H

goal (1 subgoal):
 1. generate_ring R H \<subseteq> \<Inter> {K. subring K R \<and> H \<subseteq> K}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. generate_ring R H \<subseteq> \<Inter> {K. subring K R \<and> H \<subseteq> K}
[PROOF STEP]
have "\<And>K. subring K R \<and> H \<subseteq> K \<Longrightarrow> generate_ring R H \<subseteq> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>K. subring K R \<and> H \<subseteq> K \<Longrightarrow> generate_ring R H \<subseteq> K
[PROOF STEP]
by (simp add: assms generate_ring_min_subring1)
[PROOF STATE]
proof (state)
this:
subring ?K R \<and> H \<subseteq> ?K \<Longrightarrow> generate_ring R H \<subseteq> ?K

goal (1 subgoal):
 1. generate_ring R H \<subseteq> \<Inter> {K. subring K R \<and> H \<subseteq> K}
[PROOF STEP]
thus "generate_ring R H \<subseteq> \<Inter>{K. subring K R \<and> H \<subseteq> K}"
[PROOF STATE]
proof (prove)
using this:
subring ?K R \<and> H \<subseteq> ?K \<Longrightarrow> generate_ring R H \<subseteq> ?K

goal (1 subgoal):
 1. generate_ring R H \<subseteq> \<Inter> {K. subring K R \<and> H \<subseteq> K}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
generate_ring R H \<subseteq> \<Inter> {K. subring K R \<and> H \<subseteq> K}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l_prod_elim: "w\<in>X \<cdot> Y \<longleftrightarrow> (\<exists>u v. w = u@v \<and> u\<in>X \<and> v\<in>Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w \<in> X \<cdot> Y) = (\<exists>u v. w = u @ v \<and> u \<in> X \<and> v \<in> Y)
[PROOF STEP]
by (simp add: c_prod_def times_list_def)


[STATEMENT]
lemma mtf2_moves_to_front: "distinct xs \<Longrightarrow> q \<in> set xs \<Longrightarrow> index (mtf2 (length xs) q xs) q  = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (mtf2 (length xs) q xs) q = 0
[PROOF STEP]
unfolding mtf2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
assume distxs: "distinct xs"
[PROOF STATE]
proof (state)
this:
distinct xs

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
assume qinxs: "q \<in> set xs"
[PROOF STATE]
proof (state)
this:
q \<in> set xs

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
have " index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q
    = index ( swaps [index xs q - length xs..<index xs q] xs) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = index (swaps [index xs q - length xs..<index xs q] xs) q
[PROOF STEP]
using qinxs
[PROOF STATE]
proof (prove)
using this:
q \<in> set xs

goal (1 subgoal):
 1. index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = index (swaps [index xs q - length xs..<index xs q] xs) q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = index (swaps [index xs q - length xs..<index xs q] xs) q

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = index (swaps [index xs q - length xs..<index xs q] xs) q

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
have "\<dots> = index xs q - (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (swaps [index xs q - length xs..<index xs q] xs) q = index xs q - length xs
[PROOF STEP]
apply(rule swapsthrough)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. distinct xs
 2. q \<in> set xs
[PROOF STEP]
using distxs qinxs
[PROOF STATE]
proof (prove)
using this:
distinct xs
q \<in> set xs

goal (2 subgoals):
 1. distinct xs
 2. q \<in> set xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
index (swaps [index xs q - length xs..<index xs q] xs) q = index xs q - length xs

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
index (swaps [index xs q - length xs..<index xs q] xs) q = index xs q - length xs

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index xs q - length xs = 0
[PROOF STEP]
using index_less_size_conv qinxs
[PROOF STATE]
proof (prove)
using this:
(index ?xs ?x < length ?xs) = (?x \<in> set ?xs)
q \<in> set xs

goal (1 subgoal):
 1. index xs q - length xs = 0
[PROOF STEP]
by (simp add: index_le_size)
[PROOF STATE]
proof (state)
this:
index xs q - length xs = 0

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
show "index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0"
[PROOF STATE]
proof (prove)
using this:
index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0

goal (1 subgoal):
 1. index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
index (if q \<in> set xs then swaps [index xs q - length xs..<index xs q] xs else xs) q = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cda_add_ax: "d ((x + y) \<cdot> z) = d (x \<cdot> z) + d (y \<cdot> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d ((x + y) \<cdot> z) = d (x \<cdot> z) + d (y \<cdot> z)
[PROOF STEP]
by (simp add: d_add_ax local.s_prod_distr)


[STATEMENT]
lemma NSLIM_mult_zero: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0 \<Longrightarrow> g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0 \<Longrightarrow> (\<lambda>x. f x * g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0"
  for f g :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (0::'b); g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (0::'b)\<rbrakk> \<Longrightarrow> (\<lambda>x. f x * g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (0::'b)
[PROOF STEP]
by (drule NSLIM_mult) auto


[STATEMENT]
theorem JF1set_natural: "JF1set o (JF1map u) = image u o JF1set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JF1set \<circ> JF1map u = (`) u \<circ> JF1set
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (JF1set \<circ> JF1map u) x = ((`) u \<circ> JF1set) x
[PROOF STEP]
apply (rule trans[OF o_apply])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. JF1set (JF1map u x) = ((`) u \<circ> JF1set) x
[PROOF STEP]
apply (rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ((`) u \<circ> JF1set) x = JF1set (JF1map u x)
[PROOF STEP]
apply (rule trans[OF o_apply])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. u ` JF1set x = JF1set (JF1map u x)
[PROOF STEP]
apply (rule trans[OF image_UN])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<Union>xa. u ` JF1col xa x) = JF1set (JF1map u x)
[PROOF STEP]
apply (rule SUP_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> u ` JF1col xa x = JF1col xa (JF1map u x)
[PROOF STEP]
apply (rule conjunct1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> u ` JF1col xa x = JF1col xa (JF1map u x) \<and> ?Q16 x xa
[PROOF STEP]
apply (rule spec[OF spec[OF JFcol_natural]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Im_image_cbox:
  assumes "Re a \<le> Re b" "Im a \<le> Im b"
  shows   "Im ` cbox a b = {Im a..Im b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im ` cbox a b = {Im a..Im b}
[PROOF STEP]
using inner_image_cbox[of "\<i>::complex" a b] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<i> \<in> Basis; \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i\<rbrakk> \<Longrightarrow> (\<lambda>x. x \<bullet> \<i>) ` cbox a b = {a \<bullet> \<i>..b \<bullet> \<i>}
Re a \<le> Re b
Im a \<le> Im b

goal (1 subgoal):
 1. Im ` cbox a b = {Im a..Im b}
[PROOF STEP]
by (auto simp: Basis_complex_def)


[STATEMENT]
lemma in_mkbot: "(x,y) \<in> mkbot L z \<longleftrightarrow> y\<noteq>z \<and> (if x=z then x\<noteq>y else (x,y) \<in> L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> mkbot L z) = (y \<noteq> z \<and> (if x = z then x \<noteq> y else (x, y) \<in> L))
[PROOF STEP]
by(auto simp:mkbot_def)


[STATEMENT]
lemma integer_sword8_bounded_eq:
   assumes "- (2 ^ (LENGTH(8) - 1)) \<le> i"
    and "i < 2 ^ (LENGTH(8) - 1)"
  shows "integer_of_sword8 (sword8_of_integer i) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_sword8 (sword8_of_integer i) = i
[PROOF STEP]
unfolding sword8_of_integer_def integer_of_sword8_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_sword (sword_of_integer i) = i
[PROOF STEP]
using integer_sword_bounded_eq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- (2 ^ (LENGTH(?'a) - 1)) \<le> ?i; ?i < 2 ^ (LENGTH(?'a) - 1)\<rbrakk> \<Longrightarrow> integer_of_sword (sword_of_integer ?i) = ?i
- (2 ^ (LENGTH(8) - 1)) \<le> i
i < 2 ^ (LENGTH(8) - 1)

goal (1 subgoal):
 1. integer_of_sword (sword_of_integer i) = i
[PROOF STEP]
by metis


[STATEMENT]
lemma adjuster_lincomb:
  assumes w: "(w :: 'a vec) : carrier_vec n"
    and us: "set (us :: 'a vec list) \<subseteq> carrier_vec n"
    and dist: "distinct us"
  shows "adjuster n w us = lincomb (\<lambda>u. -(w \<bullet>c u)/(u \<bullet>c u)) (set us)"
    (is "_ = lincomb ?a _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w us = lincomb (\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u)) (set us)
[PROOF STEP]
using us dist
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
distinct us

goal (1 subgoal):
 1. adjuster n w us = lincomb (\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u)) (set us)
[PROOF STEP]
unfolding lincomb_def
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
distinct us

goal (1 subgoal):
 1. adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
proof (induct us)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>v\<in>set []. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (a # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
case (Cons u us)
[PROOF STATE]
proof (state)
this:
\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
set (u # us) \<subseteq> carrier_vec n
distinct (u # us)

goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>v\<in>set []. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (a # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
let ?f = "\<lambda>u. ?a u \<cdot>\<^sub>v u"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>v\<in>set []. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (a # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
have "?f : (set us) \<rightarrow> carrier_vec n" and "?f u : carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n &&& - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n
[PROOF STEP]
using w Cons
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
set (u # us) \<subseteq> carrier_vec n
distinct (u # us)

goal (1 subgoal):
 1. (\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n &&& - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n
- (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n

goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>v\<in>set []. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (a # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n
- (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n

goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>v\<in>set []. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (a # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
have "u \<notin> set us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<notin> set us
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
set (u # us) \<subseteq> carrier_vec n
distinct (u # us)

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

goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>v\<in>set []. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (a # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n
- (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n
u \<notin> set us
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n
- (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n
u \<notin> set us

goal (1 subgoal):
 1. adjuster n w (u # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (u # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
unfolding adjuster.simps
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n
- (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n
u \<notin> set us

goal (1 subgoal):
 1. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u + adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (u # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
unfolding set_simps
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n
- (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n
u \<notin> set us

goal (1 subgoal):
 1. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u + adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>insert u (set us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
using finsum_insert[OF finite_set] Cons
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u) \<in> set us \<rightarrow> carrier_vec n
- (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u \<in> carrier_vec n
u \<notin> set us
\<lbrakk>?a \<notin> set ?xs1; ?f \<in> set ?xs1 \<rightarrow> carrier_vec n; ?f ?a \<in> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V ?f (insert ?a (set ?xs1)) = ?f ?a + finsum V ?f (set ?xs1)
\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>set us. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
set (u # us) \<subseteq> carrier_vec n
distinct (u # us)

goal (1 subgoal):
 1. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u + adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>v\<in>insert u (set us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjuster n w (u # us) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set (u # us). - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)

goal (1 subgoal):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>v\<in>set []. - (w \<bullet>c v) / (v \<bullet>c v) \<cdot>\<^sub>v v)
[PROOF STEP]
qed simp


[STATEMENT]
lemma (in ring) subcring_inter:
  assumes "subcring I R" and "subcring J R"
  shows "subcring (I \<inter> J) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcring (I \<inter> J) R
[PROOF STEP]
using subcringE[OF assms(1)] subcringE[OF assms(2)]
        subcringI[of "I \<inter> J"] subringI[of "I \<inter> J"]
[PROOF STATE]
proof (prove)
using this:
I \<subseteq> carrier R
\<zero> \<in> I
\<one> \<in> I
I \<noteq> {}
?h \<in> I \<Longrightarrow> \<ominus> ?h \<in> I
\<lbrakk>?h1.0 \<in> I; ?h2.0 \<in> I\<rbrakk> \<Longrightarrow> ?h1.0 \<otimes> ?h2.0 \<in> I
\<lbrakk>?h1.0 \<in> I; ?h2.0 \<in> I\<rbrakk> \<Longrightarrow> ?h1.0 \<oplus> ?h2.0 \<in> I
\<lbrakk>?h1.0 \<in> I; ?h2.0 \<in> I\<rbrakk> \<Longrightarrow> ?h1.0 \<otimes> ?h2.0 = ?h2.0 \<otimes> ?h1.0
J \<subseteq> carrier R
\<zero> \<in> J
\<one> \<in> J
J \<noteq> {}
?h \<in> J \<Longrightarrow> \<ominus> ?h \<in> J
\<lbrakk>?h1.0 \<in> J; ?h2.0 \<in> J\<rbrakk> \<Longrightarrow> ?h1.0 \<otimes> ?h2.0 \<in> J
\<lbrakk>?h1.0 \<in> J; ?h2.0 \<in> J\<rbrakk> \<Longrightarrow> ?h1.0 \<oplus> ?h2.0 \<in> J
\<lbrakk>?h1.0 \<in> J; ?h2.0 \<in> J\<rbrakk> \<Longrightarrow> ?h1.0 \<otimes> ?h2.0 = ?h2.0 \<otimes> ?h1.0
\<lbrakk>subring (I \<inter> J) R; \<And>h1 h2. \<lbrakk>h1 \<in> I \<inter> J; h2 \<in> I \<inter> J\<rbrakk> \<Longrightarrow> h1 \<otimes> h2 = h2 \<otimes> h1\<rbrakk> \<Longrightarrow> subcring (I \<inter> J) R
\<lbrakk>I \<inter> J \<subseteq> carrier R; \<one> \<in> I \<inter> J; \<And>h. h \<in> I \<inter> J \<Longrightarrow> \<ominus> h \<in> I \<inter> J; \<And>h1 h2. \<lbrakk>h1 \<in> I \<inter> J; h2 \<in> I \<inter> J\<rbrakk> \<Longrightarrow> h1 \<otimes> h2 \<in> I \<inter> J; \<And>h1 h2. \<lbrakk>h1 \<in> I \<inter> J; h2 \<in> I \<inter> J\<rbrakk> \<Longrightarrow> h1 \<oplus> h2 \<in> I \<inter> J\<rbrakk> \<Longrightarrow> subring (I \<inter> J) R

goal (1 subgoal):
 1. subcring (I \<inter> J) R
[PROOF STEP]
by auto


[STATEMENT]
lemma in_incs:
  assumes "(ys, t) \<in> set (incs a x (xs, s))"
  shows "length ys = length xs + 1 \<and> t = s + hd ys * a \<and> tl ys = xs \<and> C ys t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ys = length xs + 1 \<and> t = s + hd ys * a \<and> tl ys = xs \<and> C ys t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(ys, t) \<in> set (incs a x (xs, s))

goal (1 subgoal):
 1. length ys = length xs + 1 \<and> t = s + hd ys * a \<and> tl ys = xs \<and> C ys t
[PROOF STEP]
by (induct a x "(xs, s)" arbitrary: ys t rule: incs.induct)
    (subst (asm) (2) incs.simps, auto simp: Let_def)


[STATEMENT]
lemma fls_deriv_nth[simp]: "fls_deriv f $$ n = of_int (n+1) * f$$(n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv f $$ n = of_int (n + 1) * f $$ (n + 1)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fls_deriv f $$ n = of_int (n + 1) * f $$ (n + 1)
[PROOF STEP]
obtain N where "\<forall>n<N. f$$n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. \<forall>n<N. f $$ n = (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim fls_nth_vanishes_belowE)
[PROOF STATE]
proof (state)
this:
\<forall>n<N. f $$ n = (0::'a)

goal (1 subgoal):
 1. fls_deriv f $$ n = of_int (n + 1) * f $$ (n + 1)
[PROOF STEP]
hence "\<forall>n<N-1. of_int (n+1) * f$$(n+1) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>n<N. f $$ n = (0::'a)

goal (1 subgoal):
 1. \<forall>n<N - 1. of_int (n + 1) * f $$ (n + 1) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n<N - 1. of_int (n + 1) * f $$ (n + 1) = (0::'a)

goal (1 subgoal):
 1. fls_deriv f $$ n = of_int (n + 1) * f $$ (n + 1)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>n<N - 1. of_int (n + 1) * f $$ (n + 1) = (0::'a)

goal (1 subgoal):
 1. fls_deriv f $$ n = of_int (n + 1) * f $$ (n + 1)
[PROOF STEP]
using nth_Abs_fls_lower_bound
[PROOF STATE]
proof (prove)
using this:
\<forall>n<N - 1. of_int (n + 1) * f $$ (n + 1) = (0::'a)
\<forall>n<?N. ?f n = (0::?'a) \<Longrightarrow> Abs_fls ?f $$ ?n = ?f ?n

goal (1 subgoal):
 1. fls_deriv f $$ n = of_int (n + 1) * f $$ (n + 1)
[PROOF STEP]
unfolding fls_deriv_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n<N - 1. of_int (n + 1) * f $$ (n + 1) = (0::'a)
\<forall>n<?N. ?f n = (0::?'a) \<Longrightarrow> Abs_fls ?f $$ ?n = ?f ?n

goal (1 subgoal):
 1. Abs_fls (\<lambda>n. of_int (n + 1) * f $$ (n + 1)) $$ n = of_int (n + 1) * f $$ (n + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_deriv f $$ n = of_int (n + 1) * f $$ (n + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Suc_Suc_Suc_induct[elim!]:
  "\<lbrakk>i < Suc (Suc (Suc (0::nat))); primerec (ys ! 0) n;
  primerec (ys ! 1) n;
  primerec (ys ! 2) n\<rbrakk> \<Longrightarrow> primerec (ys ! i) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < Suc (Suc (Suc 0)); primerec (ys ! 0) n; primerec (ys ! 1) n; primerec (ys ! 2) n\<rbrakk> \<Longrightarrow> primerec (ys ! i) n
[PROOF STEP]
apply(cases i, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>nat < Suc (Suc 0); primerec (ys ! 0) n; primerec (ys ! Suc 0) n; primerec (ys ! 2) n; i = Suc nat\<rbrakk> \<Longrightarrow> primerec (ys ! Suc nat) n
[PROOF STEP]
apply(cases "i-1", simp, simp add: numeral_2_eq_2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mat1_index: assumes i: "i < n" and j: "j < n"
  shows "mat1I ze on n ! i ! j = (if i = j then on else ze)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat1I ze on n ! i ! j = (if i = j then on else ze)
[PROOF STEP]
by (simp add: col_mat1[OF i, simplified col_def] vec1_index[OF j])


[STATEMENT]
lemma fold_union:
  "Finite_Set.fold (\<lambda>x. (\<union>) {x}) {} (fset x) = fset x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.fold (\<lambda>x. (\<union>) {x}) {} (fset x) = fset x
[PROOF STEP]
by (induction x) (simp_all add: notin_fset comp_fun_idem_on.fold_insert_idem[OF comp_fun_idem_insert[unfolded comp_fun_idem_def']])


[STATEMENT]
theorem max_border_max_pref: assumes "u \<le>b w" shows "u \<le>p max_border w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<le>p max_border w
[PROOF STEP]
using  max_borderP_D_max[OF max_border_ex \<open>u \<le>b w\<close>]
[PROOF STATE]
proof (prove)
using this:
u \<le>p max_border w

goal (1 subgoal):
 1. u \<le>p max_border w
[PROOF STEP]
.


[STATEMENT]
lemma dim_gen_eigenspace: assumes "jordan_nf A n_as"
  shows "dim_gen_eigenspace A ev k
    = (\<Sum> n \<leftarrow> map fst [(n, e)\<leftarrow>n_as . e = ev]. min k n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim_gen_eigenspace A ev k = sum_list (map (min k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.dim_gen_eigenspace A ev k = sum_list (map (min k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))
[PROOF STEP]
from assms[unfolded jordan_nf_def]
[PROOF STATE]
proof (chain)
picking this:
0 \<notin> fst ` set n_as \<and> similar_mat A (jordan_matrix n_as)
[PROOF STEP]
have sim: "similar_mat A (jordan_matrix n_as)"
[PROOF STATE]
proof (prove)
using this:
0 \<notin> fst ` set n_as \<and> similar_mat A (jordan_matrix n_as)

goal (1 subgoal):
 1. similar_mat A (jordan_matrix n_as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat A (jordan_matrix n_as)

goal (1 subgoal):
 1. local.dim_gen_eigenspace A ev k = sum_list (map (min k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))
[PROOF STEP]
from dim_gen_eigenspace_jordan_matrix[of n_as, folded dim_gen_eigenspace_similar[OF this]]
[PROOF STATE]
proof (chain)
picking this:
local.dim_gen_eigenspace A ?ev ?k = sum_list (map (min ?k) (map fst (filter (\<lambda>(n, e). e = ?ev) n_as)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.dim_gen_eigenspace A ?ev ?k = sum_list (map (min ?k) (map fst (filter (\<lambda>(n, e). e = ?ev) n_as)))

goal (1 subgoal):
 1. local.dim_gen_eigenspace A ev k = sum_list (map (min k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.dim_gen_eigenspace A ev k = sum_list (map (min k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_root_mult_exp_cancel1:
  "\<lbrakk> 0 < x; 0 < n \<rbrakk> \<Longrightarrow> root n (x ^ (k * n)) = x ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; 0 < n\<rbrakk> \<Longrightarrow> root n (x ^ (k * n)) = x ^ k
[PROOF STEP]
by (auto dest: real_root_mult_exp_cancel [of _ 1])


[STATEMENT]
lemma count_partitions_iff:
  "count N partitions n \<longleftrightarrow> number_partition n N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (count N partitions n) = number_partition n N
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
assume "count N partitions n"
[PROOF STATE]
proof (state)
this:
count N partitions n

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
count N partitions n
[PROOF STEP]
have "(\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n)" "(\<Sum>i\<le>n. count N i * i) = n"
[PROOF STATE]
proof (prove)
using this:
count N partitions n

goal (1 subgoal):
 1. \<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n &&& (\<Sum>i\<le>n. count N i * i) = n
[PROOF STEP]
unfolding Number_Partition.partitions_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n) \<and> (\<Sum>i\<le>n. count N i * i) = n

goal (1 subgoal):
 1. \<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n &&& (\<Sum>i\<le>n. count N i * i) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n
(\<Sum>i\<le>n. count N i * i) = n

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n
(\<Sum>i\<le>n. count N i * i) = n

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n
(\<Sum>i\<le>n. count N i * i) = n
[PROOF STEP]
have "set_mset N \<subseteq> {..n}"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n
(\<Sum>i\<le>n. count N i * i) = n

goal (1 subgoal):
 1. set_mset N \<subseteq> {..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_mset N \<subseteq> {..n}

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set_mset N \<subseteq> {..n}

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
have "finite {..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {..n}

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n
(\<Sum>i\<le>n. count N i * i) = n
set_mset N \<subseteq> {..n}
finite {..n}
[PROOF STEP]
have "sum_mset N = n"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n
(\<Sum>i\<le>n. count N i * i) = n
set_mset N \<subseteq> {..n}
finite {..n}

goal (1 subgoal):
 1. \<Sum>\<^sub># N = n
[PROOF STEP]
using sum_mset_sum_count sum_mset_eq_sum_on_supersets
[PROOF STATE]
proof (prove)
using this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n
(\<Sum>i\<le>n. count N i * i) = n
set_mset N \<subseteq> {..n}
finite {..n}
\<Sum>\<^sub># ?M = (\<Sum>i\<in>set_mset ?M. count ?M i * i)
\<lbrakk>finite ?A; set_mset ?M \<subseteq> ?A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>set_mset ?M. count ?M i * i) = (\<Sum>i\<in>?A. count ?M i * i)

goal (1 subgoal):
 1. \<Sum>\<^sub># N = n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># N = n

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># N = n

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
have "0 \<notin># N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin># N
[PROOF STEP]
using \<open>\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>i. count N i \<noteq> 0 \<longrightarrow> 1 \<le> i \<and> i \<le> n

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

goal (2 subgoals):
 1. count N partitions n \<Longrightarrow> number_partition n N
 2. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Sum>\<^sub># N = n
0 \<notin># N
[PROOF STEP]
show "number_partition n N"
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># N = n
0 \<notin># N

goal (1 subgoal):
 1. number_partition n N
[PROOF STEP]
unfolding number_partition_def
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># N = n
0 \<notin># N

goal (1 subgoal):
 1. \<Sum>\<^sub># N = n \<and> 0 \<notin># N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
number_partition n N

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
assume "number_partition n N"
[PROOF STATE]
proof (state)
this:
number_partition n N

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
number_partition n N
[PROOF STEP]
have "sum_mset N = n" and "0 \<notin># N"
[PROOF STATE]
proof (prove)
using this:
number_partition n N

goal (1 subgoal):
 1. \<Sum>\<^sub># N = n &&& 0 \<notin># N
[PROOF STEP]
unfolding number_partition_def
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># N = n \<and> 0 \<notin># N

goal (1 subgoal):
 1. \<Sum>\<^sub># N = n &&& 0 \<notin># N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># N = n
0 \<notin># N

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># N = n
0 \<notin># N

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
assume "count N i \<noteq> 0"
[PROOF STATE]
proof (state)
this:
count N i \<noteq> 0

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
have "1 \<le> i \<and> i \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> i \<and> i \<le> n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 \<le> i
 2. i \<le> n
[PROOF STEP]
from \<open>0 \<notin># N\<close> \<open>count N i \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<notin># N
count N i \<noteq> 0
[PROOF STEP]
show "1 \<le> i"
[PROOF STATE]
proof (prove)
using this:
0 \<notin># N
count N i \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> i
[PROOF STEP]
using Suc_le_eq
[PROOF STATE]
proof (prove)
using this:
0 \<notin># N
count N i \<noteq> 0
(Suc ?m \<le> ?n) = (?m < ?n)

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

goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
from \<open>sum_mset N = n\<close> \<open>count N i \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
\<Sum>\<^sub># N = n
count N i \<noteq> 0
[PROOF STEP]
show "i \<le> n"
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># N = n
count N i \<noteq> 0

goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
using multi_member_split
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># N = n
count N i \<noteq> 0
?x \<in># ?M \<Longrightarrow> \<exists>A. ?M = add_mset ?x A

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

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

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
count N ?i2 \<noteq> 0 \<Longrightarrow> 1 \<le> ?i2 \<and> ?i2 \<le> n

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
count N ?i2 \<noteq> 0 \<Longrightarrow> 1 \<le> ?i2 \<and> ?i2 \<le> n

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
from \<open>sum_mset N = n\<close>
[PROOF STATE]
proof (chain)
picking this:
\<Sum>\<^sub># N = n
[PROOF STEP]
have "(\<Sum>i\<le>n. count N i * i) = n"
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># N = n

goal (1 subgoal):
 1. (\<Sum>i\<le>n. count N i * i) = n
[PROOF STEP]
by (metis atMost_iff calculation finite_atMost not_in_iff subsetI sum_mset_eq_sum_on_supersets sum_mset_sum_count)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. count N i * i) = n

goal (1 subgoal):
 1. number_partition n N \<Longrightarrow> count N partitions n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
count N ?i2 \<noteq> 0 \<Longrightarrow> 1 \<le> ?i2 \<and> ?i2 \<le> n
(\<Sum>i\<le>n. count N i * i) = n
[PROOF STEP]
show "count N partitions n"
[PROOF STATE]
proof (prove)
using this:
count N ?i2 \<noteq> 0 \<Longrightarrow> 1 \<le> ?i2 \<and> ?i2 \<le> n
(\<Sum>i\<le>n. count N i * i) = n

goal (1 subgoal):
 1. count N partitions n
[PROOF STEP]
by (rule partitionsI) auto
[PROOF STATE]
proof (state)
this:
count N partitions n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_map_sq_matrix: "map_sq_matrix f A + map_sq_matrix g A = map_sq_matrix (\<lambda>x. f x + g x) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_sq_matrix f A + map_sq_matrix g A = map_sq_matrix (\<lambda>x. f x + g x) A
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma eSuc_minus_eSuc [simp]: "((n::eint) + 1) - (m + 1) = n - m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n + 1 - (m + 1) = n - m
[PROOF STEP]
apply(cases "n = \<infinity>")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n = \<infinity> \<Longrightarrow> n + 1 - (m + 1) = n - m
 2. n \<noteq> \<infinity> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> \<infinity> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
apply(cases "m = \<infinity>")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>n \<noteq> \<infinity>; m = \<infinity>\<rbrakk> \<Longrightarrow> n + 1 - (m + 1) = n - m
 2. \<lbrakk>n \<noteq> \<infinity>; m \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
apply (metis eSuc_infinity eint.exhaust idiff_infinity_right infinity_ne_i1 sum_infinity_imp_summand_infinity)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<noteq> \<infinity>; m \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>n \<noteq> \<infinity>; m \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
assume A: "n \<noteq>\<infinity>" "m \<noteq> \<infinity>"
[PROOF STATE]
proof (state)
this:
n \<noteq> \<infinity>
m \<noteq> \<infinity>

goal (1 subgoal):
 1. \<lbrakk>n \<noteq> \<infinity>; m \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
obtain a where a_def: "n = eint a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. n = eint a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
n \<noteq> \<infinity>
m \<noteq> \<infinity>

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

goal (1 subgoal):
 1. \<lbrakk>n \<noteq> \<infinity>; m \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
obtain b where b_def: "m = eint b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. m = eint b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
n \<noteq> \<infinity>
m \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<And>b. m = eint b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = eint b

goal (1 subgoal):
 1. \<lbrakk>n \<noteq> \<infinity>; m \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> n + 1 - (m + 1) = n - m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n + 1 - (m + 1) = n - m
[PROOF STEP]
using  idiff_eint_eint[of "a + 1" "b + 1"]
           idiff_eint_eint[of a b]
[PROOF STATE]
proof (prove)
using this:
eint (a + 1) - eint (b + 1) = eint (a + 1 - (b + 1))
eint a - eint b = eint (a - b)

goal (1 subgoal):
 1. n + 1 - (m + 1) = n - m
[PROOF STEP]
by (simp add: a_def b_def eSuc_eint)
[PROOF STATE]
proof (state)
this:
n + 1 - (m + 1) = n - m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma as_list_helper_props :
  assumes "finite X"
  shows "set (as_list_helper X) = X"
    and "distinct (as_list_helper X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (as_list_helper X) = X &&& distinct (as_list_helper X)
[PROOF STEP]
using finite_distinct_list[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs = X \<and> distinct xs

goal (1 subgoal):
 1. set (as_list_helper X) = X &&& distinct (as_list_helper X)
[PROOF STEP]
using someI[of "\<lambda> xs . set xs = X \<and> distinct xs"]
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs = X \<and> distinct xs
set ?x = X \<and> distinct ?x \<Longrightarrow> set (SOME xs. set xs = X \<and> distinct xs) = X \<and> distinct (SOME xs. set xs = X \<and> distinct xs)

goal (1 subgoal):
 1. set (as_list_helper X) = X &&& distinct (as_list_helper X)
[PROOF STEP]
by (metis as_list_helper_def)+


[STATEMENT]
lemma aform_val_uminus_aform[simp]: "aform_val e (uminus_aform X) = - aform_val e X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aform_val e (uminus_aform X) = - aform_val e X
[PROOF STEP]
by (auto simp: uminus_aform_def aform_val_def)


[STATEMENT]
lemma push_bit_Suc_numeral [simp]:
  \<open>push_bit (Suc n) (numeral k) = push_bit n (numeral (Num.Bit0 k))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (Suc n) (numeral k) = push_bit n (numeral (num.Bit0 k))
[PROOF STEP]
by (simp add: numeral_eq_Suc mult_2_right) (simp add: numeral_Bit0)


[STATEMENT]
lemma DAcc_DSourcesNOT:
"(X \<notin> DAcc i C) = (C \<notin> DSources i X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<notin> DAcc i C) = (C \<notin> DSources i X)
[PROOF STEP]
by (auto, (simp add: DAcc_def DSources_def, auto)+)


[STATEMENT]
lemma neq_4k1_k43: "(4 * real m + 1) / (2 * 2^n) \<noteq> (4 * real m' + 3) / (2 * 2 ^ n')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) \<noteq> (4 * real m' + 3) / (2 * 2 ^ n')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n') \<Longrightarrow> False
[PROOF STEP]
assume "(4 * real m + 1) / (2 * 2^n) = (4 * real m' + 3) / (2 * 2 ^ n')"
[PROOF STATE]
proof (state)
this:
(4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n')

goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n') \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n')
[PROOF STEP]
have "real (Suc (4 * m) * (2 * 2 ^ n')) = real ((4 * m' + 3) * (2 * 2^n))"
[PROOF STATE]
proof (prove)
using this:
(4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n')

goal (1 subgoal):
 1. real (Suc (4 * m) * (2 * 2 ^ n')) = real ((4 * m' + 3) * (2 * 2 ^ n))
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
real (Suc (4 * m) * (2 * 2 ^ n')) = real ((4 * m' + 3) * (2 * 2 ^ n))

goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n') \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (Suc (4 * m) * (2 * 2 ^ n')) = real ((4 * m' + 3) * (2 * 2 ^ n))
[PROOF STEP]
have "Suc (4 * m) * (2 * 2 ^ n') = (4 * m' + 3) * (2 * 2^n)"
[PROOF STATE]
proof (prove)
using this:
real (Suc (4 * m) * (2 * 2 ^ n')) = real ((4 * m' + 3) * (2 * 2 ^ n))

goal (1 subgoal):
 1. Suc (4 * m) * (2 * 2 ^ n') = (4 * m' + 3) * (2 * 2 ^ n)
[PROOF STEP]
using of_nat_eq_iff
[PROOF STATE]
proof (prove)
using this:
real (Suc (4 * m) * (2 * 2 ^ n')) = real ((4 * m' + 3) * (2 * 2 ^ n))
(of_nat ?m = of_nat ?n) = (?m = ?n)

goal (1 subgoal):
 1. Suc (4 * m) * (2 * 2 ^ n') = (4 * m' + 3) * (2 * 2 ^ n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Suc (4 * m) * (2 * 2 ^ n') = (4 * m' + 3) * (2 * 2 ^ n)

goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n') \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (4 * m) * (2 * 2 ^ n') = (4 * m' + 3) * (2 * 2 ^ n)
[PROOF STEP]
have "Suc (4 * m) * (2 ^ n') = (4 * m' + 3) * (2^n)"
[PROOF STATE]
proof (prove)
using this:
Suc (4 * m) * (2 * 2 ^ n') = (4 * m' + 3) * (2 * 2 ^ n)

goal (1 subgoal):
 1. Suc (4 * m) * 2 ^ n' = (4 * m' + 3) * 2 ^ n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
Suc (4 * m) * 2 ^ n' = (4 * m' + 3) * 2 ^ n

goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n') \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (4 * m) * 2 ^ n' = (4 * m' + 3) * 2 ^ n
[PROOF STEP]
have "Suc (4 * m) = (4 * m' + 3)"
[PROOF STATE]
proof (prove)
using this:
Suc (4 * m) * 2 ^ n' = (4 * m' + 3) * 2 ^ n

goal (1 subgoal):
 1. Suc (4 * m) = 4 * m' + 3
[PROOF STEP]
by (rule prime_power_cancel2 [OF two_is_prime_nat]) auto
[PROOF STATE]
proof (state)
this:
Suc (4 * m) = 4 * m' + 3

goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n') \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (4 * m) = 4 * m' + 3
[PROOF STEP]
have "1 + 2 * m' = 2 * m"
[PROOF STATE]
proof (prove)
using this:
Suc (4 * m) = 4 * m' + 3

goal (1 subgoal):
 1. 1 + 2 * m' = 2 * m
[PROOF STEP]
using \<open>Suc (4 * m) = 4 * m' + 3\<close>
[PROOF STATE]
proof (prove)
using this:
Suc (4 * m) = 4 * m' + 3
Suc (4 * m) = 4 * m' + 3

goal (1 subgoal):
 1. 1 + 2 * m' = 2 * m
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 + 2 * m' = 2 * m

goal (1 subgoal):
 1. (4 * real m + 1) / (2 * 2 ^ n) = (4 * real m' + 3) / (2 * 2 ^ n') \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 + 2 * m' = 2 * m
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
1 + 2 * m' = 2 * m

goal (1 subgoal):
 1. False
[PROOF STEP]
using even_Suc
[PROOF STATE]
proof (prove)
using this:
1 + 2 * m' = 2 * m
even (Suc ?n) = odd ?n

goal (1 subgoal):
 1. False
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all_map_P [simp]: "list_all (\<lambda>b. b) (map (\<lambda>x. P x) list) = (\<forall>x \<in> set list. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>b. b) (map P list) = (\<forall>x\<in>set list. P x)
[PROOF STEP]
by (induct list) simp_all


[STATEMENT]
lemma lcm_1_iff_nat [simp]: "lcm m n = Suc 0 \<longleftrightarrow> m = Suc 0 \<and> n = Suc 0"
  for m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lcm m n = Suc 0) = (m = Suc 0 \<and> n = Suc 0)
[PROOF STEP]
using lcm_eq_1_iff [of m n]
[PROOF STATE]
proof (prove)
using this:
(lcm m n = 1) = (is_unit m \<and> is_unit n)

goal (1 subgoal):
 1. (lcm m n = Suc 0) = (m = Suc 0 \<and> n = Suc 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma psubset_filter_fset:
  "(\<And>x. x |\<in>| xs \<Longrightarrow> P x \<Longrightarrow> Q x) \<Longrightarrow> (x |\<in>| xs & \<not> P x & Q x) \<Longrightarrow>
    filter_fset P xs |\<subset>| filter_fset Q xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. \<lbrakk>x |\<in>| xs; P x\<rbrakk> \<Longrightarrow> Q x; x |\<in>| xs \<and> \<not> P x \<and> Q x\<rbrakk> \<Longrightarrow> filter_fset P xs |\<subset>| filter_fset Q xs
[PROOF STEP]
unfolding less_fset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. \<lbrakk>x |\<in>| xs; P x\<rbrakk> \<Longrightarrow> Q x; x |\<in>| xs \<and> \<not> P x \<and> Q x\<rbrakk> \<Longrightarrow> filter_fset P xs |\<subseteq>| filter_fset Q xs \<and> filter_fset P xs \<noteq> filter_fset Q xs
[PROOF STEP]
by (auto simp add: subset_filter_fset eq_filter_fset)


[STATEMENT]
lemma list_ord_imp: "
  \<lbrakk> \<And>x y. ord x y \<Longrightarrow> ord' x y; list_ord ord xs \<rbrakk> \<Longrightarrow>
  list_ord ord' xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. ord x y \<Longrightarrow> ord' x y; list_ord ord xs\<rbrakk> \<Longrightarrow> list_ord ord' xs
[PROOF STEP]
apply (induct xs, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>\<And>x y. ord x y \<Longrightarrow> ord' x y; list_ord ord xs\<rbrakk> \<Longrightarrow> list_ord ord' xs; \<And>x y. ord x y \<Longrightarrow> ord' x y; list_ord ord (a # xs)\<rbrakk> \<Longrightarrow> list_ord ord' (a # xs)
[PROOF STEP]
apply (simp add: list_ord_Cons)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>list_ord ord xs \<Longrightarrow> list_ord ord' xs; \<And>x y. ord x y \<Longrightarrow> ord' x y; xs = [] \<or> ord a (hd xs) \<and> list_ord ord xs\<rbrakk> \<Longrightarrow> xs = [] \<or> ord' a (hd xs) \<and> list_ord ord' xs
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma SA_nat_pow:
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "(f [^]\<^bsub>SA n\<^esub> (k::nat)) x = (f x) [^]\<^bsub>Q\<^sub>p\<^esub> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f [^]\<^bsub>SA n\<^esub> k) x = f x [^] k
[PROOF STEP]
apply(induction k)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f [^]\<^bsub>SA n\<^esub> 0) x = f x [^] 0
 2. \<And>k. (f [^]\<^bsub>SA n\<^esub> k) x = f x [^] k \<Longrightarrow> (f [^]\<^bsub>SA n\<^esub> Suc k) x = f x [^] Suc k
[PROOF STEP]
using assms  nat_pow_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
?a [^]\<^bsub>?G\<^esub> ?n = rec_nat \<one>\<^bsub>?G\<^esub> (\<lambda>u b. b \<otimes>\<^bsub>?G\<^esub> ?a) ?n

goal (2 subgoals):
 1. (f [^]\<^bsub>SA n\<^esub> 0) x = f x [^] 0
 2. \<And>k. (f [^]\<^bsub>SA n\<^esub> k) x = f x [^] k \<Longrightarrow> (f [^]\<^bsub>SA n\<^esub> Suc k) x = f x [^] Suc k
[PROOF STEP]
apply (metis function_one_eval SA_one old.nat.simps(6))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. (f [^]\<^bsub>SA n\<^esub> k) x = f x [^] k \<Longrightarrow> (f [^]\<^bsub>SA n\<^esub> Suc k) x = f x [^] Suc k
[PROOF STEP]
using assms SA_mult
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
?x \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> (?f \<otimes>\<^bsub>SA ?n\<^esub> ?g) ?x = ?f ?x \<otimes> ?g ?x

goal (1 subgoal):
 1. \<And>k. (f [^]\<^bsub>SA n\<^esub> k) x = f x [^] k \<Longrightarrow> (f [^]\<^bsub>SA n\<^esub> Suc k) x = f x [^] Suc k
[PROOF STEP]
by (metis Group.nat_pow_Suc)


[STATEMENT]
theorem swapVal_preserves_sWls[simp]:
"sWlsVal SEM (val ^[z1 \<and> z2]_zs) = sWlsVal SEM val"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sWlsVal SEM (val ^[z1 \<and> z2]_zs) = sWlsVal SEM val
[PROOF STEP]
using swapVal_preserves_sWls1[of _ _ zs z1 z2]
[PROOF STATE]
proof (prove)
using this:
sWlsVal ?SEM ?val \<Longrightarrow> sWlsVal ?SEM (?val ^[z1 \<and> z2]_zs)

goal (1 subgoal):
 1. sWlsVal SEM (val ^[z1 \<and> z2]_zs) = sWlsVal SEM val
[PROOF STEP]
by fastforce


[STATEMENT]
lemma residue_primroot_mod [simp]: "residue_primroot n (x mod n) = residue_primroot n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue_primroot n (x mod n) = residue_primroot n x
[PROOF STEP]
by (cases "n = 0") (simp_all add: residue_primroot_def)


[STATEMENT]
lemma vint_minus_closed:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "x -\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x -\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x -\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
have "x' - y' \<in> UNIV" for x' y' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' - y' \<in> UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' - ?y' \<in> UNIV

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

goal (1 subgoal):
 1. x -\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x -\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_obtain_fresh_paramS:
assumes "wlsPar P"
shows
"\<exists> z.
 (\<forall> xs. z \<notin> varsOfS P xs) \<and>
 (\<forall> s. \<forall> X \<in> termsOfS P s. fresh zs z X) \<and>
 (\<forall> us s. \<forall> A \<in> absOfS P (us,s). freshAbs zs z A) \<and>
 (\<forall> rho \<in> envsOfS P. freshEnv zs z rho)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. (\<forall>xs. z \<notin> varsOfS P xs) \<and> (\<forall>s. \<forall>X\<in>termsOfS P s. fresh zs z X) \<and> (\<forall>us s. \<forall>A\<in>absOfS P (us, s). freshAbs zs z A) \<and> (\<forall>rho\<in>envsOfS P. freshEnv zs z rho)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsPar P

goal (1 subgoal):
 1. \<exists>z. (\<forall>xs. z \<notin> varsOfS P xs) \<and> (\<forall>s. \<forall>X\<in>termsOfS P s. fresh zs z X) \<and> (\<forall>us s. \<forall>A\<in>absOfS P (us, s). freshAbs zs z A) \<and> (\<forall>rho\<in>envsOfS P. freshEnv zs z rho)
[PROOF STEP]
by(cases P) (auto intro: wls_obtain_fresh)


[STATEMENT]
lemma Sup_image_eadd2:
  "Y \<noteq> {} \<Longrightarrow> Sup ((\<lambda>y :: enat. x + y) ` Y) = x + Sup Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> \<Squnion> ((+) x ` Y) = x + \<Squnion> Y
[PROOF STEP]
by(simp add: Sup_image_eadd1 add.commute)


[STATEMENT]
lemma isUCont_isCont: "isUCont f \<Longrightarrow> isCont f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isUCont f \<Longrightarrow> isCont f x
[PROOF STEP]
by (drule uniformly_continuous_imp_continuous) (simp add: continuous_on_eq_continuous_at)


[STATEMENT]
lemma Suffixes_subset_Sublists: "Suffixes A \<subseteq> Sublists A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suffixes A \<subseteq> Sublists A
[PROOF STEP]
unfolding Suffixes_def Sublists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w. \<exists>q. q @ w \<in> A} \<subseteq> {w. Bex A (sublist w)}
[PROOF STEP]
by auto


[STATEMENT]
lemma multiplicity_distinct_prime_power:
  "prime p \<Longrightarrow> prime q \<Longrightarrow> p \<noteq> q \<Longrightarrow> multiplicity p (q ^ n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q\<rbrakk> \<Longrightarrow> multiplicity p (q ^ n) = 0
[PROOF STEP]
by (subst prime_elem_multiplicity_power_distrib) (auto simp: prime_multiplicity_other)


[STATEMENT]
lemma state_rank_oldest_token_le:
  assumes "state_rank p n = Some i"
  assumes "state_rank q n = Some j"
  assumes "oldest_token p n = Some x"
  assumes "oldest_token q n = Some y"
  shows "i \<le> j \<longleftrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<le> j) = (x \<le> y)
[PROOF STEP]
using state_rank_oldest_token[OF assms] assms state_rank_distinct oldest_token_equal
[PROOF STATE]
proof (prove)
using this:
(i < j) = (x < y)
state_rank p n = Some i
state_rank q n = Some j
oldest_token p n = Some x
oldest_token q n = Some y
\<lbrakk>?p \<noteq> ?q; state_rank ?p ?n = Some ?i; state_rank ?q ?n = Some ?j\<rbrakk> \<Longrightarrow> ?i \<noteq> ?j
\<lbrakk>oldest_token ?q ?n = Some ?i; oldest_token ?q' ?n = Some ?i\<rbrakk> \<Longrightarrow> ?q = ?q'

goal (1 subgoal):
 1. (i \<le> j) = (x \<le> y)
[PROOF STEP]
by (cases "x = y") ((metis option.sel order_refl), (metis le_eq_less_or_eq option.inject))


[STATEMENT]
lemma flatten2_im:
  fixes f :: "'a \<Rightarrow> 'a \<Rightarrow> 'b::join_semilattice_zero"
  assumes "finite (A ::'a set)"
  and "finite (B ::'a set)"
  shows "\<Sum>((\<lambda>y. \<Sum> ((\<lambda>x. f x y) ` A)) ` B) = \<Sum>((\<lambda>p. f (fst p) (snd p)) ` (A \<times> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>y. \<Sum> ((\<lambda>x. f x y) ` A)) ` B) = \<Sum> ((\<lambda>p. f (fst p) (snd p)) ` (A \<times> B))
[PROOF STEP]
by (simp only: flatten1_im assms cart_flip)


[STATEMENT]
lemma interior_of_eq_empty_alt:
   "X interior_of S = {} \<longleftrightarrow> (\<forall>T. openin X T \<and> T \<noteq> {} \<longrightarrow> T - S \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X interior_of S = {}) = (\<forall>T. openin X T \<and> T \<noteq> {} \<longrightarrow> T - S \<noteq> {})
[PROOF STEP]
by (auto simp: interior_of_eq_empty)


[STATEMENT]
lemma of_match_fields_safe_eq: assumes "all_prerequisites m" shows "OF_match_fields_safe m = OF_match_fields_unsafe m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OF_match_fields_safe m = OF_match_fields_unsafe m
[PROOF STEP]
unfolding OF_match_fields_safe_def[abs_def] fun_eq_iff comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. the (OF_match_fields m x) = OF_match_fields_unsafe m x
[PROOF STEP]
unfolding of_safe_unsafe_match_eq[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. the (Some (OF_match_fields_unsafe m x)) = OF_match_fields_unsafe m x
[PROOF STEP]
unfolding option.sel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. OF_match_fields_unsafe m x = OF_match_fields_unsafe m x
[PROOF STEP]
by clarify


[STATEMENT]
lemma Borsuk_map_into_sphere:
   "(\<lambda>x. inverse(norm (x - a)) *\<^sub>R (x - a)) ` s \<subseteq> sphere 0 1 \<longleftrightarrow> (a \<notin> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (x - a) /\<^sub>R norm (x - a)) ` s \<subseteq> sphere (0::'a) 1) = (a \<notin> s)
[PROOF STEP]
by auto (metis eq_iff_diff_eq_0 left_inverse norm_eq_zero)


[STATEMENT]
theorem Lambert_W_asymp_equiv_at_right_minus_exp_minus1:
  defines "e \<equiv> exp 1"
  defines "a \<equiv> -exp (-1)"
  defines "C1 \<equiv> sqrt (2 * exp 1)"
  defines "f \<equiv> (\<lambda>x. -1 + C1 * sqrt (x - a))"
  shows   "(\<lambda>x. Lambert_W x - f x) \<sim>[at_right a] (\<lambda>x. -2/3 * e * (x - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
define C :: "real \<Rightarrow> real" where "C = (\<lambda>c. sqrt (2/e)/3 * (2*e+3*c))"
[PROOF STATE]
proof (state)
this:
C = (\<lambda>c. sqrt (2 / e) / 3 * (2 * e + 3 * c))

goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
have asymp_equiv: "(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x)
                       \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3/2))" if "c \<noteq> -2/3 * e" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> - 2 / 3 * e
[PROOF STEP]
have "C c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> - 2 / 3 * e

goal (1 subgoal):
 1. C c \<noteq> 0
[PROOF STEP]
by (auto simp: C_def e_def)
[PROOF STATE]
proof (state)
this:
C c \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
have "(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3/2))
            \<in> o[at_right a](\<lambda>x. (x - a) powr (3/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))
[PROOF STEP]
unfolding f_def a_def C_def C1_def e_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (- 1 + sqrt (2 * exp 1) * sqrt (x - - exp (- 1)) + c * (x - - exp (- 1))) * exp (- 1 + sqrt (2 * exp 1) * sqrt (x - - exp (- 1)) + c * (x - - exp (- 1))) - x - sqrt (2 / exp 1) / 3 * (2 * exp 1 + 3 * c) * (x - - exp (- 1)) powr (3 / 2)) \<in> o[at_right (- exp (- 1))](\<lambda>x. (x - - exp (- 1)) powr (3 / 2))
[PROOF STEP]
by (real_asymp simp: field_simps real_sqrt_mult real_sqrt_divide sqrt_sqrt_mult
                           exp_minus simp flip: sqrt_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
using \<open>C c \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))
C c \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
by (intro smallo_imp_asymp_equiv) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?c \<noteq> - 2 / 3 * e \<Longrightarrow> (\<lambda>x. (f x + ?c * (x - a)) * exp (f x + ?c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C ?c * (x - a) powr (3 / 2))

goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
proof (rule asymp_equiv_sandwich')
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
fix c' :: real
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
assume c': "c' \<in> {-e<..<-2/3*e}"
[PROOF STATE]
proof (state)
this:
c' \<in> {- e<..<- 2 / 3 * e}

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence neq: "c' \<noteq> -2/3 * e"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- e<..<- 2 / 3 * e}

goal (1 subgoal):
 1. c' \<noteq> - 2 / 3 * e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c' \<noteq> - 2 / 3 * e

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
from c'
[PROOF STATE]
proof (chain)
picking this:
c' \<in> {- e<..<- 2 / 3 * e}
[PROOF STEP]
have neg: "C c' < 0"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- e<..<- 2 / 3 * e}

goal (1 subgoal):
 1. C c' < 0
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- e<..<- 2 / 3 * e}

goal (1 subgoal):
 1. sqrt (2 / e) / 3 * (2 * e + 3 * c') < 0
[PROOF STEP]
by (auto intro!: mult_pos_neg)
[PROOF STATE]
proof (state)
this:
C c' < 0

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence "eventually (\<lambda>x. C c' * (x - a) powr (3 / 2) < 0) (at_right a)"
[PROOF STATE]
proof (prove)
using this:
C c' < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. C c' * (x - a) powr (3 / 2) < 0
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. C c' * (x - a) powr (3 / 2) < 0

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence "eventually (\<lambda>x. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0) (at_right a)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. C c' * (x - a) powr (3 / 2) < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0
[PROOF STEP]
using asymp_equiv_eventually_neg_iff[OF asymp_equiv[OF neq]]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. C c' * (x - a) powr (3 / 2) < 0
\<forall>\<^sub>F x in at_right a. ((f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0) = (C c' * (x - a) powr (3 / 2) < 0)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0
[PROOF STEP]
by eventually_elim (use neg in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
thus "eventually (\<lambda>x. Lambert_W x - f x \<ge> c' * (x - a)) (at_right a)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0 \<Longrightarrow> c' * (x - a) \<le> Lambert_W x - f x
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
(f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0

goal (1 subgoal):
 1. \<And>x. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0 \<Longrightarrow> c' * (x - a) \<le> Lambert_W x - f x
[PROOF STEP]
hence "Lambert_W x \<ge> f x + c' * (x - a)"
[PROOF STATE]
proof (prove)
using this:
(f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0

goal (1 subgoal):
 1. f x + c' * (x - a) \<le> Lambert_W x
[PROOF STEP]
by (intro Lambert_W_geI) auto
[PROOF STATE]
proof (state)
this:
f x + c' * (x - a) \<le> Lambert_W x

goal (1 subgoal):
 1. \<And>x. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0 \<Longrightarrow> c' * (x - a) \<le> Lambert_W x - f x
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
f x + c' * (x - a) \<le> Lambert_W x

goal (1 subgoal):
 1. c' * (x - a) \<le> Lambert_W x - f x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c' * (x - a) \<le> Lambert_W x - f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W x - f x

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
fix c' :: real
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
assume c': "c' \<in> {-2/3*e<..<0}"
[PROOF STATE]
proof (state)
this:
c' \<in> {- 2 / 3 * e<..<0}

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence neq: "c' \<noteq> -2/3 * e"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- 2 / 3 * e<..<0}

goal (1 subgoal):
 1. c' \<noteq> - 2 / 3 * e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c' \<noteq> - 2 / 3 * e

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
from c'
[PROOF STATE]
proof (chain)
picking this:
c' \<in> {- 2 / 3 * e<..<0}
[PROOF STEP]
have pos: "C c' > 0"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- 2 / 3 * e<..<0}

goal (1 subgoal):
 1. 0 < C c'
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- 2 / 3 * e<..<0}

goal (1 subgoal):
 1. 0 < sqrt (2 / e) / 3 * (2 * e + 3 * c')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < C c'

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence "eventually (\<lambda>x. C c' * (x - a) powr (3 / 2) > 0) (at_right a)"
[PROOF STATE]
proof (prove)
using this:
0 < C c'

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. 0 < C c' * (x - a) powr (3 / 2)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. 0 < C c' * (x - a) powr (3 / 2)

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence "eventually (\<lambda>x. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x > 0) (at_right a)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. 0 < C c' * (x - a) powr (3 / 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
[PROOF STEP]
using asymp_equiv_eventually_pos_iff[OF asymp_equiv[OF neq]]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. 0 < C c' * (x - a) powr (3 / 2)
\<forall>\<^sub>F x in at_right a. (0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x) = (0 < C c' * (x - a) powr (3 / 2))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
[PROOF STEP]
by eventually_elim (use pos in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
have "eventually (\<lambda>x. - 1 \<le> f x + c' * (x - a)) (at_right a)"
                  "eventually (\<lambda>x. x > a) (at_right a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. - 1 \<le> f x + c' * (x - a) &&& eventually ((<) a) (at_right a)
[PROOF STEP]
unfolding a_def f_def C1_def c'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right (- exp (- 1)). - 1 \<le> - 1 + sqrt (2 * exp 1) * sqrt (x - - exp (- 1)) + c' * (x - - exp (- 1)) &&& eventually ((<) (- exp (- 1))) (at_right (- exp (- 1)))
[PROOF STEP]
by real_asymp+
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. - 1 \<le> f x + c' * (x - a)
eventually ((<) a) (at_right a)

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
\<forall>\<^sub>F x in at_right a. - 1 \<le> f x + c' * (x - a)
eventually ((<) a) (at_right a)
[PROOF STEP]
show "eventually (\<lambda>x. Lambert_W x - f x \<le> c' * (x - a)) (at_right a)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
\<forall>\<^sub>F x in at_right a. - 1 \<le> f x + c' * (x - a)
eventually ((<) a) (at_right a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x; - 1 \<le> f x + c' * (x - a); a < x\<rbrakk> \<Longrightarrow> Lambert_W x - f x \<le> c' * (x - a)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
- 1 \<le> f x + c' * (x - a)
a < x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x; - 1 \<le> f x + c' * (x - a); a < x\<rbrakk> \<Longrightarrow> Lambert_W x - f x \<le> c' * (x - a)
[PROOF STEP]
hence "Lambert_W x \<le> f x + c' * (x - a)"
[PROOF STATE]
proof (prove)
using this:
0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
- 1 \<le> f x + c' * (x - a)
a < x

goal (1 subgoal):
 1. Lambert_W x \<le> f x + c' * (x - a)
[PROOF STEP]
by (intro Lambert_W_leI) (auto simp: a_def)
[PROOF STATE]
proof (state)
this:
Lambert_W x \<le> f x + c' * (x - a)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x; - 1 \<le> f x + c' * (x - a); a < x\<rbrakk> \<Longrightarrow> Lambert_W x - f x \<le> c' * (x - a)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Lambert_W x \<le> f x + c' * (x - a)

goal (1 subgoal):
 1. Lambert_W x - f x \<le> c' * (x - a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Lambert_W x - f x \<le> c' * (x - a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. Lambert_W x - f x \<le> c' * (x - a)

goal (3 subgoals):
 1. - e < - 2 / 3 * e
 2. - 2 / 3 * e < 0
 3. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
qed (auto simp: e_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Lambert_W x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_distr_masks:
  "multiply_mask a (add_masks b c) = add_masks (multiply_mask a b) (multiply_mask a c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiply_mask a (add_masks b c) = add_masks (multiply_mask a b) (multiply_mask a c)
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. multiply_mask a (add_masks b c) x = add_masks (multiply_mask a b) (multiply_mask a c) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. multiply_mask a (add_masks b c) x = add_masks (multiply_mask a b) (multiply_mask a c) x
[PROOF STEP]
show "multiply_mask a (add_masks b c) x = add_masks (multiply_mask a b) (multiply_mask a c) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiply_mask a (add_masks b c) x = add_masks (multiply_mask a b) (multiply_mask a c) x
[PROOF STEP]
by (simp add: multiply_mask_def pmult_distr)
[PROOF STATE]
proof (state)
this:
multiply_mask a (add_masks b c) x = add_masks (multiply_mask a b) (multiply_mask a c) x

goal:
No subgoals!
[PROOF STEP]
qed