[STATEMENT]
lemma has_derivative_at_split:
  "(f has_derivative f') (at x) \<longleftrightarrow> (f has_derivative f') (at_left x) \<and> (f has_derivative f') (at_right x)"
  for x::"'a::{linorder_topology, real_normed_vector}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative f') (at x) = ((f has_derivative f') (at_left x) \<and> (f has_derivative f') (at_right x))
[PROOF STEP]
by (auto simp: has_derivative_at_within filterlim_at_split)


[STATEMENT]
lemma field_differentiable_at_cos: "cos field_differentiable at z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos field_differentiable at z
[PROOF STEP]
using DERIV_cos field_differentiable_def
[PROOF STATE]
proof (prove)
using this:
(cos has_field_derivative - sin ?x) (at ?x)
?f field_differentiable ?F \<equiv> \<exists>f'. (?f has_field_derivative f') ?F

goal (1 subgoal):
 1. cos field_differentiable at z
[PROOF STEP]
by blast


[STATEMENT]
lemma cycle_iff_back_edges:
    "acyclic (edges s) \<longleftrightarrow> back_edges s = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acyclic (tree_edges s \<union> cross_edges s \<union> back_edges s) = (back_edges s = {})
[PROOF STEP]
by (metis back_edge_closes_cycle cycle_needs_back_edge)


[STATEMENT]
lemma bilinear_ladd: "bilinear h \<Longrightarrow> h (x + y) z = h x z + h y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bilinear h \<Longrightarrow> h (x + y) z = h x z + h y z
[PROOF STEP]
by (simp add: bilinear_def linear_iff)


[STATEMENT]
lemma mset_tree_heap_of_A: "mset_tree (heap_of_A xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_tree (heap_of_A xs) = mset xs
[PROOF STEP]
by(induction xs)(simp_all add: mset_insert)


[STATEMENT]
lemma not_MOST [simp]: "\<not> (MOST x. P x) \<longleftrightarrow> (INFM x. \<not> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (\<forall>\<^sub>\<infinity>x. P x)) = (\<exists>\<^sub>\<infinity>x. \<not> P x)
[PROOF STEP]
by (rule not_eventually)


[STATEMENT]
lemma has_vderiv_on_blinfun_compose_right[derivative_intros]:
  assumes "(g has_vderiv_on g') T"
  assumes "\<And>x. x \<in> T \<Longrightarrow> gd' x = g' x o\<^sub>L d"
  shows "((\<lambda>x. g x o\<^sub>L d) has_vderiv_on gd') T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g x o\<^sub>L d) has_vderiv_on gd') T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(g has_vderiv_on g') T
?x \<in> T \<Longrightarrow> gd' ?x = g' ?x o\<^sub>L d

goal (1 subgoal):
 1. ((\<lambda>x. g x o\<^sub>L d) has_vderiv_on gd') T
[PROOF STEP]
by (auto simp: has_vderiv_on_def has_vector_derivative_def blinfun_ext blinfun.bilinear_simps
      intro!: derivative_eq_intros ext)


[STATEMENT]
lemma inv_project_eq:
     "bij h
      ==> inv (project (%(x,u::'c). h x) UNIV) = extend (%(x,u::'c). h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> inv (project (\<lambda>(x, u). h x) UNIV) = extend (\<lambda>(x, u). h x)
[PROOF STEP]
apply (rule inj_imp_inv_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bij h \<Longrightarrow> inj (project (\<lambda>(x, u). h x) UNIV)
 2. bij h \<Longrightarrow> \<forall>x. project (\<lambda>(x, u). h x) UNIV (extend (\<lambda>(x, u). h x) x) = x
[PROOF STEP]
apply (erule bij_project [THEN bij_is_inj])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> \<forall>x. project (\<lambda>(x, u). h x) UNIV (extend (\<lambda>(x, u). h x) x) = x
[PROOF STEP]
apply (simp (no_asm_simp) add: Extend.extend_inverse)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Inf_pres_map_dual: "Inf_pres = Sup_pres \<circ> (\<partial>\<^sub>F::('a::complete_lattice_with_dual \<Rightarrow> 'b::complete_lattice_with_dual) \<Rightarrow> 'a \<Rightarrow> 'b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F
[PROOF STEP]
fix f::"'a \<Rightarrow> 'b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F
[PROOF STEP]
have "Inf_pres f = (Sup_pres \<circ> \<partial>\<^sub>F) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres f = (Sup_pres \<circ> \<partial>\<^sub>F) f
[PROOF STEP]
by (simp add: Inf_pres_map_dual_var)
[PROOF STATE]
proof (state)
this:
Inf_pres f = (Sup_pres \<circ> \<partial>\<^sub>F) f

goal (1 subgoal):
 1. Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Inf_pres ?f2 = (Sup_pres \<circ> \<partial>\<^sub>F) ?f2

goal (1 subgoal):
 1. Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Inf_pres ?f2 = (Sup_pres \<circ> \<partial>\<^sub>F) ?f2

goal (1 subgoal):
 1. Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Inf_pres = Sup_pres \<circ> \<partial>\<^sub>F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma padic_mult_assoc:
assumes "prime p"
shows  "\<And>x y z.
       x \<in> carrier (padic_int p) \<Longrightarrow>
       y \<in> carrier (padic_int p) \<Longrightarrow>
       z \<in> carrier (padic_int p) \<Longrightarrow>
       x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
fix x y z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
assume Ax: " x \<in> carrier (padic_int p)"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (padic_int p)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
assume Ay: " y \<in> carrier (padic_int p)"
[PROOF STATE]
proof (state)
this:
y \<in> carrier (padic_int p)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
assume Az: " z \<in> carrier (padic_int p)"
[PROOF STATE]
proof (state)
this:
z \<in> carrier (padic_int p)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
show "x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) xa = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) xa
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) xa = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) xa
[PROOF STEP]
show "((x \<otimes>\<^bsub>padic_int p\<^esub> y) \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
proof(cases "n=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
 2. n \<noteq> 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
 2. n \<noteq> 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
using padic_int_simps
[PROOF STATE]
proof (prove)
using this:
n = 0
\<one>\<^bsub>padic_int ?p\<^esub> = padic_one ?p
\<zero>\<^bsub>padic_int ?p\<^esub> = padic_zero ?p
(\<oplus>\<^bsub>padic_int ?p\<^esub>) = padic_add ?p
(\<otimes>\<^bsub>padic_int ?p\<^esub>) = padic_mult ?p
carrier (padic_int ?p) = padic_set ?p

goal (1 subgoal):
 1. (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
by (metis Ax Ay Az assms padic_mult_in_padic_set padic_set_zero_res)
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have "residues (p^n)"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. residues (p ^ n)
[PROOF STEP]
by (simp add: assms residues_n)
[PROOF STATE]
proof (state)
this:
residues (p ^ n)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
residues (p ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
residues (p ^ n)

goal (1 subgoal):
 1. (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
using residues.cring padic_set_res_closed padic_mult_in_padic_set Ax Ay Az padic_mult_res
[PROOF STATE]
proof (prove)
using this:
residues (p ^ n)
residues ?m \<Longrightarrow> cring (residue_ring ?m)
?f \<in> padic_set ?p \<Longrightarrow> ?f ?m \<in> carrier (residue_ring (?p ^ ?m))
\<lbrakk>?f \<in> padic_set ?p; ?g \<in> padic_set ?p; prime ?p\<rbrakk> \<Longrightarrow> padic_mult ?p ?f ?g \<in> padic_set ?p
x \<in> carrier (padic_int p)
y \<in> carrier (padic_int p)
z \<in> carrier (padic_int p)
padic_mult ?p ?f ?g ?n = ?f ?n \<otimes>\<^bsub>residue_ring (?p ^ ?n)\<^esub> ?g ?n

goal (1 subgoal):
 1. (x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n
[PROOF STEP]
by (simp add: cring.cring_simprules(11) padic_int_def)
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z) n = (x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)) n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^bsub>padic_int p\<^esub> y \<otimes>\<^bsub>padic_int p\<^esub> z = x \<otimes>\<^bsub>padic_int p\<^esub> (y \<otimes>\<^bsub>padic_int p\<^esub> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_regular_spair_sym: "is_regular_spair p q \<Longrightarrow> is_regular_spair q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_regular_spair p q \<Longrightarrow> is_regular_spair q p
[PROOF STEP]
by (auto simp: is_regular_spair_def Let_def lcs_comm)


[STATEMENT]
lemma (in group) int_pow_is_hom: \<^marker>\<open>contributor \<open>Joachim Breitner\<close>\<close>
  "x \<in> carrier G \<Longrightarrow> (([^]) x) \<in> hom \<lparr> carrier = UNIV, mult = (+), one = 0::int \<rparr> G "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> ([^]) x \<in> hom \<lparr>carrier = UNIV, mult = (+), one = 0\<rparr> G
[PROOF STEP]
unfolding hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> ([^]) x \<in> {h \<in> carrier \<lparr>carrier = UNIV, mult = (+), one = 0\<rparr> \<rightarrow> carrier G. \<forall>x\<in>carrier \<lparr>carrier = UNIV, mult = (+), one = 0\<rparr>. \<forall>y\<in>carrier \<lparr>carrier = UNIV, mult = (+), one = 0\<rparr>. h (x \<otimes>\<^bsub>\<lparr>carrier = UNIV, mult = (+), one = 0\<rparr>\<^esub> y) = h x \<otimes> h y}
[PROOF STEP]
by (simp add: int_pow_mult)


[STATEMENT]
lemma Pi'_cong:
  assumes "finite I"
  assumes "\<And>i. i \<in> I \<Longrightarrow> f i = g i"
  shows "Pi' I f = Pi' I g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi' I f = Pi' I g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> f ?i = g ?i

goal (1 subgoal):
 1. Pi' I f = Pi' I g
[PROOF STEP]
by (auto simp: Pi'_def)


[STATEMENT]
lemma P_set_mult_closed:
  assumes "n \<noteq> 0"
  assumes "a \<in> P_set n"
  assumes "b \<in> P_set n"
  shows "a \<otimes> b \<in> P_set n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
obtain a0 where a0_def: "a0 \<in> carrier Q\<^sub>p \<and> (a0 [^] n = a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a0. a0 \<in> carrier Q\<^sub>p \<and> a0 [^] n = a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
a \<in> P_set n

goal (1 subgoal):
 1. (\<And>a0. a0 \<in> carrier Q\<^sub>p \<and> a0 [^] n = a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding P_set_def
[PROOF STATE]
proof (prove)
using this:
a \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}

goal (1 subgoal):
 1. (\<And>a0. a0 \<in> carrier Q\<^sub>p \<and> a0 [^] n = a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a0 \<in> carrier Q\<^sub>p \<and> a0 [^] n = a

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
obtain b0 where b0_def: "b0 \<in> carrier Q\<^sub>p \<and> (b0 [^] n = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b0. b0 \<in> carrier Q\<^sub>p \<and> b0 [^] n = b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
b \<in> P_set n

goal (1 subgoal):
 1. (\<And>b0. b0 \<in> carrier Q\<^sub>p \<and> b0 [^] n = b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding P_set_def
[PROOF STATE]
proof (prove)
using this:
b \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}

goal (1 subgoal):
 1. (\<And>b0. b0 \<in> carrier Q\<^sub>p \<and> b0 [^] n = b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b0 \<in> carrier Q\<^sub>p \<and> b0 [^] n = b

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
have "(a0 \<otimes> b0) [^] n = a0 [^] n \<otimes> b0 [^] n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a0 \<otimes> b0) [^] n = a0 [^] n \<otimes> b0 [^] n
[PROOF STEP]
using a0_def b0_def Qp.nat_pow_distrib
[PROOF STATE]
proof (prove)
using this:
a0 \<in> carrier Q\<^sub>p \<and> a0 [^] n = a
b0 \<in> carrier Q\<^sub>p \<and> b0 [^] n = b
\<lbrakk>?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> (?x \<otimes> ?y) [^] ?n = ?x [^] ?n \<otimes> ?y [^] ?n

goal (1 subgoal):
 1. (a0 \<otimes> b0) [^] n = a0 [^] n \<otimes> b0 [^] n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(a0 \<otimes> b0) [^] n = a0 [^] n \<otimes> b0 [^] n

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a0 \<otimes> b0) [^] n = a0 [^] n \<otimes> b0 [^] n
[PROOF STEP]
have 0: "a \<otimes> b  = (a0 \<otimes> b0) [^] n"
[PROOF STATE]
proof (prove)
using this:
(a0 \<otimes> b0) [^] n = a0 [^] n \<otimes> b0 [^] n

goal (1 subgoal):
 1. a \<otimes> b = (a0 \<otimes> b0) [^] n
[PROOF STEP]
using a0_def b0_def
[PROOF STATE]
proof (prove)
using this:
(a0 \<otimes> b0) [^] n = a0 [^] n \<otimes> b0 [^] n
a0 \<in> carrier Q\<^sub>p \<and> a0 [^] n = a
b0 \<in> carrier Q\<^sub>p \<and> b0 [^] n = b

goal (1 subgoal):
 1. a \<otimes> b = (a0 \<otimes> b0) [^] n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<otimes> b = (a0 \<otimes> b0) [^] n

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
have 1: "a0 \<otimes> b0 \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a0 \<otimes> b0 \<in> carrier Q\<^sub>p
[PROOF STEP]
by (meson Qp.cring_axioms a0_def b0_def cring.cring_simprules(5))
[PROOF STATE]
proof (state)
this:
a0 \<otimes> b0 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
have 2: "a \<otimes> b \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> b \<in> nonzero Q\<^sub>p
[PROOF STEP]
using assms nonzero_is_submonoid
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
a \<in> P_set n
b \<in> P_set n
Localization.submonoid Q\<^sub>p (nonzero Q\<^sub>p)

goal (1 subgoal):
 1. a \<otimes> b \<in> nonzero Q\<^sub>p
[PROOF STEP]
unfolding P_set_def
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
a \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}
b \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}
Localization.submonoid Q\<^sub>p (nonzero Q\<^sub>p)

goal (1 subgoal):
 1. a \<otimes> b \<in> nonzero Q\<^sub>p
[PROOF STEP]
by (metis (no_types, lifting) "0" "1" Qp.integral Qp_nat_pow_nonzero a0_def b0_def mem_Collect_eq not_nonzero_Qp)
[PROOF STATE]
proof (state)
this:
a \<otimes> b \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<otimes> b \<in> nonzero Q\<^sub>p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
using 0 1 assms
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<in> nonzero Q\<^sub>p
a \<otimes> b = (a0 \<otimes> b0) [^] n
a0 \<otimes> b0 \<in> carrier Q\<^sub>p
n \<noteq> 0
a \<in> P_set n
b \<in> P_set n

goal (1 subgoal):
 1. a \<otimes> b \<in> P_set n
[PROOF STEP]
unfolding P_set_def
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<in> nonzero Q\<^sub>p
a \<otimes> b = (a0 \<otimes> b0) [^] n
a0 \<otimes> b0 \<in> carrier Q\<^sub>p
n \<noteq> 0
a \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}
b \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}

goal (1 subgoal):
 1. a \<otimes> b \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<otimes> b \<in> P_set n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma times_nat_code [code]:
  "nat_of_num k * nat_of_num l = nat_of_num (k * l)"
  "m * 0 = (0::nat)"
  "0 * n = (0::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_num k * nat_of_num l = nat_of_num (k * l) &&& m * 0 = 0 &&& 0 * n = 0
[PROOF STEP]
by (simp_all add: nat_of_num_numeral)


[STATEMENT]
lemma EqOnGL_eqOnGL[simp]:
assumes "env p = i" and "env p' = i'"
shows "sem (EqOnGL p p') env = eqOnGL i i'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sem (EqOnGL p p') env = eqOnGL i i'
[PROOF STEP]
using assms finite_EqOnGL
[PROOF STATE]
proof (prove)
using this:
env p = i
env p' = i'
finite {EqOnUOut ?p ?p' u ou |u ou. (u, ou) \<in> GL \<times> UNIV}

goal (1 subgoal):
 1. sem (EqOnGL p p') env = eqOnGL i i'
[PROOF STEP]
unfolding EqOnGL_def eqOnGL_def sem_Scon[OF finite_EqOnGL] image_def
[PROOF STATE]
proof (prove)
using this:
env p = i
env p' = i'
finite {EqOnUOut ?p ?p' u ou |u ou. (u, ou) \<in> GL \<times> UNIV}

goal (1 subgoal):
 1. scon {y. \<exists>x\<in>{EqOnUOut p p' u ou |u ou. (u, ou) \<in> GL \<times> UNIV}. y = sem x env} = scon {eqOnUOut i i' u ou |u ou. (u, ou) \<in> GL \<times> UNIV}
[PROOF STEP]
by simp (metis (opaque_lifting, no_types) EqOnUOut_eqOnUOut)


[STATEMENT]
lemma eval_on_carrier:
  fixes S (structure)
  shows "p \<in> carrier P ==>
  eval R S phi s p = (\<Oplus>\<^bsub>S\<^esub> i \<in> {..deg R p}. phi (coeff P p i) \<otimes>\<^bsub>S\<^esub> s [^]\<^bsub>S\<^esub> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> carrier P \<Longrightarrow> eval R S phi s p = (\<Oplus>\<^bsub>S\<^esub>i\<in>{..deg R p}. phi (coeff P p i) \<otimes>\<^bsub>S\<^esub> s [^]\<^bsub>S\<^esub> i)
[PROOF STEP]
by (unfold eval_def, fold P_def) simp


[STATEMENT]
lemma (in DFS_invar) discovered_iff_tree_path:
    "v \<notin> V0 \<Longrightarrow> v \<in> dom (discovered s) \<longleftrightarrow> (\<exists>v0\<in>V0. (v0,v) \<in> (tree_edges s)\<^sup>+)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> V0 \<Longrightarrow> (v \<in> dom (discovered s)) = (\<exists>v0\<in>V0. (v0, v) \<in> (tree_edges s)\<^sup>+)
[PROOF STEP]
using tree_discovered_inv
[PROOF STATE]
proof (prove)
using this:
tree_discovered_inv s

goal (1 subgoal):
 1. v \<notin> V0 \<Longrightarrow> (v \<in> dom (discovered s)) = (\<exists>v0\<in>V0. (v0, v) \<in> (tree_edges s)\<^sup>+)
[PROOF STEP]
by (auto simp add: tree_discovered_inv_def)


[STATEMENT]
lemma insert_Chain:
assumes "Refl r" "C \<in> Chains r" and "i \<in> Field r" and "\<And>j. j \<in> C \<Longrightarrow> (j,i) \<in> r \<or> (i,j) \<in> r"
shows "insert i C \<in> Chains r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert i C \<in> Chains r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Refl r
C \<in> Chains r
i \<in> Field r
?j \<in> C \<Longrightarrow> (?j, i) \<in> r \<or> (i, ?j) \<in> r

goal (1 subgoal):
 1. insert i C \<in> Chains r
[PROOF STEP]
unfolding Chains_def
[PROOF STATE]
proof (prove)
using this:
Refl r
C \<in> {C. \<forall>a\<in>C. \<forall>b\<in>C. (a, b) \<in> r \<or> (b, a) \<in> r}
i \<in> Field r
?j \<in> C \<Longrightarrow> (?j, i) \<in> r \<or> (i, ?j) \<in> r

goal (1 subgoal):
 1. insert i C \<in> {C. \<forall>a\<in>C. \<forall>b\<in>C. (a, b) \<in> r \<or> (b, a) \<in> r}
[PROOF STEP]
by (auto dest: refl_onD)


[STATEMENT]
lemma lead_coeff_minus: "lead_coeff (- p) = - lead_coeff p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff (- p) = - lead_coeff p
[PROOF STEP]
by (metis coeff_minus degree_minus)


[STATEMENT]
lemma Ifun_star_n: "star_n F \<star> star_n X = star_n (\<lambda>n. F n (X n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star_n F \<star> star_n X = star_n (\<lambda>n. F n (X n))
[PROOF STEP]
by (simp add: Ifun_def star_n_def Abs_star_inverse starrel_in_star
      UN_equiv_class2 [OF equiv_starrel equiv_starrel Ifun_congruent2])


[STATEMENT]
lemma additiveD:
  "additive M f \<Longrightarrow> x \<inter> y = {} \<Longrightarrow> x \<in> M \<Longrightarrow> y \<in> M \<Longrightarrow> f (x \<union> y) = f x + f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Measure_Space.additive M f; x \<inter> y = {}; x \<in> M; y \<in> M\<rbrakk> \<Longrightarrow> f (x \<union> y) = f x + f y
[PROOF STEP]
by (auto simp add: additive_def)


[STATEMENT]
lemma preflect_eq_point_iff[simp]: "t0 = preflect t0 s \<longleftrightarrow> t0 = s" "preflect t0 s = t0 \<longleftrightarrow> t0 = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t0 = preflect t0 s) = (t0 = s) &&& (preflect t0 s = t0) = (t0 = s)
[PROOF STEP]
by (auto simp: preflect_def algebra_simps scaleR_2)


[STATEMENT]
lemma append_rsp2_pre1:
  assumes a:"list_all2 (\<approx>) x x'"
  shows "list_all2 (\<approx>) (z @ x) (z @ x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (\<approx>) (z @ x) (z @ x')
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<approx>) x x'

goal (1 subgoal):
 1. list_all2 (\<approx>) (z @ x) (z @ x')
[PROOF STEP]
apply (induct x x' arbitrary: z rule: list_induct2')
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>z. list_all2 (\<approx>) [] [] \<Longrightarrow> list_all2 (\<approx>) (z @ []) (z @ [])
 2. \<And>x xs z. list_all2 (\<approx>) (x # xs) [] \<Longrightarrow> list_all2 (\<approx>) (z @ x # xs) (z @ [])
 3. \<And>y ys z. list_all2 (\<approx>) [] (y # ys) \<Longrightarrow> list_all2 (\<approx>) (z @ []) (z @ y # ys)
 4. \<And>x xs y ys z. \<lbrakk>\<And>z. list_all2 (\<approx>) xs ys \<Longrightarrow> list_all2 (\<approx>) (z @ xs) (z @ ys); list_all2 (\<approx>) (x # xs) (y # ys)\<rbrakk> \<Longrightarrow> list_all2 (\<approx>) (z @ x # xs) (z @ y # ys)
[PROOF STEP]
apply (rule list_all2_refl'[OF list_eq_equivp])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x xs z. list_all2 (\<approx>) (x # xs) [] \<Longrightarrow> list_all2 (\<approx>) (z @ x # xs) (z @ [])
 2. \<And>y ys z. list_all2 (\<approx>) [] (y # ys) \<Longrightarrow> list_all2 (\<approx>) (z @ []) (z @ y # ys)
 3. \<And>x xs y ys z. \<lbrakk>\<And>z. list_all2 (\<approx>) xs ys \<Longrightarrow> list_all2 (\<approx>) (z @ xs) (z @ ys); list_all2 (\<approx>) (x # xs) (y # ys)\<rbrakk> \<Longrightarrow> list_all2 (\<approx>) (z @ x # xs) (z @ y # ys)
[PROOF STEP]
apply (simp_all del: list_eq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys z. \<lbrakk>\<And>z. list_all2 (\<approx>) (z @ xs) (z @ ys); x \<approx> y \<and> list_all2 (\<approx>) xs ys\<rbrakk> \<Longrightarrow> list_all2 (\<approx>) (z @ x # xs) (z @ y # ys)
[PROOF STEP]
apply (rule list_all2_app_l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs y ys z. \<lbrakk>\<And>z. list_all2 (\<approx>) (z @ xs) (z @ ys); x \<approx> y \<and> list_all2 (\<approx>) xs ys\<rbrakk> \<Longrightarrow> reflp (\<approx>)
 2. \<And>x xs y ys z. \<lbrakk>\<And>z. list_all2 (\<approx>) (z @ xs) (z @ ys); x \<approx> y \<and> list_all2 (\<approx>) xs ys\<rbrakk> \<Longrightarrow> list_all2 (\<approx>) (x # xs) (y # ys)
[PROOF STEP]
apply (simp_all add: reflpI)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma all_nstri_imp_lex_nstri: assumes "\<forall> i < length ys. snd (f (xs ! i) (ys ! i))" and "length xs \<ge> length ys" and "length xs = length ys \<or> length ys \<le> m"
  shows "snd (lex_ext f m xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (lex_ext f m xs ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length ys. snd (f (xs ! i) (ys ! i))
length ys \<le> length xs
length xs = length ys \<or> length ys \<le> m

goal (1 subgoal):
 1. snd (lex_ext f m xs ys)
[PROOF STEP]
by (auto simp: lex_ext_iff)


[STATEMENT]
lemma cf_rcomp_ArrMap_vrange:
  assumes "category \<alpha> \<BB>"
    and "\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "\<SS> : \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \
"
  shows "\<R>\<^sub>\<circ> (cf_rcomp \<BB> \<SS> \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_rcomp \<BB> \<SS> \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<SS> : \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_rcomp \<BB> \<SS> \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>
[PROOF STEP]
unfolding cf_rcomp_def
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<SS> : \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_bcomp \<SS> (dghm_id \<BB>) \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>
[PROOF STEP]
by (intro cf_bcomp_ArrMap_vrange) (cs_concl cs_intro: cat_cs_intros)+


[STATEMENT]
lemma union_nodes_card:
    assumes "finite (DCA.nodes A)" "finite (DCA.nodes B)"
    shows "card (DCA.nodes (union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
have "card (DCA.nodes (union A B)) \<le>
      max 1 (length (dgca.rejecting (union' A B))) * card (DGCA.nodes (union' A B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> max 1 (length (dgca.rejecting (union' A B))) * card (DGCA.nodes (union' A B))
[PROOF STEP]
using degeneralize_nodes_card
[PROOF STATE]
proof (prove)
using this:
card (DCA.nodes (degeneralize ?A)) \<le> max 1 (length (dgca.rejecting ?A)) * card (DGCA.nodes ?A)

goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> max 1 (length (dgca.rejecting (union' A B))) * card (DGCA.nodes (union' A B))
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
card (DCA.nodes (DCA_Combine.union A B)) \<le> max 1 (length (dgca.rejecting (union' A B))) * card (DGCA.nodes (union' A B))

goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (DCA.nodes (DCA_Combine.union A B)) \<le> max 1 (length (dgca.rejecting (union' A B))) * card (DGCA.nodes (union' A B))

goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
have "length (dgca.rejecting (union' A B)) = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (dgca.rejecting (union' A B)) = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (dgca.rejecting (union' A B)) = 2

goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (dgca.rejecting (union' A B)) = 2

goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
have "card (DGCA.nodes (union' A B)) \<le> card (DCA.nodes A) * card (DCA.nodes B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (DGCA.nodes (union' A B)) \<le> card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
using union'_nodes_card assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (DCA.nodes ?A); finite (DCA.nodes ?B)\<rbrakk> \<Longrightarrow> card (DGCA.nodes (union' ?A ?B)) \<le> card (DCA.nodes ?A) * card (DCA.nodes ?B)
finite (DCA.nodes A)
finite (DCA.nodes B)

goal (1 subgoal):
 1. card (DGCA.nodes (union' A B)) \<le> card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
card (DGCA.nodes (union' A B)) \<le> card (DCA.nodes A) * card (DCA.nodes B)

goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> max 1 2 * x \<le> max 1 2 * y) \<Longrightarrow> card (DCA.nodes (DCA_Combine.union A B)) \<le> max 1 2 * (card (DCA.nodes A) * card (DCA.nodes B))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> max 1 2 * x \<le> max 1 2 * y) \<Longrightarrow> card (DCA.nodes (DCA_Combine.union A B)) \<le> max 1 2 * (card (DCA.nodes A) * card (DCA.nodes B))

goal (1 subgoal):
 1. card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (DCA.nodes (DCA_Combine.union A B)) \<le> 2 * card (DCA.nodes A) * card (DCA.nodes B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plus_eq_infty_iff_enat: "(m::enat) + n = \<infinity> \<longleftrightarrow> m=\<infinity> \<or> n=\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m + n = \<infinity>) = (m = \<infinity> \<or> n = \<infinity>)
[PROOF STEP]
using enat_add_left_cancel
[PROOF STATE]
proof (prove)
using this:
(?a + ?b = ?a + ?c) = (?a = \<infinity> \<or> ?b = ?c)

goal (1 subgoal):
 1. (m + n = \<infinity>) = (m = \<infinity> \<or> n = \<infinity>)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in domain) long_divisionE:
  assumes "subfield K R" and "p \<in> carrier (K[X])" and "q \<in> carrier (K[X])" "q \<noteq> []"
  shows "long_divides p q (p pdiv q, p pmod q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. long_divides p q (p pdiv q, p pmod q)
[PROOF STEP]
using theI'[OF exists_unique_long_division[OF assms]] assms(4)
[PROOF STATE]
proof (prove)
using this:
long_divides p q (THE x. long_divides p q x)
q \<noteq> []

goal (1 subgoal):
 1. long_divides p q (p pdiv q, p pmod q)
[PROOF STEP]
unfolding pmod_def pdiv_def long_division_def
[PROOF STATE]
proof (prove)
using this:
long_divides p q (THE x. long_divides p q x)
q \<noteq> []

goal (1 subgoal):
 1. long_divides p q (if q = [] then [] else fst (The (long_divides p q)), if q = [] then p else snd (The (long_divides p q)))
[PROOF STEP]
by auto


[STATEMENT]
lemma abs_summable_on_cmult_left [intro]:
  fixes f :: "'a \<Rightarrow> 'b :: {banach, real_normed_algebra, second_countable_topology}"
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
  shows   "(\<lambda>x. f x * c) abs_summable_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x * c) abs_summable_on A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'b) \<Longrightarrow> f abs_summable_on A

goal (1 subgoal):
 1. (\<lambda>x. f x * c) abs_summable_on A
[PROOF STEP]
unfolding abs_summable_on_def
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'b) \<Longrightarrow> integrable (count_space A) f

goal (1 subgoal):
 1. integrable (count_space A) (\<lambda>x. f x * c)
[PROOF STEP]
by (intro Bochner_Integration.integrable_mult_left)


[STATEMENT]
lemma inner_dirsum_append :
  "add_independentS (As@Bs) \<Longrightarrow> 0 \<in> (\<Sum>X\<leftarrow>Bs. X)
        \<Longrightarrow> (\<Oplus>X\<leftarrow>(As@Bs). X) = (\<Oplus>X\<leftarrow>As. X) \<oplus> (\<Oplus>X\<leftarrow>Bs. X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>add_independentS (As @ Bs); (0::'a) \<in> (\<Sum>X\<leftarrow>Bs. X)\<rbrakk> \<Longrightarrow> (\<Oplus>X\<leftarrow>As @ Bs. X) = (\<Oplus>X\<leftarrow>As. X) \<oplus> (\<Oplus>X\<leftarrow>Bs. X)
[PROOF STEP]
using inner_dirsumD[of "As@Bs"] add_independentS_append_reduce_left[of As]
        inner_dirsumD[of As] inner_dirsumD[of Bs]
        add_independentS_append_reduce_right[of As Bs]
        add_independentS_append_conv_double_sum[of As]
        inner_dirsum_doubleD[of "\<Sum>X\<leftarrow>As. X"]
[PROOF STATE]
proof (prove)
using this:
add_independentS (As @ Bs) \<Longrightarrow> (\<Oplus>M\<leftarrow>As @ Bs. M) = (\<Sum>M\<leftarrow>As @ Bs. M)
\<lbrakk>add_independentS (As @ ?Bs); (0::'a) \<in> (\<Sum>X\<leftarrow>?Bs. X)\<rbrakk> \<Longrightarrow> add_independentS As
add_independentS As \<Longrightarrow> (\<Oplus>M\<leftarrow>As. M) = (\<Sum>M\<leftarrow>As. M)
add_independentS Bs \<Longrightarrow> (\<Oplus>M\<leftarrow>Bs. M) = (\<Sum>M\<leftarrow>Bs. M)
add_independentS (As @ Bs) \<Longrightarrow> add_independentS Bs
add_independentS (As @ ?Bs) \<Longrightarrow> add_independentS [\<Sum>X\<leftarrow>As. X, \<Sum>X\<leftarrow>?Bs. X]
add_independentS [\<Sum>X\<leftarrow>As. X, ?N] \<Longrightarrow> (\<Sum>X\<leftarrow>As. X) \<oplus> ?N = (\<Sum>X\<leftarrow>As. X) + ?N

goal (1 subgoal):
 1. \<lbrakk>add_independentS (As @ Bs); (0::'a) \<in> (\<Sum>X\<leftarrow>Bs. X)\<rbrakk> \<Longrightarrow> (\<Oplus>X\<leftarrow>As @ Bs. X) = (\<Oplus>X\<leftarrow>As. X) \<oplus> (\<Oplus>X\<leftarrow>Bs. X)
[PROOF STEP]
by    simp


[STATEMENT]
lemma cf_adjunction_AdjNT_of_unit_NTMap_vdomain[adj_cs_simps]:
  assumes "\<FF> : \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<DD>"
  shows "\<D>\<^sub>\<circ> (cf_adjunction_AdjNT_of_unit \<alpha> \<FF> \<GG> \<eta>\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<DD>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_adjunction_AdjNT_of_unit \<alpha> \<FF> \<GG> \<eta>\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<DD>)\<lparr>Obj\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_adjunction_AdjNT_of_unit \<alpha> \<FF> \<GG> \<eta>\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<DD>)\<lparr>Obj\<rparr>
[PROOF STEP]
interpret is_functor \<alpha> \<CC> \<DD> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<DD>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_adjunction_AdjNT_of_unit \<alpha> \<FF> \<GG> \<eta>\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<DD>)\<lparr>Obj\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_adjunction_AdjNT_of_unit \<alpha> \<FF> \<GG> \<eta>\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<DD>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cf_adjunction_AdjNT_of_unit_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>cd\<in>\<^sub>\<circ>(op_cat (\<FF>\<lparr>HomDom\<rparr>) \<times>\<^sub>C \<FF>\<lparr>HomCod\<rparr>)\<lparr>Obj\<rparr>. umap_of \<GG> (cd\<lparr>[]\<^sub>\<circ>\<rparr>) (\<FF>\<lparr>ObjMap\<rparr>\<lparr>cd\<lparr>[]\<^sub>\<circ>\<rparr>\<rparr>) (\<eta>\<lparr>NTMap\<rparr>\<lparr>cd\<lparr>[]\<^sub>\<circ>\<rparr>\<rparr>) (cd\<lparr>1\<^sub>\<nat>\<rparr>)) = (op_cat \<CC> \<times>\<^sub>C \<DD>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (simp add: cat_cs_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (cf_adjunction_AdjNT_of_unit \<alpha> \<FF> \<GG> \<eta>\<lparr>NTMap\<rparr>) = (op_cat \<CC> \<times>\<^sub>C \<DD>)\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_m_OO_MM_Rel [simp]: "(\<lambda> M M' . mat_mod M = mat_mod M') OO MM_Rel = MM_Rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>M M'. local.mat_mod M = local.mat_mod M') OO MM_Rel = MM_Rel
[PROOF STEP]
by (intro ext, auto simp: OO_def MM_Rel_def)


[STATEMENT]
lemma function_tuple_comp_closed:
  assumes "f \<in> carrier (R\<^bsup>n\<^esup>) \<rightarrow> carrier R"
  assumes "length fs = n"
  assumes "is_function_tuple R m fs"
  shows "function_tuple_comp R fs f \<in> carrier (R\<^bsup>m\<^esup>) \<rightarrow> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. function_tuple_comp R fs f \<in> carrier (R\<^bsup>m\<^esup>) \<rightarrow> carrier R
[PROOF STEP]
unfolding function_tuple_comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> function_tuple_eval R 0 fs \<in> carrier (R\<^bsup>m\<^esup>) \<rightarrow> carrier R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (R\<^bsup>n\<^esup>) \<rightarrow> carrier R
length fs = n
is_function_tuple R m fs

goal (1 subgoal):
 1. f \<circ> function_tuple_eval R 0 fs \<in> carrier (R\<^bsup>m\<^esup>) \<rightarrow> carrier R
[PROOF STEP]
by (smt Pi_iff comp_apply function_tuple_eval_closed function_tuple_eval_def)


[STATEMENT]
lemma has_derivative_abs:
  fixes a::real
  assumes "a \<noteq> 0"
  shows "(abs has_derivative ((*) (sgn a))) (at a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (abs has_derivative (*) (sgn a)) (at a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (abs has_derivative (*) (sgn a)) (at a)
[PROOF STEP]
have [simp]: "norm = abs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm = abs
[PROOF STEP]
using real_norm_def
[PROOF STATE]
proof (prove)
using this:
norm ?r = \<bar>?r\<bar>

goal (1 subgoal):
 1. norm = abs
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
norm = abs

goal (1 subgoal):
 1. (abs has_derivative (*) (sgn a)) (at a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (abs has_derivative (*) (sgn a)) (at a)
[PROOF STEP]
using has_derivative_norm [where 'a=real, simplified] assms
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> 0 \<Longrightarrow> (abs has_derivative (\<lambda>h. h * sgn ?x)) (at ?x)
a \<noteq> 0

goal (1 subgoal):
 1. (abs has_derivative (*) (sgn a)) (at a)
[PROOF STEP]
by (simp add: mult_commute_abs)
[PROOF STATE]
proof (state)
this:
(abs has_derivative (*) (sgn a)) (at a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_ref [simp]: "1 \<le> x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) \<le> x\<^sup>\<star>
[PROOF STEP]
using star_unfoldl
[PROOF STATE]
proof (prove)
using this:
(1::'a) + ?x \<cdot> ?x\<^sup>\<star> \<le> ?x\<^sup>\<star>

goal (1 subgoal):
 1. (1::'a) \<le> x\<^sup>\<star>
[PROOF STEP]
by auto


[STATEMENT]
lemma rel_fundef_rel_fst_hd_bodies:
  assumes "rel_fundef R1 R2 fd1 fd2" and "body fd1 \<noteq> [] \<or> body fd2 \<noteq> []"
  shows "R1 (fst (hd (body fd1))) (fst (hd (body fd2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 (fst (hd (body fd1))) (fst (hd (body fd2)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
rel_fundef R1 R2 fd1 fd2
body fd1 \<noteq> [] \<or> body fd2 \<noteq> []

goal (1 subgoal):
 1. R1 (fst (hd (body fd1))) (fst (hd (body fd2)))
[PROOF STEP]
unfolding fundef.rel_sel
[PROOF STATE]
proof (prove)
using this:
list_all2 (rel_prod R1 (list_all2 R2)) (body fd1) (body fd2) \<and> arity fd1 = arity fd2 \<and> return fd1 = return fd2 \<and> fundef_locals fd1 = fundef_locals fd2
body fd1 \<noteq> [] \<or> body fd2 \<noteq> []

goal (1 subgoal):
 1. R1 (fst (hd (body fd1))) (fst (hd (body fd2)))
[PROOF STEP]
by (auto intro: list_all2_rel_prod_fst_hd[THEN conjunct1])


[STATEMENT]
lemma nu_diagonal_1:
  assumes "isotone (\<lambda>x . \<nu> (\<lambda>y . f x y))"
      and "\<forall>x . has_greatest_fixpoint (\<lambda>y . f x y)"
      and "has_greatest_postfixpoint (\<lambda>x . \<nu> (\<lambda>y . f x y))"
    shows "\<nu> (\<lambda>x . f x x) = \<nu> (\<lambda>x . \<nu> (\<lambda>y . f x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
let ?g = "\<lambda>x . \<nu> (\<lambda>y . f x y)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
have 1: "is_greatest_postfixpoint ?g (\<nu> ?g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_greatest_postfixpoint (\<lambda>x. \<nu> f x) (\<nu> (\<lambda>x. \<nu> f x))
[PROOF STEP]
using assms(1,3) greatest_postfixpoint pnu_nu
[PROOF STATE]
proof (prove)
using this:
isotone (\<lambda>x. \<nu> f x)
has_greatest_postfixpoint (\<lambda>x. \<nu> f x)
has_greatest_postfixpoint ?f \<Longrightarrow> is_greatest_postfixpoint ?f (p\<nu> ?f)
\<lbrakk>has_greatest_postfixpoint ?f; isotone ?f\<rbrakk> \<Longrightarrow> p\<nu> ?f = \<nu> ?f

goal (1 subgoal):
 1. is_greatest_postfixpoint (\<lambda>x. \<nu> f x) (\<nu> (\<lambda>x. \<nu> f x))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
is_greatest_postfixpoint (\<lambda>x. \<nu> f x) (\<nu> (\<lambda>x. \<nu> f x))

goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
have "f (\<nu> ?g) (\<nu> ?g) = \<nu> ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<nu> (\<lambda>x. \<nu> f x)) (\<nu> (\<lambda>x. \<nu> f x)) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
by (metis (no_types, lifting) assms is_greatest_fixpoint_def greatest_fixpoint_char greatest_postfixpoint_fixpoint)
[PROOF STATE]
proof (state)
this:
f (\<nu> (\<lambda>x. \<nu> f x)) (\<nu> (\<lambda>x. \<nu> f x)) = \<nu> (\<lambda>x. \<nu> f x)

goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
hence "is_greatest_fixpoint (\<lambda>x . f x x) (\<nu> ?g)"
[PROOF STATE]
proof (prove)
using this:
f (\<nu> (\<lambda>x. \<nu> f x)) (\<nu> (\<lambda>x. \<nu> f x)) = \<nu> (\<lambda>x. \<nu> f x)

goal (1 subgoal):
 1. is_greatest_fixpoint (\<lambda>x. f x x) (\<nu> (\<lambda>x. \<nu> f x))
[PROOF STEP]
using 1 assms(2) is_greatest_fixpoint_def is_greatest_postfixpoint_def greatest_fixpoint
[PROOF STATE]
proof (prove)
using this:
f (\<nu> (\<lambda>x. \<nu> f x)) (\<nu> (\<lambda>x. \<nu> f x)) = \<nu> (\<lambda>x. \<nu> f x)
is_greatest_postfixpoint (\<lambda>x. \<nu> f x) (\<nu> (\<lambda>x. \<nu> f x))
\<forall>x. has_greatest_fixpoint (f x)
is_greatest_fixpoint ?f ?x \<equiv> ?f ?x = ?x \<and> (\<forall>y. ?f y = y \<longrightarrow> y \<le> ?x)
is_greatest_postfixpoint ?f ?x \<equiv> ?x \<le> ?f ?x \<and> (\<forall>y. y \<le> ?f y \<longrightarrow> y \<le> ?x)
has_greatest_fixpoint ?f \<Longrightarrow> is_greatest_fixpoint ?f (\<nu> ?f)

goal (1 subgoal):
 1. is_greatest_fixpoint (\<lambda>x. f x x) (\<nu> (\<lambda>x. \<nu> f x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_greatest_fixpoint (\<lambda>x. f x x) (\<nu> (\<lambda>x. \<nu> f x))

goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_greatest_fixpoint (\<lambda>x. f x x) (\<nu> (\<lambda>x. \<nu> f x))

goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
using greatest_fixpoint_same
[PROOF STATE]
proof (prove)
using this:
is_greatest_fixpoint (\<lambda>x. f x x) (\<nu> (\<lambda>x. \<nu> f x))
is_greatest_fixpoint ?f ?x \<Longrightarrow> ?x = \<nu> ?f

goal (1 subgoal):
 1. \<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<nu> (\<lambda>x. f x x) = \<nu> (\<lambda>x. \<nu> f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dconvfactor_compose:
  "dconvfactor (c\<^sub>1 \<circ>\<^sub>C c\<^sub>2) d = dconvfactor c\<^sub>1 d * dconvfactor c\<^sub>2 d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dconvfactor (c\<^sub>1 \<circ>\<^sub>C c\<^sub>2) d = dconvfactor c\<^sub>1 d \<cdot> dconvfactor c\<^sub>2 d
[PROOF STEP]
by (simp add: dconvfactor_def, transfer, simp add: mult_ac intpow_mult_distrib)


[STATEMENT]
lemma timpl_closure_Fun_inv':
  assumes "Fun g S \<in> timpl_closure (Fun f T) TI"
  shows "length S = length T"
    and "\<And>i. i < length S \<Longrightarrow> S ! i \<in> timpl_closure (T ! i) TI"
    and "f \<noteq> g \<Longrightarrow> is_Abs f \<and> is_Abs g \<and> (the_Abs f, the_Abs g) \<in> TI\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length S = length T &&& (\<And>i. i < length S \<Longrightarrow> S ! i \<in> timpl_closure (T ! i) TI) &&& (f \<noteq> g \<Longrightarrow> is_Abs f \<and> is_Abs g \<and> (the_Abs f, the_Abs g) \<in> TI\<^sup>+)
[PROOF STEP]
using assms timpl_closure_is_timpl_closure'
[PROOF STATE]
proof (prove)
using this:
Fun g S \<in> timpl_closure (Fun f T) TI
(?s \<in> timpl_closure ?t ?TI) = ((?t, ?s) \<in> timpl_closure' ?TI)

goal (1 subgoal):
 1. length S = length T &&& (\<And>i. i < length S \<Longrightarrow> S ! i \<in> timpl_closure (T ! i) TI) &&& (f \<noteq> g \<Longrightarrow> is_Abs f \<and> is_Abs g \<and> (the_Abs f, the_Abs g) \<in> TI\<^sup>+)
[PROOF STEP]
by (metis timpl_closure'_inv''(1), metis timpl_closure'_inv''(2), metis timpl_closure'_inv''(3))


[STATEMENT]
lemma continuous_pow_A_1: "continuous_on R pow_A_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on R pow_A_1
[PROOF STEP]
unfolding pow_A_1_def continuous_on
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>R. ((*v) A1n \<longlongrightarrow> A1n *v x) (at x within R)
[PROOF STEP]
by (auto intro: tendsto_intros)


[STATEMENT]
lemma Rep_preal_one:
     "Rep_preal 1 = {x. 0 < x \<and> x < 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_preal 1 = {x. 0 < x \<and> x < 1}
[PROOF STEP]
by (simp add: preal_one_def rat_mem_preal)


[STATEMENT]
lemma dist_add_vec:
  shows "dist (x + s *\<^sub>R v) x = abs s * norm v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (x + s *\<^sub>R v) x = \<bar>s\<bar> * norm v
[PROOF STEP]
by (simp add: dist_cancel_add1)


[STATEMENT]
lemma ennreal_ge_1[simp]: "ennreal x \<ge> 1 \<longleftrightarrow> x \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> ennreal x) = (1 \<le> x)
[PROOF STEP]
by (cases "0 \<le> x") (auto simp: ennreal_neg simp flip: ennreal_1)


[STATEMENT]
lemma inv_push_forward_inverse: "push_forward (inv.push_forward X) = X"
  if "X \<in> dest.tangent_space p" "p \<in> dest.carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_forward (inv.push_forward X) = X
[PROOF STEP]
apply (subst push_forward_compose[OF that inv.diff_axioms diff_axioms])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff.push_forward k charts2 charts2 (f \<circ> f') X = X
[PROOF STEP]
apply (rule dest.push_forward_id[OF _ that])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> dest.carrier \<Longrightarrow> (f \<circ> f') x = x
[PROOF STEP]
by auto


[STATEMENT]
lemma add_rquot: "x \<preceq>\<^sub>R y \<Longrightarrow> (D x z \<and> x \<oplus> z = y \<longleftrightarrow> z = rquot y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<preceq>\<^sub>R y \<Longrightarrow> (D x z \<and> x \<oplus> z = y) = (z = rquot y x)
[PROOF STEP]
using gR_rel_def rquot_prop
[PROOF STATE]
proof (prove)
using this:
(?x \<preceq>\<^sub>R ?y) = (\<exists>z. D ?x z \<and> ?x \<oplus> z = ?y)
D ?x ?z \<and> ?y = ?x \<oplus> ?z \<Longrightarrow> ?z = rquot ?y ?x

goal (1 subgoal):
 1. x \<preceq>\<^sub>R y \<Longrightarrow> (D x z \<and> x \<oplus> z = y) = (z = rquot y x)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma connected_space_closures:
     "connected_space X \<longleftrightarrow>
        (\<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})"
     (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_space X = (\<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. connected_space X \<Longrightarrow> \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}
 2. \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {} \<Longrightarrow> connected_space X
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
connected_space X

goal (2 subgoals):
 1. connected_space X \<Longrightarrow> \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}
 2. \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {} \<Longrightarrow> connected_space X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
connected_space X
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
connected_space X

goal (1 subgoal):
 1. \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}
[PROOF STEP]
unfolding connected_space_closedin_eq
[PROOF STATE]
proof (prove)
using this:
\<nexists>E1 E2. closedin X E1 \<and> closedin X E2 \<and> E1 \<union> E2 = topspace X \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {}

goal (1 subgoal):
 1. \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}
[PROOF STEP]
by (metis Un_upper1 Un_upper2 closedin_closure_of closure_of_Un closure_of_eq_empty closure_of_topspace)
[PROOF STATE]
proof (state)
this:
\<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}

goal (1 subgoal):
 1. \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {} \<Longrightarrow> connected_space X
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {} \<Longrightarrow> connected_space X
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}

goal (1 subgoal):
 1. \<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {} \<Longrightarrow> connected_space X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}

goal (1 subgoal):
 1. connected_space X
[PROOF STEP]
unfolding connected_space_closedin_eq
[PROOF STATE]
proof (prove)
using this:
\<nexists>e1 e2. e1 \<union> e2 = topspace X \<and> X closure_of e1 \<inter> X closure_of e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {}

goal (1 subgoal):
 1. \<nexists>E1 E2. closedin X E1 \<and> closedin X E2 \<and> E1 \<union> E2 = topspace X \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {}
[PROOF STEP]
by (metis closure_of_eq)
[PROOF STATE]
proof (state)
this:
connected_space X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) Sr_pOp_closed:"\<lbrakk>sr R S; x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sr R S; x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> S
[PROOF STEP]
apply (frule Sr_mOp_closed[of "S" "y"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sr R S; x \<in> S; y \<in> S; -\<^sub>a y \<in> S\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> S
[PROOF STEP]
apply (unfold sr_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> S; y \<in> S; -\<^sub>a y \<in> S; S \<subseteq> carrier R; 1\<^sub>r \<in> S; \<forall>x\<in>S. \<forall>y\<in>S. x \<plusminus> -\<^sub>a y \<in> S \<and> x \<cdot>\<^sub>r y \<in> S\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> S
[PROOF STEP]
apply (frule_tac x = x in bspec, assumption,
        thin_tac "\<forall>x\<in>S. \<forall>y\<in>S. x \<plusminus> -\<^sub>a y \<in> S \<and> x \<cdot>\<^sub>r y \<in> S",
        frule_tac x = "-\<^sub>a y" in bspec, assumption,
        thin_tac "\<forall>y\<in>S. x \<plusminus> -\<^sub>a y \<in> S \<and> x \<cdot>\<^sub>r y \<in> S", erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> S; y \<in> S; -\<^sub>a y \<in> S; S \<subseteq> carrier R; 1\<^sub>r \<in> S; x \<plusminus> -\<^sub>a (-\<^sub>a y) \<in> S; x \<cdot>\<^sub>r (-\<^sub>a y) \<in> S\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> S
[PROOF STEP]
apply (cut_tac ring_is_ag )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> S; y \<in> S; -\<^sub>a y \<in> S; S \<subseteq> carrier R; 1\<^sub>r \<in> S; x \<plusminus> -\<^sub>a (-\<^sub>a y) \<in> S; x \<cdot>\<^sub>r (-\<^sub>a y) \<in> S; aGroup R\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> S
[PROOF STEP]
apply (frule subsetD[of "S" "carrier R" "y"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> S; y \<in> S; -\<^sub>a y \<in> S; S \<subseteq> carrier R; 1\<^sub>r \<in> S; x \<plusminus> -\<^sub>a (-\<^sub>a y) \<in> S; x \<cdot>\<^sub>r (-\<^sub>a y) \<in> S; aGroup R; y \<in> carrier R\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> S
[PROOF STEP]
apply (simp add:aGroup.ag_inv_inv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ball_minus_countable_nonempty:
  assumes "countable (A :: 'a :: euclidean_space set)" "r > 0"
  shows   "ball z r - A \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball z r - A \<noteq> {}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ball z r - A = {} \<Longrightarrow> False
[PROOF STEP]
assume *: "ball z r - A = {}"
[PROOF STATE]
proof (state)
this:
ball z r - A = {}

goal (1 subgoal):
 1. ball z r - A = {} \<Longrightarrow> False
[PROOF STEP]
have "uncountable (ball z r - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable (ball z r - A)
[PROOF STEP]
by (intro uncountable_minus_countable assms uncountable_ball)
[PROOF STATE]
proof (state)
this:
uncountable (ball z r - A)

goal (1 subgoal):
 1. ball z r - A = {} \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
uncountable (ball z r - A)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cr_vreal_bi_uniqie[transfer_rule]: "bi_unique cr_vreal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bi_unique cr_vreal
[PROOF STEP]
unfolding cr_vreal_def bi_unique_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y z. x = y\<^sub>\<real> \<longrightarrow> x = z\<^sub>\<real> \<longrightarrow> y = z) \<and> (\<forall>x y z. x = z\<^sub>\<real> \<longrightarrow> y = z\<^sub>\<real> \<longrightarrow> x = y)
[PROOF STEP]
by (simp add: inj_eq inj_vreal_of_real)


[STATEMENT]
lemma emeasure_0_AE:
  assumes "emeasure M (space M) = 0"
  shows "AE x in M. P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere M P
[PROOF STEP]
using eventually_ae_filter assms
[PROOF STATE]
proof (prove)
using this:
almost_everywhere ?M ?P = (\<exists>N\<in>null_sets ?M. {x \<in> space ?M. \<not> ?P x} \<subseteq> N)
emeasure M (space M) = 0

goal (1 subgoal):
 1. almost_everywhere M P
[PROOF STEP]
by blast


[STATEMENT]
lemma ncoplanar_perm_11:
  assumes "\<not> Coplanar A B C D"
  shows "\<not>  Coplanar B D C A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Coplanar B D C A
[PROOF STEP]
using assms coplanar_perm_19
[PROOF STATE]
proof (prove)
using this:
\<not> Coplanar A B C D
Coplanar ?A ?B ?C ?D \<Longrightarrow> Coplanar ?D ?A ?C ?B

goal (1 subgoal):
 1. \<not> Coplanar B D C A
[PROOF STEP]
by blast


[STATEMENT]
lemma retract_of_closed:
    fixes S :: "'a :: t2_space set"
    shows "\<lbrakk>closed T; S retract_of T\<rbrakk> \<Longrightarrow> closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed T; S retract_of T\<rbrakk> \<Longrightarrow> closed S
[PROOF STEP]
by (metis closedin_retract closedin_closed_eq)


[STATEMENT]
lemma wf_trm_param_idx:
  assumes "wf\<^sub>t\<^sub>r\<^sub>m (Fun f T)"
    and "i < length T"
  shows "wf\<^sub>t\<^sub>r\<^sub>m (T ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf\<^sub>t\<^sub>r\<^sub>m (T ! i)
[PROOF STEP]
using wf_trm_param[OF assms(1), of "T ! i"] assms(2)
[PROOF STATE]
proof (prove)
using this:
T ! i \<in> set T \<Longrightarrow> wf\<^sub>t\<^sub>r\<^sub>m (T ! i)
i < length T

goal (1 subgoal):
 1. wf\<^sub>t\<^sub>r\<^sub>m (T ! i)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma subst_comp[simp]: "t \<lhd> (r \<lozenge> s) = t \<lhd> r \<lhd> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<lhd> r \<lozenge> s = t \<lhd> r \<lhd> s
[PROOF STEP]
proof (induct t)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. Var x \<lhd> r \<lozenge> s = Var x \<lhd> r \<lhd> s
 2. \<And>x. Const x \<lhd> r \<lozenge> s = Const x \<lhd> r \<lhd> s
 3. \<And>t1 t2. \<lbrakk>t1 \<lhd> r \<lozenge> s = t1 \<lhd> r \<lhd> s; t2 \<lhd> r \<lozenge> s = t2 \<lhd> r \<lhd> s\<rbrakk> \<Longrightarrow> t1 \<cdot> t2 \<lhd> r \<lozenge> s = t1 \<cdot> t2 \<lhd> r \<lhd> s
[PROOF STEP]
case (Var v)
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>x. Var x \<lhd> r \<lozenge> s = Var x \<lhd> r \<lhd> s
 2. \<And>x. Const x \<lhd> r \<lozenge> s = Const x \<lhd> r \<lhd> s
 3. \<And>t1 t2. \<lbrakk>t1 \<lhd> r \<lozenge> s = t1 \<lhd> r \<lhd> s; t2 \<lhd> r \<lozenge> s = t2 \<lhd> r \<lhd> s\<rbrakk> \<Longrightarrow> t1 \<cdot> t2 \<lhd> r \<lozenge> s = t1 \<cdot> t2 \<lhd> r \<lhd> s
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Var v \<lhd> r \<lozenge> s = Var v \<lhd> r \<lhd> s
[PROOF STEP]
by (induct r) auto
[PROOF STATE]
proof (state)
this:
Var v \<lhd> r \<lozenge> s = Var v \<lhd> r \<lhd> s

goal (2 subgoals):
 1. \<And>x. Const x \<lhd> r \<lozenge> s = Const x \<lhd> r \<lhd> s
 2. \<And>t1 t2. \<lbrakk>t1 \<lhd> r \<lozenge> s = t1 \<lhd> r \<lhd> s; t2 \<lhd> r \<lozenge> s = t2 \<lhd> r \<lhd> s\<rbrakk> \<Longrightarrow> t1 \<cdot> t2 \<lhd> r \<lozenge> s = t1 \<cdot> t2 \<lhd> r \<lhd> s
[PROOF STEP]
qed auto


[STATEMENT]
lemma uniform_limit_sophomores_dream1:
  "uniform_limit {0..(1::real)}
      (\<lambda>n x. \<Sum>k<n. (x * ln x) ^ k / fact k)
      (\<lambda>x. \<Sum>k. (x * ln x) ^ k / fact k)
      sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit {0..1} (\<lambda>n x. \<Sum>k<n. (x * ln x) ^ k / fact k) (\<lambda>x. \<Sum>k. (x * ln x) ^ k / fact k) sequentially
[PROOF STEP]
proof (rule Weierstrass_m_test)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> ?M n
 2. summable ?M
[PROOF STEP]
show "summable (\<lambda>k. exp (-1) ^ k / fact k :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>k. exp (- 1) ^ k / fact k)
[PROOF STEP]
using summable_exp[of "exp (-1)"]
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. inverse (fact n) * exp (- (1::?'a1)) ^ n)

goal (1 subgoal):
 1. summable (\<lambda>k. exp (- 1) ^ k / fact k)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>k. exp (- 1) ^ k / fact k)

goal (1 subgoal):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> exp (- 1) ^ n / fact n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> exp (- 1) ^ n / fact n
[PROOF STEP]
fix k :: nat and x :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> exp (- 1) ^ n / fact n
[PROOF STEP]
assume x: "x \<in> {0..1}"
[PROOF STATE]
proof (state)
this:
x \<in> {0..1}

goal (1 subgoal):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> exp (- 1) ^ n / fact n
[PROOF STEP]
have "norm ((x * ln x) ^ k / fact k) = norm (x * ln x) ^ k / fact k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((x * ln x) ^ k / fact k) = norm (x * ln x) ^ k / fact k
[PROOF STEP]
by (simp add: power_abs)
[PROOF STATE]
proof (state)
this:
norm ((x * ln x) ^ k / fact k) = norm (x * ln x) ^ k / fact k

goal (1 subgoal):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> exp (- 1) ^ n / fact n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((x * ln x) ^ k / fact k) = norm (x * ln x) ^ k / fact k

goal (1 subgoal):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> exp (- 1) ^ n / fact n
[PROOF STEP]
have "\<dots> \<le> exp (-1) ^ k / fact k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x * ln x) ^ k / fact k \<le> exp (- 1) ^ k / fact k
[PROOF STEP]
by (intro divide_right_mono power_mono) (use x_log_x_within_01_le [of x] x in auto)
[PROOF STATE]
proof (state)
this:
norm (x * ln x) ^ k / fact k \<le> exp (- 1) ^ k / fact k

goal (1 subgoal):
 1. \<And>n x. x \<in> {0..1} \<Longrightarrow> norm ((x * ln x) ^ n / fact n) \<le> exp (- 1) ^ n / fact n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm ((x * ln x) ^ k / fact k) \<le> exp (- 1) ^ k / fact k
[PROOF STEP]
show "norm ((x * ln x) ^ k / fact k) \<le> exp (- 1) ^ k / fact k"
[PROOF STATE]
proof (prove)
using this:
norm ((x * ln x) ^ k / fact k) \<le> exp (- 1) ^ k / fact k

goal (1 subgoal):
 1. norm ((x * ln x) ^ k / fact k) \<le> exp (- 1) ^ k / fact k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm ((x * ln x) ^ k / fact k) \<le> exp (- 1) ^ k / fact k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem nonempty_head [simp]:
    "head (x # S) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. head (x # S) = x
[PROOF STEP]
by (simp add: head_def)


[STATEMENT]
lemma rel_list_all2_Cons2:
  "list_all2 (fun_of S) xs (y#ys) =
  (\<exists>z zs. xs = z#zs \<and> (z,y) \<in> S \<and> list_all2 (fun_of S) zs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (fun_of S) xs (y # ys) = (\<exists>z zs. xs = z # zs \<and> (z, y) \<in> S \<and> list_all2 (fun_of S) zs ys)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (fun_of S) xs (y # ys) = (\<exists>z zs. xs = z # zs \<and> (z, y) \<in> S \<and> list_all2 (fun_of S) zs ys)
[PROOF STEP]
by (cases xs) auto


[STATEMENT]
lemma psi_convex2:
  assumes "psi a c b"
  assumes "psi a d b"
  assumes "0 \<le> u" "0 \<le> v" "u + v = 1"
  shows "psi a (u *\<^sub>R c + v *\<^sub>R d) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi a (u *\<^sub>R c + v *\<^sub>R d) b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. psi a (u *\<^sub>R c + v *\<^sub>R d) b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
psi a c b
psi a d b
0 \<le> u
0 \<le> v
u + v = 1
[PROOF STEP]
have v: "v = (1 - u)"
[PROOF STATE]
proof (prove)
using this:
psi a c b
psi a d b
0 \<le> u
0 \<le> v
u + v = 1

goal (1 subgoal):
 1. v = 1 - u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v = 1 - u

goal (1 subgoal):
 1. psi a (u *\<^sub>R c + v *\<^sub>R d) b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi a (u *\<^sub>R c + v *\<^sub>R d) b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
psi a c b
psi a d b
0 \<le> u
0 \<le> v
u + v = 1

goal (1 subgoal):
 1. psi a (u *\<^sub>R c + v *\<^sub>R d) b
[PROOF STEP]
by (auto simp: psi_def v intro!: lex_convex2' lex_convex2)
[PROOF STATE]
proof (state)
this:
psi a (u *\<^sub>R c + v *\<^sub>R d) b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_integral_reflect:
  "(LBINT x=a..b. f x) = (LBINT x=-b..-a. f (-x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
proof (induct a b rule: linorder_wlog)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
 2. \<And>a b. interval_lebesgue_integral lborel b a f = LBINT x=- a..- b. f (- x) \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
case (sym a b)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel b a f = LBINT x=- a..- b. f (- x)

goal (2 subgoals):
 1. \<And>a b. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
 2. \<And>a b. interval_lebesgue_integral lborel b a f = LBINT x=- a..- b. f (- x) \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interval_lebesgue_integral lborel b a f = LBINT x=- a..- b. f (- x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integral lborel b a f = LBINT x=- a..- b. f (- x)

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
by (auto simp: interval_lebesgue_integral_def interval_integrable_endpoints_reverse
             split: if_split_asm)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)

goal (1 subgoal):
 1. \<And>a b. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
case (le a b)
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (1 subgoal):
 1. \<And>a b. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
have "LBINT x:{x. - x \<in> einterval a b}. f (- x) = LBINT x:einterval (- b) (- a). f (- x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x:{x. - x \<in> einterval a b}. f (- x) = LBINT x:einterval (- b) (- a). f (- x)
[PROOF STEP]
unfolding interval_lebesgue_integrable_def set_lebesgue_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. indicat_real {x. - x \<in> einterval a b} x *\<^sub>R f (- x) = LBINT x. indicat_real (einterval (- b) (- a)) x *\<^sub>R f (- x)
[PROOF STEP]
apply (rule Bochner_Integration.integral_cong [OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> indicat_real {x. - x \<in> einterval a b} x *\<^sub>R f (- x) = indicat_real (einterval (- b) (- a)) x *\<^sub>R f (- x)
[PROOF STEP]
by (auto simp: einterval_iff ereal_uminus_le_reorder ereal_uminus_less_reorder not_less
             simp flip: uminus_ereal.simps
             split: split_indicator)
[PROOF STATE]
proof (state)
this:
LBINT x:{x. - x \<in> einterval a b}. f (- x) = LBINT x:einterval (- b) (- a). f (- x)

goal (1 subgoal):
 1. \<And>a b. a \<le> b \<Longrightarrow> interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LBINT x:{x. - x \<in> einterval a b}. f (- x) = LBINT x:einterval (- b) (- a). f (- x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
LBINT x:{x. - x \<in> einterval a b}. f (- x) = LBINT x:einterval (- b) (- a). f (- x)

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)
[PROOF STEP]
unfolding interval_lebesgue_integral_def
[PROOF STATE]
proof (prove)
using this:
LBINT x:{x. - x \<in> einterval a b}. f (- x) = LBINT x:einterval (- b) (- a). f (- x)

goal (1 subgoal):
 1. (if a \<le> b then set_lebesgue_integral lborel (einterval a b) f else - set_lebesgue_integral lborel (einterval b a) f) = (if - b \<le> - a then LBINT x:einterval (- b) (- a). f (- x) else - (LBINT x:einterval (- a) (- b). f (- x)))
[PROOF STEP]
by (subst set_integral_reflect) (simp add: le)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f = LBINT x=- b..- a. f (- x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ENR_imp_absolute_neighbourhood_retract:
  fixes S :: "'a::euclidean_space set" and S' :: "'b::euclidean_space set"
  assumes "ENR S" and hom: "S homeomorphic S'"
      and "S' \<subseteq> U"
  obtains V where "openin (top_of_set U) V" "S' retract_of V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain X where "open X" "S retract_of X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. \<lbrakk>open X; S retract_of X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>ENR S\<close>
[PROOF STATE]
proof (prove)
using this:
ENR S

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>open X; S retract_of X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: ENR_def)
[PROOF STATE]
proof (state)
this:
open X
S retract_of X

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open X
S retract_of X
[PROOF STEP]
obtain r where "retraction X S r"
[PROOF STATE]
proof (prove)
using this:
open X
S retract_of X

goal (1 subgoal):
 1. (\<And>r. retraction X S r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: retract_of_def)
[PROOF STATE]
proof (state)
this:
retraction X S r

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "locally compact S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally compact S'
[PROOF STEP]
using retract_of_locally_compact open_imp_locally_compact
          homeomorphic_local_compactness \<open>S retract_of X\<close> \<open>open X\<close> hom
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>locally compact ?S; ?T retract_of ?S\<rbrakk> \<Longrightarrow> locally compact ?T
open ?S \<Longrightarrow> locally compact ?S
?S homeomorphic ?T \<Longrightarrow> locally compact ?S = locally compact ?T
S retract_of X
open X
S homeomorphic S'

goal (1 subgoal):
 1. locally compact S'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
locally compact S'

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
locally compact S'
[PROOF STEP]
obtain W where UW: "openin (top_of_set U) W"
                  and WS': "closedin (top_of_set W) S'"
[PROOF STATE]
proof (prove)
using this:
locally compact S'

goal (1 subgoal):
 1. (\<And>W. \<lbrakk>openin (top_of_set U) W; closedin (top_of_set W) S'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply (rule locally_compact_closedin_open)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T. \<lbrakk>\<And>W. \<lbrakk>openin (top_of_set U) W; closedin (top_of_set W) S'\<rbrakk> \<Longrightarrow> thesis; open T; closedin (top_of_set T) S'\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (meson Int_lower2 assms(3) closedin_imp_subset closedin_subset_trans le_inf_iff openin_open)
[PROOF STATE]
proof (state)
this:
openin (top_of_set U) W
closedin (top_of_set W) S'

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain f g where hom: "homeomorphism S S' f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f g. homeomorphism S S' f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ENR S
S homeomorphic S'
S' \<subseteq> U

goal (1 subgoal):
 1. (\<And>f g. homeomorphism S S' f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: homeomorphic_def)
[PROOF STATE]
proof (state)
this:
homeomorphism S S' f g

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have contg: "continuous_on S' g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S' g
[PROOF STEP]
using hom homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
homeomorphism S S' f g
homeomorphism ?s ?t ?f ?g = ((\<forall>x\<in>?s. ?g (?f x) = x) \<and> ?f ` ?s = ?t \<and> continuous_on ?s ?f \<and> (\<forall>y\<in>?t. ?f (?g y) = y) \<and> ?g ` ?t = ?s \<and> continuous_on ?t ?g)

goal (1 subgoal):
 1. continuous_on S' g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on S' g

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on S' g

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "g ` S' \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` S' \<subseteq> S
[PROOF STEP]
by (metis hom equalityE homeomorphism_def)
[PROOF STATE]
proof (state)
this:
g ` S' \<subseteq> S

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on S' g
g ` S' \<subseteq> S
[PROOF STEP]
obtain h where conth: "continuous_on W h" and hg: "\<And>x. x \<in> S' \<Longrightarrow> h x = g x"
[PROOF STATE]
proof (prove)
using this:
continuous_on S' g
g ` S' \<subseteq> S

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>continuous_on W h; \<And>x. x \<in> S' \<Longrightarrow> h x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Tietze_unbounded [of S' g W] WS'
[PROOF STATE]
proof (prove)
using this:
continuous_on S' g
g ` S' \<subseteq> S
\<lbrakk>continuous_on S' g; closedin (top_of_set W) S'; \<And>ga. \<lbrakk>continuous_on W ga; \<And>x. x \<in> S' \<Longrightarrow> ga x = g x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
closedin (top_of_set W) S'

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>continuous_on W h; \<And>x. x \<in> S' \<Longrightarrow> h x = g x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on W h
?x \<in> S' \<Longrightarrow> h ?x = g ?x

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "W \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<subseteq> U
[PROOF STEP]
using UW openin_open
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set U) W
openin (top_of_set ?U) ?S = (\<exists>T. open T \<and> ?S = ?U \<inter> T)

goal (1 subgoal):
 1. W \<subseteq> U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
W \<subseteq> U

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "S' \<subseteq> W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' \<subseteq> W
[PROOF STEP]
using WS' closedin_closed
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set W) S'
closedin (top_of_set ?U) ?S = (\<exists>T. closed T \<and> ?S = ?U \<inter> T)

goal (1 subgoal):
 1. S' \<subseteq> W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S' \<subseteq> W

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have him: "\<And>x. x \<in> S' \<Longrightarrow> h x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S' \<Longrightarrow> h x \<in> X
[PROOF STEP]
by (metis (no_types) \<open>S retract_of X\<close> hg hom homeomorphism_def image_insert insert_absorb insert_iff retract_of_imp_subset subset_eq)
[PROOF STATE]
proof (state)
this:
?x \<in> S' \<Longrightarrow> h ?x \<in> X

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "S' retract_of (W \<inter> h -` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' retract_of W \<inter> h -` X
[PROOF STEP]
proof (simp add: retraction_def retract_of_def, intro exI conjI)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. S' \<subseteq> W
 2. S' \<subseteq> h -` X
 3. continuous_on (W \<inter> h -` X) ?r14
 4. ?r14 ` (W \<inter> h -` X) \<subseteq> S'
 5. \<forall>x\<in>S'. ?r14 x = x
[PROOF STEP]
show "S' \<subseteq> W" "S' \<subseteq> h -` X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' \<subseteq> W &&& S' \<subseteq> h -` X
[PROOF STEP]
using him WS' closedin_imp_subset
[PROOF STATE]
proof (prove)
using this:
?x \<in> S' \<Longrightarrow> h ?x \<in> X
closedin (top_of_set W) S'
closedin (subtopology ?U ?S) ?T \<Longrightarrow> ?T \<subseteq> ?S

goal (1 subgoal):
 1. S' \<subseteq> W &&& S' \<subseteq> h -` X
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
S' \<subseteq> W
S' \<subseteq> h -` X

goal (3 subgoals):
 1. continuous_on (W \<inter> h -` X) ?r14
 2. ?r14 ` (W \<inter> h -` X) \<subseteq> S'
 3. \<forall>x\<in>S'. ?r14 x = x
[PROOF STEP]
show "continuous_on (W \<inter> h -` X) (f \<circ> r \<circ> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (W \<inter> h -` X) (f \<circ> r \<circ> h)
[PROOF STEP]
proof (intro continuous_on_compose)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. continuous_on (W \<inter> h -` X) h
 2. continuous_on (h ` (W \<inter> h -` X)) r
 3. continuous_on (r ` h ` (W \<inter> h -` X)) f
[PROOF STEP]
show "continuous_on (W \<inter> h -` X) h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (W \<inter> h -` X) h
[PROOF STEP]
by (meson conth continuous_on_subset inf_le1)
[PROOF STATE]
proof (state)
this:
continuous_on (W \<inter> h -` X) h

goal (2 subgoals):
 1. continuous_on (h ` (W \<inter> h -` X)) r
 2. continuous_on (r ` h ` (W \<inter> h -` X)) f
[PROOF STEP]
show "continuous_on (h ` (W \<inter> h -` X)) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (h ` (W \<inter> h -` X)) r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on (h ` (W \<inter> h -` X)) r
[PROOF STEP]
have "h ` (W \<inter> h -` X) \<subseteq> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` (W \<inter> h -` X) \<subseteq> X
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h ` (W \<inter> h -` X) \<subseteq> X

goal (1 subgoal):
 1. continuous_on (h ` (W \<inter> h -` X)) r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h ` (W \<inter> h -` X) \<subseteq> X
[PROOF STEP]
show "continuous_on (h ` (W \<inter> h -` X)) r"
[PROOF STATE]
proof (prove)
using this:
h ` (W \<inter> h -` X) \<subseteq> X

goal (1 subgoal):
 1. continuous_on (h ` (W \<inter> h -` X)) r
[PROOF STEP]
by (meson \<open>retraction X S r\<close> continuous_on_subset retraction)
[PROOF STATE]
proof (state)
this:
continuous_on (h ` (W \<inter> h -` X)) r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on (h ` (W \<inter> h -` X)) r

goal (1 subgoal):
 1. continuous_on (r ` h ` (W \<inter> h -` X)) f
[PROOF STEP]
show "continuous_on (r ` h ` (W \<inter> h -` X)) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (r ` h ` (W \<inter> h -` X)) f
[PROOF STEP]
proof (rule continuous_on_subset [of S])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on S f
 2. r ` h ` (W \<inter> h -` X) \<subseteq> S
[PROOF STEP]
show "continuous_on S f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
using hom homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
homeomorphism S S' f g
homeomorphism ?s ?t ?f ?g = ((\<forall>x\<in>?s. ?g (?f x) = x) \<and> ?f ` ?s = ?t \<and> continuous_on ?s ?f \<and> (\<forall>y\<in>?t. ?f (?g y) = y) \<and> ?g ` ?t = ?s \<and> continuous_on ?t ?g)

goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on S f

goal (1 subgoal):
 1. r ` h ` (W \<inter> h -` X) \<subseteq> S
[PROOF STEP]
show "r ` h ` (W \<inter> h -` X) \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r ` h ` (W \<inter> h -` X) \<subseteq> S
[PROOF STEP]
by (metis \<open>retraction X S r\<close> image_mono image_subset_iff_subset_vimage inf_le2 retraction)
[PROOF STATE]
proof (state)
this:
r ` h ` (W \<inter> h -` X) \<subseteq> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on (r ` h ` (W \<inter> h -` X)) f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on (W \<inter> h -` X) (f \<circ> r \<circ> h)

goal (2 subgoals):
 1. (f \<circ> r \<circ> h) ` (W \<inter> h -` X) \<subseteq> S'
 2. \<forall>x\<in>S'. (f \<circ> r \<circ> h) x = x
[PROOF STEP]
show "(f \<circ> r \<circ> h) ` (W \<inter> h -` X) \<subseteq> S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> r \<circ> h) ` (W \<inter> h -` X) \<subseteq> S'
[PROOF STEP]
using \<open>retraction X S r\<close> hom
[PROOF STATE]
proof (prove)
using this:
retraction X S r
homeomorphism S S' f g

goal (1 subgoal):
 1. (f \<circ> r \<circ> h) ` (W \<inter> h -` X) \<subseteq> S'
[PROOF STEP]
by (auto simp: retraction_def homeomorphism_def)
[PROOF STATE]
proof (state)
this:
(f \<circ> r \<circ> h) ` (W \<inter> h -` X) \<subseteq> S'

goal (1 subgoal):
 1. \<forall>x\<in>S'. (f \<circ> r \<circ> h) x = x
[PROOF STEP]
show "\<forall>x\<in>S'. (f \<circ> r \<circ> h) x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S'. (f \<circ> r \<circ> h) x = x
[PROOF STEP]
using \<open>retraction X S r\<close> hom
[PROOF STATE]
proof (prove)
using this:
retraction X S r
homeomorphism S S' f g

goal (1 subgoal):
 1. \<forall>x\<in>S'. (f \<circ> r \<circ> h) x = x
[PROOF STEP]
by (auto simp: retraction_def homeomorphism_def hg)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S'. (f \<circ> r \<circ> h) x = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
S' retract_of W \<inter> h -` X

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S' retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S' retract_of W \<inter> h -` X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S' retract_of W \<inter> h -` X

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using UW \<open>open X\<close> conth continuous_openin_preimage_eq openin_trans that
[PROOF STATE]
proof (prove)
using this:
S' retract_of W \<inter> h -` X
openin (top_of_set U) W
open X
continuous_on W h
continuous_on ?S ?f = (\<forall>T. open T \<longrightarrow> openin (top_of_set ?S) (?S \<inter> ?f -` T))
\<lbrakk>openin (top_of_set ?T) ?S; openin (top_of_set ?U) ?T\<rbrakk> \<Longrightarrow> openin (top_of_set ?U) ?S
\<lbrakk>openin (top_of_set U) ?V; S' retract_of ?V\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ln_bound: "0 < x \<Longrightarrow> ln x \<le> x" for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln x \<le> x
[PROOF STEP]
using ln_le_minus_one
[PROOF STATE]
proof (prove)
using this:
0 < ?x \<Longrightarrow> ln ?x \<le> ?x - 1

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


[STATEMENT]
lemma uncountable_def: "uncountable A \<longleftrightarrow> A \<noteq> {} \<and> \<not> (\<exists>f::(nat \<Rightarrow> 'a). range f = A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable A = (A \<noteq> {} \<and> (\<nexists>f. range f = A))
[PROOF STEP]
by (auto intro: inj_on_inv_into simp: countable_def)
     (metis all_not_in_conv inj_on_iff_surj subset_UNIV)


[STATEMENT]
lemma Zp_continuous_is_Zp_closed:
  assumes "is_Zp_continuous f"
  shows "f \<in> carrier (Fun Zp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier (function_ring (carrier Zp) Zp)
[PROOF STEP]
using assms is_Zp_continuous_def
[PROOF STATE]
proof (prove)
using this:
is_Zp_continuous f
is_Zp_continuous ?f = (?f \<in> carrier (function_ring (carrier Zp) Zp) \<and> (\<forall>s. is_Zp_cauchy s \<longrightarrow> is_Zp_cauchy (?f \<circ> s)))

goal (1 subgoal):
 1. f \<in> carrier (function_ring (carrier Zp) Zp)
[PROOF STEP]
by blast


[STATEMENT]
lemma args_to_set_subset_Times:
  assumes "set ps \<subseteq> set bs \<times> (set gs \<union> set bs)"
  shows "args_to_set (gs, bs, ps) = fst ` set gs \<union> fst ` set bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. args_to_set (gs, bs, ps) = fst ` set gs \<union> fst ` set bs
[PROOF STEP]
unfolding args_to_set_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set gs \<union> fst ` set bs \<union> fst ` fst ` set ps \<union> fst ` snd ` set ps = fst ` set gs \<union> fst ` set bs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set ps \<subseteq> set bs \<times> (set gs \<union> set bs)

goal (1 subgoal):
 1. fst ` set gs \<union> fst ` set bs \<union> fst ` fst ` set ps \<union> fst ` snd ` set ps = fst ` set gs \<union> fst ` set bs
[PROOF STEP]
by auto


[STATEMENT]
lemma is_aligned_mask_offset_unat:
  fixes off :: "('a::len) word"
  and     x :: "'a word"
  assumes al: "is_aligned x sz"
  and   offv: "off \<le> mask sz"
  shows  "unat x + unat off < 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
 2. \<not> ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
assume szv: "sz < LENGTH('a)"
[PROOF STATE]
proof (state)
this:
sz < LENGTH('a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
 2. \<not> ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
from al
[PROOF STATE]
proof (chain)
picking this:
is_aligned x sz
[PROOF STEP]
obtain k where xv: "x = 2 ^ sz * (of_nat k)"
    and kl: "k < 2 ^ (LENGTH('a) - sz)"
[PROOF STATE]
proof (prove)
using this:
is_aligned x sz

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>x = 2 ^ sz * word_of_nat k; k < 2 ^ (LENGTH('a) - sz)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: is_alignedE)
[PROOF STATE]
proof (state)
this:
x = 2 ^ sz * word_of_nat k
k < 2 ^ (LENGTH('a) - sz)

goal (2 subgoals):
 1. ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
 2. \<not> ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
from offv szv
[PROOF STATE]
proof (chain)
picking this:
off \<le> mask sz
sz < LENGTH('a)
[PROOF STEP]
have offv': "unat off < 2 ^ sz"
[PROOF STATE]
proof (prove)
using this:
off \<le> mask sz
sz < LENGTH('a)

goal (1 subgoal):
 1. unat off < 2 ^ sz
[PROOF STEP]
by (simp add: mask_2pm1 unat_less_power)
[PROOF STATE]
proof (state)
this:
unat off < 2 ^ sz

goal (2 subgoals):
 1. ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
 2. \<not> ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
using szv
[PROOF STATE]
proof (prove)
using this:
sz < LENGTH('a)

goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
using al is_aligned_no_wrap''' offv'
[PROOF STATE]
proof (prove)
using this:
sz < LENGTH('a)
is_aligned x sz
\<lbrakk>is_aligned ?ptr ?sz; ?sz < LENGTH(?'a); ?off < 2 ^ ?sz\<rbrakk> \<Longrightarrow> unat ?ptr + ?off < 2 ^ LENGTH(?'a)
unat off < 2 ^ sz

goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
unat x + unat off < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
assume "\<not> sz < LENGTH('a)"
[PROOF STATE]
proof (state)
this:
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
with al
[PROOF STATE]
proof (chain)
picking this:
is_aligned x sz
\<not> sz < LENGTH('a)
[PROOF STEP]
have "x = 0"
[PROOF STATE]
proof (prove)
using this:
is_aligned x sz
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. x = 0
[PROOF STEP]
by (meson is_aligned_get_word_bits)
[PROOF STATE]
proof (state)
this:
x = 0

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x = 0

goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unat x + unat off < 2 ^ LENGTH('a)

goal:
No subgoals!
[PROOF STEP]
qed