[STATEMENT]
lemma Fourier_sum_0_integral:
  assumes "f absolutely_integrable_on {-pi..pi}"
  shows "(\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) =
       integral\<^sup>L (lebesgue_on {-pi..pi}) (\<lambda>x. (1/2 + (\<Sum>k = Suc 0..n div 2. cos(k * x))) * f x) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
note * = Fourier_products_integrable_cos [OF assms]
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (?k * x) * f x)

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
have "integrable (lebesgue_on {-pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (?k * x) * f x)

goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))
[PROOF STEP]
by (force simp: mult_ac)
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
have "integral\<^sup>L (lebesgue_on {-pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {-pi..pi}. f x * cos (x * real k))
               = (LINT x|lebesgue_on {-pi..pi}. f x / 2) + (LINT x|lebesgue_on {-pi..pi}. (\<Sum>n = Suc 0..n div 2. f x * cos (x * real n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {- pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real k)) = (LINT x|lebesgue_on {- pi..pi}. f x / 2) + (LINT x|lebesgue_on {- pi..pi}. (\<Sum>n = Suc 0..n div 2. f x * cos (x * real n)))
[PROOF STEP]
proof (subst Bochner_Integration.integral_sum)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> {Suc 0..n div 2} \<Longrightarrow> integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * cos (x * real i))
 2. integral\<^sup>L (lebesgue_on {- pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real k)) = (LINT x|lebesgue_on {- pi..pi}. f x / 2) + (\<Sum>i = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real i))
[PROOF STEP]
show "integrable (lebesgue_on {-pi..pi}) (\<lambda>x. f x * cos (x * real i))"
      if "i \<in> {Suc 0..n div 2}" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * cos (x * real i))
[PROOF STEP]
using that * [of i]
[PROOF STATE]
proof (prove)
using this:
i \<in> {Suc 0..n div 2}
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real i * x) * f x)

goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * cos (x * real i))
[PROOF STEP]
by (auto simp: Bochner_Integration.integral_sum mult_ac)
[PROOF STATE]
proof (state)
this:
?i \<in> {Suc 0..n div 2} \<Longrightarrow> integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * cos (x * real ?i))

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {- pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real k)) = (LINT x|lebesgue_on {- pi..pi}. f x / 2) + (\<Sum>i = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real i))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
integral\<^sup>L (lebesgue_on {- pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real k)) = (LINT x|lebesgue_on {- pi..pi}. f x / 2) + (LINT x|lebesgue_on {- pi..pi}. (\<Sum>n = Suc 0..n div 2. f x * cos (x * real n)))

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))
integral\<^sup>L (lebesgue_on {- pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real k)) = (LINT x|lebesgue_on {- pi..pi}. f x / 2) + (LINT x|lebesgue_on {- pi..pi}. (\<Sum>n = Suc 0..n div 2. f x * cos (x * real n)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))
integral\<^sup>L (lebesgue_on {- pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real k)) = (LINT x|lebesgue_on {- pi..pi}. f x / 2) + (LINT x|lebesgue_on {- pi..pi}. (\<Sum>n = Suc 0..n div 2. f x * cos (x * real n)))

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
using Fourier_products_integrable_cos [OF assms] absolutely_integrable_imp_integrable [OF assms]
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. \<Sum>n = Suc 0..n div 2. f x * cos (x * real n))
integral\<^sup>L (lebesgue_on {- pi..pi}) f / 2 + (\<Sum>k = Suc 0..n div 2. LINT x|lebesgue_on {- pi..pi}. f x * cos (x * real k)) = (LINT x|lebesgue_on {- pi..pi}. f x / 2) + (LINT x|lebesgue_on {- pi..pi}. (\<Sum>n = Suc 0..n div 2. f x * cos (x * real n)))
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (?k * x) * f x)
{- pi..pi} \<in> sets lebesgue \<Longrightarrow> integrable (lebesgue_on {- pi..pi}) f

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi
[PROOF STEP]
by (simp add: Fourier_sum_0_integrals sum_distrib_left assms algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (LINT x|lebesgue_on {- pi..pi}. (1 / 2 + (\<Sum>k = Suc 0..n div 2. cos (real k * x))) * f x) / pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma double_add_le_zero_iff_single_add_le_zero [simp]: "a + a \<le> 0 \<longleftrightarrow> a \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + a \<le> (0::'a)) = (a \<le> (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a + a \<le> (0::'a)) = (a \<le> (0::'a))
[PROOF STEP]
have "a + a \<le> 0 \<longleftrightarrow> 0 \<le> - (a + a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + a \<le> (0::'a)) = ((0::'a) \<le> - (a + a))
[PROOF STEP]
by (subst le_minus_iff) simp
[PROOF STATE]
proof (state)
this:
(a + a \<le> (0::'a)) = ((0::'a) \<le> - (a + a))

goal (1 subgoal):
 1. (a + a \<le> (0::'a)) = (a \<le> (0::'a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a + a \<le> (0::'a)) = ((0::'a) \<le> - (a + a))

goal (1 subgoal):
 1. (a + a \<le> (0::'a)) = (a \<le> (0::'a))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> a \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) \<le> - (a + a)) = (a \<le> (0::'a))
[PROOF STEP]
by (simp only: minus_add_distrib zero_le_double_add_iff_zero_le_single_add) simp
[PROOF STATE]
proof (state)
this:
((0::'a) \<le> - (a + a)) = (a \<le> (0::'a))

goal (1 subgoal):
 1. (a + a \<le> (0::'a)) = (a \<le> (0::'a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a + a \<le> (0::'a)) = ((0::'a) \<le> - (a + a))
((0::'a) \<le> - (a + a)) = (a \<le> (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a + a \<le> (0::'a)) = ((0::'a) \<le> - (a + a))
((0::'a) \<le> - (a + a)) = (a \<le> (0::'a))

goal (1 subgoal):
 1. (a + a \<le> (0::'a)) = (a \<le> (0::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(a + a \<le> (0::'a)) = (a \<le> (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma space_as_set_inf[simp]: "space_as_set (A \<sqinter> B) = space_as_set A \<inter> space_as_set B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space_as_set (A \<sqinter> B) = space_as_set A \<inter> space_as_set B
[PROOF STEP]
by (rule inf_ccsubspace.rep_eq)


[STATEMENT]
lemma ex_eqL:
  assumes "QCong l1" and
    "QCong l2" and
    "\<exists> A B. (l1 A B \<and> l2 A B)"
  shows "l1 = l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l1 = l2
[PROOF STEP]
using TarskiLen_def all_eql assms(1) assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
TarskiLen ?A ?B ?l \<equiv> QCong ?l \<and> ?l ?A ?B
\<lbrakk>TarskiLen ?A ?B ?l1.0; TarskiLen ?A ?B ?l2.0\<rbrakk> \<Longrightarrow> ?l1.0 = ?l2.0
QCong l1
QCong l2
\<exists>A B. l1 A B \<and> l2 A B

goal (1 subgoal):
 1. l1 = l2
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_polysub:
  fixes p::"'a::ring_1 poly"
  assumes np: "isnpolyh p n0"
    and nq: "isnpolyh q n1"
  shows "degree (p -\<^sub>p q) \<le> max (degree p) (degree q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial_Expression.degree (p -\<^sub>p q) \<le> max (Polynomial_Expression.degree p) (Polynomial_Expression.degree q)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Polynomial_Expression.degree (p -\<^sub>p q) \<le> max (Polynomial_Expression.degree p) (Polynomial_Expression.degree q)
[PROOF STEP]
from polyneg_normh[OF nq]
[PROOF STATE]
proof (chain)
picking this:
isnpolyh (~\<^sub>p q) n1
[PROOF STEP]
have nq': "isnpolyh (~\<^sub>p q) n1"
[PROOF STATE]
proof (prove)
using this:
isnpolyh (~\<^sub>p q) n1

goal (1 subgoal):
 1. isnpolyh (~\<^sub>p q) n1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
isnpolyh (~\<^sub>p q) n1

goal (1 subgoal):
 1. Polynomial_Expression.degree (p -\<^sub>p q) \<le> max (Polynomial_Expression.degree p) (Polynomial_Expression.degree q)
[PROOF STEP]
from degree_polyadd[OF np nq']
[PROOF STATE]
proof (chain)
picking this:
Polynomial_Expression.degree (p +\<^sub>p ~\<^sub>p q) \<le> max (Polynomial_Expression.degree p) (Polynomial_Expression.degree (~\<^sub>p q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Polynomial_Expression.degree (p +\<^sub>p ~\<^sub>p q) \<le> max (Polynomial_Expression.degree p) (Polynomial_Expression.degree (~\<^sub>p q))

goal (1 subgoal):
 1. Polynomial_Expression.degree (p -\<^sub>p q) \<le> max (Polynomial_Expression.degree p) (Polynomial_Expression.degree q)
[PROOF STEP]
by (simp add: polysub_def degree_polyneg[OF nq])
[PROOF STATE]
proof (state)
this:
Polynomial_Expression.degree (p -\<^sub>p q) \<le> max (Polynomial_Expression.degree p) (Polynomial_Expression.degree q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fcard_fminus1_less: "x |\<in>| A \<Longrightarrow> fcard (A |-| {|x|}) < fcard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x |\<in>| A \<Longrightarrow> fcard (A |-| {|x|}) < fcard A
[PROOF STEP]
by transfer (rule card_Diff1_less)


[STATEMENT]
lemma bigo_LIMSEQ2: "f =o g +o O(h) \<Longrightarrow> h \<longlonglongrightarrow> 0 \<Longrightarrow> f \<longlonglongrightarrow> a \<Longrightarrow> g \<longlonglongrightarrow> a"
  for f g h :: "nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> g +o O(h); h \<longlonglongrightarrow> 0; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> g \<longlonglongrightarrow> a
[PROOF STEP]
apply (drule set_plus_imp_minus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<longlonglongrightarrow> 0; f \<longlonglongrightarrow> a; f - g \<in> O(h)\<rbrakk> \<Longrightarrow> g \<longlonglongrightarrow> a
[PROOF STEP]
apply (drule bigo_LIMSEQ1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>h \<longlonglongrightarrow> 0; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> h \<longlonglongrightarrow> 0
 2. \<lbrakk>h \<longlonglongrightarrow> 0; f \<longlonglongrightarrow> a; f - g \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> g \<longlonglongrightarrow> a
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<longlonglongrightarrow> 0; f \<longlonglongrightarrow> a; f - g \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> g \<longlonglongrightarrow> a
[PROOF STEP]
apply (simp only: fun_diff_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<longlonglongrightarrow> 0; f \<longlonglongrightarrow> a; (\<lambda>x. f x - g x) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> g \<longlonglongrightarrow> a
[PROOF STEP]
apply (erule Lim_transform2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<longlonglongrightarrow> 0; (\<lambda>x. f x - g x) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> (\<lambda>x. f x - g x) \<longlonglongrightarrow> 0
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma preorder_bt_map: "preorder (bt_map f t) = map f (preorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preorder (bt_map f t) = map f (preorder t)
[PROOF STEP]
apply (induct t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. preorder (bt_map f Lf) = map f (preorder Lf)
 2. \<And>x1 t1 t2. \<lbrakk>preorder (bt_map f t1) = map f (preorder t1); preorder (bt_map f t2) = map f (preorder t2)\<rbrakk> \<Longrightarrow> preorder (bt_map f (Br x1 t1 t2)) = map f (preorder (Br x1 t1 t2))
[PROOF STEP]
apply (metis bt_map.simps(1) list.map(1) preorder.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>preorder (bt_map f t1) = map f (preorder t1); preorder (bt_map f t2) = map f (preorder t2)\<rbrakk> \<Longrightarrow> preorder (bt_map f (Br x1 t1 t2)) = map f (preorder (Br x1 t1 t2))
[PROOF STEP]
by simp


[STATEMENT]
lemma LIMSEQ_prod_0:
  fixes f :: "nat \<Rightarrow> 'a::{semidom,topological_space}"
  assumes "f i = 0"
  shows "(\<lambda>n. prod f {..n}) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. prod f {..n}) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
proof (subst tendsto_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in sequentially. prod f {..x} = ?g x
 2. ?g \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
show "\<forall>\<^sub>F n in sequentially. prod f {..n} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. prod f {..n} = (0::'a)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> prod f {..x} = (0::'a)
[PROOF STEP]
show "prod f {..n} = 0" if "n \<ge> i" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f {..n} = (0::'a)
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
i \<le> n
f i = (0::'a)

goal (1 subgoal):
 1. prod f {..n} = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<le> ?n \<Longrightarrow> prod f {..?n} = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. prod f {..n} = (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. 0::'a) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
qed auto


[STATEMENT]
lemma combine_add:
  assumes "length Ks = length Us" and "length Ks' = length Us"
    and "set Ks  \<subseteq> carrier R" "set Ks'  \<subseteq> carrier R" "set Us \<subseteq> carrier R"
  shows "(combine Ks Us) \<oplus> (combine Ks' Us) = combine (map2 (\<oplus>) Ks Ks') Us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length Ks = length Us
length Ks' = length Us
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us
[PROOF STEP]
proof (induct Us arbitrary: Ks Ks')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>Ks Ks'. \<lbrakk>length Ks = length []; length Ks' = length []; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set [] \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks [] \<oplus> combine Ks' [] = combine (map2 (\<oplus>) Ks Ks') []
 2. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
length Ks = length []
length Ks' = length []
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set [] \<subseteq> carrier R

goal (2 subgoals):
 1. \<And>Ks Ks'. \<lbrakk>length Ks = length []; length Ks' = length []; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set [] \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks [] \<oplus> combine Ks' [] = combine (map2 (\<oplus>) Ks Ks') []
 2. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length Ks = length []
length Ks' = length []
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set [] \<subseteq> carrier R

goal (1 subgoal):
 1. combine Ks [] \<oplus> combine Ks' [] = combine (map2 (\<oplus>) Ks Ks') []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
combine Ks [] \<oplus> combine Ks' [] = combine (map2 (\<oplus>) Ks Ks') []

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
case (Cons u Us)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length ?Ks = length Us; length ?Ks' = length Us; set ?Ks \<subseteq> carrier R; set ?Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ?Ks Us \<oplus> combine ?Ks' Us = combine (map2 (\<oplus>) ?Ks ?Ks') Us
length Ks = length (u # Us)
length Ks' = length (u # Us)
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length ?Ks = length Us; length ?Ks' = length Us; set ?Ks \<subseteq> carrier R; set ?Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ?Ks Us \<oplus> combine ?Ks' Us = combine (map2 (\<oplus>) ?Ks ?Ks') Us
length Ks = length (u # Us)
length Ks' = length (u # Us)
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R
[PROOF STEP]
obtain c c' Cs Cs' where Ks: "Ks = c # Cs" and Ks': "Ks' = c' # Cs'"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?Ks = length Us; length ?Ks' = length Us; set ?Ks \<subseteq> carrier R; set ?Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ?Ks Us \<oplus> combine ?Ks' Us = combine (map2 (\<oplus>) ?Ks ?Ks') Us
length Ks = length (u # Us)
length Ks' = length (u # Us)
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R

goal (1 subgoal):
 1. (\<And>c Cs c' Cs'. \<lbrakk>Ks = c # Cs; Ks' = c' # Cs'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis length_Suc_conv)
[PROOF STATE]
proof (state)
this:
Ks = c # Cs
Ks' = c' # Cs'

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
hence in_carrier:
    "c  \<in> carrier R" "set Cs  \<subseteq> carrier R"
    "c' \<in> carrier R" "set Cs' \<subseteq> carrier R"
    "u  \<in> carrier R" "set Us  \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
using this:
Ks = c # Cs
Ks' = c' # Cs'

goal (1 subgoal):
 1. (c \<in> carrier R &&& set Cs \<subseteq> carrier R &&& c' \<in> carrier R) &&& set Cs' \<subseteq> carrier R &&& u \<in> carrier R &&& set Us \<subseteq> carrier R
[PROOF STEP]
using Cons(4-6)
[PROOF STATE]
proof (prove)
using this:
Ks = c # Cs
Ks' = c' # Cs'
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R

goal (1 subgoal):
 1. (c \<in> carrier R &&& set Cs \<subseteq> carrier R &&& c' \<in> carrier R) &&& set Cs' \<subseteq> carrier R &&& u \<in> carrier R &&& set Us \<subseteq> carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<in> carrier R
set Cs \<subseteq> carrier R
c' \<in> carrier R
set Cs' \<subseteq> carrier R
u \<in> carrier R
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
hence lc_in_carrier: "combine Cs Us \<in> carrier R" "combine Cs' Us \<in> carrier R"
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier R
set Cs \<subseteq> carrier R
c' \<in> carrier R
set Cs' \<subseteq> carrier R
u \<in> carrier R
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. combine Cs Us \<in> carrier R &&& combine Cs' Us \<in> carrier R
[PROOF STEP]
using combine_in_carrier
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier R
set Cs \<subseteq> carrier R
c' \<in> carrier R
set Cs' \<subseteq> carrier R
u \<in> carrier R
set Us \<subseteq> carrier R
\<lbrakk>set ?Ks \<subseteq> carrier R; set ?Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ?Ks ?Us \<in> carrier R

goal (1 subgoal):
 1. combine Cs Us \<in> carrier R &&& combine Cs' Us \<in> carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
combine Cs Us \<in> carrier R
combine Cs' Us \<in> carrier R

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
have "combine Ks (u # Us) \<oplus> combine Ks' (u # Us) =
        ((c \<otimes> u) \<oplus> combine Cs Us) \<oplus> ((c' \<otimes> u) \<oplus> combine Cs' Us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. combine Ks (u # Us) \<oplus> combine Ks' (u # Us) = c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us)
[PROOF STEP]
unfolding Ks Ks'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. combine (c # Cs) (u # Us) \<oplus> combine (c' # Cs') (u # Us) = c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
combine Ks (u # Us) \<oplus> combine Ks' (u # Us) = c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us)

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
combine Ks (u # Us) \<oplus> combine Ks' (u # Us) = c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us)

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
have " ... = ((c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us) = (c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us)
[PROOF STEP]
using lc_in_carrier in_carrier(1,3,5)
[PROOF STATE]
proof (prove)
using this:
combine Cs Us \<in> carrier R
combine Cs' Us \<in> carrier R
c \<in> carrier R
c' \<in> carrier R
u \<in> carrier R

goal (1 subgoal):
 1. c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us) = (c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us)
[PROOF STEP]
by (simp add: l_distr ring_simprules(7,22))
[PROOF STATE]
proof (state)
this:
c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us) = (c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us)

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c \<otimes> u \<oplus> combine Cs Us \<oplus> (c' \<otimes> u \<oplus> combine Cs' Us) = (c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us)

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
have " ... = combine (map2 (\<oplus>) Ks Ks') (u # Us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us) = combine (map2 (\<oplus>) Ks Ks') (u # Us)
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?Ks = length Us; length ?Ks' = length Us; set ?Ks \<subseteq> carrier R; set ?Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ?Ks Us \<oplus> combine ?Ks' Us = combine (map2 (\<oplus>) ?Ks ?Ks') Us
length Ks = length (u # Us)
length Ks' = length (u # Us)
set Ks \<subseteq> carrier R
set Ks' \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R

goal (1 subgoal):
 1. (c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us) = combine (map2 (\<oplus>) Ks Ks') (u # Us)
[PROOF STEP]
unfolding Ks Ks'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?Ks = length Us; length ?Ks' = length Us; set ?Ks \<subseteq> carrier R; set ?Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ?Ks Us \<oplus> combine ?Ks' Us = combine (map2 (\<oplus>) ?Ks ?Ks') Us
length (c # Cs) = length (u # Us)
length (c' # Cs') = length (u # Us)
set (c # Cs) \<subseteq> carrier R
set (c' # Cs') \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R

goal (1 subgoal):
 1. (c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us) = combine (map2 (\<oplus>) (c # Cs) (c' # Cs')) (u # Us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c \<oplus> c') \<otimes> u \<oplus> (combine Cs Us \<oplus> combine Cs' Us) = combine (map2 (\<oplus>) Ks Ks') (u # Us)

goal (1 subgoal):
 1. \<And>a Us Ks Ks'. \<lbrakk>\<And>Ks Ks'. \<lbrakk>length Ks = length Us; length Ks' = length Us; set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<oplus> combine Ks' Us = combine (map2 (\<oplus>) Ks Ks') Us; length Ks = length (a # Us); length Ks' = length (a # Us); set Ks \<subseteq> carrier R; set Ks' \<subseteq> carrier R; set (a # Us) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks (a # Us) \<oplus> combine Ks' (a # Us) = combine (map2 (\<oplus>) Ks Ks') (a # Us)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
combine Ks (u # Us) \<oplus> combine Ks' (u # Us) = combine (map2 (\<oplus>) Ks Ks') (u # Us)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
combine Ks (u # Us) \<oplus> combine Ks' (u # Us) = combine (map2 (\<oplus>) Ks Ks') (u # Us)

goal (1 subgoal):
 1. combine Ks (u # Us) \<oplus> combine Ks' (u # Us) = combine (map2 (\<oplus>) Ks Ks') (u # Us)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
combine Ks (u # Us) \<oplus> combine Ks' (u # Us) = combine (map2 (\<oplus>) Ks Ks') (u # Us)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aff_dim_open:
  fixes S :: "'n::euclidean_space set"
  assumes "open S"
    and "S \<noteq> {}"
  shows "aff_dim S = int (DIM('n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = int DIM('n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim S = int DIM('n)
[PROOF STEP]
obtain x where "x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
open S
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. aff_dim S = int DIM('n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
obtain e where e: "e > 0" "cball x e \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; cball x e \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using open_contains_cball[of S] assms
[PROOF STATE]
proof (prove)
using this:
x \<in> S
open S = (\<forall>x\<in>S. \<exists>e>0. cball x e \<subseteq> S)
open S
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; cball x e \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e
cball x e \<subseteq> S

goal (1 subgoal):
 1. aff_dim S = int DIM('n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
cball x e \<subseteq> S
[PROOF STEP]
have "aff_dim (cball x e) \<le> aff_dim S"
[PROOF STATE]
proof (prove)
using this:
0 < e
cball x e \<subseteq> S

goal (1 subgoal):
 1. aff_dim (cball x e) \<le> aff_dim S
[PROOF STEP]
using aff_dim_subset
[PROOF STATE]
proof (prove)
using this:
0 < e
cball x e \<subseteq> S
?S \<subseteq> ?T \<Longrightarrow> aff_dim ?S \<le> aff_dim ?T

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

goal (1 subgoal):
 1. aff_dim S = int DIM('n)
[PROOF STEP]
with e
[PROOF STATE]
proof (chain)
picking this:
0 < e
cball x e \<subseteq> S
aff_dim (cball x e) \<le> aff_dim S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < e
cball x e \<subseteq> S
aff_dim (cball x e) \<le> aff_dim S

goal (1 subgoal):
 1. aff_dim S = int DIM('n)
[PROOF STEP]
using aff_dim_cball[of e x] aff_dim_le_DIM[of S]
[PROOF STATE]
proof (prove)
using this:
0 < e
cball x e \<subseteq> S
aff_dim (cball x e) \<le> aff_dim S
0 < e \<Longrightarrow> aff_dim (cball x e) = int DIM('n)
aff_dim S \<le> int DIM('n)

goal (1 subgoal):
 1. aff_dim S = int DIM('n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim S = int DIM('n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nfv_And_Not[simp]: "nfv (And_Not \<phi> \<psi>) = max (nfv \<phi>) (nfv \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfv (And_Not \<phi> \<psi>) = max (nfv \<phi>) (nfv \<psi>)
[PROOF STEP]
unfolding nfv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (insert 0 (Suc ` fv (And_Not \<phi> \<psi>))) = max (Max (insert 0 (Suc ` fv \<phi>))) (Max (insert 0 (Suc ` fv \<psi>)))
[PROOF STEP]
by (simp add: fvi_And_Not image_Un Max_Un[symmetric])


[STATEMENT]
lemma borel_measurable_indicator:
  assumes A: "A \<in> sets M"
  shows "indicator A \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator A \<in> borel_measurable M
[PROOF STEP]
unfolding indicator_def [abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. of_bool (x \<in> A)) \<in> borel_measurable M
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> sets M

goal (1 subgoal):
 1. (\<lambda>x. of_bool (x \<in> A)) \<in> borel_measurable M
[PROOF STEP]
by (auto intro!: measurable_If_set)


[STATEMENT]
lemma polyadd_eq_const_degree:
  "isnpolyh p n0 \<Longrightarrow> isnpolyh q n1 \<Longrightarrow> polyadd p q = C c \<Longrightarrow> degree p = degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isnpolyh p n0; isnpolyh q n1; p +\<^sub>p q = (c)\<^sub>p\<rbrakk> \<Longrightarrow> Polynomial_Expression.degree p = Polynomial_Expression.degree q
[PROOF STEP]
using polyadd_eq_const_degreen
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>isnpolyh ?p ?n0.0; isnpolyh ?q ?n1.0; ?p +\<^sub>p ?q = (?c)\<^sub>p\<rbrakk> \<Longrightarrow> degreen ?p ?m = degreen ?q ?m

goal (1 subgoal):
 1. \<lbrakk>isnpolyh p n0; isnpolyh q n1; p +\<^sub>p q = (c)\<^sub>p\<rbrakk> \<Longrightarrow> Polynomial_Expression.degree p = Polynomial_Expression.degree q
[PROOF STEP]
by (simp add: degree_eq_degreen0)


[STATEMENT]
lemma summable_comparison_test_ev:
  "eventually (\<lambda>n. norm (f n) \<le> g n) sequentially \<Longrightarrow> summable g \<Longrightarrow> summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<^sub>F n in sequentially. norm (f n) \<le> g n; summable g\<rbrakk> \<Longrightarrow> summable f
[PROOF STEP]
by (rule summable_comparison_test) (auto simp: eventually_at_top_linorder)


[STATEMENT]
lemma bijective_open_imp_homeomorphic_map:
   "\<lbrakk>continuous_map X Y f; open_map X Y f; f ` (topspace X) = topspace Y; inj_on f (topspace X)\<rbrakk>
        \<Longrightarrow> homeomorphic_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; open_map X Y f; f ` topspace X = topspace Y; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> homeomorphic_map X Y f
[PROOF STEP]
by (simp add: homeomorphic_map_def continuous_open_imp_quotient_map)


[STATEMENT]
lemma integral_less:
  fixes f :: "'n::euclidean_space \<Rightarrow> real"
  assumes cont: "continuous_on (cbox a b) f" "continuous_on (cbox a b) g" and "box a b \<noteq> {}"
    and fg: "\<And>x. x \<in> box a b \<Longrightarrow> f x < g x"
  shows "integral (cbox a b) f < integral (cbox a b) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
obtain int: "f integrable_on (cbox a b)" "g integrable_on (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>f integrable_on cbox a b; g integrable_on cbox a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using cont integrable_continuous
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) f
continuous_on (cbox a b) g
continuous_on (cbox ?a ?b) ?f \<Longrightarrow> ?f integrable_on cbox ?a ?b

goal (1 subgoal):
 1. (\<lbrakk>f integrable_on cbox a b; g integrable_on cbox a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f integrable_on cbox a b
g integrable_on cbox a b

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f integrable_on cbox a b
g integrable_on cbox a b
[PROOF STEP]
have "integral (cbox a b) f \<le> integral (cbox a b) g"
[PROOF STATE]
proof (prove)
using this:
f integrable_on cbox a b
g integrable_on cbox a b

goal (1 subgoal):
 1. integral (cbox a b) f \<le> integral (cbox a b) g
[PROOF STEP]
by (metis fg integrable_on_open_interval integral_le integral_open_interval less_eq_real_def)
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f \<le> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f \<le> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
have "integral (cbox a b) f \<noteq> integral (cbox a b) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox a b) f \<noteq> integral (cbox a b) g
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
assume "\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g"
[PROOF STATE]
proof (state)
this:
\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g
[PROOF STEP]
have 0: "((\<lambda>x. g x - f x) has_integral 0) (cbox a b)"
[PROOF STATE]
proof (prove)
using this:
\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. ((\<lambda>x. g x - f x) has_integral 0) (cbox a b)
[PROOF STEP]
by (metis (full_types) cancel_comm_monoid_add_class.diff_cancel has_integral_diff int integrable_integral)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. g x - f x) has_integral 0) (cbox a b)

goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
have cgf: "continuous_on (cbox a b) (\<lambda>x. g x - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. g x - f x)
[PROOF STEP]
using cont continuous_on_diff
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) f
continuous_on (cbox a b) g
\<lbrakk>continuous_on ?s ?f; continuous_on ?s ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (\<lambda>x. ?f x - ?g x)

goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. g x - f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. g x - f x)

goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using has_integral_0_cbox_imp_0 [OF cgf _ 0] assms(3) box_subset_cbox fg less_eq_real_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> box a b \<Longrightarrow> 0 \<le> g x - f x; box a b \<noteq> {}; ?x \<in> cbox a b\<rbrakk> \<Longrightarrow> g ?x - f ?x = 0
box a b \<noteq> {}
box ?a ?b \<subseteq> cbox ?a ?b
?x \<in> box a b \<Longrightarrow> f ?x < g ?x
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integral (cbox a b) f \<le> integral (cbox a b) g
integral (cbox a b) f \<noteq> integral (cbox a b) g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral (cbox a b) f \<le> integral (cbox a b) g
integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f < integral (cbox a b) g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dghm_cn_cov_comp_ObjMap_vdomain[dg_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>D\<^sub>G\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<D>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<GG> : op_dg \<BB> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<CC>
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
by
    (
      cs_concl
        cs_simp: dghm_cn_comp_components dg_cs_simps dg_op_simps V_cs_simps
        cs_intro: is_dghm.dghm_ObjMap_vrange
    )


[STATEMENT]
lemma time_closest_pair_rec_tm_simps_2:
  assumes "\<not> (length xs \<le> 3)"
  shows "time (closest_pair_rec_tm xs) = 1 + (
    let (xs\<^sub>L, xs\<^sub>R) = val (split_at_tm (length xs div 2) xs) in
    let (ys\<^sub>L, p\<^sub>L) = val (closest_pair_rec_tm xs\<^sub>L) in
    let (ys\<^sub>R, p\<^sub>R) = val (closest_pair_rec_tm xs\<^sub>R) in
    let ys = val (merge_tm (\<lambda>p. snd p) ys\<^sub>L ys\<^sub>R) in
    time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) +
    time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm (\<lambda>p. snd p) ys\<^sub>L ys\<^sub>R) + time (combine_tm p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys)
  )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. time (closest_pair_rec_tm xs) = 1 + (let (xs\<^sub>L, xs\<^sub>R) = Time_Monad.val (split_at_tm (length xs div 2) xs); (ys\<^sub>L, p\<^sub>L) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>L); (ys\<^sub>R, p\<^sub>R) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>R); ys = Time_Monad.val (merge_tm snd ys\<^sub>L ys\<^sub>R) in time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) + time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm snd ys\<^sub>L ys\<^sub>R) + time (combine_tm p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> length xs \<le> 3

goal (1 subgoal):
 1. time (closest_pair_rec_tm xs) = 1 + (let (xs\<^sub>L, xs\<^sub>R) = Time_Monad.val (split_at_tm (length xs div 2) xs); (ys\<^sub>L, p\<^sub>L) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>L); (ys\<^sub>R, p\<^sub>R) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>R); ys = Time_Monad.val (merge_tm snd ys\<^sub>L ys\<^sub>R) in time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) + time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm snd ys\<^sub>L ys\<^sub>R) + time (combine_tm p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys))
[PROOF STEP]
apply (subst closest_pair_rec_tm.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> length xs \<le> 3 \<Longrightarrow> time (length_tm xs \<bind> (\<lambda>n. if n \<le> 3 then mergesort_tm snd xs \<bind> (\<lambda>ys. closest_pair_bf_tm xs \<bind> (\<lambda>p. return (ys, p))) else split_at_tm (n div 2) xs \<bind> (\<lambda>(xs\<^sub>L, xs\<^sub>R). closest_pair_rec_tm xs\<^sub>L \<bind> (\<lambda>(ys\<^sub>L, p\<^sub>0\<^sub>L, p\<^sub>1\<^sub>L). closest_pair_rec_tm xs\<^sub>R \<bind> (\<lambda>(ys\<^sub>R, p\<^sub>0\<^sub>R, p\<^sub>1\<^sub>R). merge_tm snd ys\<^sub>L ys\<^sub>R \<bind> (\<lambda>ys. combine_tm (p\<^sub>0\<^sub>L, p\<^sub>1\<^sub>L) (p\<^sub>0\<^sub>R, p\<^sub>1\<^sub>R) (fst (hd xs\<^sub>R)) ys \<bind> (\<lambda>(p\<^sub>0, p\<^sub>1). return (ys, p\<^sub>0, p\<^sub>1))))))) \<bind> tick) = 1 + (let (xs\<^sub>L, xs\<^sub>R) = Time_Monad.val (split_at_tm (length xs div 2) xs); (ys\<^sub>L, p\<^sub>L) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>L); (ys\<^sub>R, p\<^sub>R) = Time_Monad.val (closest_pair_rec_tm xs\<^sub>R); ys = Time_Monad.val (merge_tm snd ys\<^sub>L ys\<^sub>R) in time (length_tm xs) + time (split_at_tm (length xs div 2) xs) + time (closest_pair_rec_tm xs\<^sub>L) + time (closest_pair_rec_tm xs\<^sub>R) + time (merge_tm snd ys\<^sub>L ys\<^sub>R) + time (combine_tm p\<^sub>L p\<^sub>R (fst (hd xs\<^sub>R)) ys))
[PROOF STEP]
by (auto simp del: closest_pair_rec_tm.simps
           simp add: time_simps length_eq_val_length_tm
              split: prod.split)


[STATEMENT]
lemma list_all_replicate:
  assumes "P x"
  shows "list_all P (replicate n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all P (replicate n x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P x

goal (1 subgoal):
 1. list_all P (replicate n x)
[PROOF STEP]
by (metis Ball_set in_set_replicate)


[STATEMENT]
lemma genPrefix_append_both:
     "[| refl r;  (xs,ys) \<in> genPrefix r;  length xs = length ys |]
      ==>  (xs@zs, ys @ zs) \<in> genPrefix r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>refl r; (xs, ys) \<in> genPrefix r; length xs = length ys\<rbrakk> \<Longrightarrow> (xs @ zs, ys @ zs) \<in> genPrefix r
[PROOF STEP]
apply (drule genPrefix_take_append, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(xs, ys) \<in> genPrefix r; length xs = length ys; (xs @ ?zs, take (length xs) ys @ ?zs) \<in> genPrefix r\<rbrakk> \<Longrightarrow> (xs @ zs, ys @ zs) \<in> genPrefix r
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma DERIV_mirror: "(DERIV f (- x) :> y) \<longleftrightarrow> (DERIV (\<lambda>x. f (- x)) x :> - y)"
  for f :: "real \<Rightarrow> real" and x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_real_derivative y) (at (- x)) = ((\<lambda>x. f (- x)) has_real_derivative - y) (at x)
[PROOF STEP]
by (simp add: DERIV_def filterlim_at_split filterlim_at_left_to_right
      tendsto_minus_cancel_left field_simps conj_commute)


[STATEMENT]
lemma vector_eq_ldot: "(\<forall>x. x \<bullet> y = x \<bullet> z) \<longleftrightarrow> y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<bullet> y = x \<bullet> z) = (y = z)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>x. x \<bullet> y = x \<bullet> z \<Longrightarrow> y = z
 2. y = z \<Longrightarrow> \<forall>x. x \<bullet> y = x \<bullet> z
[PROOF STEP]
assume "\<forall>x. x \<bullet> y = x \<bullet> z"
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<bullet> y = x \<bullet> z

goal (2 subgoals):
 1. \<forall>x. x \<bullet> y = x \<bullet> z \<Longrightarrow> y = z
 2. y = z \<Longrightarrow> \<forall>x. x \<bullet> y = x \<bullet> z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. x \<bullet> y = x \<bullet> z
[PROOF STEP]
have "\<forall>x. x \<bullet> (y - z) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<bullet> y = x \<bullet> z

goal (1 subgoal):
 1. \<forall>x. x \<bullet> (y - z) = 0
[PROOF STEP]
by (simp add: inner_diff)
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<bullet> (y - z) = 0

goal (2 subgoals):
 1. \<forall>x. x \<bullet> y = x \<bullet> z \<Longrightarrow> y = z
 2. y = z \<Longrightarrow> \<forall>x. x \<bullet> y = x \<bullet> z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. x \<bullet> (y - z) = 0
[PROOF STEP]
have "(y - z) \<bullet> (y - z) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<bullet> (y - z) = 0

goal (1 subgoal):
 1. (y - z) \<bullet> (y - z) = 0
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(y - z) \<bullet> (y - z) = 0

goal (2 subgoals):
 1. \<forall>x. x \<bullet> y = x \<bullet> z \<Longrightarrow> y = z
 2. y = z \<Longrightarrow> \<forall>x. x \<bullet> y = x \<bullet> z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(y - z) \<bullet> (y - z) = 0
[PROOF STEP]
show "y = z"
[PROOF STATE]
proof (prove)
using this:
(y - z) \<bullet> (y - z) = 0

goal (1 subgoal):
 1. y = z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = z

goal (1 subgoal):
 1. y = z \<Longrightarrow> \<forall>x. x \<bullet> y = x \<bullet> z
[PROOF STEP]
qed simp


[STATEMENT]
lemma cartesian_product_binary_intersection_left:
  assumes "C \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "D \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "A \<subseteq> carrier (R\<^bsup>m\<^esup>)"
  shows "cartesian_product (C \<inter> D) A = (cartesian_product C A) \<inter> (cartesian_product D A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (C \<inter> D) A = cartesian_product C A \<inter> cartesian_product D A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cartesian_product (C \<inter> D) A \<subseteq> cartesian_product C A \<inter> cartesian_product D A
 2. cartesian_product C A \<inter> cartesian_product D A \<subseteq> cartesian_product (C \<inter> D) A
[PROOF STEP]
show "cartesian_product (C \<inter> D) A \<subseteq> cartesian_product C A \<inter> cartesian_product D A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (C \<inter> D) A \<subseteq> cartesian_product C A \<inter> cartesian_product D A
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. \<exists>as\<in>C \<inter> D. \<exists>bs\<in>A. xs = as @ bs} \<subseteq> {xs. \<exists>as\<in>C. \<exists>bs\<in>A. xs = as @ bs} \<inter> {xs. \<exists>as\<in>D. \<exists>bs\<in>A. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product (C \<inter> D) A \<subseteq> cartesian_product C A \<inter> cartesian_product D A

goal (1 subgoal):
 1. cartesian_product C A \<inter> cartesian_product D A \<subseteq> cartesian_product (C \<inter> D) A
[PROOF STEP]
show "cartesian_product C A \<inter> cartesian_product D A \<subseteq> cartesian_product (C \<inter> D) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product C A \<inter> cartesian_product D A \<subseteq> cartesian_product (C \<inter> D) A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product C A \<inter> cartesian_product D A \<Longrightarrow> x \<in> cartesian_product (C \<inter> D) A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product C A \<inter> cartesian_product D A \<Longrightarrow> x \<in> cartesian_product (C \<inter> D) A
[PROOF STEP]
assume A: "x \<in> cartesian_product C A \<inter> cartesian_product D A"
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product C A \<inter> cartesian_product D A

goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product C A \<inter> cartesian_product D A \<Longrightarrow> x \<in> cartesian_product (C \<inter> D) A
[PROOF STEP]
show "x \<in> cartesian_product (C \<inter> D) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> cartesian_product (C \<inter> D) A
[PROOF STEP]
apply(rule cartesian_product_memI[of _ R n _ m ])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. C \<inter> D \<subseteq> carrier (R\<^bsup>n\<^esup>)
 2. A \<subseteq> carrier (R\<^bsup>m\<^esup>)
 3. take n x \<in> C \<inter> D
 4. drop n x \<in> A
[PROOF STEP]
apply (simp add: assms(2) inf.coboundedI2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. A \<subseteq> carrier (R\<^bsup>m\<^esup>)
 2. take n x \<in> C \<inter> D
 3. drop n x \<in> A
[PROOF STEP]
apply (simp add: assms(3))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. take n x \<in> C \<inter> D
 2. drop n x \<in> A
[PROOF STEP]
apply (meson A Int_iff assms(1) assms(2) cartesian_product_memE(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n x \<in> A
[PROOF STEP]
by (meson A IntD1 assms(1) cartesian_product_memE(2))
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product (C \<inter> D) A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cartesian_product C A \<inter> cartesian_product D A \<subseteq> cartesian_product (C \<inter> D) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Gcd_empty [simp]: "Gcd {} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gcd {} = (0::'a)
[PROOF STEP]
by (rule dvd_0_left, rule Gcd_greatest) simp


[STATEMENT]
lemma fincomp_Un_disjoint:
  "\<lbrakk>finite A; finite B; A \<inter> B = {}; g \<in> A \<rightarrow> M; g \<in> B \<rightarrow> M\<rbrakk>
   \<Longrightarrow> fincomp g (A \<union> B) = fincomp g A \<cdot> fincomp g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; A \<inter> B = {}; g \<in> A \<rightarrow> M; g \<in> B \<rightarrow> M\<rbrakk> \<Longrightarrow> fincomp g (A \<union> B) = fincomp g A \<cdot> fincomp g B
[PROOF STEP]
by (metis Pi_split_domain fincomp_Un_Int fincomp_closed fincomp_empty right_unit)


[STATEMENT]
lemma Cons_less_Cons: "a # x < b # y \<longleftrightarrow> length x < length y \<or> length x = length y \<and> (a < b \<or> a = b \<and> x < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a # x < b # y) = (length x < length y \<or> length x = length y \<and> (a < b \<or> a = b \<and> x < y))
[PROOF STEP]
using lenlex_length
[PROOF STATE]
proof (prove)
using this:
(?ms, ?ns) \<in> lenlex ?r \<Longrightarrow> length ?ms \<le> length ?ns

goal (1 subgoal):
 1. (a # x < b # y) = (length x < length y \<or> length x = length y \<and> (a < b \<or> a = b \<and> x < y))
[PROOF STEP]
by (fastforce simp: list_less_def Cons_lenlex_iff)


[STATEMENT]
lemma S_transform_formula_Conj [simp]:
  assumes "finite (supp xset)"
  shows "S_transform_formula (Conj xset) = Conj\<^sub>\<alpha> (map_bset S_transform_formula xset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S_transform_formula (Conj xset) = Conj\<^sub>\<alpha> (map_bset S_transform_formula xset)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (supp xset)

goal (1 subgoal):
 1. S_transform_formula (Conj xset) = Conj\<^sub>\<alpha> (map_bset S_transform_formula xset)
[PROOF STEP]
by (simp add: Conj_def S_transform_formula_def bset.map_comp map_fun_def)


[STATEMENT]
lemma continuous_at_within_tanh [continuous_intros]:
  fixes f :: "_ \<Rightarrow>'a::{real_normed_field,banach}"
  assumes "continuous (at x within A) f" "cosh (f x) \<noteq> 0"
  shows   "continuous (at x within A) (\<lambda>x. tanh (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at x within A) (\<lambda>x. tanh (f x))
[PROOF STEP]
unfolding tanh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at x within A) (\<lambda>x. sinh (f x) / cosh (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous (at x within A) f
cosh (f x) \<noteq> (0::'a)

goal (1 subgoal):
 1. continuous (at x within A) (\<lambda>x. sinh (f x) / cosh (f x))
[PROOF STEP]
by (intro continuous_intros continuous_divide) auto


[STATEMENT]
lemma lebesgue_real_scale:
  assumes "c \<noteq> 0"
  shows   "lebesgue = density (distr lebesgue lebesgue (\<lambda>x. c * x)) (\<lambda>x. ennreal \<bar>c\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lebesgue = density (distr lebesgue lebesgue ((*) c)) (\<lambda>x. ennreal \<bar>c\<bar>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. lebesgue = density (distr lebesgue lebesgue ((*) c)) (\<lambda>x. ennreal \<bar>c\<bar>)
[PROOF STEP]
by (subst lebesgue_affine_euclidean[of "\<lambda>_. c" 0]) simp_all


[STATEMENT]
lemma divide_prod_assoc: "x / (y * z :: 'a :: field) = x / y / z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / (y * z) = x / y / z
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma intersect_poincare_circles_conjugate_centers:
  assumes in_disc: "z1 \<in> unit_disc" "z2 \<in> unit_disc" and
          "z1 \<noteq> z2" and "z1 = conjugate z2" and "r > 0" and
          u: "u \<in> poincare_circle z1 r \<inter> poincare_circle z2 r"
  shows "is_real (to_complex u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
obtain z1e r1e z2e r2e where
   euclidean: "(z1e, r1e) = poincare_circle_euclidean z1 r"
              "(z2e, r2e) = poincare_circle_euclidean z2 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z1e r1e z2e r2e. \<lbrakk>(z1e, r1e) = poincare_circle_euclidean z1 r; (z2e, r2e) = poincare_circle_euclidean z2 r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis poincare_circle_euclidean_def)
[PROOF STATE]
proof (state)
this:
(z1e, r1e) = poincare_circle_euclidean z1 r
(z2e, r2e) = poincare_circle_euclidean z2 r

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
obtain z1' z2' where z': "z1 = of_complex z1'" "z2 = of_complex z2'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z1' z2'. \<lbrakk>z1 = of_complex z1'; z2 = of_complex z2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex[of z1] inf_or_of_complex[of z2] in_disc
[PROOF STATE]
proof (prove)
using this:
z1 = \<infinity>\<^sub>h \<or> (\<exists>x. z1 = of_complex x)
z2 = \<infinity>\<^sub>h \<or> (\<exists>x. z2 = of_complex x)
z1 \<in> unit_disc
z2 \<in> unit_disc

goal (1 subgoal):
 1. (\<And>z1' z2'. \<lbrakk>z1 = of_complex z1'; z2 = of_complex z2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z1 = of_complex z1'
z2 = of_complex z2'

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
obtain u' where u': "u = of_complex u'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u'. u = of_complex u' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using u inf_or_of_complex[of u]
[PROOF STATE]
proof (prove)
using this:
u \<in> poincare_circle z1 r \<inter> poincare_circle z2 r
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)

goal (1 subgoal):
 1. (\<And>u'. u = of_complex u' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: poincare_circle_def)
[PROOF STATE]
proof (state)
this:
u = of_complex u'

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
have "z1' = cnj z2'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z1' = cnj z2'
[PROOF STEP]
using \<open>z1 = conjugate z2\<close> z'
[PROOF STATE]
proof (prove)
using this:
z1 = conjugate z2
z1 = of_complex z1'
z2 = of_complex z2'

goal (1 subgoal):
 1. z1' = cnj z2'
[PROOF STEP]
by (auto simp add: of_complex_inj)
[PROOF STATE]
proof (state)
this:
z1' = cnj z2'

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z1' = cnj z2'

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
let ?cz = "1 - (cmod z2')\<^sup>2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
let ?den = "?cz * (cosh r - 1) / 2 + 1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
have "?cz > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 - (cmod z2')\<^sup>2
[PROOF STEP]
using in_disc z'
[PROOF STATE]
proof (prove)
using this:
z1 \<in> unit_disc
z2 \<in> unit_disc
z1 = of_complex z1'
z2 = of_complex z2'

goal (1 subgoal):
 1. 0 < 1 - (cmod z2')\<^sup>2
[PROOF STEP]
by (simp add: cmod_def)
[PROOF STATE]
proof (state)
this:
0 < 1 - (cmod z2')\<^sup>2

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
hence "?den \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < 1 - (cmod z2')\<^sup>2

goal (1 subgoal):
 1. 1 \<le> (1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1
[PROOF STEP]
using cosh_gt_1[OF \<open>r > 0\<close>]
[PROOF STATE]
proof (prove)
using this:
0 < 1 - (cmod z2')\<^sup>2
1 < cosh r

goal (1 subgoal):
 1. 1 \<le> (1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> (1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
hence "?den \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> (1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1

goal (1 subgoal):
 1. (1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1 \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1 \<noteq> 0

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
hence "cor ?den \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
(1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1 \<noteq> 0

goal (1 subgoal):
 1. cor ((1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1) \<noteq> 0
[PROOF STEP]
using of_real_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
(1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1 \<noteq> 0
(of_real ?x = (0::?'a)) = (?x = 0)

goal (1 subgoal):
 1. cor ((1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1) \<noteq> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cor ((1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1) \<noteq> 0

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z1' = cnj z2'
cor ((1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1) \<noteq> 0
[PROOF STEP]
have "r1e = r2e" "z1e = cnj z2e" "z1e \<noteq> z2e"
[PROOF STATE]
proof (prove)
using this:
z1' = cnj z2'
cor ((1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1) \<noteq> 0

goal (1 subgoal):
 1. r1e = r2e &&& z1e = cnj z2e &&& z1e \<noteq> z2e
[PROOF STEP]
using z' euclidean \<open>z1 \<noteq> z2\<close>
[PROOF STATE]
proof (prove)
using this:
z1' = cnj z2'
cor ((1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1) \<noteq> 0
z1 = of_complex z1'
z2 = of_complex z2'
(z1e, r1e) = poincare_circle_euclidean z1 r
(z2e, r2e) = poincare_circle_euclidean z2 r
z1 \<noteq> z2

goal (1 subgoal):
 1. r1e = r2e &&& z1e = cnj z2e &&& z1e \<noteq> z2e
[PROOF STEP]
unfolding poincare_circle_euclidean_def Let_def
[PROOF STATE]
proof (prove)
using this:
z1' = cnj z2'
cor ((1 - (cmod z2')\<^sup>2) * (cosh r - 1) / 2 + 1) \<noteq> 0
z1 = of_complex z1'
z2 = of_complex z2'
(z1e, r1e) = (to_complex z1 / cor ((1 - (cmod (to_complex z1))\<^sup>2) * ((cosh r - 1) / 2) + 1), (1 - (cmod (to_complex z1))\<^sup>2) * sqrt ((cosh r - 1) / 2 * ((cosh r - 1) / 2 + 1)) / ((1 - (cmod (to_complex z1))\<^sup>2) * ((cosh r - 1) / 2) + 1))
(z2e, r2e) = (to_complex z2 / cor ((1 - (cmod (to_complex z2))\<^sup>2) * ((cosh r - 1) / 2) + 1), (1 - (cmod (to_complex z2))\<^sup>2) * sqrt ((cosh r - 1) / 2 * ((cosh r - 1) / 2 + 1)) / ((1 - (cmod (to_complex z2))\<^sup>2) * ((cosh r - 1) / 2) + 1))
z1 \<noteq> z2

goal (1 subgoal):
 1. r1e = r2e &&& z1e = cnj z2e &&& z1e \<noteq> z2e
[PROOF STEP]
by simp_all metis
[PROOF STATE]
proof (state)
this:
r1e = r2e
z1e = cnj z2e
z1e \<noteq> z2e

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
hence "u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e" "z2e \<noteq> cnj z2e"
[PROOF STATE]
proof (prove)
using this:
r1e = r2e
z1e = cnj z2e
z1e \<noteq> z2e

goal (1 subgoal):
 1. u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e &&& z2e \<noteq> cnj z2e
[PROOF STEP]
using euclidean u u'
[PROOF STATE]
proof (prove)
using this:
r1e = r2e
z1e = cnj z2e
z1e \<noteq> z2e
(z1e, r1e) = poincare_circle_euclidean z1 r
(z2e, r2e) = poincare_circle_euclidean z2 r
u \<in> poincare_circle z1 r \<inter> poincare_circle z2 r
u = of_complex u'

goal (1 subgoal):
 1. u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e &&& z2e \<noteq> cnj z2e
[PROOF STEP]
using poincare_circle_is_euclidean_circle[of z1 r]
[PROOF STATE]
proof (prove)
using this:
r1e = r2e
z1e = cnj z2e
z1e \<noteq> z2e
(z1e, r1e) = poincare_circle_euclidean z1 r
(z2e, r2e) = poincare_circle_euclidean z2 r
u \<in> poincare_circle z1 r \<inter> poincare_circle z2 r
u = of_complex u'
\<lbrakk>z1 \<in> unit_disc; 0 < r\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean z1 r in of_complex ` circle Ze Re = poincare_circle z1 r

goal (1 subgoal):
 1. u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e &&& z2e \<noteq> cnj z2e
[PROOF STEP]
using poincare_circle_is_euclidean_circle[of z2 r]
[PROOF STATE]
proof (prove)
using this:
r1e = r2e
z1e = cnj z2e
z1e \<noteq> z2e
(z1e, r1e) = poincare_circle_euclidean z1 r
(z2e, r2e) = poincare_circle_euclidean z2 r
u \<in> poincare_circle z1 r \<inter> poincare_circle z2 r
u = of_complex u'
\<lbrakk>z1 \<in> unit_disc; 0 < r\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean z1 r in of_complex ` circle Ze Re = poincare_circle z1 r
\<lbrakk>z2 \<in> unit_disc; 0 < r\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean z2 r in of_complex ` circle Ze Re = poincare_circle z2 r

goal (1 subgoal):
 1. u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e &&& z2e \<noteq> cnj z2e
[PROOF STEP]
using in_disc \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
r1e = r2e
z1e = cnj z2e
z1e \<noteq> z2e
(z1e, r1e) = poincare_circle_euclidean z1 r
(z2e, r2e) = poincare_circle_euclidean z2 r
u \<in> poincare_circle z1 r \<inter> poincare_circle z2 r
u = of_complex u'
\<lbrakk>z1 \<in> unit_disc; 0 < r\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean z1 r in of_complex ` circle Ze Re = poincare_circle z1 r
\<lbrakk>z2 \<in> unit_disc; 0 < r\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean z2 r in of_complex ` circle Ze Re = poincare_circle z2 r
z1 \<in> unit_disc
z2 \<in> unit_disc
0 < r

goal (1 subgoal):
 1. u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e &&& z2e \<noteq> cnj z2e
[PROOF STEP]
by auto (metis image_iff of_complex_inj)+
[PROOF STATE]
proof (state)
this:
u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e
z2e \<noteq> cnj z2e

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
hence "(cmod (u' - z2e))\<^sup>2 = (cmod(u' - cnj z2e))\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
u' \<in> circle (cnj z2e) r2e \<inter> circle z2e r2e
z2e \<noteq> cnj z2e

goal (1 subgoal):
 1. (cmod (u' - z2e))\<^sup>2 = (cmod (u' - cnj z2e))\<^sup>2
[PROOF STEP]
by (simp add: circle_def)
[PROOF STATE]
proof (state)
this:
(cmod (u' - z2e))\<^sup>2 = (cmod (u' - cnj z2e))\<^sup>2

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
hence "(u' - z2e) * (cnj u' - cnj z2e) = (u' - cnj z2e) * (cnj u' - z2e)"
[PROOF STATE]
proof (prove)
using this:
(cmod (u' - z2e))\<^sup>2 = (cmod (u' - cnj z2e))\<^sup>2

goal (1 subgoal):
 1. (u' - z2e) * (cnj u' - cnj z2e) = (u' - cnj z2e) * (cnj u' - z2e)
[PROOF STEP]
by (metis complex_cnj_cnj complex_cnj_diff complex_norm_square)
[PROOF STATE]
proof (state)
this:
(u' - z2e) * (cnj u' - cnj z2e) = (u' - cnj z2e) * (cnj u' - z2e)

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
hence "(z2e - cnj z2e) * (u' - cnj u') = 0"
[PROOF STATE]
proof (prove)
using this:
(u' - z2e) * (cnj u' - cnj z2e) = (u' - cnj z2e) * (cnj u' - z2e)

goal (1 subgoal):
 1. (z2e - cnj z2e) * (u' - cnj u') = 0
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(z2e - cnj z2e) * (u' - cnj u') = 0

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(z2e - cnj z2e) * (u' - cnj u') = 0

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
using u' \<open>z2e \<noteq> cnj z2e\<close> eq_cnj_iff_real[of u']
[PROOF STATE]
proof (prove)
using this:
(z2e - cnj z2e) * (u' - cnj u') = 0
u = of_complex u'
z2e \<noteq> cnj z2e
(cnj u' = u') = is_real u'

goal (1 subgoal):
 1. is_real (to_complex u)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_real (to_complex u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Union_finite_multiset:
  fixes M::"'a::fs multiset"
  shows "finite (\<Union>{supp x | x. x \<in># M})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> {supp x |x. x \<in># M})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (\<Union> {supp x |x. x \<in># M})
[PROOF STEP]
have "finite (\<Union>(supp ` {x. x \<in># M}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> (supp ` {x. x \<in># M}))
[PROOF STEP]
by (induct M) (simp_all add: Collect_imp_eq Collect_neg_eq finite_supp)
[PROOF STATE]
proof (state)
this:
finite (\<Union> (supp ` {x. x \<in># M}))

goal (1 subgoal):
 1. finite (\<Union> {supp x |x. x \<in># M})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (\<Union> (supp ` {x. x \<in># M}))
[PROOF STEP]
show "finite (\<Union>{supp x | x. x \<in># M})"
[PROOF STATE]
proof (prove)
using this:
finite (\<Union> (supp ` {x. x \<in># M}))

goal (1 subgoal):
 1. finite (\<Union> {supp x |x. x \<in># M})
[PROOF STEP]
by (simp only: image_Collect)
[PROOF STATE]
proof (state)
this:
finite (\<Union> {supp x |x. x \<in># M})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_shift_mult_both:
  fixes   f g :: "'a::{comm_monoid_add, mult_zero} fps"
  assumes "m \<le> subdegree f" "n \<le> subdegree g"
  shows   "fps_shift m f * fps_shift n g = fps_shift (m+n) (f*g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_shift m f * fps_shift n g = fps_shift (m + n) (f * g)
[PROOF STEP]
using   assms
[PROOF STATE]
proof (prove)
using this:
m \<le> subdegree f
n \<le> subdegree g

goal (1 subgoal):
 1. fps_shift m f * fps_shift n g = fps_shift (m + n) (f * g)
[PROOF STEP]
by      (simp add: fps_shift_mult fps_shift_mult_right_noncomm fps_shift_fps_shift)


[STATEMENT]
lemma indep_vars_PiM_components:
  assumes "\<And>i. i \<in> A \<Longrightarrow> prob_space (M i)"
  shows   "prob_space.indep_vars (PiM A M) M (\<lambda>i f. f i) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
proof (cases "A = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
 2. A \<noteq> {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (2 subgoals):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
 2. A \<noteq> {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
have "distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. restrict x A) = distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. restrict x A) = distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. x)
[PROOF STEP]
by (intro distr_cong) (auto simp: restrict_def space_PiM PiE_def extensional_def Pi_def)
[PROOF STATE]
proof (state)
this:
distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. restrict x A) = distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. x)

goal (2 subgoals):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
 2. A \<noteq> {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. restrict x A) = distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. x)

goal (2 subgoals):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
 2. A \<noteq> {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
have "\<dots> = Pi\<^sub>M A M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. x) = Pi\<^sub>M A M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. x) = Pi\<^sub>M A M

goal (2 subgoals):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
 2. A \<noteq> {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. x) = Pi\<^sub>M A M

goal (2 subgoals):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
 2. A \<noteq> {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
have "\<dots> = Pi\<^sub>M A (\<lambda>i. distr (Pi\<^sub>M A M) (M i) (\<lambda>f. f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>M A M = Pi\<^sub>M A (\<lambda>i. distr (Pi\<^sub>M A M) (M i) (\<lambda>f. f i))
[PROOF STEP]
by (intro PiM_cong refl, subst distr_PiM_component) (auto simp: assms)
[PROOF STATE]
proof (state)
this:
Pi\<^sub>M A M = Pi\<^sub>M A (\<lambda>i. distr (Pi\<^sub>M A M) (M i) (\<lambda>f. f i))

goal (2 subgoals):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
 2. A \<noteq> {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. restrict x A) = Pi\<^sub>M A (\<lambda>i. distr (Pi\<^sub>M A M) (M i) (\<lambda>f. f i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distr (Pi\<^sub>M A M) (Pi\<^sub>M A M) (\<lambda>x. restrict x A) = Pi\<^sub>M A (\<lambda>i. distr (Pi\<^sub>M A M) (M i) (\<lambda>f. f i))

goal (1 subgoal):
 1. prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
by (subst prob_space.indep_vars_iff_distr_eq_PiM') (simp_all add: prob_space_PiM assms False)
[PROOF STATE]
proof (state)
this:
prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A

goal (1 subgoal):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A = {}

goal (1 subgoal):
 1. A = {} \<Longrightarrow> prob_space.indep_vars (Pi\<^sub>M A M) M (\<lambda>i f. f i) A
[PROOF STEP]
interpret prob_space "PiM A M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M A M)
[PROOF STEP]
by (intro prob_space_PiM assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A = {} \<Longrightarrow> indep_vars M (\<lambda>i f. f i) A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars M (\<lambda>i f. f i) A
[PROOF STEP]
unfolding indep_vars_def indep_sets_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>A. random_variable (M i) (\<lambda>f. f i)) \<and> (\<forall>i\<in>A. sigma_sets (space (Pi\<^sub>M A M)) {(\<lambda>f. f i) -` Aa \<inter> space (Pi\<^sub>M A M) |Aa. Aa \<in> sets (M i)} \<subseteq> events) \<and> (\<forall>J\<subseteq>A. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> (\<forall>A\<in>\<Pi> i\<in>J. sigma_sets (space (Pi\<^sub>M A M)) {(\<lambda>f. f i) -` Aa \<inter> space (Pi\<^sub>M A M) |Aa. Aa \<in> sets (M i)}. prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))))
[PROOF STEP]
by (auto simp: True)
[PROOF STATE]
proof (state)
this:
indep_vars M (\<lambda>i f. f i) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eqpoll_trans [trans]: "\<lbrakk>A \<approx> B; B \<approx> C\<rbrakk> \<Longrightarrow> A \<approx> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<approx> B; B \<approx> C\<rbrakk> \<Longrightarrow> A \<approx> C
[PROOF STEP]
unfolding eqpoll_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>f. bij_betw f A B; \<exists>f. bij_betw f B C\<rbrakk> \<Longrightarrow> \<exists>f. bij_betw f A C
[PROOF STEP]
using bij_betw_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij_betw ?f ?A ?B; bij_betw ?g ?B ?C\<rbrakk> \<Longrightarrow> bij_betw (?g \<circ> ?f) ?A ?C

goal (1 subgoal):
 1. \<lbrakk>\<exists>f. bij_betw f A B; \<exists>f. bij_betw f B C\<rbrakk> \<Longrightarrow> \<exists>f. bij_betw f A C
[PROOF STEP]
by blast


[STATEMENT]
lemma countable_SIGMA[intro, simp]:
  "countable I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> countable (A i)) \<Longrightarrow> countable (SIGMA i : I. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable I; \<And>i. i \<in> I \<Longrightarrow> countable (A i)\<rbrakk> \<Longrightarrow> countable (Sigma I A)
[PROOF STEP]
by (intro countableI'[of "\<lambda>(i, a). (to_nat_on I i, to_nat_on (A i) a)"]) (auto simp: inj_on_def)


[STATEMENT]
lemma nn_integral_map_pmf[simp]: "(\<integral>\<^sup>+x. f x \<partial>map_pmf g M) = (\<integral>\<^sup>+x. f (g x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (measure_pmf (map_pmf g M)) f = \<integral>\<^sup>+ x. f (g x) \<partial>measure_pmf M
[PROOF STEP]
unfolding map_pmf_rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (distr (measure_pmf M) (count_space UNIV) g) f = \<integral>\<^sup>+ x. f (g x) \<partial>measure_pmf M
[PROOF STEP]
by (intro nn_integral_distr) auto


[STATEMENT]
lemma point_add [simp]:
  "Point xA yA + Point xB yB = Point (xA + xB) (yA + yB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Point xA yA + Point xB yB = Point (xA + xB) (yA + yB)
[PROOF STEP]
by (simp add: point_add_def)


[STATEMENT]
lemma list_all_conv: "list_all P xs = (\<forall>i<length xs. P (xs ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all P xs = (\<forall>i<length xs. P (xs ! i))
[PROOF STEP]
by (rule list_all_length)


[STATEMENT]
lemma count_Sigma_mset_abs_def: "count (Sigma_mset A B) = (\<lambda>(a, b) \<Rightarrow> count A a * count (B a) b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (Sigma_mset A B) = (\<lambda>x. case x of (a, b) \<Rightarrow> count A a * count (B a) b)
[PROOF STEP]
by (auto simp: fun_eq_iff count_Sigma_mset)


[STATEMENT]
lemma mod_0_imp_i_set_mult_subset: "
  a mod b = 0 \<Longrightarrow> i_set_mult a \<subseteq> i_set_mult b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod b = 0 \<Longrightarrow> i_set_mult a \<subseteq> i_set_mult b
[PROOF STEP]
apply (auto simp add: ac_simps elim!: dvdE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k x. \<lbrakk>a = k * b; x \<in> i_set_mult (k * b)\<rbrakk> \<Longrightarrow> x \<in> i_set_mult b
[PROOF STEP]
apply (rule_tac a=x and k="k * b" in i_set_mult.cases)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>k x. \<lbrakk>a = k * b; x \<in> i_set_mult (k * b)\<rbrakk> \<Longrightarrow> x \<in> i_set_mult (k * b)
 2. \<And>k x n. \<lbrakk>a = k * b; x \<in> i_set_mult (k * b); x = [n\<dots>]\<rbrakk> \<Longrightarrow> x \<in> i_set_mult b
 3. \<And>k x n. \<lbrakk>a = k * b; x \<in> i_set_mult (k * b); x = [\<dots>n]\<rbrakk> \<Longrightarrow> x \<in> i_set_mult b
 4. \<And>k x n d. \<lbrakk>a = k * b; x \<in> i_set_mult (k * b); x = [n\<dots>,d]\<rbrakk> \<Longrightarrow> x \<in> i_set_mult b
 5. \<And>k x r m. \<lbrakk>a = k * b; x \<in> i_set_mult (k * b); x = [ r, mod m * (k * b) ]\<rbrakk> \<Longrightarrow> x \<in> i_set_mult b
 6. \<And>k x r m c. \<lbrakk>a = k * b; x \<in> i_set_mult (k * b); x = [ r, mod m * (k * b), c ]\<rbrakk> \<Longrightarrow> x \<in> i_set_mult b
[PROOF STEP]
apply (simp_all add: i_set_mult.intros mult.assoc[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sumset_stabilizer_eq_self:
  assumes "A \<subseteq> G"
  shows "sumset (stabilizer A) A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset (stabilizer A) A = A
[PROOF STEP]
using assms sumset_eq_Union_left[OF "stabilizer_subset_group"]
    Int_absorb2 stabilizer_coset_Un sumset_commute sumset_eq_Union_left
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> G
sumset (stabilizer ?S1) ?B = (\<Union>a\<in>stabilizer ?S1. sumset {a} ?B)
?A \<subseteq> ?B \<Longrightarrow> ?A \<inter> ?B = ?A
?A \<subseteq> G \<Longrightarrow> (\<Union>x\<in>?A. sumset {x} (stabilizer ?A)) = ?A
sumset ?A ?B = sumset ?B ?A
?A \<subseteq> G \<Longrightarrow> sumset ?A ?B = (\<Union>a\<in>?A. sumset {a} ?B)

goal (1 subgoal):
 1. sumset (stabilizer A) A = A
[PROOF STEP]
by presburger


[STATEMENT]
lemma nat_diff_left_cancel_eq2: "\<lbrakk> k - m = k - (n::nat); n < k \<rbrakk> \<Longrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k - m = k - n; n < k\<rbrakk> \<Longrightarrow> m = n
[PROOF STEP]
by simp


[STATEMENT]
lemma zhmset_pos_as_neg: "zhmset_of (hmset_pos M) = zhmset_of (hmset_neg M) + M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zhmset_of (hmset_pos M) = zhmset_of (hmset_neg M) + M
[PROOF STEP]
using mset_pos_as_neg zhmsetmset_plus zhmsetmset_inject
[PROOF STATE]
proof (prove)
using this:
zmset_of (mset_pos ?M) = zmset_of (mset_neg ?M) + ?M
zhmsetmset (?x + ?xa) = zhmsetmset ?x + zhmsetmset ?xa
(zhmsetmset ?x = zhmsetmset ?y) = (?x = ?y)

goal (1 subgoal):
 1. zhmset_of (hmset_pos M) = zhmset_of (hmset_neg M) + M
[PROOF STEP]
by fastforce


[STATEMENT]
lemma vi_policy'_opt:
  assumes "eps > 0" "l > 0"
  shows "dist (\<nu>\<^sub>b (mk_stationary_det (vi_policy' eps v))) \<nu>\<^sub>b_opt < eps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (vi_policy' eps v))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
unfolding vi_policy'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration eps v)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < eps
0 < l

goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration eps v)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
proof (induction eps v rule: value_iteration.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>eps v. \<lbrakk>\<lbrakk>\<not> (2 * l * dist v (\<L>\<^sub>b v) < eps * (1 - l) \<or> eps \<le> 0); 0 < eps; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration eps (\<L>\<^sub>b v))))) \<nu>\<^sub>b_opt < eps; 0 < eps; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration eps v)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
case (1 v)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> (2 * l * dist v_ (\<L>\<^sub>b v_) < v * (1 - l) \<or> v \<le> 0); 0 < v; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration v (\<L>\<^sub>b v_))))) \<nu>\<^sub>b_opt < v
0 < v
0 < l

goal (1 subgoal):
 1. \<And>eps v. \<lbrakk>\<lbrakk>\<not> (2 * l * dist v (\<L>\<^sub>b v) < eps * (1 - l) \<or> eps \<le> 0); 0 < eps; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration eps (\<L>\<^sub>b v))))) \<nu>\<^sub>b_opt < eps; 0 < eps; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration eps v)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<not> (2 * l * dist v_ (\<L>\<^sub>b v_) < v * (1 - l) \<or> v \<le> 0); 0 < v; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration v (\<L>\<^sub>b v_))))) \<nu>\<^sub>b_opt < v
0 < v
0 < l
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> (2 * l * dist v_ (\<L>\<^sub>b v_) < v * (1 - l) \<or> v \<le> 0); 0 < v; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration v (\<L>\<^sub>b v_))))) \<nu>\<^sub>b_opt < v
0 < v
0 < l

goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration v v_)))) \<nu>\<^sub>b_opt < v
[PROOF STEP]
using find_policy'_error_bound
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> (2 * l * dist v_ (\<L>\<^sub>b v_) < v * (1 - l) \<or> v \<le> 0); 0 < v; 0 < l\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration v (\<L>\<^sub>b v_))))) \<nu>\<^sub>b_opt < v
0 < v
0 < l
\<lbrakk>0 < ?eps; 2 * l * dist ?v (\<L>\<^sub>b ?v) < ?eps * (1 - l)\<rbrakk> \<Longrightarrow> dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (\<L>\<^sub>b ?v)))) \<nu>\<^sub>b_opt < ?eps

goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration v v_)))) \<nu>\<^sub>b_opt < v
[PROOF STEP]
by (subst value_iteration.simps) auto
[PROOF STATE]
proof (state)
this:
dist (\<nu>\<^sub>b (mk_stationary_det (find_policy' (value_iteration v v_)))) \<nu>\<^sub>b_opt < v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_affinity_iff:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: real_normed_vector"
  assumes "m > 0"
  shows   "((\<lambda>x. f (m *\<^sub>R x + c)) has_integral (I /\<^sub>R m ^ DIM('a)))
               (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m)) \<longleftrightarrow>
           (f has_integral I) (cbox a b)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m)) = (f has_integral I) (cbox a b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m)) \<Longrightarrow> (f has_integral I) (cbox a b)
 2. (f has_integral I) (cbox a b) \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))

goal (2 subgoals):
 1. ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m)) \<Longrightarrow> (f has_integral I) (cbox a b)
 2. (f has_integral I) (cbox a b) \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
[PROOF STEP]
from has_integral_affinity'[OF this, of "1 / m" "-c /\<^sub>R m"] and \<open>m > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < 1 / m \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R ((1 / m) *\<^sub>R x + - c /\<^sub>R m) + c)) has_integral I /\<^sub>R m ^ DIM('a) /\<^sub>R (1 / m) ^ DIM('a)) (cbox (((a - c) /\<^sub>R m - - c /\<^sub>R m) /\<^sub>R (1 / m)) (((b - c) /\<^sub>R m - - c /\<^sub>R m) /\<^sub>R (1 / m)))
0 < m
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
0 < 1 / m \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R ((1 / m) *\<^sub>R x + - c /\<^sub>R m) + c)) has_integral I /\<^sub>R m ^ DIM('a) /\<^sub>R (1 / m) ^ DIM('a)) (cbox (((a - c) /\<^sub>R m - - c /\<^sub>R m) /\<^sub>R (1 / m)) (((b - c) /\<^sub>R m - - c /\<^sub>R m) /\<^sub>R (1 / m)))
0 < m

goal (1 subgoal):
 1. (f has_integral I) (cbox a b)
[PROOF STEP]
by (simp add: vector_add_divide_simps) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(f has_integral I) (cbox a b)

goal (1 subgoal):
 1. (f has_integral I) (cbox a b) \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_integral I) (cbox a b) \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
(f has_integral I) (cbox a b)

goal (1 subgoal):
 1. (f has_integral I) (cbox a b) \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
[PROOF STEP]
from has_integral_affinity'[OF this, of m c] and \<open>m > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < m \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
0 < m
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
0 < m \<Longrightarrow> ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
0 < m

goal (1 subgoal):
 1. ((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (m *\<^sub>R x + c)) has_integral I /\<^sub>R m ^ DIM('a)) (cbox ((a - c) /\<^sub>R m) ((b - c) /\<^sub>R m))

goal:
No subgoals!
[PROOF STEP]
qed