[STATEMENT]
lemma nat_explode_mod_10_ident: \<open>map (\<lambda> x. x mod 10) (nat_explode' n) = nat_explode' n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
proof (cases \<open>n < 10\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n < 10 \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
 2. \<not> n < 10 \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n < 10

goal (2 subgoals):
 1. n < 10 \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
 2. \<not> n < 10 \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n < 10
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n < 10

goal (1 subgoal):
 1. map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n

goal (1 subgoal):
 1. \<not> n < 10 \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n < 10 \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> n < 10

goal (1 subgoal):
 1. \<not> n < 10 \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> n < 10
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> n < 10

goal (1 subgoal):
 1. map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
proof (induct \<open>n\<close> rule: nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m; \<not> n < 10\<rbrakk> \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:
\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m
\<not> n < 10

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m; \<not> n < 10\<rbrakk> \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m
\<not> n < 10

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m; \<not> n < 10\<rbrakk> \<Longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m
\<not> n < 10
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m
\<not> n < 10

goal (1 subgoal):
 1. map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
using div_ten_less
[PROOF STATE]
proof (prove)
using this:
\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m
\<not> n < 10
?n \<noteq> 0 \<Longrightarrow> ?n div 10 < ?n

goal (1 subgoal):
 1. map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n
[PROOF STEP]
apply(simp (no_asm))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m; \<not> n < 10; \<And>n. n \<noteq> 0 \<Longrightarrow> n div 10 < n\<rbrakk> \<Longrightarrow> map (\<lambda>x. x mod 10) (case n < 10 of True \<Rightarrow> [n mod 10] | False \<Rightarrow> n mod 10 # nat_explode' (n div 10)) = (case n < 10 of True \<Rightarrow> [n mod 10] | False \<Rightarrow> n mod 10 # nat_explode' (n div 10))
[PROOF STEP]
using unroll_nat_explode'[of n] *
[PROOF STATE]
proof (prove)
using this:
\<not> n < 10 \<Longrightarrow> (case n < 10 of True \<Rightarrow> [n mod 10] | False \<Rightarrow> n mod 10 # nat_explode' (n div 10)) = n mod 10 # nat_explode' (n div 10)
\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m
\<not> n < 10

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<n. \<not> m < 10 \<longrightarrow> map (\<lambda>x. x mod 10) (nat_explode' m) = nat_explode' m; \<not> n < 10; \<And>n. n \<noteq> 0 \<Longrightarrow> n div 10 < n\<rbrakk> \<Longrightarrow> map (\<lambda>x. x mod 10) (case n < 10 of True \<Rightarrow> [n mod 10] | False \<Rightarrow> n mod 10 # nat_explode' (n div 10)) = (case n < 10 of True \<Rightarrow> [n mod 10] | False \<Rightarrow> n mod 10 # nat_explode' (n div 10))
[PROOF STEP]
by (smt (z3) list.simps(8) list.simps(9) mod_div_trivial mod_eq_self_iff_div_eq_0
                 nat_explode'.simps zero_less_numeral)
[PROOF STATE]
proof (state)
this:
map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map (\<lambda>x. x mod 10) (nat_explode' n) = nat_explode' n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_sdiv_poly: "coeff (sdiv_poly f a) n = coeff f n div a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (sdiv_poly f a) n = coeff f n div a
[PROOF STEP]
unfolding sdiv_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (map_poly (\<lambda>c. c div a) f) n = coeff f n div a
[PROOF STEP]
by (rule coeff_map_poly, auto)


[STATEMENT]
lemma contour_integral_primitive_lemma:
  fixes f :: "complex \<Rightarrow> complex" and g :: "real \<Rightarrow> complex"
  assumes "a \<le> b"
      and "\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative f' x) (at x within s)"
      and "g piecewise_differentiable_on {a..b}"  "\<And>x. x \<in> {a..b} \<Longrightarrow> g x \<in> s"
    shows "((\<lambda>x. f'(g x) * vector_derivative g (at x within {a..b}))
             has_integral (f(g b) - f(g a))) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
obtain k where k: "finite k" "\<forall>x\<in>{a..b} - k. g differentiable (at x within {a..b})" and cg: "continuous_on {a..b} g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. \<lbrakk>finite k; \<forall>x\<in>{a..b} - k. g differentiable at x within {a..b}; continuous_on {a..b} g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> s \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within s)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> s

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>finite k; \<forall>x\<in>{a..b} - k. g differentiable at x within {a..b}; continuous_on {a..b} g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: piecewise_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
finite k
\<forall>x\<in>{a..b} - k. g differentiable at x within {a..b}
continuous_on {a..b} g

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
have cfg: "continuous_on {a..b} (\<lambda>x. f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. f (g x))
[PROOF STEP]
apply (rule continuous_on_compose [OF cg, unfolded o_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (g ` {a..b}) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> s \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within s)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> s

goal (1 subgoal):
 1. continuous_on (g ` {a..b}) f
[PROOF STEP]
apply (metis field_differentiable_def field_differentiable_imp_continuous_at continuous_on_eq_continuous_within continuous_on_subset image_subset_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. f (g x))

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. f (g x))

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
fix x::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
assume a: "a < x" and b: "x < b" and xk: "x \<notin> k"
[PROOF STATE]
proof (state)
this:
a < x
x < b
x \<notin> k

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < x
x < b
x \<notin> k
[PROOF STEP]
have "g differentiable at x within {a..b}"
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<notin> k

goal (1 subgoal):
 1. g differentiable at x within {a..b}
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<notin> k
finite k
\<forall>x\<in>{a..b} - k. g differentiable at x within {a..b}

goal (1 subgoal):
 1. g differentiable at x within {a..b}
[PROOF STEP]
by (simp add: differentiable_at_withinI)
[PROOF STATE]
proof (state)
this:
g differentiable at x within {a..b}

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g differentiable at x within {a..b}
[PROOF STEP]
have "(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})"
[PROOF STATE]
proof (prove)
using this:
g differentiable at x within {a..b}

goal (1 subgoal):
 1. (g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
by (simp add: vector_derivative_works has_field_derivative_def scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
have gdiff: "(g has_derivative (\<lambda>u. u * vector_derivative g (at x within {a..b}))) (at x within {a..b})"
[PROOF STATE]
proof (prove)
using this:
(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})

goal (1 subgoal):
 1. (g has_derivative (\<lambda>xa. complex_of_real xa * vector_derivative g (at x within {a..b}))) (at x within {a..b})
[PROOF STEP]
by (simp add: has_vector_derivative_def scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(g has_derivative (\<lambda>xa. complex_of_real xa * vector_derivative g (at x within {a..b}))) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
have "(f has_field_derivative (f' (g x))) (at (g x) within g ` {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> s \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within s)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> s

goal (1 subgoal):
 1. (f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})
[PROOF STEP]
by (metis a atLeastAtMost_iff b DERIV_subset image_subset_iff less_eq_real_def)
[PROOF STATE]
proof (state)
this:
(f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})
[PROOF STEP]
have fdiff: "(f has_derivative (*) (f' (g x))) (at (g x) within g ` {a..b})"
[PROOF STATE]
proof (prove)
using this:
(f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})

goal (1 subgoal):
 1. (f has_derivative (*) (f' (g x))) (at (g x) within g ` {a..b})
[PROOF STEP]
by (simp add: has_field_derivative_def)
[PROOF STATE]
proof (state)
this:
(f has_derivative (*) (f' (g x))) (at (g x) within g ` {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
have "((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
using diff_chain_within [OF gdiff fdiff]
[PROOF STATE]
proof (prove)
using this:
(f \<circ> g has_derivative (*) (f' (g x)) \<circ> (\<lambda>xa. complex_of_real xa * vector_derivative g (at x within {a..b}))) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
by (simp add: has_vector_derivative_def scaleR_conv_of_real o_def mult_ac)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x2; ?x2 < b; ?x2 \<notin> k\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_vector_derivative f' (g ?x2) * vector_derivative g (at ?x2 within {a..b})) (at ?x2 within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x2; ?x2 < b; ?x2 \<notin> k\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_vector_derivative f' (g ?x2) * vector_derivative g (at ?x2 within {a..b})) (at ?x2 within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
apply (rule fundamental_theorem_of_calculus_interior_strong)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. finite ?S
 2. a \<le> b
 3. \<And>x. x \<in> {a<..<b} - ?S \<Longrightarrow> ((\<lambda>a. f (g a)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x)
 4. continuous_on {a..b} (\<lambda>a. f (g a))
[PROOF STEP]
using k assms cfg *
[PROOF STATE]
proof (prove)
using this:
finite k
\<forall>x\<in>{a..b} - k. g differentiable at x within {a..b}
a \<le> b
?x \<in> s \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within s)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> s
continuous_on {a..b} (\<lambda>x. f (g x))
\<lbrakk>a < ?x2; ?x2 < b; ?x2 \<notin> k\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_vector_derivative f' (g ?x2) * vector_derivative g (at ?x2 within {a..b})) (at ?x2 within {a..b})

goal (4 subgoals):
 1. finite ?S
 2. a \<le> b
 3. \<And>x. x \<in> {a<..<b} - ?S \<Longrightarrow> ((\<lambda>a. f (g a)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x)
 4. continuous_on {a..b} (\<lambda>a. f (g a))
[PROOF STEP]
apply (auto simp: at_within_Icc_at)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordered_fmap_remove:
  assumes "is_fmap S" "x |\<in>| S"
  shows "ordered_fmap (S - {| x |}) = remove1 x (ordered_fmap S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_fmap (S |-| {|x|}) = remove1 x (ordered_fmap S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_fmap S
x |\<in>| S

goal (1 subgoal):
 1. ordered_fmap (S |-| {|x|}) = remove1 x (ordered_fmap S)
[PROOF STEP]
by transfer (rule ordered_map_remove)


[STATEMENT]
lemma p_altdef': "p k = x ^ k + y ^ k + z ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p k = x ^ k + y ^ k + z ^ k
[PROOF STEP]
unfolding p_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<3. [x, y, z] ! i ^ k) = x ^ k + y ^ k + z ^ k
[PROOF STEP]
by (simp add: eval_nat_numeral)


[STATEMENT]
lemma prob_neg_binomial_pmf_atMost:
  assumes p: "p \<in> {0<..1}"
  shows "measure_pmf.prob (neg_binomial_pmf n p) {..k} =
         measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
 2. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
case [simp]: True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
 2. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
have "set_pmf (binomial_pmf (n + k) (1 - p)) \<subseteq> {..n+k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_pmf (binomial_pmf (n + k) (1 - p)) \<subseteq> {..n + k}
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
p \<in> {0<..1}

goal (1 subgoal):
 1. set_pmf (binomial_pmf (n + k) (1 - p)) \<subseteq> {..n + k}
[PROOF STEP]
by (subst set_pmf_binomial_eq) auto
[PROOF STATE]
proof (state)
this:
set_pmf (binomial_pmf (n + k) (1 - p)) \<subseteq> {..n + k}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
 2. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
hence "measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = 1"
[PROOF STATE]
proof (prove)
using this:
set_pmf (binomial_pmf (n + k) (1 - p)) \<subseteq> {..n + k}

goal (1 subgoal):
 1. measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = 1
[PROOF STEP]
by (subst measure_pmf.prob_eq_1) (auto intro!: AE_pmfI)
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = 1

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
 2. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = 1

goal (1 subgoal):
 1. measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
hence n: "n > 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

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

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
have "measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = (\<Sum>i\<le>k. pmf (binomial_pmf (n + k) (1 - p)) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = sum (pmf (binomial_pmf (n + k) (1 - p))) {..k}
[PROOF STEP]
by (intro measure_measure_pmf_finite) auto
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = sum (pmf (binomial_pmf (n + k) (1 - p))) {..k}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = sum (pmf (binomial_pmf (n + k) (1 - p))) {..k}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. real ((n + k) choose i) * p ^ (n + k - i) * (1 - p) ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (pmf (binomial_pmf (n + k) (1 - p))) {..k} = (\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i)
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
p \<in> {0<..1}

goal (1 subgoal):
 1. sum (pmf (binomial_pmf (n + k) (1 - p))) {..k} = (\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i)
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
sum (pmf (binomial_pmf (n + k) (1 - p))) {..k} = (\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (pmf (binomial_pmf (n + k) (1 - p))) {..k} = (\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
have "\<dots> = p ^ n * (\<Sum>i\<le>k. real ((n + k) choose i) * (1 - p) ^ i * p ^ (k - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i) = p ^ n * (\<Sum>i\<le>k. real (n + k choose i) * (1 - p) ^ i * p ^ (k - i))
[PROOF STEP]
unfolding sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i) = (\<Sum>na\<le>k. p ^ n * (real (n + k choose na) * (1 - p) ^ na * p ^ (k - na)))
[PROOF STEP]
by (intro sum.cong) (auto simp: algebra_simps simp flip: power_add)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i) = p ^ n * (\<Sum>i\<le>k. real (n + k choose i) * (1 - p) ^ i * p ^ (k - i))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. real (n + k choose i) * p ^ (n + k - i) * (1 - p) ^ i) = p ^ n * (\<Sum>i\<le>k. real (n + k choose i) * (1 - p) ^ i * p ^ (k - i))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
have "(\<Sum>i\<le>k. real ((n + k) choose i) * (1 - p) ^ i * p ^ (k - i)) =
             (\<Sum>i\<le>k. ((n + i - 1) choose i) * (1 - p) ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. real (n + k choose i) * (1 - p) ^ i * p ^ (k - i)) = (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i)
[PROOF STEP]
using gbinomial_partial_sum_poly_xpos[of k "real n" "1 - p" p] n
[PROOF STATE]
proof (prove)
using this:
(\<Sum>ka\<le>k. (real k + real n gchoose ka) * (1 - p) ^ ka * p ^ (k - ka)) = (\<Sum>ka\<le>k. (real ka + real n - 1 gchoose ka) * (1 - p) ^ ka * (1 - p + p) ^ (k - ka))
0 < n

goal (1 subgoal):
 1. (\<Sum>i\<le>k. real (n + k choose i) * (1 - p) ^ i * p ^ (k - i)) = (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i)
[PROOF STEP]
by (simp add: binomial_gbinomial add_ac of_nat_diff)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. real (n + k choose i) * (1 - p) ^ i * p ^ (k - i)) = (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. real (n + k choose i) * (1 - p) ^ i * p ^ (k - i)) = (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
have "p ^ n * \<dots> = (\<Sum>i\<le>k. pmf (neg_binomial_pmf n p) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ n * (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i) = sum (pmf (neg_binomial_pmf n p)) {..k}
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
p \<in> {0<..1}

goal (1 subgoal):
 1. p ^ n * (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i) = sum (pmf (neg_binomial_pmf n p)) {..k}
[PROOF STEP]
unfolding sum_distrib_left
[PROOF STATE]
proof (prove)
using this:
p \<in> {0<..1}

goal (1 subgoal):
 1. (\<Sum>na\<le>k. p ^ n * (real (n + na - 1 choose na) * (1 - p) ^ na)) = sum (pmf (neg_binomial_pmf n p)) {..k}
[PROOF STEP]
by (simp add: pmf_neg_binomial algebra_simps)
[PROOF STATE]
proof (state)
this:
p ^ n * (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i) = sum (pmf (neg_binomial_pmf n p)) {..k}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p ^ n * (\<Sum>i\<le>k. real (n + i - 1 choose i) * (1 - p) ^ i) = sum (pmf (neg_binomial_pmf n p)) {..k}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
have "\<dots> = measure_pmf.prob (neg_binomial_pmf n p) {..k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (pmf (neg_binomial_pmf n p)) {..k} = measure_pmf.prob (neg_binomial_pmf n p) {..k}
[PROOF STEP]
by (intro measure_measure_pmf_finite [symmetric]) auto
[PROOF STATE]
proof (state)
this:
sum (pmf (neg_binomial_pmf n p)) {..k} = measure_pmf.prob (neg_binomial_pmf n p) {..k}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = measure_pmf.prob (neg_binomial_pmf n p) {..k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k} = measure_pmf.prob (neg_binomial_pmf n p) {..k}

goal (1 subgoal):
 1. measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (neg_binomial_pmf n p) {..k} = measure_pmf.prob (binomial_pmf (n + k) (1 - p)) {..k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma perp_up_down_foot_are_endpoints_in_S:
  assumes "a \<in> hyp2" and "b \<in> hyp2" and "proj2_incident b l"
  shows "are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a
[PROOF STEP]
from \<open>b \<in> hyp2\<close> and \<open>proj2_incident b l\<close> and \<open>a \<in> hyp2\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<in> hyp2
proj2_incident b l
a \<in> hyp2
[PROOF STEP]
have "perp_foot a l \<in> hyp2"
[PROOF STATE]
proof (prove)
using this:
b \<in> hyp2
proj2_incident b l
a \<in> hyp2

goal (1 subgoal):
 1. perp_foot a l \<in> hyp2
[PROOF STEP]
by (rule perp_foot_hyp2)
[PROOF STATE]
proof (state)
this:
perp_foot a l \<in> hyp2

goal (1 subgoal):
 1. are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l
[PROOF STEP]
have "perp_up a l \<in> S"
[PROOF STATE]
proof (prove)
using this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l

goal (1 subgoal):
 1. perp_up a l \<in> S
[PROOF STEP]
by (rule perp_up_in_S)
[PROOF STATE]
proof (state)
this:
perp_up a l \<in> S

goal (1 subgoal):
 1. are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l
[PROOF STEP]
have "proj2_incident (perp_up a l) (drop_perp a l)"
[PROOF STATE]
proof (prove)
using this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l

goal (1 subgoal):
 1. proj2_incident (perp_up a l) (drop_perp a l)
[PROOF STEP]
by (rule perp_up_incident)
[PROOF STATE]
proof (state)
this:
proj2_incident (perp_up a l) (drop_perp a l)

goal (1 subgoal):
 1. are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a
[PROOF STEP]
with \<open>perp_foot a l \<in> hyp2\<close> and \<open>a \<in> hyp2\<close> and \<open>perp_up a l \<in> S\<close>
    and perp_foot_incident(2) [of a l] and drop_perp_incident [of a l]
[PROOF STATE]
proof (chain)
picking this:
perp_foot a l \<in> hyp2
a \<in> hyp2
perp_up a l \<in> S
proj2_incident (perp_foot a l) (drop_perp a l)
proj2_incident a (drop_perp a l)
proj2_incident (perp_up a l) (drop_perp a l)
[PROOF STEP]
show "are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a"
[PROOF STATE]
proof (prove)
using this:
perp_foot a l \<in> hyp2
a \<in> hyp2
perp_up a l \<in> S
proj2_incident (perp_foot a l) (drop_perp a l)
proj2_incident a (drop_perp a l)
proj2_incident (perp_up a l) (drop_perp a l)

goal (1 subgoal):
 1. are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a
[PROOF STEP]
by (unfold perp_down_def) (rule end_and_opposite_are_endpoints_in_S)
[PROOF STATE]
proof (state)
this:
are_endpoints_in_S (perp_up a l) (perp_down a l) (perp_foot a l) a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_Times: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open S; open T\<rbrakk> \<Longrightarrow> open (S \<times> T)
[PROOF STEP]
unfolding open_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open S; open T\<rbrakk> \<Longrightarrow> \<forall>x\<in>S \<times> T. \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S \<times> T
[PROOF STEP]
by auto


[STATEMENT]
lemma simple_path_sym:
    "\<lbrakk>pathfinish p = pathstart q; pathfinish q = pathstart p\<rbrakk>
     \<Longrightarrow> simple_path(p +++ q) \<longleftrightarrow> simple_path(q +++ p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pathfinish p = pathstart q; pathfinish q = pathstart p\<rbrakk> \<Longrightarrow> simple_path (p +++ q) = simple_path (q +++ p)
[PROOF STEP]
by (metis (full_types) inf_commute insert_commute simple_path_joinE simple_path_join_loop)


[STATEMENT]
lemma ang_vec_sym:
  assumes "\<angle> z1 z2 \<noteq> pi"
  shows "\<angle> z1 z2 = - \<angle> z2 z1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<angle> z1 z2 = - \<angle> z2 z1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<angle> z1 z2 \<noteq> pi

goal (1 subgoal):
 1. \<angle> z1 z2 = - \<angle> z2 z1
[PROOF STEP]
unfolding ang_vec_def
[PROOF STATE]
proof (prove)
using this:
\<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> \<noteq> pi

goal (1 subgoal):
 1. \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> = - \<downharpoonright>Arg z1 - Arg z2\<downharpoonleft>
[PROOF STEP]
using canon_ang_uminus[of "Arg z2 - Arg z1"]
[PROOF STATE]
proof (prove)
using this:
\<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> \<noteq> pi
\<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> \<noteq> pi \<Longrightarrow> \<downharpoonright>- (Arg z2 - Arg z1)\<downharpoonleft> = - \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft>

goal (1 subgoal):
 1. \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> = - \<downharpoonright>Arg z1 - Arg z2\<downharpoonleft>
[PROOF STEP]
by simp


[STATEMENT]
lemma Sup_comp: "(Sup X) * z = (SUP x \<in> X . (x * z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> X * z = (\<Squnion>x\<in>X. x * z)
[PROOF STEP]
apply (rule dual_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion> X * z) ^ o = (\<Squnion>x\<in>X. x * z) ^ o
[PROOF STEP]
by (simp add: dual_comp dual_Sup dual_SUP INF_comp image_comp)


[STATEMENT]
lemma antisym_less_nmultiset:
  fixes X Y :: "'a nmultiset"
  shows "X < Y \<Longrightarrow> Y < X \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X < Y; Y < X\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using trans_less_nmultiset irrefl_less_nmultiset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?X < ?Y; ?Y < ?Z\<rbrakk> \<Longrightarrow> ?X < ?Z
?X < ?X \<Longrightarrow> False

goal (1 subgoal):
 1. \<lbrakk>X < Y; Y < X\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast


[STATEMENT]
theorem (in cring) ideal_prod_eq_Inter:
  assumes "I: {..n :: nat} \<rightarrow> { J. ideal J R }"
    and "\<And>i j. \<lbrakk> i \<in> {..n}; j \<in> {..n} \<rbrakk> \<Longrightarrow> i \<noteq> j \<Longrightarrow> (I i) <+> (I j) = carrier R"
  shows "(\<Otimes>\<^bsub>(ideals_set R)\<^esub> k \<in> {..n}. I k) = (\<Inter> k \<in> {..n}. I k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I \<in> {..n} \<rightarrow> {J. ideal J R}
\<lbrakk>?i \<in> {..n}; ?j \<in> {..n}; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i <+> I ?j = carrier R

goal (1 subgoal):
 1. finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>I \<in> {..0} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..0}; j \<in> {..0}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..0} = \<Inter> (I ` {..0})
 2. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
I \<in> {..0} \<rightarrow> {J. ideal J R}
\<lbrakk>?i \<in> {..0}; ?j \<in> {..0}; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i <+> I ?j = carrier R

goal (2 subgoals):
 1. \<lbrakk>I \<in> {..0} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..0}; j \<in> {..0}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..0} = \<Inter> (I ` {..0})
 2. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
I \<in> {..0} \<rightarrow> {J. ideal J R}
\<lbrakk>?i \<in> {..0}; ?j \<in> {..0}; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i <+> I ?j = carrier R

goal (1 subgoal):
 1. finprod (ideals_set R) I {..0} = \<Inter> (I ` {..0})
[PROOF STEP]
using comm_monoid.finprod_0[OF ideals_set_is_comm_monoid]
[PROOF STATE]
proof (prove)
using this:
I \<in> {..0} \<rightarrow> {J. ideal J R}
\<lbrakk>?i \<in> {..0}; ?j \<in> {..0}; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i <+> I ?j = carrier R
?f \<in> {0} \<rightarrow> carrier (ideals_set R) \<Longrightarrow> finprod (ideals_set R) ?f {..0} = ?f 0

goal (1 subgoal):
 1. finprod (ideals_set R) I {..0} = \<Inter> (I ` {..0})
[PROOF STEP]
by (simp add: ideals_set_def)
[PROOF STATE]
proof (state)
this:
finprod (ideals_set R) I {..0} = \<Inter> (I ` {..0})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
interpret ISet: comm_monoid "ideals_set R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid (ideals_set R)
[PROOF STEP]
by (simp add: ideals_set_is_comm_monoid)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})
I \<in> {..Suc n} \<rightarrow> {J. ideal J R}
\<lbrakk>?i \<in> {..Suc n}; ?j \<in> {..Suc n}; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i <+> I ?j = carrier R

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
hence IH: "(\<Otimes>\<^bsub>(ideals_set R)\<^esub> k \<in> {..n}. I k) = (\<Inter> k \<in> {..n}. I k)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})
I \<in> {..Suc n} \<rightarrow> {J. ideal J R}
\<lbrakk>?i \<in> {..Suc n}; ?j \<in> {..Suc n}; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i <+> I ?j = carrier R

goal (1 subgoal):
 1. finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})
[PROOF STEP]
by (simp add: atMost_Suc)
[PROOF STATE]
proof (state)
this:
finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
hence "(\<Otimes>\<^bsub>(ideals_set R)\<^esub> k \<in> {..Suc n}. I k) = I (Suc n) \<otimes>\<^bsub>(ideals_set R)\<^esub> (\<Inter> k \<in> {..n}. I k)"
[PROOF STATE]
proof (prove)
using this:
finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})

goal (1 subgoal):
 1. finprod (ideals_set R) I {..Suc n} = I (Suc n) \<otimes>\<^bsub>ideals_set R\<^esub> \<Inter> (I ` {..n})
[PROOF STEP]
using ISet.finprod_insert[of "{Suc 0..Suc n}" 0 I] atMost_Suc_eq_insert_0[of n]
[PROOF STATE]
proof (prove)
using this:
finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n})
\<lbrakk>finite {Suc 0..Suc n}; 0 \<notin> {Suc 0..Suc n}; I \<in> {Suc 0..Suc n} \<rightarrow> carrier (ideals_set R); I 0 \<in> carrier (ideals_set R)\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I (insert 0 {Suc 0..Suc n}) = I 0 \<otimes>\<^bsub>ideals_set R\<^esub> finprod (ideals_set R) I {Suc 0..Suc n}
{..Suc n} = insert 0 (Suc ` {..n})

goal (1 subgoal):
 1. finprod (ideals_set R) I {..Suc n} = I (Suc n) \<otimes>\<^bsub>ideals_set R\<^esub> \<Inter> (I ` {..n})
[PROOF STEP]
by (metis ISet.finprod_Suc Suc.prems(1) ideals_set_def partial_object.select_convs(1))
[PROOF STATE]
proof (state)
this:
finprod (ideals_set R) I {..Suc n} = I (Suc n) \<otimes>\<^bsub>ideals_set R\<^esub> \<Inter> (I ` {..n})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
hence "(\<Otimes>\<^bsub>(ideals_set R)\<^esub> k \<in> {..Suc n}. I k) = I (Suc n) \<cdot> (\<Inter> k \<in> {..n}. I k)"
[PROOF STATE]
proof (prove)
using this:
finprod (ideals_set R) I {..Suc n} = I (Suc n) \<otimes>\<^bsub>ideals_set R\<^esub> \<Inter> (I ` {..n})

goal (1 subgoal):
 1. finprod (ideals_set R) I {..Suc n} = I (Suc n) \<cdot> \<Inter> (I ` {..n})
[PROOF STEP]
by (simp add: ideals_set_def)
[PROOF STATE]
proof (state)
this:
finprod (ideals_set R) I {..Suc n} = I (Suc n) \<cdot> \<Inter> (I ` {..n})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finprod (ideals_set R) I {..Suc n} = I (Suc n) \<cdot> \<Inter> (I ` {..n})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
have "(\<Inter> k \<in> {..n}. I k) <+> I (Suc n) = carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (I ` {..n}) <+> I (Suc n) = carrier R
[PROOF STEP]
using ideal_prod_eq_Inter_aux[of I n]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<le> Suc n; j \<le> Suc n; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} <+> I (Suc n) = carrier R

goal (1 subgoal):
 1. \<Inter> (I ` {..n}) <+> I (Suc n) = carrier R
[PROOF STEP]
by (simp add: Suc.prems IH)
[PROOF STATE]
proof (state)
this:
\<Inter> (I ` {..n}) <+> I (Suc n) = carrier R

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Inter> (I ` {..n}) <+> I (Suc n) = carrier R

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
have "ideal (\<Inter> k \<in> {..n}. I k) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal (\<Inter> (I ` {..n})) R
[PROOF STEP]
using ring.i_Intersect[of R "I ` {..n}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ring R; \<And>Ia. Ia \<in> I ` {..n} \<Longrightarrow> ideal Ia R; I ` {..n} \<noteq> {}\<rbrakk> \<Longrightarrow> ideal (\<Inter> (I ` {..n})) R

goal (1 subgoal):
 1. ideal (\<Inter> (I ` {..n})) R
[PROOF STEP]
by (metis IH ISet.finprod_closed Pi_split_insert_domain Suc.prems(1) atMost_Suc
              ideals_set_def mem_Collect_eq partial_object.select_convs(1))
[PROOF STATE]
proof (state)
this:
ideal (\<Inter> (I ` {..n})) R

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finprod (ideals_set R) I {..Suc n} = I (Suc n) \<cdot> \<Inter> (I ` {..n})
\<Inter> (I ` {..n}) <+> I (Suc n) = carrier R
ideal (\<Inter> (I ` {..n})) R
[PROOF STEP]
have "(\<Otimes>\<^bsub>(ideals_set R)\<^esub> k \<in> {..Suc n}. I k) = (\<Inter> k \<in> {..n}. I k) \<inter> I (Suc n)"
[PROOF STATE]
proof (prove)
using this:
finprod (ideals_set R) I {..Suc n} = I (Suc n) \<cdot> \<Inter> (I ` {..n})
\<Inter> (I ` {..n}) <+> I (Suc n) = carrier R
ideal (\<Inter> (I ` {..n})) R

goal (1 subgoal):
 1. finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..n}) \<inter> I (Suc n)
[PROOF STEP]
using ideal_prod_eq_inter[of "\<Inter> k \<in> {..n}. I k" "I (Suc n)"]
          ideal_prod_commute[of "\<Inter> k \<in> {..n}. I k" "I (Suc n)"]
[PROOF STATE]
proof (prove)
using this:
finprod (ideals_set R) I {..Suc n} = I (Suc n) \<cdot> \<Inter> (I ` {..n})
\<Inter> (I ` {..n}) <+> I (Suc n) = carrier R
ideal (\<Inter> (I ` {..n})) R
\<lbrakk>ideal (\<Inter> (I ` {..n})) R; ideal (I (Suc n)) R; \<Inter> (I ` {..n}) <+> I (Suc n) = carrier R\<rbrakk> \<Longrightarrow> \<Inter> (I ` {..n}) \<cdot> I (Suc n) = \<Inter> (I ` {..n}) \<inter> I (Suc n)
\<lbrakk>ideal (\<Inter> (I ` {..n})) R; ideal (I (Suc n)) R\<rbrakk> \<Longrightarrow> \<Inter> (I ` {..n}) \<cdot> I (Suc n) = I (Suc n) \<cdot> \<Inter> (I ` {..n})

goal (1 subgoal):
 1. finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..n}) \<inter> I (Suc n)
[PROOF STEP]
by (metis PiE Suc.prems(1) atMost_iff mem_Collect_eq order_refl)
[PROOF STATE]
proof (state)
this:
finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..n}) \<inter> I (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>I \<in> {..n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..n}; j \<in> {..n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..n} = \<Inter> (I ` {..n}); I \<in> {..Suc n} \<rightarrow> {J. ideal J R}; \<And>i j. \<lbrakk>i \<in> {..Suc n}; j \<in> {..Suc n}; i \<noteq> j\<rbrakk> \<Longrightarrow> I i <+> I j = carrier R\<rbrakk> \<Longrightarrow> finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..n}) \<inter> I (Suc n)

goal (1 subgoal):
 1. finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})
[PROOF STEP]
by (simp add: Int_commute atMost_Suc)
[PROOF STATE]
proof (state)
this:
finprod (ideals_set R) I {..Suc n} = \<Inter> (I ` {..Suc n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Collect_eq_singleton_conv:
  "{a. P a} = {a} \<longleftrightarrow> P a \<and> (\<forall>a'. P a' \<longrightarrow> a = a')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({a. P a} = {a}) = (P a \<and> (\<forall>a'. P a' \<longrightarrow> a = a'))
[PROOF STEP]
by(auto)


[STATEMENT]
lemma quasiconvexD:
  assumes "quasiconvex C X" "x \<in> X" "y \<in> X"
  shows "\<exists>G. geodesic_segment_between G x y \<and> (\<forall>z\<in>G. infdist z X \<le> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>G. geodesic_segment_between G x y \<and> (\<forall>z\<in>G. infdist z X \<le> C)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
quasiconvex C X
x \<in> X
y \<in> X

goal (1 subgoal):
 1. \<exists>G. geodesic_segment_between G x y \<and> (\<forall>z\<in>G. infdist z X \<le> C)
[PROOF STEP]
unfolding quasiconvex_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> C \<and> (\<forall>x\<in>X. \<forall>y\<in>X. \<exists>G. geodesic_segment_between G x y \<and> (\<forall>z\<in>G. infdist z X \<le> C))
x \<in> X
y \<in> X

goal (1 subgoal):
 1. \<exists>G. geodesic_segment_between G x y \<and> (\<forall>z\<in>G. infdist z X \<le> C)
[PROOF STEP]
by auto


[STATEMENT]
lemma infnorm_eq_1_imp:
  fixes x :: "real^2"
  assumes "infnorm x = 1"
  shows "\<bar>x$1\<bar> \<le> 1" and "\<bar>x$2\<bar> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x $ 1\<bar> \<le> 1 &&& \<bar>x $ 2\<bar> \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
infnorm x = 1

goal (1 subgoal):
 1. \<bar>x $ 1\<bar> \<le> 1 &&& \<bar>x $ 2\<bar> \<le> 1
[PROOF STEP]
unfolding infnorm_eq_1_2
[PROOF STATE]
proof (prove)
using this:
\<bar>x $ 1\<bar> \<le> 1 \<and> \<bar>x $ 2\<bar> \<le> 1 \<and> (x $ 1 = - 1 \<or> x $ 1 = 1 \<or> x $ 2 = - 1 \<or> x $ 2 = 1)

goal (1 subgoal):
 1. \<bar>x $ 1\<bar> \<le> 1 &&& \<bar>x $ 2\<bar> \<le> 1
[PROOF STEP]
by auto


[STATEMENT]
lemma fundchamber_S_chamber: "s\<in>S \<Longrightarrow> chamber (s`\<rightarrow>C0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> (\<Union>(f, g)\<in>fundfoldpairs. {Abs_induced_automorph f g}) \<Longrightarrow> chamber (s `\<rightarrow> C0)
[PROOF STEP]
using fundfoldpairs_def
[PROOF STATE]
proof (prove)
using this:
fundfoldpairs \<equiv> {(f, g). OpposedThinChamberComplexFoldings X f g C0}

goal (1 subgoal):
 1. s \<in> (\<Union>(f, g)\<in>fundfoldpairs. {Abs_induced_automorph f g}) \<Longrightarrow> chamber (s `\<rightarrow> C0)
[PROOF STEP]
by    (fastforce simp add:
          fundfoldpairs_fundchamber_image
          OpposedThinChamberComplexFoldings.chamber_D0
        )