[STATEMENT]
lemma ideal_generated_subset2:
  assumes  "\<forall>b\<in>B. b \<in> ideal_generated A"
  shows "ideal_generated B \<subseteq> ideal_generated A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated B \<subseteq> ideal_generated A
[PROOF STEP]
by (metis (mono_tags, lifting) InterE assms ideal_generated_def
ideal_ideal_generated mem_Collect_eq subsetI)


[STATEMENT]
lemma imult_ile_mono1: "(i::enat) \<le> j \<Longrightarrow> i * k \<le> j * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> i * k \<le> j * k
[PROOF STEP]
by (rule imult_ile_mono[OF _ order_refl])


[STATEMENT]
lemma size_rbt_app[simp]: "size (rbt_app t1 t2) = size t1 + size t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (rbt_app t1 t2) = size t1 + size t2
[PROOF STEP]
by (induction t1 t2 rule: rbt_app.induct)
     (auto split: RBT_Impl.rbt.splits RBT_Impl.color.splits)


[STATEMENT]
lemma hyperpow_two_ge_one: "\<And>r::'a::linordered_semidom star. 1 \<le> r \<Longrightarrow> 1 \<le> r pow 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. 1 \<le> r \<Longrightarrow> 1 \<le> r pow 2
[PROOF STEP]
by transfer (rule one_le_power)


[STATEMENT]
lemma funpow_cycle_offset:
  fixes f :: "'a \<Rightarrow> 'a"
  assumes "(f ^^ k) x = (f ^^ i) x" "i \<le> k" "i \<le> l"
  shows "(f ^^ l) x = (f ^^ ((l - i) mod (k - i) + i)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ l) x = (f ^^ ((l - i) mod (k - i) + i)) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f ^^ l) x = (f ^^ ((l - i) mod (k - i) + i)) x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(f ^^ k) x = (f ^^ i) x
i \<le> k
i \<le> l
[PROOF STEP]
have
    "(f ^^ (k - i)) ((f ^^ i) x) = ((f ^^ i) x)"
    "(f ^^ l) x = (f ^^ (l - i)) ((f ^^ i) x)"
[PROOF STATE]
proof (prove)
using this:
(f ^^ k) x = (f ^^ i) x
i \<le> k
i \<le> l

goal (1 subgoal):
 1. (f ^^ (k - i)) ((f ^^ i) x) = (f ^^ i) x &&& (f ^^ l) x = (f ^^ (l - i)) ((f ^^ i) x)
[PROOF STEP]
unfolding fun_cong[OF funpow_add[symmetric, unfolded o_def]]
[PROOF STATE]
proof (prove)
using this:
(f ^^ k) x = (f ^^ i) x
i \<le> k
i \<le> l

goal (1 subgoal):
 1. (f ^^ (k - i + i)) x = (f ^^ i) x &&& (f ^^ l) x = (f ^^ (l - i + i)) x
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
(f ^^ (k - i)) ((f ^^ i) x) = (f ^^ i) x
(f ^^ l) x = (f ^^ (l - i)) ((f ^^ i) x)

goal (1 subgoal):
 1. (f ^^ l) x = (f ^^ ((l - i) mod (k - i) + i)) x
[PROOF STEP]
from funpow_cycle[OF this(1), of "l - i"] this(2)
[PROOF STATE]
proof (chain)
picking this:
(f ^^ (l - i)) ((f ^^ i) x) = (f ^^ ((l - i) mod (k - i))) ((f ^^ i) x)
(f ^^ l) x = (f ^^ (l - i)) ((f ^^ i) x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f ^^ (l - i)) ((f ^^ i) x) = (f ^^ ((l - i) mod (k - i))) ((f ^^ i) x)
(f ^^ l) x = (f ^^ (l - i)) ((f ^^ i) x)

goal (1 subgoal):
 1. (f ^^ l) x = (f ^^ ((l - i) mod (k - i) + i)) x
[PROOF STEP]
by (simp add: funpow_add)
[PROOF STATE]
proof (state)
this:
(f ^^ l) x = (f ^^ ((l - i) mod (k - i) + i)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma term_subst_eq_conv:
  "t \<cdot> \<sigma> = t \<cdot> \<tau> \<longleftrightarrow> (\<forall>x \<in> vars_term t. \<sigma> x = \<tau> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<cdot> \<sigma> = t \<cdot> \<tau>) = (\<forall>x\<in>vars_term t. \<sigma> x = \<tau> x)
[PROOF STEP]
using term_subst_eq [of t \<sigma> \<tau>] and term_subst_eq_rev [of t \<sigma> \<tau>]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> vars_term t \<Longrightarrow> \<sigma> x = \<tau> x) \<Longrightarrow> t \<cdot> \<sigma> = t \<cdot> \<tau>
t \<cdot> \<sigma> = t \<cdot> \<tau> \<Longrightarrow> \<forall>x\<in>vars_term t. \<sigma> x = \<tau> x

goal (1 subgoal):
 1. (t \<cdot> \<sigma> = t \<cdot> \<tau>) = (\<forall>x\<in>vars_term t. \<sigma> x = \<tau> x)
[PROOF STEP]
by auto


[STATEMENT]
lemma valid_cert_concatI: "(\<forall>x \<in> set xs . valid_cert x) \<Longrightarrow> valid_cert (concat xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. valid_cert x \<Longrightarrow> valid_cert (concat xs)
[PROOF STEP]
by (induction xs) (auto simp add: valid_cert_appendI)


[STATEMENT]
lemma isometry_iterates:
  fixes f::"('a::metric_space) \<Rightarrow> 'a"
  assumes "isometry f"
  shows "isometry (f^^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry (f ^^ n)
[PROOF STEP]
using isometry_on_UNIV_iterates[OF isometryD(1)[OF assms], of n] bij_fn[OF isometry_inverse(2)[OF assms], of n]
[PROOF STATE]
proof (prove)
using this:
isometry_on UNIV (f ^^ n)
bij (f ^^ n)

goal (1 subgoal):
 1. isometry (f ^^ n)
[PROOF STEP]
unfolding isometry_def
[PROOF STATE]
proof (prove)
using this:
isometry_on UNIV (f ^^ n)
bij (f ^^ n)

goal (1 subgoal):
 1. isometry_on UNIV (f ^^ n) \<and> surj (f ^^ n)
[PROOF STEP]
by (simp add: bij_is_surj)


[STATEMENT]
lemma limsup_ereal_mult_left:
  "(c::real) \<ge> 0 \<Longrightarrow> limsup (\<lambda>n. ereal c * f n) = ereal c * limsup f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> c \<Longrightarrow> limsup (\<lambda>n. ereal c * f n) = ereal c * limsup f
[PROOF STEP]
by (subst (1 2) mult.commute, rule limsup_ereal_mult_right) simp_all


[STATEMENT]
lemma one_divide_eq_0_iff [simp]: "1 / a = 0 \<longleftrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) / a = (0::'a)) = (a = (0::'a))
[PROOF STEP]
using zero_eq_1_divide_iff[of a]
[PROOF STATE]
proof (prove)
using this:
((0::'a) = (1::'a) / a) = (a = (0::'a))

goal (1 subgoal):
 1. ((1::'a) / a = (0::'a)) = (a = (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma valuate_ex: "x \<in> valuate f \<longleftrightarrow> (\<exists>e. (\<forall>i. e i \<in> {-1 .. 1}) \<and> x = f e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> valuate f) = (\<exists>e. (\<forall>i. e i \<in> {- 1..1}) \<and> x = f e)
[PROOF STEP]
unfolding valuate_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> f ` (UNIV \<rightarrow> {- 1..1})) = (\<exists>e. (\<forall>i. e i \<in> {- 1..1}) \<and> x = f e)
[PROOF STEP]
by (auto simp add: valuate_def Pi_iff) blast


[STATEMENT]
theorem meet_assoc: "(x \<sqinter> y) \<sqinter> z = x \<sqinter> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z = x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
proof (rule meetI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y
 2. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
 3. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x
 2. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
have "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
have "\<dots> \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> z \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqinter> z \<sqsubseteq> y

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y

goal (2 subgoals):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
 2. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
have "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
have "\<dots> \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> z \<sqsubseteq> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqinter> z \<sqsubseteq> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z

goal (1 subgoal):
 1. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
assume "w \<sqsubseteq> x \<sqinter> y" and "w \<sqsubseteq> z"
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y
w \<sqsubseteq> z

goal (1 subgoal):
 1. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
show "w \<sqsubseteq> x \<sqinter> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w \<sqsubseteq> x
 2. w \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
show "w \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
have "w \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
have "\<dots> \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> x

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
w \<sqsubseteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w \<sqsubseteq> x

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x

goal (1 subgoal):
 1. w \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
show "w \<sqsubseteq> y \<sqinter> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w \<sqsubseteq> y
 2. w \<sqsubseteq> z
[PROOF STEP]
show "w \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
have "w \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
have "\<dots> \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> y

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

goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> y

goal (1 subgoal):
 1. w \<sqsubseteq> z
[PROOF STEP]
show "w \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> z
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> y \<sqinter> z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> (y \<sqinter> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sgn_of_complex: "sgn (of_complex r :: 'a::complex_normed_algebra_1) = of_complex (sgn r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (of_complex r) = of_complex (sgn r)
[PROOF STEP]
unfolding of_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (r *\<^sub>C (1::'a)) = sgn r *\<^sub>C (1::'a)
[PROOF STEP]
by (simp only: sgn_scaleC sgn_one)


[STATEMENT]
lemma lappend_ltake_ldrop: "lappend (ltake n xs) (ldrop n xs) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lappend (ltake n xs) (ldrop n xs) = xs
[PROOF STEP]
by(coinduction arbitrary: n xs rule: llist.coinduct_strong)
  (auto simp add: ldrop_ltl ltl_ltake intro!: arg_cong2[where f=lappend])


[STATEMENT]
lemma sorted_wrt_append:
  assumes "sorted_wrt R xs" "sorted_wrt R ys"
          "\<And>x y. x \<in> set xs \<Longrightarrow> y \<in> set ys \<Longrightarrow> (x,y) \<in> R" "trans R"
  shows   "sorted_wrt R (xs @ ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (xs @ ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Linorder_Relations.sorted_wrt R xs
Linorder_Relations.sorted_wrt R ys
\<lbrakk>?x \<in> set xs; ?y \<in> set ys\<rbrakk> \<Longrightarrow> (?x, ?y) \<in> R
trans R

goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (xs @ ys)
[PROOF STEP]
by (induction xs) (auto simp: sorted_wrt_Cons)


[STATEMENT]
lemma limitin_sequentially:
   "limitin X S l sequentially \<longleftrightarrow>
     l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<exists>N. \<forall>n. N \<le> n \<longrightarrow> S n \<in> U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limitin X S l sequentially = (l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. S n \<in> U)))
[PROOF STEP]
by (simp add: limitin_def eventually_sequentially)


[STATEMENT]
lemma nonpos_Ints_subset_nonpos_Reals: "\<int>\<^sub>\<le>\<^sub>0 \<subseteq> \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int>\<^sub>\<le>\<^sub>0 \<subseteq> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (metis nonpos_Ints_cases nonpos_Ints_nonpos nonpos_Ints_of_int
    nonpos_Reals_of_real_iff of_real_of_int_eq subsetI)


[STATEMENT]
lemma (in prob_space)
  fixes X1 X2 :: "'a \<Rightarrow> 'b::{real_normed_field, banach, second_countable_topology}"
  assumes "indep_var borel X1 borel X2" "integrable M X1" "integrable M X2"
  shows indep_var_lebesgue_integral: "(\<integral>\<omega>. X1 \<omega> * X2 \<omega> \<partial>M) = (\<integral>\<omega>. X1 \<omega> \<partial>M) * (\<integral>\<omega>. X2 \<omega> \<partial>M)" (is ?eq)
    and indep_var_integrable: "integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)" (is ?int)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = expectation X1 * expectation X2 &&& integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)
[PROOF STEP]
unfolding indep_var_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = expectation X1 * expectation X2 &&& integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. expectation (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = expectation X1 * expectation X2
 2. integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)
[PROOF STEP]
have *: "(\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = (\<lambda>\<omega>. \<Prod>i\<in>UNIV. (case_bool X1 X2 i \<omega>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = (\<lambda>\<omega>. \<Prod>i\<in>UNIV. (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2) \<omega>)
[PROOF STEP]
by (simp add: UNIV_bool mult.commute)
[PROOF STATE]
proof (state)
this:
(\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = (\<lambda>\<omega>. \<Prod>i\<in>UNIV. (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2) \<omega>)

goal (2 subgoals):
 1. expectation (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = expectation X1 * expectation X2
 2. integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)
[PROOF STEP]
have **: "(\<lambda> _. borel) = case_bool borel borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>_. borel) = case_bool borel borel
[PROOF STEP]
by (rule ext, metis (full_types) bool.simps(3) bool.simps(4))
[PROOF STATE]
proof (state)
this:
(\<lambda>_. borel) = case_bool borel borel

goal (2 subgoals):
 1. expectation (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = expectation X1 * expectation X2
 2. integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)
[PROOF STEP]
show ?eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = expectation X1 * expectation X2
[PROOF STEP]
apply (subst *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>\<omega>. \<Prod>i\<in>UNIV. (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2) \<omega>) = expectation X1 * expectation X2
[PROOF STEP]
apply (subst indep_vars_lebesgue_integral)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. finite UNIV
 2. indep_vars (\<lambda>_. borel) (case_bool X1 X2) UNIV
 3. \<And>i. i \<in> UNIV \<Longrightarrow> integrable M (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)
 4. (\<Prod>i\<in>UNIV. expectation (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)) = expectation X1 * expectation X2
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. indep_vars (\<lambda>_. borel) (case_bool X1 X2) UNIV
 2. \<And>i. integrable M (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)
 3. (\<Prod>i\<in>UNIV. expectation (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)) = expectation X1 * expectation X2
[PROOF STEP]
apply (subst **, subst indep_var_def [symmetric], rule assms)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. integrable M (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)
 2. (\<Prod>i\<in>UNIV. expectation (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)) = expectation X1 * expectation X2
[PROOF STEP]
apply (simp split: bool.split add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>UNIV. expectation (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)) = expectation X1 * expectation X2
[PROOF STEP]
by (simp add: UNIV_bool mult.commute)
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = expectation X1 * expectation X2

goal (1 subgoal):
 1. integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)
[PROOF STEP]
show ?int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)
[PROOF STEP]
apply (subst *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>\<omega>. \<Prod>i\<in>UNIV. (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2) \<omega>)
[PROOF STEP]
apply (rule indep_vars_integrable)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite UNIV
 2. indep_vars (\<lambda>_. borel) (\<lambda>i. case i of True \<Rightarrow> X1 | False \<Rightarrow> X2) UNIV
 3. \<And>i. i \<in> UNIV \<Longrightarrow> integrable M (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. indep_vars (\<lambda>_. borel) (\<lambda>i. case i of True \<Rightarrow> X1 | False \<Rightarrow> X2) UNIV
 2. \<And>i. integrable M (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)
[PROOF STEP]
apply (subst **, subst indep_var_def [symmetric], rule assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. integrable M (case i of True \<Rightarrow> X1 | False \<Rightarrow> X2)
[PROOF STEP]
by (simp split: bool.split add: assms)
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_Hyperdual_parts:
  "(a::'a::real_normed_field) \<noteq> 0 \<Longrightarrow>
    inverse (a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12) =
    inverse a *\<^sub>H ba + - (b / a\<^sup>2) *\<^sub>H e1 + - (c / a\<^sup>2) *\<^sub>H e2 + (2 * b * c / a ^ 3 - d / a\<^sup>2) *\<^sub>H e12"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> inverse (a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12) = inverse a *\<^sub>H ba + - (b / a\<^sup>2) *\<^sub>H e1 + - (c / a\<^sup>2) *\<^sub>H e2 + ((2::'a) * b * c / a ^ 3 - d / a\<^sup>2) *\<^sub>H e12
[PROOF STEP]
by (metis Hyperdual_eq hyperdual.sel(1) hypext_inverse hypext_inverse_Hyperdual_parts)


[STATEMENT]
lemma tendsto_sup[tendsto_intros]:
  fixes X :: "'a \<Rightarrow> 'b::ordered_euclidean_space"
  assumes "(X \<longlongrightarrow> x) net" "(Y \<longlongrightarrow> y) net"
  shows "((\<lambda>i. sup (X i) (Y i)) \<longlongrightarrow> sup x y) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. sup (X i) (Y i)) \<longlongrightarrow> sup x y) net
[PROOF STEP]
unfolding sup_max eucl_sup
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. \<Sum>ia\<in>Basis. max (X i \<bullet> ia) (Y i \<bullet> ia) *\<^sub>R ia) \<longlongrightarrow> (\<Sum>i\<in>Basis. max (x \<bullet> i) (y \<bullet> i) *\<^sub>R i)) net
[PROOF STEP]
by (intro assms tendsto_intros)


[STATEMENT]
lemma suminf_eq_lim: "suminf f = lim (\<lambda>n. \<Sum>i<n. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf f = lim (\<lambda>n. sum f {..<n})
[PROOF STEP]
by (simp add: suminf_def sums_def lim_def)


[STATEMENT]
theorem fusion_gfp_eq:
  assumes monoH: "mono H" and monoG: "mono G"
  and distF: "dist_over_inf F"
  and fgh_comp: "\<And>x. ((F \<circ> G) x = (H \<circ> F) x)"
  shows "F (gfp G) = gfp H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (gfp G) = gfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F (gfp G) \<sqsubseteq> gfp H
 2. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
show "F (gfp G) \<sqsubseteq> (gfp H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (gfp G) \<sqsubseteq> gfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis fgh_comp le_less v_simple_fusion monoG)
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "\<And>x. ((H \<circ> F) x \<sqsubseteq> (F \<circ> G) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x::'a. (H \<circ> F) x \<sqsubseteq> (F \<circ> G) x
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using fgh_comp
[PROOF STATE]
proof (prove)
using this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) (?x::'a::refinement_lattice) = ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F) ?x

goal (1 subgoal):
 1. \<And>x::'a. (H \<circ> F) x \<sqsubseteq> (F \<circ> G) x
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) (?x::'a::refinement_lattice) \<sqsubseteq> (F \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) ?x

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) (?x::'a::refinement_lattice) \<sqsubseteq> (F \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) ?x
[PROOF STEP]
show "gfp H \<sqsubseteq> F (gfp G)"
[PROOF STATE]
proof (prove)
using this:
((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) (?x::'a::refinement_lattice) \<sqsubseteq> (F \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) ?x

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using monoH distF fusion_gfp_geq
[PROOF STATE]
proof (prove)
using this:
((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) (?x::'a::refinement_lattice) \<sqsubseteq> (F \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) ?x
mono (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
dist_over_inf (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
\<lbrakk>mono (?H::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice); dist_over_inf (?F::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice); \<And>x::?'a::refinement_lattice. (?H \<circ> ?F) x \<sqsubseteq> (?F \<circ> (?G::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice)) x\<rbrakk> \<Longrightarrow> gfp ?H \<sqsubseteq> ?F (gfp ?G)

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))

goal:
No subgoals!
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma element_power_order_eq_1:
    assumes x: "x \<in> carrier (mult_of R)"
    shows "x [^]\<^bsub>(mult_of R)\<^esub> Coset.order (mult_of R) = \<one>\<^bsub>(mult_of R)\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>mult_of R\<^esub> order (mult_of R) = \<one>\<^bsub>mult_of R\<^esub>
[PROOF STEP]
by (meson field_R.field_mult_group finite_carrier_mult_of group.pow_order_eq_1 x)


[STATEMENT]
lemma "\<exists>(x::'a::linordered_field) y. x \<noteq> y \<and> 10 * x \<noteq> 9 * y \<and> 10 * x < y \<longrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y \<and> (10::'a) * x \<noteq> (9::'a) * y \<and> (10::'a) * x < y \<longrightarrow> x < y
[PROOF STEP]
by ferrack


[STATEMENT]
lemma continuous_levelset_openin:
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
  shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow>
        openin (top_of_set s) {x \<in> s. f x = a} \<Longrightarrow>
        (\<exists>x \<in> s. f x = a)  \<Longrightarrow> (\<forall>x \<in> s. f x = a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected s; continuous_on s f; openin (top_of_set s) {x \<in> s. f x = a}; \<exists>x\<in>s. f x = a\<rbrakk> \<Longrightarrow> \<forall>x\<in>s. f x = a
[PROOF STEP]
using continuous_levelset_openin_cases[of s f ]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>connected s; continuous_on s f; openin (top_of_set s) {x \<in> s. f x = ?a}\<rbrakk> \<Longrightarrow> (\<forall>x\<in>s. f x \<noteq> ?a) \<or> (\<forall>x\<in>s. f x = ?a)

goal (1 subgoal):
 1. \<lbrakk>connected s; continuous_on s f; openin (top_of_set s) {x \<in> s. f x = a}; \<exists>x\<in>s. f x = a\<rbrakk> \<Longrightarrow> \<forall>x\<in>s. f x = a
[PROOF STEP]
by meson


[STATEMENT]
theorem dual_star_fix: "x^\<otimes> = (x * (x^\<otimes>)) \<squnion> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ \<otimes> = x * x ^ \<otimes> \<squnion> (1::'a)
[PROOF STEP]
by (metis dual_comp dual_dual dual_inf dual_one dual_star_def star_fix)


[STATEMENT]
lemma contour_integrable_part_circlepath_iff:
  assumes "a < b"
  shows "f contour_integrable_on (part_circlepath c r a b) \<longleftrightarrow>
           (\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f contour_integrable_on part_circlepath c r a b) = ((\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. (f contour_integrable_on part_circlepath c r a b) = ((\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b})
[PROOF STEP]
by (auto simp: contour_integrable_on_def integrable_on_def
                             has_contour_integral_part_circlepath_iff)


[STATEMENT]
lemma nrows_move_matrix_le: "nrows (move_matrix A j i) <= nat((int (nrows A)) + j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows (move_matrix A j i) \<le> nat (int (nrows A) + j)
[PROOF STEP]
apply (auto simp add: nrows_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ja ia. \<lbrakk>nat (int (nrows A) + j) \<le> ja; \<not> int ja < j; \<not> int ia < i\<rbrakk> \<Longrightarrow> Rep_matrix A (nat (int ja - j)) (nat (int ia - i)) = (0::'a)
[PROOF STEP]
apply (rule nrows)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ja ia. \<lbrakk>nat (int (nrows A) + j) \<le> ja; \<not> int ja < j; \<not> int ia < i\<rbrakk> \<Longrightarrow> nrows A \<le> nat (int ja - j)
[PROOF STEP]
apply (arith)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_subcls1: "finite (subcls1 G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subcls1 G)
[PROOF STEP]
apply(simp add: subcls1_def2 del: mem_Sigma_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (SIGMA C:{C. is_class G C}. {D. fst (the (class G C)) = D \<and> C \<noteq> Object})
[PROOF STEP]
apply(rule finite_SigmaI [OF finite_is_class])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C. C \<in> {C. is_class G C} \<Longrightarrow> finite {D. fst (the (class G C)) = D \<and> C \<noteq> Object}
[PROOF STEP]
apply(rule_tac B = "{fst (the (class G C))}" in finite_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>C. C \<in> {C. is_class G C} \<Longrightarrow> {D. fst (the (class G C)) = D \<and> C \<noteq> Object} \<subseteq> {fst (the (class G C))}
 2. \<And>C. C \<in> {C. is_class G C} \<Longrightarrow> finite {fst (the (class G C))}
[PROOF STEP]
apply  auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ordinal_minus_0 [simp]: "x - 0 = (x::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - 0 = x
[PROOF STEP]
by (rule_tac a=x in oLimit_induct, simp_all)


[STATEMENT]
lemma SD_strict_singleton_right:
  assumes "x \<in> carrier" "q \<in> lotteries_on carrier"
  shows   "q \<prec>[SD(le)] return_pmf x \<longleftrightarrow> (\<forall>y\<in>set_pmf q. y \<preceq>[le] x) \<and> (\<exists>y\<in>set_pmf q. (y \<prec>[le] x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<prec>[SD le] return_pmf x = ((\<forall>y\<in>set_pmf q. le y x) \<and> (\<exists>y\<in>set_pmf q. y \<prec>[le] x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier
q \<in> lotteries_on carrier

goal (1 subgoal):
 1. q \<prec>[SD le] return_pmf x = ((\<forall>y\<in>set_pmf q. le y x) \<and> (\<exists>y\<in>set_pmf q. y \<prec>[le] x))
[PROOF STEP]
by (auto simp add: strongly_preferred_def SD_singleton_left SD_singleton_right)


[STATEMENT]
lemma Min_set_memE:
  assumes "x \<in> Min_set m As a"
  assumes "f \<in> As"
  shows "val (a x) \<le> val (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (a x) \<le> val (f x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> Min_set m As a
f \<in> As

goal (1 subgoal):
 1. val (a x) \<le> val (f x)
[PROOF STEP]
unfolding Min_set_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<inter> (\<Inter>f\<in>As. {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). val (a x) \<le> val (f x)})
f \<in> As

goal (1 subgoal):
 1. val (a x) \<le> val (f x)
[PROOF STEP]
by blast


[STATEMENT]
lemma card_of_Fpow_infinite[simp]:
assumes "\<not>finite A"
shows "|Fpow A| =o |A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Fpow A| =o |A|
[PROOF STEP]
using assms card_of_Fpow_lists card_of_lists_infinite card_of_Fpow
      ordLeq_ordIso_trans ordIso_iff_ordLeq
[PROOF STATE]
proof (prove)
using this:
infinite A
|Fpow ?A| \<le>o |lists ?A|
infinite ?A \<Longrightarrow> |lists ?A| =o |?A|
|?A| \<le>o |Fpow ?A|
\<lbrakk>?r \<le>o ?r'; ?r' =o ?r''\<rbrakk> \<Longrightarrow> ?r \<le>o ?r''
(?r =o ?r') = (?r \<le>o ?r' \<and> ?r' \<le>o ?r)

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


[STATEMENT]
lemma mset_image_comp:
  shows "{# (f x). x \<in># {# (g x). x \<in># E #} #} = {# (f (g x)). x \<in># E #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (image_mset g E) = {#f (g x). x \<in># E#}
[PROOF STEP]
by (simp add: image_mset.compositionality comp_def)


[STATEMENT]
lemma
  assumes "vi v n \<le> vi v (Suc n)"
  shows "vi v (n + m) \<le> vi v (Suc n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
have "vi v (n + m) \<le> vi (vi v n) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v)
[PROOF STEP]
by (simp add: Groups.add_ac(2) funpow_add funpow_swap1)
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
have "\<dots> \<le> vi v (Suc n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v) \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
using \<L>\<^sub>b_iter_mono[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<L>\<^sub>b ^^ ?n) ((\<L>\<^sub>b ^^ n) v) \<le> (\<L>\<^sub>b ^^ ?n) ((\<L>\<^sub>b ^^ Suc n) v)

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v) \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
by (auto simp only: add.commute funpow_add o_apply)
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ m) ((\<L>\<^sub>b ^^ n) v) \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v

goal (1 subgoal):
 1. (\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<L>\<^sub>b ^^ (n + m)) v \<le> (\<L>\<^sub>b ^^ (Suc n + m)) v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in prob_space) prob_Collect_eq_1:
  "{x \<in> space M. P x} \<in> sets M \<Longrightarrow> \<P>(x in M. P x) = 1 \<longleftrightarrow> (AE x in M. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> events \<Longrightarrow> (prob {x \<in> space M. P x} = 1) = almost_everywhere M P
[PROOF STEP]
using AE_in_set_eq_1[of "{x\<in>space M. P x}"]
[PROOF STATE]
proof (prove)
using this:
{x \<in> space M. P x} \<in> events \<Longrightarrow> (AE x in M. x \<in> {x \<in> space M. P x}) = (prob {x \<in> space M. P x} = 1)

goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> events \<Longrightarrow> (prob {x \<in> space M. P x} = 1) = almost_everywhere M P
[PROOF STEP]
by simp


[STATEMENT]
lemma imod_idiv_equality: "(m::enat) div n * n + m mod n = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m div n * n + m mod n = m
[PROOF STEP]
by (insert idiv_imod_equality[of m n 0], simp)


[STATEMENT]
lemma fst_least_max_arg_max_list:
  fixes f :: "_ \<Rightarrow> _ :: linorder"
  assumes "sorted (n#xs)"
  shows "fst (least_max_arg_max_list f (n, f n) xs)
  = (LEAST x. is_arg_max f (\<lambda>x. x \<in> insert n (set xs)) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (least_max_arg_max_list f (n, f n) xs) = (LEAST x. is_arg_max f (\<lambda>x. x \<in> insert n (set xs)) x)
[PROOF STEP]
unfolding least_max_arg_max_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = (LEAST x. is_arg_max f (\<lambda>x. x \<in> insert n (set xs)) x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted (n # xs)

goal (1 subgoal):
 1. fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = (LEAST x. is_arg_max f (\<lambda>x. x \<in> insert n (set xs)) x)
[PROOF STEP]
proof (induction xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. sorted [n] \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) []) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set [])))
 2. \<And>a xs n. \<lbrakk>\<And>n. sorted (n # xs) \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set xs))); sorted (n # a # xs)\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
sorted [n]

goal (2 subgoals):
 1. \<And>n. sorted [n] \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) []) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set [])))
 2. \<And>a xs n. \<lbrakk>\<And>n. sorted (n # xs) \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set xs))); sorted (n # a # xs)\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sorted [n]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sorted [n]

goal (1 subgoal):
 1. fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) []) = (LEAST a. is_arg_max f (\<lambda>x. x \<in> insert n (set [])) a)
[PROOF STEP]
by (auto simp: is_arg_max_def intro!: Least_equality[symmetric])
[PROOF STATE]
proof (state)
this:
fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) []) = (LEAST a. is_arg_max f (\<lambda>x. x \<in> insert n (set [])) a)

goal (1 subgoal):
 1. \<And>a xs n. \<lbrakk>\<And>n. sorted (n # xs) \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set xs))); sorted (n # a # xs)\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs n. \<lbrakk>\<And>n. sorted (n # xs) \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set xs))); sorted (n # a # xs)\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))))
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
sorted (?n # xs) \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (?n, f ?n) xs) = (LEAST a. is_arg_max f (\<lambda>x. x \<in> insert ?n (set xs)) a)
sorted (n # a # xs)

goal (1 subgoal):
 1. \<And>a xs n. \<lbrakk>\<And>n. sorted (n # xs) \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set xs))); sorted (n # a # xs)\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))))
[PROOF STEP]
hence "sorted (a#xs)"
[PROOF STATE]
proof (prove)
using this:
sorted (?n # xs) \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (?n, f ?n) xs) = (LEAST a. is_arg_max f (\<lambda>x. x \<in> insert ?n (set xs)) a)
sorted (n # a # xs)

goal (1 subgoal):
 1. sorted (a # xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sorted (a # xs)

goal (1 subgoal):
 1. \<And>a xs n. \<lbrakk>\<And>n. sorted (n # xs) \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) xs) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set xs))); sorted (n # a # xs)\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>(am, m) x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = Least (is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sorted (a # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sorted (a # xs)

goal (1 subgoal):
 1. fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
proof (cases "f a > f n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>sorted (a # xs); f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
 2. \<lbrakk>sorted (a # xs); \<not> f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f n < f a

goal (2 subgoals):
 1. \<lbrakk>sorted (a # xs); f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
 2. \<lbrakk>sorted (a # xs); \<not> f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f n < f a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f n < f a

goal (1 subgoal):
 1. fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
by (fastforce simp: is_arg_max_def Cons.IH[OF \<open>sorted (a#xs)\<close>] intro!: cong[of Least, OF refl])
[PROOF STATE]
proof (state)
this:
fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)

goal (1 subgoal):
 1. \<lbrakk>sorted (a # xs); \<not> f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>sorted (a # xs); \<not> f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f n < f a

goal (1 subgoal):
 1. \<lbrakk>sorted (a # xs); \<not> f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
have "(LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
      = (LEAST b. is_arg_max f (\<lambda>x. x \<in> (set (n # xs))) b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
proof (cases "is_arg_max f (\<lambda>x. x \<in> set (n #a# xs)) a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
 2. \<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a

goal (2 subgoals):
 1. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
 2. \<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
hence "(LEAST b. is_arg_max f (\<lambda>x. x \<in>  (set (n#a # xs))) b) = n"
[PROOF STATE]
proof (prove)
using this:
is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a

goal (1 subgoal):
 1. (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) b) = n
[PROOF STEP]
using Cons False
[PROOF STATE]
proof (prove)
using this:
is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a
sorted (?n # xs) \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (?n, f ?n) xs) = (LEAST a. is_arg_max f (\<lambda>x. x \<in> insert ?n (set xs)) a)
sorted (n # a # xs)
\<not> f n < f a

goal (1 subgoal):
 1. (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) b) = n
[PROOF STEP]
by (fastforce simp: is_arg_max_linorder intro!: Least_equality)
[PROOF STATE]
proof (state)
this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) b) = n

goal (2 subgoals):
 1. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
 2. \<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) b) = n

goal (1 subgoal):
 1. (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
using False True Cons
[PROOF STATE]
proof (prove)
using this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) b) = n
\<not> f n < f a
is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a
sorted (?n # xs) \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (?n, f ?n) xs) = (LEAST a. is_arg_max f (\<lambda>x. x \<in> insert ?n (set xs)) a)
sorted (n # a # xs)

goal (1 subgoal):
 1. (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
by (fastforce simp: is_arg_max_linorder intro!: Least_equality[symmetric])
[PROOF STATE]
proof (state)
this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)

goal (1 subgoal):
 1. \<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a

goal (1 subgoal):
 1. \<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a \<Longrightarrow> (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> is_arg_max f (\<lambda>x. x \<in> set (n # a # xs)) a

goal (1 subgoal):
 1. (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
[PROOF STEP]
by (fastforce simp: not_less is_arg_max_linorder intro!: cong[of Least, OF refl])
[PROOF STATE]
proof (state)
this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)

goal (1 subgoal):
 1. \<lbrakk>sorted (a # xs); \<not> f n < f a\<rbrakk> \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)

goal (1 subgoal):
 1. fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
using False Cons
[PROOF STATE]
proof (prove)
using this:
(LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> set (n # xs)) b)
\<not> f n < f a
sorted (?n # xs) \<Longrightarrow> fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (?n, f ?n) xs) = (LEAST a. is_arg_max f (\<lambda>x. x \<in> insert ?n (set xs)) a)
sorted (n # a # xs)

goal (1 subgoal):
 1. fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)
[PROOF STEP]
by (auto simp add: Cons.IH[OF \<open>sorted (a#xs)\<close>])
[PROOF STATE]
proof (state)
this:
fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fst (foldl (\<lambda>a. case a of (am, m) \<Rightarrow> \<lambda>x. if m < f x then (x, f x) else (am, m)) (n, f n) (a # xs)) = (LEAST b. is_arg_max f (\<lambda>x. x \<in> insert n (set (a # xs))) b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma or_int_rec:
  \<open>k OR l = of_bool (odd k \<or> odd l) + 2 * ((k div 2) OR (l div 2))\<close>
  for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k OR l = of_bool (odd k \<or> odd l) + 2 * (k div 2 OR l div 2)
[PROOF STEP]
using and_int_rec [of \<open>NOT k\<close> \<open>NOT l\<close>]
[PROOF STATE]
proof (prove)
using this:
NOT k AND NOT l = of_bool (odd (NOT k) \<and> odd (NOT l)) + 2 * (NOT k div 2 AND NOT l div 2)

goal (1 subgoal):
 1. k OR l = of_bool (odd k \<or> odd l) + 2 * (k div 2 OR l div 2)
[PROOF STEP]
by (simp add: or_int_def even_not_iff_int not_int_div_2)
    (simp_all add: not_int_def)


[STATEMENT]
lemma (in prob_space) normal_distributed_expectation:
  assumes \<sigma>[arith]: "0 < \<sigma>"
  assumes D: "distributed M lborel X (normal_density \<mu> \<sigma>)"
  shows "expectation X = \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation X = \<mu>
[PROOF STEP]
using integral_normal_moment_nz_1[OF \<sigma>, of \<mu>] distributed_integral[OF D, of "\<lambda>x. x", symmetric]
[PROOF STATE]
proof (prove)
using this:
LBINT x. normal_density \<mu> \<sigma> x * x = \<mu>
\<lbrakk>(\<lambda>x. x) \<in> borel_measurable lborel; \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> normal_density \<mu> \<sigma> x\<rbrakk> \<Longrightarrow> expectation X = LBINT x. normal_density \<mu> \<sigma> x * x

goal (1 subgoal):
 1. expectation X = \<mu>
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
theorem primes_infinite: "\<not> finite {p. prime p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {p. prime p}
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {p. prime p}
[PROOF STEP]
@obtain b where "prime b" "Max {p. prime p} < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {p. prime p}
[PROOF STEP]
@qed


[STATEMENT]
lemma integral_pmf_of_multiset:
  "A \<noteq> {#} \<Longrightarrow> (\<integral>x. (f x :: real) \<partial>measure_pmf (pmf_of_multiset A)) =
     (\<Sum>x\<in>set_mset A. of_nat (count A x) * f x) / of_nat (size A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {#} \<Longrightarrow> measure_pmf.expectation (pmf_of_multiset A) f = (\<Sum>x\<in>set_mset A. real (count A x) * f x) / real (size A)
[PROOF STEP]
by (subst integral_measure_pmf[where A = "set_mset A"])
     (simp_all add: sum_divide_distrib mult_ac)


[STATEMENT]
lemma frac_add:
  "frac (x + y) = (if frac x + frac y < 1 then frac x + frac y else (frac x + frac y) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frac (x + y) = (if frac x + frac y < (1::'a) then frac x + frac y else frac x + frac y - (1::'a))
[PROOF STEP]
by (simp add: frac_def floor_add)


[STATEMENT]
lemma dot_matrix_product:
  "(x::real^'n) \<bullet> y = (((rowvector x ::real^'n^1) ** (columnvector y :: real^1^'n))$1)$1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet> y = (rowvector x ** columnvector y) $ 1 $ 1
[PROOF STEP]
by (vector matrix_matrix_mult_def rowvector_def columnvector_def inner_vec_def)


[STATEMENT]
lemma integral_subalgebra2:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes "subalgebra M F" and
    [measurable]: "f \<in> borel_measurable F"
  shows "(\<integral>x. f x \<partial>(restr_to_subalg M F)) = (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (restr_to_subalg M F) f = integral\<^sup>L M f
[PROOF STEP]
by (rule integral_subalgebra,
    metis measurable_in_subalg[OF assms(1)] assms(2),
    auto simp add: assms space_restr_to_subalg sets_restr_to_subalg emeasure_restr_to_subalg,
    meson assms(1) subalgebra_def subset_eq)


[STATEMENT]
lemma adjoint_mult: "adjoint (f o g) = adjoint f o adjoint g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (f \<cdot> g) = adjoint f \<cdot> adjoint g
[PROOF STEP]
by (auto simp: adjoint_def)


[STATEMENT]
lemma lattice_of_append_det_preserves:
  assumes k_det: "k = abs (Determinant.det (mat_of_rows n fs_init))"
  and mn: "m = n"
  and A: "A = (mat_of_rows n fs_init) @\<^sub>r (k \<cdot>\<^sub>m (1\<^sub>m m))"
shows "lattice_of (Matrix.rows A) = lattice_of fs_init"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
have "Matrix.rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = (Matrix.rows (mat_of_rows n fs_init) @ Matrix.rows (k \<cdot>\<^sub>m (1\<^sub>m m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = rows (mat_of_rows n fs_init) @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)
[PROOF STEP]
by (rule rows_append_rows, insert fs_init len mn, auto)
[PROOF STATE]
proof (state)
this:
rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = rows (mat_of_rows n fs_init) @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = rows (mat_of_rows n fs_init) @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
have "... = (fs_init @ Matrix.rows (k \<cdot>\<^sub>m (1\<^sub>m m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rows (mat_of_rows n fs_init) @ rows (k \<cdot>\<^sub>m 1\<^sub>m m) = fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)
[PROOF STEP]
by (simp add: fs_init)
[PROOF STATE]
proof (state)
this:
rows (mat_of_rows n fs_init) @ rows (k \<cdot>\<^sub>m 1\<^sub>m m) = fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)
[PROOF STEP]
have rw: "Matrix.rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m)
    = (fs_init @ Matrix.rows (k \<cdot>\<^sub>m (1\<^sub>m m)))"
[PROOF STATE]
proof (prove)
using this:
rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)

goal (1 subgoal):
 1. rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rows (mat_of_rows n fs_init @\<^sub>r k \<cdot>\<^sub>m 1\<^sub>m m) = fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
have "lattice_of (Matrix.rows A) = lattice_of (fs_init @ Matrix.rows (k \<cdot>\<^sub>m (1\<^sub>m m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
by (rule arg_cong[of _ _ lattice_of], auto simp add: A rw)
[PROOF STATE]
proof (state)
this:
lattice_of (rows A) = lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m))

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lattice_of (rows A) = lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m))

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
have "... = lattice_of fs_init"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
proof (cases "k = Determinant.det (mat_of_rows n fs_init)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
 2. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k = det (mat_of_rows n fs_init)

goal (2 subgoals):
 1. k = det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
 2. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = det (mat_of_rows n fs_init)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = det (mat_of_rows n fs_init)

goal (1 subgoal):
 1. lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
by (rule already_in_lattice_append[symmetric, OF fs_init
             lattice_of_kId_subset_fs_init[OF _ mn]], insert mn, auto simp add: Matrix.rows_def)
[PROOF STATE]
proof (state)
this:
lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init

goal (1 subgoal):
 1. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
k \<noteq> det (mat_of_rows n fs_init)

goal (1 subgoal):
 1. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
hence k2: "k = -Determinant.det (mat_of_rows n fs_init)"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> det (mat_of_rows n fs_init)

goal (1 subgoal):
 1. k = - det (mat_of_rows n fs_init)
[PROOF STEP]
using k_det
[PROOF STATE]
proof (prove)
using this:
k \<noteq> det (mat_of_rows n fs_init)
k = \<bar>det (mat_of_rows n fs_init)\<bar>

goal (1 subgoal):
 1. k = - det (mat_of_rows n fs_init)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k = - det (mat_of_rows n fs_init)

goal (1 subgoal):
 1. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
have l: "lattice_of (Matrix.rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init
[PROOF STEP]
by (rule lattice_of_kId_subset_fs_init[OF _ mn], insert k2, auto)
[PROOF STATE]
proof (state)
this:
lattice_of (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init

goal (1 subgoal):
 1. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
have l2: "lattice_of (Matrix.rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of (Matrix.rows (k \<cdot>\<^sub>m 1\<^sub>m m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
proof (rule mat_mult_invertible_lattice_eq)
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. ?P \<in> carrier_mat ?m ?m
 4. invertible_mat ?P
 5. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = ?m
 6. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = ?m
 7. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom ?P * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
let ?P = "(- 1::int) \<cdot>\<^sub>m 1\<^sub>m m"
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. ?P \<in> carrier_mat ?m ?m
 4. invertible_mat ?P
 5. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = ?m
 6. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = ?m
 7. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom ?P * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
show P: "?P \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 \<cdot>\<^sub>m 1\<^sub>m m \<in> carrier_mat m m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- 1 \<cdot>\<^sub>m 1\<^sub>m m \<in> carrier_mat m m

goal (6 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. invertible_mat (- 1 \<cdot>\<^sub>m 1\<^sub>m m)
 4. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 5. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 6. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom (- 1 \<cdot>\<^sub>m 1\<^sub>m m) * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
have "det ?P = 1 \<or> det ?P = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (- 1 \<cdot>\<^sub>m 1\<^sub>m m) = 1 \<or> det (- 1 \<cdot>\<^sub>m 1\<^sub>m m) = - 1
[PROOF STEP]
unfolding det_smult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ dim_col (1\<^sub>m m) * det (1\<^sub>m m) = 1 \<or> (- 1) ^ dim_col (1\<^sub>m m) * det (1\<^sub>m m) = - 1
[PROOF STEP]
by (auto simp add: minus_1_power_even)
[PROOF STATE]
proof (state)
this:
det (- 1 \<cdot>\<^sub>m 1\<^sub>m m) = 1 \<or> det (- 1 \<cdot>\<^sub>m 1\<^sub>m m) = - 1

goal (6 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. invertible_mat (- 1 \<cdot>\<^sub>m 1\<^sub>m m)
 4. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 5. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 6. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom (- 1 \<cdot>\<^sub>m 1\<^sub>m m) * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
hence "det ?P dvd 1"
[PROOF STATE]
proof (prove)
using this:
det (- 1 \<cdot>\<^sub>m 1\<^sub>m m) = 1 \<or> det (- 1 \<cdot>\<^sub>m 1\<^sub>m m) = - 1

goal (1 subgoal):
 1. is_unit (det (- 1 \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
by (smt minus_dvd_iff one_dvd)
[PROOF STATE]
proof (state)
this:
is_unit (det (- 1 \<cdot>\<^sub>m 1\<^sub>m m))

goal (6 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. invertible_mat (- 1 \<cdot>\<^sub>m 1\<^sub>m m)
 4. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 5. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 6. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom (- 1 \<cdot>\<^sub>m 1\<^sub>m m) * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
thus " invertible_mat ?P"
[PROOF STATE]
proof (prove)
using this:
is_unit (det (- 1 \<cdot>\<^sub>m 1\<^sub>m m))

goal (1 subgoal):
 1. invertible_mat (- 1 \<cdot>\<^sub>m 1\<^sub>m m)
[PROOF STEP]
unfolding invertible_iff_is_unit_JNF[OF P]
[PROOF STATE]
proof (prove)
using this:
is_unit (det (- 1 \<cdot>\<^sub>m 1\<^sub>m m))

goal (1 subgoal):
 1. is_unit (det (- 1 \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
invertible_mat (- 1 \<cdot>\<^sub>m 1\<^sub>m m)

goal (5 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 4. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 5. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom (- 1 \<cdot>\<^sub>m 1\<^sub>m m) * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
have "(- k \<cdot>\<^sub>m 1\<^sub>m m) = ?P * (k \<cdot>\<^sub>m 1\<^sub>m m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - k \<cdot>\<^sub>m 1\<^sub>m m = - 1 \<cdot>\<^sub>m 1\<^sub>m m * (k \<cdot>\<^sub>m 1\<^sub>m m)
[PROOF STEP]
unfolding mat_diag_smult[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_diag m (\<lambda>x. - k) = mat_diag m (\<lambda>x. - 1) * mat_diag m (\<lambda>x. k)
[PROOF STEP]
unfolding mat_diag_diag
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_diag m (\<lambda>x. - k) = mat_diag m (\<lambda>i. - 1 * k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- k \<cdot>\<^sub>m 1\<^sub>m m = - 1 \<cdot>\<^sub>m 1\<^sub>m m * (k \<cdot>\<^sub>m 1\<^sub>m m)

goal (5 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 4. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 5. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom (- 1 \<cdot>\<^sub>m 1\<^sub>m m) * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
thus " mat_of_rows n (Matrix.rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom ?P * mat_of_rows n (Matrix.rows (k \<cdot>\<^sub>m 1\<^sub>m m))"
[PROOF STATE]
proof (prove)
using this:
- k \<cdot>\<^sub>m 1\<^sub>m m = - 1 \<cdot>\<^sub>m 1\<^sub>m m * (k \<cdot>\<^sub>m 1\<^sub>m m)

goal (1 subgoal):
 1. mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom (- 1 \<cdot>\<^sub>m 1\<^sub>m m) * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
[PROOF STEP]
by (metis mn index_one_mat(3) index_smult_mat(3) mat_of_rows_rows of_int_mat_hom_int_id)
[PROOF STATE]
proof (state)
this:
mat_of_rows n (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = of_int_hom.mat_hom (- 1 \<cdot>\<^sub>m 1\<^sub>m m) * mat_of_rows n (rows (k \<cdot>\<^sub>m 1\<^sub>m m))

goal (4 subgoals):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 2. set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
 3. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 4. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = m
[PROOF STEP]
show " set (Matrix.rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n"
        and "set (Matrix.rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n &&& set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
[PROOF STEP]
using assms(2) one_carrier_mat set_rows_carrier smult_carrier_mat
[PROOF STATE]
proof (prove)
using this:
m = n
1\<^sub>m ?n \<in> carrier_mat ?n ?n
\<lbrakk>?A \<in> carrier_mat ?m ?n; ?v \<in> set (rows ?A)\<rbrakk> \<Longrightarrow> ?v \<in> carrier_vec ?n
?A \<in> carrier_mat ?nr ?nc \<Longrightarrow> ?k \<cdot>\<^sub>m ?A \<in> carrier_mat ?nr ?nc

goal (1 subgoal):
 1. set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n &&& set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
set (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n
set (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> carrier_vec n

goal (2 subgoals):
 1. length (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = m
 2. length (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = m
[PROOF STEP]
qed (insert mn, auto)
[PROOF STATE]
proof (state)
this:
lattice_of (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of (rows (k \<cdot>\<^sub>m 1\<^sub>m m))

goal (1 subgoal):
 1. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
hence l2: "lattice_of (Matrix.rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init"
[PROOF STATE]
proof (prove)
using this:
lattice_of (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of (rows (k \<cdot>\<^sub>m 1\<^sub>m m))

goal (1 subgoal):
 1. lattice_of (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init
[PROOF STEP]
using l
[PROOF STATE]
proof (prove)
using this:
lattice_of (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of (rows (k \<cdot>\<^sub>m 1\<^sub>m m))
lattice_of (rows (- k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init

goal (1 subgoal):
 1. lattice_of (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lattice_of (rows (k \<cdot>\<^sub>m 1\<^sub>m m)) \<subseteq> lattice_of fs_init

goal (1 subgoal):
 1. k \<noteq> det (mat_of_rows n fs_init) \<Longrightarrow> lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init
[PROOF STEP]
by (rule already_in_lattice_append[symmetric, OF fs_init l2],
          insert mn one_carrier_mat set_rows_carrier smult_carrier_mat, blast)
[PROOF STATE]
proof (state)
this:
lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lattice_of (fs_init @ rows (k \<cdot>\<^sub>m 1\<^sub>m m)) = lattice_of fs_init

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lattice_of (rows A) = lattice_of fs_init

goal (1 subgoal):
 1. lattice_of (rows A) = lattice_of fs_init
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lattice_of (rows A) = lattice_of fs_init

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma explicit_subset_rel_interior_convex_hull_minimal:
  fixes S :: "'a::euclidean_space set"
  shows "finite S
         \<Longrightarrow> {y. \<exists>u. (\<forall>x \<in> S. 0 < u x) \<and> sum u S = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}
             \<subseteq> rel_interior (convex hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> {y. \<exists>u. (\<forall>x\<in>S. 0 < u x) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y} \<subseteq> rel_interior (convex hull S)
[PROOF STEP]
by (force simp add:  rel_interior_convex_hull_union [where S="\<lambda>x. {x}" and I=S, simplified])


[STATEMENT]
theorem wls_subst_Op_simp[simp]:
assumes "wls (asSort ys) Y"
 and "wlsInp delta inp" and "wlsBinp delta binp"
shows
"((Op delta inp binp) #[Y / y]_ys) =
 Op delta (inp %[Y / y]_ys) (binp %%[Y / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Op delta inp binp #[Y / y]_ys = Op delta (inp %[Y / y]_ys) (binp %%[Y / y]_ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls (asSort ys) Y
wlsInp delta inp
wlsBinp delta binp

goal (1 subgoal):
 1. Op delta inp binp #[Y / y]_ys = Op delta (inp %[Y / y]_ys) (binp %%[Y / y]_ys)
[PROOF STEP]
unfolding subst_def substInp_def
                      substAbs_def substBinp_def
[PROOF STATE]
proof (prove)
using this:
wls (asSort ys) Y
wlsInp delta inp
wlsBinp delta binp

goal (1 subgoal):
 1. Op delta inp binp #[idEnv [y \<leftarrow> Y]_ys] = Op delta inp %[idEnv [y \<leftarrow> Y]_ys] binp %%[idEnv [y \<leftarrow> Y]_ys]
[PROOF STEP]
by auto


[STATEMENT]
lemma listwordinterval_adjacent:
    "(\<Union>s \<in> set (listwordinterval_adjacent ss). interval_of s) = (\<Union>s \<in> set ss. interval_of s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (interval_of ` set (listwordinterval_adjacent ss)) = \<Union> (interval_of ` set ss)
[PROOF STEP]
apply(induction ss rule: listwordinterval_adjacent.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (interval_of ` set (listwordinterval_adjacent [])) = \<Union> (interval_of ` set [])
 2. \<And>s e ss. \<lbrakk>\<forall>(s', e')\<in>set ss. \<not> (s \<le> e \<and> s' \<le> e' \<and> (word_next e = s' \<or> word_next e' = s)) \<Longrightarrow> \<Union> (interval_of ` set (listwordinterval_adjacent ss)) = \<Union> (interval_of ` set ss); \<not> (\<forall>(s', e')\<in>set ss. \<not> (s \<le> e \<and> s' \<le> e' \<and> (word_next e = s' \<or> word_next e' = s))) \<Longrightarrow> \<Union> (interval_of ` set (listwordinterval_adjacent (merge_adjacent (s, e) ss))) = \<Union> (interval_of ` set (merge_adjacent (s, e) ss))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (listwordinterval_adjacent ((s, e) # ss))) = \<Union> (interval_of ` set ((s, e) # ss))
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s e ss. \<lbrakk>\<forall>(s', e')\<in>set ss. \<not> (s \<le> e \<and> s' \<le> e' \<and> (word_next e = s' \<or> word_next e' = s)) \<Longrightarrow> \<Union> (interval_of ` set (listwordinterval_adjacent ss)) = \<Union> (interval_of ` set ss); \<not> (\<forall>(s', e')\<in>set ss. \<not> (s \<le> e \<and> s' \<le> e' \<and> (word_next e = s' \<or> word_next e' = s))) \<Longrightarrow> \<Union> (interval_of ` set (listwordinterval_adjacent (merge_adjacent (s, e) ss))) = \<Union> (interval_of ` set (merge_adjacent (s, e) ss))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (listwordinterval_adjacent ((s, e) # ss))) = \<Union> (interval_of ` set ((s, e) # ss))
[PROOF STEP]
apply(simp add: merge_adjacent_helper)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma  "(\<lambda>x::real. (cos (2*x) - 1) / (cos x - 1)) \<midarrow>0\<rightarrow> 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (cos (2 * x) - 1) / (cos x - 1)) \<midarrow>0\<rightarrow> 4
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma chain_homotopic_imp_homologous_rel:
  assumes
   "\<And>c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X' (h c)"
   "\<And>c. singular_chain (p -1) (subtopology X S) c \<Longrightarrow> singular_chain p (subtopology X' T) (h' c)"
   "\<And>c. singular_chain p X c
             \<Longrightarrow> (chain_boundary (Suc p) (h c)) + (h'(chain_boundary p c)) = f c - g c"
    "singular_relcycle p X S c"
  shows "homologous_rel p X' T (f c) (g c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homologous_rel p X' T (f c) (g c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homologous_rel p X' T (f c) (g c)
[PROOF STEP]
have "singular_chain p (subtopology X' T) (chain_boundary (Suc p) (h c) - (f c - g c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_chain p (subtopology X' T) (chain_boundary (Suc p) (h c) - (f c - g c))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
singular_chain p X ?c \<Longrightarrow> singular_chain (Suc p) X' (h ?c)
singular_chain (p - 1) (subtopology X S) ?c \<Longrightarrow> singular_chain p (subtopology X' T) (h' ?c)
singular_chain p X ?c \<Longrightarrow> chain_boundary (Suc p) (h ?c) + h' (chain_boundary p ?c) = f ?c - g ?c
singular_relcycle p X S c

goal (1 subgoal):
 1. singular_chain p (subtopology X' T) (chain_boundary (Suc p) (h c) - (f c - g c))
[PROOF STEP]
by (metis (no_types, lifting) add_diff_cancel_left' minus_diff_eq singular_chain_minus singular_relcycle)
[PROOF STATE]
proof (state)
this:
singular_chain p (subtopology X' T) (chain_boundary (Suc p) (h c) - (f c - g c))

goal (1 subgoal):
 1. homologous_rel p X' T (f c) (g c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
singular_chain p (subtopology X' T) (chain_boundary (Suc p) (h c) - (f c - g c))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
singular_chain p (subtopology X' T) (chain_boundary (Suc p) (h c) - (f c - g c))

goal (1 subgoal):
 1. homologous_rel p X' T (f c) (g c)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
singular_chain p (subtopology X' T) (chain_boundary (Suc p) (h c) - (f c - g c))
singular_chain p X ?c \<Longrightarrow> singular_chain (Suc p) X' (h ?c)
singular_chain (p - 1) (subtopology X S) ?c \<Longrightarrow> singular_chain p (subtopology X' T) (h' ?c)
singular_chain p X ?c \<Longrightarrow> chain_boundary (Suc p) (h ?c) + h' (chain_boundary p ?c) = f ?c - g ?c
singular_relcycle p X S c

goal (1 subgoal):
 1. homologous_rel p X' T (f c) (g c)
[PROOF STEP]
by (metis homologous_rel_def singular_relboundary singular_relcycle)
[PROOF STATE]
proof (state)
this:
homologous_rel p X' T (f c) (g c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fourier_sum_limit_Fejer_kernel_half:
  fixes n::nat
  assumes f: "f absolutely_integrable_on {-pi..pi}"
    and periodic: "\<And>x. f(x + 2*pi) = f x"
  shows "(\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2*r. Fourier_coefficient f k * trigonometric_set k t)) / n) \<longlonglongrightarrow> l
         \<longleftrightarrow>
         ((\<lambda>n. integral\<^sup>L (lebesgue_on {0..pi}) (\<lambda>x. Fejer_kernel n x * ((f(t + x) + f(t - x)) - 2*l)))  \<longlonglongrightarrow> 0)"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "?lhs \<longleftrightarrow>
        (\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2*r.  Fourier_coefficient f k * trigonometric_set k t)) / n - l) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: LIM_zero_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<dots> \<longleftrightarrow>
        (\<lambda>n. ((((\<Sum>r<n. \<Sum>k\<le>2*r.  Fourier_coefficient f k * trigonometric_set k t)) / n) - l) * pi) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) \<longlonglongrightarrow> 0 = (\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) * pi) \<longlonglongrightarrow> 0
[PROOF STEP]
using tendsto_mult_right_iff [OF pi_neq_zero]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. ?f x * pi) \<longlongrightarrow> ?l * pi) ?F = (?f \<longlongrightarrow> ?l) ?F

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) \<longlonglongrightarrow> 0 = (\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) * pi) \<longlonglongrightarrow> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) \<longlonglongrightarrow> 0 = (\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) * pi) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) \<longlonglongrightarrow> 0 = (\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) * pi) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) * pi) \<longlonglongrightarrow> 0 = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (intro Lim_transform_eq [OF Lim_transform_eventually [of "\<lambda>n. 0"]] eventually_sequentiallyI [of 1])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>n. 0) \<longlonglongrightarrow> 0
 2. \<And>x. 1 \<le> x \<Longrightarrow> 0 = ((\<Sum>r<x. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real x - l) * pi - (LINT xa|lebesgue_on {0..pi}. Fejer_kernel x xa * (f (t + xa) + f (t - xa) - 2 * l))
[PROOF STEP]
apply (simp_all add: Fourier_sum_offset_Fejer_kernel_half assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ((\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n - l) * pi) \<longlonglongrightarrow> 0 = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>r<n. \<Sum>k\<le>2 * r. Fourier_coefficient f k * trigonometric_set k t) / real n) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..pi}. Fejer_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0

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

goal:
No subgoals!
[PROOF STEP]
qed