[STATEMENT]
lemma tan_cot': "tan (pi/2 - x) = cot x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (pi / 2 - x) = cot x
[PROOF STEP]
by (simp add: tan_cot cot_altdef)


[STATEMENT]
lemma disj_evens_odds: "(*) 2 ` A \<inter> Suc ` (*) 2 ` B = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*) 2 ` A \<inter> Suc ` (*) 2 ` B = {}
[PROOF STEP]
using double_not_eq_Suc_double
[PROOF STATE]
proof (prove)
using this:
2 * ?m \<noteq> Suc (2 * ?n)

goal (1 subgoal):
 1. (*) 2 ` A \<inter> Suc ` (*) 2 ` B = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma angle_nonneg: "angle a b c \<ge> 0" and angle_le_pi: "angle a b c \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> angle a b c &&& angle a b c \<le> pi
[PROOF STEP]
using vangle_bounds
[PROOF STATE]
proof (prove)
using this:
0 \<le> vangle ?u ?v
vangle ?u ?v \<le> pi

goal (1 subgoal):
 1. 0 \<le> angle a b c &&& angle a b c \<le> pi
[PROOF STEP]
unfolding angle_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> vangle ?u ?v
vangle ?u ?v \<le> pi

goal (1 subgoal):
 1. 0 \<le> vangle (a - b) (c - b) &&& vangle (a - b) (c - b) \<le> pi
[PROOF STEP]
by blast+


[STATEMENT]
lemma card_of_Times_ordLeq_infinite:
"\<lbrakk>\<not>finite C; |A| \<le>o |C|; |B| \<le>o |C|\<rbrakk>
 \<Longrightarrow> |A \<times> B| \<le>o |C|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite C; |A| \<le>o |C|; |B| \<le>o |C|\<rbrakk> \<Longrightarrow> |A \<times> B| \<le>o |C|
[PROOF STEP]
by(simp add: card_of_Sigma_ordLeq_infinite)


[STATEMENT]
lemma (in padic_integers) residue_UnitsI:
  assumes "n \<ge> 1"
  assumes "(k::int) > 0"
  assumes "k < p^n"
  assumes "coprime k p"
  shows "k \<in> Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
using residues.res_units_eq assms
[PROOF STATE]
proof (prove)
using this:
residues ?m \<Longrightarrow> Units (residue_ring ?m) = {x. 0 < x \<and> x < ?m \<and> coprime x ?m}
1 \<le> n
0 < k
k < p ^ n
coprime k p

goal (1 subgoal):
 1. k \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
by (metis (mono_tags, lifting) coprime_power_right_iff mem_Collect_eq not_one_le_zero prime residues_n)


[STATEMENT]
lemma (in group) coset_mult_inv2:
  assumes "M #> x = M #> y"
    and "x \<in> carrier G"  "y \<in> carrier G" "M \<subseteq> carrier G"
  shows "M #> (x \<otimes> (inv y)) = M "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M #> x \<otimes> inv y = M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
M #> x = M #> y
x \<in> carrier G
y \<in> carrier G
M \<subseteq> carrier G

goal (1 subgoal):
 1. M #> x \<otimes> inv y = M
[PROOF STEP]
by (metis group.coset_mult_assoc group.coset_mult_one inv_closed is_group r_inv)


[STATEMENT]
lemma integrable_mult_left_iff [simp]:
  fixes f :: "'a \<Rightarrow> real"
  shows "integrable M (\<lambda>x. c * f x) \<longleftrightarrow> c = 0 \<or> integrable M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. c * f x) = (c = 0 \<or> integrable M f)
[PROOF STEP]
using integrable_mult_left[of c M f] integrable_mult_left[of "1 / c" M "\<lambda>x. c * f x"]
[PROOF STATE]
proof (prove)
using this:
(c \<noteq> 0 \<Longrightarrow> integrable M f) \<Longrightarrow> integrable M (\<lambda>x. f x * c)
(1 / c \<noteq> 0 \<Longrightarrow> integrable M (\<lambda>x. c * f x)) \<Longrightarrow> integrable M (\<lambda>x. c * f x * (1 / c))

goal (1 subgoal):
 1. integrable M (\<lambda>x. c * f x) = (c = 0 \<or> integrable M f)
[PROOF STEP]
by (cases "c = 0") auto


[STATEMENT]
lemma fps_XD'_power_Suc: "fps_XD' a (b ^ Suc n :: 'a :: idom fps) = of_nat (Suc n) * b ^ n * fps_XD' a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_XD' a (b ^ Suc n) = of_nat (Suc n) * b ^ n * fps_XD' a b
[PROOF STEP]
by (subst fps_XD'_power) simp_all


[STATEMENT]
lemma ereal_mult_mono:
  fixes a b c d::ereal
  assumes "b \<ge> 0" "c \<ge> 0" "a \<le> b" "c \<le> d"
  shows "a * c \<le> b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c \<le> b * d
[PROOF STEP]
by (metis ereal_mult_right_mono mult.commute order_trans assms)


[STATEMENT]
lemma set_mset_single_iff_replicate_mset: "set_mset U = {a} \<longleftrightarrow> (\<exists>n > 0. U = replicate_mset n a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set_mset U = {a}) = (\<exists>n>0. U = replicate_mset n a)
[PROOF STEP]
by (rule, metis count_greater_zero_iff count_replicate_mset insertI1 multi_count_eq singletonD
    zero_less_iff_neq_zero, force)


[STATEMENT]
lemma transpose_matrix_inject: "(transpose_matrix A = transpose_matrix B) = (A = B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (transpose_matrix A = transpose_matrix B) = (A = B)
[PROOF STEP]
apply (simp add: transpose_matrix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs_matrix (transpose_infmatrix (Rep_matrix A)) = Abs_matrix (transpose_infmatrix (Rep_matrix B))) = (A = B)
[PROOF STEP]
apply (subst Rep_matrix_inject[THEN sym])+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Rep_matrix (Abs_matrix (transpose_infmatrix (Rep_matrix A))) = Rep_matrix (Abs_matrix (transpose_infmatrix (Rep_matrix B)))) = (Rep_matrix A = Rep_matrix B)
[PROOF STEP]
apply (simp only: transpose_infmatrix_closed transpose_infmatrix_inject)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poly_linepath_comp:
  fixes a::"'a::{real_normed_vector,comm_semiring_0,real_algebra_1}"
  shows "poly p o (linepath a b) = poly (p \<circ>\<^sub>p [:a, b-a:]) o of_real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p \<circ> linepath a b = poly (p \<circ>\<^sub>p [:a, b - a:]) \<circ> of_real
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (poly p \<circ> linepath a b) x = (poly (p \<circ>\<^sub>p [:a, b - a:]) \<circ> of_real) x
[PROOF STEP]
by (auto simp add:poly_pcompose linepath_def scaleR_conv_of_real algebra_simps)


[STATEMENT]
lemma weight_mk_lossless: "weight_spmf (mk_lossless p) = (if p = return_pmf None then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight_spmf (mk_lossless p) = (if p = return_pmf None then 0 else 1)
[PROOF STEP]
by(simp add: mk_lossless_def weight_scale_spmf min_def max_def inverse_eq_divide weight_spmf_eq_0)


[STATEMENT]
lemma prio_match_matcher_alt: "{f. f \<in> set flow_entries \<and> \<gamma> (ofe_fields f) packet \<and>
  	  (\<forall>fo \<in> set flow_entries. ofe_prio fo > ofe_prio f \<longrightarrow> \<not>\<gamma> (ofe_fields fo) packet)}
  	  = (
  	  let matching = {f. f \<in> set flow_entries \<and> \<gamma> (ofe_fields f) packet}
  	  in {f. f \<in> matching \<and> (\<forall>fo \<in> matching. ofe_prio fo \<le> ofe_prio f)}
  	  )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> set flow_entries. \<gamma> (ofe_fields f) packet \<and> (\<forall>fo\<in>set flow_entries. ofe_prio f < ofe_prio fo \<longrightarrow> \<not> \<gamma> (ofe_fields fo) packet)} = (let matching = {f \<in> set flow_entries. \<gamma> (ofe_fields f) packet} in {f \<in> matching. \<forall>fo\<in>matching. ofe_prio fo \<le> ofe_prio f})
[PROOF STEP]
by(auto simp add: Let_def)


[STATEMENT]
lemma some_gcd_dvd_gcd: "some_gcd a b dvd gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. some_gcd a b dvd gcd a b
[PROOF STEP]
using is_gcd_some_gcd
[PROOF STATE]
proof (prove)
using this:
is_gcd (some_gcd ?a ?b) ?a ?b

goal (1 subgoal):
 1. some_gcd a b dvd gcd a b
[PROOF STEP]
by (auto intro: gcd_greatest)


[STATEMENT]
lemma convergent_powrat_interlaced_seq:
   "\<lbrakk> 1 \<le> a; (\<lambda>n. of_rat (r n)) \<longlonglongrightarrow> (x::real);
      (\<lambda>n. of_rat (s n)) \<longlonglongrightarrow> (x::real);
      \<forall>n. of_rat (r n) < x; \<forall>n. of_rat (s n) < x \<rbrakk>
    \<Longrightarrow> convergent (\<lambda>n. a pow\<^sub>\<rat> (interlaced_seq r s n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> a; (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x; (\<lambda>n. real_of_rat (s n)) \<longlonglongrightarrow> x; \<forall>n. real_of_rat (r n) < x; \<forall>n. real_of_rat (s n) < x\<rbrakk> \<Longrightarrow> convergent (\<lambda>n. a pow\<^sub>\<rat> interlaced_seq r s n)
[PROOF STEP]
by (auto intro: Bseq_monoseq_convergent incseq_interlaced_seq
            interlaced_seq_bounded less_imp_le incseq_imp_monoseq
            incseq_incseq_powrat Bseq_powrat_incseq [of _ _ x])


[STATEMENT]
lemma (in finite_measure) finite_measure_finite_Union:
  assumes measurable: "finite S" "A`S \<subseteq> sets M" "disjoint_family_on A S"
  shows "measure M (\<Union>i\<in>S. A i) = (\<Sum>i\<in>S. measure M (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (\<Union> (A ` S)) = (\<Sum>i\<in>S. Sigma_Algebra.measure M (A i))
[PROOF STEP]
using measure_finite_Union[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> S \<Longrightarrow> emeasure M (A i) \<noteq> \<infinity>) \<Longrightarrow> Sigma_Algebra.measure M (\<Union> (A ` S)) = (\<Sum>i\<in>S. Sigma_Algebra.measure M (A i))

goal (1 subgoal):
 1. Sigma_Algebra.measure M (\<Union> (A ` S)) = (\<Sum>i\<in>S. Sigma_Algebra.measure M (A i))
[PROOF STEP]
by simp


[STATEMENT]
lemma reconstruct_poly_defines_mset_of_argument:
  assumes "(a::'a::field) \<noteq> 0"
          "reconstruct_poly a as = reconstruct_poly a bs"
  shows "mset as = mset bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset as = mset bs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mset as = mset bs
[PROOF STEP]
have eq_smult:"smult a (\<Prod>a\<leftarrow>as. [:- a, 1:]) = smult a (\<Prod>a\<leftarrow>bs. [:- a, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult a (\<Prod>a\<leftarrow>as. [:- a, 1::'a:]) = Polynomial.smult a (\<Prod>a\<leftarrow>bs. [:- a, 1::'a:])
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
reconstruct_poly a as = reconstruct_poly a bs

goal (1 subgoal):
 1. Polynomial.smult a (\<Prod>a\<leftarrow>as. [:- a, 1::'a:]) = Polynomial.smult a (\<Prod>a\<leftarrow>bs. [:- a, 1::'a:])
[PROOF STEP]
by (auto simp:reconstruct_poly_def)
[PROOF STATE]
proof (state)
this:
Polynomial.smult a (\<Prod>a\<leftarrow>as. [:- a, 1::'a:]) = Polynomial.smult a (\<Prod>a\<leftarrow>bs. [:- a, 1::'a:])

goal (1 subgoal):
 1. mset as = mset bs
[PROOF STEP]
from reconstruct_poly_monic_defines_mset[OF Fun.injD[OF smult_inj[OF assms(1)] eq_smult]]
[PROOF STATE]
proof (chain)
picking this:
mset as = mset bs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mset as = mset bs

goal (1 subgoal):
 1. mset as = mset bs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset as = mset bs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wordinterval_card: "wordinterval_card r \<ge> card (wordinterval_to_set r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (wordinterval_to_set r) \<le> wordinterval_card r
[PROOF STEP]
proof(induction r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1 x2. card (wordinterval_to_set (WordInterval x1 x2)) \<le> wordinterval_card (WordInterval x1 x2)
 2. \<And>r1 r2. \<lbrakk>card (wordinterval_to_set r1) \<le> wordinterval_card r1; card (wordinterval_to_set r2) \<le> wordinterval_card r2\<rbrakk> \<Longrightarrow> card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)
[PROOF STEP]
case WordInterval
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>x1 x2. card (wordinterval_to_set (WordInterval x1 x2)) \<le> wordinterval_card (WordInterval x1 x2)
 2. \<And>r1 r2. \<lbrakk>card (wordinterval_to_set r1) \<le> wordinterval_card r1; card (wordinterval_to_set r2) \<le> wordinterval_card r2\<rbrakk> \<Longrightarrow> card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (wordinterval_to_set (WordInterval x1_ x2_)) \<le> wordinterval_card (WordInterval x1_ x2_)
[PROOF STEP]
by (simp add: card_atLeastAtMost_word)
[PROOF STATE]
proof (state)
this:
card (wordinterval_to_set (WordInterval x1_ x2_)) \<le> wordinterval_card (WordInterval x1_ x2_)

goal (1 subgoal):
 1. \<And>r1 r2. \<lbrakk>card (wordinterval_to_set r1) \<le> wordinterval_card r1; card (wordinterval_to_set r2) \<le> wordinterval_card r2\<rbrakk> \<Longrightarrow> card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r1 r2. \<lbrakk>card (wordinterval_to_set r1) \<le> wordinterval_card r1; card (wordinterval_to_set r2) \<le> wordinterval_card r2\<rbrakk> \<Longrightarrow> card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)
[PROOF STEP]
case (RangeUnion r1 r2)
[PROOF STATE]
proof (state)
this:
card (wordinterval_to_set r1) \<le> wordinterval_card r1
card (wordinterval_to_set r2) \<le> wordinterval_card r2

goal (1 subgoal):
 1. \<And>r1 r2. \<lbrakk>card (wordinterval_to_set r1) \<le> wordinterval_card r1; card (wordinterval_to_set r2) \<le> wordinterval_card r2\<rbrakk> \<Longrightarrow> card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)
[PROOF STEP]
have "card (wordinterval_to_set r1 \<union> wordinterval_to_set r2) \<le>
              card (wordinterval_to_set r1) + card (wordinterval_to_set r2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (wordinterval_to_set r1 \<union> wordinterval_to_set r2) \<le> card (wordinterval_to_set r1) + card (wordinterval_to_set r2)
[PROOF STEP]
using Finite_Set.card_Un_le
[PROOF STATE]
proof (prove)
using this:
card (?A \<union> ?B) \<le> card ?A + card ?B

goal (1 subgoal):
 1. card (wordinterval_to_set r1 \<union> wordinterval_to_set r2) \<le> card (wordinterval_to_set r1) + card (wordinterval_to_set r2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card (wordinterval_to_set r1 \<union> wordinterval_to_set r2) \<le> card (wordinterval_to_set r1) + card (wordinterval_to_set r2)

goal (1 subgoal):
 1. \<And>r1 r2. \<lbrakk>card (wordinterval_to_set r1) \<le> wordinterval_card r1; card (wordinterval_to_set r2) \<le> wordinterval_card r2\<rbrakk> \<Longrightarrow> card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)
[PROOF STEP]
with RangeUnion
[PROOF STATE]
proof (chain)
picking this:
card (wordinterval_to_set r1) \<le> wordinterval_card r1
card (wordinterval_to_set r2) \<le> wordinterval_card r2
card (wordinterval_to_set r1 \<union> wordinterval_to_set r2) \<le> card (wordinterval_to_set r1) + card (wordinterval_to_set r2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (wordinterval_to_set r1) \<le> wordinterval_card r1
card (wordinterval_to_set r2) \<le> wordinterval_card r2
card (wordinterval_to_set r1 \<union> wordinterval_to_set r2) \<le> card (wordinterval_to_set r1) + card (wordinterval_to_set r2)

goal (1 subgoal):
 1. card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
card (wordinterval_to_set (RangeUnion r1 r2)) \<le> wordinterval_card (RangeUnion r1 r2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isometry_extend_closure:
  fixes f::"('a::metric_space) \<Rightarrow> ('b::complete_space)"
  assumes "isometry_on X f"
  shows "\<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)
[PROOF STEP]
obtain g where g: "\<And>x. x \<in> X \<Longrightarrow> g x = f x" "uniformly_continuous_on (closure X) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>\<And>x. x \<in> X \<Longrightarrow> g x = f x; uniformly_continuous_on (closure X) g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using uniformly_continuous_on_extension_on_closure[OF isometry_on_uniformly_continuous[OF assms]]
[PROOF STATE]
proof (prove)
using this:
(\<And>g. \<lbrakk>uniformly_continuous_on (closure X) g; \<And>x. x \<in> X \<Longrightarrow> f x = g x; \<And>Y h x. \<lbrakk>X \<subseteq> Y; Y \<subseteq> closure X; continuous_on Y h; \<And>x. x \<in> X \<Longrightarrow> f x = h x; x \<in> Y\<rbrakk> \<Longrightarrow> h x = g x\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>\<And>x. x \<in> X \<Longrightarrow> g x = f x; uniformly_continuous_on (closure X) g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?x \<in> X \<Longrightarrow> g ?x = f ?x
uniformly_continuous_on (closure X) g

goal (1 subgoal):
 1. \<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)
[PROOF STEP]
have "isometry_on (closure X) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry_on (closure X) g
[PROOF STEP]
apply (rule isometry_on_closure, rule isometry_on_cong[OF assms])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> X \<Longrightarrow> g x = f x
 2. continuous_on (closure X) g
[PROOF STEP]
using g uniformly_continuous_imp_continuous[OF g(2)]
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<Longrightarrow> g ?x = f ?x
uniformly_continuous_on (closure X) g
continuous_on (closure X) g

goal (2 subgoals):
 1. \<And>x. x \<in> X \<Longrightarrow> g x = f x
 2. continuous_on (closure X) g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isometry_on (closure X) g

goal (1 subgoal):
 1. \<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isometry_on (closure X) g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isometry_on (closure X) g

goal (1 subgoal):
 1. \<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)
[PROOF STEP]
using g(1)
[PROOF STATE]
proof (prove)
using this:
isometry_on (closure X) g
?x \<in> X \<Longrightarrow> g ?x = f ?x

goal (1 subgoal):
 1. \<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>g. isometry_on (closure X) g \<and> (\<forall>x\<in>X. g x = f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Carmichael_number_gt_3: "Carmichael_number n \<Longrightarrow> n > 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
assume *: "Carmichael_number n"
[PROOF STATE]
proof (state)
this:
Carmichael_number n

goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
hence "n > 1"
[PROOF STATE]
proof (prove)
using this:
Carmichael_number n

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

goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
1 < n

goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
assume "\<not>(n > 3)"
[PROOF STATE]
proof (state)
this:
\<not> 3 < n

goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
with \<open>n > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < n
\<not> 3 < n
[PROOF STEP]
have "n = 2 \<or> n = 3"
[PROOF STATE]
proof (prove)
using this:
1 < n
\<not> 3 < n

goal (1 subgoal):
 1. n = 2 \<or> n = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = 2 \<or> n = 3

goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
with * and Carmichael_number_not_prime[of n]
[PROOF STATE]
proof (chain)
picking this:
Carmichael_number n
Carmichael_number n \<Longrightarrow> \<not> prime n
n = 2 \<or> n = 3
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
Carmichael_number n
Carmichael_number n \<Longrightarrow> \<not> prime n
n = 2 \<or> n = 3

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

goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> 3 < n \<Longrightarrow> False

goal (1 subgoal):
 1. Carmichael_number n \<Longrightarrow> 3 < n
[PROOF STEP]
thus "n > 3"
[PROOF STATE]
proof (prove)
using this:
\<not> 3 < n \<Longrightarrow> False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjoint_family_onI:
  assumes "\<And>i j. i \<in> I \<and> j \<in> I \<Longrightarrow> i \<noteq> j \<Longrightarrow> (A i) \<inter> (A j) = {}"
  shows "disjoint_family_on A I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint_family_on A I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> I \<and> ?j \<in> I; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> A ?i \<inter> A ?j = {}

goal (1 subgoal):
 1. disjoint_family_on A I
[PROOF STEP]
unfolding disjoint_family_on_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> I \<and> ?j \<in> I; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> A ?i \<inter> A ?j = {}

goal (1 subgoal):
 1. \<forall>m\<in>I. \<forall>n\<in>I. m \<noteq> n \<longrightarrow> A m \<inter> A n = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma append_carrier_vec[simp,intro]:
  "v \<in> carrier_vec n1 \<Longrightarrow> w \<in> carrier_vec n2 \<Longrightarrow> v @\<^sub>v w \<in> carrier_vec (n1 + n2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n1; w \<in> carrier_vec n2\<rbrakk> \<Longrightarrow> v @\<^sub>v w \<in> carrier_vec (n1 + n2)
[PROOF STEP]
unfolding carrier_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> {v. dim_vec v = n1}; w \<in> {v. dim_vec v = n2}\<rbrakk> \<Longrightarrow> v @\<^sub>v w \<in> {v. dim_vec v = n1 + n2}
[PROOF STEP]
by auto


[STATEMENT]
lemma real_root_less_mono: "0 < n \<Longrightarrow> x < y \<Longrightarrow> root n x < root n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; x < y\<rbrakk> \<Longrightarrow> root n x < root n y
[PROOF STEP]
proof (clarsimp split: split_root)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ya yaa. \<lbrakk>0 < n; sgn ya * \<bar>ya\<bar> ^ n < sgn yaa * \<bar>yaa\<bar> ^ n; x = sgn ya * \<bar>ya\<bar> ^ n; y = sgn yaa * \<bar>yaa\<bar> ^ n\<rbrakk> \<Longrightarrow> ya < yaa
[PROOF STEP]
have *: "0 < b \<Longrightarrow> a < 0 \<Longrightarrow> \<not> a > b" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < b; a < 0\<rbrakk> \<Longrightarrow> \<not> b < a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?b; ?a < 0\<rbrakk> \<Longrightarrow> \<not> ?b < ?a

goal (1 subgoal):
 1. \<And>ya yaa. \<lbrakk>0 < n; sgn ya * \<bar>ya\<bar> ^ n < sgn yaa * \<bar>yaa\<bar> ^ n; x = sgn ya * \<bar>ya\<bar> ^ n; y = sgn yaa * \<bar>yaa\<bar> ^ n\<rbrakk> \<Longrightarrow> ya < yaa
[PROOF STEP]
fix a b :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ya yaa. \<lbrakk>0 < n; sgn ya * \<bar>ya\<bar> ^ n < sgn yaa * \<bar>yaa\<bar> ^ n; x = sgn ya * \<bar>ya\<bar> ^ n; y = sgn yaa * \<bar>yaa\<bar> ^ n\<rbrakk> \<Longrightarrow> ya < yaa
[PROOF STEP]
assume "0 < n" "sgn a * \<bar>a\<bar> ^ n < sgn b * \<bar>b\<bar> ^ n"
[PROOF STATE]
proof (state)
this:
0 < n
sgn a * \<bar>a\<bar> ^ n < sgn b * \<bar>b\<bar> ^ n

goal (1 subgoal):
 1. \<And>ya yaa. \<lbrakk>0 < n; sgn ya * \<bar>ya\<bar> ^ n < sgn yaa * \<bar>yaa\<bar> ^ n; x = sgn ya * \<bar>ya\<bar> ^ n; y = sgn yaa * \<bar>yaa\<bar> ^ n\<rbrakk> \<Longrightarrow> ya < yaa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n
sgn a * \<bar>a\<bar> ^ n < sgn b * \<bar>b\<bar> ^ n
[PROOF STEP]
show "a < b"
[PROOF STATE]
proof (prove)
using this:
0 < n
sgn a * \<bar>a\<bar> ^ n < sgn b * \<bar>b\<bar> ^ n

goal (1 subgoal):
 1. a < b
[PROOF STEP]
using power_less_imp_less_base[of a n b]
      power_less_imp_less_base[of "- b" n "- a"]
[PROOF STATE]
proof (prove)
using this:
0 < n
sgn a * \<bar>a\<bar> ^ n < sgn b * \<bar>b\<bar> ^ n
\<lbrakk>a ^ n < b ^ n; 0 \<le> b\<rbrakk> \<Longrightarrow> a < b
\<lbrakk>(- b) ^ n < (- a) ^ n; 0 \<le> - a\<rbrakk> \<Longrightarrow> - b < - a

goal (1 subgoal):
 1. a < b
[PROOF STEP]
by (simp add: sgn_real_def * [of "a ^ n" "- ((- b) ^ n)"]
        split: if_split_asm)
[PROOF STATE]
proof (state)
this:
a < b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux3_lm0241_binom_bounds:
  assumes "1 \<ge> (m::nat)"
  assumes "1 \<ge> (n::nat)"
  shows "1 \<ge> m choose n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m choose n \<le> 1
[PROOF STEP]
using assms(1) assms(2) le_Suc_eq
[PROOF STATE]
proof (prove)
using this:
m \<le> 1
n \<le> 1
(?m \<le> Suc ?n) = (?m \<le> ?n \<or> ?m = Suc ?n)

goal (1 subgoal):
 1. m choose n \<le> 1
[PROOF STEP]
by auto


[STATEMENT]
lemma ceiling_add_of_int [simp]: "\<lceil>x + of_int z\<rceil> = \<lceil>x\<rceil> + z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x + of_int z\<rceil> = \<lceil>x\<rceil> + z
[PROOF STEP]
using ceiling_correct [of x]
[PROOF STATE]
proof (prove)
using this:
of_int \<lceil>x\<rceil> - (1::'a) < x \<and> x \<le> of_int \<lceil>x\<rceil>

goal (1 subgoal):
 1. \<lceil>x + of_int z\<rceil> = \<lceil>x\<rceil> + z
[PROOF STEP]
by (simp add: ceiling_def)


[STATEMENT]
lemma d_bound: assumes i: "ii < m"
  shows "d fs ii \<le> N^ii"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d fs ii \<le> int (N ^ ii)
[PROOF STEP]
using d_approx[OF assms]
[PROOF STATE]
proof (prove)
using this:
rat_of_int (d fs ii) \<le> rat_of_nat (N ^ ii)

goal (1 subgoal):
 1. d fs ii \<le> int (N ^ ii)
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
using this:
rat_of_int (gs.Gramian_determinant fs ii) \<le> rat_of_nat (N ^ ii)

goal (1 subgoal):
 1. gs.Gramian_determinant fs ii \<le> int (N ^ ii)
[PROOF STEP]
by linarith


[STATEMENT]
lemma ladder_stepdown_n:
  assumes length_L_greater_1: "length L > 1"
  assumes L': "L' = ladder_stepdown L"
  assumes index_bound: "index < length L'"
  shows "ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
note L_prepare = ladder_stepdown_prepare[OF length_L_greater_1]
[PROOF STATE]
proof (state)
this:
L = (ladder_n L 0, ladder_j L 0, ladder_i L 0) # (ladder_n L 1, ladder_j L 1, ladder_ix L 1) # drop 2 L

goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
have ladder_stepdown_L_def: "ladder_stepdown L = ((ladder_n L (Suc 0) - Suc (ladder_n L 0), ladder_j L (Suc 0), ladder_j L 0 + ladder_ix L (Suc 0)) #
    ladder_shift_n (Suc (ladder_n L 0)) (drop 2 L))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_stepdown L = (ladder_n L (Suc 0) - Suc (ladder_n L 0), ladder_j L (Suc 0), ladder_j L 0 + ladder_ix L (Suc 0)) # ladder_shift_n (Suc (ladder_n L 0)) (drop 2 L)
[PROOF STEP]
by (subst L_prepare, simp)
[PROOF STATE]
proof (state)
this:
ladder_stepdown L = (ladder_n L (Suc 0) - Suc (ladder_n L 0), ladder_j L (Suc 0), ladder_j L 0 + ladder_ix L (Suc 0)) # ladder_shift_n (Suc (ladder_n L 0)) (drop 2 L)

goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
have "index = 0 \<or> index > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index = 0 \<or> 0 < index
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
index = 0 \<or> 0 < index

goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
index = 0 \<or> 0 < index
[PROOF STEP]
show "ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L"
[PROOF STATE]
proof (prove)
using this:
index = 0 \<or> 0 < index

goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
proof (induct rule: disjCases2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. index = 0 \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
 2. 0 < index \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
index = 0

goal (2 subgoals):
 1. index = 0 \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
 2. 0 < index \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
by (simp add: L' ladder_stepdown_L_def 1 ladder_n_def deriv_n_def ladder_stepdown_diff_def)
[PROOF STATE]
proof (state)
this:
ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L

goal (1 subgoal):
 1. 0 < index \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < index \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
0 < index

goal (1 subgoal):
 1. 0 < index \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
have index_bound': "Suc index < length L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc index < length L
[PROOF STEP]
using index_bound L' ladder_stepdown_length length_L_greater_1
[PROOF STATE]
proof (prove)
using this:
index < length L'
L' = ladder_stepdown L
1 < length ?L \<Longrightarrow> length (ladder_stepdown ?L) = length ?L - 1
1 < length L

goal (1 subgoal):
 1. Suc index < length L
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc index < length L

goal (1 subgoal):
 1. 0 < index \<Longrightarrow> ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L
[PROOF STEP]
apply (simp add: L' ladder_stepdown_L_def 2 ladder_n_def ladder_shift_n_drop drop_2_shift
          ladder_stepdown_diff_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv_n (drop 2 (ladder_shift_n (Suc (deriv_n (L ! 0))) L) ! (index - Suc 0)) = deriv_n (L ! Suc index) - Suc (deriv_n (L ! 0))
[PROOF STEP]
apply (subst drop_2_shift)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < index
 2. 1 < length (ladder_shift_n (Suc (deriv_n (L ! 0))) L)
 3. deriv_n (ladder_shift_n (Suc (deriv_n (L ! 0))) L ! Suc index) = deriv_n (L ! Suc index) - Suc (deriv_n (L ! 0))
[PROOF STEP]
apply (simp add: 2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 1 < length (ladder_shift_n (Suc (deriv_n (L ! 0))) L)
 2. deriv_n (ladder_shift_n (Suc (deriv_n (L ! 0))) L ! Suc index) = deriv_n (L ! Suc index) - Suc (deriv_n (L ! 0))
[PROOF STEP]
using length_L_greater_1
[PROOF STATE]
proof (prove)
using this:
1 < length L

goal (2 subgoals):
 1. 1 < length (ladder_shift_n (Suc (deriv_n (L ! 0))) L)
 2. deriv_n (ladder_shift_n (Suc (deriv_n (L ! 0))) L ! Suc index) = deriv_n (L ! Suc index) - Suc (deriv_n (L ! 0))
[PROOF STEP]
apply (simp add: ladder_shift_n_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv_n (ladder_shift_n (Suc (deriv_n (L ! 0))) L ! Suc index) = deriv_n (L ! Suc index) - Suc (deriv_n (L ! 0))
[PROOF STEP]
apply (simp add: deriv_n_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (ladder_shift_n (Suc (fst (L ! 0))) L ! Suc index) = fst (L ! Suc index) - Suc (fst (L ! 0))
[PROOF STEP]
apply (simp add: ladder_shift_n_at[OF index_bound'])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ladder_n L' index = ladder_n L (Suc index) - ladder_stepdown_diff L

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma EVEN_union_ODD:
  shows "EVEN \<union> ODD = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EVEN \<union> ODD = UNIV
[PROOF STEP]
using even_or_odd
[PROOF STATE]
proof (prove)
using this:
\<exists>i. ?n = 2 * i \<or> ?n = 2 * i + 1

goal (1 subgoal):
 1. EVEN \<union> ODD = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
have "EVEN \<union> ODD = (\<lambda>n. atom n) ` {n. \<exists>i. n = 2*i} \<union> (\<lambda>n. atom n) ` {n. \<exists>i. n = 2*i+1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EVEN \<union> ODD = atom ` {n. \<exists>i. n = 2 * i} \<union> atom ` {n. \<exists>i. n = 2 * i + 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
EVEN \<union> ODD = atom ` {n. \<exists>i. n = 2 * i} \<union> atom ` {n. \<exists>i. n = 2 * i + 1}

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
EVEN \<union> ODD = atom ` {n. \<exists>i. n = 2 * i} \<union> atom ` {n. \<exists>i. n = 2 * i + 1}

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
have "\<dots> = (\<lambda>n. atom n) ` ({n. \<exists>i. n = 2*i} \<union> {n. \<exists>i. n = 2*i+1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atom ` {n. \<exists>i. n = 2 * i} \<union> atom ` {n. \<exists>i. n = 2 * i + 1} = atom ` ({n. \<exists>i. n = 2 * i} \<union> {n. \<exists>i. n = 2 * i + 1})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
atom ` {n. \<exists>i. n = 2 * i} \<union> atom ` {n. \<exists>i. n = 2 * i + 1} = atom ` ({n. \<exists>i. n = 2 * i} \<union> {n. \<exists>i. n = 2 * i + 1})

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
atom ` {n. \<exists>i. n = 2 * i} \<union> atom ` {n. \<exists>i. n = 2 * i + 1} = atom ` ({n. \<exists>i. n = 2 * i} \<union> {n. \<exists>i. n = 2 * i + 1})

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
have "\<dots> = (\<lambda>n. atom n) ` ({n. \<exists>i. n = 2*i \<or> n = 2*i+1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atom ` ({n. \<exists>i. n = 2 * i} \<union> {n. \<exists>i. n = 2 * i + 1}) = atom ` {n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
atom ` ({n. \<exists>i. n = 2 * i} \<union> {n. \<exists>i. n = 2 * i + 1}) = atom ` {n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1}

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
atom ` ({n. \<exists>i. n = 2 * i} \<union> {n. \<exists>i. n = 2 * i + 1}) = atom ` {n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1}

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
have "\<dots> = (\<lambda>n. atom n) ` (UNIV::nat set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atom ` {n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1} = range atom
[PROOF STEP]
using even_or_odd
[PROOF STATE]
proof (prove)
using this:
\<exists>i. ?n = 2 * i \<or> ?n = 2 * i + 1

goal (1 subgoal):
 1. atom ` {n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1} = range atom
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
atom ` {n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1} = range atom

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
atom ` {n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1} = range atom

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
have "\<dots> = (UNIV::atom set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj atom
[PROOF STEP]
using atom.exhaust
[PROOF STATE]
proof (prove)
using this:
(\<And>x. ?y = atom x \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. surj atom
[PROOF STEP]
by (auto simp add: surj_def)
[PROOF STATE]
proof (state)
this:
surj atom

goal (1 subgoal):
 1. (\<And>n. \<exists>i. n = 2 * i \<or> n = 2 * i + 1) \<Longrightarrow> EVEN \<union> ODD = UNIV
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
EVEN \<union> ODD = UNIV
[PROOF STEP]
show "EVEN \<union> ODD = UNIV"
[PROOF STATE]
proof (prove)
using this:
EVEN \<union> ODD = UNIV

goal (1 subgoal):
 1. EVEN \<union> ODD = UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
EVEN \<union> ODD = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_prod_list: "(\<And> p. p \<in> set ps \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> order x (prod_list ps) = sum_list (map (order x) ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. p \<in> set ps \<Longrightarrow> p \<noteq> 0) \<Longrightarrow> order x (prod_list ps) = sum_list (map (order x) ps)
[PROOF STEP]
by (induct ps, auto, subst order_mult, auto simp: prod_list_zero_iff)


[STATEMENT]
lemma gcd_zero_iff[simp]: "gcd a b = 0 \<longleftrightarrow> a = 0 \<and> b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (gcd a b = (0::'a)) = (a = (0::'a) \<and> b = (0::'a))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. gcd a b = (0::'a) \<Longrightarrow> a = (0::'a) \<and> b = (0::'a)
 2. a = (0::'a) \<and> b = (0::'a) \<Longrightarrow> gcd a b = (0::'a)
[PROOF STEP]
assume "gcd a b = 0"
[PROOF STATE]
proof (state)
this:
gcd a b = (0::'a)

goal (2 subgoals):
 1. gcd a b = (0::'a) \<Longrightarrow> a = (0::'a) \<and> b = (0::'a)
 2. a = (0::'a) \<and> b = (0::'a) \<Longrightarrow> gcd a b = (0::'a)
[PROOF STEP]
from gcd_dvd1[of a b, unfolded this] gcd_dvd2[of a b, unfolded this]
[PROOF STATE]
proof (chain)
picking this:
(0::'a) dvd a
(0::'a) dvd b
[PROOF STEP]
show "a = 0 \<and> b = 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) dvd a
(0::'a) dvd b

goal (1 subgoal):
 1. a = (0::'a) \<and> b = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = (0::'a) \<and> b = (0::'a)

goal (1 subgoal):
 1. a = (0::'a) \<and> b = (0::'a) \<Longrightarrow> gcd a b = (0::'a)
[PROOF STEP]
qed auto


[STATEMENT]
lemma inner_nth_eucl: "x \<bullet> y = (\<Sum>i<DIM('a). x $\<^sub>e i * y $\<^sub>e i)"
  for x y::"'a::executable_euclidean_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet> y = (\<Sum>i<DIM('a). x $\<^sub>e i * y $\<^sub>e i)
[PROOF STEP]
apply (subst self_eq_eucl_of_list[where x=x])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_of_list (map (($\<^sub>e) x) [0..<DIM('a)]) \<bullet> y = (\<Sum>i<DIM('a). x $\<^sub>e i * y $\<^sub>e i)
[PROOF STEP]
apply (subst self_eq_eucl_of_list[where x=y])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_of_list (map (($\<^sub>e) x) [0..<DIM('a)]) \<bullet> eucl_of_list (map (($\<^sub>e) y) [0..<DIM('a)]) = (\<Sum>i<DIM('a). x $\<^sub>e i * y $\<^sub>e i)
[PROOF STEP]
apply (subst eucl_of_list_inner)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. length (map (($\<^sub>e) x) [0..<DIM('a)]) = DIM('a)
 2. length (map (($\<^sub>e) y) [0..<DIM('a)]) = DIM('a)
 3. sum_list (map2 (*) (map (($\<^sub>e) x) [0..<DIM('a)]) (map (($\<^sub>e) y) [0..<DIM('a)])) = (\<Sum>i<DIM('a). x $\<^sub>e i * y $\<^sub>e i)
[PROOF STEP]
by (auto simp: map2_map_map atLeast_upt interv_sum_list_conv_sum_set_nat)


[STATEMENT]
lemma streams_mono:  "s \<in> streams A \<Longrightarrow> A \<subseteq> B \<Longrightarrow> s \<in> streams B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> streams A; A \<subseteq> B\<rbrakk> \<Longrightarrow> s \<in> streams B
[PROOF STEP]
unfolding streams_iff_sset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sset s \<subseteq> A; A \<subseteq> B\<rbrakk> \<Longrightarrow> sset s \<subseteq> B
[PROOF STEP]
by auto


[STATEMENT]
lemma M_0[simp]: "M 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M 0 = 0
[PROOF STEP]
by (auto simp add: M_def)


[STATEMENT]
lemma lborel_integrable_real_affine_iff:
  fixes f :: "real \<Rightarrow> 'a :: {banach, second_countable_topology}"
  shows "c \<noteq> 0 \<Longrightarrow> integrable lborel (\<lambda>x. f (t + c * x)) \<longleftrightarrow> integrable lborel f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> integrable lborel (\<lambda>x. f (t + c * x)) = integrable lborel f
[PROOF STEP]
using
    lborel_integrable_real_affine[of f c t]
    lborel_integrable_real_affine[of "\<lambda>x. f (t + c * x)" "1/c" "-t/c"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>integrable lborel f; c \<noteq> 0\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>x. f (t + c * x))
\<lbrakk>integrable lborel (\<lambda>x. f (t + c * x)); 1 / c \<noteq> 0\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>x. f (t + c * (- t / c + 1 / c * x)))

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> integrable lborel (\<lambda>x. f (t + c * x)) = integrable lborel f
[PROOF STEP]
by (auto simp add: field_simps)


[STATEMENT]
lemma fds_shift_integral: "fds_shift b (fds_integral a f) = fds_integral a (fds_shift b f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_shift b (fds_integral a f) = fds_integral a (fds_shift b f)
[PROOF STEP]
by (rule fds_eqI) (simp add: fds_integral_def fds_shift_def)


[STATEMENT]
lemma finite_M1: "finite M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite M1
[PROOF STEP]
by (rule finite_subset [OF M1_subset_G finite_G])


[STATEMENT]
lemma real_non_neg_matD: assumes "real_non_neg_mat A"
  shows "A $h i $h j \<in> \<real>" "Re (A $h i $h j) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $h i $h j \<in> \<real> &&& 0 \<le> Re (A $h i $h j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real_non_neg_mat A

goal (1 subgoal):
 1. A $h i $h j \<in> \<real> &&& 0 \<le> Re (A $h i $h j)
[PROOF STEP]
unfolding real_non_neg_mat_def elements_mat_h_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>range (\<lambda>(i, y). A $h i $h y). a \<in> \<real> \<and> 0 \<le> Re a

goal (1 subgoal):
 1. A $h i $h j \<in> \<real> &&& 0 \<le> Re (A $h i $h j)
[PROOF STEP]
by auto


[STATEMENT]
lemma backlinks_correct: "FiniteGraph.backflows (set E) = set (backlinks E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. backflows (set E) = set (backlinks E)
[PROOF STEP]
unfolding backflows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(r, s). (s, r) \<in> set E} = set (backlinks E)
[PROOF STEP]
by(simp add: backlinks_set)

  \<comment> \<open>undirected\<close>


[STATEMENT]
lemma fun_sum_list_commute:
  assumes "f 0 = 0" and "\<And>x y. f (x + y) = f x + f y"
  shows "f (sum_list xs) = sum_list (map f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (sum_list xs) = sum_list (map f xs)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f (sum_list []) = sum_list (map f [])
 2. \<And>a xs. f (sum_list xs) = sum_list (map f xs) \<Longrightarrow> f (sum_list (a # xs)) = sum_list (map f (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. f (sum_list []) = sum_list (map f [])
 2. \<And>a xs. f (sum_list xs) = sum_list (map f xs) \<Longrightarrow> f (sum_list (a # xs)) = sum_list (map f (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (sum_list []) = sum_list (map f [])
[PROOF STEP]
by (simp add: assms(1))
[PROOF STATE]
proof (state)
this:
f (sum_list []) = sum_list (map f [])

goal (1 subgoal):
 1. \<And>a xs. f (sum_list xs) = sum_list (map f xs) \<Longrightarrow> f (sum_list (a # xs)) = sum_list (map f (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. f (sum_list xs) = sum_list (map f xs) \<Longrightarrow> f (sum_list (a # xs)) = sum_list (map f (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
f (sum_list xs) = sum_list (map f xs)

goal (1 subgoal):
 1. \<And>a xs. f (sum_list xs) = sum_list (map f xs) \<Longrightarrow> f (sum_list (a # xs)) = sum_list (map f (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
f (sum_list xs) = sum_list (map f xs)

goal (1 subgoal):
 1. f (sum_list (x # xs)) = sum_list (map f (x # xs))
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
f (sum_list (x # xs)) = sum_list (map f (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_cong:
  assumes "\<And>w. w \<in> space M \<Longrightarrow> f w = g w"
  shows "f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable M M'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M M') = (g \<in> M \<rightarrow>\<^sub>M M')
[PROOF STEP]
unfolding measurable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> {f \<in> space M \<rightarrow> space M'. \<forall>y\<in>sets M'. f -` y \<inter> space M \<in> sets M}) = (g \<in> {f \<in> space M \<rightarrow> space M'. \<forall>y\<in>sets M'. f -` y \<inter> space M \<in> sets M})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?w \<in> space M \<Longrightarrow> f ?w = g ?w

goal (1 subgoal):
 1. (f \<in> {f \<in> space M \<rightarrow> space M'. \<forall>y\<in>sets M'. f -` y \<inter> space M \<in> sets M}) = (g \<in> {f \<in> space M \<rightarrow> space M'. \<forall>y\<in>sets M'. f -` y \<inter> space M \<in> sets M})
[PROOF STEP]
by (simp cong: vimage_inter_cong Pi_cong)


[STATEMENT]
lemma hd_in_butlast: "length xs > 1 \<Longrightarrow> hd xs \<in> set (butlast xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length xs \<Longrightarrow> hd xs \<in> set (butlast xs)
[PROOF STEP]
by (metis butlast.simps(2) dual_order.strict_iff_order hd_Cons_tl hd_in_set length_greater_0_conv length_tl less_le_trans list.distinct(1) list.sel(1) neq0_conv zero_less_diff)


[STATEMENT]
lemma scalar_prod_right_sum_distrib:
  assumes vs: "\<And> v. v \<in> set vvs \<Longrightarrow> v \<in> carrier_vec n" and w: "w \<in> carrier_vec n"
  shows "w \<bullet> sumlist vvs = sum_list (map (\<lambda> v. w \<bullet> v) vvs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<bullet> M.sumlist vvs = sum_list (map ((\<bullet>) w) vvs)
[PROOF STEP]
by (subst comm_scalar_prod[OF w sumlist_carrier], insert vs w, force,
  subst scalar_prod_left_sum_distrib[OF vs w], force,
  rule arg_cong[of _ _ sum_list], rule nth_equalityI,
  auto simp: set_conv_nth intro!: comm_scalar_prod)


[STATEMENT]
lemma integral_Pair_const:
    "integral (cbox (a,c) (b,d)) (\<lambda>x. k) =
     integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox (a, c) (b, d)) (\<lambda>x. k) = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. k))
[PROOF STEP]
by (simp add: content_Pair)


[STATEMENT]
lemma has_laplace_cmul:
  assumes "(f has_laplace F) S"
  shows "((\<lambda>x. r *\<^sub>R f x) has_laplace r *\<^sub>R F) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. r *\<^sub>R f x) has_laplace r *\<^sub>R F) S
[PROOF STEP]
apply (rule has_laplaceI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. exp (t *\<^sub>R - S) * r *\<^sub>R f t) has_integral r *\<^sub>R F) {0..}
[PROOF STEP]
using has_laplaceD[OF assms, THEN has_integral_cmul[where c=r]]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. r *\<^sub>R (exp (x *\<^sub>R - S) * f x)) has_integral r *\<^sub>R F) {0..}

goal (1 subgoal):
 1. ((\<lambda>t. exp (t *\<^sub>R - S) * r *\<^sub>R f t) has_integral r *\<^sub>R F) {0..}
[PROOF STEP]
by auto


[STATEMENT]
lemma line_integral_degenerate_chain:
  assumes "(\<forall>(k, \<gamma>) \<in> chain. point_path \<gamma>)"
  assumes "finite basis"
  shows "one_chain_line_integral F basis chain = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F basis chain = 0
[PROOF STEP]
proof (simp add: one_chain_line_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g) = 0
[PROOF STEP]
have "\<forall>(k,g)\<in>chain. line_integral F basis g = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>(k, g)\<in>chain. line_integral F basis g = 0
[PROOF STEP]
using assms line_integral_point_path
[PROOF STATE]
proof (prove)
using this:
\<forall>(k, \<gamma>)\<in>chain. point_path \<gamma>
finite basis
\<lbrakk>point_path ?\<gamma>; finite ?basis\<rbrakk> \<Longrightarrow> line_integral ?F ?basis ?\<gamma> = 0

goal (1 subgoal):
 1. \<forall>(k, g)\<in>chain. line_integral F basis g = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>(k, g)\<in>chain. line_integral F basis g = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>(k, g)\<in>chain. line_integral F basis g = 0
[PROOF STEP]
have "\<forall>(k,g)\<in>chain. real_of_int k * line_integral F basis g = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>(k, g)\<in>chain. line_integral F basis g = 0

goal (1 subgoal):
 1. \<forall>(k, g)\<in>chain. real_of_int k * line_integral F basis g = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>(k, g)\<in>chain. real_of_int k * line_integral F basis g = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>(k, g)\<in>chain. real_of_int k * line_integral F basis g = 0
[PROOF STEP]
have "\<And>p. p \<in> chain \<Longrightarrow> (case p of (i, f) \<Rightarrow> real_of_int i * line_integral F basis f) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>(k, g)\<in>chain. real_of_int k * line_integral F basis g = 0

goal (1 subgoal):
 1. \<And>p. p \<in> chain \<Longrightarrow> (case p of (i, f) \<Rightarrow> real_of_int i * line_integral F basis f) = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?p \<in> chain \<Longrightarrow> (case ?p of (i, f) \<Rightarrow> real_of_int i * line_integral F basis f) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?p \<in> chain \<Longrightarrow> (case ?p of (i, f) \<Rightarrow> real_of_int i * line_integral F basis f) = 0
[PROOF STEP]
show "(\<Sum>x\<in>chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g) = 0"
[PROOF STATE]
proof (prove)
using this:
?p \<in> chain \<Longrightarrow> (case ?p of (i, f) \<Rightarrow> real_of_int i * line_integral F basis f) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scalar_prod_append: assumes "v1 \<in> carrier_vec n1" "v2 \<in> carrier_vec n2"
  "w1 \<in> carrier_vec n1" "w2 \<in> carrier_vec n2"
  shows "(v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
v1 \<in> carrier_vec n1
v2 \<in> carrier_vec n2
w1 \<in> carrier_vec n1
w2 \<in> carrier_vec n2
[PROOF STEP]
have dim: "dim_vec v1 = n1" "dim_vec v2 = n2" "dim_vec w1 = n1" "dim_vec w2 = n2"
[PROOF STATE]
proof (prove)
using this:
v1 \<in> carrier_vec n1
v2 \<in> carrier_vec n2
w1 \<in> carrier_vec n1
w2 \<in> carrier_vec n2

goal (1 subgoal):
 1. (dim_vec v1 = n1 &&& dim_vec v2 = n2) &&& dim_vec w1 = n1 &&& dim_vec w2 = n2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_vec v1 = n1
dim_vec v2 = n2
dim_vec w1 = n1
dim_vec w2 = n2

goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
have id: "{0 ..< n1 + n2} = {0 ..< n1} \<union> {n1 ..< n1 + n2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<n1 + n2} = {0..<n1} \<union> {n1..<n1 + n2}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<n1 + n2} = {0..<n1} \<union> {n1..<n1 + n2}

goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
have id2: "{n1 ..< n1 + n2} = (plus n1) ` {0 ..< n2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n1..<n1 + n2} = (+) n1 ` {0..<n2}
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
{n1..<n1 + n2} = (+) n1 ` {0..<n2}

goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
have "(v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = (\<Sum>i = 0..<n1. v1 $ i * w1 $ i) +
    (\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = (\<Sum>i = 0..<n1. v1 $ i * w1 $ i) + (\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1))
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (w1 @\<^sub>v w2). (v1 @\<^sub>v v2) $ i * (w1 @\<^sub>v w2) $ i) = (\<Sum>i = 0..<n1. v1 $ i * w1 $ i) + (\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1))
[PROOF STEP]
by (auto simp: dim id, subst sum.union_disjoint, insert assms, force+)
[PROOF STATE]
proof (state)
this:
(v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = (\<Sum>i = 0..<n1. v1 $ i * w1 $ i) + (\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1))

goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = (\<Sum>i = 0..<n1. v1 $ i * w1 $ i) + (\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1))

goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
have "(\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1))
    = (\<Sum>i = 0..< n2. v2 $ i * w2 $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1)) = (\<Sum>i = 0..<n2. v2 $ i * w2 $ i)
[PROOF STEP]
by (rule sum.reindex_cong [OF _ id2]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i = n1..<n1 + n2. v2 $ (i - n1) * w2 $ (i - n1)) = (\<Sum>i = 0..<n2. v2 $ i * w2 $ i)

goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = (\<Sum>i = 0..<n1. v1 $ i * w1 $ i) + (\<Sum>i = 0..<n2. v2 $ i * w2 $ i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = (\<Sum>i = 0..<n1. v1 $ i * w1 $ i) + (\<Sum>i = 0..<n2. v2 $ i * w2 $ i)

goal (1 subgoal):
 1. (v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2
[PROOF STEP]
by (simp, insert assms, auto simp: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
(v1 @\<^sub>v v2) \<bullet> (w1 @\<^sub>v w2) = v1 \<bullet> w1 + v2 \<bullet> w2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remove_Max_eq: "\<lbrakk> finite I; I \<noteq> {}; n \<noteq> Max I \<rbrakk> \<Longrightarrow> Max (I - {n}) = Max I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}; n \<noteq> Max I\<rbrakk> \<Longrightarrow> Max (I - {n}) = Max I
[PROOF STEP]
by (rule Max_equality, simp+)


[STATEMENT]
lemma [smt_arith_multiplication]:
  fixes A B :: real and p n :: int
  assumes "A \<le> B" "0 < n" "p > 0"
  shows "(A / n) * p \<le> (B / n) * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A / real_of_int n * real_of_int p \<le> B / real_of_int n * real_of_int p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<le> B
0 < n
0 < p

goal (1 subgoal):
 1. A / real_of_int n * real_of_int p \<le> B / real_of_int n * real_of_int p
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma image0_r_iff_image0_trancl: "(r``{i}={}) = (\<forall>x. ((i,x) \<in> r\<^sup>+) = False)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r `` {i} = {}) = (\<forall>x. ((i, x) \<in> r\<^sup>+) = False)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r `` {i} = {}; (i, x) \<in> r\<^sup>+\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule image0_trancl_iff_image0_r [THEN ssubst], auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Times_mset_single_left: "{#a#} \<times># B = image_mset (Pair a) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#a#} \<times># B = image_mset (Pair a) B
[PROOF STEP]
unfolding Sigma_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>#{#a#}. image_mset (Pair a) B) = image_mset (Pair a) B
[PROOF STEP]
by auto


[STATEMENT]
lemma bigo_abs_powr_iff [simp]:
  "0 < p \<Longrightarrow> (\<lambda>x. \<bar>f x :: real\<bar> powr p) \<in> O[F](\<lambda>x. \<bar>g x\<bar> powr p) \<longleftrightarrow> f \<in> O[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar> powr p) \<in> O[F](\<lambda>x. \<bar>g x\<bar> powr p)) = (f \<in> O[F](g))
[PROOF STEP]
by(subst bigo_powr_iff; simp)


[STATEMENT]
lemma sndTSdet: "n\<le>length xs \<Longrightarrow> snd (TSdet init initH xs n) = rev (take n xs) @ initH"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length xs \<Longrightarrow> snd (TSdet init initH xs n) = rev (take n xs) @ initH
[PROOF STEP]
apply(induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> length xs \<Longrightarrow> snd (TSdet init initH xs 0) = rev (take 0 xs) @ initH
 2. \<And>n. \<lbrakk>n \<le> length xs \<Longrightarrow> snd (TSdet init initH xs n) = rev (take n xs) @ initH; Suc n \<le> length xs\<rbrakk> \<Longrightarrow> snd (TSdet init initH xs (Suc n)) = rev (take (Suc n) xs) @ initH
[PROOF STEP]
apply(simp add: rTS_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> length xs \<Longrightarrow> snd (TSdet init initH xs n) = rev (take n xs) @ initH; Suc n \<le> length xs\<rbrakk> \<Longrightarrow> snd (TSdet init initH xs (Suc n)) = rev (take (Suc n) xs) @ initH
[PROOF STEP]
by(simp add: split_def TS_step_d_def take_Suc_conv_app_nth config'_snoc Step_def rTS_def)


[STATEMENT]
lemma nn_integral_uniform_measure:
  assumes f[measurable]: "f \<in> borel_measurable M" and S[measurable]: "S \<in> sets M"
  shows "(\<integral>\<^sup>+x. f x \<partial>uniform_measure M S) = (\<integral>\<^sup>+x. f x * indicator S x \<partial>M) / emeasure M S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
assume "emeasure M S = \<infinity>"
[PROOF STATE]
proof (state)
this:
emeasure M S = \<infinity>

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure M S = \<infinity>
[PROOF STEP]
have ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure M S = \<infinity>

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
by (simp add: uniform_measure_def nn_integral_density f)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
emeasure M S = \<infinity> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
emeasure M S = \<infinity> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
emeasure M S = \<infinity> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
assume [simp]: "emeasure M S = 0"
[PROOF STATE]
proof (state)
this:
emeasure M S = 0

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure M S = 0
[PROOF STEP]
have ae: "AE x in M. x \<notin> S"
[PROOF STATE]
proof (prove)
using this:
emeasure M S = 0

goal (1 subgoal):
 1. AE x in M. x \<notin> S
[PROOF STEP]
using sets.sets_into_space[OF S]
[PROOF STATE]
proof (prove)
using this:
emeasure M S = 0
S \<subseteq> space M

goal (1 subgoal):
 1. AE x in M. x \<notin> S
[PROOF STEP]
by (subst AE_iff_measurable[OF _ refl]) (simp_all add: subset_eq cong: rev_conj_cong)
[PROOF STATE]
proof (state)
this:
AE x in M. x \<notin> S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
from ae
[PROOF STATE]
proof (chain)
picking this:
AE x in M. x \<notin> S
[PROOF STEP]
have "(\<integral>\<^sup>+ x. indicator S x / 0 * f x \<partial>M) = 0"
[PROOF STATE]
proof (prove)
using this:
AE x in M. x \<notin> S

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator S x / 0 * f x \<partial>M = 0
[PROOF STEP]
by (subst nn_integral_0_iff_AE) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator S x / 0 * f x \<partial>M = 0

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator S x / 0 * f x \<partial>M = 0

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
from ae
[PROOF STATE]
proof (chain)
picking this:
AE x in M. x \<notin> S
[PROOF STEP]
have "(\<integral>\<^sup>+ x. f x * indicator S x \<partial>M) = 0"
[PROOF STATE]
proof (prove)
using this:
AE x in M. x \<notin> S

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator S x \<partial>M = 0
[PROOF STEP]
by (subst nn_integral_0_iff_AE) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f x * indicator S x \<partial>M = 0

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. indicator S x / 0 * f x \<partial>M = 0
\<integral>\<^sup>+ x. f x * indicator S x \<partial>M = 0
[PROOF STEP]
have ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. indicator S x / 0 * f x \<partial>M = 0
\<integral>\<^sup>+ x. f x * indicator S x \<partial>M = 0

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
by (simp add: uniform_measure_def nn_integral_density f)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
emeasure M S = 0 \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
emeasure M S = 0 \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
have "emeasure M S \<noteq> 0 \<Longrightarrow> emeasure M S \<noteq> \<infinity> \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>emeasure M S \<noteq> 0; emeasure M S \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
unfolding uniform_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>emeasure M S \<noteq> 0; emeasure M S \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> integral\<^sup>N (density M (\<lambda>x. indicator S x / emeasure M S)) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
by (subst nn_integral_density)
       (auto simp: ennreal_times_divide f nn_integral_divide[symmetric] mult.commute)
[PROOF STATE]
proof (state)
this:
\<lbrakk>emeasure M S \<noteq> 0; emeasure M S \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
emeasure M S = \<infinity> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
emeasure M S = 0 \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
\<lbrakk>emeasure M S \<noteq> 0; emeasure M S \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure M S = \<infinity> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
emeasure M S = 0 \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
\<lbrakk>emeasure M S \<noteq> 0; emeasure M S \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal (1 subgoal):
 1. integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (uniform_measure M S) f = \<integral>\<^sup>+ x. f x * indicator S x \<partial>M / emeasure M S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_subset_image:
   "countable B \<and> B \<subseteq> (f ` A) \<longleftrightarrow> (\<exists>A'. countable A' \<and> A' \<subseteq> A \<and> (B = f ` A'))"
   (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (countable B \<and> B \<subseteq> f ` A) = (\<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. countable B \<and> B \<subseteq> f ` A \<Longrightarrow> \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A'
 2. \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A' \<Longrightarrow> countable B \<and> B \<subseteq> f ` A
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
countable B \<and> B \<subseteq> f ` A

goal (2 subgoals):
 1. countable B \<and> B \<subseteq> f ` A \<Longrightarrow> \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A'
 2. \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A' \<Longrightarrow> countable B \<and> B \<subseteq> f ` A
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A'
[PROOF STEP]
by (rule exI [where x="inv_into A f ` B"])
      (use \<open>?lhs\<close> in \<open>auto simp: f_inv_into_f subset_iff image_inv_into_cancel inv_into_into\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A'

goal (1 subgoal):
 1. \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A' \<Longrightarrow> countable B \<and> B \<subseteq> f ` A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A' \<Longrightarrow> countable B \<and> B \<subseteq> f ` A
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A'

goal (1 subgoal):
 1. \<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A' \<Longrightarrow> countable B \<and> B \<subseteq> f ` A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A'
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>A'. countable A' \<and> A' \<subseteq> A \<and> B = f ` A'

goal (1 subgoal):
 1. countable B \<and> B \<subseteq> f ` A
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
countable B \<and> B \<subseteq> f ` A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_int_div_aux:
  assumes "d \<noteq> 0"
  shows "(of_int x ::'a::field_char_0) / of_int d =
    of_int (x div d) + (of_int (x mod d)) / of_int d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
let ?t = "of_int (x div d) * (of_int d ::'a) + of_int (x mod d)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
let ?f = "\<lambda>x. x / of_int d"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
have "x = (x div d) * d + x mod d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = x div d * d + x mod d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = x div d * d + x mod d

goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = x div d * d + x mod d
[PROOF STEP]
have eq: "of_int x = ?t"
[PROOF STATE]
proof (prove)
using this:
x = x div d * d + x mod d

goal (1 subgoal):
 1. of_int x = of_int (x div d) * of_int d + of_int (x mod d)
[PROOF STEP]
by (simp only: of_int_mult[symmetric] of_int_add [symmetric])
[PROOF STATE]
proof (state)
this:
of_int x = of_int (x div d) * of_int d + of_int (x mod d)

goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_int x = of_int (x div d) * of_int d + of_int (x mod d)
[PROOF STEP]
have "of_int x / of_int d = ?t / of_int d"
[PROOF STATE]
proof (prove)
using this:
of_int x = of_int (x div d) * of_int d + of_int (x mod d)

goal (1 subgoal):
 1. of_int x / of_int d = (of_int (x div d) * of_int d + of_int (x mod d)) / of_int d
[PROOF STEP]
using cong[OF refl[of ?f] eq]
[PROOF STATE]
proof (prove)
using this:
of_int x = of_int (x div d) * of_int d + of_int (x mod d)
of_int x / of_int d = (of_int (x div d) * of_int d + of_int (x mod d)) / of_int d

goal (1 subgoal):
 1. of_int x / of_int d = (of_int (x div d) * of_int d + of_int (x mod d)) / of_int d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int x / of_int d = (of_int (x div d) * of_int d + of_int (x mod d)) / of_int d

goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_int x / of_int d = (of_int (x div d) * of_int d + of_int (x mod d)) / of_int d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
of_int x / of_int d = (of_int (x div d) * of_int d + of_int (x mod d)) / of_int d

goal (1 subgoal):
 1. of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d
[PROOF STEP]
by (simp add: add_divide_distrib algebra_simps \<open>d \<noteq> 0\<close>)
[PROOF STATE]
proof (state)
this:
of_int x / of_int d = of_int (x div d) + of_int (x mod d) / of_int d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nsets_3_eq: "nsets A 3 = (\<Union>x\<in>A. \<Union>y\<in>A - {x}. \<Union>z\<in>A - {x,y}. {{x,y,z}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A]\<^bsup>3\<^esup> = (\<Union>x\<in>A. \<Union>y\<in>A - {x}. \<Union>z\<in>A - {x, y}. {{x, y, z}})
[PROOF STEP]
by (simp add: eval_nat_numeral nsets_def card_Suc_eq) blast


[STATEMENT]
lemma sin_coeff_Suc: "sin_coeff (Suc n) = cos_coeff n / real (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin_coeff (Suc n) = cos_coeff n / real (Suc n)
[PROOF STEP]
unfolding cos_coeff_def sin_coeff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if even (Suc n) then 0 else (- 1) ^ ((Suc n - Suc 0) div 2) / fact (Suc n)) = (if even n then (- 1) ^ (n div 2) / fact n else 0) / real (Suc n)
[PROOF STEP]
by (simp del: mult_Suc)


[STATEMENT]
lemma connected_component_eq_UNIV:
    fixes x :: "'a::real_normed_vector"
    shows "connected_component_set s x = UNIV \<longleftrightarrow> s = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_component_set s x = UNIV) = (s = UNIV)
[PROOF STEP]
using connected_component_in connected_component_UNIV
[PROOF STATE]
proof (prove)
using this:
connected_component ?S ?x ?y \<Longrightarrow> ?x \<in> ?S \<and> ?y \<in> ?S
connected_component_set UNIV ?x = UNIV

goal (1 subgoal):
 1. (connected_component_set s x = UNIV) = (s = UNIV)
[PROOF STEP]
by blast


[STATEMENT]
lemma pathstart_linepath[simp]: "pathstart (linepath a b) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathstart (linepath a b) = a
[PROOF STEP]
unfolding pathstart_def linepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - 0) *\<^sub>R a + 0 *\<^sub>R b = a
[PROOF STEP]
by auto


[STATEMENT]
lemma SD_preorderD:
  assumes "p \<succeq>[SD(le)] q"
  shows   "p \<in> lotteries_on carrier" "q \<in> lotteries_on carrier"
  and      "\<And>x. x \<in> carrier \<Longrightarrow>
             measure_pmf.prob p (preferred_alts le x) \<ge> measure_pmf.prob q (preferred_alts le x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<in> lotteries_on carrier &&& q \<in> lotteries_on carrier) &&& (\<And>x. x \<in> carrier \<Longrightarrow> measure_pmf.prob q (preferred_alts le x) \<le> measure_pmf.prob p (preferred_alts le x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
SD le q p

goal (1 subgoal):
 1. (p \<in> lotteries_on carrier &&& q \<in> lotteries_on carrier) &&& (\<And>x. x \<in> carrier \<Longrightarrow> measure_pmf.prob q (preferred_alts le x) \<le> measure_pmf.prob p (preferred_alts le x))
[PROOF STEP]
unfolding SD_preorder
[PROOF STATE]
proof (prove)
using this:
p \<in> lotteries_on carrier \<and> q \<in> lotteries_on carrier \<and> (\<forall>x\<in>carrier. measure_pmf.prob q (preferred_alts le x) \<le> measure_pmf.prob p (preferred_alts le x))

goal (1 subgoal):
 1. (p \<in> lotteries_on carrier &&& q \<in> lotteries_on carrier) &&& (\<And>x. x \<in> carrier \<Longrightarrow> measure_pmf.prob q (preferred_alts le x) \<le> measure_pmf.prob p (preferred_alts le x))
[PROOF STEP]
by simp_all


[STATEMENT]
lemma continuous_attains_inf:
  fixes f :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"
  shows "compact s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> continuous_on s f \<Longrightarrow> (\<exists>x\<in>s. \<forall>y\<in>s. f x \<le> f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>compact s; s \<noteq> {}; continuous_on s f\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. \<forall>y\<in>s. f x \<le> f y
[PROOF STEP]
using compact_attains_inf[of "f ` s"] compact_continuous_image[of s f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact (f ` s); f ` s \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>sa\<in>f ` s. \<forall>t\<in>f ` s. sa \<le> t
\<lbrakk>continuous_on s f; compact s\<rbrakk> \<Longrightarrow> compact (f ` s)

goal (1 subgoal):
 1. \<lbrakk>compact s; s \<noteq> {}; continuous_on s f\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. \<forall>y\<in>s. f x \<le> f y
[PROOF STEP]
by auto


[STATEMENT]
lemma binomial_fact:
  assumes kn: "k \<le> n"
  shows "(of_nat (n choose k) :: 'a::field_char_0) = fact n / (fact k * fact (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (n choose k) = fact n / (fact k * fact (n - k))
[PROOF STEP]
using binomial_fact_lemma[OF kn]
[PROOF STATE]
proof (prove)
using this:
fact k * fact (n - k) * (n choose k) = fact n

goal (1 subgoal):
 1. of_nat (n choose k) = fact n / (fact k * fact (n - k))
[PROOF STEP]
by (metis (mono_tags, lifting) fact_nonzero mult_eq_0_iff nonzero_mult_div_cancel_left of_nat_fact of_nat_mult)


[STATEMENT]
lemma Idl_subset_eq_dvd: "Idl\<^bsub>\<Z>\<^esub> {k} \<subseteq> Idl\<^bsub>\<Z>\<^esub> {l} \<longleftrightarrow> l dvd k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Idl\<^bsub>\<Z>\<^esub> {k} \<subseteq> Idl\<^bsub>\<Z>\<^esub> {l}) = (l dvd k)
[PROOF STEP]
by (subst int_Idl_subset_ideal) (auto simp: dvd_def int_Idl)


[STATEMENT]
lemma convex_closure_inter:
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)"
    and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
  shows "closure (\<Inter>I) = \<Inter>{closure S |S. S \<in> I}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}
[PROOF STEP]
have "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> {closure S |S. S \<in> I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> I})
[PROOF STEP]
using convex_closure_rel_interior_inter assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>S\<in>?I. convex S; \<Inter> {rel_interior S |S. S \<in> ?I} \<noteq> {}\<rbrakk> \<Longrightarrow> \<Inter> {closure S |S. S \<in> ?I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> ?I})
\<forall>S\<in>I. convex S
\<Inter> {rel_interior S |S. S \<in> I} \<noteq> {}

goal (1 subgoal):
 1. \<Inter> {closure S |S. S \<in> I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> I})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Inter> {closure S |S. S \<in> I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> I})

goal (1 subgoal):
 1. closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Inter> {closure S |S. S \<in> I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> I})

goal (1 subgoal):
 1. closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}
[PROOF STEP]
have "closure (\<Inter>{rel_interior S |S. S \<in> I}) \<le> closure (\<Inter>I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (\<Inter> {rel_interior S |S. S \<in> I}) \<subseteq> closure (\<Inter> I)
[PROOF STEP]
using rel_interior_inter_aux closure_mono[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"]
[PROOF STATE]
proof (prove)
using this:
\<Inter> {rel_interior S |S. S \<in> ?I} \<subseteq> \<Inter> ?I
\<Inter> {rel_interior S |S. S \<in> I} \<subseteq> \<Inter> I \<Longrightarrow> closure (\<Inter> {rel_interior S |S. S \<in> I}) \<subseteq> closure (\<Inter> I)

goal (1 subgoal):
 1. closure (\<Inter> {rel_interior S |S. S \<in> I}) \<subseteq> closure (\<Inter> I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closure (\<Inter> {rel_interior S |S. S \<in> I}) \<subseteq> closure (\<Inter> I)

goal (1 subgoal):
 1. closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Inter> {closure S |S. S \<in> I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> I})
closure (\<Inter> {rel_interior S |S. S \<in> I}) \<subseteq> closure (\<Inter> I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Inter> {closure S |S. S \<in> I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> I})
closure (\<Inter> {rel_interior S |S. S \<in> I}) \<subseteq> closure (\<Inter> I)

goal (1 subgoal):
 1. closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}
[PROOF STEP]
using closure_Int[of I]
[PROOF STATE]
proof (prove)
using this:
\<Inter> {closure S |S. S \<in> I} \<subseteq> closure (\<Inter> {rel_interior S |S. S \<in> I})
closure (\<Inter> {rel_interior S |S. S \<in> I}) \<subseteq> closure (\<Inter> I)
closure (\<Inter> I) \<subseteq> \<Inter> {closure S |S. S \<in> I}

goal (1 subgoal):
 1. closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closure (\<Inter> I) = \<Inter> {closure S |S. S \<in> I}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cross_ratio_reciprocal [simp]:
  assumes "u \<noteq> v" and "v \<noteq> w" and "u \<noteq> w"
  shows "cross_ratio (reciprocal z) (reciprocal u) (reciprocal v) (reciprocal w) =
         cross_ratio z u v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_ratio (reciprocal z) (reciprocal u) (reciprocal v) (reciprocal w) = cross_ratio z u v w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
v \<noteq> w
u \<noteq> w

goal (1 subgoal):
 1. cross_ratio (reciprocal z) (reciprocal u) (reciprocal v) (reciprocal w) = cross_ratio z u v w
[PROOF STEP]
by (subst moebius_reciprocal[symmetric])+ (simp del: moebius_reciprocal)


[STATEMENT]
lemma mpl_lem: "j \<le> i \<Longrightarrow> k < j \<Longrightarrow> i - j + k < i"
  for i j k :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j \<le> i; k < j\<rbrakk> \<Longrightarrow> i - j + k < i
[PROOF STEP]
by arith


[STATEMENT]
lemma ordIso_Fpow_cong:
assumes "r =o r'"
shows "|Fpow(Field r)| =o |Fpow(Field r')|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Fpow (Field r)| =o |Fpow (Field r')|
[PROOF STEP]
using assms card_of_cong card_of_Fpow_cong
[PROOF STATE]
proof (prove)
using this:
r =o r'
?r =o ?r' \<Longrightarrow> |Field ?r| =o |Field ?r'|
|?A| =o |?B| \<Longrightarrow> |Fpow ?A| =o |Fpow ?B|

goal (1 subgoal):
 1. |Fpow (Field r)| =o |Fpow (Field r')|
[PROOF STEP]
by blast


[STATEMENT]
lemma bij_betw_set_is_empty:
  assumes "finite A" "finite B"
  assumes "card A \<noteq> card B"
  shows "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} = {}
[PROOF STEP]
using assms bij_betw_same_card
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
card A \<noteq> card B
bij_betw ?f ?A ?B \<Longrightarrow> card ?A = card ?B

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma gfp_loop:
  assumes "finite (UNIV :: 'b set)"
   and "mono (\<tau> :: ('b set \<Rightarrow> 'b set))"
    shows "\<exists> n . gfp \<tau>  = (\<tau> ^^ n)UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. gfp \<tau> = (\<tau> ^^ n) UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. gfp \<tau> = (\<tau> ^^ n) UNIV
[PROOF STEP]
have " \<exists>i. (\<tau> ^^ i)(UNIV :: 'b set) = (\<tau> ^^ (i + (1))) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite UNIV
mono \<tau>

goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
by (rule finite_fixp2)
[PROOF STATE]
proof (state)
this:
\<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV

goal (1 subgoal):
 1. \<exists>n. gfp \<tau> = (\<tau> ^^ n) UNIV
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
obtain i where "(\<tau> ^^ i)UNIV = (\<tau> ^^ (i + (1))) UNIV"
[PROOF STATE]
proof (prove)
using this:
\<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV

goal (1 subgoal):
 1. (\<And>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (erule exE)
[PROOF STATE]
proof (state)
this:
(\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV

goal (1 subgoal):
 1. \<exists>n. gfp \<tau> = (\<tau> ^^ n) UNIV
[PROOF STEP]
thus "\<exists> n . gfp \<tau>  = (\<tau> ^^ n)UNIV"
[PROOF STATE]
proof (prove)
using this:
(\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV

goal (1 subgoal):
 1. \<exists>n. gfp \<tau> = (\<tau> ^^ n) UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
finite UNIV
mono \<tau>

goal (1 subgoal):
 1. \<exists>n. gfp \<tau> = (\<tau> ^^ n) UNIV
[PROOF STEP]
by (metis Suc_eq_plus1 gfp_Kleene_iter)
[PROOF STATE]
proof (state)
this:
\<exists>n. gfp \<tau> = (\<tau> ^^ n) UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_monoid) finprod_finprod_swap:
  "finite A \<Longrightarrow> finite B \<Longrightarrow> (\<And> a b. a \<in> A  \<Longrightarrow> b \<in> B \<Longrightarrow> g a b \<in> carrier G) \<Longrightarrow>
  finprod G (\<lambda> a. finprod G (g a) B) A = finprod G (\<lambda> b. finprod G (\<lambda> a. g a b) A) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; \<And>a b. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> g a b \<in> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>a\<in>A. finprod G (g a) B) = (\<Otimes>b\<in>B. \<Otimes>a\<in>A. g a b)
[PROOF STEP]
using finprod_finprod[of A B] finprod_finprod[of B A] finprod_swap[of A B]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite A; finite B; \<And>a b. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> ?g a b \<in> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>a\<in>A. finprod G (?g a) B) = (\<Otimes>(a, b)\<in>A \<times> B. ?g a b)
\<lbrakk>finite B; finite A; \<And>a b. \<lbrakk>a \<in> B; b \<in> A\<rbrakk> \<Longrightarrow> ?g a b \<in> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>a\<in>B. finprod G (?g a) A) = (\<Otimes>(a, b)\<in>B \<times> A. ?g a b)
\<lbrakk>finite A; finite B; \<And>a b. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> ?g a b \<in> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>(b, a)\<in>B \<times> A. ?g a b) = (\<Otimes>(a, b)\<in>A \<times> B. ?g a b)

goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; \<And>a b. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> g a b \<in> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>a\<in>A. finprod G (g a) B) = (\<Otimes>b\<in>B. \<Otimes>a\<in>A. g a b)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in group) ord_eq_0:
   "x \<in> carrier G \<Longrightarrow> (ord x = 0 \<longleftrightarrow> (\<forall>n::nat. n \<noteq> 0 \<longrightarrow> x [^] n \<noteq> \<one>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> (ord x = 0) = (\<forall>n. n \<noteq> 0 \<longrightarrow> x [^] n \<noteq> \<one>)
[PROOF STEP]
by (auto simp: pow_eq_id)


[STATEMENT]
lemma fls_compose_power_fps_to_fls:
  assumes "d > 0"
  shows   "fls_compose_power (fps_to_fls f) d = fps_to_fls (fps_compose f (fps_X ^ d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_compose_power (fps_to_fls f) d = fps_to_fls (f oo fps_X ^ d)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < d

goal (1 subgoal):
 1. fls_compose_power (fps_to_fls f) d = fps_to_fls (f oo fps_X ^ d)
[PROOF STEP]
by (intro fls_eqI) (auto simp: fls_nth_compose_power fps_nth_compose_X_power
                                 pos_imp_zdiv_neg_iff div_neg_pos_less0 nat_div_distrib
                           simp flip: int_dvd_int_iff)


[STATEMENT]
lemma Sigma_mset_Un_distrib1: "Sigma_mset (I \<union># J) C = Sigma_mset I C \<union># Sigma_mset J C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_mset (I \<union># J) C = Sigma_mset I C \<union># Sigma_mset J C
[PROOF STEP]
by (auto simp add: Sigma_mset_def union_mset_def untion_image_mset_Pair_distribute)


[STATEMENT]
lemma homeomorphism_st_proj1: "homeomorphism (UNIV - {top_sphere}) UNIV st_proj1 st_proj1_inv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism (UNIV - {top_sphere}) UNIV st_proj1 st_proj1_inv
[PROOF STEP]
apply (auto simp: homeomorphism_def st_proj1_continuous st_proj1_inv_continuous st_proj1_inv_inv
      st_proj1_inv st_proj1_inv_ne_top)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> st_proj1 ` (UNIV - {top_sphere})
 2. \<And>x. x \<notin> range st_proj1_inv \<Longrightarrow> x = top_sphere
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> st_proj1 ` (UNIV - {top_sphere})
[PROOF STEP]
by (rule image_eqI[where x="st_proj1_inv x"]) (auto simp: st_proj1_inv_inv st_proj1_inv_ne_top)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<notin> range st_proj1_inv \<Longrightarrow> x = top_sphere
[PROOF STEP]
by (metis rangeI st_proj1_inv)


[STATEMENT]
lemma le_combine_matrix:
  assumes
  "f 0 0 = 0"
  "\<forall>a b c d. a <= b & c <= d \<longrightarrow> f a c <= f b d"
  "A <= B"
  "C <= D"
  shows
  "combine_matrix f A C <= combine_matrix f B D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. combine_matrix f A C \<le> combine_matrix f B D
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f (0::'b) (0::'c) = (0::'a)
\<forall>a b c d. a \<le> b \<and> c \<le> d \<longrightarrow> f a c \<le> f b d
A \<le> B
C \<le> D

goal (1 subgoal):
 1. combine_matrix f A C \<le> combine_matrix f B D
[PROOF STEP]
by (simp add: le_matrix_def)


[STATEMENT]
lemma differentiable_on_mult [simp, derivative_intros]:
  fixes f :: "'M::real_normed_vector \<Rightarrow> 'a::real_normed_algebra"
  shows "\<lbrakk>f differentiable_on S; g differentiable_on S\<rbrakk> \<Longrightarrow> (\<lambda>z. f z * g z) differentiable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f differentiable_on S; g differentiable_on S\<rbrakk> \<Longrightarrow> (\<lambda>z. f z * g z) differentiable_on S
[PROOF STEP]
unfolding differentiable_on_def differentiable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>S. \<exists>D. (f has_derivative D) (at x within S); \<forall>x\<in>S. \<exists>D. (g has_derivative D) (at x within S)\<rbrakk> \<Longrightarrow> \<forall>x\<in>S. \<exists>D. ((\<lambda>z. f z * g z) has_derivative D) (at x within S)
[PROOF STEP]
using differentiable_def differentiable_mult
[PROOF STATE]
proof (prove)
using this:
(?f differentiable ?F) = (\<exists>D. (?f has_derivative D) ?F)
\<lbrakk>?f differentiable at ?x within ?s; ?g differentiable at ?x within ?s\<rbrakk> \<Longrightarrow> (\<lambda>x. ?f x * ?g x) differentiable at ?x within ?s

goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>S. \<exists>D. (f has_derivative D) (at x within S); \<forall>x\<in>S. \<exists>D. (g has_derivative D) (at x within S)\<rbrakk> \<Longrightarrow> \<forall>x\<in>S. \<exists>D. ((\<lambda>z. f z * g z) has_derivative D) (at x within S)
[PROOF STEP]
by blast


[STATEMENT]
lemma Log_nat_power:
  assumes "0 < x"
  and "1 < b" and "b \<noteq> 1"
  shows " Log b (x ^ n) = real n * Log b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Log b (x ^ n) = real n * Log b x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Log b (x ^ n) = real n * Log b x
[PROOF STEP]
have "Log b (x pow\<^sub>\<real> real n) = real n * Log b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> real n) = real n * Log b x
[PROOF STEP]
by (simp add: Log_powreal assms)
[PROOF STATE]
proof (state)
this:
Log b (x pow\<^sub>\<real> real n) = real n * Log b x

goal (1 subgoal):
 1. Log b (x ^ n) = real n * Log b x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Log b (x pow\<^sub>\<real> real n) = real n * Log b x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Log b (x pow\<^sub>\<real> real n) = real n * Log b x

goal (1 subgoal):
 1. Log b (x ^ n) = real n * Log b x
[PROOF STEP]
by (simp add: assms(1) powreal_power_eq)
[PROOF STATE]
proof (state)
this:
Log b (x ^ n) = real n * Log b x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_rsplit_rcat [rule_format]:
  "n > 0 \<longrightarrow> bin_rsplit n (n * size ws, bin_rcat n ws) = map ((take_bit :: nat \<Rightarrow> int \<Rightarrow> int) n) ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<longrightarrow> bin_rsplit n (n * length ws, bin_rcat n ws) = map (take_bit n) ws
[PROOF STEP]
apply (unfold bin_rsplit_def bin_rcat_eq_foldl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<longrightarrow> bin_rsplit_aux n (fst (n * length ws, foldl (\<lambda>u v. concat_bit n v u) 0 ws)) (snd (n * length ws, foldl (\<lambda>u v. concat_bit n v u) 0 ws)) [] = map (take_bit n) ws
[PROOF STEP]
apply (rule_tac xs = ws in rev_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < n \<longrightarrow> bin_rsplit_aux n (fst (n * length [], foldl (\<lambda>u v. concat_bit n v u) 0 [])) (snd (n * length [], foldl (\<lambda>u v. concat_bit n v u) 0 [])) [] = map (take_bit n) []
 2. \<And>x xs. 0 < n \<longrightarrow> bin_rsplit_aux n (fst (n * length xs, foldl (\<lambda>u v. concat_bit n v u) 0 xs)) (snd (n * length xs, foldl (\<lambda>u v. concat_bit n v u) 0 xs)) [] = map (take_bit n) xs \<Longrightarrow> 0 < n \<longrightarrow> bin_rsplit_aux n (fst (n * length (xs @ [x]), foldl (\<lambda>u v. concat_bit n v u) 0 (xs @ [x]))) (snd (n * length (xs @ [x]), foldl (\<lambda>u v. concat_bit n v u) 0 (xs @ [x]))) [] = map (take_bit n) (xs @ [x])
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. 0 < n \<longrightarrow> bin_rsplit_aux n (fst (n * length xs, foldl (\<lambda>u v. concat_bit n v u) 0 xs)) (snd (n * length xs, foldl (\<lambda>u v. concat_bit n v u) 0 xs)) [] = map (take_bit n) xs \<Longrightarrow> 0 < n \<longrightarrow> bin_rsplit_aux n (fst (n * length (xs @ [x]), foldl (\<lambda>u v. concat_bit n v u) 0 (xs @ [x]))) (snd (n * length (xs @ [x]), foldl (\<lambda>u v. concat_bit n v u) 0 (xs @ [x]))) [] = map (take_bit n) (xs @ [x])
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>0 < n; bin_rsplit_aux n (n * length xs) (foldl (\<lambda>u v. concat_bit n v u) 0 xs) [] = map (take_bit n) xs\<rbrakk> \<Longrightarrow> bin_rsplit_aux n (n * length xs) (drop_bit n (concat_bit n x (foldl (\<lambda>u v. concat_bit n v u) 0 xs))) [take_bit n x] = map (take_bit n) xs @ [take_bit n x]
[PROOF STEP]
apply (subst rsplit_aux_alts)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>0 < n; bin_rsplit_aux n (n * length xs) (foldl (\<lambda>u v. concat_bit n v u) 0 xs) [] = map (take_bit n) xs\<rbrakk> \<Longrightarrow> bin_rsplit_aux n (n * length xs) (drop_bit n (concat_bit n x (foldl (\<lambda>u v. concat_bit n v u) 0 xs))) [] @ [take_bit n x] = map (take_bit n) xs @ [take_bit n x]
[PROOF STEP]
apply (simp add: drop_bit_bin_cat_eq take_bit_bin_cat_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dist_eq_dist_code_abs_lt:
  fixes p\<^sub>0 :: point
  shows "\<bar>c\<bar> < dist p\<^sub>0 p\<^sub>1 \<longleftrightarrow> c\<^sup>2 < dist_code p\<^sub>0 p\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>real_of_int c\<bar> < dist (case p\<^sub>0 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case p\<^sub>1 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y))) = (c\<^sup>2 < dist_code p\<^sub>0 p\<^sub>1)
[PROOF STEP]
using dist_eq_sqrt_dist_code
[PROOF STATE]
proof (prove)
using this:
dist (case ?p\<^sub>0 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case ?p\<^sub>1 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt (real_of_int (dist_code ?p\<^sub>0 ?p\<^sub>1))

goal (1 subgoal):
 1. (\<bar>real_of_int c\<bar> < dist (case p\<^sub>0 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case p\<^sub>1 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y))) = (c\<^sup>2 < dist_code p\<^sub>0 p\<^sub>1)
[PROOF STEP]
by (metis of_int_less_of_int_power_cancel_iff real_sqrt_abs real_sqrt_less_iff)


[STATEMENT]
lemma "w\<^sup>2 + x\<^sup>2 + y\<^sup>2 + z\<^sup>2 = 1 \<longrightarrow> (w + x + y + z)\<^sup>2 \<le> (4::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w\<^sup>2 + x\<^sup>2 + y\<^sup>2 + z\<^sup>2 = 1 \<longrightarrow> (w + x + y + z)\<^sup>2 \<le> 4
[PROOF STEP]
by sos