[STATEMENT]
lemma fMax_less_Length[simp]: "x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> fMax (m1\<^bsup>\<AA>\<^esup>k) < Length \<AA>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> fMax (m1\<^bsup>\<AA>\<^esup>k) < Length \<AA>
[PROOF STEP]
by transfer
    (force elim: order.strict_trans2[OF MSB_greater, rotated -1] intro: fMax_in split: order.splits)


[STATEMENT]
lemma resolutionI : "partition_on_mset \<B> P \<Longrightarrow> (\<And> S . S \<in>#P \<Longrightarrow> distinct_mset S) \<Longrightarrow>
    (\<And> S . S\<in># P \<Longrightarrow> resolution_class (set_mset S)) \<Longrightarrow> resolution P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>partition_on_mset \<B> P; \<And>S. S \<in># P \<Longrightarrow> distinct_mset S; \<And>S. S \<in># P \<Longrightarrow> resolution_class (set_mset S)\<rbrakk> \<Longrightarrow> resolution P
[PROOF STEP]
by (simp add: resolution_def)


[STATEMENT]
lemma VLambda_vdoubleton(*not simp*):
  "(\<lambda>a\<in>\<^sub>\<circ>set {a, b}. f a) = set {\<langle>a, f a\<rangle>, \<langle>b, f b\<rangle>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda (set {a, b}) f = set {\<langle>a, f a\<rangle>, \<langle>b, f b\<rangle>}
[PROOF STEP]
by (auto simp: vinsert_set_insert_eq)


[STATEMENT]
lemma open_exceptI:
  assumes "(x::'b::{t1_space}) \<noteq> y"
  shows "open (open_except x y)" and "x\<in> open_except x y" and  "y\<notin> open_except x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (open_except x y) &&& x \<in> open_except x y &&& y \<notin> open_except x y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
have ex:"\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
using \<open>x\<noteq> y\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
by (simp add:t1_space)
[PROOF STATE]
proof (state)
this:
\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U

goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
let ?V = "SOME A. open A \<and> x\<in> A \<and> y\<notin> A"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
have vprop: "open ?V \<and> x \<in> ?V \<and> y \<notin> ?V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> x \<in> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> y \<notin> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A)
[PROOF STEP]
using someI_ex[of "\<lambda>U. open U \<and> x \<in> U \<and> y \<notin> U"] ex
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. open xa \<and> x \<in> xa \<and> y \<notin> xa \<Longrightarrow> open (SOME xa. open xa \<and> x \<in> xa \<and> y \<notin> xa) \<and> x \<in> (SOME xa. open xa \<and> x \<in> xa \<and> y \<notin> xa) \<and> y \<notin> (SOME xa. open xa \<and> x \<in> xa \<and> y \<notin> xa)
\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U

goal (1 subgoal):
 1. open (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> x \<in> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> y \<notin> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
open (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> x \<in> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A) \<and> y \<notin> (SOME A. open A \<and> x \<in> A \<and> y \<notin> A)

goal (3 subgoals):
 1. open (open_except x y)
 2. x \<in> open_except x y
 3. y \<notin> open_except x y
[PROOF STEP]
show "open (open_except x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (open_except x y)
[PROOF STEP]
by (simp add: open_except_def vprop)
[PROOF STATE]
proof (state)
this:
open (open_except x y)

goal (2 subgoals):
 1. x \<in> open_except x y
 2. y \<notin> open_except x y
[PROOF STEP]
show "x\<in> open_except x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> open_except x y
[PROOF STEP]
by (metis (full_types) open_except_def vprop)
[PROOF STATE]
proof (state)
this:
x \<in> open_except x y

goal (1 subgoal):
 1. y \<notin> open_except x y
[PROOF STEP]
show "y\<notin> open_except x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<notin> open_except x y
[PROOF STEP]
by (metis (full_types) open_except_def vprop)
[PROOF STATE]
proof (state)
this:
y \<notin> open_except x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_add_le_mono2:
  fixes i :: "'a :: len word"
  shows "\<lbrakk>i \<le> j; unat j + unat k < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> k + i \<le> k + j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; unat j + unat k < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> k + i \<le> k + j
[PROOF STEP]
by (subst field_simps, subst field_simps, erule (1) word_add_le_mono1)


[STATEMENT]
lemma in_GSMP_in_proj: "t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) \<Longrightarrow> \<exists>n. t \<in> GSMP (trms_proj\<^sub>l\<^sub>s\<^sub>t n A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) \<Longrightarrow> \<exists>n. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj n A))
[PROOF STEP]
using GSMP_Union[of A]
[PROOF STATE]
proof (prove)
using this:
GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) = (\<Union>l. GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj l A)))

goal (1 subgoal):
 1. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) \<Longrightarrow> \<exists>n. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj n A))
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_imp_fip:
  fixes S :: "'a::heine_borel set"
  assumes "closed S"
      and T: "T \<in> \<F>" "bounded T"
      and clof: "\<And>T. T \<in> \<F> \<Longrightarrow> closed T"
      and none: "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> \<Inter>\<F>' \<noteq> {}"
    shows "S \<inter> \<Inter>\<F> \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
have "compact (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (S \<inter> T)
[PROOF STEP]
using \<open>closed S\<close> clof compact_eq_bounded_closed T
[PROOF STATE]
proof (prove)
using this:
closed S
?T \<in> \<F> \<Longrightarrow> closed ?T
compact ?S = (bounded ?S \<and> closed ?S)
T \<in> \<F>
bounded T

goal (1 subgoal):
 1. compact (S \<inter> T)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
compact (S \<inter> T)

goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compact (S \<inter> T)
[PROOF STEP]
have "(S \<inter> T) \<inter> \<Inter>\<F> \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
compact (S \<inter> T)

goal (1 subgoal):
 1. S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
apply (rule compact_imp_fip)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>T. T \<in> \<F> \<Longrightarrow> closed T
 2. \<And>F'. \<lbrakk>finite F'; F' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> T \<inter> \<Inter> F' \<noteq> {}
[PROOF STEP]
apply (simp add: clof)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>F'. \<lbrakk>finite F'; F' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> T \<inter> \<Inter> F' \<noteq> {}
[PROOF STEP]
by (metis Int_assoc complete_lattice_class.Inf_insert finite_insert insert_subset none \<open>T \<in> \<F>\<close>)
[PROOF STATE]
proof (state)
this:
S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<inter> T \<inter> \<Inter> \<F> \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S \<inter> \<Inter> \<F> \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zmset_empty_image_zmset_empty: "(\<And>t. zcount M t = 0) \<Longrightarrow> zcount (image_zmset f M) t = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. zcount M t = 0) \<Longrightarrow> zcount (Auxiliary.image_zmset f M) t = 0
[PROOF STEP]
by (auto simp: zcount_image_zmset)


[STATEMENT]
lemma probGn_le:
  assumes p_prob: "0 < p n" "p n < 1"
  assumes sub: "\<And>n es. es \<in> space (MGn p n) \<Longrightarrow> P n es \<Longrightarrow> Q n es"
  shows "probGn p n (P n) \<le> probGn p n (Q n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. probGn p n (P n) \<le> probGn p n (Q n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. probGn p n (P n) \<le> probGn p n (Q n)
[PROOF STEP]
from p_prob
[PROOF STATE]
proof (chain)
picking this:
0 < p n
p n < 1
[PROOF STEP]
interpret E: edge_space n "p n"
[PROOF STATE]
proof (prove)
using this:
0 < p n
p n < 1

goal (1 subgoal):
 1. edge_space (p n)
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. E.prob {es \<in> space E.P. P n es} \<le> E.prob {es \<in> space E.P. Q n es}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E.prob {es \<in> space E.P. P n es} \<le> E.prob {es \<in> space E.P. Q n es}
[PROOF STEP]
by (auto intro!: E.finite_measure_mono sub simp: E.space_eq E.sets_eq)
[PROOF STATE]
proof (state)
this:
E.prob {es \<in> space E.P. P n es} \<le> E.prob {es \<in> space E.P. Q n es}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cube_in_cball:
  fixes x y :: "'a::euclidean_space"
  assumes "r > 0"
  assumes "\<And>i. i\<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt(DIM('a))"
  shows "y \<in> cball x r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> cball x r
[PROOF STEP]
unfolding mem_cball euclidean_dist_l2[of x y] L2_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
have "(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>(i::'a)\<in>Basis. (r / sqrt(DIM('a)))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
[PROOF STEP]
proof (intro sum_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
fix i :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
assume "i \<in> Basis"
[PROOF STATE]
proof (state)
this:
i \<in> Basis

goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
thus "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt(DIM('a)))\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis

goal (1 subgoal):
 1. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis
0 < r
?i \<in> Basis \<Longrightarrow> dist (x \<bullet> ?i) (y \<bullet> ?i) \<le> r / sqrt (real DIM('a))

goal (1 subgoal):
 1. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2
[PROOF STEP]
by (auto intro: sqrt_le_D)
[PROOF STATE]
proof (state)
this:
(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 \<le> (r / sqrt (real DIM('a)))\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
have "... \<le> r\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < r
?i \<in> Basis \<Longrightarrow> dist (x \<bullet> ?i) (y \<bullet> ?i) \<le> r / sqrt (real DIM('a))

goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
[PROOF STEP]
by (simp add: power_divide)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
[PROOF STEP]
show "sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> (\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2)
(\<Sum>i\<in>Basis. (r / sqrt (real DIM('a)))\<^sup>2) \<le> r\<^sup>2
0 < r
?i \<in> Basis \<Longrightarrow> dist (x \<bullet> ?i) (y \<bullet> ?i) \<le> r / sqrt (real DIM('a))

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r
[PROOF STEP]
by (auto intro!: real_le_lsqrt sum_nonneg)
[PROOF STATE]
proof (state)
this:
sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2) \<le> r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma H_var1: "H p x q \<longleftrightarrow> t p \<cdot> x \<cdot> n q = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H p x q = (t p \<cdot> x \<cdot> !q = (0::'a))
[PROOF STEP]
by (metis H_def n_kat_3 t_n_closed)


[STATEMENT]
lemma eq_fin_le_fininf_transp[intro, trans]:
      assumes "w\<^sub>1 =\<^sub>F w\<^sub>2" "w\<^sub>2 \<preceq>\<^sub>F\<^sub>I w\<^sub>3"
      shows "w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 =\<^sub>F w\<^sub>2
w\<^sub>2 \<preceq>\<^sub>F\<^sub>I w\<^sub>3

goal (1 subgoal):
 1. w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3
[PROOF STEP]
by blast


[STATEMENT]
lemma sqrt_leI:
  "(\<And>z. z^2 \<le> y \<Longrightarrow> z \<le> x) \<Longrightarrow> Discrete.sqrt y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. z\<^sup>2 \<le> y \<Longrightarrow> z \<le> x) \<Longrightarrow> local.sqrt y \<le> x
[PROOF STEP]
by (simp add: sqrt_le_iff)


[STATEMENT]
lemma emeasure_count_space_eq_0:
  "emeasure (count_space A) X = 0 \<longleftrightarrow> (X \<subseteq> A \<longrightarrow> X = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
 2. \<not> ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
assume X: "X \<subseteq> A"
[PROOF STATE]
proof (state)
this:
X \<subseteq> A

goal (2 subgoals):
 1. ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
 2. \<not> ?P \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> A

goal (1 subgoal):
 1. (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
proof (intro iffI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>X \<subseteq> A; emeasure (count_space A) X = 0; X \<subseteq> A\<rbrakk> \<Longrightarrow> X = {}
 2. \<lbrakk>X \<subseteq> A; X \<subseteq> A \<longrightarrow> X = {}\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = 0
[PROOF STEP]
assume "emeasure (count_space A) X = 0"
[PROOF STATE]
proof (state)
this:
emeasure (count_space A) X = 0

goal (2 subgoals):
 1. \<lbrakk>X \<subseteq> A; emeasure (count_space A) X = 0; X \<subseteq> A\<rbrakk> \<Longrightarrow> X = {}
 2. \<lbrakk>X \<subseteq> A; X \<subseteq> A \<longrightarrow> X = {}\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = 0
[PROOF STEP]
with X
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> A
emeasure (count_space A) X = 0
[PROOF STEP]
show "X = {}"
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> A
emeasure (count_space A) X = 0

goal (1 subgoal):
 1. X = {}
[PROOF STEP]
by (subst (asm) emeasure_count_space) (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
X = {}

goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> A; X \<subseteq> A \<longrightarrow> X = {}\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = 0
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
(emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})

goal (1 subgoal):
 1. \<not> X \<subseteq> A \<Longrightarrow> (emeasure (count_space A) X = 0) = (X \<subseteq> A \<longrightarrow> X = {})
[PROOF STEP]
qed (simp add: emeasure_notin_sets)


[STATEMENT]
lemma space_EXP: "space EXP = measurable COCOUNT BOOL"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
have "f \<in> space EXP \<longleftrightarrow> (\<lambda>(a, b). f b) \<in> measurable (POW \<Otimes>\<^sub>M COCOUNT) BOOL"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
using eq[of "\<lambda>x. f"]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>(x, y). f y) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL) = ((\<lambda>x. f) \<in> POW \<rightarrow>\<^sub>M EXP)

goal (1 subgoal):
 1. (f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
by (simp add: measurable_const_iff)
[PROOF STATE]
proof (state)
this:
(f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<in> space EXP) = ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
have "\<dots> \<longleftrightarrow> f \<in> measurable COCOUNT BOOL"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>(a, b). f b) \<in> POW \<Otimes>\<^sub>M COCOUNT \<rightarrow>\<^sub>M BOOL) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
have "f \<in> space EXP \<longleftrightarrow> f \<in> measurable COCOUNT BOOL"
[PROOF STATE]
proof (prove)
using this:
(f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. (f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<in> space EXP) = (f \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?f2 \<in> space EXP) = (?f2 \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?f2 \<in> space EXP) = (?f2 \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(?f2 \<in> space EXP) = (?f2 \<in> COCOUNT \<rightarrow>\<^sub>M BOOL)

goal (1 subgoal):
 1. space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
space EXP = COCOUNT \<rightarrow>\<^sub>M BOOL

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_on_inv_vreal_of_real_impl:
  "inj_on (inv vreal_of_real_impl) (range vreal_of_real_impl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (inv vreal_of_real_impl) (range vreal_of_real_impl)
[PROOF STEP]
by (intro inj_onI) (fastforce intro: inv_into_injective)


[STATEMENT]
lemma remove_indices_decomp:
"m = (restrict_to_indices m S) + (remove_indices m S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = restrict_to_indices m S + remove_indices m S
[PROOF STEP]
unfolding remove_indices_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = restrict_to_indices m S + restrict_to_indices m (set_mset m - S)
[PROOF STEP]
using restrict_to_indices_decomp
[PROOF STATE]
proof (prove)
using this:
?m = restrict_to_indices ?m ?S + restrict_to_indices ?m (set_mset ?m - ?S)

goal (1 subgoal):
 1. m = restrict_to_indices m S + restrict_to_indices m (set_mset m - S)
[PROOF STEP]
by blast


[STATEMENT]
lemma ODordTr1:" \<lbrakk>Worder D; Worder E\<rbrakk> \<Longrightarrow>
       (ODord (ordinal_number D) (ordinal_number E)) =
       (\<exists>b\<in> carrier E. ord_equiv D (Iod E (segment E b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; Worder E\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E = (\<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b)))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Worder D; Worder E; ordinal_number D \<sqsubset> ordinal_number E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (simp add:ODord_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Worder D; Worder E; \<exists>x\<in>ordinal_number D. \<exists>y\<in>ordinal_number E. \<exists>c\<in>carrier y. ord_equiv x (Iod y (segment y c))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply ((erule bexE)+, simp add:ordinal_number_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y c. \<lbrakk>Worder D; Worder E; c \<in> carrier y; ord_equiv x (Iod y (segment y c)); Worder x; ord_equiv x D; Worder y; ord_equiv y E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (rename_tac X Y c)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac S = Y and T = E in Worder_ord_equivTr, assumption,
       simp, erule exE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac D = Y in Worder.Order,
       frule_tac D = E in Worder.Order,
       frule_tac D = Y and E = E and f = f and a = c in
                 Order.ord_isom_segment_segment, assumption+,
       frule_tac S = Y and T = E and f = f and a = c in
                 Worder_ord_isom_mem, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (cut_tac D = Y and a = c in Worder.segment_Worder, assumption,
       cut_tac D = E and a = "f c" in Worder.segment_Worder, assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac S1 = "Iod Y (segment Y c)" and T1 = "Iod E (segment E (f c))"
       in Worder_ord_equivTr[THEN sym], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; ord_equiv X D; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (frule_tac S = X and T = D in Worder_sym, assumption+,
       thin_tac "ord_equiv X D",
       frule_tac S = D and T = X and U = "Iod Y (segment Y c)" in
                 Worder_trans, assumption+,
       frule_tac S = D and T = "Iod Y (segment Y c)" and
           U = "Iod E (segment E (f c))" in Worder_trans, assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c))); ord_equiv D X; ord_equiv D (Iod Y (segment Y c))\<rbrakk> \<Longrightarrow> ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c)))
 2. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c))); ord_equiv D X; ord_equiv D (Iod Y (segment Y c)); ord_equiv D (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 3. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X Y c f. \<lbrakk>Worder D; Worder E; c \<in> carrier Y; ord_equiv X (Iod Y (segment Y c)); Worder X; Worder Y; ord_equiv Y E; ord_isom Y E f; Order Y; Order E; ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) (restrict f (carrier (Iod Y (segment Y c)))); f c \<in> carrier E; Worder (Iod Y (segment Y c)); Worder (Iod E (segment E (f c))); (\<exists>fa. ord_isom (Iod Y (segment Y c)) (Iod E (segment E (f c))) fa) = ord_equiv (Iod Y (segment Y c)) (Iod E (segment E (f c))); ord_equiv D X; ord_equiv D (Iod Y (segment Y c)); ord_equiv D (Iod E (segment E (f c)))\<rbrakk> \<Longrightarrow> \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))
 2. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> ordinal_number D \<sqsubset> ordinal_number E
[PROOF STEP]
apply (simp add:ODord_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; Worder E; \<exists>b\<in>carrier E. ord_equiv D (Iod E (segment E b))\<rbrakk> \<Longrightarrow> \<exists>x\<in>ordinal_number D. \<exists>y\<in>ordinal_number E. \<exists>c\<in>carrier y. ord_equiv x (Iod y (segment y c))
[PROOF STEP]
apply (frule ordinal_inc_self[of "D"],
       frule ordinal_inc_self[of "E"], blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inverse_e1 [simp]: "inverse e1 = -e1"
  and inverse_e2 [simp]: "inverse e2 = -e2"
  and inverse_e3 [simp]: "inverse e3 = -e3"
  and inverse_e4 [simp]: "inverse e4 = -e4"
  and inverse_e5 [simp]: "inverse e5 = -e5"
  and inverse_e6 [simp]: "inverse e6 = -e6"
  and inverse_e7 [simp]: "inverse e7 = -e7"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inverse e1 = - e1 &&& inverse e2 = - e2 &&& inverse e3 = - e3) &&& (inverse e4 = - e4 &&& inverse e5 = - e5) &&& inverse e6 = - e6 &&& inverse e7 = - e7
[PROOF STEP]
by (simp_all add: octo_eq_iff)


[STATEMENT]
lemma pdevs_val_pdevs_of_list_eq[simp]:
  "pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e o (+) 1) (pdevs_of_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "pdevs_val e (pdevs_of_list (x # xs)) =
    (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) +
    (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}.
      e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))"
    (is "_ = ?l + ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) + (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))
[PROOF STEP]
by (simp add: pdevs_val_pdevs_domain if_distrib sum.If_cases pdevs_apply_pdevs_of_list_Cons)
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list (x # xs)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) + (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list (x # xs)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) + (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0))

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "?r = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)
[PROOF STEP]
by (rule sum.reindex_cong[of "\<lambda>i. i + 1"]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> - {0}. e i *\<^sub>R pdevs_apply (pdevs_of_list xs) (i - Suc 0)) = (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "\<dots> = pdevs_val (e o (+) 1) (pdevs_of_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i) = pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
by (simp add: pdevs_val_pdevs_domain  )
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i) = pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list xs). e (Suc i) *\<^sub>R pdevs_apply (pdevs_of_list xs) i) = pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "?l = (\<Sum>i\<in>{0}. e i *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) = (\<Sum>i\<in>{0}. e i *\<^sub>R x)
[PROOF STEP]
by (rule sum.mono_neutral_cong_left) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) = (\<Sum>i\<in>{0}. e i *\<^sub>R x)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>pdevs_domain (pdevs_of_list (x # xs)) \<inter> {0}. e i *\<^sub>R x) = (\<Sum>i\<in>{0}. e i *\<^sub>R x)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
have "\<dots> = e 0 *\<^sub>R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{0}. e i *\<^sub>R x) = e 0 *\<^sub>R x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0}. e i *\<^sub>R x) = e 0 *\<^sub>R x

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list (x # xs)) = e 0 *\<^sub>R x + pdevs_val (e \<circ> (+) 1) (pdevs_of_list xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dual_der1: "\<C>\<^sub>D \<D> \<equiv> (\<I>\<^sub>D \<D>)\<^sup>d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<C>\<^sub>D \<D> \<equiv> \<I>\<^sub>D \<D>\<^sup>d
[PROOF STEP]
unfolding Cl_der_def Int_der_def dual_def conn
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lambda>A w. A w \<or> \<D> A w \<equiv> \<lambda>X w. \<not> (\<not> X w \<and> \<not> \<D> (\<lambda>w. \<not> \<not> X w) w)
[PROOF STEP]
by simp


[STATEMENT]
lemma int_step_then_rat_poly_step :
  assumes Some:"Some (a1,a2) = div_int_poly_step q b (Some (c1,c2))"
  shows "(rp a1,rp a2) = (div_rat_poly_step (rp q) \<circ> rat_of_int) b (rp c1,rp c2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
note simps = div_int_poly_step_def option.simps Let_def divmod_int_def prod.simps
[PROOF STATE]
proof (state)
this:
div_int_poly_step ?q = (\<lambda>a sro. case sro of None \<Rightarrow> None | Some (s, r) \<Rightarrow> let ar = pCons a r; (b, m) = divmod_int (coeff ar (degree ?q)) (lead_coeff ?q) in if m = 0 then Some (pCons b s, ar - smult b ?q) else None)
(Some ?x2.0 = Some ?y2.0) = (?x2.0 = ?y2.0)
None \<noteq> Some ?x2.0
Some ?x2.0 \<noteq> None
(case None of None \<Rightarrow> ?f1.0 | Some x \<Rightarrow> ?f2.0 x) = ?f1.0
(case Some ?x2.0 of None \<Rightarrow> ?f1.0 | Some x \<Rightarrow> ?f2.0 x) = ?f2.0 ?x2.0
rec_option ?f1.0 ?f2.0 None = ?f1.0
rec_option ?f1.0 ?f2.0 (Some ?x2.0) = ?f2.0 ?x2.0
map_option ?f None = None
map_option ?f (Some ?x2.0) = Some (?f ?x2.0)
rel_option ?R None None
rel_option ?R (Some ?x2.0) (Some ?y2.0) = ?R ?x2.0 ?y2.0
\<not> rel_option ?R None (Some ?y2.0)
\<not> rel_option ?R (Some ?y2.0) None
set_option None = {}
set_option (Some ?x2.0) = {?x2.0}
Let ?s ?f \<equiv> ?f ?s
divmod_int ?n ?m = (?n div ?m, ?n mod ?m)
((?x1.0, ?x2.0) = (?y1.0, ?y2.0)) = (?x1.0 = ?y1.0 \<and> ?x2.0 = ?y2.0)
(case (?x1.0, ?x2.0) of (x, xa) \<Rightarrow> ?f x xa) = ?f ?x1.0 ?x2.0
old.rec_prod ?f1.0 (?a, ?b) = ?f1.0 ?a ?b

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
from Some[unfolded simps]
[PROOF STATE]
proof (chain)
picking this:
Some (a1, a2) = (if coeff (pCons b c2) (degree q) mod lead_coeff q = 0 then Some (pCons (coeff (pCons b c2) (degree q) div lead_coeff q) c1, pCons b c2 - smult (coeff (pCons b c2) (degree q) div lead_coeff q) q) else None)
[PROOF STEP]
have mod0: "coeff (pCons b c2) (degree q) mod coeff q (degree q) = 0"
[PROOF STATE]
proof (prove)
using this:
Some (a1, a2) = (if coeff (pCons b c2) (degree q) mod lead_coeff q = 0 then Some (pCons (coeff (pCons b c2) (degree q) div lead_coeff q) c1, pCons b c2 - smult (coeff (pCons b c2) (degree q) div lead_coeff q) q) else None)

goal (1 subgoal):
 1. coeff (pCons b c2) (degree q) mod lead_coeff q = 0
[PROOF STEP]
by (auto split: option.splits prod.splits if_splits)
[PROOF STATE]
proof (state)
this:
coeff (pCons b c2) (degree q) mod lead_coeff q = 0

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff (pCons b c2) (degree q) mod lead_coeff q = 0

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
using assms rat_int_poly_step_agree
[PROOF STATE]
proof (prove)
using this:
coeff (pCons b c2) (degree q) mod lead_coeff q = 0
Some (a1, a2) = div_int_poly_step q b (Some (c1, c2))
coeff (pCons ?b ?c2.0) (degree ?q) mod lead_coeff ?q = 0 \<Longrightarrow> ((of_int_poly ?a1.0, of_int_poly ?a2.0) = (div_rat_poly_step (of_int_poly ?q) \<circ> rat_of_int) ?b (of_int_poly ?c1.0, of_int_poly ?c2.0)) = (Some (?a1.0, ?a2.0) = div_int_poly_step ?q ?b (Some (?c1.0, ?c2.0)))

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma par_two_sides_two_sides:
  assumes "A B Par C D" and
    "B D TS A C"
  shows "A C TS B D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C TS B D
[PROOF STEP]
by (metis Par_def TS_def assms(1) assms(2) invert_one_side invert_two_sides l12_6 l9_31 not_col_permutation_4 one_side_symmetry os_ts1324__os pars__os3412)


[STATEMENT]
lemma tl_lem1[rule_format]: "l \<noteq> [] \<longrightarrow> tl l = [] \<longrightarrow> length l = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<noteq> [] \<longrightarrow> tl l = [] \<longrightarrow> length l = 1
[PROOF STEP]
by (induction l, simp+)


[STATEMENT]
lemma distinct_adj_mapD: "distinct_adj (map f xs) \<Longrightarrow> distinct_adj xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_adj (map f xs) \<Longrightarrow> distinct_adj xs
[PROOF STEP]
unfolding distinct_adj_def successively_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. successively (\<lambda>x y. f x \<noteq> f y) xs \<Longrightarrow> successively (\<noteq>) xs
[PROOF STEP]
by (erule successively_mono) auto


[STATEMENT]
lemma elem_in_uniq_set:
  assumes in_set: "x \<in> A"
      and part: "P partitions A"
  shows "\<exists>! X \<in> P . x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
P partitions A
[PROOF STEP]
obtain X where *: "X \<in> P \<and> x \<in> X"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
P partitions A

goal (1 subgoal):
 1. (\<And>X. X \<in> P \<and> x \<in> X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule elem_in_partition) blast
[PROOF STATE]
proof (state)
this:
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
fix Y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
assume "Y \<in> P \<and> x \<in> Y"
[PROOF STATE]
proof (state)
this:
Y \<in> P \<and> x \<in> Y

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y \<in> P \<and> x \<in> Y
[PROOF STEP]
have "Y = X"
[PROOF STATE]
proof (prove)
using this:
Y \<in> P \<and> x \<in> Y

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
using part in_set *
[PROOF STATE]
proof (prove)
using this:
Y \<in> P \<and> x \<in> Y
P partitions A
x \<in> A
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
unfolding is_partition_of_def is_non_overlapping_def
[PROOF STATE]
proof (prove)
using this:
Y \<in> P \<and> x \<in> Y
\<Union> P = A \<and> (\<forall>X\<in>P. \<forall>Y\<in>P. (X \<inter> Y \<noteq> {}) = (X = Y))
x \<in> A
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
by (metis disjoint_iff_not_equal)
[PROOF STATE]
proof (state)
this:
Y = X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?Y2 \<in> P \<and> x \<in> ?Y2 \<Longrightarrow> ?Y2 = X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
X \<in> P \<and> x \<in> X
?Y2 \<in> P \<and> x \<in> ?Y2 \<Longrightarrow> ?Y2 = X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<in> P \<and> x \<in> X
?Y2 \<in> P \<and> x \<in> ?Y2 \<Longrightarrow> ?Y2 = X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
by (rule ex1I)
[PROOF STATE]
proof (state)
this:
\<exists>!X. X \<in> P \<and> x \<in> X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diagvector_const[simp]: "diagvector (\<lambda> x. k) = mat k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagvector (\<lambda>x. k) = mat k
[PROOF STEP]
unfolding diagvector_def mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. if i = j then k else (0::'a)) = (\<chi>i j. if i = j then k else (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma iprev_closed: "n \<in> I \<Longrightarrow> iprev n I \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> I \<Longrightarrow> iprev n I \<in> I
[PROOF STEP]
apply (clarsimp simp: iprev_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<in> I; I \<down>< n \<noteq> {}\<rbrakk> \<Longrightarrow> Max (I \<down>< n) \<in> I
[PROOF STEP]
apply (rule subsetD[of "I \<down>< n"], fastforce)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<in> I; I \<down>< n \<noteq> {}\<rbrakk> \<Longrightarrow> Max (I \<down>< n) \<in> I \<down>< n
[PROOF STEP]
by (rule Max_in[OF nat_cut_less_finite])


[STATEMENT]
lemma foldli_size_aux: "distinct (map fst l)
    \<Longrightarrow> foldli l (\<lambda>_. True) (\<lambda>_ n. Suc n) n = n + op_map_size (map_of l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst l) \<Longrightarrow> foldli l (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of l)
[PROOF STEP]
apply (induct l arbitrary: n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. distinct (map fst []) \<Longrightarrow> foldli [] (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of [])
 2. \<And>a l n. \<lbrakk>\<And>n. distinct (map fst l) \<Longrightarrow> foldli l (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of l); distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> foldli (a # l) (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of (a # l))
[PROOF STEP]
apply (auto simp: dom_map_of_conv_image_fst)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma interleavings_filter_eq1:
  assumes "interleavings xs ys zs"
  assumes "(\<forall>x\<in>set xs. P x) \<and> (\<forall>y\<in>set ys. \<not> P y)"
  shows "filter P zs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter P zs = xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
interleavings xs ys zs
(\<forall>x\<in>set xs. P x) \<and> (\<forall>y\<in>set ys. \<not> P y)

goal (1 subgoal):
 1. filter P zs = xs
[PROOF STEP]
by (induct rule: interleavings.induct) auto


[STATEMENT]
lemma traces_list_all:
  "trace c T c' \<Longrightarrow> P c' \<Longrightarrow> (\<And> c c'. c \<Rightarrow> c' \<Longrightarrow> P c' \<Longrightarrow> P c) \<Longrightarrow> (\<forall> x\<in>set T. P x) \<and> P c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trace c T c'; P c'; \<And>c c'. \<lbrakk>c \<Rightarrow> c'; P c'\<rbrakk> \<Longrightarrow> P c\<rbrakk> \<Longrightarrow> (\<forall>x\<in>set T. P x) \<and> P c
[PROOF STEP]
by (induction rule:trace.induct) auto


[STATEMENT]
lemma (in Congruence_Rule) Seg_not_Eq_Point :
  assumes
    "\<not> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)"
  shows "\<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
have P1 : "Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow>
    Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
[PROOF STEP]
by (simp add:Seg_Point_Eq)
[PROOF STATE]
proof (state)
this:
Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)

goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
from assms P1
[PROOF STATE]
proof (chain)
picking this:
\<not> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
[PROOF STEP]
show "\<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)"
[PROOF STATE]
proof (prove)
using this:
\<not> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)

goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vars_for_consts_for_unis:
  \<open>closed (length cs) p \<Longrightarrow> list_all (\<lambda>c. new c p) cs \<Longrightarrow> distinct cs \<Longrightarrow>
   vars_for_consts (consts_for_unis (put_unis (length cs) p) cs) cs = p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed (length cs) p; list_all (\<lambda>c. new c p) cs; distinct cs\<rbrakk> \<Longrightarrow> vars_for_consts (consts_for_unis (put_unis (length cs) p) cs) cs = p
[PROOF STEP]
by (induct cs arbitrary: p) (simp_all add: subst_new_all)


[STATEMENT]
lemma cindex_pathE_linepath_on:
  assumes "z \<in> closed_segment a b"
  shows "cindex_pathE (linepath a b) z  = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
obtain u where "0\<le>u" "u\<le>1"
      and z_eq:"z = complex_of_real (1 - u) * a + complex_of_real u * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; z = complex_of_real (1 - u) * a + complex_of_real u * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<in> closed_segment a b

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; z = complex_of_real (1 - u) * a + complex_of_real u * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding in_segment scaleR_conv_of_real
[PROOF STATE]
proof (prove)
using this:
\<exists>u\<ge>0. u \<le> 1 \<and> z = complex_of_real (1 - u) * a + complex_of_real u * b

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; z = complex_of_real (1 - u) * a + complex_of_real u * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> u
u \<le> 1
z = complex_of_real (1 - u) * a + complex_of_real u * b

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
define U where "U = [:-u, 1:]"
[PROOF STATE]
proof (state)
this:
U = [:- u, 1:]

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "U\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<noteq> 0
[PROOF STEP]
unfolding U_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- u, 1:] \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U \<noteq> 0

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "cindex_pathE (linepath a b) z
        = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a))
                          / (Re a + t * Re b - (Re z + t * Re a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))
[PROOF STEP]
unfolding cindex_pathE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (linepath a b t - z) / Re (linepath a b t - z)) = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))
[PROOF STEP]
by (simp add:linepath_def algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath a b) z = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath a b) z = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "...  = cindexE 0 1
     (\<lambda>t. ( (Im b - Im a) * (t-u))
        / ( (Re b - Re a) * (t-u)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))
[PROOF STEP]
unfolding z_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im (complex_of_real (1 - u) * a + complex_of_real u * b) + t * Im a)) / (Re a + t * Re b - (Re (complex_of_real (1 - u) * a + complex_of_real u * b) + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))
[PROOF STEP]
by (simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = cindex_polyE 0 1 (U*[:Im b - Im a:]) (U*[:Re b - Re a:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:])
[PROOF STEP]
proof (subst cindexE_eq_cindex_polyE[symmetric])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < 1
 2. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)
[PROOF STEP]
have " (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))
            =  poly (U * [:Im b - Im a:]) t / poly (U * [:Re b - Re a:]) t" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)) = poly (U * [:Im b - Im a:]) t / poly (U * [:Re b - Re a:]) t
[PROOF STEP]
unfolding U_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)) = poly ([:- u, 1:] * [:Im b - Im a:]) t / poly ([:- u, 1:] * [:Re b - Re a:]) t
[PROOF STEP]
by (simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
(Im b - Im a) * (?t - u) / ((Re b - Re a) * (?t - u)) = poly (U * [:Im b - Im a:]) ?t / poly (U * [:Re b - Re a:]) ?t

goal (2 subgoals):
 1. 0 < 1
 2. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Im b - Im a) * (?t - u) / ((Re b - Re a) * (?t - u)) = poly (U * [:Im b - Im a:]) ?t / poly (U * [:Re b - Re a:]) ?t
[PROOF STEP]
show "cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) =
                  cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)"
[PROOF STATE]
proof (prove)
using this:
(Im b - Im a) * (?t - u) / ((Re b - Re a) * (?t - u)) = poly (U * [:Im b - Im a:]) ?t / poly (U * [:Re b - Re a:]) ?t

goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:])

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:])

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:]) = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]
[PROOF STEP]
apply (rule cindex_polyE_mult_cancel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<noteq> 0
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:]) = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:]) = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:] = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))
[PROOF STEP]
apply (subst cindexE_eq_cindex_polyE[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < 1
 2. cindexE 0 1 (\<lambda>x. poly [:Im b - Im a:] x / poly [:Re b - Re a:] x) = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:] = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:] = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a)) = 0
[PROOF STEP]
apply (rule cindexE_constI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> (Im b - Im a) / (Re b - Re a) = ?c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a)) = 0

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (linepath a b) z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (linepath a b) z = 0

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath a b) z = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_exps_pref:  "k \<le> l \<Longrightarrow> r\<^sup>@k \<le>p r\<^sup>@l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> l \<Longrightarrow> r \<^sup>@ k \<le>p r \<^sup>@ l
[PROOF STEP]
using leI pop_pow[of k l r]
[PROOF STATE]
proof (prove)
using this:
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x
k \<le> l \<Longrightarrow> r \<^sup>@ k \<cdot> r \<^sup>@ (l - k) = r \<^sup>@ l

goal (1 subgoal):
 1. k \<le> l \<Longrightarrow> r \<^sup>@ k \<le>p r \<^sup>@ l
[PROOF STEP]
by blast


[STATEMENT]
lemma size_Suc_Diff1: "x \<in># M \<Longrightarrow> Suc (size (M - {#x#})) = size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in># M \<Longrightarrow> Suc (size (M - {#x#})) = size M
[PROOF STEP]
using arg_cong[OF insert_DiffM, of _ _ size]
[PROOF STATE]
proof (prove)
using this:
?x1 \<in># ?y \<Longrightarrow> size (add_mset ?x1 (?y - {#?x1#})) = size ?y

goal (1 subgoal):
 1. x \<in># M \<Longrightarrow> Suc (size (M - {#x#})) = size M
[PROOF STEP]
by simp


[STATEMENT]
lemma Var_eq_subst_iff: "Var z = t[x \<^bold>\<rightarrow>t y] \<longleftrightarrow> (if z = x then x = y \<and> t = Var x else
  if z = y then t = Var x \<or> t = Var y else t = Var z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Var z = t[x \<^bold>\<rightarrow>t y]) = (if z = x then x = y \<and> t = Var x else if z = y then t = Var x \<or> t = Var y else t = Var z)
[PROOF STEP]
by (cases t) auto


[STATEMENT]
lemma (in module) lincomb_not_depend:
  fixes a A N
  assumes h1: "finite A" and h2: "A\<subseteq>N" and h3: "submodule R N M" and h4: "a:A\<rightarrow>carrier R"
  shows "lincomb a A = module.lincomb (md N) a A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a A = module.lincomb (md N) a A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb a A = module.lincomb (md N) a A
[PROOF STEP]
from h3
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R N M
[PROOF STEP]
interpret N: module R "(md N)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R N M

goal (1 subgoal):
 1. module R (md N)
[PROOF STEP]
by (rule submodule_is_module)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
have 3: "N=carrier (md N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N = carrier (md N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N = carrier (md N)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
have 4: "(smult M ) = (smult (md N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<odot>\<^bsub>M\<^esub>) = (\<odot>\<^bsub>md N\<^esub>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<odot>\<^bsub>M\<^esub>) = (\<odot>\<^bsub>md N\<^esub>)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
from h1 h2 h3 h4
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> N
LinearCombinations.submodule R N M
a \<in> A \<rightarrow> carrier R
[PROOF STEP]
have "(\<Oplus>\<^bsub>(md N)\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> N
LinearCombinations.submodule R N M
a \<in> A \<rightarrow> carrier R

goal (1 subgoal):
 1. (\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)
[PROOF STEP]
apply (intro finsum_not_depend)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> finite A
 2. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> A \<subseteq> N
 3. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> LinearCombinations.submodule R N M
 4. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> (\<lambda>v. a v \<odot>\<^bsub>M\<^esub> v) \<in> A \<rightarrow> N
[PROOF STEP]
using N.summands_valid
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> carrier (md N); ?a \<in> ?A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> \<forall>v\<in>?A. ?a v \<odot>\<^bsub>md N\<^esub> v \<in> carrier (md N)

goal (4 subgoals):
 1. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> finite A
 2. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> A \<subseteq> N
 3. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> LinearCombinations.submodule R N M
 4. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> (\<lambda>v. a v \<odot>\<^bsub>M\<^esub> v) \<in> A \<rightarrow> N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
by (unfold lincomb_def N.lincomb_def, simp)
[PROOF STATE]
proof (state)
this:
lincomb a A = N.lincomb a A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_monic_setD:
  assumes "is_monic_set B" and "b \<in> B" and "b \<noteq> 0"
  shows "lc b = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lc b = (1::'b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_monic_set B
b \<in> B
b \<noteq> 0

goal (1 subgoal):
 1. lc b = (1::'b)
[PROOF STEP]
unfolding is_monic_set_def
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>B. b \<noteq> 0 \<longrightarrow> lc b = (1::'b)
b \<in> B
b \<noteq> 0

goal (1 subgoal):
 1. lc b = (1::'b)
[PROOF STEP]
by auto


[STATEMENT]
lemma [simp]: "(\<forall>x\<in>set s_s'_list. case x of (s_XXX, s_') \<Rightarrow> tr_s T s_XXX s_' \<and> tr_s_f T s_XXX = s_') \<longrightarrow>
       tr_ss_f T (map fst s_s'_list) = map snd s_s'_list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set s_s'_list. case x of (s_XXX, s_') \<Rightarrow> tr_s T s_XXX s_' \<and> tr_s_f T s_XXX = s_') \<longrightarrow> tr_ss_f T (map fst s_s'_list) = map snd s_s'_list
[PROOF STEP]
by (induct s_s'_list, auto)


[STATEMENT]
lemma (in padic_integers) mod_in_carrier:
  "a mod (p^n) \<in> carrier (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod p ^ n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
using p_residue_alt_def p_residue_range'
[PROOF STATE]
proof (prove)
using this:
p_residue ?m ?n = ?n mod p ^ ?m
p_residue ?m ?n \<in> carrier (residue_ring (p ^ ?m))

goal (1 subgoal):
 1. a mod p ^ n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
by auto


[STATEMENT]
lemma twisted_cartesian_product_memI:
  assumes "\<pi>\<^bsub>S\<^esub> a \<in> A"
  assumes "\<pi>\<^bsub>S'\<^esub> a \<in> B"
  assumes "length a = card S + card S'"
  shows "a \<in> twisted_cartesian_product S S' A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> Prod\<^bsub>S, S'\<^esub> A B
[PROOF STEP]
by (metis (mono_tags, lifting) assms(1) assms(2) assms(3) mem_Collect_eq twisted_cartesian_product_def)


[STATEMENT]
lemma is_K33_component_size_step1:
  assumes comp:"is_K33_component_size_inv G k blue blue_cnt"
  assumes blue: "blue (ig_verts G ! k)"
  shows "is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
have "{i. i < Suc k \<and> blue (ig_verts G ! i)}
      = insert k {i. i < k \<and> blue (ig_verts G ! i)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
using blue
[PROOF STATE]
proof (prove)
using this:
blue (ig_verts G ! k)

goal (1 subgoal):
 1. {i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}

goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
with comp
[PROOF STATE]
proof (chain)
picking this:
is_K33_component_size_inv G k blue blue_cnt
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_K33_component_size_inv G k blue blue_cnt
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}

goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
unfolding is_K33_component_size_inv_def
[PROOF STATE]
proof (prove)
using this:
blue_cnt = card {i. i < k \<and> blue (ig_verts G ! i)}
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}

goal (1 subgoal):
 1. Suc blue_cnt = card {i. i < Suc k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma G_relpow_matpow_pos_ge:
  assumes "(i,j) \<in> G ^^ m" "n \<ge> m"
  shows "matpow (A + mat 1) n $ i $ j > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
m \<le> n
[PROOF STEP]
obtain k where n: "n = m + k"
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. (\<And>k. n = m + k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using le_Suc_ex
[PROOF STATE]
proof (prove)
using this:
m \<le> n
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n

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

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
have "0 < matpow A m $ i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < matpow A m $h i $h j
[PROOF STEP]
by (rule G_relpow_matpow_pos[OF assms(1)])
[PROOF STATE]
proof (state)
this:
(0::'a) < matpow A m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'a) < matpow A m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
have "\<dots> \<le> matpow (A + mat 1) m $ i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow A m $h i $h j \<le> matpow (A + mat (1::'a)) m $h i $h j
[PROOF STEP]
by (rule matpow_mono, auto simp: mat_def)
[PROOF STATE]
proof (state)
this:
matpow A m $h i $h j \<le> matpow (A + mat (1::'a)) m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
matpow A m $h i $h j \<le> matpow (A + mat (1::'a)) m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
have "\<dots> \<le> matpow (A + mat 1) n $ i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) (m + k) $h i $h j
[PROOF STEP]
using matpow_sum_one_mono
[PROOF STATE]
proof (prove)
using this:
matpow (A + mat (1::'a)) ?n $h ?i $h ?j \<le> matpow (A + mat (1::'a)) (?n + ?k) $h ?i $h ?j

goal (1 subgoal):
 1. matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) (m + k) $h i $h j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) n $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'a) < matpow (A + mat (1::'a)) n $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) < matpow (A + mat (1::'a)) n $h i $h j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma least_0: "(LEAST n. n \<in> (UNIV::'a set)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. n \<in> UNIV) = (0::'a)
[PROOF STEP]
proof (rule Least_equality, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
fix y::"'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
have "(0::'a) \<le> Abs (Rep y mod int CARD('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> Abs (Rep y mod int CARD('a))
[PROOF STEP]
using strict_mono_Rep
[PROOF STATE]
proof (prove)
using this:
strict_mono Rep

goal (1 subgoal):
 1. (0::'a) \<le> Abs (Rep y mod int CARD('a))
[PROOF STEP]
unfolding strict_mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x < y \<longrightarrow> Rep x < Rep y

goal (1 subgoal):
 1. (0::'a) \<le> Abs (Rep y mod int CARD('a))
[PROOF STEP]
by (metis (opaque_lifting, mono_tags) Rep_0 Rep_ge_0 strict_mono_Rep strict_mono_less_eq)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> Abs (Rep y mod int CARD('a))

goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> Abs (Rep y mod int CARD('a))

goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
have "... = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs (Rep y mod int CARD('a)) = y
[PROOF STEP]
by (metis Rep_inverse Rep_mod)
[PROOF STATE]
proof (state)
this:
Abs (Rep y mod int CARD('a)) = y

goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> y
[PROOF STEP]
show "(0::'a) \<le> y"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> y

goal (1 subgoal):
 1. (0::'a) \<le> y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sink_invar_init:
      assumes I: "heap_invar h"
      assumes NE: "length h > 1"
      shows "sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
from NE
[PROOF STATE]
proof (chain)
picking this:
1 < length h
[PROOF STEP]
have V: "valid h (Suc 0)" "valid h (length h)"
[PROOF STATE]
proof (prove)
using this:
1 < length h

goal (1 subgoal):
 1. valid h (Suc 0) &&& valid h (length h)
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 1 < length h \<Longrightarrow> valid h (Suc 0)
 2. 1 < length h \<Longrightarrow> valid h (length h)
[PROOF STEP]
apply (auto simp: valid_def neq_Nil_conv) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length h \<Longrightarrow> valid h (length h)
[PROOF STEP]
by (cases h) (auto simp: valid_def)
[PROOF STATE]
proof (state)
this:
valid h (Suc 0)
valid h (length h)

goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
heap_invar h

goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
unfolding heap_eq_heap' heap_invar'_def sink_invar_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i

goal (1 subgoal):
 1. valid (butlast (exch h (Suc 0) (length h))) (Suc 0) \<and> (\<forall>j. valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0 \<longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j) \<and> (has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0) \<longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0))
[PROOF STEP]
apply (intro impI conjI allI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i \<Longrightarrow> valid (butlast (exch h (Suc 0) (length h))) (Suc 0)
 2. \<And>j. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j
 3. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
using NE
[PROOF STATE]
proof (prove)
using this:
1 < length h

goal (3 subgoals):
 1. \<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i \<Longrightarrow> valid (butlast (exch h (Suc 0) (length h))) (Suc 0)
 2. \<And>j. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j
 3. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
apply (auto simp: V valid_butlast_conv) []
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j
 2. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
apply (auto simp add: children_ge_def V NE valid_butlast_conv) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
apply (auto simp add: children_ge_def V NE valid_butlast_conv) []
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_inj2: "inj2 (#)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj2 (#)
[PROOF STEP]
unfolding inj2_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x1\<in>UNIV. \<forall>x2\<in>UNIV. \<forall>y1\<in>UNIV. \<forall>y2\<in>UNIV. x1 # y1 = x2 # y2 \<longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
by simp


[STATEMENT]
lemma int_vertices_simps[simp]:
    "int_vertices [] = {}"
    "int_vertices (vv#p) = insert (fst vv) (int_vertices p)"
    "int_vertices (p1@p2) = int_vertices p1 \<union> int_vertices p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_vertices [] = {} &&& int_vertices (vv # p) = insert (fst vv) (int_vertices p) &&& int_vertices (p1 @ p2) = int_vertices p1 \<union> int_vertices p2
[PROOF STEP]
by (auto simp add: int_vertices_def)


[STATEMENT]
lemma vdisjntI:
  assumes "\<And>x y. x \<in>\<^sub>\<circ> A \<Longrightarrow> y \<in>\<^sub>\<circ> B \<Longrightarrow> x \<noteq> y"
  shows "vdisjnt A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vdisjnt A B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in>\<^sub>\<circ> A; ?y \<in>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> ?x \<noteq> ?y

goal (1 subgoal):
 1. vdisjnt A B
[PROOF STEP]
by auto


[STATEMENT]
lemma list_ord_trans_imp: "\<And>i.
  \<lbrakk> transP ord; list_ord ord xs; j < length xs; i < j \<rbrakk> \<Longrightarrow>
  ord (xs ! i) (xs ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>trans {(x, y). ord x y}; list_ord ord xs; j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
[PROOF STEP]
apply (simp add: list_ord_all_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
[PROOF STEP]
apply (induct j, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i < Suc j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (case_tac "j < i", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i < Suc j; \<not> j < i\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (simp add: linorder_not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. i < j \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i \<le> j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (case_tac "i = j", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. i < j \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i \<le> j; i \<noteq> j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (drule_tac x=i in meta_spec, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (drule_tac x=j in spec, simp add: Suc_less_pred_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; j < length xs - Suc 0; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j); ord (xs ! j) (xs ! Suc j)\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (unfold trans_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<forall>x y z. (x, y) \<in> {(x, y). ord x y} \<longrightarrow> (y, z) \<in> {(x, y). ord x y} \<longrightarrow> (x, z) \<in> {(x, y). ord x y}; j < length xs - Suc 0; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j); ord (xs ! j) (xs ! Suc j)\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (drule_tac x="xs ! i" in spec, drule_tac x="xs ! j" in spec, drule_tac x="xs ! Suc j" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>j < length xs - Suc 0; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j); ord (xs ! j) (xs ! Suc j); (xs ! i, xs ! j) \<in> {(x, y). ord x y} \<longrightarrow> (xs ! j, xs ! Suc j) \<in> {(x, y). ord x y} \<longrightarrow> (xs ! i, xs ! Suc j) \<in> {(x, y). ord x y}\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma superadditive_converges_bounded'':
  assumes "superadditive u"
          "\<And>n. n > 0 \<Longrightarrow> u n \<le> n * (a::real)"
  shows "\<exists>l. (\<lambda>n. u n / n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> n * l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
have "\<exists>l. (\<lambda>n. -u n / n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. -u n \<ge> n * l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)
[PROOF STEP]
apply (rule subadditive_converges_bounded''[OF subadditive_of_superadditive[OF assms(1)], of "-a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> real n * - a \<le> - u n
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> u ?n \<le> real ?n * a

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> real n * - a \<le> - u n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)
[PROOF STEP]
obtain l where l: "(\<lambda>n. -u n / n) \<longlonglongrightarrow> l" "(\<forall>n>0. -u n \<ge> n * l)"
[PROOF STATE]
proof (prove)
using this:
\<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>(\<lambda>n. - u n / real n) \<longlonglongrightarrow> l; \<forall>n>0. real n * l \<le> - u n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - u n / real n) \<longlonglongrightarrow> l
\<forall>n>0. real n * l \<le> - u n

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
have "(\<lambda>n. -((-u n)/n)) \<longlonglongrightarrow> -l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l
[PROOF STEP]
by (intro tendsto_intros l)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
have "\<forall>n>0. u n \<le> n * (-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n>0. u n \<le> real n * - l
[PROOF STEP]
using l(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>n>0. real n * l \<le> - u n

goal (1 subgoal):
 1. \<forall>n>0. u n \<le> real n * - l
[PROOF STEP]
by (auto simp add: algebra_simps) (metis minus_equation_iff neg_le_iff_le)
[PROOF STATE]
proof (state)
this:
\<forall>n>0. u n \<le> real n * - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l
\<forall>n>0. u n \<le> real n * - l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l
\<forall>n>0. u n \<le> real n * - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible\<^sub>d_dvd_smult:
  fixes p :: "'a::{comm_semiring_1,semiring_no_zero_divisors} poly"
  assumes "degree p > 0" "irreducible\<^sub>d q" "p dvd q"
  shows "\<exists> c. c \<noteq> 0 \<and> q = smult c p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < degree p
irreducible\<^sub>d q
p dvd q
[PROOF STEP]
obtain r where q: "q = p * r"
[PROOF STATE]
proof (prove)
using this:
0 < degree p
irreducible\<^sub>d q
p dvd q

goal (1 subgoal):
 1. (\<And>r. q = p * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim dvdE, auto)
[PROOF STATE]
proof (state)
this:
q = p * r

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from degree_mult_eq[of p r] assms(1) q
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>p \<noteq> 0; r \<noteq> 0\<rbrakk> \<Longrightarrow> degree (p * r) = degree p + degree r
0 < degree p
q = p * r
[PROOF STEP]
have "\<not> degree p < degree q" and nz: "p \<noteq> 0" "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p \<noteq> 0; r \<noteq> 0\<rbrakk> \<Longrightarrow> degree (p * r) = degree p + degree r
0 < degree p
q = p * r

goal (1 subgoal):
 1. \<not> degree p < degree q &&& p \<noteq> 0 &&& q \<noteq> 0
[PROOF STEP]
apply (metis assms(2) degree_mult_eq_0 gr_implies_not_zero irreducible\<^sub>dD(2) less_add_same_cancel2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. p \<noteq> 0
 2. q \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < degree p
irreducible\<^sub>d q
p dvd q

goal (2 subgoals):
 1. p \<noteq> 0
 2. q \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> degree p < degree q
p \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
hence deg: "degree p \<ge> degree q"
[PROOF STATE]
proof (prove)
using this:
\<not> degree p < degree q
p \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. degree q \<le> degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree q \<le> degree p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from \<open>p dvd q\<close>
[PROOF STATE]
proof (chain)
picking this:
p dvd q
[PROOF STEP]
obtain k where q: "q = k * p"
[PROOF STATE]
proof (prove)
using this:
p dvd q

goal (1 subgoal):
 1. (\<And>k. q = k * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. q = p * k

goal (1 subgoal):
 1. (\<And>k. q = k * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
q = k * p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
with nz
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
q \<noteq> 0
q = k * p
[PROOF STEP]
have "k \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
q \<noteq> 0
q = k * p

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

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from deg[unfolded q degree_mult_eq[OF \<open>k \<noteq> 0\<close> \<open>p \<noteq> 0\<close> ]]
[PROOF STATE]
proof (chain)
picking this:
degree k + degree p \<le> degree p
[PROOF STEP]
have "degree k = 0"
[PROOF STATE]
proof (prove)
using this:
degree k + degree p \<le> degree p

goal (1 subgoal):
 1. degree k = 0
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
using this:
degree k + degree p \<le> degree p

goal (1 subgoal):
 1. degree k = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree k = 0

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree k = 0
[PROOF STEP]
obtain c where k: "k = [: c :]"
[PROOF STATE]
proof (prove)
using this:
degree k = 0

goal (1 subgoal):
 1. (\<And>c. k = [:c:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis degree_0_id)
[PROOF STATE]
proof (state)
this:
k = [:c:]

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
with \<open>k \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
k = [:c:]
[PROOF STEP]
have "c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
k = [:c:]

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

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
have "q = smult c p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q = smult c p
[PROOF STEP]
unfolding q k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:c:] * p = smult c p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q = smult c p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
with \<open>c \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a)
q = smult c p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
q = smult c p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c. c \<noteq> (0::'a) \<and> q = smult c p

goal:
No subgoals!
[PROOF STEP]
qed