[STATEMENT]
lemma ntcf_rcomp_Hom_NTMap_vdomain[cat_cs_simps]:
  assumes "\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<D>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(-,\<psi>-)\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<BB>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(-,\<psi>-)\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(-,\<psi>-)\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
interpret \<psi>: is_ntcf \<alpha> \<BB> \<CC> \<FF> \<GG> \<psi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(-,\<psi>-)\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(-,\<psi>-)\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding ntcf_rcomp_Hom_def \<psi>.ntcf_NTDGCod
[PROOF STATE]
proof (prove)
using this:
\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(ntcf_id (dghm_id \<CC>)-,\<psi>-)\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(-,\<psi>-)\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<BB>)\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fSup_subdistl_var:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows  "mono f \<Longrightarrow> (\<Squnion>g \<in> G. f \<circ> g) \<le> f \<circ> \<Squnion>G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> \<Squnion> ((\<circ>) f ` G) \<le> f \<circ> \<Squnion> G
[PROOF STEP]
by (simp add: SUP_least Sup_upper le_fun_def monoD image_comp)


[STATEMENT]
lemma eNorm_ge1_triangular_ineq:
  assumes "p \<ge> (1::real)"
  shows "eNorm (\<LL> p M) (x + y) \<le> eNorm (\<LL> p M) x + eNorm (\<LL> p M) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm (\<LL> (ennreal p) M) (x + y) \<le> eNorm (\<LL> (ennreal p) M) x + eNorm (\<LL> (ennreal p) M) y
[PROOF STEP]
using eNorm_triangular_ineq [of "(\<LL> p M)"] assms
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> (ennreal p) M) (?x + ?y) \<le> ennreal (defect (\<LL> (ennreal p) M)) * eNorm (\<LL> (ennreal p) M) ?x + ennreal (defect (\<LL> (ennreal p) M)) * eNorm (\<LL> (ennreal p) M) ?y
1 \<le> p

goal (1 subgoal):
 1. eNorm (\<LL> (ennreal p) M) (x + y) \<le> eNorm (\<LL> (ennreal p) M) x + eNorm (\<LL> (ennreal p) M) y
[PROOF STEP]
by (simp add: Lp(2))


[STATEMENT]
lemma exp_minus: "exp (- x) = inverse (exp x)"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- x) = inverse (exp x)
[PROOF STEP]
by (intro inverse_unique [symmetric] exp_minus_inverse)


[STATEMENT]
lemma emeasure_prod_count_space_single[simp]: "emeasure (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) {x} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) {x} = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) {x} = 1
[PROOF STEP]
have [simp]: "\<And>a b x y. indicator {(a, b)} (x, y) = (indicator {a} x * indicator {b} y::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x y. indicator {(a, b)} (x, y) = indicator {a} x * indicator {b} y
[PROOF STEP]
by (auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
indicator {(?a, ?b)} (?x, ?y) = indicator {?a} ?x * indicator {?b} ?y

goal (1 subgoal):
 1. emeasure (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) {x} = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) {x} = 1
[PROOF STEP]
by (cases x) (auto simp: emeasure_prod_count_space nn_integral_cmult sets_Pair)
[PROOF STATE]
proof (state)
this:
emeasure (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) {x} = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in domain) long_division_add_iff:
  assumes "subfield K R"
    and "a \<in> carrier (K[X])" "b \<in> carrier (K[X])" "c \<in> carrier (K[X])" "q \<in> carrier (K[X])"
  shows "a pmod q = b pmod q \<longleftrightarrow> (a \<oplus>\<^bsub>K[X]\<^esub> c) pmod q = (b \<oplus>\<^bsub>K[X]\<^esub> c) pmod q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a pmod q = b pmod q) = (a \<oplus>\<^bsub>K [X]\<^esub> c pmod q = b \<oplus>\<^bsub>K [X]\<^esub> c pmod q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a pmod q = b pmod q) = (a \<oplus>\<^bsub>K [X]\<^esub> c pmod q = b \<oplus>\<^bsub>K [X]\<^esub> c pmod q)
[PROOF STEP]
interpret UP: ring "K[X]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring (K [X])
[PROOF STEP]
using univ_poly_is_ring[OF subfieldE(1)[OF assms(1)]]
[PROOF STATE]
proof (prove)
using this:
ring (K [X])

goal (1 subgoal):
 1. ring (K [X])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a pmod q = b pmod q) = (a \<oplus>\<^bsub>K [X]\<^esub> c pmod q = b \<oplus>\<^bsub>K [X]\<^esub> c pmod q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a pmod q = b pmod q) = (a \<oplus>\<^bsub>K [X]\<^esub> c pmod q = b \<oplus>\<^bsub>K [X]\<^esub> c pmod q)
[PROOF STEP]
using assms(2-4)[THEN long_division_closed(2)[OF assms(1) _ assms(5)]]
[PROOF STATE]
proof (prove)
using this:
a pmod q \<in> carrier (K [X])
b pmod q \<in> carrier (K [X])
c pmod q \<in> carrier (K [X])

goal (1 subgoal):
 1. (a pmod q = b pmod q) = (a \<oplus>\<^bsub>K [X]\<^esub> c pmod q = b \<oplus>\<^bsub>K [X]\<^esub> c pmod q)
[PROOF STEP]
unfolding assms(2-3)[THEN long_division_add(2)[OF assms(1) _ assms(4-5)]]
[PROOF STATE]
proof (prove)
using this:
a pmod q \<in> carrier (K [X])
b pmod q \<in> carrier (K [X])
c pmod q \<in> carrier (K [X])

goal (1 subgoal):
 1. (a pmod q = b pmod q) = (a pmod q \<oplus>\<^bsub>K [X]\<^esub> (c pmod q) = b pmod q \<oplus>\<^bsub>K [X]\<^esub> (c pmod q))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a pmod q = b pmod q) = (a \<oplus>\<^bsub>K [X]\<^esub> c pmod q = b \<oplus>\<^bsub>K [X]\<^esub> c pmod q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_prod_minus1_le_prod_minus1:
  fixes f :: "nat \<Rightarrow> 'a :: {real_normed_div_algebra,comm_ring_1}"
  shows "norm (prod (\<lambda>n. 1 + f n) A - 1) \<le> prod (\<lambda>n. 1 + norm (f n)) A - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
[PROOF STEP]
proof (induction A rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
from insert.hyps
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
[PROOF STEP]
have
    "norm ((\<Prod>n\<in>insert x A. 1 + f n) - 1) =
       norm ((\<Prod>n\<in>A. 1 + f n) - 1 + f x * (\<Prod>n\<in>A. 1 + f n))"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. norm ((\<Prod>n\<in>insert x A. (1::'a) + f n) - (1::'a)) = norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a) + f x * (\<Prod>n\<in>A. (1::'a) + f n))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
norm ((\<Prod>n\<in>insert x A. (1::'a) + f n) - (1::'a)) = norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a) + f x * (\<Prod>n\<in>A. (1::'a) + f n))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((\<Prod>n\<in>insert x A. (1::'a) + f n) - (1::'a)) = norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a) + f x * (\<Prod>n\<in>A. (1::'a) + f n))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
have "\<dots> \<le> norm ((\<Prod>n\<in>A. 1 + f n) - 1) + norm (f x * (\<Prod>n\<in>A. 1 + f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a) + f x * (\<Prod>n\<in>A. (1::'a) + f n)) \<le> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) + norm (f x * (\<Prod>n\<in>A. (1::'a) + f n))
[PROOF STEP]
by (rule norm_triangle_ineq)
[PROOF STATE]
proof (state)
this:
norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a) + f x * (\<Prod>n\<in>A. (1::'a) + f n)) \<le> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) + norm (f x * (\<Prod>n\<in>A. (1::'a) + f n))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a) + f x * (\<Prod>n\<in>A. (1::'a) + f n)) \<le> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) + norm (f x * (\<Prod>n\<in>A. (1::'a) + f n))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
have "norm (f x * (\<Prod>n\<in>A. 1 + f n)) = norm (f x) * (\<Prod>x\<in>A. norm (1 + f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x * (\<Prod>n\<in>A. (1::'a) + f n)) = norm (f x) * (\<Prod>x\<in>A. norm ((1::'a) + f x))
[PROOF STEP]
by (simp add: prod_norm norm_mult)
[PROOF STATE]
proof (state)
this:
norm (f x * (\<Prod>n\<in>A. (1::'a) + f n)) = norm (f x) * (\<Prod>x\<in>A. norm ((1::'a) + f x))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f x * (\<Prod>n\<in>A. (1::'a) + f n)) = norm (f x) * (\<Prod>x\<in>A. norm ((1::'a) + f x))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
have "(\<Prod>x\<in>A. norm (1 + f x)) \<le> (\<Prod>x\<in>A. norm (1::'a) + norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>A. norm ((1::'a) + f x)) \<le> (\<Prod>x\<in>A. norm (1::'a) + norm (f x))
[PROOF STEP]
by (intro prod_mono norm_triangle_ineq ballI conjI) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>A. norm ((1::'a) + f x)) \<le> (\<Prod>x\<in>A. norm (1::'a) + norm (f x))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>A. norm ((1::'a) + f x)) \<le> (\<Prod>x\<in>A. norm (1::'a) + norm (f x))

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
have "norm (1::'a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (1::'a) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (1::'a) = 1

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (1::'a) = 1

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
note insert.IH
[PROOF STATE]
proof (state)
this:
norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
have "(\<Prod>n\<in>A. 1 + norm (f n)) - 1 + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x)) =
             (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>n\<in>A. 1 + norm (f n)) - 1 + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x)) = (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. (\<Prod>n\<in>A. 1 + norm (f n)) - 1 + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x)) = (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Prod>n\<in>A. 1 + norm (f n)) - 1 + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x)) = (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm ((\<Prod>n\<in>F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>F. 1 + norm (f n)) - 1\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x F. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x F. 1 + norm (f n)) - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>xa y. xa \<le> y \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) + norm (f x) * xa \<le> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) + norm (f x) * y; \<And>xa y. xa \<le> y \<Longrightarrow> xa + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x)) \<le> y + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x))\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>xa y. xa \<le> y \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) + norm (f x) * xa \<le> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) + norm (f x) * y; \<And>xa y. xa \<le> y \<Longrightarrow> xa + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x)) \<le> y + norm (f x) * (\<Prod>x\<in>A. 1 + norm (f x))\<rbrakk> \<Longrightarrow> norm ((\<Prod>n\<in>insert x A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1

goal (1 subgoal):
 1. norm ((\<Prod>n\<in>insert x A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1
[PROOF STEP]
by - (simp_all add: mult_left_mono)
[PROOF STATE]
proof (state)
this:
norm ((\<Prod>n\<in>insert x A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>insert x A. 1 + norm (f n)) - 1

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm ((\<Prod>n\<in>A. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>A. 1 + norm (f n)) - 1
 2. norm ((\<Prod>n\<in>{}. (1::'a) + f n) - (1::'a)) \<le> (\<Prod>n\<in>{}. 1 + norm (f n)) - 1
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma card_matching_vertex_cover:
  "\<lbrakk> finite C;  matching M;  M \<subseteq> E;  vertex_cover E C \<rbrakk> \<Longrightarrow> card M \<le> card C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite C; matching M; M \<subseteq> E; vertex_cover E C\<rbrakk> \<Longrightarrow> card M \<le> card C
[PROOF STEP]
apply(erule card_le_if_inj_on_rel[where r = "\<lambda>e v. v \<in> e"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. \<lbrakk>matching M; M \<subseteq> E; vertex_cover E C; a \<in> M\<rbrakk> \<Longrightarrow> \<exists>b. b \<in> C \<and> b \<in> a
 2. \<And>a1 a2 b. \<lbrakk>matching M; M \<subseteq> E; vertex_cover E C; a1 \<in> M; a2 \<in> M; b \<in> C; b \<in> a1; b \<in> a2\<rbrakk> \<Longrightarrow> a1 = a2
[PROOF STEP]
apply (meson disjnt_def disjnt_iff vertex_cover_def subsetCE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a1 a2 b. \<lbrakk>matching M; M \<subseteq> E; vertex_cover E C; a1 \<in> M; a2 \<in> M; b \<in> C; b \<in> a1; b \<in> a2\<rbrakk> \<Longrightarrow> a1 = a2
[PROOF STEP]
by (meson disjnt_iff pairwise_def)


[STATEMENT]
lemma val_relation_setE:
  assumes "as \<in> val_relation_set"
  shows "as!0 \<in> carrier Q\<^sub>p \<and> as!1 \<in> carrier Q\<^sub>p \<and> as = [as!0,as!1] \<and> val (as!1) \<le> val (as!0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. as ! 0 \<in> carrier Q\<^sub>p \<and> as ! 1 \<in> carrier Q\<^sub>p \<and> as = [as ! 0, as ! 1] \<and> val (as ! 1) \<le> val (as ! 0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
as \<in> val_relation_set

goal (1 subgoal):
 1. as ! 0 \<in> carrier Q\<^sub>p \<and> as ! 1 \<in> carrier Q\<^sub>p \<and> as = [as ! 0, as ! 1] \<and> val (as ! 1) \<le> val (as ! 0)
[PROOF STEP]
unfolding val_relation_set_def
[PROOF STATE]
proof (prove)
using this:
as \<in> {as \<in> carrier (Q\<^sub>p\<^bsup>2\<^esup>). val (as ! 1) \<le> val (as ! 0)}

goal (1 subgoal):
 1. as ! 0 \<in> carrier Q\<^sub>p \<and> as ! 1 \<in> carrier Q\<^sub>p \<and> as = [as ! 0, as ! 1] \<and> val (as ! 1) \<le> val (as ! 0)
[PROOF STEP]
by (smt cartesian_power_car_memE cartesian_power_car_memE' mem_Collect_eq one_less_numeral_iff pair_id pos2 semiring_norm(76))


[STATEMENT]
lemma Lindelof_space_subtopology_subset:
   "S \<subseteq> topspace X
        \<Longrightarrow> (Lindelof_space(subtopology X S) \<longleftrightarrow>
             (\<forall>\<U>. (\<forall>U \<in> \<U>. openin X U) \<and> S \<subseteq> \<Union>\<U>
                 \<longrightarrow> (\<exists>V. countable V \<and> V \<subseteq> \<U> \<and> S \<subseteq> \<Union>V)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> topspace X \<Longrightarrow> Lindelof_space (subtopology X S) = (\<forall>\<U>. (\<forall>U\<in>\<U>. openin X U) \<and> S \<subseteq> \<Union> \<U> \<longrightarrow> (\<exists>V. countable V \<and> V \<subseteq> \<U> \<and> S \<subseteq> \<Union> V))
[PROOF STEP]
by (metis Lindelof_space_subtopology topspace_subtopology topspace_subtopology_subset)


[STATEMENT]
lemma integral_minus_sets':
  fixes f::"real \<Rightarrow> 'a::banach"
  shows "c \<ge> a \<Longrightarrow> c \<ge> b \<Longrightarrow> f integrable_on {min a b .. c} \<Longrightarrow>
    integral {a .. c} f - integral {b .. c} f =
    (if a \<le> b then integral {a .. b} f else - integral {b .. a} f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> c; b \<le> c; f integrable_on {min a b..c}\<rbrakk> \<Longrightarrow> integral {a..c} f - integral {b..c} f = (if a \<le> b then integral {a..b} f else - integral {b..a} f)
[PROOF STEP]
using integral_combine[of b a c f] integral_combine[of a b c f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>b \<le> a; a \<le> c; f integrable_on {b..c}\<rbrakk> \<Longrightarrow> integral {b..a} f + integral {a..c} f = integral {b..c} f
\<lbrakk>a \<le> b; b \<le> c; f integrable_on {a..c}\<rbrakk> \<Longrightarrow> integral {a..b} f + integral {b..c} f = integral {a..c} f

goal (1 subgoal):
 1. \<lbrakk>a \<le> c; b \<le> c; f integrable_on {min a b..c}\<rbrakk> \<Longrightarrow> integral {a..c} f - integral {b..c} f = (if a \<le> b then integral {a..b} f else - integral {b..a} f)
[PROOF STEP]
by (auto simp: algebra_simps min_def)


[STATEMENT]
lemma ln_gt_zero_iff [simp]: "0 < x \<Longrightarrow> 0 < ln x \<longleftrightarrow> 1 < x"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (0 < ln x) = (1 < x)
[PROOF STEP]
using ln_less_cancel_iff [of 1 x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; 0 < x\<rbrakk> \<Longrightarrow> (ln 1 < ln x) = (1 < x)

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (0 < ln x) = (1 < x)
[PROOF STEP]
by simp


[STATEMENT]
lemma nonempty_nsphere [simp]: "~ (topspace(nsphere n) = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (nsphere n) \<noteq> {}
[PROOF STEP]
using in_topspace_nsphere
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if n = 0 then 1 else 0) \<in> topspace (nsphere ?n)

goal (1 subgoal):
 1. topspace (nsphere n) \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
lemma less_fract [simp]:
  "\<lbrakk> b \<noteq> 0; d \<noteq> 0 \<rbrakk> \<Longrightarrow> Fract a b < Fract c d \<longleftrightarrow> (a * d) * (b * d) < (c * b) * (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> (0::'a); d \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (Fract a b < Fract c d) = (a * d * (b * d) < c * b * (b * d))
[PROOF STEP]
by (simp add: less_fract_def less_le_not_le ac_simps)


[STATEMENT]
lemma forests_bot_1:
  assumes "equivalence e"
      and "forest f"
    shows "(-e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot
[PROOF STEP]
have "f * f\<^sup>T \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * f\<^sup>T \<le> e
[PROOF STEP]
using assms dual_order.trans
[PROOF STATE]
proof (prove)
using this:
equivalence e
forest f
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a

goal (1 subgoal):
 1. f * f\<^sup>T \<le> e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f * f\<^sup>T \<le> e

goal (1 subgoal):
 1. (- e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot
[PROOF STEP]
hence "f * (e \<sqinter> f)\<^sup>T \<le> e"
[PROOF STATE]
proof (prove)
using this:
f * f\<^sup>T \<le> e

goal (1 subgoal):
 1. f * (e \<sqinter> f)\<^sup>T \<le> e
[PROOF STEP]
by (metis conv_dist_inf inf.boundedE inf.cobounded2 inf.orderE mult_right_isotone)
[PROOF STATE]
proof (state)
this:
f * (e \<sqinter> f)\<^sup>T \<le> e

goal (1 subgoal):
 1. (- e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot
[PROOF STEP]
hence "-e \<sqinter> f * (e \<sqinter> f)\<^sup>T = bot"
[PROOF STATE]
proof (prove)
using this:
f * (e \<sqinter> f)\<^sup>T \<le> e

goal (1 subgoal):
 1. - e \<sqinter> f * (e \<sqinter> f)\<^sup>T = bot
[PROOF STEP]
by (simp add: p_antitone pseudo_complement)
[PROOF STATE]
proof (state)
this:
- e \<sqinter> f * (e \<sqinter> f)\<^sup>T = bot

goal (1 subgoal):
 1. (- e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- e \<sqinter> f * (e \<sqinter> f)\<^sup>T = bot

goal (1 subgoal):
 1. (- e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot
[PROOF STEP]
by (metis assms(1) comp_isotone conv_dist_inf equivalence_comp_right_complement inf.boundedI inf.cobounded1 inf.cobounded2 le_bot)
[PROOF STATE]
proof (state)
this:
(- e \<sqinter> f) * (e \<sqinter> f)\<^sup>T = bot

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_div_fact_le_pow:
  assumes "r \<le> n"
  shows "fact n div fact (n - r) \<le> n ^ r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n div fact (n - r) \<le> n ^ r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fact n div fact (n - r) \<le> n ^ r
[PROOF STEP]
have "r \<le> n \<Longrightarrow> \<Prod>{n - r..n} = (n - r) * \<Prod>{Suc (n - r)..n}" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<le> n \<Longrightarrow> \<Prod>{n - r..n} = (n - r) * \<Prod>{Suc (n - r)..n}
[PROOF STEP]
by (subst prod.insert[symmetric]) (auto simp: atLeastAtMost_insertL)
[PROOF STATE]
proof (state)
this:
?r \<le> n \<Longrightarrow> \<Prod>{n - ?r..n} = (n - ?r) * \<Prod>{Suc (n - ?r)..n}

goal (1 subgoal):
 1. fact n div fact (n - r) \<le> n ^ r
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
r \<le> n
?r \<le> n \<Longrightarrow> \<Prod>{n - ?r..n} = (n - ?r) * \<Prod>{Suc (n - ?r)..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r \<le> n
?r \<le> n \<Longrightarrow> \<Prod>{n - ?r..n} = (n - ?r) * \<Prod>{Suc (n - ?r)..n}

goal (1 subgoal):
 1. fact n div fact (n - r) \<le> n ^ r
[PROOF STEP]
by (induct r rule: nat.induct) (auto simp add: fact_div_fact Suc_diff_Suc mult_le_mono)
[PROOF STATE]
proof (state)
this:
fact n div fact (n - r) \<le> n ^ r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_sum:
  assumes "finite T"
    and "\<And>a. a \<in> T \<Longrightarrow> ((f a) has_integral (i a)) S"
  shows "((\<lambda>x. sum (\<lambda>a. f a x) T) has_integral (sum i T)) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>a\<in>T. f a x) has_integral sum i T) S
[PROOF STEP]
using assms(1) subset_refl[of T]
[PROOF STATE]
proof (prove)
using this:
finite T
T \<subseteq> T

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>a\<in>T. f a x) has_integral sum i T) S
[PROOF STEP]
proof (induct rule: finite_subset_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<lambda>x. \<Sum>a\<in>{}. f a x) has_integral sum i {}) S
 2. \<And>a F. \<lbrakk>finite F; a \<in> T; a \<notin> F; ((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S\<rbrakk> \<Longrightarrow> ((\<lambda>x. \<Sum>a\<in>insert a F. f a x) has_integral sum i (insert a F)) S
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. ((\<lambda>x. \<Sum>a\<in>{}. f a x) has_integral sum i {}) S
 2. \<And>a F. \<lbrakk>finite F; a \<in> T; a \<notin> F; ((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S\<rbrakk> \<Longrightarrow> ((\<lambda>x. \<Sum>a\<in>insert a F. f a x) has_integral sum i (insert a F)) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>a\<in>{}. f a x) has_integral sum i {}) S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>a\<in>{}. f a x) has_integral sum i {}) S

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> T; a \<notin> F; ((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S\<rbrakk> \<Longrightarrow> ((\<lambda>x. \<Sum>a\<in>insert a F. f a x) has_integral sum i (insert a F)) S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> T; a \<notin> F; ((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S\<rbrakk> \<Longrightarrow> ((\<lambda>x. \<Sum>a\<in>insert a F. f a x) has_integral sum i (insert a F)) S
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<in> T
x \<notin> F
((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> T; a \<notin> F; ((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S\<rbrakk> \<Longrightarrow> ((\<lambda>x. \<Sum>a\<in>insert a F. f a x) has_integral sum i (insert a F)) S
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite T
?a \<in> T \<Longrightarrow> (f ?a has_integral i ?a) S
finite F
x \<in> T
x \<notin> F
((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite T
?a \<in> T \<Longrightarrow> (f ?a has_integral i ?a) S
finite F
x \<in> T
x \<notin> F
((\<lambda>x. \<Sum>a\<in>F. f a x) has_integral sum i F) S

goal (1 subgoal):
 1. ((\<lambda>xa. \<Sum>a\<in>insert x F. f a xa) has_integral sum i (insert x F)) S
[PROOF STEP]
by (simp add: has_integral_add)
[PROOF STATE]
proof (state)
this:
((\<lambda>xa. \<Sum>a\<in>insert x F. f a xa) has_integral sum i (insert x F)) S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_of_real_interval_subset: "set_of (real_interval x) \<subseteq> set_of (real_interval y)"
  if "set_of x \<subseteq> set_of y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (real_interval x) \<subseteq> set_of (real_interval y)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
set_of x \<subseteq> set_of y

goal (1 subgoal):
 1. set_of (real_interval x) \<subseteq> set_of (real_interval y)
[PROOF STEP]
by (auto simp: set_of_eq)


[STATEMENT]
lemma has_prod_iff_shift:
  assumes "\<And>i. i < n \<Longrightarrow> f i \<noteq> 0"
  shows "(\<lambda>i. f (i + n)) has_prod a \<longleftrightarrow> f has_prod (a * (\<Prod>i<n. f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i < n \<Longrightarrow> f ?i \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n})
[PROOF STEP]
proof (induct n arbitrary: a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. (\<And>i. i < 0 \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + 0)) has_prod a = f has_prod (a * prod f {..<0})
 2. \<And>n a. \<lbrakk>\<And>a. (\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n}); \<And>i. i < Suc n \<Longrightarrow> f i \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?i < 0 \<Longrightarrow> f ?i \<noteq> (0::'a)

goal (2 subgoals):
 1. \<And>a. (\<And>i. i < 0 \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + 0)) has_prod a = f has_prod (a * prod f {..<0})
 2. \<And>n a. \<lbrakk>\<And>a. (\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n}); \<And>i. i < Suc n \<Longrightarrow> f i \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i < 0 \<Longrightarrow> f ?i \<noteq> (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i < 0 \<Longrightarrow> f ?i \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>i. f (i + 0)) has_prod a = f has_prod (a * prod f {..<0})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>i. f (i + 0)) has_prod a = f has_prod (a * prod f {..<0})

goal (1 subgoal):
 1. \<And>n a. \<lbrakk>\<And>a. (\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n}); \<And>i. i < Suc n \<Longrightarrow> f i \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n a. \<lbrakk>\<And>a. (\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n}); \<And>i. i < Suc n \<Longrightarrow> f i \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod ?a = f has_prod (?a * prod f {..<n})
?i < Suc n \<Longrightarrow> f ?i \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>n a. \<lbrakk>\<And>a. (\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n}); \<And>i. i < Suc n \<Longrightarrow> f i \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod ?a = f has_prod (?a * prod f {..<n})
?i < Suc n \<Longrightarrow> f ?i \<noteq> (0::'a)
[PROOF STEP]
have "(\<lambda>i. f (Suc i + n)) has_prod a \<longleftrightarrow> (\<lambda>i. f (i + n)) has_prod (a * f n)"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod ?a = f has_prod (?a * prod f {..<n})
?i < Suc n \<Longrightarrow> f ?i \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>i. f (Suc i + n)) has_prod a = (\<lambda>i. f (i + n)) has_prod (a * f n)
[PROOF STEP]
by (subst has_prod_Suc_iff) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>i. f (Suc i + n)) has_prod a = (\<lambda>i. f (i + n)) has_prod (a * f n)

goal (1 subgoal):
 1. \<And>n a. \<lbrakk>\<And>a. (\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod a = f has_prod (a * prod f {..<n}); \<And>i. i < Suc n \<Longrightarrow> f i \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod ?a = f has_prod (?a * prod f {..<n})
?i < Suc n \<Longrightarrow> f ?i \<noteq> (0::'a)
(\<lambda>i. f (Suc i + n)) has_prod a = (\<lambda>i. f (i + n)) has_prod (a * f n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < n \<Longrightarrow> f i \<noteq> (0::'a)) \<Longrightarrow> (\<lambda>i. f (i + n)) has_prod ?a = f has_prod (?a * prod f {..<n})
?i < Suc n \<Longrightarrow> f ?i \<noteq> (0::'a)
(\<lambda>i. f (Suc i + n)) has_prod a = (\<lambda>i. f (i + n)) has_prod (a * f n)

goal (1 subgoal):
 1. (\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. f (i + Suc n)) has_prod a = f has_prod (a * prod f {..<Suc n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cong_periodic_arithmetic:
  assumes "periodic_arithmetic f k" "[a = b] (mod k)"
  shows   "f a = f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a = f b
[PROOF STEP]
using assms mod_periodic_arithmetic[of f k a b]
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic f k
[a = b] (mod k)
\<lbrakk>periodic_arithmetic f k; a mod k = b mod k\<rbrakk> \<Longrightarrow> f a = f b

goal (1 subgoal):
 1. f a = f b
[PROOF STEP]
by (auto simp: cong_def)


[STATEMENT]
lemma is_SNF_intro:
  assumes "P \<in> carrier_mat (dim_row A) (dim_row A)"
  and "Q \<in> carrier_mat (dim_col A) (dim_col A) "
  and "invertible_mat P" and "invertible_mat Q"
  and "Smith_normal_form_mat S" and "S = P * A * Q"
shows "is_SNF A (P,S,Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_SNF A (P, S, Q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat (dim_row A) (dim_row A)
Q \<in> carrier_mat (dim_col A) (dim_col A)
invertible_mat P
invertible_mat Q
Smith_normal_form_mat S
S = P * A * Q

goal (1 subgoal):
 1. is_SNF A (P, S, Q)
[PROOF STEP]
unfolding is_SNF_def
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat (dim_row A) (dim_row A)
Q \<in> carrier_mat (dim_col A) (dim_col A)
invertible_mat P
invertible_mat Q
Smith_normal_form_mat S
S = P * A * Q

goal (1 subgoal):
 1. case (P, S, Q) of (P, S, Q) \<Rightarrow> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> Q \<in> carrier_mat (dim_col A) (dim_col A) \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S \<and> S = P * A * Q
[PROOF STEP]
by auto


[STATEMENT]
lemma CBlinfun_plus:
  assumes [simp]: \<open>bounded_clinear f\<close> \<open>bounded_clinear g\<close>
  shows \<open>CBlinfun (f + g) = CBlinfun f + CBlinfun g\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CBlinfun (f + g) = CBlinfun f + CBlinfun g
[PROOF STEP]
by (auto intro!: cblinfun_eqI simp: plus_fun_def bounded_clinear_add CBlinfun_inverse cblinfun.add_left)


[STATEMENT]
lemma has_integral_eq:
  assumes "\<And>x. x \<in> s \<Longrightarrow> f x = g x"
    and "(f has_integral k) s"
  shows "(g has_integral k) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_integral k) s
[PROOF STEP]
using has_integral_diff[OF assms(2), of "\<lambda>x. f x - g x" 0]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x - g x) has_integral (0::'b)) s \<Longrightarrow> ((\<lambda>x. f x - (f x - g x)) has_integral k - (0::'b)) s

goal (1 subgoal):
 1. (g has_integral k) s
[PROOF STEP]
using has_integral_is_0[of s "\<lambda>x. f x - g x"]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x - g x) has_integral (0::'b)) s \<Longrightarrow> ((\<lambda>x. f x - (f x - g x)) has_integral k - (0::'b)) s
(\<And>x. x \<in> s \<Longrightarrow> f x - g x = (0::'b)) \<Longrightarrow> ((\<lambda>x. f x - g x) has_integral (0::'b)) s

goal (1 subgoal):
 1. (g has_integral k) s
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x - g x) has_integral (0::'b)) s \<Longrightarrow> ((\<lambda>x. f x - (f x - g x)) has_integral k - (0::'b)) s
(\<And>x. x \<in> s \<Longrightarrow> f x - g x = (0::'b)) \<Longrightarrow> ((\<lambda>x. f x - g x) has_integral (0::'b)) s
?x \<in> s \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. (g has_integral k) s
[PROOF STEP]
by auto


[STATEMENT]
lemma nth_root_nat_aux1:
  assumes "k > 0"
  shows   "{m::nat. m ^ k \<le> n} \<subseteq> {..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m. m ^ k \<le> n} \<subseteq> {..n}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x ^ k \<le> n \<Longrightarrow> x \<le> n
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x ^ k \<le> n \<Longrightarrow> x \<le> n
[PROOF STEP]
assume "m ^ k \<le> n"
[PROOF STATE]
proof (state)
this:
m ^ k \<le> n

goal (1 subgoal):
 1. \<And>x. x ^ k \<le> n \<Longrightarrow> x \<le> n
[PROOF STEP]
show "m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n
[PROOF STEP]
proof (cases "m = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> m \<le> n
 2. m \<noteq> 0 \<Longrightarrow> m \<le> n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
m \<noteq> 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> m \<le> n
 2. m \<noteq> 0 \<Longrightarrow> m \<le> n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < k
m \<noteq> 0
[PROOF STEP]
have "m ^ 1 \<le> m ^ k"
[PROOF STATE]
proof (prove)
using this:
0 < k
m \<noteq> 0

goal (1 subgoal):
 1. m ^ 1 \<le> m ^ k
[PROOF STEP]
by (intro power_increasing) simp_all
[PROOF STATE]
proof (state)
this:
m ^ 1 \<le> m ^ k

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> m \<le> n
 2. m \<noteq> 0 \<Longrightarrow> m \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m ^ 1 \<le> m ^ k

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> m \<le> n
 2. m \<noteq> 0 \<Longrightarrow> m \<le> n
[PROOF STEP]
note \<open>m ^ k \<le> n\<close>
[PROOF STATE]
proof (state)
this:
m ^ k \<le> n

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> m \<le> n
 2. m \<noteq> 0 \<Longrightarrow> m \<le> n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
m ^ 1 \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m ^ 1 \<le> n

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

goal (1 subgoal):
 1. m = 0 \<Longrightarrow> m \<le> n
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
m \<le> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex1_3: "\<bar>integral {0 .. 1} (\<lambda>x. 1 / (1 + x*x::real)) - pi/4\<bar> \<le> 1 / 10^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>integral {0..1} (\<lambda>x. 1 / (1 + x * x)) - pi / 4\<bar> \<le> 1 / 10 ^ 3
[PROOF STEP]
by (rule abs_minus_leI) (tactic \<open>integral_bnds_tac 1 30 5 6 13 "-" [] @{context} 1\<close>)


[STATEMENT]
lemma "(-x < y) = (0 < x + (y::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x < y) = (0 < x + y)
[PROOF STEP]
by arith


[STATEMENT]
lemma (in topology) inter_closed:
  assumes xsclosed: "\<And>x. x\<in>S \<Longrightarrow> x closed"
  shows "\<Inter>S closed"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> S closed
[PROOF STEP]
proof (rule closedI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier - \<Inter> S open
[PROOF STEP]
let ?M = "{m. \<exists>x\<in>S. m = carrier - x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier - \<Inter> S open
[PROOF STEP]
have "\<forall> m \<in> ?M. m open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m\<in>{m. \<exists>x\<in>S. m = carrier - x}. m open
[PROOF STEP]
by (auto dest: xsclosed elim: closedE)
[PROOF STATE]
proof (state)
this:
\<forall>m\<in>{m. \<exists>x\<in>S. m = carrier - x}. m open

goal (1 subgoal):
 1. carrier - \<Inter> S open
[PROOF STEP]
hence "\<Union> ?M open"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>{m. \<exists>x\<in>S. m = carrier - x}. m open

goal (1 subgoal):
 1. \<Union> {m. \<exists>x\<in>S. m = carrier - x} open
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<Union> {m. \<exists>x\<in>S. m = carrier - x} open

goal (1 subgoal):
 1. carrier - \<Inter> S open
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Union> {m. \<exists>x\<in>S. m = carrier - x} open

goal (1 subgoal):
 1. carrier - \<Inter> S open
[PROOF STEP]
have "\<Union> ?M = carrier - \<Inter>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {m. \<exists>x\<in>S. m = carrier - x} = carrier - \<Inter> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> {m. \<exists>x\<in>S. m = carrier - x} = carrier - \<Inter> S

goal (1 subgoal):
 1. carrier - \<Inter> S open
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Union> {m. \<exists>x\<in>S. m = carrier - x} open
\<Union> {m. \<exists>x\<in>S. m = carrier - x} = carrier - \<Inter> S
[PROOF STEP]
show "carrier - \<Inter>S open"
[PROOF STATE]
proof (prove)
using this:
\<Union> {m. \<exists>x\<in>S. m = carrier - x} open
\<Union> {m. \<exists>x\<in>S. m = carrier - x} = carrier - \<Inter> S

goal (1 subgoal):
 1. carrier - \<Inter> S open
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
carrier - \<Inter> S open

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uncountable_open_interval: "uncountable {a<..<b} \<longleftrightarrow> a < b" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable {a<..<b} = (a < b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. uncountable {a<..<b} \<Longrightarrow> a < b
 2. a < b \<Longrightarrow> uncountable {a<..<b}
[PROOF STEP]
show "a < b" if "uncountable {a<..<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b
[PROOF STEP]
using uncountable_def that
[PROOF STATE]
proof (prove)
using this:
uncountable ?A = (?A \<noteq> {} \<and> (\<nexists>f. range f = ?A))
uncountable {a<..<b}

goal (1 subgoal):
 1. a < b
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
uncountable {a<..<b} \<Longrightarrow> a < b

goal (1 subgoal):
 1. a < b \<Longrightarrow> uncountable {a<..<b}
[PROOF STEP]
show "uncountable {a<..<b}" if "a < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable {a<..<b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. uncountable {a<..<b}
[PROOF STEP]
obtain f where "bij_betw f {a <..< b} {-pi/2<..<pi/2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. bij_betw f {a<..<b} {- pi / 2<..<pi / 2} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using bij_betw_open_intervals[OF \<open>a < b\<close>, of "-pi/2" "pi/2"]
[PROOF STATE]
proof (prove)
using this:
- pi / 2 < pi / 2 \<Longrightarrow> \<exists>f. bij_betw f {a<..<b} {- pi / 2<..<pi / 2}

goal (1 subgoal):
 1. (\<And>f. bij_betw f {a<..<b} {- pi / 2<..<pi / 2} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bij_betw f {a<..<b} {- pi / 2<..<pi / 2}

goal (1 subgoal):
 1. uncountable {a<..<b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw f {a<..<b} {- pi / 2<..<pi / 2}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw f {a<..<b} {- pi / 2<..<pi / 2}

goal (1 subgoal):
 1. uncountable {a<..<b}
[PROOF STEP]
by (metis bij_betw_tan uncountable_bij_betw uncountable_UNIV_real)
[PROOF STATE]
proof (state)
this:
uncountable {a<..<b}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a < b \<Longrightarrow> uncountable {a<..<b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_permutations:
  assumes "card S = n"
    and "finite S"
  shows "card {p. p permutes S} = fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {p. p permutes S} = fact n
[PROOF STEP]
using assms(2,1)
[PROOF STATE]
proof (prove)
using this:
finite S
card S = n

goal (1 subgoal):
 1. card {p. p permutes S} = fact n
[PROOF STEP]
proof (induct arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. card {} = n \<Longrightarrow> card {p. p permutes {}} = fact n
 2. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
card {} = n

goal (2 subgoals):
 1. \<And>n. card {} = n \<Longrightarrow> card {p. p permutes {}} = fact n
 2. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {} = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card {} = n

goal (1 subgoal):
 1. card {p. p permutes {}} = fact n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {p. p permutes {}} = fact n

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
card F = ?n \<Longrightarrow> card {p. p permutes F} = fact ?n
card (insert x F) = n

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
card F = ?n \<Longrightarrow> card {p. p permutes F} = fact ?n
card (insert x F) = n

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
assume card_insert: "card (insert x F) = n"
[PROOF STATE]
proof (state)
this:
card (insert x F) = n

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
let ?xF = "{p. p permutes insert x F}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
let ?pF = "{p. p permutes F}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
let ?pF' = "{(b, p). b \<in> insert x F \<and> p \<in> ?pF}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
let ?g = "(\<lambda>(b, p). transpose x b \<circ> p)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
have xfgpF': "?xF = ?g ` ?pF'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. p permutes insert x F} = (\<lambda>(b, p). Transposition.transpose x b \<circ> p) ` {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
by (rule permutes_insert[of x F])
[PROOF STATE]
proof (state)
this:
{p. p permutes insert x F} = (\<lambda>(b, p). Transposition.transpose x b \<circ> p) ` {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
from \<open>x \<notin> F\<close> \<open>finite F\<close> card_insert
[PROOF STATE]
proof (chain)
picking this:
x \<notin> F
finite F
card (insert x F) = n
[PROOF STEP]
have Fs: "card F = n - 1"
[PROOF STATE]
proof (prove)
using this:
x \<notin> F
finite F
card (insert x F) = n

goal (1 subgoal):
 1. card F = n - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card F = n - 1

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
from \<open>finite F\<close> insert.hyps Fs
[PROOF STATE]
proof (chain)
picking this:
finite F
finite F
x \<notin> F
card F = ?n \<Longrightarrow> card {p. p permutes F} = fact ?n
card F = n - 1
[PROOF STEP]
have pFs: "card ?pF = fact (n - 1)"
[PROOF STATE]
proof (prove)
using this:
finite F
finite F
x \<notin> F
card F = ?n \<Longrightarrow> card {p. p permutes F} = fact ?n
card F = n - 1

goal (1 subgoal):
 1. card {p. p permutes F} = fact (n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {p. p permutes F} = fact (n - 1)

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {p. p permutes F} = fact (n - 1)
[PROOF STEP]
have "finite ?pF"
[PROOF STATE]
proof (prove)
using this:
card {p. p permutes F} = fact (n - 1)

goal (1 subgoal):
 1. finite {p. p permutes F}
[PROOF STEP]
by (auto intro: card_ge_0_finite)
[PROOF STATE]
proof (state)
this:
finite {p. p permutes F}

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
with \<open>finite F\<close> card.insert_remove
[PROOF STATE]
proof (chain)
picking this:
finite F
finite ?A \<Longrightarrow> card (insert ?x ?A) = Suc (card (?A - {?x}))
finite {p. p permutes F}
[PROOF STEP]
have pF'f: "finite ?pF'"
[PROOF STATE]
proof (prove)
using this:
finite F
finite ?A \<Longrightarrow> card (insert ?x ?A) = Suc (card (?A - {?x}))
finite {p. p permutes F}

goal (1 subgoal):
 1. finite {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
apply (simp only: Collect_case_prod Collect_mem_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite F; \<And>A x. finite A \<Longrightarrow> card (insert x A) = Suc (card (A - {x})); finite {p. p permutes F}\<rbrakk> \<Longrightarrow> finite (insert x F \<times> {p. p permutes F})
[PROOF STEP]
apply (rule finite_cartesian_product)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite F; \<And>A x. finite A \<Longrightarrow> card (insert x A) = Suc (card (A - {x})); finite {p. p permutes F}\<rbrakk> \<Longrightarrow> finite (insert x F)
 2. \<lbrakk>finite F; \<And>A x. finite A \<Longrightarrow> card (insert x A) = Suc (card (A - {x})); finite {p. p permutes F}\<rbrakk> \<Longrightarrow> finite {p. p permutes F}
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
finite {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
have ginj: "inj_on ?g ?pF'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
fix b p c q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
assume bp: "(b, p) \<in> ?pF'"
[PROOF STATE]
proof (state)
this:
(b, p) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
assume cq: "(c, q) \<in> ?pF'"
[PROOF STATE]
proof (state)
this:
(c, q) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
assume eq: "?g (b, p) = ?g (c, q)"
[PROOF STATE]
proof (state)
this:
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
from bp cq
[PROOF STATE]
proof (chain)
picking this:
(b, p) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
(c, q) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
have pF: "p permutes F" and qF: "q permutes F"
[PROOF STATE]
proof (prove)
using this:
(b, p) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
(c, q) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}

goal (1 subgoal):
 1. p permutes F &&& q permutes F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p permutes F
q permutes F

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
from pF \<open>x \<notin> F\<close> eq
[PROOF STATE]
proof (chain)
picking this:
p permutes F
x \<notin> F
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)
[PROOF STEP]
have "b = ?g (b, p) x"
[PROOF STATE]
proof (prove)
using this:
p permutes F
x \<notin> F
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)

goal (1 subgoal):
 1. b = (case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x
[PROOF STEP]
by (auto simp: permutes_def fun_upd_def fun_eq_iff)
[PROOF STATE]
proof (state)
this:
b = (case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b = (case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
from qF \<open>x \<notin> F\<close> eq
[PROOF STATE]
proof (chain)
picking this:
q permutes F
x \<notin> F
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)
[PROOF STEP]
have "\<dots> = ?g (c, q) x"
[PROOF STATE]
proof (prove)
using this:
q permutes F
x \<notin> F
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)

goal (1 subgoal):
 1. (case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x
[PROOF STEP]
by (auto simp: fun_upd_def fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
from qF \<open>x \<notin> F\<close>
[PROOF STATE]
proof (chain)
picking this:
q permutes F
x \<notin> F
[PROOF STEP]
have "\<dots> = c"
[PROOF STATE]
proof (prove)
using this:
q permutes F
x \<notin> F

goal (1 subgoal):
 1. (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x = c
[PROOF STEP]
by (auto simp: permutes_def fun_upd_def fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) x = c

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
b = c
[PROOF STEP]
have "b = c"
[PROOF STATE]
proof (prove)
using this:
b = c

goal (1 subgoal):
 1. b = c
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
b = c

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = c
[PROOF STEP]
have "transpose x b = transpose x c"
[PROOF STATE]
proof (prove)
using this:
b = c

goal (1 subgoal):
 1. Transposition.transpose x b = Transposition.transpose x c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Transposition.transpose x b = Transposition.transpose x c

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)
Transposition.transpose x b = Transposition.transpose x c
[PROOF STEP]
have "transpose x b \<circ> p = transpose x b \<circ> q"
[PROOF STATE]
proof (prove)
using this:
(case (b, p) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (c, q) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)
Transposition.transpose x b = Transposition.transpose x c

goal (1 subgoal):
 1. Transposition.transpose x b \<circ> p = Transposition.transpose x b \<circ> q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Transposition.transpose x b \<circ> p = Transposition.transpose x b \<circ> q

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Transposition.transpose x b \<circ> p = Transposition.transpose x b \<circ> q
[PROOF STEP]
have "transpose x b \<circ> (transpose x b \<circ> p) = transpose x b \<circ> (transpose x b \<circ> q)"
[PROOF STATE]
proof (prove)
using this:
Transposition.transpose x b \<circ> p = Transposition.transpose x b \<circ> q

goal (1 subgoal):
 1. Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> p) = Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> p) = Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> q)

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> p) = Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> q)
[PROOF STEP]
have "p = q"
[PROOF STATE]
proof (prove)
using this:
Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> p) = Transposition.transpose x b \<circ> (Transposition.transpose x b \<circ> q)

goal (1 subgoal):
 1. p = q
[PROOF STEP]
by (simp add: o_assoc)
[PROOF STATE]
proof (state)
this:
p = q

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
with \<open>b = c\<close>
[PROOF STATE]
proof (chain)
picking this:
b = c
p = q
[PROOF STEP]
have "(b, p) = (c, q)"
[PROOF STATE]
proof (prove)
using this:
b = c
p = q

goal (1 subgoal):
 1. (b, p) = (c, q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(b, p) = (c, q)

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>(?b3, ?p3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (?c3, ?q3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (case (?b3, ?p3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (?c3, ?q3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)\<rbrakk> \<Longrightarrow> (?b3, ?p3) = (?c3, ?q3)

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(?b3, ?p3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (?c3, ?q3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (case (?b3, ?p3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (?c3, ?q3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)\<rbrakk> \<Longrightarrow> (?b3, ?p3) = (?c3, ?q3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?b3, ?p3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (?c3, ?q3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (case (?b3, ?p3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (?c3, ?q3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)\<rbrakk> \<Longrightarrow> (?b3, ?p3) = (?c3, ?q3)

goal (1 subgoal):
 1. inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?b3, ?p3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (?c3, ?q3) \<in> {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}; (case (?b3, ?p3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p) = (case (?c3, ?q3) of (b, p) \<Rightarrow> Transposition.transpose x b \<circ> p)\<rbrakk> \<Longrightarrow> (?b3, ?p3) = (?c3, ?q3)

goal (1 subgoal):
 1. \<forall>xa\<in>{(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}. \<forall>y\<in>{(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}. (case xa of (b, xa) \<Rightarrow> Transposition.transpose x b \<circ> xa) = (case y of (b, xa) \<Rightarrow> Transposition.transpose x b \<circ> xa) \<longrightarrow> xa = y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>(b, p). Transposition.transpose x b \<circ> p) {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}}

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
from \<open>x \<notin> F\<close> \<open>finite F\<close> card_insert
[PROOF STATE]
proof (chain)
picking this:
x \<notin> F
finite F
card (insert x F) = n
[PROOF STEP]
have "n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> F
finite F
card (insert x F) = n

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

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have "\<exists>m. n = Suc m"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. \<exists>m. n = Suc m
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<exists>m. n = Suc m

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>m. n = Suc m
[PROOF STEP]
obtain m where n: "n = Suc m"
[PROOF STATE]
proof (prove)
using this:
\<exists>m. n = Suc m

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

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
from pFs card_insert
[PROOF STATE]
proof (chain)
picking this:
card {p. p permutes F} = fact (n - 1)
card (insert x F) = n
[PROOF STEP]
have *: "card ?xF = fact n"
[PROOF STATE]
proof (prove)
using this:
card {p. p permutes F} = fact (n - 1)
card (insert x F) = n

goal (1 subgoal):
 1. card {p. p permutes insert x F} = fact n
[PROOF STEP]
unfolding xfgpF' card_image[OF ginj]
[PROOF STATE]
proof (prove)
using this:
card {p. p permutes F} = fact (n - 1)
card (insert x F) = n

goal (1 subgoal):
 1. card {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}} = fact n
[PROOF STEP]
using \<open>finite F\<close> \<open>finite ?pF\<close>
[PROOF STATE]
proof (prove)
using this:
card {p. p permutes F} = fact (n - 1)
card (insert x F) = n
finite F
finite {p. p permutes F}

goal (1 subgoal):
 1. card {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}} = fact n
[PROOF STEP]
by (simp only: Collect_case_prod Collect_mem_eq card_cartesian_product) (simp add: n)
[PROOF STATE]
proof (state)
this:
card {p. p permutes insert x F} = fact n

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
from finite_imageI[OF pF'f, of ?g]
[PROOF STATE]
proof (chain)
picking this:
finite ((\<lambda>(b, p). Transposition.transpose x b \<circ> p) ` {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}})
[PROOF STEP]
have xFf: "finite ?xF"
[PROOF STATE]
proof (prove)
using this:
finite ((\<lambda>(b, p). Transposition.transpose x b \<circ> p) ` {(b, p). b \<in> insert x F \<and> p \<in> {p. p permutes F}})

goal (1 subgoal):
 1. finite {p. p permutes insert x F}
[PROOF STEP]
by (simp add: xfgpF' n)
[PROOF STATE]
proof (state)
this:
finite {p. p permutes insert x F}

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
card {p. p permutes insert x F} = fact n
[PROOF STEP]
have "card ?xF = fact n"
[PROOF STATE]
proof (prove)
using this:
card {p. p permutes insert x F} = fact n

goal (1 subgoal):
 1. card {p. p permutes insert x F} = fact n
[PROOF STEP]
unfolding xFf
[PROOF STATE]
proof (prove)
using this:
card {p. p permutes insert x F} = fact n

goal (1 subgoal):
 1. card {p. p permutes insert x F} = fact n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card {p. p permutes insert x F} = fact n

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
card (insert x F) = ?nb2 \<Longrightarrow> card {p. p permutes insert x F} = fact ?nb2

goal (1 subgoal):
 1. \<And>x F n. \<lbrakk>finite F; x \<notin> F; \<And>n. card F = n \<Longrightarrow> card {p. p permutes F} = fact n; card (insert x F) = n\<rbrakk> \<Longrightarrow> card {p. p permutes insert x F} = fact n
[PROOF STEP]
with insert
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
card F = ?n \<Longrightarrow> card {p. p permutes F} = fact ?n
card (insert x F) = n
card (insert x F) = ?nb2 \<Longrightarrow> card {p. p permutes insert x F} = fact ?nb2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
card F = ?n \<Longrightarrow> card {p. p permutes F} = fact ?n
card (insert x F) = n
card (insert x F) = ?nb2 \<Longrightarrow> card {p. p permutes insert x F} = fact ?nb2

goal (1 subgoal):
 1. card {p. p permutes insert x F} = fact n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {p. p permutes insert x F} = fact n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_power_ineq: "norm (x ^ n) \<le> norm x ^ n"
  for x :: "'a::real_normed_algebra_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x ^ n) \<le> norm x ^ n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. norm (x ^ 0) \<le> norm x ^ 0
 2. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. norm (x ^ 0) \<le> norm x ^ 0
 2. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
show "norm (x ^ 0) \<le> norm x ^ 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x ^ 0) \<le> norm x ^ 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (x ^ 0) \<le> norm x ^ 0

goal (1 subgoal):
 1. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
norm (x ^ n) \<le> norm x ^ n

goal (1 subgoal):
 1. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
have "norm (x * x ^ n) \<le> norm x * norm (x ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x * x ^ n) \<le> norm x * norm (x ^ n)
[PROOF STEP]
by (rule norm_mult_ineq)
[PROOF STATE]
proof (state)
this:
norm (x * x ^ n) \<le> norm x * norm (x ^ n)

goal (1 subgoal):
 1. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (x * x ^ n) \<le> norm x * norm (x ^ n)

goal (1 subgoal):
 1. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
norm (x ^ n) \<le> norm x ^ n
[PROOF STEP]
have "\<dots> \<le> norm x * norm x ^ n"
[PROOF STATE]
proof (prove)
using this:
norm (x ^ n) \<le> norm x ^ n

goal (1 subgoal):
 1. norm x * norm (x ^ n) \<le> norm x * norm x ^ n
[PROOF STEP]
using norm_ge_zero
[PROOF STATE]
proof (prove)
using this:
norm (x ^ n) \<le> norm x ^ n
0 \<le> norm ?x

goal (1 subgoal):
 1. norm x * norm (x ^ n) \<le> norm x * norm x ^ n
[PROOF STEP]
by (rule mult_left_mono)
[PROOF STATE]
proof (state)
this:
norm x * norm (x ^ n) \<le> norm x * norm x ^ n

goal (1 subgoal):
 1. \<And>n. norm (x ^ n) \<le> norm x ^ n \<Longrightarrow> norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (x * x ^ n) \<le> norm x * norm x ^ n
[PROOF STEP]
show "norm (x ^ Suc n) \<le> norm x ^ Suc n"
[PROOF STATE]
proof (prove)
using this:
norm (x * x ^ n) \<le> norm x * norm x ^ n

goal (1 subgoal):
 1. norm (x ^ Suc n) \<le> norm x ^ Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (x ^ Suc n) \<le> norm x ^ Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monotone_Pair:
  "\<lbrakk> monotone ord orda f; monotone ord ordb g \<rbrakk>
  \<Longrightarrow> monotone ord (rel_prod orda ordb) (\<lambda>x. (f x, g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>monotone ord orda f; monotone ord ordb g\<rbrakk> \<Longrightarrow> monotone ord (rel_prod orda ordb) (\<lambda>x. (f x, g x))
[PROOF STEP]
by(simp add: monotone_def)


[STATEMENT]
lemma norm_minus_commute: "norm (a - b) = norm (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (a - b) = norm (b - a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (a - b) = norm (b - a)
[PROOF STEP]
have "norm (- (b - a)) = norm (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (- (b - a)) = norm (b - a)
[PROOF STEP]
by (rule norm_minus_cancel)
[PROOF STATE]
proof (state)
this:
norm (- (b - a)) = norm (b - a)

goal (1 subgoal):
 1. norm (a - b) = norm (b - a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (- (b - a)) = norm (b - a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (- (b - a)) = norm (b - a)

goal (1 subgoal):
 1. norm (a - b) = norm (b - a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (a - b) = norm (b - a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scale_zero_right [simp]: "a *s 0 = 0"
  and scale_minus_right [simp]: "a *s (- x) = - (a *s x)"
  and scale_right_diff_distrib [algebra_simps, algebra_split_simps]:
    "a *s (x - y) = a *s x - a *s y"
  and scale_sum_right: "a *s (sum f A) = (\<Sum>x\<in>A. a *s (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *s (0::'b) = (0::'b) &&& a *s - x = - (a *s x)) &&& a *s (x - y) = a *s x - a *s y &&& a *s sum f A = (\<Sum>x\<in>A. a *s f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. a *s (0::'b) = (0::'b)
 2. a *s - x = - (a *s x)
 3. a *s (x - y) = a *s x - a *s y
 4. a *s sum f A = (\<Sum>x\<in>A. a *s f x)
[PROOF STEP]
interpret s: additive "\<lambda>x. a *s x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. additive ((*s) a)
[PROOF STEP]
by standard (rule scale_right_distrib)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. a *s (0::'b) = (0::'b)
 2. a *s - x = - (a *s x)
 3. a *s (x - y) = a *s x - a *s y
 4. a *s sum f A = (\<Sum>x\<in>A. a *s f x)
[PROOF STEP]
show "a *s 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *s (0::'b) = (0::'b)
[PROOF STEP]
by (rule s.zero)
[PROOF STATE]
proof (state)
this:
a *s (0::'b) = (0::'b)

goal (3 subgoals):
 1. a *s - x = - (a *s x)
 2. a *s (x - y) = a *s x - a *s y
 3. a *s sum f A = (\<Sum>x\<in>A. a *s f x)
[PROOF STEP]
show "a *s (- x) = - (a *s x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *s - x = - (a *s x)
[PROOF STEP]
by (rule s.minus)
[PROOF STATE]
proof (state)
this:
a *s - x = - (a *s x)

goal (2 subgoals):
 1. a *s (x - y) = a *s x - a *s y
 2. a *s sum f A = (\<Sum>x\<in>A. a *s f x)
[PROOF STEP]
show "a *s (x - y) = a *s x - a *s y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *s (x - y) = a *s x - a *s y
[PROOF STEP]
by (rule s.diff)
[PROOF STATE]
proof (state)
this:
a *s (x - y) = a *s x - a *s y

goal (1 subgoal):
 1. a *s sum f A = (\<Sum>x\<in>A. a *s f x)
[PROOF STEP]
show "a *s (sum f A) = (\<Sum>x\<in>A. a *s (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *s sum f A = (\<Sum>x\<in>A. a *s f x)
[PROOF STEP]
by (rule s.sum)
[PROOF STATE]
proof (state)
this:
a *s sum f A = (\<Sum>x\<in>A. a *s f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma util_fun_def_holds:
  assumes "i \<in> agents"
    and "x \<in> consumption_set"
    and "y \<in> consumption_set"
  shows "x \<succeq>[Pr[i]] y \<longleftrightarrow> U[i] x \<ge> U[i] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<succeq>[Pr[i]] y = (U[i] y \<le> U[i] x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<succeq>[Pr[i]] y \<Longrightarrow> U[i] y \<le> U[i] x
 2. U[i] y \<le> U[i] x \<Longrightarrow> x \<succeq>[Pr[i]] y
[PROOF STEP]
assume "x \<succeq>[Pr[i]] y"
[PROOF STATE]
proof (state)
this:
x \<succeq>[Pr[i]] y

goal (2 subgoals):
 1. x \<succeq>[Pr[i]] y \<Longrightarrow> U[i] y \<le> U[i] x
 2. U[i] y \<le> U[i] x \<Longrightarrow> x \<succeq>[Pr[i]] y
[PROOF STEP]
show "U[i] x \<ge> U[i] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U[i] y \<le> U[i] x
[PROOF STEP]
by (meson \<open>x \<succeq>[Pr[i]] y\<close> agent_props assms eucl_ordinal_utility_def ordinal_utility_def)
[PROOF STATE]
proof (state)
this:
U[i] y \<le> U[i] x

goal (1 subgoal):
 1. U[i] y \<le> U[i] x \<Longrightarrow> x \<succeq>[Pr[i]] y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. U[i] y \<le> U[i] x \<Longrightarrow> x \<succeq>[Pr[i]] y
[PROOF STEP]
assume "U[i] x \<ge> U[i] y"
[PROOF STATE]
proof (state)
this:
U[i] y \<le> U[i] x

goal (1 subgoal):
 1. U[i] y \<le> U[i] x \<Longrightarrow> x \<succeq>[Pr[i]] y
[PROOF STEP]
have "eucl_ordinal_utility consumption_set (Pr[i]) (U[i])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_ordinal_utility consumption_set Pr[i] U[i]
[PROOF STEP]
by (simp add: agent_props assms)
[PROOF STATE]
proof (state)
this:
eucl_ordinal_utility consumption_set Pr[i] U[i]

goal (1 subgoal):
 1. U[i] y \<le> U[i] x \<Longrightarrow> x \<succeq>[Pr[i]] y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eucl_ordinal_utility consumption_set Pr[i] U[i]
[PROOF STEP]
show "x \<succeq>[Pr[i]] y"
[PROOF STATE]
proof (prove)
using this:
eucl_ordinal_utility consumption_set Pr[i] U[i]

goal (1 subgoal):
 1. x \<succeq>[Pr[i]] y
[PROOF STEP]
by (meson \<open>U[i] y \<le> U[i] x\<close> assms(2) assms(3) eucl_ordinal_utility_def ordinal_utility.util_def_conf)
[PROOF STATE]
proof (state)
this:
x \<succeq>[Pr[i]] y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "equiv UNIV (uconnected E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv UNIV (uconnected E)
[PROOF STEP]
apply (rule equivI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. refl (uconnected E)
 2. sym (uconnected E)
 3. trans (uconnected E)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl (uconnected E)
[PROOF STEP]
by (auto simp: refl_on_def uconnected_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sym (uconnected E)
 2. trans (uconnected E)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (uconnected E)
[PROOF STEP]
apply(clarsimp simp: sym_def uconnected_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y p. epath E x p y \<Longrightarrow> \<exists>p. epath E y p x
[PROOF STEP]
subgoal for x y p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. epath E x p y \<Longrightarrow> \<exists>p. epath E y p x
[PROOF STEP]
apply (rule exI[where x="rev p"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. epath E x p y \<Longrightarrow> epath E y (rev p) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (uconnected E)
[PROOF STEP]
by (fact uconnected_trans)


[STATEMENT]
lemma brouwer_surjective_cball:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'n"
  assumes "continuous_on (cball a e) f"
    and "e > 0"
    and "x \<in> S"
    and "\<And>x y. \<lbrakk>x\<in>S; y\<in>cball a e\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> cball a e"
  shows "\<exists>y\<in>cball a e. f y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>cball a e. f y = x
[PROOF STEP]
apply (rule brouwer_surjective)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. compact (cball a e)
 2. convex (cball a e)
 3. cball a e \<noteq> {}
 4. continuous_on (cball a e) f
 5. \<And>x y. \<lbrakk>x \<in> ?S; y \<in> cball a e\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> cball a e
 6. x \<in> ?S
[PROOF STEP]
apply (rule compact_cball convex_cball)+
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. cball a e \<noteq> {}
 2. continuous_on (cball a e) f
 3. \<And>x y. \<lbrakk>x \<in> ?S; y \<in> cball a e\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> cball a e
 4. x \<in> ?S
[PROOF STEP]
unfolding cball_eq_empty
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<not> e < 0
 2. continuous_on (cball a e) f
 3. \<And>x y. \<lbrakk>x \<in> ?S; y \<in> cball a e\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> cball a e
 4. x \<in> ?S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on (cball a e) f
0 < e
x \<in> S
\<lbrakk>?x \<in> S; ?y \<in> cball a e\<rbrakk> \<Longrightarrow> ?x + (?y - f ?y) \<in> cball a e

goal (4 subgoals):
 1. \<not> e < 0
 2. continuous_on (cball a e) f
 3. \<And>x y. \<lbrakk>x \<in> ?S; y \<in> cball a e\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> cball a e
 4. x \<in> ?S
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in finite_measure) finite_measure_subadditive_countably:
  "range A \<subseteq> sets M \<Longrightarrow> summable (\<lambda>i. measure M (A i)) \<Longrightarrow> measure M (\<Union>i. A i) \<le> (\<Sum>i. measure M (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>range A \<subseteq> sets M; summable (\<lambda>i. Sigma_Algebra.measure M (A i))\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (\<Union> (range A)) \<le> (\<Sum>i. Sigma_Algebra.measure M (A i))
[PROOF STEP]
by (rule measure_subadditive_countably)
     (simp_all add: ennreal_suminf_neq_top emeasure_eq_measure)


[STATEMENT]
lemma Arccos_Arcsin_csqrt_pos:
    "(0 < Re z | Re z = 0 & 0 \<le> Im z) \<Longrightarrow> Arccos z = Arcsin(csqrt(1 - z\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re z \<or> Re z = 0 \<and> 0 \<le> Im z \<Longrightarrow> Arccos z = Arcsin (csqrt (1 - z\<^sup>2))
[PROOF STEP]
by (simp add: Arcsin_def Arccos_def Complex.csqrt_square add.commute)


[STATEMENT]
lemma abs_vec_nth_blinfun_apply_lemma:
  fixes x::"(real^'n) \<Rightarrow>\<^sub>L (real^'m)"
  shows "abs (vec_nth (blinfun_apply x (axis ia 1)) i) \<le> norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>blinfun_apply x (axis ia 1) $ i\<bar> \<le> norm x
[PROOF STEP]
apply (rule component_le_norm_cart[THEN order_trans])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (blinfun_apply x (axis ia 1)) \<le> norm x
[PROOF STEP]
apply (rule norm_blinfun[THEN order_trans])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x * norm (axis ia 1) \<le> norm x
[PROOF STEP]
by (auto simp: norm_axis)


[STATEMENT]
lemma language_coinduct:
fixes R (infixl "\<sim>" 50)
assumes "K \<sim> L"
assumes "\<And>K L. K \<sim> L \<Longrightarrow> ([] \<in> K \<longleftrightarrow> [] \<in> L)"
assumes "\<And>K L x. K \<sim> L \<Longrightarrow> Deriv x K \<sim> Deriv x L"
shows "K = L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K = L
[PROOF STEP]
apply (rule equal_if_bisimilar)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bisimilar K L
[PROOF STEP]
apply (rule bisimilar.coinduct[of R, OF \<open>K \<sim> L\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2. x1 \<sim> x2 \<Longrightarrow> \<exists>K L. x1 = K \<and> x2 = L \<and> ([] \<in> K) = ([] \<in> L) \<and> (\<forall>x. Deriv x K \<sim> Deriv x L \<or> bisimilar (Deriv x K) (Deriv x L))
[PROOF STEP]
apply (auto simp: assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma size_of_lhs:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes signs :: "rat list list"
  shows "dim_vec (construct_lhs_vector p qs signs) = length signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (w_vec p qs signs) = length signs
[PROOF STEP]
unfolding construct_lhs_vector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
by simp


[STATEMENT]
lemma affine_hull_3:
  fixes a b c :: "'a::real_vector"
  shows "affine hull {a,b,c} = { u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c| u v w. u + v + w = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull {a, b, c} = {u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c |u v w. u + v + w = 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. affine hull {a, b, c} = {u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c |u v w. u + v + w = 1}
[PROOF STEP]
have *:
    "\<And>x y z. z = x - y \<longleftrightarrow> y + z = (x::real)"
    "\<And>x y z. z = x - y \<longleftrightarrow> y + z = (x::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z. (z = x - y) = (y + z = x)) &&& (\<And>x y z. (z = x - y) = (y + z = x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(?z = ?x - ?y) = (?y + ?z = ?x)
(?z = ?x - ?y) = (?y + ?z = ?x)

goal (1 subgoal):
 1. affine hull {a, b, c} = {u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c |u v w. u + v + w = 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull {a, b, c} = {u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c |u v w. u + v + w = 1}
[PROOF STEP]
apply (simp add: affine_hull_finite affine_hull_finite_step)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>v va u. u c = 1 - v - va \<and> u c *\<^sub>R c = y - v *\<^sub>R a - va *\<^sub>R b} = {u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c |u v w. u + v + w = 1}
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>v va u. v + (va + u c) = 1 \<and> v *\<^sub>R a + (va *\<^sub>R b + u c *\<^sub>R c) = y} = {u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c |u v w. u + v + w = 1}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x v va u. v + (va + u c) = 1 \<Longrightarrow> \<exists>ua vb w. v *\<^sub>R a + (va *\<^sub>R b + u c *\<^sub>R c) = ua *\<^sub>R a + vb *\<^sub>R b + w *\<^sub>R c \<and> ua + vb + w = 1
 2. \<And>x u v w. u + v + w = 1 \<Longrightarrow> \<exists>va vb ua. va + (vb + ua c) = 1 \<and> va *\<^sub>R a + (vb *\<^sub>R b + ua c *\<^sub>R c) = u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c
[PROOF STEP]
apply (metis add.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x u v w. u + v + w = 1 \<Longrightarrow> \<exists>va vb ua. va + (vb + ua c) = 1 \<and> va *\<^sub>R a + (vb *\<^sub>R b + ua c *\<^sub>R c) = u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c
[PROOF STEP]
apply (rule_tac x=u in exI, force)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
affine hull {a, b, c} = {u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c |u v w. u + v + w = 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma icard_1_singleton_conv: "(icard A = eSuc 0) = (\<exists>a. A = {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (icard A = eSuc 0) = (\<exists>a. A = {a})
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. icard A = eSuc 0 \<Longrightarrow> \<exists>a. A = {a}
 2. \<exists>a. A = {a} \<Longrightarrow> icard A = eSuc 0
[PROOF STEP]
apply (simp add: icard_1_imp_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. A = {a} \<Longrightarrow> icard A = eSuc 0
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma degree_in_var_ineq:
  assumes "m \<in> monomials_of R P"
  assumes "finite (monomials_of R P)"
  shows "degree_in_var R P i \<ge> count m i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count m i \<le> degree_in_var R P i
[PROOF STEP]
unfolding degree_in_var_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count m i \<le> (if monomials_of R P = {} then 0 else MAX m\<in>monomials_of R P. count m i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<in> monomials_of R P
finite (monomials_of R P)

goal (1 subgoal):
 1. count m i \<le> (if monomials_of R P = {} then 0 else MAX m\<in>monomials_of R P. count m i)
[PROOF STEP]
by force


[STATEMENT]
lemma combine_ncols_max: "f 0 0 = 0 \<Longrightarrow> ncols (combine_matrix f A B) <= max (ncols A) (ncols B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'b) (0::'c) = (0::'a) \<Longrightarrow> ncols (combine_matrix f A B) \<le> max (ncols A) (ncols B)
[PROOF STEP]
by (simp add: ncols_le)