[STATEMENT]
lemma gcs_minus:
  assumes "u adds s" and "u adds t"
  shows "gcs (s - u) (t - u) = gcs s t - u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcs (s - u) (t - u) = gcs s t - u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcs (s - u) (t - u) = gcs s t - u
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
u adds s
u adds t
[PROOF STEP]
have "gcs s t = gcs ((s - u) + u) ((t - u) + u)"
[PROOF STATE]
proof (prove)
using this:
u adds s
u adds t

goal (1 subgoal):
 1. gcs s t = gcs (s - u + u) (t - u + u)
[PROOF STEP]
by (simp add: minus_plus)
[PROOF STATE]
proof (state)
this:
gcs s t = gcs (s - u + u) (t - u + u)

goal (1 subgoal):
 1. gcs (s - u) (t - u) = gcs s t - u
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gcs s t = gcs (s - u + u) (t - u + u)

goal (1 subgoal):
 1. gcs (s - u) (t - u) = gcs s t - u
[PROOF STEP]
have "... = gcs (s - u) (t - u) + u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcs (s - u + u) (t - u + u) = gcs (s - u) (t - u) + u
[PROOF STEP]
by (simp only: gcs_plus_right)
[PROOF STATE]
proof (state)
this:
gcs (s - u + u) (t - u + u) = gcs (s - u) (t - u) + u

goal (1 subgoal):
 1. gcs (s - u) (t - u) = gcs s t - u
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gcs s t = gcs (s - u) (t - u) + u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gcs s t = gcs (s - u) (t - u) + u

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_zero_contra[dest,consumes 2]: "1 \<le> x \<Longrightarrow> (x :: QDelta) \<le> 0 \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> x; x \<le> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using order.trans[of 1 x 0] not_one_le_zero_qdelta
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> x; x \<le> 0\<rbrakk> \<Longrightarrow> 1 \<le> 0
\<not> 1 \<le> 0

goal (1 subgoal):
 1. \<lbrakk>1 \<le> x; x \<le> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by simp


[STATEMENT]
lemma Prefixes_empty_iff [simp]: "Prefixes A = {} \<longleftrightarrow> A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Prefixes A = {}) = (A = {})
[PROOF STEP]
by (auto simp: Prefixes_altdef)


[STATEMENT]
lemma cod_MkArr [simp]:
    assumes "arr (MkArr A B F)"
    shows "cod (MkArr A B F) = MkIde B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cod (MkArr A B F) = MkIde B
[PROOF STEP]
using assms cod_char
[PROOF STATE]
proof (prove)
using this:
arr (MkArr A B F)
cod ?f = (if arr ?f then MkIde (Cod ?f) else null)

goal (1 subgoal):
 1. cod (MkArr A B F) = MkIde B
[PROOF STEP]
by simp


[STATEMENT]
lemma euler_witness_mod[simp]: "euler_witness (a mod p) p = euler_witness a p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_witness (a mod int p) p = euler_witness a p
[PROOF STEP]
unfolding euler_witness_def cong_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Jacobi (a mod int p) (int p) mod int p \<noteq> (a mod int p) ^ ((p - 1) div 2) mod int p) = (Jacobi a (int p) mod int p \<noteq> a ^ ((p - 1) div 2) mod int p)
[PROOF STEP]
by (simp add: power_mod)


[STATEMENT]
lemma gbinomial_eq_0_int:
  assumes "n < k"
  shows "(int n) gchoose k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int n gchoose k = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int n gchoose k = 0
[PROOF STEP]
have "\<exists>a\<in>{0..<k}. int n - int a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a\<in>{0..<k}. int n - int a = 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. int n - int ?a = 0
 2. ?a \<in> {0..<k}
[PROOF STEP]
show "int n - int n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int n - int n = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int n - int n = 0

goal (1 subgoal):
 1. n \<in> {0..<k}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<in> {0..<k}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
n < k
[PROOF STEP]
show "n \<in> {0..<k}"
[PROOF STATE]
proof (prove)
using this:
n < k

goal (1 subgoal):
 1. n \<in> {0..<k}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n \<in> {0..<k}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>a\<in>{0..<k}. int n - int a = 0

goal (1 subgoal):
 1. int n gchoose k = 0
[PROOF STEP]
with finite_atLeastLessThan
[PROOF STATE]
proof (chain)
picking this:
finite {?l..<?u}
\<exists>a\<in>{0..<k}. int n - int a = 0
[PROOF STEP]
have eq: "prod (\<lambda>i. int n - int i) {0..<k} = 0"
[PROOF STATE]
proof (prove)
using this:
finite {?l..<?u}
\<exists>a\<in>{0..<k}. int n - int a = 0

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. int n - int i) = 0
[PROOF STEP]
by (rule prod_zero)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. int n - int i) = 0

goal (1 subgoal):
 1. int n gchoose k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int n gchoose k = 0
[PROOF STEP]
by (simp add: gbinomial_prod_rev eq)
[PROOF STATE]
proof (state)
this:
int n gchoose k = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma limitin_canonical_iff_gen [simp]:
  assumes "open S"
  shows "limitin (top_of_set S) f l F \<longleftrightarrow> (f \<longlongrightarrow> l) F \<and> l \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limitin (top_of_set S) f l F = ((f \<longlongrightarrow> l) F \<and> l \<in> S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
open S

goal (1 subgoal):
 1. limitin (top_of_set S) f l F = ((f \<longlongrightarrow> l) F \<and> l \<in> S)
[PROOF STEP]
by (auto simp: limitin_subtopology tendsto_def)


[STATEMENT]
lemma cost_Copy_Del: "cost(min_eds xs ys) \<le> cost (min_eds xs (x#ys)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cost (min_eds xs ys) \<le> cost (min_eds xs (x # ys)) + 1
[PROOF STEP]
apply(induction xs ys rule: min_eds.induct)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. cost (min_eds [] []) \<le> cost (min_eds [] [x]) + 1
 2. \<And>y ys. cost (min_eds [] ys) \<le> cost (min_eds [] (x # ys)) + 1 \<Longrightarrow> cost (min_eds [] (y # ys)) \<le> cost (min_eds [] (x # y # ys)) + 1
 3. \<And>xa xs. cost (min_eds xs []) \<le> cost (min_eds xs [x]) + 1 \<Longrightarrow> cost (min_eds (xa # xs) []) \<le> cost (min_eds (xa # xs) [x]) + 1
 4. \<And>xa xs y ys. \<lbrakk>cost (min_eds (xa # xs) ys) \<le> cost (min_eds (xa # xs) (x # ys)) + 1; cost (min_eds xs (y # ys)) \<le> cost (min_eds xs (x # y # ys)) + 1; cost (min_eds xs ys) \<le> cost (min_eds xs (x # ys)) + 1\<rbrakk> \<Longrightarrow> cost (min_eds (xa # xs) (y # ys)) \<le> cost (min_eds (xa # xs) (x # y # ys)) + 1
[PROOF STEP]
apply(auto simp del: filter_True filter_False split!: if_splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mirror_elem_mirror_elem_ident: "
  \<lbrakk> finite I; n \<le> iMin I + Max I \<rbrakk> \<Longrightarrow> mirror_elem (mirror_elem n I) I = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; n \<le> iMin I + Max I\<rbrakk> \<Longrightarrow> mirror_elem (mirror_elem n I) I = n
[PROOF STEP]
unfolding mirror_elem_def nat_mirror_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; n \<le> iMin I + Max I\<rbrakk> \<Longrightarrow> iMin I + Max I - (iMin I + Max I - n) = n
[PROOF STEP]
by simp


[STATEMENT]
lemma formulaWithEmptyClauseIsUnsatisfiable:
  fixes formula :: Formula
  assumes "([]::Clause) el formula"
  shows "\<not> satisfiable formula"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> satisfiable formula
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
[] el formula

goal (1 subgoal):
 1. \<not> satisfiable formula
[PROOF STEP]
by (auto simp add: satisfiable_def formulaTrueIffAllClausesAreTrue)


[STATEMENT]
lemma mono_SucI1: "\<forall>n. X n \<le> X (Suc n) \<Longrightarrow> monoseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. X n \<le> X (Suc n) \<Longrightarrow> monoseq X
[PROOF STEP]
by (simp add: monoseq_Suc)


[STATEMENT]
lemma c_insert_is_pr: "c_insert \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_insert \<in> PrimRec2
[PROOF STEP]
proof (unfold c_insert_def, rule if_eq_is_pr2)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. c_in \<in> PrimRec2
 2. (\<lambda>x y. 1) \<in> PrimRec2
 3. (\<lambda>x y. y) \<in> PrimRec2
 4. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
show "c_in \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_in \<in> PrimRec2
[PROOF STEP]
by (rule c_in_is_pr)
[PROOF STATE]
proof (state)
this:
c_in \<in> PrimRec2

goal (3 subgoals):
 1. (\<lambda>x y. 1) \<in> PrimRec2
 2. (\<lambda>x y. y) \<in> PrimRec2
 3. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x y. 1) \<in> PrimRec2
 2. (\<lambda>x y. y) \<in> PrimRec2
 3. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. 1) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. 1) \<in> PrimRec2
[PROOF STEP]
by (rule const_is_pr_2)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. 1) \<in> PrimRec2

goal (2 subgoals):
 1. (\<lambda>x y. y) \<in> PrimRec2
 2. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x y. y) \<in> PrimRec2
 2. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. y) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. y) \<in> PrimRec2
[PROOF STEP]
by (rule pr_id2_2)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. y) \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
from power_is_pr
[PROOF STATE]
proof (chain)
picking this:
(^) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. y + 2 ^ x) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
(^) \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. y + 2 ^ x) \<in> PrimRec2
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. y + 2 ^ x) \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_mono:
  "a \<subseteq> b \<Longrightarrow> b \<in> sets M \<Longrightarrow> emeasure M a \<le> emeasure M b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<subseteq> b; b \<in> sets M\<rbrakk> \<Longrightarrow> emeasure M a \<le> emeasure M b
[PROOF STEP]
by (metis zero_le sets.additive_increasing emeasure_additive emeasure_notin_sets emeasure_positive increasingD)


[STATEMENT]
lemma ceiling_add_numeral [simp]: "\<lceil>x + numeral v\<rceil> = \<lceil>x\<rceil> + numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x + numeral v\<rceil> = \<lceil>x\<rceil> + numeral v
[PROOF STEP]
using ceiling_add_of_int [of x "numeral v"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>x + of_int (numeral v)\<rceil> = \<lceil>x\<rceil> + numeral v

goal (1 subgoal):
 1. \<lceil>x + numeral v\<rceil> = \<lceil>x\<rceil> + numeral v
[PROOF STEP]
by simp


[STATEMENT]
lemma uminus_closed'[simp]: "\<forall>x\<in>U\<^sub>V\<^sub>S. -\<^sub>V\<^sub>S x \<in> U\<^sub>V\<^sub>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>U\<^sub>V\<^sub>S. -\<^sub>V\<^sub>S x \<in> U\<^sub>V\<^sub>S
[PROOF STEP]
by (simp add: uminus_closed)


[STATEMENT]
lemma stationary_distributionI_pair:
  assumes N1: "K1.stationary_distribution N1"
  assumes N2: "K2.stationary_distribution N2"
  shows "stationary_distribution (pair_pmf N1 N2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stationary_distribution (pair_pmf N1 N2)
[PROOF STEP]
unfolding stationary_distribution_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pair_pmf N1 N2 = pair_pmf N1 N2 \<bind> Kp
[PROOF STEP]
unfolding Kp_def pair_pmf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N1 \<bind> (\<lambda>x. N2 \<bind> (\<lambda>y. return_pmf (x, y))) = N1 \<bind> (\<lambda>x. N2 \<bind> (\<lambda>y. return_pmf (x, y))) \<bind> (\<lambda>(a, b). K1 a \<bind> (\<lambda>x. K2 b \<bind> (\<lambda>y. return_pmf (x, y))))
[PROOF STEP]
apply (subst N1[unfolded K1.stationary_distribution_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N1 \<bind> K1 \<bind> (\<lambda>x. N2 \<bind> (\<lambda>y. return_pmf (x, y))) = N1 \<bind> (\<lambda>x. N2 \<bind> (\<lambda>y. return_pmf (x, y))) \<bind> (\<lambda>(a, b). K1 a \<bind> (\<lambda>x. K2 b \<bind> (\<lambda>y. return_pmf (x, y))))
[PROOF STEP]
apply (subst N2[unfolded K2.stationary_distribution_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N1 \<bind> K1 \<bind> (\<lambda>x. N2 \<bind> K2 \<bind> (\<lambda>y. return_pmf (x, y))) = N1 \<bind> (\<lambda>x. N2 \<bind> (\<lambda>y. return_pmf (x, y))) \<bind> (\<lambda>(a, b). K1 a \<bind> (\<lambda>x. K2 b \<bind> (\<lambda>y. return_pmf (x, y))))
[PROOF STEP]
apply (simp add: bind_assoc_pmf bind_return_pmf)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N1 \<bind> (\<lambda>x. K1 x \<bind> (\<lambda>x. N2 \<bind> (\<lambda>xa. K2 xa \<bind> (\<lambda>y. return_pmf (x, y))))) = N1 \<bind> (\<lambda>x. N2 \<bind> (\<lambda>xa. K1 x \<bind> (\<lambda>x. K2 xa \<bind> (\<lambda>y. return_pmf (x, y)))))
[PROOF STEP]
apply (subst bind_commute_pmf[of N2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N1 \<bind> (\<lambda>x. K1 x \<bind> (\<lambda>x. N2 \<bind> (\<lambda>xa. K2 xa \<bind> (\<lambda>y. return_pmf (x, y))))) = N1 \<bind> (\<lambda>x. K1 x \<bind> (\<lambda>y. N2 \<bind> (\<lambda>x. K2 x \<bind> (\<lambda>ya. return_pmf (y, ya)))))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma not_eventually_sequentiallyD:
  assumes "\<not> eventually P sequentially"
  shows "\<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (\<forall>n. \<not> P (r n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (\<forall>n. \<not> P (r n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (\<forall>n. \<not> P (r n))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> eventually P sequentially
[PROOF STEP]
have "\<forall>n. \<exists>m\<ge>n. \<not> P m"
[PROOF STATE]
proof (prove)
using this:
\<not> eventually P sequentially

goal (1 subgoal):
 1. \<forall>n. \<exists>m\<ge>n. \<not> P m
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<nexists>N. \<forall>n\<ge>N. P n

goal (1 subgoal):
 1. \<forall>n. \<exists>m\<ge>n. \<not> P m
[PROOF STEP]
by (simp add: not_less)
[PROOF STATE]
proof (state)
this:
\<forall>n. \<exists>m\<ge>n. \<not> P m

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (\<forall>n. \<not> P (r n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. \<exists>m\<ge>n. \<not> P m
[PROOF STEP]
obtain r where "\<And>n. r n \<ge> n" "\<And>n. \<not> P (r n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<exists>m\<ge>n. \<not> P m

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>\<And>n. n \<le> r n; \<And>n. \<not> P (r n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: choice_iff)
[PROOF STATE]
proof (state)
this:
?n \<le> r ?n
\<not> P (r ?n)

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (\<forall>n. \<not> P (r n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?n \<le> r ?n
\<not> P (r ?n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?n \<le> r ?n
\<not> P (r ?n)

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (\<forall>n. \<not> P (r n))
[PROOF STEP]
by (auto intro!: exI[of _ "\<lambda>n. r (((Suc \<circ> r) ^^ Suc n) 0)"]
             simp: less_eq_Suc_le strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
\<exists>r. strict_mono r \<and> (\<forall>n. \<not> P (r n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_prod_mset:
  assumes "0 \<notin># A"
  shows   "order x (prod_mset A) = sum_mset (image_mset (order x) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x (\<Prod>\<^sub># A) = \<Sum>\<^sub># (image_mset (order x) A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<notin># A

goal (1 subgoal):
 1. order x (\<Prod>\<^sub># A) = \<Sum>\<^sub># (image_mset (order x) A)
[PROOF STEP]
by (induction A) (auto simp: order_mult)


[STATEMENT]
lemma (in cpx_sq_mat) cpx_sq_mat_mult:
  assumes "A \<in> fc_mats"
  and "B \<in> fc_mats"
shows "A * B \<in> fc_mats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B \<in> fc_mats
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * B \<in> fc_mats
[PROOF STEP]
have "dim_row (A * B) = dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (A * B) = dimR
[PROOF STEP]
using assms fc_mats_carrier
[PROOF STATE]
proof (prove)
using this:
A \<in> fc_mats
B \<in> fc_mats
fc_mats = carrier_mat dimR dimC

goal (1 subgoal):
 1. dim_row (A * B) = dimR
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (A * B) = dimR

goal (1 subgoal):
 1. A * B \<in> fc_mats
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_row (A * B) = dimR

goal (1 subgoal):
 1. A * B \<in> fc_mats
[PROOF STEP]
have "dim_col (A * B) = dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (A * B) = dimR
[PROOF STEP]
using assms fc_mats_carrier dim_eq
[PROOF STATE]
proof (prove)
using this:
A \<in> fc_mats
B \<in> fc_mats
fc_mats = carrier_mat dimR dimC
dimR = dimC

goal (1 subgoal):
 1. dim_col (A * B) = dimR
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (A * B) = dimR

goal (1 subgoal):
 1. A * B \<in> fc_mats
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_row (A * B) = dimR
dim_col (A * B) = dimR
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim_row (A * B) = dimR
dim_col (A * B) = dimR

goal (1 subgoal):
 1. A * B \<in> fc_mats
[PROOF STEP]
using fc_mats_carrier carrier_mat_def dim_eq
[PROOF STATE]
proof (prove)
using this:
dim_row (A * B) = dimR
dim_col (A * B) = dimR
fc_mats = carrier_mat dimR dimC
carrier_mat ?nr ?nc = {m. dim_row m = ?nr \<and> dim_col m = ?nc}
dimR = dimC

goal (1 subgoal):
 1. A * B \<in> fc_mats
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * B \<in> fc_mats

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Limsup_bounded:
  assumes le: "eventually (\<lambda>n. X n \<le> C) F"
  shows "Limsup F X \<le> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F X \<le> C
[PROOF STEP]
using Limsup_mono[OF le] Limsup_const[of F C]
[PROOF STATE]
proof (prove)
using this:
Limsup F X \<le> Limsup F (\<lambda>n. C)
F \<noteq> bot \<Longrightarrow> Limsup F (\<lambda>x. C) = C

goal (1 subgoal):
 1. Limsup F X \<le> C
[PROOF STEP]
by (cases "F = bot") simp_all


[STATEMENT]
lemma Suc_add_max_le[simp]:
  "(Suc(n + max i j) \<le> m) = (Suc(n + i) \<le> m \<and> Suc(n + j) \<le> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc (n + max i j) \<le> m) = (Suc (n + i) \<le> m \<and> Suc (n + j) \<le> m)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc (n + max i j) \<le> m) = (Suc (n + i) \<le> m \<and> Suc (n + j) \<le> m)
[PROOF STEP]
by arith


[STATEMENT]
lemma Poly_replicate_0 [simp]: "Poly (replicate n 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (replicate n (0::'a)) = 0
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma local_lipschitz_minus:
  fixes f::"'a::metric_space \<Rightarrow> 'b::metric_space \<Rightarrow> 'c::real_normed_vector"
  shows "local_lipschitz T X (\<lambda>t x. - f t x) = local_lipschitz T X f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_lipschitz T X (\<lambda>t x. - f t x) = local_lipschitz T X f
[PROOF STEP]
by (auto simp: local_lipschitz_def lipschitz_on_minus)


[STATEMENT]
lemma signed_take_bit_minus:
  \<open>signed_take_bit n (- signed_take_bit n k) = signed_take_bit n (- k)\<close>
  for k :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit n (- signed_take_bit n k) = signed_take_bit n (- k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. signed_take_bit n (- signed_take_bit n k) = signed_take_bit n (- k)
[PROOF STEP]
have \<open>take_bit (Suc n)
     (- take_bit (Suc n) (signed_take_bit n k)) =
    take_bit (Suc n) (- k)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (Suc n) (- take_bit (Suc n) (signed_take_bit n k)) = take_bit (Suc n) (- k)
[PROOF STEP]
by (simp add: take_bit_signed_take_bit take_bit_minus)
[PROOF STATE]
proof (state)
this:
take_bit (Suc n) (- take_bit (Suc n) (signed_take_bit n k)) = take_bit (Suc n) (- k)

goal (1 subgoal):
 1. signed_take_bit n (- signed_take_bit n k) = signed_take_bit n (- k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take_bit (Suc n) (- take_bit (Suc n) (signed_take_bit n k)) = take_bit (Suc n) (- k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
take_bit (Suc n) (- take_bit (Suc n) (signed_take_bit n k)) = take_bit (Suc n) (- k)

goal (1 subgoal):
 1. signed_take_bit n (- signed_take_bit n k) = signed_take_bit n (- k)
[PROOF STEP]
by (simp only: signed_take_bit_eq_iff_take_bit_eq take_bit_minus)
[PROOF STATE]
proof (state)
this:
signed_take_bit n (- signed_take_bit n k) = signed_take_bit n (- k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  unitarily_equiv_trace':
  assumes "A \<in> carrier_mat n n"
  and "unitarily_equiv A B U"
shows "Complex_Matrix.trace A = (\<Sum> i = 0 ..< dim_row A. B $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
have "Complex_Matrix.trace A = Complex_Matrix.trace B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace A = Complex_Matrix.trace B
[PROOF STEP]
using assms unitarily_equiv_trace[of A]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
unitarily_equiv A B U
\<lbrakk>A \<in> carrier_mat ?n ?n; unitarily_equiv A ?B ?U\<rbrakk> \<Longrightarrow> Complex_Matrix.trace A = Complex_Matrix.trace ?B

goal (1 subgoal):
 1. Complex_Matrix.trace A = Complex_Matrix.trace B
[PROOF STEP]
by (meson unitary_diag_imp_unitarily_equiv)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace A = Complex_Matrix.trace B

goal (1 subgoal):
 1. Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace A = Complex_Matrix.trace B

goal (1 subgoal):
 1. Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
have "... = (\<Sum> i = 0 ..< dim_row A. B $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace B = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
unitarily_equiv A B U

goal (1 subgoal):
 1. Complex_Matrix.trace B = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
by (metis Complex_Matrix.trace_def carrier_matD(1) unitarily_equiv_carrier(1))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace B = (\<Sum>i = 0..<dim_row A. B $$ (i, i))

goal (1 subgoal):
 1. Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))

goal (1 subgoal):
 1. Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace A = (\<Sum>i = 0..<dim_row A. B $$ (i, i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma left_mult_one_mat'[simp]: "dim_row (A :: 'a :: semiring_1 mat) = n \<Longrightarrow> 1\<^sub>m n * A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = n \<Longrightarrow> 1\<^sub>m n * A = A
[PROOF STEP]
by (rule left_mult_one_mat, unfold carrier_mat_def, simp)


[STATEMENT]
lemma map_ofD:
  fixes xs k opt
  assumes "map_of xs k = opt"
  shows "opt = None \<or> (\<exists>n < length xs. opt = Some (snd (xs ! n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. opt = None \<or> (\<exists>n<length xs. opt = Some (snd (xs ! n)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
map_of xs k = opt

goal (1 subgoal):
 1. opt = None \<or> (\<exists>n<length xs. opt = Some (snd (xs ! n)))
[PROOF STEP]
by (metis in_set_conv_nth map_of_SomeD not_Some_eq snd_conv)


[STATEMENT]
lemma mono_SucI1: "\<forall>n. X n \<le> X (Suc n) \<Longrightarrow> monoseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. X n \<le> X (Suc n) \<Longrightarrow> monoseq X
[PROOF STEP]
by (simp add: monoseq_Suc)


[STATEMENT]
lemma continuous_at_sequentiallyI:
  fixes f :: "'a::{first_countable_topology, t2_space} \<Rightarrow> 'b::topological_space"
  assumes "\<And>u. u \<longlonglongrightarrow> a \<Longrightarrow> (\<lambda>n. f (u n)) \<longlonglongrightarrow> f a"
  shows "continuous (at a) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f a
[PROOF STEP]
using continuous_within_sequentiallyI[of a UNIV f] assms
[PROOF STATE]
proof (prove)
using this:
(\<And>u. \<lbrakk>u \<longlonglongrightarrow> a; \<forall>n. u n \<in> UNIV\<rbrakk> \<Longrightarrow> (\<lambda>n. f (u n)) \<longlonglongrightarrow> f a) \<Longrightarrow> isCont f a
?u \<longlonglongrightarrow> a \<Longrightarrow> (\<lambda>n. f (?u n)) \<longlonglongrightarrow> f a

goal (1 subgoal):
 1. isCont f a
[PROOF STEP]
by auto


[STATEMENT]
theorem prelim_element_match:
 "matrix_match A1 A2 B1 B2 \<Longrightarrow> (\<forall>i j.((i<(row_length A1)*(row_length B1))
                              \<and>(j<(length A2)*(length B2)))
         \<longrightarrow>
  (((A1 \<circ> A2)\<otimes>(B1 \<circ>  B2))!j!i
                  = ((A1 \<otimes> B1)\<circ>(A2 \<otimes> B2))!j!i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
assume assms:"matrix_match A1 A2 B1 B2 "
[PROOF STATE]
proof (state)
this:
matrix_match A1 A2 B1 B2

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
have 1:"matrix_match A1 A2 B1 B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2
[PROOF STEP]
using assms matrix_compose_cond_def
[PROOF STATE]
proof (prove)
using this:
matrix_match A1 A2 B1 B2
matrix_compose_cond ?A1.0 ?A2.0 ?B1.0 ?B2.0 ?i ?j \<equiv> mat (row_length ?A1.0) (length ?A1.0) ?A1.0 \<and> mat (row_length ?A2.0) (length ?A2.0) ?A2.0 \<and> mat (row_length ?B1.0) (length ?B1.0) ?B1.0 \<and> mat (row_length ?B2.0) (length ?B2.0) ?B2.0 \<and> length ?A1.0 = row_length ?A2.0 \<and> length ?B1.0 = row_length ?B2.0 \<and> ?A1.0 \<noteq> [] \<and> ?A2.0 \<noteq> [] \<and> ?B1.0 \<noteq> [] \<and> ?B2.0 \<noteq> [] \<and> ?i < row_length ?A1.0 * row_length ?B1.0 \<and> ?j < length ?A2.0 * length ?B2.0

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_match A1 A2 B1 B2

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
matrix_match A1 A2 B1 B2
[PROOF STEP]
have 2:
    "\<forall>i j. ((i<(row_length A1)*(row_length B1))\<and>(j<(length A2)*(length B2)))
     \<longrightarrow>
      (((A1 \<circ> A2)\<otimes>(B1 \<circ>  B2))!j!i
                = (scalar_product
                    (row A1 (i div (row_length B1))) (col A2  (j div (length B2))))
                   *(scalar_product
                      (row B1 (i mod (row_length B1))) (col B2 (j mod (length B2)))))"
[PROOF STATE]
proof (prove)
using this:
matrix_match A1 A2 B1 B2

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2))
[PROOF STEP]
using effective_matrix_match_condn_1 assms
[PROOF STATE]
proof (prove)
using this:
matrix_match A1 A2 B1 B2
matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> \<forall>i j. i < row_length ?A1.0 * row_length ?B1.0 \<and> j < length ?A2.0 * length ?B2.0 \<longrightarrow> (?A1.0 \<circ> ?A2.0 \<otimes> ?B1.0 \<circ> ?B2.0) ! j ! i = scalar_product (row ?A1.0 (i div row_length ?B1.0)) (col ?A2.0 (j div length ?B2.0)) * scalar_product (row ?B1.0 (i mod row_length ?B1.0)) (col ?B2.0 (j mod length ?B2.0))
matrix_match A1 A2 B1 B2

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2))

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2))

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
matrix_match A1 A2 B1 B2
[PROOF STEP]
have 3:"\<forall>i j. ((i<(row_length A1)*(row_length B1))\<and>(j<(length A2)*(length B2))) \<longrightarrow>
           ((A1 \<otimes> B1)\<circ>(A2 \<otimes> B2))!j!i =
                 scalar_product
          (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1)))
          (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))"
[PROOF STATE]
proof (prove)
using this:
matrix_match A1 A2 B1 B2

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))
[PROOF STEP]
using effective_matrix_match_condn_2
[PROOF STATE]
proof (prove)
using this:
matrix_match A1 A2 B1 B2
matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> \<forall>i j. i < row_length ?A1.0 * row_length ?B1.0 \<and> j < length ?A2.0 * length ?B2.0 \<longrightarrow> ((?A1.0 \<otimes> ?B1.0) \<circ> (?A2.0 \<otimes> ?B2.0)) ! j ! i = scalar_product (vec_vec_Tensor (row ?A1.0 (i div row_length ?B1.0)) (row ?B1.0 (i mod row_length ?B1.0))) (vec_vec_Tensor (col ?A2.0 (j div length ?B2.0)) (col ?B2.0 (j mod length ?B2.0)))

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
have  "\<forall>i j. ((i<(row_length A1)*(row_length B1))\<and>(j<(length A2)*(length B2)))
         \<longrightarrow>length (row A1 (i div (row_length B1)))
                           = length (col A2  (j div (length B2)))"
 and "\<forall>i j. ((i<(row_length A1)*(row_length B1))\<and>(j<(length A2)*(length B2)))
           \<longrightarrow> length (row B1 (i mod (row_length B1)))
                             = length (col B2 (j mod (length B2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row A1 (i div row_length B1)) = length (col A2 (j div length B2)) &&& \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
using assms effective_row_col_match
[PROOF STATE]
proof (prove)
using this:
matrix_match A1 A2 B1 B2
matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> \<forall>i j. i < row_length ?A1.0 * row_length ?B1.0 \<and> j < length ?A2.0 * length ?B2.0 \<longrightarrow> length (row ?A1.0 (i div row_length ?B1.0)) = length (col ?A2.0 (j div length ?B2.0))
matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> \<forall>i j. i < row_length ?A1.0 * row_length ?B1.0 \<and> j < length ?A2.0 * length ?B2.0 \<longrightarrow> length (row ?B1.0 (i mod row_length ?B1.0)) = length (col ?B2.0 (j mod length ?B2.0))

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row A1 (i div row_length B1)) = length (col A2 (j div length B2)) &&& \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have " \<forall>i j. ((i<(row_length A1)*(row_length B1))\<and>(j<(length A2)*(length B2)))
           \<longrightarrow>
           (scalar_product (row A1 (i div (row_length B1))) (col A2  (j div (length B2))))
                   *(scalar_product (row B1 (i mod (row_length B1))) (col B2 (j mod (length B2))))
             =  scalar_product
          (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1)))
          (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))"
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2)) = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))
[PROOF STEP]
using effective_scalar_product_distributivity
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
\<lbrakk>length ?v1.0 = length ?v2.0; length ?w1.0 = length ?w2.0\<rbrakk> \<Longrightarrow> scalar_product ?v1.0 ?v2.0 * scalar_product ?w1.0 ?w2.0 = scalar_product (vec_vec_Tensor ?v1.0 ?w1.0) (vec_vec_Tensor ?v2.0 ?w2.0)

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2)) = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2)) = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))

goal (1 subgoal):
 1. matrix_match A1 A2 B1 B2 \<Longrightarrow> \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2)) = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2)) = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
using 2 3
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2)) = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = scalar_product (row A1 (i div row_length B1)) (col A2 (j div length B2)) * scalar_product (row B1 (i mod row_length B1)) (col B2 (j mod length B2))
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i = scalar_product (vec_vec_Tensor (row A1 (i div row_length B1)) (row B1 (i mod row_length B1))) (vec_vec_Tensor (col A2 (j div length B2)) (col B2 (j mod length B2)))

goal (1 subgoal):
 1. \<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < row_length A1 * row_length B1 \<and> j < length A2 * length B2 \<longrightarrow> (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adj_canc2:
  fixes f :: "'a::ord \<Rightarrow> 'b::order"
  shows "f \<stileturn> g \<Longrightarrow> ((g \<circ> f) x = (g \<circ> f) y \<longrightarrow> f x = f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> g \<Longrightarrow> (g \<circ> f) x = (g \<circ> f) y \<longrightarrow> f x = f y
[PROOF STEP]
unfolding adj_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> g (f x) = g (f y) \<longrightarrow> f x = f y
[PROOF STEP]
by (metis eq_iff)


[STATEMENT]
lemma in_IF1rel:
  "IF1rel R x y \<longleftrightarrow> (\<exists> z. z \<in> IF1in (Collect (case_prod R)) \<and> IF1map fst z = x \<and> IF1map snd z = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IF1rel R x y = (\<exists>z. z \<in> IF1in {(x, y). R x y} \<and> IF1map fst z = x \<and> IF1map snd z = y)
[PROOF STEP]
unfolding IF1rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((BNF_Def.Grp (IF1in {(x, y). R x y}) (IF1map fst))\<inverse>\<inverse> OO BNF_Def.Grp (IF1in {(x, y). R x y}) (IF1map snd)) x y = (\<exists>z. z \<in> IF1in {(x, y). R x y} \<and> IF1map fst z = x \<and> IF1map snd z = y)
[PROOF STEP]
by (rule predicate2_eqD[OF OO_Grp_alt])


[STATEMENT]
lemma Z_I_spectrum:
  shows "{Re x |x. x \<in> spectrum Z_I} \<subseteq> {- 1, 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum Z_I} \<subseteq> {- 1, 1}
[PROOF STEP]
using unitary_hermitian_Re_spectrum Z_I_hermitian
    Z_I_unitary Z_I_carrier
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary ?U; hermitian ?U; ?U \<in> carrier_mat ?n ?n; 0 < ?n\<rbrakk> \<Longrightarrow> {Re x |x. x \<in> spectrum ?U} \<subseteq> {- 1, 1}
hermitian Z_I
Complex_Matrix.unitary Z_I
Z_I \<in> carrier_mat 4 4

goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum Z_I} \<subseteq> {- 1, 1}
[PROOF STEP]
by simp


[STATEMENT]
lemma homeomorphic_map_relative_homology_iso:
  assumes f: "homeomorphic_map X Y f" and S: "S \<subseteq> topspace X" "f ` S = T"
  shows "(hom_induced p X S Y T f) \<in> iso (relative_homology_group p X S) (relative_homology_group p Y T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p X S Y T f \<in> Group.iso (relative_homology_group p X S) (relative_homology_group p Y T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom_induced p X S Y T f \<in> Group.iso (relative_homology_group p X S) (relative_homology_group p Y T)
[PROOF STEP]
obtain g where g: "homeomorphic_maps X Y f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. homeomorphic_maps X Y f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using homeomorphic_map_maps f
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map ?X ?Y ?f = (\<exists>g. homeomorphic_maps ?X ?Y ?f g)
homeomorphic_map X Y f

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

goal (1 subgoal):
 1. hom_induced p X S Y T f \<in> Group.iso (relative_homology_group p X S) (relative_homology_group p Y T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_maps X Y f g
[PROOF STEP]
have "group_isomorphisms (relative_homology_group p X S) (relative_homology_group p Y T)
                                (hom_induced p X S Y T f) (hom_induced p Y T X S g)"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. group_isomorphisms (relative_homology_group p X S) (relative_homology_group p Y T) (hom_induced p X S Y T f) (hom_induced p Y T X S g)
[PROOF STEP]
using S g
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y f g
S \<subseteq> topspace X
f ` S = T
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. group_isomorphisms (relative_homology_group p X S) (relative_homology_group p Y T) (hom_induced p X S Y T f) (hom_induced p Y T X S g)
[PROOF STEP]
by (auto simp: homeomorphic_maps_def intro!: homeomorphic_maps_relative_homology_group_isomorphisms)
[PROOF STATE]
proof (state)
this:
group_isomorphisms (relative_homology_group p X S) (relative_homology_group p Y T) (hom_induced p X S Y T f) (hom_induced p Y T X S g)

goal (1 subgoal):
 1. hom_induced p X S Y T f \<in> Group.iso (relative_homology_group p X S) (relative_homology_group p Y T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
group_isomorphisms (relative_homology_group p X S) (relative_homology_group p Y T) (hom_induced p X S Y T f) (hom_induced p Y T X S g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
group_isomorphisms (relative_homology_group p X S) (relative_homology_group p Y T) (hom_induced p X S Y T f) (hom_induced p Y T X S g)

goal (1 subgoal):
 1. hom_induced p X S Y T f \<in> Group.iso (relative_homology_group p X S) (relative_homology_group p Y T)
[PROOF STEP]
by (rule group_isomorphisms_imp_iso)
[PROOF STATE]
proof (state)
this:
hom_induced p X S Y T f \<in> Group.iso (relative_homology_group p X S) (relative_homology_group p Y T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux2_lm0241_single_digit_binom:
  assumes "1 \<ge> (a::nat)"
  assumes "1 \<ge> (b::nat)"
  shows "\<not>(a = 1 \<and> b = 1) \<longleftrightarrow> ((a + b) choose b) = 1" (is "?P \<longleftrightarrow> ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (a = 1 \<and> b = 1)) = (a + b choose b = 1)
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
a \<le> 1
b \<le> 1

goal (1 subgoal):
 1. (\<not> (a = 1 \<and> b = 1)) = (a + b choose b = 1)
[PROOF STEP]
by (metis Suc_eq_plus1 add.commute add_cancel_right_left add_eq_if
              binomial_n_0 choose_one le_add2 le_antisym zero_neq_one)


[STATEMENT]
lemma interval_inner_leI:
  assumes "x \<in> {a .. b}" "0 \<le> i"
  shows "a\<bullet>i \<le> x\<bullet>i" "x\<bullet>i \<le> b\<bullet>i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<bullet> i \<le> x \<bullet> i &&& x \<bullet> i \<le> b \<bullet> i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..b}
(0::'a) \<le> i

goal (1 subgoal):
 1. a \<bullet> i \<le> x \<bullet> i &&& x \<bullet> i \<le> b \<bullet> i
[PROOF STEP]
unfolding euclidean_inner[of a i] euclidean_inner[of x i] euclidean_inner[of b i]
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..b}
(0::'a) \<le> i

goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. a \<bullet> b * (i \<bullet> b)) \<le> (\<Sum>b\<in>Basis. x \<bullet> b * (i \<bullet> b)) &&& (\<Sum>b\<in>Basis. x \<bullet> b * (i \<bullet> b)) \<le> (\<Sum>ba\<in>Basis. b \<bullet> ba * (i \<bullet> ba))
[PROOF STEP]
by (auto intro!: ordered_comm_monoid_add_class.sum_mono mult_right_mono simp: eucl_le)


[STATEMENT]
lemma (in Group) Nfunc_LeastTr2_6:"\<lbrakk>\<forall>l \<le> (n::nat). G \<guillemotright> f l; \<forall>l \<le> n. G \<guillemotright> g l;
       \<exists>i \<le> n. (f i \<noteq> g i)\<rbrakk> \<Longrightarrow> (LEAST k. (f k \<noteq> g k)) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; \<exists>i\<le>n. f i \<noteq> g i\<rbrakk> \<Longrightarrow> (LEAST k. f k \<noteq> g k) \<le> n
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; i \<le> n \<and> f i \<noteq> g i\<rbrakk> \<Longrightarrow> (LEAST k. f k \<noteq> g k) \<le> n
[PROOF STEP]
apply (rule_tac i = i in  Nfunc_LeastTr2_4, assumption+, simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma compact_blinfun_lemma:
  fixes f :: "nat \<Rightarrow> 'a::euclidean_space \<Rightarrow>\<^sub>L 'b::euclidean_space"
  assumes "bounded (range f)"
  shows "\<forall>d\<subseteq>Basis. \<exists>l::'a \<Rightarrow>\<^sub>L 'b. \<exists> r::nat\<Rightarrow>nat.
    strict_mono r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) i) (l i) < e) sequentially)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>d\<subseteq>Basis. \<exists>x r. strict_mono r \<and> (\<forall>e>0. \<forall>\<^sub>F n in sequentially. \<forall>i\<in>d. dist (blinfun_apply (f (r n)) i) (blinfun_apply x i) < e)
[PROOF STEP]
by (rule compact_lemma_general[where unproj = "\<lambda>e. blinfun_of_matrix (\<lambda>i j. e j \<bullet> i)"])
   (auto intro!: euclidean_eqI[where 'a='b] bounded_linear_image assms
    simp: blinfun_of_matrix_works blinfun_of_matrix_apply inner_Basis mult_if_delta sum.delta'
      scaleR_sum_left[symmetric])


[STATEMENT]
lemma cf_cn_cov_comp_ObjMap_app[cat_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>" and "a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>"
  shows "(\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret L: is_functor \<alpha> \<open>op_cat \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_cat \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret R: is_functor \<alpha> \<AA> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
by
      (
        rule smcf_cn_cov_comp_ObjMap_app
          [
            OF
              L.cf_is_semifunctor[unfolded slicing_commute[symmetric]]
              R.cf_is_semifunctor,
            unfolded slicing_commute slicing_simps,
            OF assms(3)
          ]
      )
[PROOF STATE]
proof (state)
this:
(\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<lambda>x::real. exp (real_of_int (floor x))) \<in> \<Theta>(\<lambda>x. exp x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp (real_of_int \<lfloor>x\<rfloor>)) \<in> \<Theta>(exp)
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma R_mono: "d \<in> D\<^sub>D \<Longrightarrow> u \<le> v \<Longrightarrow> (R d) u \<le> (R d) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d \<in> D\<^sub>D; u \<le> v\<rbrakk> \<Longrightarrow> blinfun_apply (R d) u \<le> blinfun_apply (R d) v
[PROOF STEP]
using R_nonneg[of d "v - u"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>d \<in> D\<^sub>D; 0 \<le> v - u\<rbrakk> \<Longrightarrow> 0 \<le> blinfun_apply (R d) (v - u)

goal (1 subgoal):
 1. \<lbrakk>d \<in> D\<^sub>D; u \<le> v\<rbrakk> \<Longrightarrow> blinfun_apply (R d) u \<le> blinfun_apply (R d) v
[PROOF STEP]
by (auto simp: blinfun.bilinear_simps)


[STATEMENT]
lemma Fract_normalize: "Fract (fst (Rat.normalize (x,y))) (snd (Rat.normalize (x,y))) = Fract x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract (fst (Rat.normalize (x, y))) (snd (Rat.normalize (x, y))) = Fract x y
[PROOF STEP]
by (rule quotient_of_inject) (simp add: quotient_of_Fract Rat_normalize_idempotent)


[STATEMENT]
lemma ChiRel_ChiPlus_trans2:
   "\<lbrakk> (U,S) \<in> ChiRel A; (S,T) \<in> ChiPlus A \<rbrakk> \<Longrightarrow> (U,T) \<in> ChiPlus A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(U, S) \<in> ChiRel A; (S, T) \<in> ChiPlus A\<rbrakk> \<Longrightarrow> (U, T) \<in> ChiPlus A
[PROOF STEP]
apply (unfold ChiPlus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(U, S) \<in> ChiRel A; (S, T) \<in> (ChiRel A)\<^sup>+\<rbrakk> \<Longrightarrow> (U, T) \<in> (ChiRel A)\<^sup>+
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lm052:
  assumes "finite A" "A \<noteq> {}"
  shows "Max (f`A) \<in> f`A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (f ` A) \<in> f ` A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
A \<noteq> {}

goal (1 subgoal):
 1. Max (f ` A) \<in> f ` A
[PROOF STEP]
by (metis Max_in finite_imageI image_is_empty)


[STATEMENT]
lemma interval_integral_Ioo:
  "a \<le> b \<Longrightarrow> \<bar>a\<bar> < \<infinity> ==> \<bar>b\<bar> < \<infinity> \<Longrightarrow> (LBINT x=a..b. f x) = (LBINT x : {real_of_ereal a <..< real_of_ereal b}. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<bar>a\<bar> < \<infinity>; \<bar>b\<bar> < \<infinity>\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = set_lebesgue_integral lborel {real_of_ereal a<..<real_of_ereal b} f
[PROOF STEP]
by (auto simp: interval_lebesgue_integral_def einterval_iff)


[STATEMENT]
lemma carrier_relative_homology_group_0:
   "carrier(relative_homology_group 0 X S)
 = (homologous_rel_set 0 X S) ` singular_relcycle_set 0 X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (relative_homology_group 0 X S) = homologous_rel_set 0 X S ` singular_relcycle_set 0 X S
[PROOF STEP]
using carrier_relative_homology_group [of 0 X S]
[PROOF STATE]
proof (prove)
using this:
carrier (relative_homology_group (int 0) X S) = homologous_rel_set 0 X S ` singular_relcycle_set 0 X S

goal (1 subgoal):
 1. carrier (relative_homology_group 0 X S) = homologous_rel_set 0 X S ` singular_relcycle_set 0 X S
[PROOF STEP]
by simp


[STATEMENT]
lemma convex_halfspace_Re_gt: "convex {x. Re x > b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. b < Re x}
[PROOF STEP]
using convex_halfspace_gt[of b "1::complex"]
[PROOF STATE]
proof (prove)
using this:
convex {x. b < 1 \<bullet> x}

goal (1 subgoal):
 1. convex {x. b < Re x}
[PROOF STEP]
by simp


[STATEMENT]
lemma prefixes_conv_suffixes: "prefixes xs = map rev (suffixes (rev xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefixes xs = map rev (suffixes (rev xs))
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma pairwise_take_drop:
  assumes "pairwise P (set (zip xs ys))" "length xs = length ys"
  shows "pairwise P (set (zip (take i xs @ drop (Suc i) xs) (take i ys @ drop (Suc i) ys)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise P (set (zip (take i xs @ drop (Suc i) xs) (take i ys @ drop (Suc i) ys)))
[PROOF STEP]
by (rule pairwise_subset[OF assms(1)]) (auto simp: set_zip assms(2))


[STATEMENT]
lemma tendsto_PInfty_eq_at_top:
  "((\<lambda>z. ereal (f z)) \<longlongrightarrow> \<infinity>) F \<longleftrightarrow> (LIM z F. f z :> at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. ereal (f z)) \<longlongrightarrow> \<infinity>) F = filterlim f at_top F
[PROOF STEP]
unfolding tendsto_PInfty filterlim_at_top_dense
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>r. \<forall>\<^sub>F x in F. ereal r < ereal (f x)) = (\<forall>Z. \<forall>\<^sub>F x in F. Z < f x)
[PROOF STEP]
by simp


[STATEMENT]
lemma to_Zp_zero:
  shows "to_Zp \<zero> = \<zero>\<^bsub>Z\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_Zp \<zero> = \<zero>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
using Q\<^sub>p_def Zp_def Zp.domain_axioms \<iota>_def domain_frac.inc_inj1 inc_to_Zp
        padic_integers_axioms to_Zp_def domain_frac_axioms
[PROOF STATE]
proof (prove)
using this:
Q\<^sub>p \<equiv> Frac Z\<^sub>p
Z\<^sub>p \<equiv> padic_int p
domain Z\<^sub>p
\<iota> \<equiv> Frac_inc Z\<^sub>p
\<lbrakk>domain_frac ?R; ?a \<in> carrier ?R; Frac_inc ?R ?a = \<zero>\<^bsub>Frac ?R\<^esub>\<rbrakk> \<Longrightarrow> ?a = \<zero>\<^bsub>?R\<^esub>
?b \<in> carrier Z\<^sub>p \<Longrightarrow> to_Zp (\<iota> ?b) = ?b
padic_integers p
to_Zp ?a = (if ?a \<in> \<O>\<^sub>p then SOME x. x \<in> carrier Z\<^sub>p \<and> \<iota> x = ?a else \<zero>\<^bsub>Z\<^sub>p\<^esub>)
domain_frac Z\<^sub>p

goal (1 subgoal):
 1. to_Zp \<zero> = \<zero>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma half_segments_of_aform2:
  assumes ch: "x \<in> convex hull set (map snd (half_segments_of_aform X))"
  assumes ab: "(a, b) \<in> set (half_segments_of_aform X)"
  shows "ccw a b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw a b x
[PROOF STEP]
using finite_set _ ch
[PROOF STATE]
proof (prove)
using this:
finite (set ?xs)
PROP ?psi \<Longrightarrow> PROP ?psi
x \<in> convex hull set (map snd (half_segments_of_aform X))

goal (1 subgoal):
 1. ccw a b x
[PROOF STEP]
proof (rule ccw.convex_hull)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c. c \<in> set (map snd (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c. c \<in> set (map snd (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
assume "d \<in> set (map snd (half_segments_of_aform X))"
[PROOF STATE]
proof (state)
this:
d \<in> set (map snd (half_segments_of_aform X))

goal (2 subgoals):
 1. \<And>c. c \<in> set (map snd (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d \<in> set (map snd (half_segments_of_aform X))
[PROOF STEP]
obtain c where "(c, d) \<in> set (half_segments_of_aform X)"
[PROOF STATE]
proof (prove)
using this:
d \<in> set (map snd (half_segments_of_aform X))

goal (1 subgoal):
 1. (\<And>c. (c, d) \<in> set (half_segments_of_aform X) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c, d) \<in> set (half_segments_of_aform X)

goal (2 subgoals):
 1. \<And>c. c \<in> set (map snd (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
with ab
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> set (half_segments_of_aform X)
(c, d) \<in> set (half_segments_of_aform X)
[PROOF STEP]
show "ccw a b d"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> set (half_segments_of_aform X)
(c, d) \<in> set (half_segments_of_aform X)

goal (1 subgoal):
 1. ccw a b d
[PROOF STEP]
by (rule ccw_half_segments_of_aform(2))
[PROOF STATE]
proof (state)
this:
ccw a b d

goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
qed (insert ab, simp add: nlex_half_segments_of_aform)


[STATEMENT]
lemma SA_mult_closed_id:
  assumes "is_semialg_function n f"
  assumes "is_semialg_function n g"
  shows "restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) = f \<otimes>\<^bsub>SA n\<^esub> g "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) = f \<otimes>\<^bsub>SA n\<^esub> g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
show "(restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
apply(cases "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
 2. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
using assms restrict_apply
[PROOF STATE]
proof (prove)
using this:
is_semialg_function n f
is_semialg_function n g
restrict ?f ?A ?x = (if ?x \<in> ?A then ?f ?x else undefined)

goal (2 subgoals):
 1. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
 2. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
apply (metis SA_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_semialg_function n f
is_semialg_function n g

goal (1 subgoal):
 1. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
by (metis SA_mult')
[PROOF STATE]
proof (state)
this:
(restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<otimes>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<otimes>\<^bsub>SA n\<^esub> g) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cSup_bounds:
  fixes S :: "'a :: conditionally_complete_lattice set"
  shows "S \<noteq> {} \<Longrightarrow> a <=* S \<Longrightarrow> S *<= b \<Longrightarrow> a \<le> Sup S \<and> Sup S \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; a <=* S; S *<= b\<rbrakk> \<Longrightarrow> a \<le> Sup S \<and> Sup S \<le> b
[PROOF STEP]
using cSup_least[of S b] cSup_upper2[of _ S a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>S \<noteq> {}; \<And>x. x \<in> S \<Longrightarrow> x \<le> b\<rbrakk> \<Longrightarrow> Sup S \<le> b
\<lbrakk>?x \<in> S; a \<le> ?x; bdd_above S\<rbrakk> \<Longrightarrow> a \<le> Sup S

goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; a <=* S; S *<= b\<rbrakk> \<Longrightarrow> a \<le> Sup S \<and> Sup S \<le> b
[PROOF STEP]
by (auto simp: bdd_above_setle setge_def setle_def)


[STATEMENT]
lemma poly_eval_power: "poly_eval a (p ^ m) = poly_eval a p ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_eval a (p ^ m) = poly_eval a p ^ m
[PROOF STEP]
by (induct m) (simp_all add: poly_eval_times)


[STATEMENT]
lemma anchor_inj [iff]: "(anchor A n B = anchor A' n' B')
= (A=A' & n=n' & B=B')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (anchor A n B = anchor A' n' B') = (A = A' \<and> n = n' \<and> B = B')
[PROOF STEP]
by (auto simp: anchor_def)


[STATEMENT]
lemma fmfilter_comm: "fmfilter P (fmfilter Q m) = fmfilter Q (fmfilter P m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmfilter P (fmfilter Q m) = fmfilter Q (fmfilter P m)
[PROOF STEP]
unfolding fmfilter_comp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmfilter (\<lambda>x. P x \<and> Q x) m = fmfilter (\<lambda>x. Q x \<and> P x) m
[PROOF STEP]
by meson


[STATEMENT]
lemma PosOrd_def2:
  shows "v1 \<sqsubset>val p v2 \<longleftrightarrow>
         pflat_len v1 p > pflat_len v2 p \<and>
         (\<forall>q \<in> Pos v1. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q) \<and>
         (\<forall>q \<in> Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v1 \<sqsubset>val p v2 = (pflat_len v2 p < pflat_len v1 p \<and> (\<forall>q\<in>Pos v1. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q) \<and> (\<forall>q\<in>Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q))
[PROOF STEP]
unfolding PosOrd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pflat_len v2 p < pflat_len v1 p \<and> (\<forall>q\<in>Pos v1 \<union> Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q)) = (pflat_len v2 p < pflat_len v1 p \<and> (\<forall>q\<in>Pos v1. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q) \<and> (\<forall>q\<in>Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q))
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in NFlow) augment_cf_refine_aux: (* For snippet *)
      assumes AUG: "isAugmentingPath p"
      shows "residualGraph c (augment (augmentingFlow p)) (u,v) = (
        if (u,v)\<in>set p then (residualGraph c f (u,v) - resCap p)
        else if (v,u)\<in>set p then (residualGraph c f (u,v) + resCap p)
        else residualGraph c f (u,v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cf_of (augment (augmentingFlow p)) (u, v) = (if (u, v) \<in> set p then cf (u, v) - resCap p else if (v, u) \<in> set p then cf (u, v) + resCap p else cf (u, v))
[PROOF STEP]
using augment_alt[OF AUG]
[PROOF STATE]
proof (prove)
using this:
cf_of (augment (augmentingFlow p)) = cf.augment_cf (set p) (resCap p)

goal (1 subgoal):
 1. cf_of (augment (augmentingFlow p)) (u, v) = (if (u, v) \<in> set p then cf (u, v) - resCap p else if (v, u) \<in> set p then cf (u, v) + resCap p else cf (u, v))
[PROOF STEP]
by (auto simp: Graph.augment_cf_def)


[STATEMENT]
lemma is_pascal_under_alternate_vertices:
  assumes "pascal_prop" and "is_pascal A B C A' B' C'"
  shows "is_pascal A B' C A' B C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pascal A B' C A' B C'
[PROOF STEP]
using assms pascal_prop_def is_pascal_rot_CW
[PROOF STATE]
proof (prove)
using this:
pascal_prop
is_pascal A B C A' B' C'
pascal_prop \<equiv> \<forall>A B C D E F. is_pascal A B C D E F \<longrightarrow> is_pascal B A C D E F
is_pascal ?A ?B ?C ?D ?E ?F \<Longrightarrow> is_pascal ?F ?A ?B ?C ?D ?E

goal (1 subgoal):
 1. is_pascal A B' C A' B C'
[PROOF STEP]
by presburger


[STATEMENT]
lemma mod_power_lem: "a > 1 \<Longrightarrow> a ^ n mod a ^ m = (if m \<le> n then 0 else a ^ n)"
  for a :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < a \<Longrightarrow> a ^ n mod a ^ m = (if m \<le> n then 0 else a ^ n)
[PROOF STEP]
by (simp add: mod_eq_0_iff_dvd le_imp_power_dvd)


[STATEMENT]
lemma cblinfun_image_ccspan:
  shows "A *\<^sub>S ccspan G = ccspan ((*\<^sub>V) A ` G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>S ccspan G = ccspan ((*\<^sub>V) A ` G)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A G. bounded_clinear A \<Longrightarrow> closure (A ` closure (cspan G)) = closure (cspan (A ` G))
[PROOF STEP]
by (simp add: bounded_clinear.bounded_linear bounded_clinear_def closure_bounded_linear_image_subset_eq complex_vector.linear_span_image)


[STATEMENT]
lemma oSuc_eq_oSuc [iff]: "(oSuc x = oSuc y) = (x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (oSuc x = oSuc y) = (x = y)
[PROOF STEP]
by (safe, erule contrapos_pp, simp add: linorder_neq_iff)


[STATEMENT]
lemma in_set_take_conv_nth:
  \<open>x \<in> set (take n xs) \<longleftrightarrow> (\<exists>m<min n (length xs). xs ! m = x)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (take n xs)) = (\<exists>m<min n (length xs). xs ! m = x)
[PROOF STEP]
by (metis in_set_conv_nth length_take min.commute min.strict_boundedE nth_take)


[STATEMENT]
lemma even_inter_mat_intersections: "j1 < dim_col N \<Longrightarrow> j2 < dim_col N \<Longrightarrow> j1 \<noteq> j2
  \<Longrightarrow> even (mat_inter_num N j1 j2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j1 < dim_col N; j2 < dim_col N; j1 \<noteq> j2\<rbrakk> \<Longrightarrow> even (mat_inter_num N j1 j2)
[PROOF STEP]
using even_inters mat_inter_num_conv valid_indices_block_min
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?bl1.0 \<in># \<B>; ?bl2.0 \<in># remove1_mset ?bl1.0 \<B>\<rbrakk> \<Longrightarrow> even (?bl1.0 |\<inter>| ?bl2.0)
\<lbrakk>?j1.0 < dim_col N; ?j2.0 < dim_col N\<rbrakk> \<Longrightarrow> \<B>s ! ?j1.0 |\<inter>| \<B>s ! ?j2.0 = mat_inter_num N ?j1.0 ?j2.0
\<lbrakk>?j1.0 < dim_col N; ?j2.0 < dim_col N; ?j1.0 \<noteq> ?j2.0\<rbrakk> \<Longrightarrow> 2 \<le> \<b>

goal (1 subgoal):
 1. \<lbrakk>j1 < dim_col N; j2 < dim_col N; j1 \<noteq> j2\<rbrakk> \<Longrightarrow> even (mat_inter_num N j1 j2)
[PROOF STEP]
by (metis dim_col_is_b obtains_two_diff_block_indexes)


[STATEMENT]
lemma gcdof_greatestLower:
  fixes G (structure)
  assumes carr[simp]: "a \<in> carrier G"  "b \<in> carrier G"
  shows "(x \<in> carrier G \<and> x gcdof a b) = greatest (division_rel G) x (Lower (division_rel G) {a, b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> carrier G \<and> x gcdof a b) = is_glb (division_rel G) x {a, b}
[PROOF STEP]
by (auto simp: isgcd_def greatest_def Lower_def elem_def)


[STATEMENT]
lemma (in ordered_ab_semigroup_add_0) sum_mono_0:
  "(\<And>i. i\<in>K \<Longrightarrow> f i + 0 \<le> g i) \<Longrightarrow> (\<Sum>i\<in>K. f i) \<le> (\<Sum>i\<in>K. g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> K \<Longrightarrow> f i + (0::'a) \<le> g i) \<Longrightarrow> sum_0 f K \<le> sum_0 g K
[PROOF STEP]
apply (rule sum_mono_00)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<And>i. i \<in> K \<Longrightarrow> f i + (0::'a) \<le> g i; i \<in> K\<rbrakk> \<Longrightarrow> f i + (0::'a) \<le> g i + (0::'a)
[PROOF STEP]
by (metis add_right_mono zero_neutral)


[STATEMENT]
lemma exp_fg:
  fixes z::complex
  assumes g: "(g has_vector_derivative g') (at x within s)"
      and f: "(f has_vector_derivative (g' / (g x - z))) (at x within s)"
      and z: "g x \<noteq> z"
    shows "((\<lambda>x. exp(-f x) * (g x - z)) has_vector_derivative 0) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (- f x) * (g x - z)) has_vector_derivative 0) (at x within s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. exp (- f x) * (g x - z)) has_vector_derivative 0) (at x within s)
[PROOF STEP]
have *: "(exp \<circ> (\<lambda>x. (- f x)) has_vector_derivative - (g' / (g x - z)) * exp (- f x)) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp \<circ> (\<lambda>x. - f x) has_vector_derivative - (g' / (g x - z)) * exp (- f x)) (at x within s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(g has_vector_derivative g') (at x within s)
(f has_vector_derivative g' / (g x - z)) (at x within s)
g x \<noteq> z

goal (1 subgoal):
 1. (exp \<circ> (\<lambda>x. - f x) has_vector_derivative - (g' / (g x - z)) * exp (- f x)) (at x within s)
[PROOF STEP]
unfolding has_vector_derivative_def scaleR_conv_of_real
[PROOF STATE]
proof (prove)
using this:
(g has_derivative (\<lambda>x. complex_of_real x * g')) (at x within s)
(f has_derivative (\<lambda>xa. complex_of_real xa * (g' / (g x - z)))) (at x within s)
g x \<noteq> z

goal (1 subgoal):
 1. (exp \<circ> (\<lambda>x. - f x) has_derivative (\<lambda>xa. complex_of_real xa * (- (g' / (g x - z)) * exp (- f x)))) (at x within s)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
(exp \<circ> (\<lambda>x. - f x) has_vector_derivative - (g' / (g x - z)) * exp (- f x)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. exp (- f x) * (g x - z)) has_vector_derivative 0) (at x within s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (- f x) * (g x - z)) has_vector_derivative 0) (at x within s)
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
g x \<noteq> z

goal (1 subgoal):
 1. ((\<lambda>x. exp (- f x) * (g x - z)) has_vector_derivative 0) (at x within s)
[PROOF STEP]
by (auto intro!: derivative_eq_intros * [unfolded o_def] g)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (- f x) * (g x - z)) has_vector_derivative 0) (at x within s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Maclaurin_zero: "x = 0 \<Longrightarrow> n \<noteq> 0 \<Longrightarrow> (\<Sum>m<n. (diff m 0 / fact m) * x ^ m) = diff 0 0"
  for x :: real and n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = 0; n \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>m<n. diff m (0::'a) / fact m * x ^ m) = diff 0 (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in group) subgroup_conjugation_is_surj0:
  assumes "g \<in> carrier G" "H \<subseteq> carrier G"
  shows "g <# ((inv g) <# H #> g) #> (inv g) = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g <# (inv g <# H #> g) #> inv g = H
[PROOF STEP]
using coset_assoc assms coset_mult_assoc l_coset_subset_G lcos_m_assoc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; ?y \<in> carrier G; ?H \<subseteq> carrier G\<rbrakk> \<Longrightarrow> ?x <# (?H #> ?y) = ?x <# ?H #> ?y
g \<in> carrier G
H \<subseteq> carrier G
\<lbrakk>?M \<subseteq> carrier G; ?g \<in> carrier G; ?h \<in> carrier G\<rbrakk> \<Longrightarrow> ?M #> ?g #> ?h = ?M #> ?g \<otimes> ?h
\<lbrakk>?H \<subseteq> carrier G; ?x \<in> carrier G\<rbrakk> \<Longrightarrow> ?x <# ?H \<subseteq> carrier G
\<lbrakk>?M \<subseteq> carrier G; ?g \<in> carrier G; ?h \<in> carrier G\<rbrakk> \<Longrightarrow> ?g <# (?h <# ?M) = ?g \<otimes> ?h <# ?M

goal (1 subgoal):
 1. g <# (inv g <# H #> g) #> inv g = H
[PROOF STEP]
by (simp add: lcos_mult_one)


[STATEMENT]
lemma Add_Less:
assumes "0 < b"
shows    "(Suc a - b < Suc a) = True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc a - b < Suc a) = True
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < b

goal (1 subgoal):
 1. (Suc a - b < Suc a) = True
[PROOF STEP]
by auto


[STATEMENT]
lemma bernoulli'_0 [simp]: "bernoulli' 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli' 0 = 1
[PROOF STEP]
by (simp add: bernoulli'_def)


[STATEMENT]
lemma sum_subset_iff:
  fixes A :: hf shows "A+B \<le> C+D \<longleftrightarrow> A\<le>C \<and> B\<le>D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A + B \<le> C + D) = (A \<le> C \<and> B \<le> D)
[PROOF STEP]
by blast


[STATEMENT]
lemma splitit: " (index xs q < i \<and> i < length xs  \<Longrightarrow> P)
     \<Longrightarrow> (index xs q = i \<Longrightarrow> P)
     \<Longrightarrow> (index xs q - n \<le> i \<and> i < index xs q \<Longrightarrow> P)
     \<Longrightarrow> (i < index xs q - n \<Longrightarrow> P)
   \<Longrightarrow> (i < length xs \<Longrightarrow> P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>index xs q < i \<and> i < length xs \<Longrightarrow> P; index xs q = i \<Longrightarrow> P; index xs q - n \<le> i \<and> i < index xs q \<Longrightarrow> P; i < index xs q - n \<Longrightarrow> P; i < length xs\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by force


[STATEMENT]
lemma half_segments_of_aform1:
  assumes ch: "x \<in> convex hull set (map fst (half_segments_of_aform X))"
  assumes ab: "(a, b) \<in> set (half_segments_of_aform X)"
  shows "ccw a b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw a b x
[PROOF STEP]
using finite_set _ ch
[PROOF STATE]
proof (prove)
using this:
finite (set ?xs)
PROP ?psi \<Longrightarrow> PROP ?psi
x \<in> convex hull set (map fst (half_segments_of_aform X))

goal (1 subgoal):
 1. ccw a b x
[PROOF STEP]
proof (rule ccw.convex_hull)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c. c \<in> set (map fst (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c. c \<in> set (map fst (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
assume "c \<in> set (map fst (half_segments_of_aform X))"
[PROOF STATE]
proof (state)
this:
c \<in> set (map fst (half_segments_of_aform X))

goal (2 subgoals):
 1. \<And>c. c \<in> set (map fst (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<in> set (map fst (half_segments_of_aform X))
[PROOF STEP]
obtain d where "(c, d) \<in> set (half_segments_of_aform X)"
[PROOF STATE]
proof (prove)
using this:
c \<in> set (map fst (half_segments_of_aform X))

goal (1 subgoal):
 1. (\<And>d. (c, d) \<in> set (half_segments_of_aform X) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c, d) \<in> set (half_segments_of_aform X)

goal (2 subgoals):
 1. \<And>c. c \<in> set (map fst (half_segments_of_aform X)) \<Longrightarrow> ccw a b c
 2. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
with ab
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> set (half_segments_of_aform X)
(c, d) \<in> set (half_segments_of_aform X)
[PROOF STEP]
show "ccw a b c"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> set (half_segments_of_aform X)
(c, d) \<in> set (half_segments_of_aform X)

goal (1 subgoal):
 1. ccw a b c
[PROOF STEP]
by (rule ccw_half_segments_of_aform(1))
[PROOF STATE]
proof (state)
this:
ccw a b c

goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex b a
[PROOF STEP]
qed (insert ab, simp add: nlex_half_segments_of_aform)


[STATEMENT]
lemma closed_ML_Suc: "closed\<^sub>M\<^sub>L n v \<Longrightarrow> closed\<^sub>M\<^sub>L (Suc n) (lift\<^sub>M\<^sub>L k v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed\<^sub>M\<^sub>L n v \<Longrightarrow> closed\<^sub>M\<^sub>L (Suc n) (lift\<^sub>M\<^sub>L k v)
[PROOF STEP]
by (induct k v arbitrary: n rule: lift_ML.induct) simp_all


[STATEMENT]
lemma diagonal_to_Smith_row_i_preserves_previous_diagonal:
  fixes A::"'a:: {bezout_ring}^'b::mod_type^'c::mod_type"
  assumes ib: "is_bezout_ext bezout"
  and i_min: "i < min (nrows A) (ncols A)"
  and a_notin: "to_nat a \<notin> set [i + 1..<min (nrows A) (ncols A)]"
  and ab: "to_nat a = to_nat b"
  and ai: "to_nat a \<noteq> i"
  shows "Diagonal_to_Smith_row_i A i bezout $ a $ b = A $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Diagonal_to_Smith_row_i A i bezout $ a $ b = A $ a $ b
[PROOF STEP]
unfolding Diagonal_to_Smith_row_i_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_to_Smith_i [i + 1..<min (nrows A) (ncols A)] A i bezout $ a $ b = A $ a $ b
[PROOF STEP]
by (rule diagonal_to_Smith_i_preserves_previous_diagonal[OF ib i_min a_notin ab ai], auto)


[STATEMENT]
lemma sum_list_const_mult_prod :
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'r::semiring_0"
  shows "r * (\<Sum>(x,y)\<leftarrow>xys. f x y) = (\<Sum>(x,y)\<leftarrow>xys. r * (f x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * (\<Sum>(x, y)\<leftarrow>xys. f x y) = (\<Sum>(x, y)\<leftarrow>xys. r * f x y)
[PROOF STEP]
using sum_list_const_mult[of r "case_prod f"] prod.case_distrib[of "\<lambda>x. r*x" f]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>?xs. r * (case x of (x, xa) \<Rightarrow> f x xa)) = r * (\<Sum>x\<leftarrow>?xs. case x of (x, xa) \<Rightarrow> f x xa)
r * (case ?prod of (x, xa) \<Rightarrow> f x xa) = (case ?prod of (x1, x2) \<Rightarrow> r * f x1 x2)

goal (1 subgoal):
 1. r * (\<Sum>(x, y)\<leftarrow>xys. f x y) = (\<Sum>(x, y)\<leftarrow>xys. r * f x y)
[PROOF STEP]
by    simp


[STATEMENT]
lemma w: "(w solves_ode f2) {0..<pi/4} UNIV" and "w 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w solves_ode f2) {0..<pi / 4} UNIV &&& w 0 = 1
[PROOF STEP]
by (auto intro!: solves_odeI derivative_eq_intros ext
    simp: w_def has_vderiv_on_def f2_def has_vector_derivative_def cos_neq_zeroI
      tan_45 tan_sec divide_simps)


[STATEMENT]
lemma ind_eq_1_iff: "ind P n = 1 \<longleftrightarrow> n > 0 \<and> P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ind P n = (1::'a)) = (0 < n \<and> P n)
[PROOF STEP]
by (simp add: ind_def)


[STATEMENT]
lemma atLeastAtMost_nat_numeral:
  "{(m::nat)..numeral k} =
     (if m \<le> numeral k then insert (numeral k) {m..pred_numeral k} else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m..numeral k} = (if m \<le> numeral k then insert (numeral k) {m..pred_numeral k} else {})
[PROOF STEP]
by (auto simp: numeral_eq_Suc)


[STATEMENT]
lemma has_vderiv_on_component[simp]:
  fixes x::"real \<Rightarrow> ('a::banach)^('n::finite)"
  shows "(D x = x' on T) = (\<forall>i. D (\<lambda>t. x t $ i) = (\<lambda>t. x' t $ i) on T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1.  D x = x' on T = (\<forall>i.  D (\<lambda>t. x t $ i) = (\<lambda>t. x' t $ i) on T)
[PROOF STEP]
unfolding has_vderiv_on_def has_vector_derivative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>xa\<in>T. D x \<mapsto> (\<lambda>x. x *\<^sub>R x' xa) at xa within T) = (\<forall>i. \<forall>xa\<in>T. D (\<lambda>t. x t $ i) \<mapsto> (\<lambda>x. x *\<^sub>R x' xa $ i) at xa within T)
[PROOF STEP]
by auto


[STATEMENT]
lemma sigma_lemma:
  "primerec rg (Suc (length xs))
     \<Longrightarrow> rec_exec (rec_sigma rg) (xs @ [x]) = Sigma (rec_exec rg) (xs @ [x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primerec rg (Suc (length xs)) \<Longrightarrow> rec_exec (rec_sigma rg) (xs @ [x]) = UF.Sigma (rec_exec rg) (xs @ [x])
[PROOF STEP]
apply(induct x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. primerec rg (Suc (length xs)) \<Longrightarrow> rec_exec (rec_sigma rg) (xs @ [0]) = UF.Sigma (rec_exec rg) (xs @ [0])
 2. \<And>x. \<lbrakk>primerec rg (Suc (length xs)) \<Longrightarrow> rec_exec (rec_sigma rg) (xs @ [x]) = UF.Sigma (rec_exec rg) (xs @ [x]); primerec rg (Suc (length xs))\<rbrakk> \<Longrightarrow> rec_exec (rec_sigma rg) (xs @ [Suc x]) = UF.Sigma (rec_exec rg) (xs @ [Suc x])
[PROOF STEP]
apply(auto simp: rec_exec.simps rec_sigma.simps Let_def
      get_fstn_args_take Sigma_0_simp_rewrite
      Sigma_Suc_simp_rewrite)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma div_lt_mult: "\<lbrakk>i < k div x; 0 < x\<rbrakk> \<Longrightarrow> i * x < k"
  for i k x :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < k div x; 0 < x\<rbrakk> \<Longrightarrow> i * x < k
[PROOF STEP]
by (metis div_le_mono div_lt'' not_le unat_div word_div_mult word_less_iff_unsigned)


[STATEMENT]
lemma "\<exists>x::'a::linordered_field. \<forall>y. \<exists>z > y.
  \<forall>w. w < 13 \<longrightarrow> w + 10 * x - z \<ge> y \<longrightarrow> 5 * w + 7 * x + 13 * z \<ge> 2 * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. \<forall>y. \<exists>z>y. \<forall>w<13::'a. y \<le> w + (10::'a) * x - z \<longrightarrow> (2::'a) * y \<le> (5::'a) * w + (7::'a) * x + (13::'a) * z
[PROOF STEP]
by ferrack


[STATEMENT]
lemma "\<forall>(x::'a::linordered_field) y. x < y \<longrightarrow> (\<exists>z>0. x + z = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> (\<exists>z>0::'a. x + z = y)
[PROOF STEP]
by ferrack


[STATEMENT]
lemma mult_assoc: "mult (mult i j) k = mult i (mult j k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult (mult i j) k = mult i (mult j k)
[PROOF STEP]
by (induct k) (auto simp add: add_mult_distrib)


[STATEMENT]
lemma subst_tm_HPair [simp]: "subst i x (HPair a b) = HPair (subst i x a) (subst i x b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst i x (HPair a b) = HPair (subst i x a) (subst i x b)
[PROOF STEP]
by (auto simp: HPair_def)


[STATEMENT]
lemma CARD_tree [card_simps]:
  "CARD('a tree) = card_tree CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a tree) = card_tree CARD('a)
[PROOF STEP]
by(simp add: card_tree_def finite_UNIV_tree)


[STATEMENT]
lemma concat_nth_length:
  "i < length uss \<Longrightarrow> j < length (uss ! i) \<Longrightarrow>
    sum_list (map length (take i uss)) + j < length (concat uss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length uss; j < length (uss ! i)\<rbrakk> \<Longrightarrow> sum_list (map length (take i uss)) + j < length (concat uss)
[PROOF STEP]
by (induct uss arbitrary: i j) (simp, case_tac i, auto)


[STATEMENT]
lemma total_onPD:
  "\<lbrakk> total_onP A r; x \<in> A; y \<in> A \<rbrakk> \<Longrightarrow> r x y \<or> x = y \<or> r y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>total_onP A r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> r x y \<or> x = y \<or> r y x
[PROOF STEP]
by(drule (2) total_onD) blast


[STATEMENT]
lemma shift_vars_add:
  assumes "p \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "Q \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  shows "shift_vars n m (p \<oplus>\<^bsub>R[\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<oplus>\<^bsub>R[\<X>\<^bsub>n+m\<^esub>]\<^esub> shift_vars n m Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shift_vars n m (p \<oplus>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<oplus>\<^bsub>R [\<X>\<^bsub>n + m\<^esub>]\<^esub> shift_vars n m Q
[PROOF STEP]
using assms shift_vars_char(1)[of n m]
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
Q \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
ring_hom_ring (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>n + m\<^esub>]) (shift_vars n m)

goal (1 subgoal):
 1. shift_vars n m (p \<oplus>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<oplus>\<^bsub>R [\<X>\<^bsub>n + m\<^esub>]\<^esub> shift_vars n m Q
[PROOF STEP]
unfolding ring_hom_ring_def ring_hom_ring_axioms_def
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
Q \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
ring (R [\<X>\<^bsub>n\<^esub>]) \<and> ring (R [\<X>\<^bsub>n + m\<^esub>]) \<and> shift_vars n m \<in> ring_hom (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>n + m\<^esub>])

goal (1 subgoal):
 1. shift_vars n m (p \<oplus>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<oplus>\<^bsub>R [\<X>\<^bsub>n + m\<^esub>]\<^esub> shift_vars n m Q
[PROOF STEP]
using ring_hom_add
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
Q \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
ring (R [\<X>\<^bsub>n\<^esub>]) \<and> ring (R [\<X>\<^bsub>n + m\<^esub>]) \<and> shift_vars n m \<in> ring_hom (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>n + m\<^esub>])
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<oplus>\<^bsub>?R\<^esub> ?y) = ?h ?x \<oplus>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. shift_vars n m (p \<oplus>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<oplus>\<^bsub>R [\<X>\<^bsub>n + m\<^esub>]\<^esub> shift_vars n m Q
[PROOF STEP]
by (metis (no_types, lifting))


[STATEMENT]
lemma type_to_set:
  shows "class.nontriv TYPE('b)" (is ?a) and "p=CARD('b)" (is ?b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.nontriv TYPE('b) &&& p = CARD('b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. p = CARD('b)
[PROOF STEP]
from local_typedef
[PROOF STATE]
proof (chain)
picking this:
\<exists>Rep Abs. type_definition Rep Abs {0..<int p}
[PROOF STEP]
obtain Rep::"('b \<Rightarrow> int)" and Abs
    where t: "type_definition Rep Abs {0..<p :: int}"
[PROOF STATE]
proof (prove)
using this:
\<exists>Rep Abs. type_definition Rep Abs {0..<int p}

goal (1 subgoal):
 1. (\<And>Rep Abs. type_definition Rep Abs {0..<int p} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
type_definition Rep Abs {0..<int p}

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. p = CARD('b)
[PROOF STEP]
have "card (UNIV :: 'b set) = card {0..<p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('b) = card {0..<p}
[PROOF STEP]
using t type_definition.card
[PROOF STATE]
proof (prove)
using this:
type_definition Rep Abs {0..<int p}
type_definition ?Rep ?Abs ?A \<Longrightarrow> CARD(?'b) = card ?A

goal (1 subgoal):
 1. CARD('b) = card {0..<p}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
CARD('b) = card {0..<p}

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. p = CARD('b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
CARD('b) = card {0..<p}

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. p = CARD('b)
[PROOF STEP]
have "... = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {0..<p} = p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {0..<p} = p

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. p = CARD('b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
CARD('b) = p
[PROOF STEP]
show ?b
[PROOF STATE]
proof (prove)
using this:
CARD('b) = p

goal (1 subgoal):
 1. p = CARD('b)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
p = CARD('b)

goal (1 subgoal):
 1. class.nontriv TYPE('b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = CARD('b)
[PROOF STEP]
show ?a
[PROOF STATE]
proof (prove)
using this:
p = CARD('b)

goal (1 subgoal):
 1. class.nontriv TYPE('b)
[PROOF STEP]
unfolding class.nontriv_def
[PROOF STATE]
proof (prove)
using this:
p = CARD('b)

goal (1 subgoal):
 1. 1 < CARD('b)
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
p = CARD('b)
1 < p

goal (1 subgoal):
 1. 1 < CARD('b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
class.nontriv TYPE('b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sign_changes_Cons_Cons_different:
  fixes x y :: "'a :: linordered_idom"
  assumes "x * y < 0"
  shows "sign_changes (x # y # xs) = 1 + sign_changes (y # xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes (x # y # xs) = 1 + sign_changes (y # xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sign_changes (x # y # xs) = 1 + sign_changes (y # xs)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x * y < (0::'a)
[PROOF STEP]
have "sgn x = -1 \<and> sgn y = 1 \<or> sgn x = 1 \<and> sgn y = -1"
[PROOF STATE]
proof (prove)
using this:
x * y < (0::'a)

goal (1 subgoal):
 1. sgn x = - (1::'a) \<and> sgn y = (1::'a) \<or> sgn x = (1::'a) \<and> sgn y = - (1::'a)
[PROOF STEP]
by (auto simp: mult_less_0_iff)
[PROOF STATE]
proof (state)
this:
sgn x = - (1::'a) \<and> sgn y = (1::'a) \<or> sgn x = (1::'a) \<and> sgn y = - (1::'a)

goal (1 subgoal):
 1. sign_changes (x # y # xs) = 1 + sign_changes (y # xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sgn x = - (1::'a) \<and> sgn y = (1::'a) \<or> sgn x = (1::'a) \<and> sgn y = - (1::'a)

goal (1 subgoal):
 1. sign_changes (x # y # xs) = 1 + sign_changes (y # xs)
[PROOF STEP]
by (fastforce simp: sign_changes_def)
[PROOF STATE]
proof (state)
this:
sign_changes (x # y # xs) = 1 + sign_changes (y # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_max [continuous_intros]:
  fixes f :: "'a::t2_space \<Rightarrow> 'b::linorder_topology"
  shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. (max (f x) (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. max (f x) (g x))
[PROOF STEP]
by (simp add: tendsto_max continuous_def)


[STATEMENT]
lemma mtf_eq_mtf2: "mtf x xs = mtf2 (length xs - 1) x xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mtf x xs = mtf2 (length xs - 1) x xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mtf x xs = mtf2 (length xs - 1) x xs
[PROOF STEP]
have "x : set xs \<Longrightarrow> index xs x - (size xs - Suc 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs \<Longrightarrow> index xs x - (length xs - Suc 0) = 0
[PROOF STEP]
by (auto simp: less_Suc_eq_le[symmetric])
[PROOF STATE]
proof (state)
this:
x \<in> set xs \<Longrightarrow> index xs x - (length xs - Suc 0) = 0

goal (1 subgoal):
 1. mtf x xs = mtf2 (length xs - 1) x xs
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> set xs \<Longrightarrow> index xs x - (length xs - Suc 0) = 0

goal (1 subgoal):
 1. mtf x xs = mtf2 (length xs - 1) x xs
[PROOF STEP]
by(auto simp: mtf_def mtf2_def swaps_eq_nth_take_drop)
[PROOF STATE]
proof (state)
this:
mtf x xs = mtf2 (length xs - 1) x xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sq_mtx_scaleR_ith[simp]: "(c *\<^sub>R A) $$ i = (c  *\<^sub>R (A $$ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c *\<^sub>R A) $$ i = c *\<^sub>R A $$ i
[PROOF STEP]
by (unfold scaleR_sq_mtx_def, transfer, simp)


[STATEMENT]
lemma scaleR_right_mono_neg: "b \<le> a \<Longrightarrow> c \<le> 0 \<Longrightarrow> a *\<^sub>R c \<le> b *\<^sub>R c"
  for c :: "'a::ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<le> a; c \<le> (0::'a)\<rbrakk> \<Longrightarrow> a *\<^sub>R c \<le> b *\<^sub>R c
[PROOF STEP]
by (drule scaleR_right_mono [of _ _ "- c"], simp_all)