[STATEMENT]
lemma (in finite_measure) integrable_const_bound:
  fixes f :: "'a \<Rightarrow> 'b::{banach,second_countable_topology}"
  shows "AE x in M. norm (f x) \<le> B \<Longrightarrow> f \<in> borel_measurable M \<Longrightarrow> integrable M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>AE x in M. norm (f x) \<le> B; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> integrable M f
[PROOF STEP]
apply (rule integrable_bound[OF integrable_const[of B], of f])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>AE x in M. norm (f x) \<le> B; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> f \<in> borel_measurable M
 2. \<lbrakk>AE x in M. norm (f x) \<le> B; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> AE x in M. norm (f x) \<le> norm B
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>AE x in M. norm (f x) \<le> B; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> AE x in M. norm (f x) \<le> norm B
[PROOF STEP]
apply (cases "0 \<le> B")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>AE x in M. norm (f x) \<le> B; f \<in> borel_measurable M; 0 \<le> B\<rbrakk> \<Longrightarrow> AE x in M. norm (f x) \<le> norm B
 2. \<lbrakk>AE x in M. norm (f x) \<le> B; f \<in> borel_measurable M; \<not> 0 \<le> B\<rbrakk> \<Longrightarrow> AE x in M. norm (f x) \<le> norm B
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in sigma_finite_measure)
  assumes N: "sigma_finite_measure N" and ac: "absolutely_continuous M N" "sets N = sets M"
    and f: "f \<in> borel_measurable M"
  shows RN_deriv_integrable: "integrable N f \<longleftrightarrow>
      integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)" (is ?integrable)
    and RN_deriv_integral: "integral\<^sup>L N f = (\<integral>x. enn2real (RN_deriv M N x) * f x \<partial>M)" (is ?integral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable N f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x) &&& integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable N f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)
 2. integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
note ac(2)[simp] and sets_eq_imp_space_eq[OF ac(2), simp]
[PROOF STATE]
proof (state)
this:
sets N = sets M
space N = space M

goal (2 subgoals):
 1. integrable N f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)
 2. integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
interpret N: sigma_finite_measure N
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure N
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable N f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)
 2. integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
have eq: "density M (RN_deriv M N) = density M (\<lambda>x. enn2real (RN_deriv M N x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. density M (RN_deriv M N) = density M (\<lambda>x. ennreal (enn2real (RN_deriv M N x)))
[PROOF STEP]
proof (rule density_cong)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. RN_deriv M N \<in> borel_measurable M
 2. (\<lambda>x. ennreal (enn2real (RN_deriv M N x))) \<in> borel_measurable M
 3. AE x in M. RN_deriv M N x = ennreal (enn2real (RN_deriv M N x))
[PROOF STEP]
from RN_deriv_finite[OF assms(1,2,3)]
[PROOF STATE]
proof (chain)
picking this:
AE x in M. RN_deriv M N x \<noteq> \<infinity>
[PROOF STEP]
show "AE x in M. RN_deriv M N x = ennreal (enn2real (RN_deriv M N x))"
[PROOF STATE]
proof (prove)
using this:
AE x in M. RN_deriv M N x \<noteq> \<infinity>

goal (1 subgoal):
 1. AE x in M. RN_deriv M N x = ennreal (enn2real (RN_deriv M N x))
[PROOF STEP]
by eventually_elim (auto simp: less_top)
[PROOF STATE]
proof (state)
this:
AE x in M. RN_deriv M N x = ennreal (enn2real (RN_deriv M N x))

goal (2 subgoals):
 1. RN_deriv M N \<in> borel_measurable M
 2. (\<lambda>x. ennreal (enn2real (RN_deriv M N x))) \<in> borel_measurable M
[PROOF STEP]
qed (insert ac, auto)
[PROOF STATE]
proof (state)
this:
density M (RN_deriv M N) = density M (\<lambda>x. ennreal (enn2real (RN_deriv M N x)))

goal (2 subgoals):
 1. integrable N f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)
 2. integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
show ?integrable
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable N f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)
[PROOF STEP]
apply (subst density_RN_deriv[OF ac, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (density M (RN_deriv M N)) f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (density M (\<lambda>x. ennreal (enn2real (RN_deriv M N x)))) f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)
[PROOF STEP]
apply (intro integrable_real_density f AE_I2 enn2real_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. enn2real (RN_deriv M N x)) \<in> borel_measurable M
[PROOF STEP]
apply (insert ac, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
integrable N f = integrable M (\<lambda>x. enn2real (RN_deriv M N x) * f x)

goal (1 subgoal):
 1. integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
show ?integral
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
apply (subst density_RN_deriv[OF ac, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (density M (RN_deriv M N)) f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (density M (\<lambda>x. ennreal (enn2real (RN_deriv M N x)))) f = LINT x|M. enn2real (RN_deriv M N x) * f x
[PROOF STEP]
apply (intro integral_real_density f AE_I2 enn2real_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. enn2real (RN_deriv M N x)) \<in> borel_measurable M
[PROOF STEP]
apply (insert ac, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
integral\<^sup>L N f = LINT x|M. enn2real (RN_deriv M N x) * f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Elem_zimplode: "(Elem x (zimplode z)) = (zin x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Elem x (zimplode z) = zin x z
[PROOF STEP]
apply (simp add: zimplode_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Elem x (implode (Rep_zet z)) = zin x z
[PROOF STEP]
apply (subst Elem_implode)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_zet z \<in> range explode
 2. (x \<in> Rep_zet z) = zin x z
[PROOF STEP]
apply (simp_all add: zin_def Rep_zet range_explode_eq_zet)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma shift_autonomous_solution:
  assumes sol: "(x solves_ode f) T X"
  assumes auto: "\<And>s t. s \<in> T \<Longrightarrow> f s (x s) = f t (x s)"
  shows "((\<lambda>t. x (t + t0)) solves_ode f) ((\<lambda>t. t - t0) ` T) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. x (t + t0)) solves_ode f) ((\<lambda>t. t - t0) ` T) X
[PROOF STEP]
using solves_odeD[OF sol]
[PROOF STATE]
proof (prove)
using this:
(x has_vderiv_on (\<lambda>t. f t (x t))) T
?t \<in> T \<Longrightarrow> x ?t \<in> X

goal (1 subgoal):
 1. ((\<lambda>t. x (t + t0)) solves_ode f) ((\<lambda>t. t - t0) ` T) X
[PROOF STEP]
apply (intro solves_odeI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(x has_vderiv_on (\<lambda>t. f t (x t))) T; \<And>t. t \<in> T \<Longrightarrow> x t \<in> X\<rbrakk> \<Longrightarrow> ((\<lambda>t. x (t + t0)) has_vderiv_on (\<lambda>t. f t (x (t + t0)))) ((\<lambda>t. t - t0) ` T)
 2. \<And>t. \<lbrakk>(x has_vderiv_on (\<lambda>t. f t (x t))) T; \<And>t. t \<in> T \<Longrightarrow> x t \<in> X; t \<in> (\<lambda>t. t - t0) ` T\<rbrakk> \<Longrightarrow> x (t + t0) \<in> X
[PROOF STEP]
apply (rule has_vderiv_on_compose'[of x, THEN has_vderiv_on_eq_rhs])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>(x has_vderiv_on (\<lambda>t. f t (x t))) T; \<And>t. t \<in> T \<Longrightarrow> x t \<in> X\<rbrakk> \<Longrightarrow> (x has_vderiv_on ?f'6) ((\<lambda>x. x + t0) ` (\<lambda>t. t - t0) ` T)
 2. \<lbrakk>(x has_vderiv_on (\<lambda>t. f t (x t))) T; \<And>t. t \<in> T \<Longrightarrow> x t \<in> X\<rbrakk> \<Longrightarrow> ((\<lambda>x. x + t0) has_vderiv_on ?g'6) ((\<lambda>t. t - t0) ` T)
 3. \<And>t. \<lbrakk>(x has_vderiv_on (\<lambda>t. f t (x t))) T; \<And>t. t \<in> T \<Longrightarrow> x t \<in> X; t \<in> (\<lambda>t. t - t0) ` T\<rbrakk> \<Longrightarrow> ?g'6 t *\<^sub>R ?f'6 (t + t0) = f t (x (t + t0))
 4. \<And>t. \<lbrakk>(x has_vderiv_on (\<lambda>t. f t (x t))) T; \<And>t. t \<in> T \<Longrightarrow> x t \<in> X; t \<in> (\<lambda>t. t - t0) ` T\<rbrakk> \<Longrightarrow> x (t + t0) \<in> X
[PROOF STEP]
apply (auto simp: image_image intro!: auto derivative_intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma two_in_unreach:
  "\<lbrakk>Q \<in> \<P>; b \<in> \<E>; b \<notin> Q\<rbrakk> \<Longrightarrow> \<exists>x\<in>unreach-on Q from b. \<exists>y\<in>unreach-on Q from b. x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Q \<in> \<P>; b \<in> \<E>; b \<notin> Q\<rbrakk> \<Longrightarrow> \<exists>x\<in>unreach-on Q from b. \<exists>y\<in>unreach-on Q from b. x \<noteq> y
[PROOF STEP]
using I5
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?Q \<in> \<P>; ?b \<in> \<E> - ?Q\<rbrakk> \<Longrightarrow> \<exists>x y. {x, y} \<subseteq> unreach-on ?Q from ?b \<and> x \<noteq> y

goal (1 subgoal):
 1. \<lbrakk>Q \<in> \<P>; b \<in> \<E>; b \<notin> Q\<rbrakk> \<Longrightarrow> \<exists>x\<in>unreach-on Q from b. \<exists>y\<in>unreach-on Q from b. x \<noteq> y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma cinner_mult_right': "cinner a (b * of_complex m) = (cinner a b) * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner a (b * of_complex m) = cinner a b * m
[PROOF STEP]
by (simp add: complex_inner_class.cinner_scaleC_right of_complex_def)


[STATEMENT]
lemma pmf_join: "pmf (join_pmf N) i = (\<integral>M. pmf M i \<partial>measure_pmf N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (join_pmf N) i = measure_pmf.expectation N (\<lambda>M. pmf M i)
[PROOF STEP]
unfolding join_pmf_def pmf_bind
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation N (\<lambda>x. pmf x i) = measure_pmf.expectation N (\<lambda>M. pmf M i)
[PROOF STEP]
..


[STATEMENT]
lemma rel_set_Grp: "rel_set (BNF_Def.Grp A f) = BNF_Def.Grp {X. X \<subseteq> A} (image f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_set (BNF_Def.Grp A f) = BNF_Def.Grp {X. X \<subseteq> A} ((`) f)
[PROOF STEP]
by(auto simp add: fun_eq_iff Grp_def rel_set_def)


[STATEMENT]
lemma cf_rcomp_ArrMap_app[cat_cs_simps]:
  assumes "category \<alpha> \<BB>"
    and "\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>"
    and "g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
  shows "cf_rcomp \<BB> \<SS> \<GG>\<lparr>ArrMap\<rparr>\<lparr>f, g\<rparr>\<^sub>\<bullet> = \<SS>\<lparr>ArrMap\<rparr>\<lparr>f, \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<rparr>\<rparr>\<^sub>\<bullet>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>cf_rcomp \<BB> \<SS> \<GG>\<^esub> g = f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<SS>\<^esub> \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>cf_rcomp \<BB> \<SS> \<GG>\<^esub> g = f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<SS>\<^esub> \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<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>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>cf_bcomp \<SS> (dghm_id \<BB>) \<GG>\<^esub> g = f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<SS>\<^esub> \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<rparr>
[PROOF STEP]
by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros cat_prod_cs_intros)


[STATEMENT]
lemma Brouwer_degree2_homotopy_equivalence:
  assumes f: "continuous_map (nsphere p) (nsphere p) f" and g: "continuous_map (nsphere p) (nsphere p) g"
    and hom: "homotopic_with (\<lambda>x. True) (nsphere p) (nsphere p) (f \<circ> g) id"
  obtains "\<bar>Brouwer_degree2 p f\<bar> = 1" "\<bar>Brouwer_degree2 p g\<bar> = 1" "Brouwer_degree2 p g = Brouwer_degree2 p f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>\<bar>Brouwer_degree2 p f\<bar> = 1; \<bar>Brouwer_degree2 p g\<bar> = 1; Brouwer_degree2 p g = Brouwer_degree2 p f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Brouwer_degree2_homotopic [OF hom] Brouwer_degree2_compose f g zmult_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
Brouwer_degree2 p (f \<circ> g) = Brouwer_degree2 p id
\<lbrakk>continuous_map (nsphere ?p) (nsphere ?p) ?f; continuous_map (nsphere ?p) (nsphere ?p) ?g\<rbrakk> \<Longrightarrow> Brouwer_degree2 ?p (?g \<circ> ?f) = Brouwer_degree2 ?p ?g * Brouwer_degree2 ?p ?f
continuous_map (nsphere p) (nsphere p) f
continuous_map (nsphere p) (nsphere p) g
(?m * ?n = 1) = (?m = 1 \<and> ?n = 1 \<or> ?m = - 1 \<and> ?n = - 1)

goal (1 subgoal):
 1. (\<lbrakk>\<bar>Brouwer_degree2 p f\<bar> = 1; \<bar>Brouwer_degree2 p g\<bar> = 1; Brouwer_degree2 p g = Brouwer_degree2 p f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma find_max_nat_param[param]:
  assumes "(n,n')\<in>nat_rel"
  assumes "\<And>j j'. \<lbrakk>(j,j')\<in>nat_rel; j'<n'\<rbrakk> \<Longrightarrow> (P j,P' j')\<in>bool_rel"
  shows "(find_max_nat n P,find_max_nat n' P') \<in> nat_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (find_max_nat n P, find_max_nat n' P') \<in> nat_rel
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(n, n') \<in> nat_rel
\<lbrakk>(?j, ?j') \<in> nat_rel; ?j' < n'\<rbrakk> \<Longrightarrow> (P ?j, P' ?j') \<in> bool_rel

goal (1 subgoal):
 1. (find_max_nat n P, find_max_nat n' P') \<in> nat_rel
[PROOF STEP]
by (induction n arbitrary: n') auto


[STATEMENT]
lemma homeomorphic_map_path_component_of:
  assumes f: "homeomorphic_map X Y f" and x: "x \<in> topspace X"
  shows "Collect (path_component_of Y (f x)) = f ` Collect(path_component_of X x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_of_set Y (f x) = f ` path_component_of_set X x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_component_of_set Y (f x) = f ` path_component_of_set X x
[PROOF STEP]
obtain g where g: "homeomorphic_maps X Y f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. homeomorphic_maps X Y f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using f homeomorphic_map_maps
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map X Y f
homeomorphic_map ?X ?Y ?f = (\<exists>g. homeomorphic_maps ?X ?Y ?f g)

goal (1 subgoal):
 1. (\<And>g. homeomorphic_maps X Y f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. path_component_of_set Y (f x) = f ` path_component_of_set X x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_of_set Y (f x) = f ` path_component_of_set X x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_component_of_set Y (f x) \<subseteq> f ` path_component_of_set X x
 2. f ` path_component_of_set X x \<subseteq> path_component_of_set Y (f x)
[PROOF STEP]
have "Collect (path_component_of Y (f x)) \<subseteq> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_of_set Y (f x) \<subseteq> topspace Y
[PROOF STEP]
by (simp add: path_component_of_subset_topspace)
[PROOF STATE]
proof (state)
this:
path_component_of_set Y (f x) \<subseteq> topspace Y

goal (2 subgoals):
 1. path_component_of_set Y (f x) \<subseteq> f ` path_component_of_set X x
 2. f ` path_component_of_set X x \<subseteq> path_component_of_set Y (f x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
path_component_of_set Y (f x) \<subseteq> topspace Y

goal (2 subgoals):
 1. path_component_of_set Y (f x) \<subseteq> f ` path_component_of_set X x
 2. f ` path_component_of_set X x \<subseteq> path_component_of_set Y (f x)
[PROOF STEP]
have "g ` Collect(path_component_of Y (f x)) \<subseteq> Collect (path_component_of X (g (f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` path_component_of_set Y (f x) \<subseteq> path_component_of_set X (g (f x))
[PROOF STEP]
using g x
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y f g
x \<in> topspace X

goal (1 subgoal):
 1. g ` path_component_of_set Y (f x) \<subseteq> path_component_of_set X (g (f x))
[PROOF STEP]
unfolding homeomorphic_maps_def
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f \<and> continuous_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)
x \<in> topspace X

goal (1 subgoal):
 1. g ` path_component_of_set Y (f x) \<subseteq> path_component_of_set X (g (f x))
[PROOF STEP]
by (metis f homeomorphic_imp_surjective_map imageI mem_Collect_eq path_component_of_maximal path_component_of_refl path_connectedin_continuous_map_image path_connectedin_path_component_of)
[PROOF STATE]
proof (state)
this:
g ` path_component_of_set Y (f x) \<subseteq> path_component_of_set X (g (f x))

goal (2 subgoals):
 1. path_component_of_set Y (f x) \<subseteq> f ` path_component_of_set X x
 2. f ` path_component_of_set X x \<subseteq> path_component_of_set Y (f x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
path_component_of_set Y (f x) \<subseteq> topspace Y
g ` path_component_of_set Y (f x) \<subseteq> path_component_of_set X (g (f x))
[PROOF STEP]
show "Collect (path_component_of Y (f x)) \<subseteq> f ` Collect (path_component_of X x)"
[PROOF STATE]
proof (prove)
using this:
path_component_of_set Y (f x) \<subseteq> topspace Y
g ` path_component_of_set Y (f x) \<subseteq> path_component_of_set X (g (f x))

goal (1 subgoal):
 1. path_component_of_set Y (f x) \<subseteq> f ` path_component_of_set X x
[PROOF STEP]
using g x
[PROOF STATE]
proof (prove)
using this:
path_component_of_set Y (f x) \<subseteq> topspace Y
g ` path_component_of_set Y (f x) \<subseteq> path_component_of_set X (g (f x))
homeomorphic_maps X Y f g
x \<in> topspace X

goal (1 subgoal):
 1. path_component_of_set Y (f x) \<subseteq> f ` path_component_of_set X x
[PROOF STEP]
unfolding homeomorphic_maps_def continuous_map_def image_iff subset_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>t. t \<in> path_component_of_set Y (f x) \<longrightarrow> t \<in> topspace Y
\<forall>t. (\<exists>x\<in>path_component_of_set Y (f x). t = g x) \<longrightarrow> t \<in> path_component_of_set X (g (f x))
((\<forall>x\<in>topspace X. f x \<in> topspace Y) \<and> (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U})) \<and> ((\<forall>x\<in>topspace Y. g x \<in> topspace X) \<and> (\<forall>U. openin X U \<longrightarrow> openin Y {x \<in> topspace Y. g x \<in> U})) \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y)
x \<in> topspace X

goal (1 subgoal):
 1. \<forall>t. t \<in> path_component_of_set Y (f x) \<longrightarrow> (\<exists>x\<in>path_component_of_set X x. t = f x)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
path_component_of_set Y (f x) \<subseteq> f ` path_component_of_set X x

goal (1 subgoal):
 1. f ` path_component_of_set X x \<subseteq> path_component_of_set Y (f x)
[PROOF STEP]
show "f ` Collect (path_component_of X x) \<subseteq> Collect (path_component_of Y (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` path_component_of_set X x \<subseteq> path_component_of_set Y (f x)
[PROOF STEP]
proof (rule path_component_of_maximal)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_connectedin Y (f ` path_component_of_set X x)
 2. f x \<in> f ` path_component_of_set X x
[PROOF STEP]
show "path_connectedin Y (f ` Collect (path_component_of X x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin Y (f ` path_component_of_set X x)
[PROOF STEP]
by (meson f homeomorphic_map_path_connectedness_eq path_connectedin_path_component_of)
[PROOF STATE]
proof (state)
this:
path_connectedin Y (f ` path_component_of_set X x)

goal (1 subgoal):
 1. f x \<in> f ` path_component_of_set X x
[PROOF STEP]
qed (simp add: path_component_of_refl x)
[PROOF STATE]
proof (state)
this:
f ` path_component_of_set X x \<subseteq> path_component_of_set Y (f x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
path_component_of_set Y (f x) = f ` path_component_of_set X x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigo_abs5: "f =o O(g) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) =o O(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> O(g) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) \<in> O(g)
[PROOF STEP]
by (unfold bigo_def, auto)


[STATEMENT]
lemma lower_comp: "x \<in> carrier \<X> \<Longrightarrow> \<pi>\<^sup>* (\<pi>\<^sub>* (\<pi>\<^sup>* x)) = \<pi>\<^sup>* x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier \<X> \<Longrightarrow> \<pi>\<^sup>* (\<pi>\<^sub>* (\<pi>\<^sup>* x)) = \<pi>\<^sup>* x
[PROOF STEP]
by (meson deflation funcset_mem inflation is_order_B lower_closure lower_iso partial_order.le_antisym upper_closure use_iso2)


[STATEMENT]
lemma same_i_append_eq[iff]: "(xs \<frown> f = xs \<frown> g) = (f = g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<frown> f = xs \<frown> g) = (f = g)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. xs \<frown> f = xs \<frown> g \<Longrightarrow> f = g
 2. f = g \<Longrightarrow> xs \<frown> f = xs \<frown> g
[PROOF STEP]
apply (clarsimp simp: expand_ilist_eq, rename_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<forall>x. (xs \<frown> f) x = (xs \<frown> g) x \<Longrightarrow> f i = g i
 2. f = g \<Longrightarrow> xs \<frown> f = xs \<frown> g
[PROOF STEP]
apply (erule_tac x="length xs + i" in allE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. (xs \<frown> f) (length xs + i) = (xs \<frown> g) (length xs + i) \<Longrightarrow> f i = g i
 2. f = g \<Longrightarrow> xs \<frown> f = xs \<frown> g
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g \<Longrightarrow> xs \<frown> f = xs \<frown> g
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma equivalence_and_implicates:
  assumes "equivalent S1 S2"
  shows "implicates S1 = implicates S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. implicates S1 = implicates S2
[PROOF STEP]
using assms entailment_and_implicates equivalent_def
[PROOF STATE]
proof (prove)
using this:
equivalent S1 S2
entails_formula ?S1.0 ?S2.0 \<Longrightarrow> implicates ?S2.0 \<subseteq> implicates ?S1.0
equivalent ?S1.0 ?S2.0 = (entails_formula ?S1.0 ?S2.0 \<and> entails_formula ?S2.0 ?S1.0)

goal (1 subgoal):
 1. implicates S1 = implicates S2
[PROOF STEP]
by blast


[STATEMENT]
lemma space_tree_sigma: "space (tree_sigma M) = trees (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (tree_sigma M) = trees (space M)
[PROOF STEP]
unfolding tree_sigma_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (sigma (trees (space M)) (trees_cyl ` trees (sets M))) = trees (space M)
[PROOF STEP]
by (rule space_measure_of_conv)


[STATEMENT]
lemma orthogonal_comp_anti_mono:
  assumes "A \<subseteq> B"
  shows "B\<^sup>\<bottom> \<subseteq> A\<^sup>\<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B\<^sup>\<bottom> \<subseteq> A\<^sup>\<bottom>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B\<^sup>\<bottom> \<Longrightarrow> x \<in> A\<^sup>\<bottom>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B\<^sup>\<bottom> \<Longrightarrow> x \<in> A\<^sup>\<bottom>
[PROOF STEP]
assume x: "x \<in> B\<^sup>\<bottom>"
[PROOF STATE]
proof (state)
this:
x \<in> B\<^sup>\<bottom>

goal (1 subgoal):
 1. \<And>x. x \<in> B\<^sup>\<bottom> \<Longrightarrow> x \<in> A\<^sup>\<bottom>
[PROOF STEP]
show "x \<in> orthogonal_comp A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A\<^sup>\<bottom>
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> B\<^sup>\<bottom>

goal (1 subgoal):
 1. x \<in> A\<^sup>\<bottom>
[PROOF STEP]
unfolding orthogonal_comp_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. \<forall>y\<in>B. orthogonal y x}

goal (1 subgoal):
 1. x \<in> {x. \<forall>y\<in>A. orthogonal y x}
[PROOF STEP]
by (simp add: orthogonal_def, metis assms in_mono)
[PROOF STATE]
proof (state)
this:
x \<in> A\<^sup>\<bottom>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma BisT_Sym: "c \<approx>T d \<Longrightarrow> d \<approx>T c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<approx>T d \<Longrightarrow> d \<approx>T c
[PROOF STEP]
using BisT_sym
[PROOF STATE]
proof (prove)
using this:
sym BisT

goal (1 subgoal):
 1. c \<approx>T d \<Longrightarrow> d \<approx>T c
[PROOF STEP]
unfolding sym_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x \<approx>T y \<longrightarrow> y \<approx>T x

goal (1 subgoal):
 1. c \<approx>T d \<Longrightarrow> d \<approx>T c
[PROOF STEP]
by blast


[STATEMENT]
lemma INT_in_lattice:
     "[|lattice L; !!i. i\<in>I ==> r i \<in> L|] ==> (\<Inter>i\<in>I. r i)  \<in> L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lattice L; \<And>i. i \<in> I \<Longrightarrow> r i \<in> L\<rbrakk> \<Longrightarrow> \<Inter> (r ` I) \<in> L
[PROOF STEP]
apply (blast intro: Inter_in_lattice)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma foldseq_zerotail:
  assumes
  fz: "f 0 0 = 0"
  and sz: "\<forall>i.  n <= i \<longrightarrow> s i = 0"
  and nm: "n <= m"
  shows
  "foldseq f s n = foldseq f s m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldseq f s n = foldseq f s m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. foldseq f s n = foldseq f s m
[PROOF STEP]
show "foldseq f s n = foldseq f s m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldseq f s n = foldseq f s m
[PROOF STEP]
apply (simp add: foldseq_tail[OF nm, of f s])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldseq f s n = foldseq f (\<lambda>k. if k < n then s k else foldseq f (\<lambda>k. s (k + n)) (m - n)) n
[PROOF STEP]
apply (rule foldseq_significant_positions)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<le>n. s i = (if i < n then s i else foldseq f (\<lambda>k. s (k + n)) (m - n))
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s n = foldseq f (\<lambda>k. s (k + n)) (m - n)
[PROOF STEP]
apply (subst foldseq_zero)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. f (0::'a) (0::'a) = (0::'a)
 2. \<forall>i\<le>m - n. s (i + n) = (0::'a)
 3. s n = (0::'a)
[PROOF STEP]
by (simp add: fz sz)+
[PROOF STATE]
proof (state)
this:
foldseq f s n = foldseq f s m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nest_mono[mono_set]: "x \<subseteq> y \<Longrightarrow> (a,b) \<in> nest r x \<longrightarrow> (a,b) \<in> nest r y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<subseteq> y \<Longrightarrow> (a, b) \<in> nest r x \<longrightarrow> (a, b) \<in> nest r y
[PROOF STEP]
using mono_nest[unfolded mono_def, rule_format, of x y r]
[PROOF STATE]
proof (prove)
using this:
x \<subseteq> y \<Longrightarrow> nest r x \<subseteq> nest r y

goal (1 subgoal):
 1. x \<subseteq> y \<Longrightarrow> (a, b) \<in> nest r x \<longrightarrow> (a, b) \<in> nest r y
[PROOF STEP]
by blast


[STATEMENT]
lemma dvd_gcdD1: "a dvd gcd b c \<Longrightarrow> a dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd gcd b c \<Longrightarrow> a dvd b
[PROOF STEP]
using gcd_dvd1 [of b c]
[PROOF STATE]
proof (prove)
using this:
gcd b c dvd b

goal (1 subgoal):
 1. a dvd gcd b c \<Longrightarrow> a dvd b
[PROOF STEP]
by (blast intro: dvd_trans)


[STATEMENT]
lemma convex_halfspace_abs_le: "convex {x. \<bar>inner a x\<bar> \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. \<bar>a \<bullet> x\<bar> \<le> b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex {x. \<bar>a \<bullet> x\<bar> \<le> b}
[PROOF STEP]
have *: "{x. \<bar>inner a x\<bar> \<le> b} = {x. inner a x \<le> b} \<inter> {x. -b \<le> inner a x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<bar>a \<bullet> x\<bar> \<le> b} = {x. a \<bullet> x \<le> b} \<inter> {x. - b \<le> a \<bullet> x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. \<bar>a \<bullet> x\<bar> \<le> b} = {x. a \<bullet> x \<le> b} \<inter> {x. - b \<le> a \<bullet> x}

goal (1 subgoal):
 1. convex {x. \<bar>a \<bullet> x\<bar> \<le> b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. \<bar>a \<bullet> x\<bar> \<le> b}
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex ({x. a \<bullet> x \<le> b} \<inter> {x. - b \<le> a \<bullet> x})
[PROOF STEP]
by (simp add: convex_Int convex_halfspace_ge convex_halfspace_le)
[PROOF STATE]
proof (state)
this:
convex {x. \<bar>a \<bullet> x\<bar> \<le> b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equiv_proj:
  assumes e: "equiv A R" and m: "z \<in> R"
  shows "(proj R \<circ> fst) z = (proj R \<circ> snd) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
z \<in> R
[PROOF STEP]
have z: "(fst z, snd z) \<in> R"
[PROOF STATE]
proof (prove)
using this:
z \<in> R

goal (1 subgoal):
 1. (fst z, snd z) \<in> R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(fst z, snd z) \<in> R

goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
with e
[PROOF STATE]
proof (chain)
picking this:
equiv A R
(fst z, snd z) \<in> R
[PROOF STEP]
have "\<And>x. (fst z, x) \<in> R \<Longrightarrow> (snd z, x) \<in> R" "\<And>x. (snd z, x) \<in> R \<Longrightarrow> (fst z, x) \<in> R"
[PROOF STATE]
proof (prove)
using this:
equiv A R
(fst z, snd z) \<in> R

goal (1 subgoal):
 1. (\<And>x. (fst z, x) \<in> R \<Longrightarrow> (snd z, x) \<in> R) &&& (\<And>x. (snd z, x) \<in> R \<Longrightarrow> (fst z, x) \<in> R)
[PROOF STEP]
unfolding equiv_def sym_def trans_def
[PROOF STATE]
proof (prove)
using this:
refl_on A R \<and> (\<forall>x y. (x, y) \<in> R \<longrightarrow> (y, x) \<in> R) \<and> (\<forall>x y z. (x, y) \<in> R \<longrightarrow> (y, z) \<in> R \<longrightarrow> (x, z) \<in> R)
(fst z, snd z) \<in> R

goal (1 subgoal):
 1. (\<And>x. (fst z, x) \<in> R \<Longrightarrow> (snd z, x) \<in> R) &&& (\<And>x. (snd z, x) \<in> R \<Longrightarrow> (fst z, x) \<in> R)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R

goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R

goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
unfolding proj_def[abs_def]
[PROOF STATE]
proof (prove)
using this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R

goal (1 subgoal):
 1. ((\<lambda>x. R `` {x}) \<circ> fst) z = ((\<lambda>x. R `` {x}) \<circ> snd) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(proj R \<circ> fst) z = (proj R \<circ> snd) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uminus_zero_vec_eq: assumes v: "(v :: 'a :: group_add vec) \<in> carrier_vec n"
  shows "(- v = 0\<^sub>v n) = (v = 0\<^sub>v n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- v = 0\<^sub>v n) = (v = 0\<^sub>v n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
assume z: "- v = 0\<^sub>v n"
[PROOF STATE]
proof (state)
this:
- v = 0\<^sub>v n

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
- v = 0\<^sub>v n

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
assume i: "i < n"
[PROOF STATE]
proof (state)
this:
i < n

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
have "v $ i = - (- (v $ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $ i = - (- v $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v $ i = - (- v $ i)

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v $ i = - (- v $ i)

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
have "- (v $ i) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - v $ i = (0::'a)
[PROOF STEP]
using arg_cong[OF z, of "\<lambda> v. v $ i"] i v
[PROOF STATE]
proof (prove)
using this:
(- v) $ i = 0\<^sub>v n $ i
i < n
v \<in> carrier_vec n

goal (1 subgoal):
 1. - v $ i = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- v $ i = (0::'a)

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- v $ i = (0::'a)

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
have "- 0 = (0 :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (0::'a) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (0::'a) = (0::'a)

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
v $ i = (0::'a)
[PROOF STEP]
have "v $ i = 0"
[PROOF STATE]
proof (prove)
using this:
v $ i = (0::'a)

goal (1 subgoal):
 1. v $ i = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v $ i = (0::'a)

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < n \<Longrightarrow> v $ ?i2 = (0::'a)

goal (2 subgoals):
 1. - v = 0\<^sub>v n \<Longrightarrow> v = 0\<^sub>v n
 2. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
thus "v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
?i2 < n \<Longrightarrow> v $ ?i2 = (0::'a)

goal (1 subgoal):
 1. v = 0\<^sub>v n
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
?i2 < n \<Longrightarrow> v $ ?i2 = (0::'a)
v \<in> carrier_vec n

goal (1 subgoal):
 1. v = 0\<^sub>v n
[PROOF STEP]
by (intro eq_vecI, auto)
[PROOF STATE]
proof (state)
this:
v = 0\<^sub>v n

goal (1 subgoal):
 1. v = 0\<^sub>v n \<Longrightarrow> - v = 0\<^sub>v n
[PROOF STEP]
qed auto


[STATEMENT]
lemma transpose_comp_eq:
  \<open>transpose a b \<circ> f = f \<circ> transpose (inv f a) (inv f b)\<close>
  if \<open>bij f\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Transposition.transpose a b \<circ> f = f \<circ> Transposition.transpose (inv f a) (inv f b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
bij f

goal (1 subgoal):
 1. Transposition.transpose a b \<circ> f = f \<circ> Transposition.transpose (inv f a) (inv f b)
[PROOF STEP]
by (simp add: fun_eq_iff transpose_apply_commute)


[STATEMENT]
lemma random_dictatorship_unique_favorites:
  assumes "is_pref_profile R" "has_unique_favorites R"
  shows   "RD R = map_pmf (favorite R) (pmf_of_set agents)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RD R = map_pmf (favorite R) (pmf_of_set agents)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. RD R = map_pmf (favorite R) (pmf_of_set agents)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
is_pref_profile R
[PROOF STEP]
interpret pref_profile_wf agents alts R
[PROOF STATE]
proof (prove)
using this:
is_pref_profile R

goal (1 subgoal):
 1. is_pref_profile R
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. RD R = map_pmf (favorite R) (pmf_of_set agents)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
has_unique_favorites R
[PROOF STEP]
interpret pref_profile_unique_favorites agents alts R
[PROOF STATE]
proof (prove)
using this:
has_unique_favorites R

goal (1 subgoal):
 1. pref_profile_unique_favorites agents alts R
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. RD R = map_pmf (favorite R) (pmf_of_set agents)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RD R = map_pmf (favorite R) (pmf_of_set agents)
[PROOF STEP]
unfolding random_dictatorship_def[OF assms(1)] map_pmf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_of_set agents \<bind> (\<lambda>i. pmf_of_set (favorites R i)) = pmf_of_set agents \<bind> (\<lambda>x. return_pmf (favorite R x))
[PROOF STEP]
by (intro bind_pmf_cong) (auto simp: unique_favorites pmf_of_set_singleton)
[PROOF STATE]
proof (state)
this:
RD R = map_pmf (favorite R) (pmf_of_set agents)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_compose_prod_distrib:
  assumes c0: "c$0 = (0::'a::idom)"
  shows "prod a S oo c = prod (\<lambda>k. a k oo c) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod a S oo c = (\<Prod>k\<in>S. a k oo c)
[PROOF STEP]
proof (induct S rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> prod a A oo c = (\<Prod>k\<in>A. a k oo c)
 2. prod a {} oo c = (\<Prod>k\<in>{}. a k oo c)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; prod a F oo c = (\<Prod>k\<in>F. a k oo c)\<rbrakk> \<Longrightarrow> prod a (insert x F) oo c = (\<Prod>k\<in>insert x F. a k oo c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> prod a A oo c = (\<Prod>k\<in>A. a k oo c)
 2. prod a {} oo c = (\<Prod>k\<in>{}. a k oo c)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; prod a F oo c = (\<Prod>k\<in>F. a k oo c)\<rbrakk> \<Longrightarrow> prod a (insert x F) oo c = (\<Prod>k\<in>insert x F. a k oo c)
[PROOF STEP]
case (insert)
[PROOF STATE]
proof (state)
this:
finite F_
x_ \<notin> F_
prod a F_ oo c = (\<Prod>k\<in>F_. a k oo c)

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> prod a A oo c = (\<Prod>k\<in>A. a k oo c)
 2. prod a {} oo c = (\<Prod>k\<in>{}. a k oo c)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; prod a F oo c = (\<Prod>k\<in>F. a k oo c)\<rbrakk> \<Longrightarrow> prod a (insert x F) oo c = (\<Prod>k\<in>insert x F. a k oo c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F_
x_ \<notin> F_
prod a F_ oo c = (\<Prod>k\<in>F_. a k oo c)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F_
x_ \<notin> F_
prod a F_ oo c = (\<Prod>k\<in>F_. a k oo c)

goal (1 subgoal):
 1. prod a (insert x_ F_) oo c = (\<Prod>k\<in>insert x_ F_. a k oo c)
[PROOF STEP]
by (simp add: fps_compose_mult_distrib[OF c0])
[PROOF STATE]
proof (state)
this:
prod a (insert x_ F_) oo c = (\<Prod>k\<in>insert x_ F_. a k oo c)

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> prod a A oo c = (\<Prod>k\<in>A. a k oo c)
 2. prod a {} oo c = (\<Prod>k\<in>{}. a k oo c)
[PROOF STEP]
qed auto


[STATEMENT]
lemma continuous_at_Inf_antimono:
  fixes f :: "'a::{linorder_topology,conditionally_complete_linorder} \<Rightarrow>
    'b::{linorder_topology,conditionally_complete_linorder}"
  assumes "antimono f"
    and cont: "continuous (at_right (Inf S)) f"
    and S: "S \<noteq> {}" "bdd_below S"
  shows "f (Inf S) = (SUP s\<in>S. f s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (Inf S) = Sup (f ` S)
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f (Inf S) \<le> Sup (f ` S)
 2. Sup (f ` S) \<le> f (Inf S)
[PROOF STEP]
have f: "(f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))
[PROOF STEP]
using cont
[PROOF STATE]
proof (prove)
using this:
continuous (at_right (Inf S)) f

goal (1 subgoal):
 1. (f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))
[PROOF STEP]
unfolding continuous_within
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))

goal (1 subgoal):
 1. (f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))

goal (2 subgoals):
 1. f (Inf S) \<le> Sup (f ` S)
 2. Sup (f ` S) \<le> f (Inf S)
[PROOF STEP]
show "f (Inf S) \<le> (SUP s\<in>S. f s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
 2. \<not> ?P \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
assume "Inf S \<in> S"
[PROOF STATE]
proof (state)
this:
Inf S \<in> S

goal (2 subgoals):
 1. ?P \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
 2. \<not> ?P \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf S \<in> S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Inf S \<in> S

goal (1 subgoal):
 1. f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
by (rule cSUP_upper) (auto intro: bdd_above_image_antimono S \<open>antimono f\<close>)
[PROOF STATE]
proof (state)
this:
f (Inf S) \<le> Sup (f ` S)

goal (1 subgoal):
 1. Inf S \<notin> S \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf S \<notin> S \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
assume "Inf S \<notin> S"
[PROOF STATE]
proof (state)
this:
Inf S \<notin> S

goal (1 subgoal):
 1. Inf S \<notin> S \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
from \<open>S \<noteq> {}\<close>
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain s where "s \<in> S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

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

goal (1 subgoal):
 1. Inf S \<notin> S \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
with \<open>Inf S \<notin> S\<close> S
[PROOF STATE]
proof (chain)
picking this:
Inf S \<notin> S
S \<noteq> {}
bdd_below S
s \<in> S
[PROOF STEP]
have "Inf S < s"
[PROOF STATE]
proof (prove)
using this:
Inf S \<notin> S
S \<noteq> {}
bdd_below S
s \<in> S

goal (1 subgoal):
 1. Inf S < s
[PROOF STEP]
unfolding less_le
[PROOF STATE]
proof (prove)
using this:
Inf S \<notin> S
S \<noteq> {}
bdd_below S
s \<in> S

goal (1 subgoal):
 1. Inf S \<le> s \<and> Inf S \<noteq> s
[PROOF STEP]
by (blast intro: cInf_lower)
[PROOF STATE]
proof (state)
this:
Inf S < s

goal (1 subgoal):
 1. Inf S \<notin> S \<Longrightarrow> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f (Inf S) \<le> Sup (f ` S) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> f (Inf S) \<le> Sup (f ` S)

goal (1 subgoal):
 1. \<not> f (Inf S) \<le> Sup (f ` S) \<Longrightarrow> False
[PROOF STEP]
with order_tendstoD(1)[OF f, of "SUP s\<in>S. f s"]
[PROOF STATE]
proof (chain)
picking this:
Sup (f ` S) < f (Inf S) \<Longrightarrow> \<forall>\<^sub>F x in at_right (Inf S). Sup (f ` S) < f x
\<not> f (Inf S) \<le> Sup (f ` S)
[PROOF STEP]
obtain b where "Inf S < b"
        and *: "\<And>y. Inf S < y \<Longrightarrow> y < b \<Longrightarrow> (SUP s\<in>S. f s) < f y"
[PROOF STATE]
proof (prove)
using this:
Sup (f ` S) < f (Inf S) \<Longrightarrow> \<forall>\<^sub>F x in at_right (Inf S). Sup (f ` S) < f x
\<not> f (Inf S) \<le> Sup (f ` S)

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>Inf S < b; \<And>y. \<lbrakk>Inf S < y; y < b\<rbrakk> \<Longrightarrow> Sup (f ` S) < f y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: not_le eventually_at_right[OF \<open>Inf S < s\<close>])
[PROOF STATE]
proof (state)
this:
Inf S < b
\<lbrakk>Inf S < ?y; ?y < b\<rbrakk> \<Longrightarrow> Sup (f ` S) < f ?y

goal (1 subgoal):
 1. \<not> f (Inf S) \<le> Sup (f ` S) \<Longrightarrow> False
[PROOF STEP]
with \<open>S \<noteq> {}\<close>
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
Inf S < b
\<lbrakk>Inf S < ?y; ?y < b\<rbrakk> \<Longrightarrow> Sup (f ` S) < f ?y
[PROOF STEP]
obtain c where "c \<in> S" "c < b"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
Inf S < b
\<lbrakk>Inf S < ?y; ?y < b\<rbrakk> \<Longrightarrow> Sup (f ` S) < f ?y

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<in> S; c < b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using cInf_lessD[of S b]
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
Inf S < b
\<lbrakk>Inf S < ?y; ?y < b\<rbrakk> \<Longrightarrow> Sup (f ` S) < f ?y
\<lbrakk>S \<noteq> {}; Inf S < b\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. x < b

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

goal (1 subgoal):
 1. \<not> f (Inf S) \<le> Sup (f ` S) \<Longrightarrow> False
[PROOF STEP]
with \<open>Inf S \<notin> S\<close> S
[PROOF STATE]
proof (chain)
picking this:
Inf S \<notin> S
S \<noteq> {}
bdd_below S
c \<in> S
c < b
[PROOF STEP]
have "Inf S < c"
[PROOF STATE]
proof (prove)
using this:
Inf S \<notin> S
S \<noteq> {}
bdd_below S
c \<in> S
c < b

goal (1 subgoal):
 1. Inf S < c
[PROOF STEP]
unfolding less_le
[PROOF STATE]
proof (prove)
using this:
Inf S \<notin> S
S \<noteq> {}
bdd_below S
c \<in> S
c \<le> b \<and> c \<noteq> b

goal (1 subgoal):
 1. Inf S \<le> c \<and> Inf S \<noteq> c
[PROOF STEP]
by (blast intro: cInf_lower)
[PROOF STATE]
proof (state)
this:
Inf S < c

goal (1 subgoal):
 1. \<not> f (Inf S) \<le> Sup (f ` S) \<Longrightarrow> False
[PROOF STEP]
from *[OF \<open>Inf S < c\<close> \<open>c < b\<close>] cSUP_upper[OF \<open>c \<in> S\<close> bdd_above_image_antimono[of f]]
[PROOF STATE]
proof (chain)
picking this:
Sup (f ` S) < f c
\<lbrakk>antimono f; bdd_below S\<rbrakk> \<Longrightarrow> f c \<le> Sup (f ` S)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Sup (f ` S) < f c
\<lbrakk>antimono f; bdd_below S\<rbrakk> \<Longrightarrow> f c \<le> Sup (f ` S)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (Inf S) \<le> Sup (f ` S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (Inf S) \<le> Sup (f ` S)

goal (1 subgoal):
 1. Sup (f ` S) \<le> f (Inf S)
[PROOF STEP]
qed (intro cSUP_least \<open>antimono f\<close>[THEN antimonoD] cInf_lower S)


[STATEMENT]
lemma gen_lower_bound_increasing:
  fixes a :: real
  assumes "a \<le> x"
      and "\<And>y. a \<le> y \<Longrightarrow> y \<le> x \<Longrightarrow> ((\<lambda>x. fl x - f x) has_real_derivative g y) (at y)"
      and "\<And>y. a \<le> y \<Longrightarrow> y \<le> x \<Longrightarrow> g y \<le> 0"
      and "fl a = f a"
    shows "fl x \<le> f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fl x \<le> f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fl x \<le> f x
[PROOF STEP]
have "fl x - f x \<le> fl a - f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fl x - f x \<le> fl a - f a
[PROOF STEP]
apply (rule DERIV_nonpos_imp_nonincreasing [where f = "\<lambda>x. fl x - f x"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<le> x
 2. \<And>xa. \<lbrakk>a \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. fl x - f x) has_real_derivative y) (at xa) \<and> y \<le> 0
[PROOF STEP]
apply (rule assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>a \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. fl x - f x) has_real_derivative y) (at xa) \<and> y \<le> 0
[PROOF STEP]
apply (intro allI impI exI conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>a \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> ((\<lambda>x. fl x - f x) has_real_derivative ?y3 xa) (at xa)
 2. \<And>xa. \<lbrakk>a \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> ?y3 xa \<le> 0
[PROOF STEP]
apply (rule assms | simp)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fl x - f x \<le> fl a - f a

goal (1 subgoal):
 1. fl x \<le> f x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fl x - f x \<le> fl a - f a

goal (1 subgoal):
 1. fl x \<le> f x
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fl a - f a = 0
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
fl a - f a = 0

goal (1 subgoal):
 1. fl x \<le> f x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fl x - f x \<le> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fl x - f x \<le> 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma extend_lin_independent_to_basis :
  assumes "set us \<subseteq> V" "lin_independent us"
  shows   "\<exists>vs. basis_for V (vs @ us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
define n where "n = Suc (dim V - length us)"
[PROOF STATE]
proof (state)
this:
n = Suc (dim_R V - length us)

goal (1 subgoal):
 1. \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
set us \<subseteq> V
R_lin_independent us
[PROOF STEP]
obtain vs
    where vs: "set vs \<subseteq> V" "lin_independent (vs @ us)"
              "Span (vs @ us) = V \<or> length vs = n"
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> V
R_lin_independent us

goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>set vs \<subseteq> V; R_lin_independent (vs @ us); RSpan (vs @ us) = V \<or> length vs = n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using build_lin_independent_seq[of us n]
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> V
R_lin_independent us
\<lbrakk>set us \<subseteq> V; R_lin_independent us\<rbrakk> \<Longrightarrow> \<exists>ws. set ws \<subseteq> V \<and> R_lin_independent (ws @ us) \<and> (RSpan (ws @ us) = V \<or> length ws = n)

goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>set vs \<subseteq> V; R_lin_independent (vs @ us); RSpan (vs @ us) = V \<or> length vs = n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
set vs \<subseteq> V
R_lin_independent (vs @ us)
RSpan (vs @ us) = V \<or> length vs = n

goal (1 subgoal):
 1. \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
with assms n_def
[PROOF STATE]
proof (chain)
picking this:
set us \<subseteq> V
R_lin_independent us
n = Suc (dim_R V - length us)
set vs \<subseteq> V
R_lin_independent (vs @ us)
RSpan (vs @ us) = V \<or> length vs = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> V
R_lin_independent us
n = Suc (dim_R V - length us)
set vs \<subseteq> V
R_lin_independent (vs @ us)
RSpan (vs @ us) = V \<or> length vs = n

goal (1 subgoal):
 1. \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
using set_append lin_independent_length_le_dim[of "vs @ us"]
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> V
R_lin_independent us
n = Suc (dim_R V - length us)
set vs \<subseteq> V
R_lin_independent (vs @ us)
RSpan (vs @ us) = V \<or> length vs = n
set (?xs @ ?ys) = set ?xs \<union> set ?ys
\<lbrakk>set (vs @ us) \<subseteq> V; R_lin_independent (vs @ us)\<rbrakk> \<Longrightarrow> length (vs @ us) \<le> dim_R V

goal (1 subgoal):
 1. \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dag_setof_subsetD: "\<lbrakk>Dag p low high t; n \<in> set_of t; Dag n low high nt\<rbrakk> \<Longrightarrow> set_of nt \<subseteq> set_of t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Dag p low high t; n \<in> set_of t; Dag n low high nt\<rbrakk> \<Longrightarrow> set_of nt \<subseteq> set_of t
[PROOF STEP]
apply (simp add: dag_setofD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma row_mat_of_rows_list:
assumes b: "b < length A"
and nc: "\<forall>i. i < length A \<longrightarrow> length (A ! i) = nc"
shows "(row (mat_of_rows_list nc A) b) = vec_of_list (A ! b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_of_rows_list nc A) b = vec_of_list (A ! b)
[PROOF STEP]
proof (auto simp add: vec_eq_iff)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_col (mat_of_rows_list nc A) = length (A ! b)
 2. \<And>i. i < length (A ! b) \<Longrightarrow> row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i
[PROOF STEP]
show "dim_col (mat_of_rows_list nc A) = length (A ! b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (mat_of_rows_list nc A) = length (A ! b)
[PROOF STEP]
unfolding mat_of_rows_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (mat (length A) nc (\<lambda>(i, y). A ! i ! y)) = length (A ! b)
[PROOF STEP]
using b nc
[PROOF STATE]
proof (prove)
using this:
b < length A
\<forall>i<length A. length (A ! i) = nc

goal (1 subgoal):
 1. dim_col (mat (length A) nc (\<lambda>(i, y). A ! i ! y)) = length (A ! b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_col (mat_of_rows_list nc A) = length (A ! b)

goal (1 subgoal):
 1. \<And>i. i < length (A ! b) \<Longrightarrow> row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (A ! b) \<Longrightarrow> row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i
[PROOF STEP]
assume i: "i < length (A ! b)"
[PROOF STATE]
proof (state)
this:
i < length (A ! b)

goal (1 subgoal):
 1. \<And>i. i < length (A ! b) \<Longrightarrow> row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i
[PROOF STEP]
show "row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i
[PROOF STEP]
using i b nc
[PROOF STATE]
proof (prove)
using this:
i < length (A ! b)
b < length A
\<forall>i<length A. length (A ! i) = nc

goal (1 subgoal):
 1. row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i
[PROOF STEP]
unfolding mat_of_rows_list_def row_def
[PROOF STATE]
proof (prove)
using this:
i < length (A ! b)
b < length A
\<forall>i<length A. length (A ! i) = nc

goal (1 subgoal):
 1. vec (dim_col (mat (length A) nc (\<lambda>(i, y). A ! i ! y))) (\<lambda>j. mat (length A) nc (\<lambda>(i, y). A ! i ! y) $$ (b, j)) $ i = vec_of_list (A ! b) $ i
[PROOF STEP]
by (transfer, auto simp add: mk_vec_def mk_mat_def)
[PROOF STATE]
proof (state)
this:
row (mat_of_rows_list nc A) b $ i = vec_of_list (A ! b) $ i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma del_list_sorted: "sorted1 (ps @ (a,b) # qs) \<Longrightarrow>
  del_list x (ps @ (a,b) # qs) =
    (if x < a then del_list x ps @ (a,b) # qs
     else ps @ del_list x ((a,b) # qs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted1 (ps @ (a, b) # qs) \<Longrightarrow> del_list x (ps @ (a, b) # qs) = (if x < a then del_list x ps @ (a, b) # qs else ps @ del_list x ((a, b) # qs))
[PROOF STEP]
by(induction ps)
  (fastforce simp: sorted_lems sorted_wrt_Cons intro!: del_list_idem)+


[STATEMENT]
lemma vbl_cases: "x = zeroX | (? y . x = nextX y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = zeroX \<or> (\<exists>y. x = nextX y)
[PROOF STEP]
apply(case_tac x, rename_tac m)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. x = X m \<Longrightarrow> x = zeroX \<or> (\<exists>y. x = nextX y)
[PROOF STEP]
apply(case_tac m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. \<lbrakk>x = X m; m = 0\<rbrakk> \<Longrightarrow> x = zeroX \<or> (\<exists>y. x = nextX y)
 2. \<And>m nat. \<lbrakk>x = X m; m = Suc nat\<rbrakk> \<Longrightarrow> x = zeroX \<or> (\<exists>y. x = nextX y)
[PROOF STEP]
apply(simp add: zeroX_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m nat. \<lbrakk>x = X m; m = Suc nat\<rbrakk> \<Longrightarrow> x = zeroX \<or> (\<exists>y. x = nextX y)
[PROOF STEP]
apply(rule disjI2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m nat. \<lbrakk>x = X m; m = Suc nat\<rbrakk> \<Longrightarrow> \<exists>y. x = nextX y
[PROOF STEP]
apply (rule_tac x="X nat" in exI, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vcinjection_vrange:
  assumes "i \<in>\<^sub>\<circ> I" and "\<And>j. j \<in>\<^sub>\<circ> I \<Longrightarrow> A j \<noteq> 0"
  shows "\<R>\<^sub>\<circ> (vcinjection A i) = (\<Union>\<^sub>\<circ>x\<in>\<^sub>\<circ>A i. set {\<langle>i, x\<rangle>})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (vcinjection A i) = \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
proof(intro vsubset_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<R>\<^sub>\<circ> (vcinjection A i) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
 2. \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<subseteq>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
interpret vsv \<open>vcinjection A i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv (vcinjection A i)
[PROOF STEP]
by (rule vcinjection_vsv)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<R>\<^sub>\<circ> (vcinjection A i) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
 2. \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<subseteq>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
show "\<R>\<^sub>\<circ> (vcinjection A i) \<subseteq>\<^sub>\<circ> (\<Union>\<^sub>\<circ>x\<in>\<^sub>\<circ>A i. set {\<langle>i, x\<rangle>})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (vcinjection A i) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
unfolding vcinjection_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (VLambda (A i) (vpair i)) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
proof(intro vrange_VLambda_vsubset)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A i \<Longrightarrow> \<langle>i, x\<rangle> \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A i \<Longrightarrow> \<langle>i, x\<rangle> \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
assume prems: "x \<in>\<^sub>\<circ> A i"
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> A i

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A i \<Longrightarrow> \<langle>i, x\<rangle> \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
show "\<langle>i, x\<rangle> \<in>\<^sub>\<circ> (\<Union>\<^sub>\<circ>x\<in>\<^sub>\<circ>A i. set {\<langle>i, x\<rangle>})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>i, x\<rangle> \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
by (intro vifunionI, rule prems) simp
[PROOF STATE]
proof (state)
this:
\<langle>i, x\<rangle> \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<R>\<^sub>\<circ> (vcinjection A i) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)

goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<subseteq>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
show "(\<Union>\<^sub>\<circ>x\<in>\<^sub>\<circ>A i. set {\<langle>i, x\<rangle>}) \<subseteq>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<subseteq>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
proof(rule vsubsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<Longrightarrow> x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
fix ix
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<Longrightarrow> x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
assume "ix \<in>\<^sub>\<circ> (\<Union>\<^sub>\<circ>x\<in>\<^sub>\<circ>A i. set {\<langle>i, x\<rangle>})"
[PROOF STATE]
proof (state)
this:
ix \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<Longrightarrow> x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ix \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)
[PROOF STEP]
obtain x where x: "x \<in>\<^sub>\<circ> A i" and ix_def: "ix = \<langle>i, x\<rangle>"
[PROOF STATE]
proof (prove)
using this:
ix \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in>\<^sub>\<circ> A i; ix = \<langle>i, x\<rangle>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim vifunionE) auto
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> A i
ix = \<langle>i, x\<rangle>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<Longrightarrow> x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in>\<^sub>\<circ> A i
x \<in>\<^sub>\<circ> A i
ix = \<langle>i, x\<rangle>
[PROOF STEP]
show "ix \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)"
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> A i
x \<in>\<^sub>\<circ> A i
ix = \<langle>i, x\<rangle>

goal (1 subgoal):
 1. ix \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
unfolding ix_def
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> A i
x \<in>\<^sub>\<circ> A i
\<langle>i, x\<rangle> = \<langle>i, x\<rangle>

goal (1 subgoal):
 1. \<langle>i, x\<rangle> \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)
[PROOF STEP]
by (intro vsv_vimageI2') auto
[PROOF STATE]
proof (state)
this:
ix \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>A i. set {\<langle>i, a\<rangle>}) `\<^sub>\<circ> A i) \<subseteq>\<^sub>\<circ> \<R>\<^sub>\<circ> (vcinjection A i)

goal:
No subgoals!
[PROOF STEP]
qed


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

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
by
    (
      cs_concl cs_shallow
        cs_simp: dghm_comp_components
        cs_intro: is_dghm.dghm_ObjMap_vrange V_cs_intros
    )


[STATEMENT]
lemma sum_mult_product:
  "sum h {..<A * B :: nat} = (\<Sum>i\<in>{..<A}. \<Sum>j\<in>{..<B}. h (j + i * B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum h {..<A * B} = (\<Sum>i<A. \<Sum>j<B. h (j + i * B))
[PROOF STEP]
unfolding sum.nat_group[of h B A, unfolded atLeast0LessThan, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m<A. sum h {m * B..<m * B + B}) = (\<Sum>i<A. \<Sum>j<B. h (j + i * B))
[PROOF STEP]
proof (rule sum.cong, simp, rule sum.reindex_cong)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {..<A} \<Longrightarrow> inj_on (?l3 x) {..<B}
 2. \<And>x. x \<in> {..<A} \<Longrightarrow> {x * B..<x * B + B} = ?l3 x ` {..<B}
 3. \<And>x xa. \<lbrakk>x \<in> {..<A}; xa \<in> {..<B}\<rbrakk> \<Longrightarrow> h (?l3 x xa) = h (xa + x * B)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {..<A} \<Longrightarrow> inj_on (?l3 x) {..<B}
 2. \<And>x. x \<in> {..<A} \<Longrightarrow> {x * B..<x * B + B} = ?l3 x ` {..<B}
 3. \<And>x xa. \<lbrakk>x \<in> {..<A}; xa \<in> {..<B}\<rbrakk> \<Longrightarrow> h (?l3 x xa) = h (xa + x * B)
[PROOF STEP]
show "inj_on (\<lambda>j. j + i * B) {..<B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>j. j + i * B) {..<B}
[PROOF STEP]
by (auto intro!: inj_onI)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>j. j + i * B) {..<B}

goal (2 subgoals):
 1. \<And>x. x \<in> {..<A} \<Longrightarrow> {x * B..<x * B + B} = (\<lambda>j. j + ?i10 x * B) ` {..<B}
 2. \<And>x xa. \<lbrakk>x \<in> {..<A}; xa \<in> {..<B}\<rbrakk> \<Longrightarrow> h (xa + ?i10 x * B) = h (xa + x * B)
[PROOF STEP]
show "{i * B..<i * B + B} = (\<lambda>j. j + i * B) ` {..<B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i * B..<i * B + B} = (\<lambda>j. j + i * B) ` {..<B}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {i * B..<i * B + B} \<Longrightarrow> x \<in> (\<lambda>j. j + i * B) ` {..<B}
 2. \<And>x j. j < B \<Longrightarrow> j + i * B \<in> {i * B..<i * B + B}
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {i * B..<i * B + B} \<Longrightarrow> x \<in> (\<lambda>j. j + i * B) ` {..<B}
 2. \<And>x j. j < B \<Longrightarrow> j + i * B \<in> {i * B..<i * B + B}
[PROOF STEP]
assume "j \<in> {i * B..<i * B + B}"
[PROOF STATE]
proof (state)
this:
j \<in> {i * B..<i * B + B}

goal (2 subgoals):
 1. \<And>x. x \<in> {i * B..<i * B + B} \<Longrightarrow> x \<in> (\<lambda>j. j + i * B) ` {..<B}
 2. \<And>x j. j < B \<Longrightarrow> j + i * B \<in> {i * B..<i * B + B}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j \<in> {i * B..<i * B + B}
[PROOF STEP]
show "j \<in> (\<lambda>j. j + i * B) ` {..<B}"
[PROOF STATE]
proof (prove)
using this:
j \<in> {i * B..<i * B + B}

goal (1 subgoal):
 1. j \<in> (\<lambda>j. j + i * B) ` {..<B}
[PROOF STEP]
by (auto intro!: image_eqI[of _ _ "j - i * B"])
[PROOF STATE]
proof (state)
this:
j \<in> (\<lambda>j. j + i * B) ` {..<B}

goal (1 subgoal):
 1. \<And>x j. j < B \<Longrightarrow> j + i * B \<in> {i * B..<i * B + B}
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
{i * B..<i * B + B} = (\<lambda>j. j + i * B) ` {..<B}

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> {..<A}; xa \<in> {..<B}\<rbrakk> \<Longrightarrow> h (xa + x * B) = h (xa + x * B)
[PROOF STEP]
qed simp


[STATEMENT]
lemma list_all3_Cons:
  "list_all3 P xs ys (z # zs) \<longleftrightarrow> (\<exists>x xs' y ys'. xs = x # xs' \<and> ys = y # ys' \<and> P x y z \<and> list_all3 P xs' ys' zs)"
  "list_all3 P xs (y # ys) zs \<longleftrightarrow> (\<exists>x xs' z zs'. xs = x # xs' \<and> zs = z # zs' \<and> P x y z \<and> list_all3 P xs' ys zs')"
  "list_all3 P (x # xs) ys zs \<longleftrightarrow> (\<exists>y ys' z zs'. ys = y # ys' \<and> zs = z # zs' \<and> P x y z \<and> list_all3 P xs ys' zs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all3 P xs ys (z # zs) = (\<exists>x xs' y ys'. xs = x # xs' \<and> ys = y # ys' \<and> P x y z \<and> list_all3 P xs' ys' zs) &&& list_all3 P xs (y # ys) zs = (\<exists>x xs' z zs'. xs = x # xs' \<and> zs = z # zs' \<and> P x y z \<and> list_all3 P xs' ys zs') &&& list_all3 P (x # xs) ys zs = (\<exists>y ys' z zs'. ys = y # ys' \<and> zs = z # zs' \<and> P x y z \<and> list_all3 P xs ys' zs')
[PROOF STEP]
unfolding list_all3_conv_all_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = length ys \<and> length ys = length (z # zs) \<and> (\<forall>i<length xs. P (xs ! i) (ys ! i) ((z # zs) ! i))) = (\<exists>x xs' y ys'. xs = x # xs' \<and> ys = y # ys' \<and> P x y z \<and> length xs' = length ys' \<and> length ys' = length zs \<and> (\<forall>i<length xs'. P (xs' ! i) (ys' ! i) (zs ! i))) &&& (length xs = length (y # ys) \<and> length (y # ys) = length zs \<and> (\<forall>i<length xs. P (xs ! i) ((y # ys) ! i) (zs ! i))) = (\<exists>x xs' z zs'. xs = x # xs' \<and> zs = z # zs' \<and> P x y z \<and> length xs' = length ys \<and> length ys = length zs' \<and> (\<forall>i<length xs'. P (xs' ! i) (ys ! i) (zs' ! i))) &&& (length (x # xs) = length ys \<and> length ys = length zs \<and> (\<forall>i<length (x # xs). P ((x # xs) ! i) (ys ! i) (zs ! i))) = (\<exists>y ys' z zs'. ys = y # ys' \<and> zs = z # zs' \<and> P x y z \<and> length xs = length ys' \<and> length ys' = length zs' \<and> (\<forall>i<length xs. P (xs ! i) (ys' ! i) (zs' ! i)))
[PROOF STEP]
by (auto simp: length_Suc_conv Suc_length_conv nth_Cons split: nat.splits)


[STATEMENT]
lemma squarefree_part_nonzero [simp]: "squarefree_part n \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squarefree_part n \<noteq> (0::'a)
[PROOF STEP]
using squarefree_decompose[of n]
[PROOF STATE]
proof (prove)
using this:
n = squarefree_part n * (square_part n)\<^sup>2

goal (1 subgoal):
 1. squarefree_part n \<noteq> (0::'a)
[PROOF STEP]
by (cases "n \<noteq> 0") auto


[STATEMENT]
lemma upd_bruijn_pres_distinct:
  assumes "sorted xs" "distinct xs"
  shows "distinct (upd_bruijn xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (upd_bruijn xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct (upd_bruijn xs)
[PROOF STEP]
have "sorted (ys :: nat list) \<Longrightarrow> distinct ys \<Longrightarrow> 0 \<notin> set (tl ys)" for ys
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted ys; distinct ys\<rbrakk> \<Longrightarrow> 0 \<notin> set (tl ys)
[PROOF STEP]
by (induct ys) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>sorted ?ys; distinct ?ys\<rbrakk> \<Longrightarrow> 0 \<notin> set (tl ?ys)

goal (1 subgoal):
 1. distinct (upd_bruijn xs)
[PROOF STEP]
from this[OF assms]
[PROOF STATE]
proof (chain)
picking this:
0 \<notin> set (tl xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<notin> set (tl xs)

goal (1 subgoal):
 1. distinct (upd_bruijn xs)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
0 \<notin> set (tl xs)
distinct xs

goal (1 subgoal):
 1. distinct (upd_bruijn xs)
[PROOF STEP]
using pres_distinct_not_0_list_dec[OF distinct_tl, OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
0 \<notin> set (tl xs)
distinct xs
0 \<notin> set (tl xs) \<Longrightarrow> distinct (map (\<lambda>x. x - Suc 0) (tl xs))

goal (1 subgoal):
 1. distinct (upd_bruijn xs)
[PROOF STEP]
unfolding upd_bruijn_def
[PROOF STATE]
proof (prove)
using this:
0 \<notin> set (tl xs)
distinct xs
0 \<notin> set (tl xs) \<Longrightarrow> distinct (map (\<lambda>x. x - Suc 0) (tl xs))

goal (1 subgoal):
 1. distinct (tl (map (\<lambda>x. x - 1) xs))
[PROOF STEP]
by (simp add: map_tl)
[PROOF STATE]
proof (state)
this:
distinct (upd_bruijn xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equiv_proj:
  assumes e: "equiv A R" and m: "z \<in> R"
  shows "(proj R \<circ> fst) z = (proj R \<circ> snd) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
z \<in> R
[PROOF STEP]
have z: "(fst z, snd z) \<in> R"
[PROOF STATE]
proof (prove)
using this:
z \<in> R

goal (1 subgoal):
 1. (fst z, snd z) \<in> R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(fst z, snd z) \<in> R

goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
with e
[PROOF STATE]
proof (chain)
picking this:
equiv A R
(fst z, snd z) \<in> R
[PROOF STEP]
have "\<And>x. (fst z, x) \<in> R \<Longrightarrow> (snd z, x) \<in> R" "\<And>x. (snd z, x) \<in> R \<Longrightarrow> (fst z, x) \<in> R"
[PROOF STATE]
proof (prove)
using this:
equiv A R
(fst z, snd z) \<in> R

goal (1 subgoal):
 1. (\<And>x. (fst z, x) \<in> R \<Longrightarrow> (snd z, x) \<in> R) &&& (\<And>x. (snd z, x) \<in> R \<Longrightarrow> (fst z, x) \<in> R)
[PROOF STEP]
unfolding equiv_def sym_def trans_def
[PROOF STATE]
proof (prove)
using this:
refl_on A R \<and> (\<forall>x y. (x, y) \<in> R \<longrightarrow> (y, x) \<in> R) \<and> (\<forall>x y z. (x, y) \<in> R \<longrightarrow> (y, z) \<in> R \<longrightarrow> (x, z) \<in> R)
(fst z, snd z) \<in> R

goal (1 subgoal):
 1. (\<And>x. (fst z, x) \<in> R \<Longrightarrow> (snd z, x) \<in> R) &&& (\<And>x. (snd z, x) \<in> R \<Longrightarrow> (fst z, x) \<in> R)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R

goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R

goal (1 subgoal):
 1. (proj R \<circ> fst) z = (proj R \<circ> snd) z
[PROOF STEP]
unfolding proj_def[abs_def]
[PROOF STATE]
proof (prove)
using this:
(fst z, ?x) \<in> R \<Longrightarrow> (snd z, ?x) \<in> R
(snd z, ?x) \<in> R \<Longrightarrow> (fst z, ?x) \<in> R

goal (1 subgoal):
 1. ((\<lambda>x. R `` {x}) \<circ> fst) z = ((\<lambda>x. R `` {x}) \<circ> snd) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(proj R \<circ> fst) z = (proj R \<circ> snd) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma well_def_signs_step:
  fixes qs1 qs2 :: "real poly list"
  fixes signs1 signs2 :: "rat list list"
  assumes "length qs1 > 0"
  assumes "length qs2 > 0"
  assumes well_def1: "well_def_signs (length qs1) signs1"
  assumes well_def2: "well_def_signs (length qs2) signs2"
  shows "well_def_signs (length (qs1@qs2)) (signs_smash signs1 signs2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_def_signs (length (qs1 @ qs2)) (signs_smash signs1 signs2)
[PROOF STEP]
using well_def1 well_def2
[PROOF STATE]
proof (prove)
using this:
well_def_signs (length qs1) signs1
well_def_signs (length qs2) signs2

goal (1 subgoal):
 1. well_def_signs (length (qs1 @ qs2)) (signs_smash signs1 signs2)
[PROOF STEP]
unfolding well_def_signs_def
[PROOF STATE]
proof (prove)
using this:
\<forall>signs\<in>set signs1. length signs = length qs1
\<forall>signs\<in>set signs2. length signs = length qs2

goal (1 subgoal):
 1. \<forall>signs\<in>set (signs_smash signs1 signs2). length signs = length (qs1 @ qs2)
[PROOF STEP]
using signs_smash_property_set[of signs1 signs2] length_append
[PROOF STATE]
proof (prove)
using this:
\<forall>signs\<in>set signs1. length signs = length qs1
\<forall>signs\<in>set signs2. length signs = length qs2
\<forall>elem. elem \<in> set (signs_smash signs1 signs2) \<longrightarrow> (\<exists>elem1 elem2. elem1 \<in> set signs1 \<and> elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
length (?xs @ ?ys) = length ?xs + length ?ys

goal (1 subgoal):
 1. \<forall>signs\<in>set (signs_smash signs1 signs2). length signs = length (qs1 @ qs2)
[PROOF STEP]
by auto


[STATEMENT]
lemma compact_sequentialE:
  fixes S T::"'a::first_countable_topology set"
  assumes "compact S"
  assumes "infinite T"
  assumes "T \<subseteq> S"
  obtains t::"nat \<Rightarrow> 'a" and l::'a
  where "\<And>n. t n \<in> T" "\<And>n. t n \<noteq> l" "t \<longlonglongrightarrow> l" "l \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t l. \<lbrakk>\<And>n. t n \<in> T; \<And>n. t n \<noteq> l; t \<longlonglongrightarrow> l; l \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>t l. \<lbrakk>\<And>n. t n \<in> T; \<And>n. t n \<noteq> l; t \<longlonglongrightarrow> l; l \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from Heine_Borel_imp_Bolzano_Weierstrass[OF assms]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>S. x islimpt T
[PROOF STEP]
obtain l where "l \<in> S" "l islimpt T"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. x islimpt T

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l \<in> S; l islimpt T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
l \<in> S
l islimpt T

goal (1 subgoal):
 1. (\<And>t l. \<lbrakk>\<And>n. t n \<in> T; \<And>n. t n \<noteq> l; t \<longlonglongrightarrow> l; l \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l \<in> S
l islimpt T
[PROOF STEP]
obtain t where "t n \<in> T" "t n \<noteq> l" "t \<longlonglongrightarrow> l" "l \<in> S" for n
[PROOF STATE]
proof (prove)
using this:
l \<in> S
l islimpt T

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>\<And>n. t n \<in> T; \<And>n. t n \<noteq> l; t \<longlonglongrightarrow> l; l \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding islimpt_sequential
[PROOF STATE]
proof (prove)
using this:
l \<in> S
\<exists>f. (\<forall>n. f n \<in> T - {l}) \<and> f \<longlonglongrightarrow> l

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>\<And>n. t n \<in> T; \<And>n. t n \<noteq> l; t \<longlonglongrightarrow> l; l \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t ?n \<in> T
t ?n \<noteq> l
t \<longlonglongrightarrow> l
l \<in> S

goal (1 subgoal):
 1. (\<And>t l. \<lbrakk>\<And>n. t n \<in> T; \<And>n. t n \<noteq> l; t \<longlonglongrightarrow> l; l \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t ?n \<in> T
t ?n \<noteq> l
t \<longlonglongrightarrow> l
l \<in> S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t ?n \<in> T
t ?n \<noteq> l
t \<longlonglongrightarrow> l
l \<in> S

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_zip [simp]:
  "\<lbrakk>i < length xs; i < length ys\<rbrakk> \<Longrightarrow> (zip xs ys)!i = (xs!i, ys!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; i < length ys\<rbrakk> \<Longrightarrow> zip xs ys ! i = (xs ! i, ys ! i)
[PROOF STEP]
proof (induct ys arbitrary: i xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i xs. \<lbrakk>i < length xs; i < length []\<rbrakk> \<Longrightarrow> zip xs [] ! i = (xs ! i, [] ! i)
 2. \<And>a ys i xs. \<lbrakk>\<And>i xs. \<lbrakk>i < length xs; i < length ys\<rbrakk> \<Longrightarrow> zip xs ys ! i = (xs ! i, ys ! i); i < length xs; i < length (a # ys)\<rbrakk> \<Longrightarrow> zip xs (a # ys) ! i = (xs ! i, (a # ys) ! i)
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < length ?xs; ?i < length ys\<rbrakk> \<Longrightarrow> zip ?xs ys ! ?i = (?xs ! ?i, ys ! ?i)
i < length xs
i < length (y # ys)

goal (2 subgoals):
 1. \<And>i xs. \<lbrakk>i < length xs; i < length []\<rbrakk> \<Longrightarrow> zip xs [] ! i = (xs ! i, [] ! i)
 2. \<And>a ys i xs. \<lbrakk>\<And>i xs. \<lbrakk>i < length xs; i < length ys\<rbrakk> \<Longrightarrow> zip xs ys ! i = (xs ! i, ys ! i); i < length xs; i < length (a # ys)\<rbrakk> \<Longrightarrow> zip xs (a # ys) ! i = (xs ! i, (a # ys) ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i < length ?xs; ?i < length ys\<rbrakk> \<Longrightarrow> zip ?xs ys ! ?i = (?xs ! ?i, ys ! ?i)
i < length xs
i < length (y # ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < length ?xs; ?i < length ys\<rbrakk> \<Longrightarrow> zip ?xs ys ! ?i = (?xs ! ?i, ys ! ?i)
i < length xs
i < length (y # ys)

goal (1 subgoal):
 1. zip xs (y # ys) ! i = (xs ! i, (y # ys) ! i)
[PROOF STEP]
by (cases xs) (simp_all add: nth.simps split: nat.split)
[PROOF STATE]
proof (state)
this:
zip xs (y # ys) ! i = (xs ! i, (y # ys) ! i)

goal (1 subgoal):
 1. \<And>i xs. \<lbrakk>i < length xs; i < length []\<rbrakk> \<Longrightarrow> zip xs [] ! i = (xs ! i, [] ! i)
[PROOF STEP]
qed auto


[STATEMENT]
lemma array_foldl_new_array:
  "array_foldl f b (new_array a n) = foldl (\<lambda>b (k, v). f k b v) b (zip [0..<n] (replicate n a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. array_foldl f b (new_array a n) = foldl (\<lambda>b (k, v). f k b v) b (zip [0..<n] (replicate n a))
[PROOF STEP]
by(simp add: new_array_def array_foldl_def)


[STATEMENT]
lemma bij_fst_inv_inv_eq: "bij f \<Longrightarrow> fst (inv (%(x, u). inv f x) z) = f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij f \<Longrightarrow> fst (inv (\<lambda>(x, u). inv f x) z) = f z
[PROOF STEP]
apply (rule fst_inv_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bij f \<Longrightarrow> surj (\<lambda>a. case a of (x, u) \<Rightarrow> inv f x)
 2. \<And>x y. bij f \<Longrightarrow> f (case (x, y) of (x, u) \<Rightarrow> inv f x) = x
[PROOF STEP]
apply (rule_tac f = "%z. (f z, h z)" for h in surjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. bij f \<Longrightarrow> (case (f x, ?h7 x) of (x, u) \<Rightarrow> inv f x) = x
 2. \<And>x y. bij f \<Longrightarrow> f (case (x, y) of (x, u) \<Rightarrow> inv f x) = x
[PROOF STEP]
apply (simp add: bij_is_inj inv_f_f)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. bij f \<Longrightarrow> f (case (x, y) of (x, u) \<Rightarrow> inv f x) = x
[PROOF STEP]
apply (simp add: bij_is_surj surj_f_inv_f)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in factorial_monoid) associated_fcount:
  assumes acarr: "a \<in> carrier G"
    and bcarr: "b \<in> carrier G"
    and asc: "a \<sim> b"
  shows "factorcount G a = factorcount G b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factorcount G a = factorcount G b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G
b \<in> carrier G
a \<sim> b

goal (1 subgoal):
 1. factorcount G a = factorcount G b
[PROOF STEP]
by (auto simp: associated_def factorial_monoid.divides_fcount factorial_monoid_axioms le_antisym)


[STATEMENT]
lemma mono_restriction_is_mono: "mono f \<Longrightarrow> mono (\<lambda>S. f (S \<inter> V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> mono (\<lambda>S. f (S \<inter> V))
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<subseteq> y \<longrightarrow> f x \<le> f y \<Longrightarrow> \<forall>x y. x \<subseteq> y \<longrightarrow> f (x \<inter> V) \<le> f (y \<inter> V)
[PROOF STEP]
by (meson inf_mono monoD subset_refl)


[STATEMENT]
lemma ran_distinct:
  assumes dist: "distinct (map fst al)"
  shows "ran (map_of al) = snd ` set al"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ran (map_of al) = snd ` set al
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct (map fst al)

goal (1 subgoal):
 1. ran (map_of al) = snd ` set al
[PROOF STEP]
proof (induct al)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct (map fst []) \<Longrightarrow> ran (map_of []) = snd ` set []
 2. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
distinct (map fst [])

goal (2 subgoals):
 1. distinct (map fst []) \<Longrightarrow> ran (map_of []) = snd ` set []
 2. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst [])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distinct (map fst [])

goal (1 subgoal):
 1. ran (map_of []) = snd ` set []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ran (map_of []) = snd ` set []

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
case (Cons kv al)
[PROOF STATE]
proof (state)
this:
distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al
distinct (map fst (kv # al))

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al
distinct (map fst (kv # al))
[PROOF STEP]
have "ran (map_of al) = snd ` set al"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al
distinct (map fst (kv # al))

goal (1 subgoal):
 1. ran (map_of al) = snd ` set al
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ran (map_of al) = snd ` set al

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ran (map_of al) = snd ` set al

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
from Cons.prems
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst (kv # al))
[PROOF STEP]
have "map_of al (fst kv) = None"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (kv # al))

goal (1 subgoal):
 1. map_of al (fst kv) = None
[PROOF STEP]
by (simp add: map_of_eq_None_iff)
[PROOF STATE]
proof (state)
this:
map_of al (fst kv) = None

goal (1 subgoal):
 1. \<And>a al. \<lbrakk>distinct (map fst al) \<Longrightarrow> ran (map_of al) = snd ` set al; distinct (map fst (a # al))\<rbrakk> \<Longrightarrow> ran (map_of (a # al)) = snd ` set (a # al)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ran (map_of al) = snd ` set al
map_of al (fst kv) = None
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ran (map_of al) = snd ` set al
map_of al (fst kv) = None

goal (1 subgoal):
 1. ran (map_of (kv # al)) = snd ` set (kv # al)
[PROOF STEP]
by (simp only: map_of.simps ran_map_upd) simp
[PROOF STATE]
proof (state)
this:
ran (map_of (kv # al)) = snd ` set (kv # al)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma replaceEquivalentByEquivalent:
  fixes formula :: Formula and formula' :: Formula and formula1 :: Formula and formula2 :: Formula
  assumes "equivalentFormulae formula formula'"
  shows "equivalentFormulae (formula1 @ formula @ formula2) (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalentFormulae (formula1 @ formula @ formula2) (formula1 @ formula' @ formula2)
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>valuation. model valuation (formula1 @ formula @ formula2) = model valuation (formula1 @ formula' @ formula2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>valuation. model valuation (formula1 @ formula @ formula2) = model valuation (formula1 @ formula' @ formula2)
[PROOF STEP]
fix v :: Valuation
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>valuation. model valuation (formula1 @ formula @ formula2) = model valuation (formula1 @ formula' @ formula2)
[PROOF STEP]
show "model v (formula1 @ formula @ formula2) = model v (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. model v (formula1 @ formula @ formula2) = model v (formula1 @ formula' @ formula2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
assume "model v (formula1 @ formula @ formula2)"
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula @ formula2)

goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
hence *: "consistent v" "formulaTrue formula1 v" "formulaTrue formula v" "formulaTrue formula2 v"
[PROOF STATE]
proof (prove)
using this:
model v (formula1 @ formula @ formula2)

goal (1 subgoal):
 1. (consistent v &&& formulaTrue formula1 v) &&& formulaTrue formula v &&& formulaTrue formula2 v
[PROOF STEP]
by (auto simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
consistent v
formulaTrue formula1 v
formulaTrue formula v
formulaTrue formula2 v

goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
from \<open>consistent v\<close> \<open>formulaTrue formula v\<close> \<open>equivalentFormulae formula formula'\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent v
formulaTrue formula v
equivalentFormulae formula formula'
[PROOF STEP]
have "formulaTrue formula' v"
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula v
equivalentFormulae formula formula'

goal (1 subgoal):
 1. formulaTrue formula' v
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula v
\<forall>valuation. model valuation formula = model valuation formula'

goal (1 subgoal):
 1. formulaTrue formula' v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
formulaTrue formula' v

goal (2 subgoals):
 1. model v (formula1 @ formula @ formula2) \<Longrightarrow> model v (formula1 @ formula' @ formula2)
 2. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
thus "model v (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula' v

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula' v
consistent v
formulaTrue formula1 v
formulaTrue formula v
formulaTrue formula2 v

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2)
[PROOF STEP]
by (simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula' @ formula2)

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
assume "model v (formula1 @ formula' @ formula2)"
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula' @ formula2)

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
hence *: "consistent v" "formulaTrue formula1 v" "formulaTrue formula' v" "formulaTrue formula2 v"
[PROOF STATE]
proof (prove)
using this:
model v (formula1 @ formula' @ formula2)

goal (1 subgoal):
 1. (consistent v &&& formulaTrue formula1 v) &&& formulaTrue formula' v &&& formulaTrue formula2 v
[PROOF STEP]
by (auto simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
consistent v
formulaTrue formula1 v
formulaTrue formula' v
formulaTrue formula2 v

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
from \<open>consistent v\<close> \<open>formulaTrue formula' v\<close> \<open>equivalentFormulae formula formula'\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent v
formulaTrue formula' v
equivalentFormulae formula formula'
[PROOF STEP]
have "formulaTrue formula v"
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula' v
equivalentFormulae formula formula'

goal (1 subgoal):
 1. formulaTrue formula v
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
using this:
consistent v
formulaTrue formula' v
\<forall>valuation. model valuation formula = model valuation formula'

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

goal (1 subgoal):
 1. model v (formula1 @ formula' @ formula2) \<Longrightarrow> model v (formula1 @ formula @ formula2)
[PROOF STEP]
thus "model v (formula1 @ formula @ formula2)"
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula v

goal (1 subgoal):
 1. model v (formula1 @ formula @ formula2)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula v
consistent v
formulaTrue formula1 v
formulaTrue formula' v
formulaTrue formula2 v

goal (1 subgoal):
 1. model v (formula1 @ formula @ formula2)
[PROOF STEP]
by (simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula @ formula2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
model v (formula1 @ formula @ formula2) = model v (formula1 @ formula' @ formula2)

goal:
No subgoals!
[PROOF STEP]
qed