[STATEMENT]
lemma ladder_cut_prefix_n:
  assumes index_bound: "index < length L"
  assumes length_L: "length L > 0"
  shows "ladder_n (ladder_cut_prefix d L) index = ladder_n L index"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n (ladder_cut_prefix d L) index = ladder_n L index
[PROOF STEP]
apply (simp add: ladder_cut_prefix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n ((ladder_shift_j d L)[0 := (ladder_n L 0, ladder_j L 0 - d, ladder_i L 0 - d)]) index = ladder_n L index
[PROOF STEP]
apply (cases index)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. index = 0 \<Longrightarrow> ladder_n ((ladder_shift_j d L)[0 := (ladder_n L 0, ladder_j L 0 - d, ladder_i L 0 - d)]) index = ladder_n L index
 2. \<And>nat. index = Suc nat \<Longrightarrow> ladder_n ((ladder_shift_j d L)[0 := (ladder_n L 0, ladder_j L 0 - d, ladder_i L 0 - d)]) index = ladder_n L index
[PROOF STEP]
apply (auto simp add: ladder_n_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. index = 0 \<Longrightarrow> deriv_n ((ladder_shift_j d L)[0 := (deriv_n (L ! 0), ladder_j L 0 - d, ladder_i L 0 - d)] ! 0) = deriv_n (L ! 0)
 2. \<And>nat. index = Suc nat \<Longrightarrow> deriv_n (ladder_shift_j d L ! Suc nat) = deriv_n (L ! Suc nat)
[PROOF STEP]
apply (subst nth_list_update_eq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. index = 0 \<Longrightarrow> 0 < length (ladder_shift_j d L)
 2. index = 0 \<Longrightarrow> deriv_n (deriv_n (L ! 0), ladder_j L 0 - d, ladder_i L 0 - d) = deriv_n (L ! 0)
 3. \<And>nat. index = Suc nat \<Longrightarrow> deriv_n (ladder_shift_j d L ! Suc nat) = deriv_n (L ! Suc nat)
[PROOF STEP]
apply (simp add: ladder_shift_j_length)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. index = 0 \<Longrightarrow> L \<noteq> []
 2. index = 0 \<Longrightarrow> deriv_n (deriv_n (L ! 0), ladder_j L 0 - d, ladder_i L 0 - d) = deriv_n (L ! 0)
 3. \<And>nat. index = Suc nat \<Longrightarrow> deriv_n (ladder_shift_j d L ! Suc nat) = deriv_n (L ! Suc nat)
[PROOF STEP]
using length_L
[PROOF STATE]
proof (prove)
using this:
0 < length L

goal (3 subgoals):
 1. index = 0 \<Longrightarrow> L \<noteq> []
 2. index = 0 \<Longrightarrow> deriv_n (deriv_n (L ! 0), ladder_j L 0 - d, ladder_i L 0 - d) = deriv_n (L ! 0)
 3. \<And>nat. index = Suc nat \<Longrightarrow> deriv_n (ladder_shift_j d L ! Suc nat) = deriv_n (L ! Suc nat)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. index = 0 \<Longrightarrow> deriv_n (deriv_n (L ! 0), ladder_j L 0 - d, ladder_i L 0 - d) = deriv_n (L ! 0)
 2. \<And>nat. index = Suc nat \<Longrightarrow> deriv_n (ladder_shift_j d L ! Suc nat) = deriv_n (L ! Suc nat)
[PROOF STEP]
apply (simp add: deriv_n_def )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. index = Suc nat \<Longrightarrow> deriv_n (ladder_shift_j d L ! Suc nat) = deriv_n (L ! Suc nat)
[PROOF STEP]
apply (rule_tac deriv_n_ladder_shift_j)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. index = Suc nat \<Longrightarrow> Suc nat < length L
[PROOF STEP]
using index_bound
[PROOF STATE]
proof (prove)
using this:
index < length L

goal (1 subgoal):
 1. \<And>nat. index = Suc nat \<Longrightarrow> Suc nat < length L
[PROOF STEP]
by arith


[STATEMENT]
lemma AE_point_measure:
  "(AE x in point_measure A f. P x) \<longleftrightarrow> (\<forall>x\<in>A. 0 < f x \<longrightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere (point_measure A f) P = (\<forall>x\<in>A. 0 < f x \<longrightarrow> P x)
[PROOF STEP]
unfolding point_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere (density (count_space A) f) P = (\<forall>x\<in>A. 0 < f x \<longrightarrow> P x)
[PROOF STEP]
by (subst AE_density) (auto simp: AE_density AE_count_space point_measure_def)


[STATEMENT]
lemma add_col_to_multiple_index_change_bounds:
  assumes "i < dim_row A" and "j < dim_col A" and "j \<ge> low" and "j < up"  and "l < low \<or> l \<ge> up"
    and "l < dim_col A"
  shows "add_col_to_multiple a [low..<up] l A $$ (i,j) = (a * A$$(i, l)) + A$$(i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)
[PROOF STEP]
have d: "distinct [low..<up]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct [low..<up]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distinct [low..<up]

goal (1 subgoal):
 1. add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)
[PROOF STEP]
have jin: "j \<in> set [low..<up]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<in> set [low..<up]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A
low \<le> j
j < up
l < low \<or> up \<le> l
l < dim_col A

goal (1 subgoal):
 1. j \<in> set [low..<up]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j \<in> set [low..<up]

goal (1 subgoal):
 1. add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)
[PROOF STEP]
have lnin: "l \<notin> set [low..<up]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<notin> set [low..<up]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A
low \<le> j
j < up
l < low \<or> up \<le> l
l < dim_col A

goal (1 subgoal):
 1. l \<notin> set [low..<up]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l \<notin> set [low..<up]

goal (1 subgoal):
 1. add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
l \<notin> set [low..<up]

goal (1 subgoal):
 1. add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)
[PROOF STEP]
using add_col_to_multiple_index_change d jin assms
[PROOF STATE]
proof (prove)
using this:
l \<notin> set [low..<up]
\<lbrakk>?i < dim_row ?A; ?j < dim_col ?A; ?j \<in> set ?ks; distinct ?ks; ?l \<notin> set ?ks; ?l < dim_col ?A\<rbrakk> \<Longrightarrow> add_col_to_multiple ?a ?ks ?l ?A $$ (?i, ?j) = ?a * ?A $$ (?i, ?l) + ?A $$ (?i, ?j)
distinct [low..<up]
j \<in> set [low..<up]
i < dim_row A
j < dim_col A
low \<le> j
j < up
l < low \<or> up \<le> l
l < dim_col A

goal (1 subgoal):
 1. add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
add_col_to_multiple a [low..<up] l A $$ (i, j) = a * A $$ (i, l) + A $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nfoldli_nfoldli_prod_conv:
  "nfoldli l2 ctd (\<lambda>i. nfoldli l1 ctd (f i)) s = nfoldli (List.product l2 l1) ctd (\<lambda>(i,j). f i j) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfoldli l2 ctd (\<lambda>i. nfoldli l1 ctd (f i)) s = nfoldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nfoldli l2 ctd (\<lambda>i. nfoldli l1 ctd (f i)) s = nfoldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
have [simp]: "nfoldli (map (Pair a) l) ctd (\<lambda>(x, y). f x y) s = nfoldli l ctd (f a) s"
    for a l s
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfoldli (map (Pair a) l) ctd (\<lambda>(x, y). f x y) s = nfoldli l ctd (f a) s
[PROOF STEP]
apply (induction l arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. nfoldli (map (Pair a) []) ctd (\<lambda>(x, y). f x y) s = nfoldli [] ctd (f a) s
 2. \<And>aa l s. (\<And>s. nfoldli (map (Pair a) l) ctd (\<lambda>(x, y). f x y) s = nfoldli l ctd (f a) s) \<Longrightarrow> nfoldli (map (Pair a) (aa # l)) ctd (\<lambda>(x, y). f x y) s = nfoldli (aa # l) ctd (f a) s
[PROOF STEP]
by (auto simp: pw_eq_iff refine_pw_simps)
[PROOF STATE]
proof (state)
this:
nfoldli (map (Pair ?a) ?l) ctd (\<lambda>(x, y). f x y) ?s = nfoldli ?l ctd (f ?a) ?s

goal (1 subgoal):
 1. nfoldli l2 ctd (\<lambda>i. nfoldli l1 ctd (f i)) s = nfoldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfoldli l2 ctd (\<lambda>i. nfoldli l1 ctd (f i)) s = nfoldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s
[PROOF STEP]
by (induction l2 arbitrary: l1 s) auto
[PROOF STATE]
proof (state)
this:
nfoldli l2 ctd (\<lambda>i. nfoldli l1 ctd (f i)) s = nfoldli (List.product l2 l1) ctd (\<lambda>(i, j). f i j) s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PrimReplace_iff:
  assumes sv: "\<forall>u v v'. u \<^bold>\<in> A \<longrightarrow> R u v \<longrightarrow> R u v' \<longrightarrow> v'=v"
  shows "v \<^bold>\<in> (PrimReplace A R) \<longleftrightarrow> (\<exists>u. u \<^bold>\<in> A \<and> R u v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v \<^bold>\<in> PrimReplace A R) = (\<exists>u. u \<^bold>\<in> A \<and> R u v)
[PROOF STEP]
apply (insert replacement [OF sv], clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. \<forall>v. (v \<^bold>\<in> z) = (\<exists>u. u \<^bold>\<in> A \<and> R u v) \<Longrightarrow> (v \<^bold>\<in> PrimReplace A R) = (\<exists>u. u \<^bold>\<in> A \<and> R u v)
[PROOF STEP]
apply (simp add: PrimReplace_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. \<forall>v. (v \<^bold>\<in> z) = (\<exists>u. u \<^bold>\<in> A \<and> R u v) \<Longrightarrow> (v \<^bold>\<in> (THE z. \<forall>v. (v \<^bold>\<in> z) = (\<exists>u. u \<^bold>\<in> A \<and> R u v))) = (\<exists>u. u \<^bold>\<in> A \<and> R u v)
[PROOF STEP]
apply (rule theI2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>z. \<forall>v. (v \<^bold>\<in> z) = (\<exists>u. u \<^bold>\<in> A \<and> R u v) \<Longrightarrow> \<forall>v. (v \<^bold>\<in> ?a3 z) = (\<exists>u. u \<^bold>\<in> A \<and> R u v)
 2. \<And>z u. \<lbrakk>\<forall>v. (v \<^bold>\<in> z) = (\<exists>u. u \<^bold>\<in> A \<and> R u v); \<forall>v. (v \<^bold>\<in> u) = (\<exists>u. u \<^bold>\<in> A \<and> R u v)\<rbrakk> \<Longrightarrow> u = ?a3 z
 3. \<And>z u. \<lbrakk>\<forall>v. (v \<^bold>\<in> z) = (\<exists>u. u \<^bold>\<in> A \<and> R u v); \<forall>v. (v \<^bold>\<in> u) = (\<exists>u. u \<^bold>\<in> A \<and> R u v)\<rbrakk> \<Longrightarrow> (v \<^bold>\<in> u) = (\<exists>u. u \<^bold>\<in> A \<and> R u v)
[PROOF STEP]
apply (auto simp: hf_ext)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bij_betw_quotient_domain_permutation_eq:
  assumes "finite A" "finite B"
  assumes "card A = card B"
  shows "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
 2. {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B
[PROOF STEP]
show "{{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B
[PROOF STEP]
by (simp add: bijections_in_domain_permutation[OF assms])
[PROOF STATE]
proof (state)
this:
{{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
show "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
fix F
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
assume F_in: "F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B"
[PROOF STATE]
proof (state)
this:
F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
have "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {F \<in> ((A \<rightarrow>\<^sub>E B) // domain_permutation A B). univ (\<lambda>f. bij_betw f A B) F}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B. univ (\<lambda>f. bij_betw f A B) F}
[PROOF STEP]
using equiv_domain_permutation[of A B] bij_betw_respects_domain_permutation[of A B]
[PROOF STATE]
proof (prove)
using this:
equiv (A \<rightarrow>\<^sub>E B) (domain_permutation A B)
(\<lambda>f. bij_betw f A B) respects domain_permutation A B

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B. univ (\<lambda>f. bij_betw f A B) F}
[PROOF STEP]
by (simp only: univ_preserves_predicate)
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B. univ (\<lambda>f. bij_betw f A B) F}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
from F_in this
[PROOF STATE]
proof (chain)
picking this:
F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B. univ (\<lambda>f. bij_betw f A B) F}
[PROOF STEP]
have "F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B"
      and "univ (\<lambda>f. bij_betw f A B) F"
[PROOF STATE]
proof (prove)
using this:
F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B. univ (\<lambda>f. bij_betw f A B) F}

goal (1 subgoal):
 1. F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B &&& univ (\<lambda>f. bij_betw f A B) F
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B
univ (\<lambda>f. bij_betw f A B) F

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
have "F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
have "\<forall>f \<in> F. f \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
using \<open>F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B\<close>
[PROOF STATE]
proof (prove)
using this:
F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B

goal (1 subgoal):
 1. \<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
by (metis ImageE equiv_class_eq_iff equiv_domain_permutation quotientE)
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B

goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B

goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
have "\<forall>f \<in> F. bij_betw f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
using univ_predicate_impl_forall[OF equiv_domain_permutation bij_betw_respects_domain_permutation]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?X \<in> (?A1 \<rightarrow>\<^sub>E ?B1) // domain_permutation ?A1 ?B1; univ (\<lambda>f. bij_betw f ?A1 ?B1) ?X\<rbrakk> \<Longrightarrow> \<forall>x\<in>?X. bij_betw x ?A1 ?B1

goal (1 subgoal):
 1. \<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
using \<open>F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B\<close> \<open>univ (\<lambda>f. bij_betw f A B) F\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?X \<in> (?A1 \<rightarrow>\<^sub>E ?B1) // domain_permutation ?A1 ?B1; univ (\<lambda>f. bij_betw f ?A1 ?B1) ?X\<rbrakk> \<Longrightarrow> \<forall>x\<in>?X. bij_betw x ?A1 ?B1
F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B
univ (\<lambda>f. bij_betw f A B) F

goal (1 subgoal):
 1. \<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. bij_betw f A B

goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
\<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
show "F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}"
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
\<forall>f\<in>F. bij_betw f A B

goal (1 subgoal):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
show "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
fix f'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
assume "f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}"
[PROOF STATE]
proof (state)
this:
f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
have "f' \<in> A \<rightarrow>\<^sub>E B" "bij_betw f' A B"
[PROOF STATE]
proof (prove)
using this:
f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. f' \<in> A \<rightarrow>\<^sub>E B &&& bij_betw f' A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f' \<in> A \<rightarrow>\<^sub>E B
bij_betw f' A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
obtain f where "f \<in> A \<rightarrow>\<^sub>E B" and "F = domain_permutation A B `` {f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; F = domain_permutation A B `` {f}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B\<close>
[PROOF STATE]
proof (prove)
using this:
F \<in> (A \<rightarrow>\<^sub>E B) // domain_permutation A B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; F = domain_permutation A B `` {f}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: quotientE)
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B
F = domain_permutation A B `` {f}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
have "bij_betw f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f A B
[PROOF STEP]
using univ_commute'[OF equiv_domain_permutation bij_betw_respects_domain_permutation]
[PROOF STATE]
proof (prove)
using this:
?x \<in> ?A1 \<rightarrow>\<^sub>E ?B1 \<Longrightarrow> univ (\<lambda>f. bij_betw f ?A1 ?B1) (domain_permutation ?A1 ?B1 `` {?x}) = bij_betw ?x ?A1 ?B1

goal (1 subgoal):
 1. bij_betw f A B
[PROOF STEP]
using \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> \<open>F = domain_permutation A B `` {f}\<close> \<open>univ (\<lambda>f. bij_betw f A B) F\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> ?A1 \<rightarrow>\<^sub>E ?B1 \<Longrightarrow> univ (\<lambda>f. bij_betw f ?A1 ?B1) (domain_permutation ?A1 ?B1 `` {?x}) = bij_betw ?x ?A1 ?B1
f \<in> A \<rightarrow>\<^sub>E B
F = domain_permutation A B `` {f}
univ (\<lambda>f. bij_betw f A B) F

goal (1 subgoal):
 1. bij_betw f A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bij_betw f A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
obtain p where "p permutes A" "\<forall>x\<in>A. f x = f' (p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtain_domain_permutation_for_two_bijections
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij_betw ?f ?A ?B; bij_betw ?f' ?A ?B; \<And>p. \<lbrakk>p permutes ?A; \<forall>a\<in>?A. ?f a = ?f' (p a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>bij_betw f A B\<close> \<open>bij_betw f' A B\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij_betw ?f ?A ?B; bij_betw ?f' ?A ?B; \<And>p. \<lbrakk>p permutes ?A; \<forall>a\<in>?A. ?f a = ?f' (p a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
bij_betw f A B
bij_betw f' A B

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
from this \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> \<open>f' \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
have "(f, f') \<in> domain_permutation A B"
[PROOF STATE]
proof (prove)
using this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. (f, f') \<in> domain_permutation A B
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. (f, f') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(f, f') \<in> domain_permutation A B
[PROOF STEP]
show "f' \<in> F"
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. f' \<in> F
[PROOF STEP]
using \<open>F = domain_permutation A B `` {f}\<close>
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> domain_permutation A B
F = domain_permutation A B `` {f}

goal (1 subgoal):
 1. f' \<in> F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f' \<in> F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
show "F \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}"
[PROOF STATE]
proof (prove)
using this:
F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. F \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
F \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_mult_left_cancel: "a dvd 1 \<Longrightarrow> a * b = a * c \<longleftrightarrow> b = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd (1::'a) \<Longrightarrow> (a * b = a * c) = (b = c)
[PROOF STEP]
using mult_cancel_left [of a b c]
[PROOF STATE]
proof (prove)
using this:
(a * b = a * c) = (a = (0::'a) \<or> b = c)

goal (1 subgoal):
 1. a dvd (1::'a) \<Longrightarrow> (a * b = a * c) = (b = c)
[PROOF STEP]
by auto


[STATEMENT]
lemma GreatestIB:
fixes n :: \<open>nat\<close> and P
assumes a:\<open>\<exists>k\<le>n. P k\<close>
shows GreatestBI: \<open>P (GREATEST k. k\<le>n \<and> P k)\<close> and GreatestB: \<open>(GREATEST k. k\<le>n \<and> P k) \<le> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (GREATEST k. k \<le> n \<and> P k) &&& (GREATEST k. k \<le> n \<and> P k) \<le> n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P (GREATEST k. k \<le> n \<and> P k)
 2. (GREATEST k. k \<le> n \<and> P k) \<le> n
[PROOF STEP]
show \<open>P (GREATEST k. k\<le>n \<and> P k)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (GREATEST k. k \<le> n \<and> P k)
[PROOF STEP]
using GreatestI_ex_nat[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>y. y \<le> n \<and> P y \<Longrightarrow> y \<le> ?b) \<Longrightarrow> (GREATEST k. k \<le> n \<and> P k) \<le> n \<and> P (GREATEST k. k \<le> n \<and> P k)

goal (1 subgoal):
 1. P (GREATEST k. k \<le> n \<and> P k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P (GREATEST k. k \<le> n \<and> P k)

goal (1 subgoal):
 1. (GREATEST k. k \<le> n \<and> P k) \<le> n
[PROOF STEP]
show \<open>(GREATEST k. k\<le>n \<and> P k) \<le> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (GREATEST k. k \<le> n \<and> P k) \<le> n
[PROOF STEP]
using GreatestI_ex_nat[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>y. y \<le> n \<and> P y \<Longrightarrow> y \<le> ?b) \<Longrightarrow> (GREATEST k. k \<le> n \<and> P k) \<le> n \<and> P (GREATEST k. k \<le> n \<and> P k)

goal (1 subgoal):
 1. (GREATEST k. k \<le> n \<and> P k) \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(GREATEST k. k \<le> n \<and> P k) \<le> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma log_ceiling[simp]: assumes b: "b > 1" and x: "x > 0"
  shows "log_ceiling b x = \<lceil>log b x\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (log_ceiling b x) = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int (log_ceiling b x) = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>
[PROOF STEP]
obtain y where y: "log_ceiling b x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. log_ceiling b x = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
log_ceiling b x = y

goal (1 subgoal):
 1. int (log_ceiling b x) = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>
[PROOF STEP]
note main = log_ceiling_sound[OF assms y]
[PROOF STATE]
proof (state)
this:
x \<le> b ^ y
y \<noteq> 0 \<Longrightarrow> b ^ (y - 1) < x

goal (1 subgoal):
 1. int (log_ceiling b x) = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>
[PROOF STEP]
from b x
[PROOF STATE]
proof (chain)
picking this:
1 < b
0 < x
[PROOF STEP]
have *: "1 < real_of_int b" "0 < real_of_int (b ^ (y - 1))" "0 < real_of_int x"
    and **: "1 < real_of_int b" "0 < real_of_int x" "0 < real_of_int (b ^ y)"
[PROOF STATE]
proof (prove)
using this:
1 < b
0 < x

goal (1 subgoal):
 1. (1 < real_of_int b &&& 0 < real_of_int (b ^ (y - 1)) &&& 0 < real_of_int x) &&& 1 < real_of_int b &&& 0 < real_of_int x &&& 0 < real_of_int (b ^ y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < real_of_int b
0 < real_of_int (b ^ (y - 1))
0 < real_of_int x
1 < real_of_int b
0 < real_of_int x
0 < real_of_int (b ^ y)

goal (1 subgoal):
 1. int (log_ceiling b x) = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (log_ceiling b x) = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>
[PROOF STEP]
unfolding y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int y = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>
[PROOF STEP]
proof (rule sym, rule ceiling_unique)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
 2. log (real_of_int b) (real_of_int x) \<le> real_of_int (int y)
[PROOF STEP]
show "log (real_of_int b) (real_of_int x) \<le> real_of_int (int y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (real_of_int b) (real_of_int x) \<le> real_of_int (int y)
[PROOF STEP]
using main(1)[folded log_le_cancel_iff[OF **, unfolded of_int_le_iff]]
[PROOF STATE]
proof (prove)
using this:
log (real_of_int b) (real_of_int x) \<le> log (real_of_int b) (real_of_int (b ^ y))

goal (1 subgoal):
 1. log (real_of_int b) (real_of_int x) \<le> real_of_int (int y)
[PROOF STEP]
using log_pow_cancel[of b y] b
[PROOF STATE]
proof (prove)
using this:
log (real_of_int b) (real_of_int x) \<le> log (real_of_int b) (real_of_int (b ^ y))
\<lbrakk>0 < real_of_int b; real_of_int b \<noteq> 1\<rbrakk> \<Longrightarrow> log (real_of_int b) (real_of_int b ^ y) = real y
1 < b

goal (1 subgoal):
 1. log (real_of_int b) (real_of_int x) \<le> real_of_int (int y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
log (real_of_int b) (real_of_int x) \<le> real_of_int (int y)

goal (1 subgoal):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
0 < x
[PROOF STEP]
have x: "x \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < x

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

goal (1 subgoal):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
show "real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
proof (cases "y = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
 2. y \<noteq> 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
y \<noteq> 0

goal (2 subgoals):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
 2. y \<noteq> 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> 0

goal (1 subgoal):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
using main(2)[folded log_less_cancel_iff[OF *, unfolded of_int_less_iff]]
[PROOF STATE]
proof (prove)
using this:
y \<noteq> 0
y \<noteq> 0 \<Longrightarrow> log (real_of_int b) (real_of_int (b ^ (y - 1))) < log (real_of_int b) (real_of_int x)

goal (1 subgoal):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
using log_pow_cancel[of b "y - 1"] b x
[PROOF STATE]
proof (prove)
using this:
y \<noteq> 0
y \<noteq> 0 \<Longrightarrow> log (real_of_int b) (real_of_int (b ^ (y - 1))) < log (real_of_int b) (real_of_int x)
\<lbrakk>0 < real_of_int b; real_of_int b \<noteq> 1\<rbrakk> \<Longrightarrow> log (real_of_int b) (real_of_int b ^ (y - 1)) = real (y - 1)
1 < b
1 \<le> x

goal (1 subgoal):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
y = 0

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
have "real_of_int (int y) - 1 = log b (1/b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (int y) - 1 = log (real_of_int b) (1 / real_of_int b)
[PROOF STEP]
using True b
[PROOF STATE]
proof (prove)
using this:
y = 0
1 < b

goal (1 subgoal):
 1. real_of_int (int y) - 1 = log (real_of_int b) (1 / real_of_int b)
[PROOF STEP]
by (subst log_divide, auto)
[PROOF STATE]
proof (state)
this:
real_of_int (int y) - 1 = log (real_of_int b) (1 / real_of_int b)

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (int y) - 1 = log (real_of_int b) (1 / real_of_int b)

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
have "\<dots> < log b 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (real_of_int b) (1 / real_of_int b) < log (real_of_int b) 1
[PROOF STEP]
by (subst log_less_cancel_iff, insert b, auto)
[PROOF STATE]
proof (state)
this:
log (real_of_int b) (1 / real_of_int b) < log (real_of_int b) 1

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
log (real_of_int b) (1 / real_of_int b) < log (real_of_int b) 1

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
have "\<dots> \<le> log b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (real_of_int b) 1 \<le> log (real_of_int b) (real_of_int x)
[PROOF STEP]
by (subst log_le_cancel_iff, insert b x, auto)
[PROOF STATE]
proof (state)
this:
log (real_of_int b) 1 \<le> log (real_of_int b) (real_of_int x)

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
show "real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)"
[PROOF STATE]
proof (prove)
using this:
real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)

goal (1 subgoal):
 1. real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real_of_int (int y) - 1 < log (real_of_int b) (real_of_int x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int (log_ceiling b x) = \<lceil>log (real_of_int b) (real_of_int x)\<rceil>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ass_function_Complete_set_non_associates:
  assumes f: "ass_function f"
  shows "Complete_set_non_associates (f`UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complete_set_non_associates (range f)
[PROOF STEP]
unfolding Complete_set_non_associates_def ass_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>fa. ((\<forall>a. normalize a = normalize (fa a)) \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range fa)) \<and> range fa = range f \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)
[PROOF STEP]
apply (rule exI[of _ f])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>a. normalize a = normalize (f a)) \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)) \<and> range f = range f \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
ass_function f

goal (1 subgoal):
 1. ((\<forall>a. normalize a = normalize (f a)) \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)) \<and> range f = range f \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)
[PROOF STEP]
unfolding ass_function_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>a. normalize a = normalize (f a)) \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)

goal (1 subgoal):
 1. ((\<forall>a. normalize a = normalize (f a)) \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)) \<and> range f = range f \<and> pairwise (\<lambda>a b. normalize a \<noteq> normalize b) (range f)
[PROOF STEP]
unfolding pairwise_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>a. normalize a = normalize (f a)) \<and> (\<forall>x\<in>range f. \<forall>y\<in>range f. x \<noteq> y \<longrightarrow> normalize x \<noteq> normalize y)

goal (1 subgoal):
 1. ((\<forall>a. normalize a = normalize (f a)) \<and> (\<forall>x\<in>range f. \<forall>y\<in>range f. x \<noteq> y \<longrightarrow> normalize x \<noteq> normalize y)) \<and> range f = range f \<and> (\<forall>x\<in>range f. \<forall>y\<in>range f. x \<noteq> y \<longrightarrow> normalize x \<noteq> normalize y)
[PROOF STEP]
by fast


[STATEMENT]
lemma continuous_at_right_imp_inf_continuous:
  fixes f :: "'a::{complete_linorder, linorder_topology} \<Rightarrow> 'b::{complete_linorder, linorder_topology}"
  assumes "mono f" "\<And>x. continuous (at_right x) f"
  shows "inf_continuous f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_continuous f
[PROOF STEP]
unfolding inf_continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>M. decseq M \<longrightarrow> f (Inf (range M)) = (INF i. f (M i))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. decseq M \<Longrightarrow> f (Inf (range M)) = (INF i. f (M i))
[PROOF STEP]
fix M :: "nat \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. decseq M \<Longrightarrow> f (Inf (range M)) = (INF i. f (M i))
[PROOF STEP]
assume "decseq M"
[PROOF STATE]
proof (state)
this:
decseq M

goal (1 subgoal):
 1. \<And>M. decseq M \<Longrightarrow> f (Inf (range M)) = (INF i. f (M i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
decseq M
[PROOF STEP]
show "f (INF i. M i) = (INF i. f (M i))"
[PROOF STATE]
proof (prove)
using this:
decseq M

goal (1 subgoal):
 1. f (Inf (range M)) = (INF i. f (M i))
[PROOF STEP]
using continuous_at_Inf_mono [OF assms, of "range M"]
[PROOF STATE]
proof (prove)
using this:
decseq M
\<lbrakk>range M \<noteq> {}; bdd_below (range M)\<rbrakk> \<Longrightarrow> f (Inf (range M)) = Inf (f ` range M)

goal (1 subgoal):
 1. f (Inf (range M)) = (INF i. f (M i))
[PROOF STEP]
by (simp add: image_comp)
[PROOF STATE]
proof (state)
this:
f (Inf (range M)) = (INF i. f (M i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma step_right_unique: "right_unique step"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. right_unique (\<rightarrow>)
[PROOF STEP]
using step_deterministic
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?s1.0 \<rightarrow> ?s2.0; ?s1.0 \<rightarrow> ?s3.0\<rbrakk> \<Longrightarrow> ?s2.0 = ?s3.0

goal (1 subgoal):
 1. right_unique (\<rightarrow>)
[PROOF STEP]
by (rule right_uniqueI)


[STATEMENT]
lemma ideal_inter:
  assumes "ideal I" and "ideal J" shows "ideal (I \<inter> J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal (I \<inter> J)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ideal I
ideal J

goal (1 subgoal):
 1. ideal (I \<inter> J)
[PROOF STEP]
unfolding ideal_def left_ideal_def right_ideal_def subgroup_def
[PROOF STATE]
proof (prove)
using this:
(((0::'a) \<in> I \<and> (\<forall>a\<in>I. \<forall>b\<in>I. a + b \<in> I) \<and> (\<forall>a\<in>I. - a \<in> I)) \<and> (\<forall>x\<in>I. \<forall>r. r * x \<in> I)) \<and> ((0::'a) \<in> I \<and> (\<forall>a\<in>I. \<forall>b\<in>I. a + b \<in> I) \<and> (\<forall>a\<in>I. - a \<in> I)) \<and> (\<forall>x\<in>I. \<forall>r. x * r \<in> I)
(((0::'a) \<in> J \<and> (\<forall>a\<in>J. \<forall>b\<in>J. a + b \<in> J) \<and> (\<forall>a\<in>J. - a \<in> J)) \<and> (\<forall>x\<in>J. \<forall>r. r * x \<in> J)) \<and> ((0::'a) \<in> J \<and> (\<forall>a\<in>J. \<forall>b\<in>J. a + b \<in> J) \<and> (\<forall>a\<in>J. - a \<in> J)) \<and> (\<forall>x\<in>J. \<forall>r. x * r \<in> J)

goal (1 subgoal):
 1. (((0::'a) \<in> I \<inter> J \<and> (\<forall>a\<in>I \<inter> J. \<forall>b\<in>I \<inter> J. a + b \<in> I \<inter> J) \<and> (\<forall>a\<in>I \<inter> J. - a \<in> I \<inter> J)) \<and> (\<forall>x\<in>I \<inter> J. \<forall>r. r * x \<in> I \<inter> J)) \<and> ((0::'a) \<in> I \<inter> J \<and> (\<forall>a\<in>I \<inter> J. \<forall>b\<in>I \<inter> J. a + b \<in> I \<inter> J) \<and> (\<forall>a\<in>I \<inter> J. - a \<in> I \<inter> J)) \<and> (\<forall>x\<in>I \<inter> J. \<forall>r. x * r \<in> I \<inter> J)
[PROOF STEP]
by auto


[STATEMENT]
lemma iMOD_eq_conv: "0 < m \<Longrightarrow> ([r, mod m] = [r', mod m']) = (r = r' \<and> m = m')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> ([ r, mod m ] = [ r', mod m' ]) = (r = r' \<and> m = m')
[PROOF STEP]
apply (case_tac "m' = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m; m' = 0\<rbrakk> \<Longrightarrow> ([ r, mod m ] = [ r', mod m' ]) = (r = r' \<and> m = m')
 2. \<lbrakk>0 < m; m' \<noteq> 0\<rbrakk> \<Longrightarrow> ([ r, mod m ] = [ r', mod m' ]) = (r = r' \<and> m = m')
[PROOF STEP]
apply (simp add: eq_sym_conv[of "[r, mod m]"] iMOD_0_eq_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m' \<noteq> 0\<rbrakk> \<Longrightarrow> ([ r, mod m ] = [ r', mod m' ]) = (r = r' \<and> m = m')
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m; m' \<noteq> 0; [ r, mod m ] = [ r', mod m' ]\<rbrakk> \<Longrightarrow> r = r' \<and> m = m'
 2. \<lbrakk>0 < m; m' \<noteq> 0; r = r' \<and> m = m'\<rbrakk> \<Longrightarrow> [ r, mod m ] = [ r', mod m' ]
[PROOF STEP]
apply (fastforce simp add: set_eq_subset iMOD_subset_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m' \<noteq> 0; r = r' \<and> m = m'\<rbrakk> \<Longrightarrow> [ r, mod m ] = [ r', mod m' ]
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma orthogonal_Int_0:
  assumes "subspace U"
  shows "U \<inter> U\<^sup>\<bottom> = {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<inter> U\<^sup>\<bottom> = {0::'a}
[PROOF STEP]
using orthogonal_comp_def orthogonal_self
[PROOF STATE]
proof (prove)
using this:
?W\<^sup>\<bottom> \<equiv> {x. \<forall>y\<in>?W. orthogonal y x}
orthogonal ?x ?x = (?x = (0::?'a))

goal (1 subgoal):
 1. U \<inter> U\<^sup>\<bottom> = {0::'a}
[PROOF STEP]
by (force simp: assms subspace_0 subspace_orthogonal_comp)


[STATEMENT]
lemma zero_less_HMSet_iff[simp]: "0 < HMSet M \<longleftrightarrow> M \<noteq> {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < HMSet M) = (M \<noteq> {#})
[PROOF STEP]
by (simp only: zero_less_iff_neq_zero_hmset HMSet_eq_0_iff)


[STATEMENT]
lemma prob_conj_imp2:
  "prob ({x. Pr x} \<inter> msgs) = 0 \<Longrightarrow> prob ({x. Pr x \<and> Q x} \<inter> msgs) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob ({x. Pr x} \<inter> msgs) = 0 \<Longrightarrow> prob ({x. Pr x \<and> Q x} \<inter> msgs) = 0
[PROOF STEP]
using finite_measure_mono[of "{x. Pr x \<and> Q x} \<inter> msgs" "{x. Pr x} \<inter> msgs"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{x. Pr x \<and> Q x} \<inter> msgs \<subseteq> {x. Pr x} \<inter> msgs; {x. Pr x} \<inter> msgs \<in> events\<rbrakk> \<Longrightarrow> prob ({x. Pr x \<and> Q x} \<inter> msgs) \<le> prob ({x. Pr x} \<inter> msgs)

goal (1 subgoal):
 1. prob ({x. Pr x} \<inter> msgs) = 0 \<Longrightarrow> prob ({x. Pr x \<and> Q x} \<inter> msgs) = 0
[PROOF STEP]
using measure_nonneg[of \<mu> "{x. Pr x \<and> Q x} \<inter> msgs"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{x. Pr x \<and> Q x} \<inter> msgs \<subseteq> {x. Pr x} \<inter> msgs; {x. Pr x} \<inter> msgs \<in> events\<rbrakk> \<Longrightarrow> prob ({x. Pr x \<and> Q x} \<inter> msgs) \<le> prob ({x. Pr x} \<inter> msgs)
0 \<le> prob ({x. Pr x \<and> Q x} \<inter> msgs)

goal (1 subgoal):
 1. prob ({x. Pr x} \<inter> msgs) = 0 \<Longrightarrow> prob ({x. Pr x \<and> Q x} \<inter> msgs) = 0
[PROOF STEP]
by (simp add: subset_eq)


[STATEMENT]
lemma map_tailrec_is_listmap: "rev (map_tailrec f l accs) = (rev accs)@(List.map f l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (Efficient_Distinct.map_tailrec f l accs) = rev accs @ map f l
[PROOF STEP]
by (induction l accs rule: map_tailrec.induct) auto


[STATEMENT]
lemma csucc_le: "\<lbrakk>Card \<mu>; \<kappa> \<in> elts \<mu>\<rbrakk> \<Longrightarrow> csucc \<kappa> \<le> \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Card \<mu>; \<kappa> \<in> elts \<mu>\<rbrakk> \<Longrightarrow> csucc \<kappa> \<le> \<mu>
[PROOF STEP]
unfolding csucc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Card \<mu>; \<kappa> \<in> elts \<mu>\<rbrakk> \<Longrightarrow> (LEAST \<kappa>'. Ord \<kappa>' \<and> Card \<kappa>' \<and> \<kappa> < \<kappa>') \<le> \<mu>
[PROOF STEP]
by (simp add: Card_is_Ord Ord_Least_le OrdmemD)


[STATEMENT]
lemma (in linorder_topology) eventually_at_right:
  "x < y \<Longrightarrow> eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> eventually P (at_right x) = (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)
[PROOF STEP]
unfolding at_right_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> eventually P (INF a\<in>{x<..}. principal {x<..<a}) = (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)
[PROOF STEP]
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)


[STATEMENT]
lemma poincare_section3_rep[poincare_tac_theorems]:
              "{(200, -1000, -1000, -1000, -1000)..(200, 1000, 1000, 1000, 1000)::real*real*real*real*real} =
  {eucl_of_list [200, -1000, -1000, -1000, -1000]..eucl_of_list [200, 1000, 1000, 1000, 1000]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(200, - 1000, - 1000, - 1000, - 1000)..(200, 1000, 1000, 1000, 1000)} = {eucl_of_list [200, - 1000, - 1000, - 1000, - 1000]..eucl_of_list [200, 1000, 1000, 1000, 1000]}
[PROOF STEP]
by (auto simp: eucl_of_list_prod)


[STATEMENT]
lemma diff_union:
  shows "A - (\<Union> i \<le> n. B i) - B (Suc n) = A - (\<Union> i \<le> (Suc n). B i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - \<Union> (B ` {..n}) - B (Suc n) = A - \<Union> (B ` {..Suc n})
[PROOF STEP]
using atMost_Suc
[PROOF STATE]
proof (prove)
using this:
{..Suc ?k} = insert (Suc ?k) {..?k}

goal (1 subgoal):
 1. A - \<Union> (B ` {..n}) - B (Suc n) = A - \<Union> (B ` {..Suc n})
[PROOF STEP]
by auto


[STATEMENT]
lemma conj_eqvt:
  shows "pi\<bullet>(A\<and>B) = ((pi\<bullet>A)\<and>(pi\<bullet>B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi \<bullet> (A \<and> B) = (pi \<bullet> A \<and> pi \<bullet> B)
[PROOF STEP]
by (simp add: perm_bool)


[STATEMENT]
lemma dual_downset: "downset = dual_ord.upset"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<down> = ord.upset (\<lambda>x y. y \<le> x)
[PROOF STEP]
by (simp add: dual_ord.dual_upset)


[STATEMENT]
lemma is_scc_restrict1:
  assumes SCC: "is_scc E U"
  shows "U\<times>U\<subseteq>(E\<inter>U\<times>U)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<times> U \<subseteq> (Restr E U)\<^sup>*
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_scc E U

goal (1 subgoal):
 1. U \<times> U \<subseteq> (Restr E U)\<^sup>*
[PROOF STEP]
unfolding is_scc_def
[PROOF STATE]
proof (prove)
using this:
U \<times> U \<subseteq> E\<^sup>* \<and> (\<forall>V. U \<subset> V \<longrightarrow> \<not> V \<times> V \<subseteq> E\<^sup>*)

goal (1 subgoal):
 1. U \<times> U \<subseteq> (Restr E U)\<^sup>*
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>U \<times> U \<subseteq> E\<^sup>*; \<forall>V. U \<subset> V \<longrightarrow> \<not> V \<times> V \<subseteq> E\<^sup>*; a \<in> U; b \<in> U\<rbrakk> \<Longrightarrow> (a, b) \<in> (Restr E U)\<^sup>*
[PROOF STEP]
apply (rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>U \<times> U \<subseteq> E\<^sup>*; \<forall>V. U \<subset> V \<longrightarrow> \<not> V \<times> V \<subseteq> E\<^sup>*; a \<in> U; b \<in> U; (a, b) \<notin> (Restr E U)\<^sup>*\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule (2) find_outside_node[rotated])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>U \<times> U \<subseteq> E\<^sup>*; \<forall>V. U \<subset> V \<longrightarrow> \<not> V \<times> V \<subseteq> E\<^sup>*; a \<in> U; b \<in> U\<rbrakk> \<Longrightarrow> (a, b) \<in> E\<^sup>*
 2. \<And>a b. \<lbrakk>U \<times> U \<subseteq> E\<^sup>*; \<forall>V. U \<subset> V \<longrightarrow> \<not> V \<times> V \<subseteq> E\<^sup>*; a \<in> U; b \<in> U; \<exists>u'. u' \<notin> U \<and> (a, u') \<in> E\<^sup>* \<and> (u', b) \<in> E\<^sup>*\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply auto []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>U \<times> U \<subseteq> E\<^sup>*; \<forall>V. U \<subset> V \<longrightarrow> \<not> V \<times> V \<subseteq> E\<^sup>*; a \<in> U; b \<in> U; \<exists>u'. u' \<notin> U \<and> (a, u') \<in> E\<^sup>* \<and> (u', b) \<in> E\<^sup>*\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis is_scc_closed[OF SCC] mem_Sigma_iff rtrancl_trans subsetD)


[STATEMENT]
lemma Minr_is_Suc[simp]: "\<lbrakk>Minr Rr xs w = Suc w; Rr (xs @ [Suc w])\<rbrakk> \<Longrightarrow>
                                       Minr Rr xs (Suc w) = Suc w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Minr Rr xs w = Suc w; Rr (xs @ [Suc w])\<rbrakk> \<Longrightarrow> Minr Rr xs (Suc w) = Suc w
[PROOF STEP]
apply(simp add: Minr.simps expand_conj_in_set)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(if \<forall>x\<le>w. \<not> Rr (xs @ [x]) then Suc w else Min {uu_. uu_ \<le> w \<and> Rr (xs @ [uu_])}) = Suc w; Rr (xs @ [Suc w])\<rbrakk> \<Longrightarrow> Min (insert (Suc w) {uu_. uu_ \<le> w \<and> Rr (xs @ [uu_])}) = Suc w
[PROOF STEP]
apply(cases "\<forall>x\<le>w. \<not> Rr (xs @ [x])", auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma exponential_density_def:
  "exponential_density l x = (if x < 0 then 0 else l * exp (- x * l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exponential_density l x = (if x < 0 then 0 else l * exp (- x * l))
[PROOF STEP]
by (simp add: fun_eq_iff erlang_density_def)


[STATEMENT]
lemma Example2_lemma2_aux2:
  "j\<le> s \<Longrightarrow> (\<Sum>i::nat=0..<j. (b (s:=t)) i) = (\<Sum>i=0..<j. b i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> s \<Longrightarrow> sum (b(s := t)) {0..<j} = sum b {0..<j}
[PROOF STEP]
by (induct j) simp_all


[STATEMENT]
lemma abs_Im_le_cmod: "\<bar>Im x\<bar> \<le> cmod x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Im x\<bar> \<le> cmod x
[PROOF STEP]
by (simp add: norm_complex_def)


[STATEMENT]
lemma fpxs_of_fls_mult [simp]: "fpxs_of_fls (f * g) = fpxs_of_fls f * fpxs_of_fls g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_of_fls (f * g) = fpxs_of_fls f * fpxs_of_fls g
[PROOF STEP]
proof (rule fpxs_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
fix r :: rat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
show "fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
proof (cases "r \<in> \<int>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r \<in> \<int>

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
define h1 where "h1 = (\<lambda>(x, y). (\<lfloor>x::rat\<rfloor>, \<lfloor>y::rat\<rfloor>))"
[PROOF STATE]
proof (state)
this:
h1 = (\<lambda>(x, y). (\<lfloor>x\<rfloor>, \<lfloor>y\<rfloor>))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
define h2 where "h2 = (\<lambda>(x, y). (of_int x :: rat, of_int y :: rat))"
[PROOF STATE]
proof (state)
this:
h2 = (\<lambda>(x, y). (rat_of_int x, rat_of_int y))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
define df dg where [simp]: "df = fls_subdegree f" "dg = fls_subdegree g"
[PROOF STATE]
proof (state)
this:
df = fls_subdegree f
dg = fls_subdegree g

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
r \<in> \<int>
[PROOF STEP]
obtain n where [simp]: "r = of_int n"
[PROOF STATE]
proof (prove)
using this:
r \<in> \<int>

goal (1 subgoal):
 1. (\<And>n. r = rat_of_int n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases rule: Ints_cases)
[PROOF STATE]
proof (state)
this:
r = rat_of_int n

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r =
            (\<Sum>(y,z) | y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> rat_of_int n = y + z.
              (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else 0) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> rat_of_int n = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a)))
[PROOF STEP]
by (auto simp: fpxs_nth_mult fpxs_nth_of_fls)
[PROOF STATE]
proof (state)
this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> rat_of_int n = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a)))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> rat_of_int n = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a)))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "\<dots> = (\<Sum>(y,z) | y \<in> supp (fls_nth f) \<and> z \<in> supp (fls_nth g) \<and> n = y + z.
                      fls_nth f y * fls_nth g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> rat_of_int n = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a))) = (\<Sum>(y, z)\<in>{(y, z). y \<in> supp (fls_nth f) \<and> z \<in> supp (fls_nth g) \<and> n = y + z}. fls_nth f y * fls_nth g z)
[PROOF STEP]
by (rule sum.reindex_bij_witness[of _ h2 h1]) (auto simp: h1_def h2_def fpxs_supp_of_fls)
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> rat_of_int n = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a))) = (\<Sum>(y, z)\<in>{(y, z). y \<in> supp (fls_nth f) \<and> z \<in> supp (fls_nth g) \<and> n = y + z}. fls_nth f y * fls_nth g z)

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> rat_of_int n = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a))) = (\<Sum>(y, z)\<in>{(y, z). y \<in> supp (fls_nth f) \<and> z \<in> supp (fls_nth g) \<and> n = y + z}. fls_nth f y * fls_nth g z)

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "\<dots> = (\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g).
                      fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(y, z)\<in>{(y, z). y \<in> supp (fls_nth f) \<and> z \<in> supp (fls_nth g) \<and> n = y + z}. fls_nth f y * fls_nth g z) = (\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g). fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y))
[PROOF STEP]
by (rule sum.reindex_bij_witness[of _ "\<lambda>y. (y - fls_subdegree g, fls_subdegree g + n - y)" "\<lambda>z. fst z + fls_subdegree g"])
         auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, z)\<in>{(y, z). y \<in> supp (fls_nth f) \<and> z \<in> supp (fls_nth g) \<and> n = y + z}. fls_nth f y * fls_nth g z) = (\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g). fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, z)\<in>{(y, z). y \<in> supp (fls_nth f) \<and> z \<in> supp (fls_nth g) \<and> n = y + z}. fls_nth f y * fls_nth g z) = (\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g). fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "\<dots> = (\<Sum>i = fls_subdegree f + fls_subdegree g..n.
              fls_nth f (i - fls_subdegree g) * fls_nth g (fls_subdegree g + n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g). fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y)) = (\<Sum>i = fls_subdegree f + fls_subdegree g..n. fls_nth f (i - fls_subdegree g) * fls_nth g (fls_subdegree g + n - i))
[PROOF STEP]
using fls_subdegree_leI[of f] fls_subdegree_leI [of g]
[PROOF STATE]
proof (prove)
using this:
fls_nth f ?n \<noteq> (0::'a) \<Longrightarrow> fls_subdegree f \<le> ?n
fls_nth g ?n \<noteq> (0::'a) \<Longrightarrow> fls_subdegree g \<le> ?n

goal (1 subgoal):
 1. (\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g). fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y)) = (\<Sum>i = fls_subdegree f + fls_subdegree g..n. fls_nth f (i - fls_subdegree g) * fls_nth g (fls_subdegree g + n - i))
[PROOF STEP]
by (intro sum.mono_neutral_left; force simp: supp_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g). fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y)) = (\<Sum>i = fls_subdegree f + fls_subdegree g..n. fls_nth f (i - fls_subdegree g) * fls_nth g (fls_subdegree g + n - i))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y | y - fls_subdegree g \<in> supp (fls_nth f) \<and> fls_subdegree g + n - y \<in> supp (fls_nth g). fls_nth f (y - fls_subdegree g) * fls_nth g (fls_subdegree g + n - y)) = (\<Sum>i = fls_subdegree f + fls_subdegree g..n. fls_nth f (i - fls_subdegree g) * fls_nth g (fls_subdegree g + n - i))

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "\<dots> = fpxs_nth (fpxs_of_fls (f * g)) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = fls_subdegree f + fls_subdegree g..n. fls_nth f (i - fls_subdegree g) * fls_nth g (fls_subdegree g + n - i)) = fpxs_nth (fpxs_of_fls (f * g)) r
[PROOF STEP]
by (auto simp: fls_times_nth fpxs_nth_of_fls)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = fls_subdegree f + fls_subdegree g..n. fls_nth f (i - fls_subdegree g) * fls_nth g (fls_subdegree g + n - i)) = fpxs_nth (fpxs_of_fls (f * g)) r

goal (2 subgoals):
 1. r \<in> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
 2. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = fpxs_nth (fpxs_of_fls (f * g)) r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = fpxs_nth (fpxs_of_fls (f * g)) r

goal (1 subgoal):
 1. fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r

goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r \<notin> \<int>

goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r =
            (\<Sum>(y,z) | y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z.
              (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else 0) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a)))
[PROOF STEP]
by (simp add: fpxs_nth_mult fpxs_nth_of_fls)
[PROOF STATE]
proof (state)
this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a)))

goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a)))

goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a))) = (0::'a)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
r \<notin> \<int>

goal (1 subgoal):
 1. (\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a))) = (0::'a)
[PROOF STEP]
by (intro sum.neutral ballI) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a))) = (0::'a)

goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(y, z)\<in>{(y, z). y \<in> fpxs_supp (fpxs_of_fls f) \<and> z \<in> fpxs_supp (fpxs_of_fls g) \<and> r = y + z}. (if y \<in> \<int> then fls_nth f \<lfloor>y\<rfloor> else (0::'a)) * (if z \<in> \<int> then fls_nth g \<lfloor>z\<rfloor> else (0::'a))) = (0::'a)

goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
have "0 = fpxs_nth (fpxs_of_fls (f * g)) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) = fpxs_nth (fpxs_of_fls (f * g)) r
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
r \<notin> \<int>

goal (1 subgoal):
 1. (0::'a) = fpxs_nth (fpxs_of_fls (f * g)) r
[PROOF STEP]
by (simp add: fpxs_nth_of_fls)
[PROOF STATE]
proof (state)
this:
(0::'a) = fpxs_nth (fpxs_of_fls (f * g)) r

goal (1 subgoal):
 1. r \<notin> \<int> \<Longrightarrow> fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = fpxs_nth (fpxs_of_fls (f * g)) r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r = fpxs_nth (fpxs_of_fls (f * g)) r

goal (1 subgoal):
 1. fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fpxs_nth (fpxs_of_fls (f * g)) r = fpxs_nth (fpxs_of_fls f * fpxs_of_fls g) r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Corps) subfield_mOp:"\<lbrakk>Corps K'; subfield K K'; x \<in> carrier K\<rbrakk> \<Longrightarrow>
                     -\<^sub>a x = -\<^sub>a\<^bsub>K'\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Corps K'; subfield K K'; x \<in> carrier K\<rbrakk> \<Longrightarrow> -\<^sub>a x = -\<^sub>a\<^bsub>K'\<^esub> x
[PROOF STEP]
apply (cut_tac field_is_ring, frule Corps.field_is_ring[of "K'"],
       frule Ring.ring_is_ag[of "K"], frule Ring.ring_is_ag[of "K'"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Corps K'; subfield K K'; x \<in> carrier K; Ring K; Ring K'; aGroup K; aGroup K'\<rbrakk> \<Longrightarrow> -\<^sub>a x = -\<^sub>a\<^bsub>K'\<^esub> x
[PROOF STEP]
apply (simp add:subfield_def, erule conjE, simp add:rHom_def,
       frule conjunct1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Corps K'; x \<in> carrier K; Ring K; Ring K'; aGroup K; aGroup K'; carrier K \<subseteq> carrier K'; I\<^bsub>K\<^esub> \<in> aHom K K' \<and> (\<forall>x\<in>carrier K. \<forall>y\<in>carrier K. I\<^bsub>K\<^esub> (x \<cdot>\<^sub>r y) = I\<^bsub>K\<^esub> x \<cdot>\<^sub>r\<^bsub>K'\<^esub> I\<^bsub>K\<^esub> y) \<and> I\<^bsub>K\<^esub> 1\<^sub>r = 1\<^sub>r\<^bsub>K'\<^esub>; I\<^bsub>K\<^esub> \<in> aHom K K'\<rbrakk> \<Longrightarrow> -\<^sub>a x = -\<^sub>a\<^bsub>K'\<^esub> x
[PROOF STEP]
apply (thin_tac "I\<^bsub>K\<^esub> \<in> aHom K K' \<and>
     (\<forall>x\<in>carrier K. \<forall>y\<in>carrier K. I\<^bsub>K\<^esub> (x \<cdot>\<^sub>r y) = I\<^bsub>K\<^esub> x \<cdot>\<^sub>r\<^bsub>K'\<^esub> I\<^bsub>K\<^esub> y) \<and>
     I\<^bsub>K\<^esub> 1\<^sub>r = 1\<^sub>r\<^bsub>K'\<^esub>")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Corps K'; x \<in> carrier K; Ring K; Ring K'; aGroup K; aGroup K'; carrier K \<subseteq> carrier K'; I\<^bsub>K\<^esub> \<in> aHom K K'\<rbrakk> \<Longrightarrow> -\<^sub>a x = -\<^sub>a\<^bsub>K'\<^esub> x
[PROOF STEP]
apply (frule aHom_inv_inv[of "K" "K'" "I\<^bsub>K\<^esub>" "x"], assumption+,
       frule aGroup.ag_mOp_closed[of "K" "x"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Corps K'; x \<in> carrier K; Ring K; Ring K'; aGroup K; aGroup K'; carrier K \<subseteq> carrier K'; I\<^bsub>K\<^esub> \<in> aHom K K'; I\<^bsub>K\<^esub> (-\<^sub>a x) = -\<^sub>a\<^bsub>K'\<^esub> I\<^bsub>K\<^esub> x; -\<^sub>a x \<in> carrier K\<rbrakk> \<Longrightarrow> -\<^sub>a x = -\<^sub>a\<^bsub>K'\<^esub> x
[PROOF STEP]
apply (simp add:idmap_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pres_eq_iff_svb: "((=),(=))\<in>K\<rightarrow>K\<rightarrow>bool_rel \<longleftrightarrow> (single_valued K \<and> single_valued (K\<inverse>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((=), (=)) \<in> K \<rightarrow> K \<rightarrow> bool_rel) = (single_valued K \<and> single_valued (K\<inverse>))
[PROOF STEP]
apply (safe intro!: single_valuedI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x y z. \<lbrakk>((=), (=)) \<in> K \<rightarrow> K \<rightarrow> bool_rel; (x, y) \<in> K; (x, z) \<in> K\<rbrakk> \<Longrightarrow> y = z
 2. \<And>x y z. \<lbrakk>((=), (=)) \<in> K \<rightarrow> K \<rightarrow> bool_rel; (y, x) \<in> K; (z, x) \<in> K\<rbrakk> \<Longrightarrow> y = z
 3. \<And>a a' aa a'a. \<lbrakk>(aa, a') \<in> K; (aa, a'a) \<in> K; single_valued K; single_valued (K\<inverse>)\<rbrakk> \<Longrightarrow> a' = a'a
 4. \<And>a a' aa a'a. \<lbrakk>(a, a'a) \<in> K; (aa, a'a) \<in> K; single_valued K; single_valued (K\<inverse>)\<rbrakk> \<Longrightarrow> a = aa
[PROOF STEP]
apply (metis (full_types) IdD fun_relD1)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x y z. \<lbrakk>((=), (=)) \<in> K \<rightarrow> K \<rightarrow> bool_rel; (y, x) \<in> K; (z, x) \<in> K\<rbrakk> \<Longrightarrow> y = z
 2. \<And>a a' aa a'a. \<lbrakk>(aa, a') \<in> K; (aa, a'a) \<in> K; single_valued K; single_valued (K\<inverse>)\<rbrakk> \<Longrightarrow> a' = a'a
 3. \<And>a a' aa a'a. \<lbrakk>(a, a'a) \<in> K; (aa, a'a) \<in> K; single_valued K; single_valued (K\<inverse>)\<rbrakk> \<Longrightarrow> a = aa
[PROOF STEP]
apply (metis (full_types) IdD fun_relD1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a a' aa a'a. \<lbrakk>(aa, a') \<in> K; (aa, a'a) \<in> K; single_valued K; single_valued (K\<inverse>)\<rbrakk> \<Longrightarrow> a' = a'a
 2. \<And>a a' aa a'a. \<lbrakk>(a, a'a) \<in> K; (aa, a'a) \<in> K; single_valued K; single_valued (K\<inverse>)\<rbrakk> \<Longrightarrow> a = aa
[PROOF STEP]
by (auto dest: single_valuedD)


[STATEMENT]
lemma vector_one_nth [simp]:
  fixes x :: "'a^1" shows "vec (x $ 1) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (x $ 1) = x
[PROOF STEP]
by (metis vec_def vector_one)


[STATEMENT]
lemma eliminate_entries_gen [simp]:
  assumes "i<(dim_row A)" "j<(dim_col A)" shows
  "eliminate_entries_gen mminus ttimes v A I J $$ (i, j) =
   (if i = I then A $$ (i,j) else mminus (A $$ (i,j)) (ttimes (v i) (A $$ (I,j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eliminate_entries_gen mminus ttimes v A I J $$ (i, j) = (if i = I then A $$ (i, j) else mminus (A $$ (i, j)) (ttimes (v i) (A $$ (I, j))))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A

goal (1 subgoal):
 1. eliminate_entries_gen mminus ttimes v A I J $$ (i, j) = (if i = I then A $$ (i, j) else mminus (A $$ (i, j)) (ttimes (v i) (A $$ (I, j))))
[PROOF STEP]
unfolding eliminate_entries_gen_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A

goal (1 subgoal):
 1. mat (dim_row A) (dim_col A) (\<lambda>(i, j). if i \<noteq> I then mminus (A $$ (i, j)) (ttimes (v i) (A $$ (I, j))) else A $$ (i, j)) $$ (i, j) = (if i = I then A $$ (i, j) else mminus (A $$ (i, j)) (ttimes (v i) (A $$ (I, j))))
[PROOF STEP]
by auto


[STATEMENT]
lemma Farkas_Lemma: fixes A :: "'a mat" and b :: "'a vec"
  assumes A: "A \<in> carrier_mat n nr" and b: "b \<in> carrier_vec n"
  shows "(\<exists> x. x \<ge> 0\<^sub>v nr \<and> A *\<^sub>v x = b) \<longleftrightarrow> (\<forall> y. y \<in> carrier_vec n \<longrightarrow> A\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v nr \<longrightarrow> y \<bullet> b \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
let ?C = "set (cols A)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n nr
[PROOF STEP]
have C: "?C \<subseteq> carrier_vec n" and C': " \<forall>w\<in>set (cols A). dim_vec w = n"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n nr

goal (1 subgoal):
 1. set (cols A) \<subseteq> carrier_vec n &&& \<forall>w\<in>set (cols A). dim_vec w = n
[PROOF STEP]
unfolding cols_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n nr

goal (1 subgoal):
 1. set (map (col A) [0..<dim_col A]) \<subseteq> carrier_vec n &&& \<forall>w\<in>set (map (col A) [0..<dim_col A]). dim_vec w = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (cols A) \<subseteq> carrier_vec n
\<forall>w\<in>set (cols A). dim_vec w = n

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "(\<exists> x. x \<ge> 0\<^sub>v nr \<and> A *\<^sub>v x = b) = (b \<in> cone ?C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (b \<in> cone (set (cols A)))
[PROOF STEP]
using cone_of_cols[OF A b]
[PROOF STATE]
proof (prove)
using this:
(b \<in> cone (set (cols A))) = (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b)

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (b \<in> cone (set (cols A)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (b \<in> cone (set (cols A)))

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (b \<in> cone (set (cols A)))

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>?C. 0 \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<in> cone (set (cols A))) = (\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a))
[PROOF STEP]
unfolding fundamental_theorem_of_linear_inequalities(3)[OF C finite_set] mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<in> carrier_vec n \<and> (\<nexists>c. c \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> c \<bullet> a\<^sub>i) \<and> c \<bullet> b < (0::'a))) = (\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a))
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec n

goal (1 subgoal):
 1. (b \<in> carrier_vec n \<and> (\<nexists>c. c \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> c \<bullet> a\<^sub>i) \<and> c \<bullet> b < (0::'a))) = (\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(b \<in> cone (set (cols A))) = (\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a))

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(b \<in> cone (set (cols A))) = (\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a))

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> (\<forall>a\<^sub>i\<in>?C. 0 \<le> y \<bullet> a\<^sub>i) \<longrightarrow> y \<bullet> b \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a)) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a)) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<nexists>y. y \<in> carrier_vec n \<and> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<and> y \<bullet> b < (0::'a)) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<forall> y. y \<in> carrier_vec n \<longrightarrow> A\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v nr \<longrightarrow> y \<bullet> b \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y. y \<in> carrier_vec n \<longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<longrightarrow> (0::'a) \<le> y \<bullet> b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
proof (intro all_cong imp_cong refl)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec n \<Longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
fix y :: "'a vec"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec n \<Longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
assume y: "y \<in> carrier_vec n"
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec n \<Longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
have "(\<forall>a\<^sub>i\<in> ?C. 0 \<le> y \<bullet> a\<^sub>i) = (\<forall>a\<^sub>i\<in> ?C. 0 \<le> a\<^sub>i \<bullet> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> a\<^sub>i \<bullet> y)
[PROOF STEP]
by (intro ball_cong[OF refl], subst comm_scalar_prod[OF y], insert C, auto)
[PROOF STATE]
proof (state)
this:
(\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> a\<^sub>i \<bullet> y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec n \<Longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> a\<^sub>i \<bullet> y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec n \<Longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
have "\<dots> = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> a\<^sub>i \<bullet> y) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> a\<^sub>i \<bullet> y) = (dim_vec (0\<^sub>v nr) = dim_vec (A\<^sup>T *\<^sub>v y) \<and> (\<forall>i<dim_vec (A\<^sup>T *\<^sub>v y). 0\<^sub>v nr $ i \<le> (A\<^sup>T *\<^sub>v y) $ i))
[PROOF STEP]
using C A y
[PROOF STATE]
proof (prove)
using this:
set (cols A) \<subseteq> carrier_vec n
A \<in> carrier_mat n nr
y \<in> carrier_vec n

goal (1 subgoal):
 1. (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> a\<^sub>i \<bullet> y) = (dim_vec (0\<^sub>v nr) = dim_vec (A\<^sup>T *\<^sub>v y) \<and> (\<forall>i<dim_vec (A\<^sup>T *\<^sub>v y). 0\<^sub>v nr $ i \<le> (A\<^sup>T *\<^sub>v y) $ i))
[PROOF STEP]
by (auto simp: cols_def)
[PROOF STATE]
proof (state)
this:
(\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> a\<^sub>i \<bullet> y) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec n \<Longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
show "(\<forall>a\<^sub>i\<in>set (cols A). 0 \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
using this:
(\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) = (0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>y. y \<in> carrier_vec n \<longrightarrow> (\<forall>a\<^sub>i\<in>set (cols A). (0::'a) \<le> y \<bullet> a\<^sub>i) \<longrightarrow> (0::'a) \<le> y \<bullet> b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<exists>x\<ge>0\<^sub>v nr. A *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec n \<longrightarrow> 0\<^sub>v nr \<le> A\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_Suc_conv: "
  ((Suc a) mod m = (Suc b) mod m) = (a mod m = b mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc a mod m = Suc b mod m) = (a mod m = b mod m)
[PROOF STEP]
by (simp add: mod_Suc)


[STATEMENT]
lemma max_flow_val_unique:
  "\<lbrakk>is_max_flow_val fv1; is_max_flow_val fv2\<rbrakk> \<Longrightarrow> fv1=fv2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_max_flow_val fv1; is_max_flow_val fv2\<rbrakk> \<Longrightarrow> fv1 = fv2
[PROOF STEP]
unfolding is_max_flow_val_def isMaxFlow_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>f. (Flow c s t f \<and> (\<forall>f'. Flow c s t f' \<longrightarrow> Flow.val c s f' \<le> Flow.val c s f)) \<and> fv1 = Flow.val c s f; \<exists>f. (Flow c s t f \<and> (\<forall>f'. Flow c s t f' \<longrightarrow> Flow.val c s f' \<le> Flow.val c s f)) \<and> fv2 = Flow.val c s f\<rbrakk> \<Longrightarrow> fv1 = fv2
[PROOF STEP]
by (auto simp: antisym)


[STATEMENT]
lemma starset_n_Un: "*sn* (\<lambda>n. (A n) \<union> (B n)) = *sn* A \<union> *sn* B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. *sn* (\<lambda>n. A n \<union> B n) = *sn* A \<union> *sn* B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. *sn* (\<lambda>n. A n \<union> B n) = *sn* A \<union> *sn* B
[PROOF STEP]
have "\<And>N. Iset ((*f* (\<lambda>n. {x. x \<in> A n \<or> x \<in> B n})) N) =
    {x. x \<in> Iset ((*f* A) N) \<or> x \<in> Iset ((*f* B) N)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. Iset ((*f* (\<lambda>n. {x. x \<in> A n \<or> x \<in> B n})) N) = {x. x \<in> Iset ((*f* A) N) \<or> x \<in> Iset ((*f* B) N)}
[PROOF STEP]
by transfer simp
[PROOF STATE]
proof (state)
this:
Iset ((*f* (\<lambda>n. {x. x \<in> A n \<or> x \<in> B n})) ?N) = {x. x \<in> Iset ((*f* A) ?N) \<or> x \<in> Iset ((*f* B) ?N)}

goal (1 subgoal):
 1. *sn* (\<lambda>n. A n \<union> B n) = *sn* A \<union> *sn* B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Iset ((*f* (\<lambda>n. {x. x \<in> A n \<or> x \<in> B n})) ?N) = {x. x \<in> Iset ((*f* A) ?N) \<or> x \<in> Iset ((*f* B) ?N)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Iset ((*f* (\<lambda>n. {x. x \<in> A n \<or> x \<in> B n})) ?N) = {x. x \<in> Iset ((*f* A) ?N) \<or> x \<in> Iset ((*f* B) ?N)}

goal (1 subgoal):
 1. *sn* (\<lambda>n. A n \<union> B n) = *sn* A \<union> *sn* B
[PROOF STEP]
by (simp add: starset_n_def star_n_eq_starfun_whn Un_def)
[PROOF STATE]
proof (state)
this:
*sn* (\<lambda>n. A n \<union> B n) = *sn* A \<union> *sn* B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem TBtheorem2a:
assumes "eout PQ E"
       and "subcomponents PQ = {P,Q}"
       and "correctCompositionOut PQ"
shows    "eout P E \<or> eout Q E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eout P E \<or> eout Q E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
eout PQ E
subcomponents PQ = {P, Q}
correctCompositionOut PQ

goal (1 subgoal):
 1. eout P E \<or> eout Q E
[PROOF STEP]
by (simp add: eout_def correctCompositionOut_def, auto)


[STATEMENT]
lemma fps_compose_Lambert_W': "fps_compose (fps_X * fps_exp 1) fps_Lambert_W  = fps_X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_X * fps_exp 1 oo fps_Lambert_W = fps_X
[PROOF STEP]
unfolding fps_Lambert_W_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_X * fps_exp 1 oo fps_inv (fps_X * fps_exp 1) = fps_X
[PROOF STEP]
by (rule fps_inv_right) auto


[STATEMENT]
lemma prod_mset_const_poly: "(\<Prod>x\<in>#A. [:f x:]) = [:prod_mset (image_mset f A):]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>#A. [:f x:]) = [:\<Prod>\<^sub># (image_mset f A):]
[PROOF STEP]
by (induct A) (simp_all add: ac_simps)


[STATEMENT]
lemma carrier_relative_homology_group:
   "carrier(relative_homology_group (int p) X S)
 = (homologous_rel_set p X S) ` singular_relcycle_set p X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (relative_homology_group (int p) X S) = homologous_rel_set p X S ` singular_relcycle_set p X S
[PROOF STEP]
by (auto simp: set_eq_iff image_iff relative_homology_group_def FactGroup_def RCOSETS_def right_coset_singular_relboundary)


[STATEMENT]
lemma homeomorphism_on_subset:
  assumes "homeomorphism_on S f"
          "T \<subseteq> S"
  shows "homeomorphism_on T f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism_on T f
[PROOF STEP]
using assms homeomorphism_of_subsets
[PROOF STATE]
proof (prove)
using this:
homeomorphism_on S f
T \<subseteq> S
\<lbrakk>homeomorphism ?S ?T ?f ?g; ?S' \<subseteq> ?S; ?T'' \<subseteq> ?T; ?f ` ?S' = ?T'\<rbrakk> \<Longrightarrow> homeomorphism ?S' ?T' ?f ?g

goal (1 subgoal):
 1. homeomorphism_on T f
[PROOF STEP]
unfolding homeomorphism_on_def
[PROOF STATE]
proof (prove)
using this:
Ex (homeomorphism S (f ` S) f)
T \<subseteq> S
\<lbrakk>homeomorphism ?S ?T ?f ?g; ?S' \<subseteq> ?S; ?T'' \<subseteq> ?T; ?f ` ?S' = ?T'\<rbrakk> \<Longrightarrow> homeomorphism ?S' ?T' ?f ?g

goal (1 subgoal):
 1. Ex (homeomorphism T (f ` T) f)
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_kmin:
"finite (kmin f PR)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (kmin f PR)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (kmin f PR)
[PROOF STEP]
have "finite PR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite PR
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite PR

goal (1 subgoal):
 1. finite (kmin f PR)
[PROOF STEP]
with  kmin_prop and finite_subset
[PROOF STATE]
proof (chain)
picking this:
kmin ?f PR \<subseteq> PR \<and> card (kmin ?f PR) = khl \<and> (\<forall>i\<in>kmin ?f PR. \<forall>j\<in>PR - kmin ?f PR. ?f i \<le> ?f j)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
finite PR
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
kmin ?f PR \<subseteq> PR \<and> card (kmin ?f PR) = khl \<and> (\<forall>i\<in>kmin ?f PR. \<forall>j\<in>PR - kmin ?f PR. ?f i \<le> ?f j)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
finite PR

goal (1 subgoal):
 1. finite (kmin f PR)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (kmin f PR)

goal:
No subgoals!
[PROOF STEP]
qed