[STATEMENT]
lemma rank_mat_mul_right:
  assumes "A \<in> carrier_mat n d"
  assumes "B \<in> carrier_mat d nc"
  shows "rank (A * B) \<le> rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (A * B) \<le> rank A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (A * B) \<le> rank A
[PROOF STEP]
have "subspace class_ring (local.span (set (cols (A*B))))
        (vs (local.span (set (cols A))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace class_ring (local.span (set (cols (A * B)))) (vs (local.span (set (cols A))))
[PROOF STEP]
unfolding subspace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace class_ring (vs (local.span (set (cols A)))) \<and> LinearCombinations.submodule class_ring (local.span (set (cols (A * B)))) (vs (local.span (set (cols A))))
[PROOF STEP]
by (metis assms(1) assms(2) carrier_matD(1) cols_dim index_mult_mat(2) nested_submodules span_is_submodule vec_space.span_mat_mul_subset vec_vs_col)
[PROOF STATE]
proof (state)
this:
subspace class_ring (local.span (set (cols (A * B)))) (vs (local.span (set (cols A))))

goal (1 subgoal):
 1. rank (A * B) \<le> rank A
[PROOF STEP]
from vectorspace.subspace_dim[OF _ this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>vectorspace class_ring (vs (local.span (set (cols A)))); vectorspace.fin_dim class_ring (vs (local.span (set (cols A)))); vectorspace.fin_dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>)\<rbrakk> \<Longrightarrow> vectorspace.dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))
[PROOF STEP]
have "vectorspace.dim class_ring
   (vs (local.span (set (cols A)))
    \<lparr>carrier := local.span (set (cols (A * B)))\<rparr>) \<le>
  vectorspace.dim class_ring
      (vs (local.span (set (cols A))))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>vectorspace class_ring (vs (local.span (set (cols A)))); vectorspace.fin_dim class_ring (vs (local.span (set (cols A)))); vectorspace.fin_dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>)\<rbrakk> \<Longrightarrow> vectorspace.dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))

goal (1 subgoal):
 1. vectorspace.dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>vectorspace class_ring (vs (local.span (set (cols A)))); vectorspace.fin_dim class_ring (vs (local.span (set (cols A)))); vectorspace.fin_dim class_ring (vs (local.span (set (cols (A * B)))))\<rbrakk> \<Longrightarrow> vectorspace.dim class_ring (vs (local.span (set (cols (A * B))))) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))) \<Longrightarrow> vectorspace.dim class_ring (vs (local.span (set (cols (A * B))))) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))
[PROOF STEP]
by (metis (no_types) assms(1) carrier_matD(1) fin_dim_span_cols index_mult_mat(2) mat_of_cols_carrier(1) mat_of_cols_cols vec_vs_col)
[PROOF STATE]
proof (state)
this:
vectorspace.dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))

goal (1 subgoal):
 1. rank (A * B) \<le> rank A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
vectorspace.dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))

goal (1 subgoal):
 1. rank (A * B) \<le> rank A
[PROOF STEP]
unfolding rank_def
[PROOF STATE]
proof (prove)
using this:
vectorspace.dim class_ring (vs (local.span (set (cols A)))\<lparr>carrier := local.span (set (cols (A * B)))\<rparr>) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))

goal (1 subgoal):
 1. vectorspace.dim class_ring (vs (local.span (set (cols (A * B))))) \<le> vectorspace.dim class_ring (vs (local.span (set (cols A))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rank (A * B) \<le> rank A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_sneg_minus1: "-x = (-1::'a::ring_1) *s x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x = - (1::'a) *s x
[PROOF STEP]
by vector


[STATEMENT]
lemma listrel_subset_rtrancl_listrel1: "listrel r \<subseteq> (listrel1 r)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listrel r \<subseteq> (listrel1 r)\<^sup>*
[PROOF STEP]
by(fast intro:rtrancl_listrel1_if_listrel)


[STATEMENT]
lemma sets_PiM_in_sets:
  assumes space: "space N = (\<Pi>\<^sub>E i\<in>I. space (M i))"
  assumes sets: "\<And>i A. i \<in> I \<Longrightarrow> A \<in> sets (M i) \<Longrightarrow> {x\<in>space N. x i \<in> A} \<in> sets N"
  shows "sets (\<Pi>\<^sub>M i \<in> I. M i) \<subseteq> sets N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Pi\<^sub>M I M) \<subseteq> sets N
[PROOF STEP]
unfolding sets_PiM_single space[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets (space N) {{f \<in> space N. f i \<in> A} |i A. i \<in> I \<and> A \<in> sets (M i)} \<subseteq> sets N
[PROOF STEP]
by (intro sets.sigma_sets_subset subsetI) (auto intro: sets)


[STATEMENT]
theorem deduction: "insert p H |- q  ==>  H |- p->q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert p H |- q \<Longrightarrow> H |- p -> q
[PROOF STEP]
apply (induct set: thms)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>pa. pa \<in> insert p H \<Longrightarrow> H |- p -> pa
 2. \<And>pa q. H |- p -> pa -> q -> pa
 3. \<And>pa q r. H |- p -> (pa -> q -> r) -> (pa -> q) -> pa -> r
 4. \<And>pa. H |- p -> ((pa -> false) -> false) -> pa
 5. \<And>pa q. \<lbrakk>insert p H |- pa -> q; H |- p -> pa -> q; insert p H |- pa; H |- p -> pa\<rbrakk> \<Longrightarrow> H |- p -> q
[PROOF STEP]
apply (fast intro: thms_I thms.H thms.K thms.S thms.DN
                   thms.S [THEN thms.MP, THEN thms.MP] weaken_right)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poly_deg_monomial: "poly_deg (monomial c t) = (if c = 0 then 0 else deg_pm t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (monomial c t) = (if c = (0::'c) then 0::'a else deg_pm t)
[PROOF STEP]
by (simp add: poly_deg_def)


[STATEMENT]
lemma extended_Gromov_distance_commute:
  "extended_Gromov_distance x y = extended_Gromov_distance y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extended_Gromov_distance x y = extended_Gromov_distance y x
[PROOF STEP]
unfolding extended_Gromov_distance_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x \<in> Gromov_boundary \<or> y \<in> Gromov_boundary then \<infinity> else ereal (dist (inv to_Gromov_completion x) (inv to_Gromov_completion y))) = (if y \<in> Gromov_boundary \<or> x \<in> Gromov_boundary then \<infinity> else ereal (dist (inv to_Gromov_completion y) (inv to_Gromov_completion x)))
[PROOF STEP]
by (simp add: dist_commute)


[STATEMENT]
lemma induced_function_integral_aux:
  fixes f::"'a \<Rightarrow> real"
  assumes A_meas [measurable]: "A \<in> sets M"
      and f_int [measurable]: "integrable M f"
      and f_pos: "\<And>x. f x \<ge> 0"
  shows "integrable M (induced_function A f)"
        "(\<integral>y. induced_function A f y \<partial>M) = (\<integral>x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (induced_function A f) &&& integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable M (induced_function A f)
 2. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
show "integrable M (induced_function A f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (induced_function A f)
[PROOF STEP]
proof (rule integrableI_nonneg)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. AE x in M. 0 \<le> induced_function A f x
 3. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
show "AE x in M. induced_function A f x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. 0 \<le> induced_function A f x
[PROOF STEP]
unfolding induced_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. 0 \<le> (\<Sum>i<return_time_function A x. f ((T ^^ i) x))
[PROOF STEP]
by (simp add: f_pos sum_nonneg)
[PROOF STATE]
proof (state)
this:
AE x in M. 0 \<le> induced_function A f x

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
have "(\<integral>\<^sup>+x. ennreal (induced_function A f x) \<partial>M) = (\<integral>\<^sup>+ x. induced_function A (\<lambda>x. ennreal(f x)) x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M = integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x)))
[PROOF STEP]
unfolding induced_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (\<Sum>i<return_time_function A x. f ((T ^^ i) x)) \<partial>M = \<integral>\<^sup>+ x. (\<Sum>i<return_time_function A x. ennreal (f ((T ^^ i) x))) \<partial>M
[PROOF STEP]
by (auto simp: f_pos)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M = integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x)))

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M = integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x)))

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
have "... = (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x))) = \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M
[PROOF STEP]
by (rule induced_function_nn_integral, auto simp add: assms)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x))) = \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x))) = \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
have "... \<le> (\<integral>\<^sup>+ x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M \<le> \<integral>\<^sup>+ x. ennreal (f x) \<partial>M
[PROOF STEP]
using nn_set_integral_set_mono[where ?A = "(\<Union>n. (T^^n)--`A)" and ?B = UNIV and ?f = "\<lambda>x. ennreal(f x)"]
[PROOF STATE]
proof (prove)
using this:
(\<Union>n. (T ^^ n) --` A) \<subseteq> UNIV \<Longrightarrow> \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>?M \<le> \<integral>\<^sup>+x\<in>UNIV. ennreal (f x)\<partial>?M

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M \<le> \<integral>\<^sup>+ x. ennreal (f x) \<partial>M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M \<le> \<integral>\<^sup>+ x. ennreal (f x) \<partial>M

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M \<le> \<integral>\<^sup>+ x. ennreal (f x) \<partial>M

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
have "... < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>M < \<infinity>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> sets M
integrable M f
0 \<le> f ?x3

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>M < \<infinity>
[PROOF STEP]
by (auto simp: less_top)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>M < \<infinity>

goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
show "(\<integral>\<^sup>+ x. induced_function A f x \<partial>M) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M < \<infinity>

goal (1 subgoal):
 1. induced_function A f \<in> borel_measurable M
[PROOF STEP]
qed (simp)
[PROOF STATE]
proof (state)
this:
integrable M (induced_function A f)

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<integral>\<^sup>+ x. (f x * indicator (\<Union>n. (T^^n)--`A) x) \<partial>M) = (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M
[PROOF STEP]
by (auto split: split_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = (\<integral>\<^sup>+ x. induced_function A (\<lambda>x. ennreal(f x)) x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M = integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x)))
[PROOF STEP]
by (rule induced_function_nn_integral[symmetric], auto simp add: assms)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M = integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x)))

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>(\<Union>n. (T ^^ n) --` A). ennreal (f x)\<partial>M = integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x)))

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = (\<integral>\<^sup>+x. ennreal (induced_function A f x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x))) = \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M
[PROOF STEP]
unfolding induced_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Sum>i<return_time_function A x. ennreal (f ((T ^^ i) x))) \<partial>M = \<integral>\<^sup>+ x. ennreal (\<Sum>i<return_time_function A x. f ((T ^^ i) x)) \<partial>M
[PROOF STEP]
by (auto simp: f_pos)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A (\<lambda>x. ennreal (f x))) = \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M
[PROOF STEP]
have *: "(\<integral>\<^sup>+ x. (f x * indicator (\<Union>n. (T^^n)--`A) x) \<partial>M) = (\<integral>\<^sup>+x. ennreal (induced_function A f x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<integral> x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M) = (\<integral> x. f x * indicator (\<Union>n. (T^^n)--`A) x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f = LINT x|M. f x * indicat_real (\<Union>n. (T ^^ n) --` A) x
[PROOF STEP]
by (simp add: mult.commute set_lebesgue_integral_def)
[PROOF STATE]
proof (state)
this:
set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f = LINT x|M. f x * indicat_real (\<Union>n. (T ^^ n) --` A) x

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f = LINT x|M. f x * indicat_real (\<Union>n. (T ^^ n) --` A) x

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = enn2real (\<integral>\<^sup>+ x. (f x * indicator (\<Union>n. (T^^n)--`A) x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. f x * indicat_real (\<Union>n. (T ^^ n) --` A) x = enn2real (\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M)
[PROOF STEP]
by (rule integral_eq_nn_integral, auto simp add: f_pos)
[PROOF STATE]
proof (state)
this:
LINT x|M. f x * indicat_real (\<Union>n. (T ^^ n) --` A) x = enn2real (\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M)

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. f x * indicat_real (\<Union>n. (T ^^ n) --` A) x = enn2real (\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M)

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = enn2real (\<integral>\<^sup>+x. ennreal (induced_function A f x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M) = enn2real (\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M = \<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M

goal (1 subgoal):
 1. enn2real (\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M) = enn2real (\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enn2real (\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M) = enn2real (\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M)

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
enn2real (\<integral>\<^sup>+ x. ennreal (f x * indicat_real (\<Union>n. (T ^^ n) --` A) x) \<partial>M) = enn2real (\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M)

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = (\<integral> x. induced_function A f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M) = integral\<^sup>L M (induced_function A f)
[PROOF STEP]
apply (rule integral_eq_nn_integral[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. AE x in M. 0 \<le> induced_function A f x
[PROOF STEP]
unfolding induced_function_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i<return_time_function A x. f ((T ^^ i) x)) \<in> borel_measurable M
 2. AE x in M. 0 \<le> (\<Sum>i<return_time_function A x. f ((T ^^ i) x))
[PROOF STEP]
by (auto simp add: f_pos sum_nonneg)
[PROOF STATE]
proof (state)
this:
enn2real (\<integral>\<^sup>+ x. ennreal (induced_function A f x) \<partial>M) = integral\<^sup>L M (induced_function A f)

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f = integral\<^sup>L M (induced_function A f)
[PROOF STEP]
show "(\<integral> x. induced_function A f x \<partial>M) = (\<integral> x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f = integral\<^sup>L M (induced_function A f)

goal (1 subgoal):
 1. integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M (induced_function A f) = set_lebesgue_integral M (\<Union>n. (T ^^ n) --` A) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma T_snoc: "length rs = length as
       \<Longrightarrow>  T init (rs@[r]) (as@[a])
        = T init rs as + t\<^sub>p (steps' init rs as (length rs)) r a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length rs = length as \<Longrightarrow> T\<^sub>p init (rs @ [r]) (as @ [a]) = T\<^sub>p init rs as + t\<^sub>p (steps' init rs as (length rs)) r a
[PROOF STEP]
apply(induct rs as arbitrary: init rule: list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>init. T\<^sub>p init ([] @ [r]) ([] @ [a]) = T\<^sub>p init [] [] + t\<^sub>p (steps' init [] [] (length [])) r a
 2. \<And>x xs y ys init. \<lbrakk>length xs = length ys; \<And>init. T\<^sub>p init (xs @ [r]) (ys @ [a]) = T\<^sub>p init xs ys + t\<^sub>p (steps' init xs ys (length xs)) r a\<rbrakk> \<Longrightarrow> T\<^sub>p init ((x # xs) @ [r]) ((y # ys) @ [a]) = T\<^sub>p init (x # xs) (y # ys) + t\<^sub>p (steps' init (x # xs) (y # ys) (length (x # xs))) r a
[PROOF STEP]
by simp_all


[STATEMENT]
lemma Smith_normal_form_upt_k_intro_alt:
  assumes "(\<And>a b. to_nat a = to_nat b \<and> to_nat a + 1 < k \<and> to_nat b + 1 < k \<Longrightarrow> A $ a $ b dvd A $ (a+1) $ (b+1))"
  and "isDiagonal_upt_k A k"
  shows "Smith_normal_form_upt_k A k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Smith_normal_form_upt_k A k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat ?a = mod_type_class.to_nat ?b \<and> mod_type_class.to_nat ?a + 1 < k \<and> mod_type_class.to_nat ?b + 1 < k \<Longrightarrow> A $ ?a $ ?b dvd A $ (?a + (1::'a)) $ (?b + (1::'b))
isDiagonal_upt_k A k

goal (1 subgoal):
 1. Smith_normal_form_upt_k A k
[PROOF STEP]
unfolding Smith_normal_form_upt_k_def
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat ?a = mod_type_class.to_nat ?b \<and> mod_type_class.to_nat ?a + 1 < k \<and> mod_type_class.to_nat ?b + 1 < k \<Longrightarrow> A $ ?a $ ?b dvd A $ (?a + (1::'a)) $ (?b + (1::'b))
isDiagonal_upt_k A k

goal (1 subgoal):
 1. (\<forall>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < k \<and> mod_type_class.to_nat b + 1 < k \<longrightarrow> A $ a $ b dvd A $ (a + (1::'a)) $ (b + (1::'b))) \<and> isDiagonal_upt_k A k
[PROOF STEP]
by auto


[STATEMENT]
lemma vec_nth_eq_list_of_eucl2:
  "vec_nth (vec_nth (M::real^'n::enum^'m::enum) i) j =
    list_of_eucl M ! (index enum_class.enum i * CARD('n) + index enum_class.enum j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M $ i $ j = list_of_eucl M ! (index enum_class.enum i * CARD('n) + index enum_class.enum j)
[PROOF STEP]
apply (subst eucl_of_list_list_of_eucl[of M, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_of_list (list_of_eucl M) $ i $ j = list_of_eucl M ! (index enum_class.enum i * CARD('n) + index enum_class.enum j)
[PROOF STEP]
apply (subst vec_nth_eucl_of_list_eq2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (list_of_eucl M) = CARD('n) * CARD('m)
 2. list_of_eucl M ! index Basis_list (axis i (axis j 1)) = list_of_eucl M ! (index enum_class.enum i * CARD('n) + index enum_class.enum j)
[PROOF STEP]
unfolding index_Basis_list_axis2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (list_of_eucl M) = CARD('n) * CARD('m)
 2. list_of_eucl M ! (index enum_class.enum i * CARD('n) + index enum_class.enum j) = list_of_eucl M ! (index enum_class.enum i * CARD('n) + index enum_class.enum j)
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_divide_1':
  fixes   a :: "'a::{comm_monoid_add,inverse,mult_zero,uminus,zero_neq_one,monoid_mult} fps"
  assumes "inverse (1::'a) = 1"
  shows   "a / 1 = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a / 1 = a
[PROOF STEP]
using   assms fps_inverse_one' fps_one_mult(2)[of a]
[PROOF STATE]
proof (prove)
using this:
inverse (1::'a) = (1::'a)
inverse (1::?'a) = (1::?'a) \<Longrightarrow> inverse 1 = 1
a * 1 = a

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


[STATEMENT]
lemma real_root_le_1_iff [simp]: "0 < n \<Longrightarrow> root n x \<le> 1 \<longleftrightarrow> x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (root n x \<le> 1) = (x \<le> 1)
[PROOF STEP]
using real_root_le_iff [where y=1]
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> (root ?n ?x \<le> root ?n 1) = (?x \<le> 1)

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


[STATEMENT]
lemma linorder_rank_insert:
  assumes "finite A" "y \<notin> A"
  shows   "linorder_rank R (insert y A) x =
             (if x \<noteq> y \<and> (y,x) \<in> R then 1 else 0) + linorder_rank R A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linorder_rank R (insert y A) x = (if x \<noteq> y \<and> (y, x) \<in> R then 1 else 0) + linorder_rank R A x
[PROOF STEP]
using linorder_rank_union[of "{y}" A R x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {y}; finite A; {y} \<inter> A = {}\<rbrakk> \<Longrightarrow> linorder_rank R ({y} \<union> A) x = linorder_rank R {y} x + linorder_rank R A x
finite A
y \<notin> A

goal (1 subgoal):
 1. linorder_rank R (insert y A) x = (if x \<noteq> y \<and> (y, x) \<in> R then 1 else 0) + linorder_rank R A x
[PROOF STEP]
by (auto simp: linorder_rank_singleton)


[STATEMENT]
lemma fst_nodes: "fst ` nodes t = set_tree t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` nodes t = set_tree t
[PROOF STEP]
apply(induction t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fst ` nodes \<langle>\<rangle> = set_tree \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>fst ` nodes t1 = set_tree t1; fst ` nodes t2 = set_tree t2\<rbrakk> \<Longrightarrow> fst ` nodes \<langle>t1, x2, t2\<rangle> = set_tree \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>fst ` nodes t1 = set_tree t1; fst ` nodes t2 = set_tree t2\<rbrakk> \<Longrightarrow> fst ` nodes \<langle>t1, x2, t2\<rangle> = set_tree \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
apply (fastforce simp: image_def set_eq_iff ball_Un)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma proj_zero [term_simps]: "proj_poly k 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k 0 = 0
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_proj_poly)


[STATEMENT]
lemma (in comp_fun_idem) fold_set_union:
  assumes "finite A" "finite B"
  shows "Finite_Set.fold f z (A \<union> B) = Finite_Set.fold f (Finite_Set.fold f z A) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.fold f z (A \<union> B) = Finite_Set.fold f (Finite_Set.fold f z A) B
[PROOF STEP]
using assms(2,1)
[PROOF STATE]
proof (prove)
using this:
finite B
finite A

goal (1 subgoal):
 1. Finite_Set.fold f z (A \<union> B) = Finite_Set.fold f (Finite_Set.fold f z A) B
[PROOF STEP]
by induction simp_all


[STATEMENT]
lemma space_bind[simp]:
  assumes "\<And>x. x \<in> space M \<Longrightarrow> sets (f x) = sets N" and "space M \<noteq> {}"
  shows "space (bind M f) = space N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (M \<bind> f) = space N
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> space M \<Longrightarrow> sets (f ?x) = sets N
space M \<noteq> {}

goal (1 subgoal):
 1. space (M \<bind> f) = space N
[PROOF STEP]
by (intro sets_eq_imp_space_eq sets_bind)


[STATEMENT]
lemma height'_node22:
   "height l > 0 \<Longrightarrow> hD(node22 l a r') = max (height l) (hD r') + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height l \<Longrightarrow> hD (node22 l a r') = max (height l) (hD r') + 1
[PROOF STEP]
by(induct l a r' rule: node22.induct)(simp_all)


[STATEMENT]
lemma l6_11_uniqueness:
  assumes "A Out X R" and
    "Cong A X B C" and
    "A Out Y R" and
    "Cong A Y B C"
  shows "X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y
[PROOF STEP]
by (metis Out_def assms(1) assms(2) assms(3) assms(4) between_cong cong_symmetry cong_transitivity l6_6 l6_7)


[STATEMENT]
lemma finite_distinct_subset:
  assumes "finite X"
  shows "finite { xs . distinct xs \<and> set xs \<subseteq> X}" (is "finite (?S X)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. distinct xs \<and> set xs \<subseteq> X}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {xs. distinct xs \<and> set xs \<subseteq> X}
[PROOF STEP]
let ?X = "{ { xs. distinct xs \<and> set xs = Y} | Y. Y \<subseteq> X}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {xs. distinct xs \<and> set xs \<subseteq> X}
[PROOF STEP]
have id: "?S X = \<Union> ?X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. distinct xs \<and> set xs \<subseteq> X} = \<Union> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{xs. distinct xs \<and> set xs \<subseteq> X} = \<Union> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}

goal (1 subgoal):
 1. finite {xs. distinct xs \<and> set xs \<subseteq> X}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. distinct xs \<and> set xs \<subseteq> X}
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X})
[PROOF STEP]
proof (rule finite_Union)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}
 2. \<And>M. M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X} \<Longrightarrow> finite M
[PROOF STEP]
show "finite ?X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. finite {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}

goal (1 subgoal):
 1. \<And>M. M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X} \<Longrightarrow> finite M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X} \<Longrightarrow> finite M
[PROOF STEP]
fix M
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X} \<Longrightarrow> finite M
[PROOF STEP]
assume "M \<in> ?X"
[PROOF STATE]
proof (state)
this:
M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}

goal (1 subgoal):
 1. \<And>M. M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X} \<Longrightarrow> finite M
[PROOF STEP]
with finite_distinct
[PROOF STATE]
proof (chain)
picking this:
finite {xs. distinct xs \<and> set xs = ?X}
M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}
[PROOF STEP]
show "finite M"
[PROOF STATE]
proof (prove)
using this:
finite {xs. distinct xs \<and> set xs = ?X}
M \<in> {{xs. distinct xs \<and> set xs = Y} |Y. Y \<subseteq> X}

goal (1 subgoal):
 1. finite M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {xs. distinct xs \<and> set xs \<subseteq> X}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_cat_assoc: "(\<lambda>k n l. concat_bit n l k) ((\<lambda>k n l. concat_bit n l k) x m y) n z = (\<lambda>k n l. concat_bit n l k) x (m + n) ((\<lambda>k n l. concat_bit n l k) y n z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat_bit n z (concat_bit m y x) = concat_bit (m + n) (concat_bit n z y) x
[PROOF STEP]
by (fact concat_bit_assoc)


[STATEMENT]
lemma uminus_l_inv_vec[simp]:
  "(v :: 'a :: group_add vec) \<in> carrier_vec n \<Longrightarrow> (- v + v) = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec n \<Longrightarrow> - v + v = 0\<^sub>v n
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma bifunctor_flip_ObjMap_vdomain[cat_cs_simps]:
  assumes "category \<alpha> \<AA>"
    and "category \<alpha> \<BB>"
    and "\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<D>\<^sub>\<circ> (bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding bifunctor_flip_components
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (fflip (\<FF>\<lparr>ObjMap\<rparr>)) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (cs_concl cs_shallow cs_simp: V_cs_simps cat_cs_simps)


[STATEMENT]
lemma tendsto_frac_at_right_0:
  "(frac \<longlongrightarrow> 0) (at_right (0 :: 'a :: {floor_ceiling,order_topology}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (frac \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (frac \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
have *: "eventually (\<lambda>x. x = frac x) (at_right (0::'a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right (0::'a). x = frac x
[PROOF STEP]
by (intro eventually_at_rightI[of 0 1]) (simp_all add: frac_eq eq_commute[of _ "frac x" for x])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right (0::'a). x = frac x

goal (1 subgoal):
 1. (frac \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right (0::'a). x = frac x

goal (1 subgoal):
 1. (frac \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
have **: "((\<lambda>x::'a. x) \<longlongrightarrow> 0) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x) \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
by (rule tendsto_ident_at)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x) \<longlongrightarrow> (0::'a)) (at_right (0::'a))

goal (1 subgoal):
 1. (frac \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_right (0::'a). x = frac x
((\<lambda>x. x) \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right (0::'a). x = frac x
((\<lambda>x. x) \<longlongrightarrow> (0::'a)) (at_right (0::'a))

goal (1 subgoal):
 1. (frac \<longlongrightarrow> (0::'a)) (at_right (0::'a))
[PROOF STEP]
by (blast intro: Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(frac \<longlongrightarrow> (0::'a)) (at_right (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DC_mono:
  fixes a::"'s prog"
  assumes rab: "a \<sqsubseteq> b" and rcd: "c \<sqsubseteq> d"
  shows "(a \<Sqinter> c) \<sqsubseteq> (b \<Sqinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Sqinter> c) \<sqsubseteq> (b \<Sqinter> d)
[PROOF STEP]
proof(rule refinesI, unfold wp_eval, rule le_funI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> min (wp a P x) (wp c P x) \<le> min (wp b P x) (wp d P x)
[PROOF STEP]
fix P::"'s \<Rightarrow> real" and s::'s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> min (wp a P x) (wp c P x) \<le> min (wp b P x) (wp d P x)
[PROOF STEP]
assume sP: "sound P"
[PROOF STATE]
proof (state)
this:
sound P

goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> min (wp a P x) (wp c P x) \<le> min (wp b P x) (wp d P x)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<sqsubseteq> b
c \<sqsubseteq> d
sound P
[PROOF STEP]
have "wp a P s \<le> wp b P s" and "wp c P s \<le> wp d P s"
[PROOF STATE]
proof (prove)
using this:
a \<sqsubseteq> b
c \<sqsubseteq> d
sound P

goal (1 subgoal):
 1. wp a P s \<le> wp b P s &&& wp c P s \<le> wp d P s
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
wp a P s \<le> wp b P s
wp c P s \<le> wp d P s

goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> min (wp a P x) (wp c P x) \<le> min (wp b P x) (wp d P x)
[PROOF STEP]
thus "min (wp a P s) (wp c P s) \<le> min (wp b P s) (wp d P s)"
[PROOF STATE]
proof (prove)
using this:
wp a P s \<le> wp b P s
wp c P s \<le> wp d P s

goal (1 subgoal):
 1. min (wp a P s) (wp c P s) \<le> min (wp b P s) (wp d P s)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
min (wp a P s) (wp c P s) \<le> min (wp b P s) (wp d P s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_in_Reals [intro,simp]: "(\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f s \<in> \<real>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f s \<in> \<real>
[PROOF STEP]
proof (induct s rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>i. i \<in> A \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> prod f A \<in> \<real>
 2. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f {} \<in> \<real>
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f F \<in> \<real>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> prod f (insert x F) \<in> \<real>
[PROOF STEP]
case infinite
[PROOF STATE]
proof (state)
this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<real>

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>i. i \<in> A \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> prod f A \<in> \<real>
 2. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f {} \<in> \<real>
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f F \<in> \<real>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> prod f (insert x F) \<in> \<real>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<real>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<real>

goal (1 subgoal):
 1. prod f A_ \<in> \<real>
[PROOF STEP]
by (metis Reals_1 prod.infinite)
[PROOF STATE]
proof (state)
this:
prod f A_ \<in> \<real>

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f {} \<in> \<real>
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f F \<in> \<real>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> prod f (insert x F) \<in> \<real>
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma nth_list_segment:
  assumes "as \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "j \<le>n"
  assumes "i \<le>  j"
  assumes "k < j - i"
  shows "(list_segment i j as) ! k = as ! (i + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_segment i j as ! k = as ! (i + k)
[PROOF STEP]
unfolding list_segment_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((!) as) [i..<j] ! k = as ! (i + k)
[PROOF STEP]
using assms nth_map_upt[of k j i "((!) as)"   ]
[PROOF STATE]
proof (prove)
using this:
as \<in> carrier (R\<^bsup>n\<^esup>)
j \<le> n
i \<le> j
k < j - i
k < j - i \<Longrightarrow> map ((!) as) [i..<j] ! k = as ! (i + k)

goal (1 subgoal):
 1. map ((!) as) [i..<j] ! k = as ! (i + k)
[PROOF STEP]
by blast


[STATEMENT]
lemma lselect_to_lproject: "lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
have 1: "{(x, y). y \<in> s} = UNIV \<times> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). y \<in> s} = UNIV \<times> s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(x, y). y \<in> s} = UNIV \<times> s

goal (1 subgoal):
 1. lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
have "lselect s w = lmap fst (lproject {(x, y). y \<in> s} (w \<bar>\<bar> iterates Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lselect s w = lmap fst (lproject {(x, y). y \<in> s} (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
unfolding lnths_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lmap fst (lfilter (\<lambda>(x, y). y \<in> s) (w \<bar>\<bar> iterates Suc 0)) = lmap fst (lproject {(x, y). y \<in> s} (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lselect s w = lmap fst (lproject {(x, y). y \<in> s} (w \<bar>\<bar> iterates Suc 0))

goal (1 subgoal):
 1. lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lselect s w = lmap fst (lproject {(x, y). y \<in> s} (w \<bar>\<bar> iterates Suc 0))

goal (1 subgoal):
 1. lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
have "\<dots> = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lmap fst (lproject {(x, y). y \<in> s} (w \<bar>\<bar> iterates Suc 0)) = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
unfolding 1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0)) = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
by rule
[PROOF STATE]
proof (state)
this:
lmap fst (lproject {(x, y). y \<in> s} (w \<bar>\<bar> iterates Suc 0)) = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))

goal (1 subgoal):
 1. lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))

goal (1 subgoal):
 1. lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
lselect s w = lmap fst (lproject (UNIV \<times> s) (w \<bar>\<bar> iterates Suc 0))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RSpan_lincomb_closed :
  "\<lbrakk> set rs \<subseteq> R; set ms \<subseteq> M; set ns \<subseteq> RSpan ms \<rbrakk> \<Longrightarrow> rs \<bullet>\<cdot> ns \<in> RSpan ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set rs \<subseteq> R; set ms \<subseteq> M; set ns \<subseteq> RSpan ms\<rbrakk> \<Longrightarrow> rs \<bullet>\<cdot> ns \<in> RSpan ms
[PROOF STEP]
using lincomb_Nil RSpan_zero_closed lincomb_Cons RSpan_smult_closed RSpan_add_closed
[PROOF STATE]
proof (prove)
using this:
?rs = [] \<or> ?ms = [] \<Longrightarrow> ?rs \<bullet>\<cdot> ?ms = (0::'m)
set ?ms \<subseteq> M \<Longrightarrow> (0::'m) \<in> RSpan ?ms
(?r # ?rs) \<bullet>\<cdot> (?m # ?ms) = ?r \<cdot> ?m + ?rs \<bullet>\<cdot> ?ms
\<lbrakk>?r \<in> R; set ?ms \<subseteq> M; ?n \<in> RSpan ?ms\<rbrakk> \<Longrightarrow> ?r \<cdot> ?n \<in> RSpan ?ms
\<lbrakk>set ?ms \<subseteq> M; ?n \<in> RSpan ?ms; ?n' \<in> RSpan ?ms\<rbrakk> \<Longrightarrow> ?n + ?n' \<in> RSpan ?ms

goal (1 subgoal):
 1. \<lbrakk>set rs \<subseteq> R; set ms \<subseteq> M; set ns \<subseteq> RSpan ms\<rbrakk> \<Longrightarrow> rs \<bullet>\<cdot> ns \<in> RSpan ms
[PROOF STEP]
by    (induct rs ns rule: list_induct2') auto


[STATEMENT]
lemma conj_seq_bot_right [simp]: "c;\<bottom> \<iinter> c =  c;\<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ; \<bottom> \<iinter> c = c ; \<bottom>
variables:
c :: 'b
(\<iinter>), (;) :: 'b \<Rightarrow> 'b \<Rightarrow> 'b
type variables:
'b :: refinement_lattice
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c ; \<bottom> \<iinter> c \<sqsubseteq> c ; \<bottom>
 2. c ; \<bottom> \<sqsubseteq> c ; \<bottom> \<iinter> c
variables:
c :: 'b
(\<iinter>), (;) :: 'b \<Rightarrow> 'b \<Rightarrow> 'b
type variables:
'b :: refinement_lattice
[PROOF STEP]
show lr: "c;\<bottom> \<iinter> c \<sqsubseteq>  c;\<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ; \<bottom> \<iinter> c \<sqsubseteq> c ; \<bottom>
variables:
c :: 'b
(\<iinter>), (;) :: 'b \<Rightarrow> 'b \<Rightarrow> 'b
type variables:
'b :: refinement_lattice
[PROOF STEP]
by (metis seq_bot_conj conj_idem)
[PROOF STATE]
proof (state)
this:
(c::'b::refinement_lattice) ; \<bottom> \<iinter> c \<sqsubseteq> c ; \<bottom>

goal (1 subgoal):
 1. c ; \<bottom> \<sqsubseteq> c ; \<bottom> \<iinter> c
variables:
c :: 'b
(\<iinter>), (;) :: 'b \<Rightarrow> 'b \<Rightarrow> 'b
type variables:
'b :: refinement_lattice
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c ; \<bottom> \<sqsubseteq> c ; \<bottom> \<iinter> c
variables:
c :: 'b
(\<iinter>), (;) :: 'b \<Rightarrow> 'b \<Rightarrow> 'b
type variables:
'b :: refinement_lattice
[PROOF STEP]
show rl: "c;\<bottom> \<sqsubseteq> c;\<bottom> \<iinter> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ; \<bottom> \<sqsubseteq> c ; \<bottom> \<iinter> c
variables:
c :: 'b
(\<iinter>), (;) :: 'b \<Rightarrow> 'b \<Rightarrow> 'b
type variables:
'b :: refinement_lattice
[PROOF STEP]
by (metis conj_idem conj_mono_right seq_bot_right)
[PROOF STATE]
proof (state)
this:
(c::'b::refinement_lattice) ; \<bottom> \<sqsubseteq> c ; \<bottom> \<iinter> c

goal:
No subgoals!
variables:
c :: 'b
(\<iinter>), (;) :: 'b \<Rightarrow> 'b \<Rightarrow> 'b
type variables:
'b :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_list_of_set_UN_eq_concat:
  assumes I: "strict_mono_sets I f" "finite I" and fin: "\<And>i. finite (f i)"
  shows "list_of (\<Union>i \<in> I. f i) = concat (map (list_of \<circ> f) (list_of I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
strict_mono_sets I f
finite I

goal (1 subgoal):
 1. list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
proof (induction "card I" arbitrary: I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
case (Suc n I)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = card ?I; strict_mono_sets ?I f; finite ?I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` ?I)) = concat (map (list_of \<circ> f) (list_of ?I))
Suc n = card I
strict_mono_sets I f
finite I

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = card ?I; strict_mono_sets ?I f; finite ?I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` ?I)) = concat (map (list_of \<circ> f) (list_of ?I))
Suc n = card I
strict_mono_sets I f
finite I
[PROOF STEP]
have "I \<noteq> {}" and Iexp: "I = insert (Min I) (I - {Min I})"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?I; strict_mono_sets ?I f; finite ?I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` ?I)) = concat (map (list_of \<circ> f) (list_of ?I))
Suc n = card I
strict_mono_sets I f
finite I

goal (1 subgoal):
 1. I \<noteq> {} &&& I = insert (Min I) (I - {Min I})
[PROOF STEP]
using Min_in Suc.hyps(2) Suc.prems(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?I; strict_mono_sets ?I f; finite ?I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` ?I)) = concat (map (list_of \<circ> f) (list_of ?I))
Suc n = card I
strict_mono_sets I f
finite I
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A
Suc n = card I
finite I

goal (1 subgoal):
 1. I \<noteq> {} &&& I = insert (Min I) (I - {Min I})
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
I \<noteq> {}
I = insert (Min I) (I - {Min I})

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
have IH: "list_of (\<Union> (f ` (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of (I - {Min I})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (\<Union> (f ` (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of (I - {Min I})))
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?I; strict_mono_sets ?I f; finite ?I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` ?I)) = concat (map (list_of \<circ> f) (list_of ?I))
Suc n = card I
strict_mono_sets I f
finite I

goal (1 subgoal):
 1. list_of (\<Union> (f ` (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of (I - {Min I})))
[PROOF STEP]
unfolding strict_mono_sets_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?I; \<forall>x\<in>?I. \<forall>y\<in>?I. x < y \<longrightarrow> f x \<lless> f y; finite ?I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` ?I)) = concat (map (list_of \<circ> f) (list_of ?I))
Suc n = card I
\<forall>x\<in>I. \<forall>y\<in>I. x < y \<longrightarrow> f x \<lless> f y
finite I

goal (1 subgoal):
 1. list_of (\<Union> (f ` (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of (I - {Min I})))
[PROOF STEP]
by (metis DiffE Iexp card_Diff_singleton diff_Suc_1 finite_Diff insertI1)
[PROOF STATE]
proof (state)
this:
list_of (\<Union> (f ` (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
have "list_of (\<Union> (f ` I)) = list_of (\<Union> (f ` (insert (Min I) (I - {Min I}))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (\<Union> (f ` I)) = list_of (\<Union> (f ` insert (Min I) (I - {Min I})))
[PROOF STEP]
using Iexp
[PROOF STATE]
proof (prove)
using this:
I = insert (Min I) (I - {Min I})

goal (1 subgoal):
 1. list_of (\<Union> (f ` I)) = list_of (\<Union> (f ` insert (Min I) (I - {Min I})))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_of (\<Union> (f ` I)) = list_of (\<Union> (f ` insert (Min I) (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
list_of (\<Union> (f ` I)) = list_of (\<Union> (f ` insert (Min I) (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
have "\<dots> = list_of (f (Min I) \<union> \<Union> (f ` (I - {Min I})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (\<Union> (f ` insert (Min I) (I - {Min I}))) = list_of (f (Min I) \<union> \<Union> (f ` (I - {Min I})))
[PROOF STEP]
by (metis Union_image_insert)
[PROOF STATE]
proof (state)
this:
list_of (\<Union> (f ` insert (Min I) (I - {Min I}))) = list_of (f (Min I) \<union> \<Union> (f ` (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
list_of (\<Union> (f ` insert (Min I) (I - {Min I}))) = list_of (f (Min I) \<union> \<Union> (f ` (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
have "\<dots> = list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (f (Min I) \<union> \<Union> (f ` (I - {Min I}))) = list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I})))
[PROOF STEP]
proof (rule sorted_list_of_set_Un)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f (Min I) \<lless> \<Union> (f ` (I - {Min I}))
 2. finite (f (Min I))
 3. finite (\<Union> (f ` (I - {Min I})))
[PROOF STEP]
show "f (Min I) \<lless> \<Union> (f ` (I - {Min I}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (Min I) \<lless> \<Union> (f ` (I - {Min I}))
[PROOF STEP]
using Suc.prems \<open>I \<noteq> {}\<close> strict_mono_less_sets_Min
[PROOF STATE]
proof (prove)
using this:
strict_mono_sets I f
finite I
I \<noteq> {}
\<lbrakk>strict_mono_sets ?I ?f; finite ?I; ?I \<noteq> {}\<rbrakk> \<Longrightarrow> ?f (Min ?I) \<lless> \<Union> (?f ` (?I - {Min ?I}))

goal (1 subgoal):
 1. f (Min I) \<lless> \<Union> (f ` (I - {Min I}))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f (Min I) \<lless> \<Union> (f ` (I - {Min I}))

goal (2 subgoals):
 1. finite (f (Min I))
 2. finite (\<Union> (f ` (I - {Min I})))
[PROOF STEP]
show "finite (\<Union> (f ` (I - {Min I})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> (f ` (I - {Min I})))
[PROOF STEP]
by (simp add: \<open>finite I\<close> fin)
[PROOF STATE]
proof (state)
this:
finite (\<Union> (f ` (I - {Min I})))

goal (1 subgoal):
 1. finite (f (Min I))
[PROOF STEP]
qed (use fin in auto)
[PROOF STATE]
proof (state)
this:
list_of (f (Min I) \<union> \<Union> (f ` (I - {Min I}))) = list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
list_of (f (Min I) \<union> \<Union> (f ` (I - {Min I}))) = list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
have "\<dots> = list_of (f (Min I)) @ concat (map (list_of \<circ> f) (list_of (I - {Min I})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I}))) = list_of (f (Min I)) @ concat (map (list_of \<circ> f) (list_of (I - {Min I})))
[PROOF STEP]
using IH
[PROOF STATE]
proof (prove)
using this:
list_of (\<Union> (f ` (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of (I - {Min I})))

goal (1 subgoal):
 1. list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I}))) = list_of (f (Min I)) @ concat (map (list_of \<circ> f) (list_of (I - {Min I})))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I}))) = list_of (f (Min I)) @ concat (map (list_of \<circ> f) (list_of (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
list_of (f (Min I)) @ list_of (\<Union> (f ` (I - {Min I}))) = list_of (f (Min I)) @ concat (map (list_of \<circ> f) (list_of (I - {Min I})))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
have "\<dots> = concat (map (list_of \<circ> f) (list_of I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (f (Min I)) @ concat (map (list_of \<circ> f) (list_of (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
by (simp add: Suc.prems(2) \<open>I \<noteq> {}\<close> sorted_list_of_set_nonempty)
[PROOF STATE]
proof (state)
this:
list_of (f (Min I)) @ concat (map (list_of \<circ> f) (list_of (I - {Min I}))) = concat (map (list_of \<circ> f) (list_of I))

goal (2 subgoals):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
 2. \<And>x I. \<lbrakk>\<And>I. \<lbrakk>x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I)); Suc x = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))

goal (1 subgoal):
 1. list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))

goal (1 subgoal):
 1. \<And>I. \<lbrakk>0 = card I; strict_mono_sets I f; finite I\<rbrakk> \<Longrightarrow> list_of (\<Union> (f ` I)) = concat (map (list_of \<circ> f) (list_of I))
[PROOF STEP]
qed auto


[STATEMENT]
lemma groupF_nequality: "A \<in> set (groupF f xs) \<Longrightarrow> B \<in> set (groupF f xs) \<Longrightarrow> A \<noteq> B \<Longrightarrow>
     \<forall>a \<in> set A. \<forall>b \<in> set B. f a \<noteq> f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> set (groupF f xs); B \<in> set (groupF f xs); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
[PROOF STEP]
proof(induction f xs rule: groupF.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<lbrakk>A \<in> set (groupF f []); B \<in> set (groupF f []); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
 2. \<And>f x xs. \<lbrakk>\<lbrakk>A \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); B \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b; A \<in> set (groupF f (x # xs)); B \<in> set (groupF f (x # xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
A \<in> set (groupF f_ [])
B \<in> set (groupF f_ [])
A \<noteq> B

goal (2 subgoals):
 1. \<And>f. \<lbrakk>A \<in> set (groupF f []); B \<in> set (groupF f []); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
 2. \<And>f x xs. \<lbrakk>\<lbrakk>A \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); B \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b; A \<in> set (groupF f (x # xs)); B \<in> set (groupF f (x # xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
A \<in> set (groupF f_ [])
B \<in> set (groupF f_ [])
A \<noteq> B

goal (1 subgoal):
 1. \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b

goal (1 subgoal):
 1. \<And>f x xs. \<lbrakk>\<lbrakk>A \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); B \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b; A \<in> set (groupF f (x # xs)); B \<in> set (groupF f (x # xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x xs. \<lbrakk>\<lbrakk>A \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); B \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b; A \<in> set (groupF f (x # xs)); B \<in> set (groupF f (x # xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
\<lbrakk>A \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); B \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b
A \<in> set (groupF f_ (x_ # xs_))
B \<in> set (groupF f_ (x_ # xs_))
A \<noteq> B

goal (1 subgoal):
 1. \<And>f x xs. \<lbrakk>\<lbrakk>A \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); B \<in> set (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b; A \<in> set (groupF f (x # xs)); B \<in> set (groupF f (x # xs)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f a \<noteq> f b
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); B \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b
A \<in> set (groupF f_ (x_ # xs_))
B \<in> set (groupF f_ (x_ # xs_))
A \<noteq> B

goal (1 subgoal):
 1. \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>A \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); B \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b; A \<in> set (groupF f_ (x_ # xs_)); B \<in> set (groupF f_ (x_ # xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b
[PROOF STEP]
apply(subst (asm) groupF.simps)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>A \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); B \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b; A \<in> set ((x_ # filter (\<lambda>y. f_ x_ = f_ y) xs_) # groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); B \<in> set ((x_ # filter (\<lambda>y. f_ x_ = f_ y) xs_) # groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b
[PROOF STEP]
using groupF_set
[PROOF STATE]
proof (prove)
using this:
\<forall>X\<in>set (groupF ?f ?xs). \<forall>x\<in>set X. x \<in> set ?xs

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>A \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); B \<in> set (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b; A \<in> set ((x_ # filter (\<lambda>y. f_ x_ = f_ y) xs_) # groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); B \<in> set ((x_ # filter (\<lambda>y. f_ x_ = f_ y) xs_) # groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b

goal:
No subgoals!
[PROOF STEP]
(*1s*)
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set A. \<forall>b\<in>set B. f_ a \<noteq> f_ b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_set_uminus[simp]: "vec_set (-A) = uminus ` vec_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set\<^sub>v (- A) = uminus ` set\<^sub>v A
[PROOF STEP]
unfolding vec_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (- A) ` {..<dim_vec (- A)} = uminus ` ($) A ` {..<dim_vec A}
[PROOF STEP]
by auto


[STATEMENT]
lemma map_of_ls_update:
  "map_of (fst (ls_update k v l)) = (map_of l)(k \<mapsto> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (fst (ls_update k v l)) = map_of l(k \<mapsto> v)
[PROOF STEP]
apply (induct l rule: ls_update.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k v. map_of (fst (ls_update k v [])) = map_of [](k \<mapsto> v)
 2. \<And>k v l w ls. (k \<noteq> l \<Longrightarrow> map_of (fst (ls_update k v ls)) = map_of ls(k \<mapsto> v)) \<Longrightarrow> map_of (fst (ls_update k v ((l, w) # ls))) = map_of ((l, w) # ls)(k \<mapsto> v)
[PROOF STEP]
by (auto simp add: ext Let_def)


[STATEMENT]
lemma cis_opposite_diff_cis [simp]:
  shows "cis (-\<phi>) - cis (\<phi>) = - 2 * \<i> * sin \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (- \<phi>) - cis \<phi> = - 2 * \<i> * cor (sin \<phi>)
[PROOF STEP]
using cis_diff_cis_opposite[of "-\<phi>"]
[PROOF STATE]
proof (prove)
using this:
cis (- \<phi>) - cis (- (- \<phi>)) = 2 * \<i> * cor (sin (- \<phi>))

goal (1 subgoal):
 1. cis (- \<phi>) - cis \<phi> = - 2 * \<i> * cor (sin \<phi>)
[PROOF STEP]
by simp


[STATEMENT]
lemma foldr_does_nothing_to_xf:
  "\<lbrakk> \<And>x s. x \<in> set xs \<Longrightarrow> xf (f x s) = xf s \<rbrakk> \<Longrightarrow> xf (foldr f xs s) = xf s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x s. x \<in> set xs \<Longrightarrow> xf (f x s) = xf s) \<Longrightarrow> xf (foldr f xs s) = xf s
[PROOF STEP]
by (induct xs, simp_all)


[STATEMENT]
lemma Cons_less_Cons [simp]: "list_less (a # x) (b # y) \<longleftrightarrow> a < b \<or> a = b \<and> list_less x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_less (a # x) (b # y) = (a < b \<or> a = b \<and> list_less x y)
[PROOF STEP]
by (simp add: list_less_def)


[STATEMENT]
lemma lagrange_interpolation_poly: assumes dist: "distinct (map fst xs_ys)"
  and p: "p = lagrange_interpolation_poly xs_ys"
  shows "\<And> x y. (x,y) \<in> set xs_ys \<Longrightarrow> poly p x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set xs_ys \<Longrightarrow> poly p x = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set xs_ys \<Longrightarrow> poly p x = y
[PROOF STEP]
let ?xs = "map fst xs_ys"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set xs_ys \<Longrightarrow> poly p x = y
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set xs_ys \<Longrightarrow> poly p x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set xs_ys \<Longrightarrow> poly p x = y
[PROOF STEP]
assume xy: "(x,y) \<in> set xs_ys"
[PROOF STATE]
proof (state)
this:
(x, y) \<in> set xs_ys

goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set xs_ys \<Longrightarrow> poly p x = y
[PROOF STEP]
show "poly p x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p x = y
[PROOF STEP]
unfolding p lagrange_interpolation_poly_def Let_def poly_sum_list map_map o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>xa\<leftarrow>xs_ys. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) = y
[PROOF STEP]
proof (subst sum_list_map_remove1[OF xy], unfold split poly_smult lagrange_basis_poly_1,
      subst sum_list_neutral)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
assume "v \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly ?xs xj))
                               x)
                 (remove1 (x, y) xs_ys))" (is "_ \<in> set (map ?f ?xy)")
[PROOF STATE]
proof (state)
this:
v \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys))

goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys))
[PROOF STEP]
obtain xy' where mem: "xy' \<in> set ?xy" and v: "v = ?f xy'"
[PROOF STATE]
proof (prove)
using this:
v \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys))

goal (1 subgoal):
 1. (\<And>xy'. \<lbrakk>xy' \<in> set (remove1 (x, y) xs_ys); v = poly (case xy' of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xy' \<in> set (remove1 (x, y) xs_ys)
v = poly (case xy' of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x

goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
obtain x' y' where xy': "xy' = (x',y')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x' y'. xy' = (x', y') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
xy' = (x', y')

goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
from v[unfolded this split]
[PROOF STATE]
proof (chain)
picking this:
v = poly (smult y' (lagrange_basis_poly (map fst xs_ys) x')) x
[PROOF STEP]
have v: "v = poly (smult y' (lagrange_basis_poly ?xs x')) x"
[PROOF STATE]
proof (prove)
using this:
v = poly (smult y' (lagrange_basis_poly (map fst xs_ys) x')) x

goal (1 subgoal):
 1. v = poly (smult y' (lagrange_basis_poly (map fst xs_ys) x')) x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v = poly (smult y' (lagrange_basis_poly (map fst xs_ys) x')) x

goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
have neq: "x' \<noteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' \<noteq> x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
assume "x' = x"
[PROOF STATE]
proof (state)
this:
x' = x

goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
with mem[unfolded xy']
[PROOF STATE]
proof (chain)
picking this:
(x', y') \<in> set (remove1 (x, y) xs_ys)
x' = x
[PROOF STEP]
have mem: "(x,y') \<in> set (remove1 (x,y) xs_ys)"
[PROOF STATE]
proof (prove)
using this:
(x', y') \<in> set (remove1 (x, y) xs_ys)
x' = x

goal (1 subgoal):
 1. (x, y') \<in> set (remove1 (x, y) xs_ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x, y') \<in> set (remove1 (x, y) xs_ys)

goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
hence mem': "(x,y') \<in> set xs_ys"
[PROOF STATE]
proof (prove)
using this:
(x, y') \<in> set (remove1 (x, y) xs_ys)

goal (1 subgoal):
 1. (x, y') \<in> set xs_ys
[PROOF STEP]
by (meson notin_set_remove1)
[PROOF STATE]
proof (state)
this:
(x, y') \<in> set xs_ys

goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
from dist[unfolded distinct_map]
[PROOF STATE]
proof (chain)
picking this:
distinct xs_ys \<and> inj_on fst (set xs_ys)
[PROOF STEP]
have inj: "inj_on fst (set xs_ys)"
[PROOF STATE]
proof (prove)
using this:
distinct xs_ys \<and> inj_on fst (set xs_ys)

goal (1 subgoal):
 1. inj_on fst (set xs_ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on fst (set xs_ys)

goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
with mem' xy
[PROOF STATE]
proof (chain)
picking this:
(x, y') \<in> set xs_ys
(x, y) \<in> set xs_ys
inj_on fst (set xs_ys)
[PROOF STEP]
have y': "y' = y"
[PROOF STATE]
proof (prove)
using this:
(x, y') \<in> set xs_ys
(x, y) \<in> set xs_ys
inj_on fst (set xs_ys)

goal (1 subgoal):
 1. y' = y
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
using this:
(x, y') \<in> set xs_ys
(x, y) \<in> set xs_ys
\<forall>x\<in>set xs_ys. \<forall>y\<in>set xs_ys. fst x = fst y \<longrightarrow> x = y

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

goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
from dist
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst xs_ys)
[PROOF STEP]
have "distinct xs_ys"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst xs_ys)

goal (1 subgoal):
 1. distinct xs_ys
[PROOF STEP]
using distinct_map
[PROOF STATE]
proof (prove)
using this:
distinct (map fst xs_ys)
distinct (map ?f ?xs) = (distinct ?xs \<and> inj_on ?f (set ?xs))

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

goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
hence "(x,y) \<notin> set (remove1 (x,y) xs_ys)"
[PROOF STATE]
proof (prove)
using this:
distinct xs_ys

goal (1 subgoal):
 1. (x, y) \<notin> set (remove1 (x, y) xs_ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x, y) \<notin> set (remove1 (x, y) xs_ys)

goal (1 subgoal):
 1. x' = x \<Longrightarrow> False
[PROOF STEP]
with mem[unfolded y']
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> set (remove1 (x, y) xs_ys)
(x, y) \<notin> set (remove1 (x, y) xs_ys)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> set (remove1 (x, y) xs_ys)
(x, y) \<notin> set (remove1 (x, y) xs_ys)

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

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

goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
have "poly (lagrange_basis_poly ?xs x') x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (lagrange_basis_poly (map fst xs_ys) x') x = (0::'a)
[PROOF STEP]
by (rule lagrange_basis_poly_0, insert xy mem[unfolded xy'] dist neq, force+)
[PROOF STATE]
proof (state)
this:
poly (lagrange_basis_poly (map fst xs_ys) x') x = (0::'a)

goal (2 subgoals):
 1. \<And>xa. xa \<in> set (map (\<lambda>xa. poly (case xa of (xj, yj) \<Rightarrow> smult yj (lagrange_basis_poly (map fst xs_ys) xj)) x) (remove1 (x, y) xs_ys)) \<Longrightarrow> xa = (0::'a)
 2. y * (1::'a) + (0::'a) = y
[PROOF STEP]
thus "v = 0"
[PROOF STATE]
proof (prove)
using this:
poly (lagrange_basis_poly (map fst xs_ys) x') x = (0::'a)

goal (1 subgoal):
 1. v = (0::'a)
[PROOF STEP]
unfolding v
[PROOF STATE]
proof (prove)
using this:
poly (lagrange_basis_poly (map fst xs_ys) x') x = (0::'a)

goal (1 subgoal):
 1. poly (smult y' (lagrange_basis_poly (map fst xs_ys) x')) x = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v = (0::'a)

goal (1 subgoal):
 1. y * (1::'a) + (0::'a) = y
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
poly p x = y

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?x2, ?y2) \<in> set xs_ys \<Longrightarrow> poly p ?x2 = ?y2

goal:
No subgoals!
[PROOF STEP]
note sound = this
[PROOF STATE]
proof (state)
this:
(?x2, ?y2) \<in> set xs_ys \<Longrightarrow> poly p ?x2 = ?y2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjuncts_list_nFAND:
  "\<lbrakk>list_all (\<lambda>x. \<not> is_FAnd x) \<phi>s; \<phi>s \<noteq> []\<rbrakk> \<Longrightarrow> conjuncts_list (nFAND \<phi>s) = \<phi>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all (\<lambda>x. \<not> is_FAnd x) \<phi>s; \<phi>s \<noteq> []\<rbrakk> \<Longrightarrow> conjuncts_list (nFAND \<phi>s) = \<phi>s
[PROOF STEP]
by (induct \<phi>s rule: nFAND.induct) (auto simp: juncts_list_singleton)


[STATEMENT]
lemma has_vector_derivative_transform_within_open:
  assumes "(f has_vector_derivative f') (at x)"
    and "open S"
    and "x \<in> S"
    and "\<And>y. y\<in>S \<Longrightarrow> f y = g y"
  shows "(g has_vector_derivative f') (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_vector_derivative f') (at x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_vector_derivative f') (at x)
open S
x \<in> S
?y \<in> S \<Longrightarrow> f ?y = g ?y

goal (1 subgoal):
 1. (g has_vector_derivative f') (at x)
[PROOF STEP]
unfolding has_vector_derivative_def
[PROOF STATE]
proof (prove)
using this:
(f has_derivative (\<lambda>x. x *\<^sub>R f')) (at x)
open S
x \<in> S
?y \<in> S \<Longrightarrow> f ?y = g ?y

goal (1 subgoal):
 1. (g has_derivative (\<lambda>x. x *\<^sub>R f')) (at x)
[PROOF STEP]
by (rule has_derivative_transform_within_open)


[STATEMENT]
lemma compl_inter_eq:
  "x \<sqinter> y = x \<sqinter> z \<Longrightarrow> -x \<sqinter> y = -x \<sqinter> z \<Longrightarrow> y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqinter> y = x \<sqinter> z; - x \<sqinter> y = - x \<sqinter> z\<rbrakk> \<Longrightarrow> y = z
[PROOF STEP]
by (metis inf_commute maddux_3_11)


[STATEMENT]
lemma hom_one:
  assumes "h \<in> hom G H" "group G" "group H"
  shows "h (one G) = one H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<one>\<^bsub>G\<^esub> = \<one>\<^bsub>H\<^esub>
[PROOF STEP]
apply (rule group_hom.hom_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom G H h
[PROOF STEP]
by (simp add: assms group_hom_axioms_def group_hom_def)


[STATEMENT]
lemma rank_removed:
    assumes "finite (nodes A)" "w \<notin> language A"
    shows "v \<notin> graph A w (Suc (rank A w v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> graph A w (Suc (rank A w v))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<in> graph A w (Suc (rank A w v)) \<Longrightarrow> False
[PROOF STEP]
assume "v \<in> graph A w (Suc (rank A w v))"
[PROOF STATE]
proof (state)
this:
v \<in> graph A w (Suc (rank A w v))

goal (1 subgoal):
 1. v \<in> graph A w (Suc (rank A w v)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> graph A w (Suc (rank A w v))
[PROOF STEP]
have 2: "Suc (rank A w v) \<le> rank A w v"
[PROOF STATE]
proof (prove)
using this:
v \<in> graph A w (Suc (rank A w v))

goal (1 subgoal):
 1. Suc (rank A w v) \<le> rank A w v
[PROOF STEP]
unfolding rank_def
[PROOF STATE]
proof (prove)
using this:
v \<in> graph A w (Suc (GREATEST k. v \<in> graph A w k))

goal (1 subgoal):
 1. Suc (GREATEST k. v \<in> graph A w k) \<le> (GREATEST k. v \<in> graph A w k)
[PROOF STEP]
using Greatest_le_nat graph_le assms
[PROOF STATE]
proof (prove)
using this:
v \<in> graph A w (Suc (GREATEST k. v \<in> graph A w k))
\<lbrakk>?P ?k; \<And>y. ?P y \<Longrightarrow> y \<le> ?b\<rbrakk> \<Longrightarrow> ?k \<le> Greatest ?P
\<lbrakk>finite (nodes ?A); ?w \<notin> language ?A; ?v \<in> graph ?A ?w ?k\<rbrakk> \<Longrightarrow> ?k \<le> 2 * card (nodes ?A)
finite (nodes A)
w \<notin> language A

goal (1 subgoal):
 1. Suc (GREATEST k. v \<in> graph A w k) \<le> (GREATEST k. v \<in> graph A w k)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Suc (rank A w v) \<le> rank A w v

goal (1 subgoal):
 1. v \<in> graph A w (Suc (rank A w v)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (rank A w v) \<le> rank A w v
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
Suc (rank A w v) \<le> rank A w v

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma n_sum_last_lt:
  fixes l::"'a::{comm_monoid_add, ordered_cancel_ab_semigroup_add} list"
  assumes "j < l!i"
  and "i < length l"
  shows "n_sum i l + j < n_sum (Suc i) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_sum i l + j < n_sum (Suc i) l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n_sum i l + j < n_sum (Suc i) l
[PROOF STEP]
have "n_sum i l + j < n_sum i l + l!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_sum i l + j < n_sum i l + l ! i
[PROOF STEP]
using assms add_strict_left_mono[of j "l!i"]
[PROOF STATE]
proof (prove)
using this:
j < l ! i
i < length l
j < l ! i \<Longrightarrow> ?c + j < ?c + l ! i

goal (1 subgoal):
 1. n_sum i l + j < n_sum i l + l ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n_sum i l + j < n_sum i l + l ! i

goal (1 subgoal):
 1. n_sum i l + j < n_sum (Suc i) l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n_sum i l + j < n_sum i l + l ! i

goal (1 subgoal):
 1. n_sum i l + j < n_sum (Suc i) l
[PROOF STEP]
have "... = n_sum (Suc i) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_sum i l + l ! i = n_sum (Suc i) l
[PROOF STEP]
using n_sum_last[of i l] assms
[PROOF STATE]
proof (prove)
using this:
i < length l \<Longrightarrow> n_sum (Suc i) l = n_sum i l + l ! i
j < l ! i
i < length l

goal (1 subgoal):
 1. n_sum i l + l ! i = n_sum (Suc i) l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n_sum i l + l ! i = n_sum (Suc i) l

goal (1 subgoal):
 1. n_sum i l + j < n_sum (Suc i) l
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n_sum i l + j < n_sum (Suc i) l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n_sum i l + j < n_sum (Suc i) l

goal (1 subgoal):
 1. n_sum i l + j < n_sum (Suc i) l
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n_sum i l + j < n_sum (Suc i) l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_kernel_smult: assumes A: "A \<in> carrier_mat nr nc"
  and v: "v \<in> mat_kernel A"
  shows "a \<cdot>\<^sub>v v \<in>  mat_kernel A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
from mat_kernelD[OF A v]
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec nc
A *\<^sub>v v = 0\<^sub>v nr
[PROOF STEP]
have v: "v \<in> carrier_vec nc"
    and z: "A *\<^sub>v v = 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec nc
A *\<^sub>v v = 0\<^sub>v nr

goal (1 subgoal):
 1. v \<in> carrier_vec nc &&& A *\<^sub>v v = 0\<^sub>v nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec nc
A *\<^sub>v v = 0\<^sub>v nr

goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
from arg_cong[OF z, of "\<lambda> v. a \<cdot>\<^sub>v v"] v
[PROOF STATE]
proof (chain)
picking this:
a \<cdot>\<^sub>v (A *\<^sub>v v) = a \<cdot>\<^sub>v 0\<^sub>v nr
v \<in> carrier_vec nc
[PROOF STEP]
have "a \<cdot>\<^sub>v (A *\<^sub>v v) = 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
a \<cdot>\<^sub>v (A *\<^sub>v v) = a \<cdot>\<^sub>v 0\<^sub>v nr
v \<in> carrier_vec nc

goal (1 subgoal):
 1. a \<cdot>\<^sub>v (A *\<^sub>v v) = 0\<^sub>v nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v (A *\<^sub>v v) = 0\<^sub>v nr

goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v (A *\<^sub>v v) = 0\<^sub>v nr

goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
have "a \<cdot>\<^sub>v (A *\<^sub>v v) = A *\<^sub>v (a \<cdot>\<^sub>v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot>\<^sub>v (A *\<^sub>v v) = A *\<^sub>v (a \<cdot>\<^sub>v v)
[PROOF STEP]
using A v
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
v \<in> carrier_vec nc

goal (1 subgoal):
 1. a \<cdot>\<^sub>v (A *\<^sub>v v) = A *\<^sub>v (a \<cdot>\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v (A *\<^sub>v v) = A *\<^sub>v (a \<cdot>\<^sub>v v)

goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v (a \<cdot>\<^sub>v v) = 0\<^sub>v nr
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v (a \<cdot>\<^sub>v v) = 0\<^sub>v nr

goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
using v A
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v (a \<cdot>\<^sub>v v) = 0\<^sub>v nr
v \<in> carrier_vec nc
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. a \<cdot>\<^sub>v v \<in> mat_kernel A
[PROOF STEP]
by (intro mat_kernelI, auto)
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v v \<in> mat_kernel A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eint_add_mono:
  assumes "(a::eint) \<le> b"
  assumes "(c::eint) \<le> d"
  shows "a + c \<le> b + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + c \<le> b + d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
c \<le> d

goal (1 subgoal):
 1. a + c \<le> b + d
[PROOF STEP]
by (simp add: add_mono)


[STATEMENT]
lemma finite_ImageI:
    assumes "finite A"
    assumes "\<And>a. a\<in>A \<Longrightarrow> finite (R``{a})"
    shows "finite (R``A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
note [[simproc add: finite_Collect]]
[PROOF STATE]
proof (state)
this:
TERM _

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
have "R``A = \<Union>{R``{a} | a. a:A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` A = \<Union> {R `` {a} |a. a \<in> A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R `` A = \<Union> {R `` {a} |a. a \<in> A}

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R `` A = \<Union> {R `` {a} |a. a \<in> A}

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
have "finite (\<Union>{R``{a} | a. a:A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> {R `` {a} |a. a \<in> A})
[PROOF STEP]
apply (rule finite_Union)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {R `` {a} |a. a \<in> A}
 2. \<And>M. M \<in> {R `` {a} |a. a \<in> A} \<Longrightarrow> finite M
[PROOF STEP]
apply (simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>M. M \<in> {R `` {a} |a. a \<in> A} \<Longrightarrow> finite M
[PROOF STEP]
apply (clarsimp simp: assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
finite (\<Union> {R `` {a} |a. a \<in> A})

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finite (R `` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (R `` A)

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite (R `` A)

goal:
No subgoals!
[PROOF STEP]
qed