[STATEMENT]
lemma not_less_iMin: "k < iMin I \<Longrightarrow> k \<notin> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < iMin I \<Longrightarrow> k \<notin> I
[PROOF STEP]
unfolding iMin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < (LEAST x. x \<in> I) \<Longrightarrow> k \<notin> I
[PROOF STEP]
by (rule not_less_Least)


[STATEMENT]
lemma dom_override_on [simp]:
  "dom (override_on f g A) =
    (dom f  - {a. a \<in> A - dom g}) \<union> {a. a \<in> A \<inter> dom g}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom (override_on f g A) = dom f - {a. a \<in> A - dom g} \<union> {a. a \<in> A \<inter> dom g}
[PROOF STEP]
by (auto simp: dom_def override_on_def)


[STATEMENT]
lemma absolutely_integrable_restrict_UNIV:
  "(\<lambda>x. if x \<in> S then f x else 0) absolutely_integrable_on UNIV \<longleftrightarrow> f absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) absolutely_integrable_on UNIV) = (f absolutely_integrable_on S)
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. indicat_real UNIV x *\<^sub>R (if x \<in> S then f x else (0::'b))) = integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
by (intro arg_cong2[where f=integrable]) auto


[STATEMENT]
lemma map_of_zip_eq_SomeD: "length xs = length ys \<Longrightarrow>
  map_of (zip xs ys) x = Some y \<Longrightarrow> y \<in> set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; map_of (zip xs ys) x = Some y\<rbrakk> \<Longrightarrow> y \<in> set ys
[PROOF STEP]
apply(induct rule:list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map_of (zip [] []) x = Some y \<Longrightarrow> y \<in> set []
 2. \<And>xa xs ya ys. \<lbrakk>length xs = length ys; map_of (zip xs ys) x = Some y \<Longrightarrow> y \<in> set ys; map_of (zip (xa # xs) (ya # ys)) x = Some y\<rbrakk> \<Longrightarrow> y \<in> set (ya # ys)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xs ya ys. \<lbrakk>length xs = length ys; map_of (zip xs ys) x = Some y \<Longrightarrow> y \<in> set ys; map_of (zip (xa # xs) (ya # ys)) x = Some y\<rbrakk> \<Longrightarrow> y \<in> set (ya # ys)
[PROOF STEP]
apply (auto split:if_splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma le_foldseq:
  assumes
  "\<forall>a b c d . a <= b & c <= d \<longrightarrow> f a c <= f b d"
  "\<forall>i. i <= n \<longrightarrow> s i <= t i"
  shows
  "foldseq f s n <= foldseq f t n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldseq f s n \<le> foldseq f t n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. foldseq f s n \<le> foldseq f t n
[PROOF STEP]
have "\<forall>s t. (\<forall>i. i<=n \<longrightarrow> s i <= t i) \<longrightarrow> foldseq f s n <= foldseq f t n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s t. (\<forall>i\<le>n. s i \<le> t i) \<longrightarrow> foldseq f s n \<le> foldseq f t n
[PROOF STEP]
by (induct n) (simp_all add: assms)
[PROOF STATE]
proof (state)
this:
\<forall>s t. (\<forall>i\<le>n. s i \<le> t i) \<longrightarrow> foldseq f s n \<le> foldseq f t n

goal (1 subgoal):
 1. foldseq f s n \<le> foldseq f t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>s t. (\<forall>i\<le>n. s i \<le> t i) \<longrightarrow> foldseq f s n \<le> foldseq f t n
[PROOF STEP]
show "foldseq f s n <= foldseq f t n"
[PROOF STATE]
proof (prove)
using this:
\<forall>s t. (\<forall>i\<le>n. s i \<le> t i) \<longrightarrow> foldseq f s n \<le> foldseq f t n

goal (1 subgoal):
 1. foldseq f s n \<le> foldseq f t n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>s t. (\<forall>i\<le>n. s i \<le> t i) \<longrightarrow> foldseq f s n \<le> foldseq f t n
\<forall>a b c d. a \<le> b \<and> c \<le> d \<longrightarrow> f a c \<le> f b d
\<forall>i\<le>n. s i \<le> t i

goal (1 subgoal):
 1. foldseq f s n \<le> foldseq f t n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldseq f s n \<le> foldseq f t n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_eq_poly_eq_iff: "poly p = poly q \<longleftrightarrow> p = q"
  (is "?lhs \<longleftrightarrow> ?rhs")
  for p q :: "'a::{comm_ring_1,ring_no_zero_divisors,ring_char_0} poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p = poly q) = (p = q)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly p = poly q \<Longrightarrow> p = q
 2. p = q \<Longrightarrow> poly p = poly q
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
p = q

goal (2 subgoals):
 1. poly p = poly q \<Longrightarrow> p = q
 2. p = q \<Longrightarrow> poly p = poly q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = q
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
p = q

goal (1 subgoal):
 1. poly p = poly q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly p = poly q

goal (1 subgoal):
 1. poly p = poly q \<Longrightarrow> p = q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly p = poly q \<Longrightarrow> p = q
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
poly p = poly q

goal (1 subgoal):
 1. poly p = poly q \<Longrightarrow> p = q
[PROOF STEP]
have "poly p = poly 0 \<longleftrightarrow> p = 0" for p :: "'a poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p = poly 0) = (p = 0)
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> (poly p = poly 0) = (p = 0)
 2. p \<noteq> 0 \<Longrightarrow> (poly p = poly 0) = (p = 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> (poly p = poly 0) = (p = 0)
 2. p \<noteq> 0 \<Longrightarrow> (poly p = poly 0) = (p = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. (poly p = poly 0) = (p = 0)
[PROOF STEP]
by (auto simp add: infinite_UNIV_char_0 dest: poly_roots_finite)
[PROOF STATE]
proof (state)
this:
(poly p = poly 0) = (p = 0)

goal (1 subgoal):
 1. p = 0 \<Longrightarrow> (poly p = poly 0) = (p = 0)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(poly ?p = poly 0) = (?p = 0)

goal (1 subgoal):
 1. poly p = poly q \<Longrightarrow> p = q
[PROOF STEP]
from \<open>?lhs\<close> and this [of "p - q"]
[PROOF STATE]
proof (chain)
picking this:
poly p = poly q
(poly (p - q) = poly 0) = (p - q = 0)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
poly p = poly q
(poly (p - q) = poly 0) = (p - q = 0)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible_altdef:
  "irreducible x \<longleftrightarrow> x \<noteq> 0 \<and> \<not>is_unit x \<and> (\<forall>b. b dvd x \<longrightarrow> x dvd b \<or> is_unit b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible x = (x \<noteq> (0::'a) \<and> \<not> is_unit x \<and> (\<forall>b. b dvd x \<longrightarrow> x dvd b \<or> is_unit b))
[PROOF STEP]
using irreducibleI'[of x] irreducibleD'[of x] irreducible_not_unit[of x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<noteq> (0::'a); \<not> is_unit x; \<And>b. b dvd x \<Longrightarrow> x dvd b \<or> is_unit b\<rbrakk> \<Longrightarrow> irreducible x
\<lbrakk>irreducible x; ?b dvd x\<rbrakk> \<Longrightarrow> x dvd ?b \<or> is_unit ?b
irreducible x \<Longrightarrow> \<not> is_unit x

goal (1 subgoal):
 1. irreducible x = (x \<noteq> (0::'a) \<and> \<not> is_unit x \<and> (\<forall>b. b dvd x \<longrightarrow> x dvd b \<or> is_unit b))
[PROOF STEP]
by auto


[STATEMENT]
lemma disjoint_family_on_insert:
  "i \<notin> I \<Longrightarrow> disjoint_family_on A (insert i I) \<longleftrightarrow> A i \<inter> (\<Union>i\<in>I. A i) = {} \<and> disjoint_family_on A I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<notin> I \<Longrightarrow> disjoint_family_on A (insert i I) = (A i \<inter> \<Union> (A ` I) = {} \<and> disjoint_family_on A I)
[PROOF STEP]
by (fastforce simp: disjoint_family_on_def)


[STATEMENT]
lemma iT_Minus_icard: "icard (k \<ominus> I) = icard (I \<down>\<le> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. icard (k \<ominus> I) = icard (I \<down>\<le> k)
[PROOF STEP]
by (simp add: icard_finite iT_Minus_finite nat_cut_le_finite iT_Minus_card)


[STATEMENT]
lemma monic_prod:
  fixes f :: "'a \<Rightarrow> 'b :: idom poly"
  assumes "\<And> a. a \<in> as \<Longrightarrow> monic (f a)"
  shows "monic (prod f as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (prod f as)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> as \<Longrightarrow> monic (f ?a)

goal (1 subgoal):
 1. monic (prod f as)
[PROOF STEP]
proof (induct as rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>a. a \<in> A \<Longrightarrow> monic (f a)\<rbrakk> \<Longrightarrow> monic (prod f A)
 2. (\<And>a. a \<in> {} \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f {})
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f F); \<And>a. a \<in> insert x F \<Longrightarrow> monic (f a)\<rbrakk> \<Longrightarrow> monic (prod f (insert x F))
[PROOF STEP]
case (insert a as)
[PROOF STATE]
proof (state)
this:
finite as
a \<notin> as
(\<And>a. a \<in> as \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f as)
?a \<in> insert a as \<Longrightarrow> monic (f ?a)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>a. a \<in> A \<Longrightarrow> monic (f a)\<rbrakk> \<Longrightarrow> monic (prod f A)
 2. (\<And>a. a \<in> {} \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f {})
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f F); \<And>a. a \<in> insert x F \<Longrightarrow> monic (f a)\<rbrakk> \<Longrightarrow> monic (prod f (insert x F))
[PROOF STEP]
hence id: "prod f (insert a as) = f a * prod f as"
    and *: "monic (f a)" "monic (prod f as)"
[PROOF STATE]
proof (prove)
using this:
finite as
a \<notin> as
(\<And>a. a \<in> as \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f as)
?a \<in> insert a as \<Longrightarrow> monic (f ?a)

goal (1 subgoal):
 1. prod f (insert a as) = f a * prod f as &&& monic (f a) &&& monic (prod f as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod f (insert a as) = f a * prod f as
monic (f a)
monic (prod f as)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>a. a \<in> A \<Longrightarrow> monic (f a)\<rbrakk> \<Longrightarrow> monic (prod f A)
 2. (\<And>a. a \<in> {} \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f {})
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f F); \<And>a. a \<in> insert x F \<Longrightarrow> monic (f a)\<rbrakk> \<Longrightarrow> monic (prod f (insert x F))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (prod f (insert a as))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (f a * prod f as)
[PROOF STEP]
by (rule monic_mult[OF *])
[PROOF STATE]
proof (state)
this:
monic (prod f (insert a as))

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>a. a \<in> A \<Longrightarrow> monic (f a)\<rbrakk> \<Longrightarrow> monic (prod f A)
 2. (\<And>a. a \<in> {} \<Longrightarrow> monic (f a)) \<Longrightarrow> monic (prod f {})
[PROOF STEP]
qed auto


[STATEMENT]
lemma gcd_add2 [simp]: "gcd m (m + n) = gcd m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m (m + n) = gcd m n
[PROOF STEP]
using gcd_add1 [of n m]
[PROOF STATE]
proof (prove)
using this:
gcd (n + m) m = gcd n m

goal (1 subgoal):
 1. gcd m (m + n) = gcd m n
[PROOF STEP]
by (simp add: ac_simps)


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

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


[STATEMENT]
lemma ln_2_ge_56_81: "ln 2 \<ge> (56 / 81 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 56 / 81 \<le> ln 2
[PROOF STEP]
using ln_approx_bounds[of 2 2, simplified, simplified eval_nat_numeral, simplified]
[PROOF STATE]
proof (prove)
using this:
56 \<le> ln 2 * 81 \<and> ln 2 \<le> 56 / 81 + 9 * (1 / 3) ^ 5 / 20

goal (1 subgoal):
 1. 56 / 81 \<le> ln 2
[PROOF STEP]
by simp


[STATEMENT]
lemma supportE_Suc: "supportE (\<lambda>l s. Suc (e1 l s)) = supportE e1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supportE (\<lambda>l s. Suc (e1 l s)) = supportE e1
[PROOF STEP]
unfolding supportE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>l1 l2 s. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> Suc (e1 l1 s) \<noteq> Suc (e1 l2 s)} = {x. \<exists>l1 l2 s. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> e1 l1 s \<noteq> e1 l2 s}
[PROOF STEP]
by (auto)


[STATEMENT]
lemma affine_diffs_subspace:
  assumes "affine S" "a \<in> S"
  shows "subspace ((\<lambda>x. (-a)+x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
have [simp]: "(\<lambda>x. x - a) = plus (- a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x - a) = (+) (- a)
[PROOF STEP]
by (simp add: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x - a) = (+) (- a)

goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
have "affine ((\<lambda>x. (-a)+x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine ((+) (- a) ` S)
[PROOF STEP]
using affine_translation assms
[PROOF STATE]
proof (prove)
using this:
affine ?S = affine ((+) ?a ` ?S)
affine S
a \<in> S

goal (1 subgoal):
 1. affine ((+) (- a) ` S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
affine ((+) (- a) ` S)

goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
affine ((+) (- a) ` S)

goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
have "0 \<in> ((\<lambda>x. (-a)+x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<in> (+) (- a) ` S
[PROOF STEP]
using assms exI[of "(\<lambda>x. x\<in>S \<and> -a+x = 0)" a]
[PROOF STATE]
proof (prove)
using this:
affine S
a \<in> S
a \<in> S \<and> - a + a = (0::'a) \<Longrightarrow> \<exists>x. x \<in> S \<and> - a + x = (0::'a)

goal (1 subgoal):
 1. (0::'a) \<in> (+) (- a) ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<in> (+) (- a) ` S

goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
affine ((+) (- a) ` S)
(0::'a) \<in> (+) (- a) ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
affine ((+) (- a) ` S)
(0::'a) \<in> (+) (- a) ` S

goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
using subspace_affine
[PROOF STATE]
proof (prove)
using this:
affine ((+) (- a) ` S)
(0::'a) \<in> (+) (- a) ` S
subspace ?S = (affine ?S \<and> (0::?'a) \<in> ?S)

goal (1 subgoal):
 1. subspace ((+) (- a) ` S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subspace ((+) (- a) ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma evaluate_list_mono[mono]:
  assumes "R \<le> Q"
  shows "evaluate_list R \<le> evaluate_list Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Big_Step_Unclocked_Single.evaluate_list R \<le> Big_Step_Unclocked_Single.evaluate_list Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R \<le> Q

goal (1 subgoal):
 1. Big_Step_Unclocked_Single.evaluate_list R \<le> Big_Step_Unclocked_Single.evaluate_list Q
[PROOF STEP]
unfolding le_fun_def le_bool_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x xa xb. R x xa xb \<longrightarrow> Q x xa xb

goal (1 subgoal):
 1. \<forall>x xa xb. Big_Step_Unclocked_Single.evaluate_list R x xa xb \<longrightarrow> Big_Step_Unclocked_Single.evaluate_list Q x xa xb
[PROOF STEP]
by (metis evaluate_list_mono_strong)


[STATEMENT]
lemma ccInf_lower2: "countable A \<Longrightarrow> u \<in> A \<Longrightarrow> u \<le> v \<Longrightarrow> Inf A \<le> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; u \<in> A; u \<le> v\<rbrakk> \<Longrightarrow> Inf A \<le> v
[PROOF STEP]
using ccInf_lower [of A u]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable A; u \<in> A\<rbrakk> \<Longrightarrow> Inf A \<le> u

goal (1 subgoal):
 1. \<lbrakk>countable A; u \<in> A; u \<le> v\<rbrakk> \<Longrightarrow> Inf A \<le> v
[PROOF STEP]
by auto


[STATEMENT]
lemma mon_compose_rev:
   "\<lbrakk>f \<in> hom G H; g \<in> hom H K; (g \<circ> f) \<in> mon G K\<rbrakk> \<Longrightarrow> f \<in> mon G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> hom G H; g \<in> hom H K; g \<circ> f \<in> mon G K\<rbrakk> \<Longrightarrow> f \<in> mon G H
[PROOF STEP]
using inj_on_imageI2
[PROOF STATE]
proof (prove)
using this:
inj_on (?f' \<circ> ?f) ?A \<Longrightarrow> inj_on ?f ?A

goal (1 subgoal):
 1. \<lbrakk>f \<in> hom G H; g \<in> hom H K; g \<circ> f \<in> mon G K\<rbrakk> \<Longrightarrow> f \<in> mon G H
[PROOF STEP]
by (auto simp: mon_def)


[STATEMENT]
lemma bounded_linearI':
  fixes f ::"'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
  assumes "\<And>x y. f (x + y) = f x + f y"
    and "\<And>c x. f (c *\<^sub>R x) = c *\<^sub>R f x"
  shows "bounded_linear f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f
[PROOF STEP]
using assms linearI linear_conv_bounded_linear
[PROOF STATE]
proof (prove)
using this:
f (?x + ?y) = f ?x + f ?y
f (?c *\<^sub>R ?x) = ?c *\<^sub>R f ?x
\<lbrakk>\<And>b1 b2. ?f (b1 + b2) = ?f b1 + ?f b2; \<And>r b. ?f (r *\<^sub>R b) = r *\<^sub>R ?f b\<rbrakk> \<Longrightarrow> linear ?f
linear ?f = bounded_linear ?f

goal (1 subgoal):
 1. bounded_linear f
[PROOF STEP]
by blast


[STATEMENT]
lemma "c \<noteq> 0 \<Longrightarrow> D (\<lambda>t. - a3 * exp (t^3 / c) + a1 * sin t + a2 * t^2) =
  (\<lambda>t. a1 * cos t + 2 * a2 * t - 3 * a3 * t^2 / c * exp (t^3 / c)) on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow>  D (\<lambda>t. - a3 * exp (t ^ 3 / c) + a1 * sin t + a2 * t\<^sup>2) = (\<lambda>t. a1 * cos t + 2 * a2 * t - 3 * a3 * t\<^sup>2 / c * exp (t ^ 3 / c)) on T
[PROOF STEP]
by(auto intro!: poly_derivatives simp: power2_eq_square)


[STATEMENT]
lemma square_irreflexive_part_2:
  "x * x - 1 \<le> x\<^sup>\<star> - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * x - (1::'a) \<le> x\<^sup>\<star> - (1::'a)
[PROOF STEP]
using comp_inf.mult_left_isotone star.circ_increasing star.circ_mult_upper_bound
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?x \<sqinter> ?z \<le> ?y \<sqinter> ?z
?x \<le> ?x\<^sup>\<star>
\<lbrakk>?x \<le> ?z\<^sup>\<star>; ?y \<le> ?z\<^sup>\<star>\<rbrakk> \<Longrightarrow> ?x * ?y \<le> ?z\<^sup>\<star>

goal (1 subgoal):
 1. x * x - (1::'a) \<le> x\<^sup>\<star> - (1::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma card_face_cycle_sets_da: "card G.face_cycle_sets = Suc (card H.face_cycle_sets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.face_cycle_sets = Suc (card H.face_cycle_sets)
[PROOF STEP]
unfolding card_face_cycle_sets_da'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.face_cycle_sets = Suc (card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1))
[PROOF STEP]
using S_ne diff_face card_fcs_aa'_le
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
G.face_cycle_set a' \<noteq> G.face_cycle_set a
card {G.face_cycle_set a, G.face_cycle_set a'} \<le> card G.face_cycle_sets

goal (1 subgoal):
 1. card G.face_cycle_sets = Suc (card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1))
[PROOF STEP]
by simp


[STATEMENT]
lemma realrel_iff [simp]: "(((x1,y1),(x2,y2)) \<in> realrel) = (x1 + y2 = x2 + y1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((x1, y1), x2, y2) \<in> Dedekind_Real.realrel) = (x1 + y2 = x2 + y1)
[PROOF STEP]
by (simp add: realrel_def)


[STATEMENT]
lemma infs_mono: "(\<And> a. a \<in> sset w \<Longrightarrow> P a \<Longrightarrow> Q a) \<Longrightarrow> infs P w \<Longrightarrow> infs Q w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a. \<lbrakk>a \<in> sset w; P a\<rbrakk> \<Longrightarrow> Q a; infs P w\<rbrakk> \<Longrightarrow> infs Q w
[PROOF STEP]
unfolding infs_snth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a. \<lbrakk>a \<in> sset w; P a\<rbrakk> \<Longrightarrow> Q a; \<forall>n. \<exists>k\<ge>n. P (w !! k)\<rbrakk> \<Longrightarrow> \<forall>n. \<exists>k\<ge>n. Q (w !! k)
[PROOF STEP]
by force


[STATEMENT]
lemma totient_conv_moebius_mu_of_nat:
  "of_nat (totient n) = dirichlet_prod moebius_mu of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (totient n) = dirichlet_prod moebius_mu of_nat n
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> of_nat (totient n) = dirichlet_prod moebius_mu of_nat n
 2. n \<noteq> 0 \<Longrightarrow> of_nat (totient n) = dirichlet_prod moebius_mu of_nat n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> of_nat (totient n) = dirichlet_prod moebius_mu of_nat n
 2. n \<noteq> 0 \<Longrightarrow> of_nat (totient n) = dirichlet_prod moebius_mu of_nat n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (totient n) = dirichlet_prod moebius_mu of_nat n
[PROOF STEP]
by (rule moebius_inversion)
       (insert False, simp_all add: of_nat_sum [symmetric] totient_divisor_sum del: of_nat_sum)
[PROOF STATE]
proof (state)
this:
of_nat (totient n) = dirichlet_prod moebius_mu of_nat n

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> of_nat (totient n) = dirichlet_prod moebius_mu of_nat n
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma c_ballE:
  assumes "x \<in> c_ball n c"
  shows "x \<in> carrier Q\<^sub>p"
        " val (x \<ominus> c) \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier Q\<^sub>p &&& eint n \<le> val (x \<ominus> c)
[PROOF STEP]
using assms c_ball_def
[PROOF STATE]
proof (prove)
using this:
x \<in> B\<^bsub>n\<^esub>[c]
B\<^bsub>?n\<^esub>[?c] = {x \<in> carrier Q\<^sub>p. eint ?n \<le> val (x \<ominus> ?c)}

goal (1 subgoal):
 1. x \<in> carrier Q\<^sub>p &&& eint n \<le> val (x \<ominus> c)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eint n \<le> val (x \<ominus> c)
[PROOF STEP]
using assms c_ball_def
[PROOF STATE]
proof (prove)
using this:
x \<in> B\<^bsub>n\<^esub>[c]
B\<^bsub>?n\<^esub>[?c] = {x \<in> carrier Q\<^sub>p. eint ?n \<le> val (x \<ominus> ?c)}

goal (1 subgoal):
 1. eint n \<le> val (x \<ominus> c)
[PROOF STEP]
by blast


[STATEMENT]
lemma bounded_bilinear_matrix_matrix_mult[bounded_bilinear]:
   "bounded_bilinear ((**)::
    ('a::{euclidean_space, real_normed_algebra_1}^'n^'m) \<Rightarrow>
    ('a::{euclidean_space, real_normed_algebra_1}^'p^'n) \<Rightarrow>
    ('a::{euclidean_space, real_normed_algebra_1}^'p^'m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_bilinear (**)
[PROOF STEP]
unfolding bilinear_conv_bounded_bilinear[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bilinear (**)
[PROOF STEP]
unfolding bilinear_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. linear ((**) x)) \<and> (\<forall>y. linear (\<lambda>x. x ** y))
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. linear ((**) x)
 2. \<And>y. linear (\<lambda>x. x ** y)
[PROOF STEP]
by unfold_locales (auto simp: matrix_add_ldistrib matrix_add_rdistrib matrix_scaleR_right matrix_scaleR_left)


[STATEMENT]
lemma independent_alt:
  "independent B \<longleftrightarrow>
    (\<forall>X. finite {x. X x \<noteq> 0} \<longrightarrow> {x. X x \<noteq> 0} \<subseteq> B \<longrightarrow> (\<Sum>x|X x \<noteq> 0. X x *s x) = 0 \<longrightarrow> (\<forall>x. X x = 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent B = (\<forall>X. finite {x. X x \<noteq> (0::'a)} \<longrightarrow> {x. X x \<noteq> (0::'a)} \<subseteq> B \<longrightarrow> (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b) \<longrightarrow> (\<forall>x. X x = (0::'a)))
[PROOF STEP]
unfolding dependent_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>X. finite {x. X x \<noteq> (0::'a)} \<and> {x. X x \<noteq> (0::'a)} \<subseteq> B \<and> (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b) \<and> (\<exists>x. X x \<noteq> (0::'a))) = (\<forall>X. finite {x. X x \<noteq> (0::'a)} \<longrightarrow> {x. X x \<noteq> (0::'a)} \<subseteq> B \<longrightarrow> (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b) \<longrightarrow> (\<forall>x. X x = (0::'a)))
[PROOF STEP]
by auto


[STATEMENT]
lemma GRP034_4:
  "(\<forall>X Y. product(X::'a,Y,multiply(X::'a,Y))) &
  (\<forall>X. product(identity::'a,X,X)) &
  (\<forall>X. product(X::'a,identity,X)) &
  (\<forall>X. product(X::'a,INVERSE(X),identity)) &
  (\<forall>Y U Z X V W. product(X::'a,Y,U) & product(Y::'a,Z,V) & product(U::'a,Z,W) --> product(X::'a,V,W)) &
  (\<forall>Y X V U Z W. product(X::'a,Y,U) & product(Y::'a,Z,V) & product(X::'a,V,W) --> product(U::'a,Z,W)) &
  (\<forall>B A C. subgroup_member(A) & subgroup_member(B) & product(B::'a,INVERSE(A),C) --> subgroup_member(C)) &
  (subgroup_member(a)) &
  (~subgroup_member(INVERSE(a))) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>X Y. product (X, Y, multiply (X, Y))) \<and> (\<forall>X. product (identity, X, X)) \<and> (\<forall>X. product (X, identity, X)) \<and> (\<forall>X. product (X, INVERSE X, identity)) \<and> (\<forall>Y U Z X V W. product (X, Y, U) \<and> product (Y, Z, V) \<and> product (U, Z, W) \<longrightarrow> product (X, V, W)) \<and> (\<forall>Y X V U Z W. product (X, Y, U) \<and> product (Y, Z, V) \<and> product (X, V, W) \<longrightarrow> product (U, Z, W)) \<and> (\<forall>B A C. subgroup_member A \<and> subgroup_member B \<and> product (B, INVERSE A, C) \<longrightarrow> subgroup_member C) \<and> subgroup_member a \<and> \<not> subgroup_member (INVERSE a) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma power_up_nonpos_iff[simp]:
  notes [simp del] = power_up_neg_iff power_up_eq_zero_iff
  shows "power_up prec b n \<le> 0 \<longleftrightarrow> b < 0 \<and> odd n \<or> b = 0 \<and> n \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (power_up prec b n \<le> 0) = (b < 0 \<and> odd n \<or> b = 0 \<and> n \<noteq> 0)
[PROOF STEP]
using power_up_neg_iff[of prec b n] power_up_eq_zero_iff[of prec b n]
[PROOF STATE]
proof (prove)
using this:
(power_up prec b n < 0) = (b < 0 \<and> odd n)
(power_up prec b n = 0) = (b = 0 \<and> n \<noteq> 0)

goal (1 subgoal):
 1. (power_up prec b n \<le> 0) = (b < 0 \<and> odd n \<or> b = 0 \<and> n \<noteq> 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma univariate_mpoly_roots_finite:
fixes p::"'a::idom mpoly"
assumes "vars p \<subseteq> {v}" "p \<noteq> 0"
shows "finite {x. insertion (\<lambda>v. x) p = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. insertion (\<lambda>v. x) p = (0::'a)}
[PROOF STEP]
using poly_roots_finite[of "mpoly_to_poly v p", unfolded poly_eq_insertion[OF \<open>vars p \<subseteq> {v}\<close>]]
[PROOF STATE]
proof (prove)
using this:
mpoly_to_poly v p \<noteq> 0 \<Longrightarrow> finite {x. insertion (\<lambda>v. x) p = (0::'a)}

goal (1 subgoal):
 1. finite {x. insertion (\<lambda>v. x) p = (0::'a)}
[PROOF STEP]
using assms(1) assms(2) mpoly_to_poly_inverse poly_to_mpoly0
[PROOF STATE]
proof (prove)
using this:
mpoly_to_poly v p \<noteq> 0 \<Longrightarrow> finite {x. insertion (\<lambda>v. x) p = (0::'a)}
vars p \<subseteq> {v}
p \<noteq> 0
vars ?p \<subseteq> {?v} \<Longrightarrow> poly_to_mpoly ?v (mpoly_to_poly ?v ?p) = ?p
poly_to_mpoly ?v 0 = 0

goal (1 subgoal):
 1. finite {x. insertion (\<lambda>v. x) p = (0::'a)}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma snd_Gauss_Jordan_upt_k_PA:
shows "snd (Gauss_Jordan_upt_k_PA A k) = (Gauss_Jordan_upt_k A k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Gauss_Jordan_upt_k_PA A k) = Gauss_Jordan_upt_k A k
[PROOF STEP]
unfolding Gauss_Jordan_upt_k_PA_def Gauss_Jordan_upt_k_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (fst (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]), snd (snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]))) = snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k])
[PROOF STEP]
using snd_foldl_Gauss_Jordan_column_k_eq[of A "Suc k"]
[PROOF STATE]
proof (prove)
using this:
snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]

goal (1 subgoal):
 1. snd (fst (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]), snd (snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]))) = snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k])
[PROOF STEP]
by simp


[STATEMENT]
lemma (in deutsch) deutsch_transform_coeff [simp]:
  shows "U\<^sub>f $$ (0,1) = f(0)" and "U\<^sub>f $$ (1,0) = f(0)"
    and "U\<^sub>f $$(2,3) = f(1)" and "U\<^sub>f $$ (3,2) = f(1)"
    and "U\<^sub>f $$ (0,0) = 1 - f(0)" and "U\<^sub>f $$(1,1) = 1 - f(0)"
    and "U\<^sub>f $$ (2,2) = 1 - f(1)" and "U\<^sub>f $$ (3,3) = 1 - f(1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((U\<^sub>f $$ (0, 1) = of_nat (f 0) &&& U\<^sub>f $$ (1, 0) = of_nat (f 0)) &&& U\<^sub>f $$ (2, 3) = of_nat (f 1) &&& U\<^sub>f $$ (3, 2) = of_nat (f 1)) &&& (U\<^sub>f $$ (0, 0) = of_nat (1 - f 0) &&& U\<^sub>f $$ (1, 1) = of_nat (1 - f 0)) &&& U\<^sub>f $$ (2, 2) = of_nat (1 - f 1) &&& U\<^sub>f $$ (3, 3) = of_nat (1 - f 1)
[PROOF STEP]
using deutsch_transform_def
[PROOF STATE]
proof (prove)
using this:
U\<^sub>f \<equiv> Tensor.mat_of_cols_list 4 (map (map of_nat) [[1 - f 0, f 0, 0, 0], [f 0, 1 - f 0, 0, 0], [0, 0, 1 - f 1, f 1], [0, 0, f 1, 1 - f 1]])

goal (1 subgoal):
 1. ((U\<^sub>f $$ (0, 1) = of_nat (f 0) &&& U\<^sub>f $$ (1, 0) = of_nat (f 0)) &&& U\<^sub>f $$ (2, 3) = of_nat (f 1) &&& U\<^sub>f $$ (3, 2) = of_nat (f 1)) &&& (U\<^sub>f $$ (0, 0) = of_nat (1 - f 0) &&& U\<^sub>f $$ (1, 1) = of_nat (1 - f 0)) &&& U\<^sub>f $$ (2, 2) = of_nat (1 - f 1) &&& U\<^sub>f $$ (3, 3) = of_nat (1 - f 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma real_seq_to_hypreal_Infinitesimal2:
  "\<forall>n. norm(X n - Y n) < inverse(real(Suc n)) \<Longrightarrow> star_n X - star_n Y \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. norm (X n - Y n) < inverse (real (Suc n)) \<Longrightarrow> star_n X - star_n Y \<in> Infinitesimal
[PROOF STEP]
unfolding Infinitesimal_FreeUltrafilterNat_iff star_n_diff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. norm (X n - Y n) < inverse (real (Suc n)) \<Longrightarrow> \<forall>u>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < u
[PROOF STEP]
by (auto dest!: FreeUltrafilterNat_inverse_real_of_posnat
      intro: order_less_trans elim!: eventually_mono)


[STATEMENT]
lemma register_pair_apply:
  assumes [simp]: \<open>register F\<close> \<open>register G\<close>
  assumes \<open>\<And>a b. F a o\<^sub>C\<^sub>L G b = G b o\<^sub>C\<^sub>L F a\<close>
  shows \<open>(register_pair F G) (tensor_op a b) = F a o\<^sub>C\<^sub>L G b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. register_pair F G (a \<otimes>\<^sub>o b) = F a o\<^sub>C\<^sub>L G b
[PROOF STEP]
unfolding register_pair_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if register F \<and> register G \<and> (\<forall>a b. F a o\<^sub>C\<^sub>L G b = G b o\<^sub>C\<^sub>L F a) then tensor_lift (\<lambda>a b. F a o\<^sub>C\<^sub>L G b) else (\<lambda>_. 0)) (a \<otimes>\<^sub>o b) = F a o\<^sub>C\<^sub>L G b
[PROOF STEP]
apply (simp flip: assms(3))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_lift (\<lambda>a b. F a o\<^sub>C\<^sub>L G b) (a \<otimes>\<^sub>o b) = F a o\<^sub>C\<^sub>L G b
[PROOF STEP]
by (metis assms(1) assms(2) cbilinear_F_comp_G register_preregister tensor_lift_correct)


[STATEMENT]
lemma taylor_eval:
  assumes "a \<in> carrier R"
  assumes "f \<in> carrier P"
  assumes "b \<in> carrier R"
  shows "to_fun (T\<^bsub>a\<^esub> f) b = to_fun f (b \<oplus> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (T\<^bsub>a\<^esub> f) b = to_fun f (b \<oplus> a)
[PROOF STEP]
unfolding  taylor_expansion_def taylor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (Cring_Poly.compose R f (X_poly_plus R a)) b = to_fun f (b \<oplus> a)
[PROOF STEP]
using to_fun_sub[of "(X_plus a)" f b] to_fun_X_plus[of a b]
        assms X_plus_closed[of a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>X_poly_plus R a \<in> carrier P; f \<in> carrier P; b \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (Cring_Poly.compose R f (X_poly_plus R a)) b = to_fun f (to_fun (X_poly_plus R a) b)
\<lbrakk>a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (X_poly_plus R a) b = b \<oplus> a
a \<in> carrier R
f \<in> carrier P
b \<in> carrier R
a \<in> carrier R \<Longrightarrow> X_poly_plus R a \<in> carrier P

goal (1 subgoal):
 1. to_fun (Cring_Poly.compose R f (X_poly_plus R a)) b = to_fun f (b \<oplus> a)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_us_map_IInf_iff:
  fixes g :: "'a::complete_lattice_with_dual \<Rightarrow> 'b::complete_lattice_with_dual"
  shows "(f = map_us g) = (map_IInf f = g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f = map_us g) = (map_IInf f = g)
[PROOF STEP]
by (metis inj_eq inj_map_us map_us_map_IInf_inv pointfree_idE)


[STATEMENT]
lemma triangular_to_jnf_steps_dims[simp]:
  "dim_row (step_1 A) = dim_row A"
  "dim_col (step_1 A) = dim_col A"
  "dim_row (step_2 A) = dim_row A"
  "dim_col (step_2 A) = dim_col A"
  "dim_row (step_3 A) = dim_row A"
  "dim_col (step_3 A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim_row (step_1 A) = dim_row A &&& dim_col (step_1 A) = dim_col A &&& dim_row (step_2 A) = dim_row A) &&& dim_col (step_2 A) = dim_col A &&& dim_row (step_3 A) = dim_row A &&& dim_col (step_3 A) = dim_col A
[PROOF STEP]
unfolding step_1_def step_2_def step_3_def o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim_row (step_1_main (dim_row A) 0 0 A) = dim_row A &&& dim_col (step_1_main (dim_row A) 0 0 A) = dim_col A &&& dim_row (step_2_main (dim_row A) 0 A) = dim_row A) &&& dim_col (step_2_main (dim_row A) 0 A) = dim_col A &&& dim_row (step_3_main (dim_row A) 1 A) = dim_row A &&& dim_col (step_3_main (dim_row A) 1 A) = dim_col A
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_subst_poly_subst: "poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
have "poly_subst f (poly_subst g p) =
          poly_subst f (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp g t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst f (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp g t))
[PROOF STEP]
by (simp only: poly_subst_def)
[PROOF STATE]
proof (state)
this:
poly_subst f (poly_subst g p) = poly_subst f (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp g t))

goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_subst f (poly_subst g p) = poly_subst f (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp g t))

goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
have "\<dots> = (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp (\<lambda>x. poly_subst f (g x)) t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_subst f (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp g t)) = (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp (\<lambda>x. poly_subst f (g x)) t))
[PROOF STEP]
by (simp add: poly_subst_sum poly_subst_monom_mult poly_subst_subst_pp)
[PROOF STATE]
proof (state)
this:
poly_subst f (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp g t)) = (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp (\<lambda>x. poly_subst f (g x)) t))

goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_subst f (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp g t)) = (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp (\<lambda>x. poly_subst f (g x)) t))

goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
have "\<dots> = poly_subst (\<lambda>x. poly_subst f (g x)) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp (\<lambda>x. poly_subst f (g x)) t)) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
by (simp only: poly_subst_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>keys p. punit.monom_mult (lookup p t) 0 (subst_pp (\<lambda>x. poly_subst f (g x)) t)) = poly_subst (\<lambda>x. poly_subst f (g x)) p

goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p

goal (1 subgoal):
 1. poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly_subst f (poly_subst g p) = poly_subst (\<lambda>x. poly_subst f (g x)) p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma undirected_succ_tran_set: "set (succ_tran (undirected G) v) = {e2. (v,e2) \<in> (set (edgesL (undirected G)))\<^sup>+}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (FiniteListGraph.succ_tran (FiniteListGraph.undirected G) v) = {e2. (v, e2) \<in> (set (edgesL (FiniteListGraph.undirected G)))\<^sup>+}
[PROOF STEP]
by (fact succ_tran_set)


[STATEMENT]
lemma sup_continuous_iff_at_left:
  fixes f :: "'a::{complete_linorder, linorder_topology, first_countable_topology} \<Rightarrow>
    'b::{complete_linorder, linorder_topology}"
  shows "sup_continuous f \<longleftrightarrow> (\<forall>x. continuous (at_left x) f) \<and> mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_continuous f = ((\<forall>x. continuous (at_left x) f) \<and> mono f)
[PROOF STEP]
using sup_continuous_at_left[of f] continuous_at_left_imp_sup_continuous[of f]
    sup_continuous_mono[of f]
[PROOF STATE]
proof (prove)
using this:
sup_continuous f \<Longrightarrow> continuous (at_left ?x) f
\<lbrakk>mono f; \<And>x. continuous (at_left x) f\<rbrakk> \<Longrightarrow> sup_continuous f
sup_continuous f \<Longrightarrow> mono f

goal (1 subgoal):
 1. sup_continuous f = ((\<forall>x. continuous (at_left x) f) \<and> mono f)
[PROOF STEP]
by auto


[STATEMENT]
theorem wls_fresh_swap_compose:
assumes "wls s X" and "fresh xs y X"  and "fresh xs z X"
shows "((X #[y \<and> x]_xs) #[z \<and> y]_xs) = (X #[z \<and> x]_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X #[y \<and> x]_xs #[z \<and> y]_xs = X #[z \<and> x]_xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
fresh xs y X
fresh xs z X

goal (1 subgoal):
 1. X #[y \<and> x]_xs #[z \<and> y]_xs = X #[z \<and> x]_xs
[PROOF STEP]
by (intro fresh_swap_compose) auto


[STATEMENT]
lemma line_points_in_cube:
  assumes "is_line L n t"
    and "s < t"
  shows "L s \<in> cube n t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L s \<in> cube n t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_line L n t
s < t

goal (1 subgoal):
 1. L s \<in> cube n t
[PROOF STEP]
unfolding cube_def is_line_def
[PROOF STATE]
proof (prove)
using this:
L \<in> {..<t} \<rightarrow>\<^sub>E {..<n} \<rightarrow>\<^sub>E {..<t} \<and> (\<forall>j<n. (\<forall>x<t. \<forall>y<t. L x j = L y j) \<or> (\<forall>s<t. L s j = s)) \<and> (\<exists>j<n. \<forall>s<t. L s j = s)
s < t

goal (1 subgoal):
 1. L s \<in> {..<n} \<rightarrow>\<^sub>E {..<t}
[PROOF STEP]
by auto


[STATEMENT]
lemma subseqs_of_length_Suc_Cons:
  "{ ys. subseq_of_length (Suc n) (x#xs) ys } =
   Cons x ` { ys. subseq_of_length n xs ys } \<union> { ys. subseq_of_length (Suc n) xs ys }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ys. subseq_of_length (Suc n) (x # xs) ys} = (#) x ` {ys. subseq_of_length n xs ys} \<union> {ys. subseq_of_length (Suc n) xs ys}
[PROOF STEP]
by (unfold subseq_of_length_def, auto)


[STATEMENT]
lemma ariths[simp]: "\<lbrakk>0 < s; s \<le> 2 *n; s mod 2 \<noteq> Suc 0\<rbrakk> \<Longrightarrow>
                                      (s - Suc 0) mod 2 = Suc 0"
  "\<lbrakk>0 < s; s \<le> 2 *n; s mod 2 \<noteq> Suc 0\<rbrakk> \<Longrightarrow>
                                       s - Suc 0 \<le> 2 * n"
  "\<lbrakk>0 < s; s \<le> 2 *n; s mod 2 \<noteq> Suc 0\<rbrakk> \<Longrightarrow> \<not> s \<le> Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>0 < s; s \<le> 2 * n; s mod 2 \<noteq> Suc 0\<rbrakk> \<Longrightarrow> (s - Suc 0) mod 2 = Suc 0) &&& (\<lbrakk>0 < s; s \<le> 2 * n; s mod 2 \<noteq> Suc 0\<rbrakk> \<Longrightarrow> s - Suc 0 \<le> 2 * n) &&& (\<lbrakk>0 < s; s \<le> 2 * n; s mod 2 \<noteq> Suc 0\<rbrakk> \<Longrightarrow> \<not> s \<le> Suc 0)
[PROOF STEP]
by(arith)+


[STATEMENT]
lemma degree_monom0'[simp]: "degree (monom 0 b) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (monom (0::'a) b) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma pochhammer_Suc: "pochhammer a (Suc n) = pochhammer a n * (a + of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer a (Suc n) = pochhammer a n * (a + of_nat n)
[PROOF STEP]
by (simp add: pochhammer_prod atLeast0_lessThan_Suc ac_simps)


[STATEMENT]
lemma polytope_imp_polyhedron:
  fixes S :: "'a :: euclidean_space set"
  shows "polytope S \<Longrightarrow> polyhedron S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polytope S \<Longrightarrow> polyhedron S
[PROOF STEP]
by (simp add: polytope_eq_bounded_polyhedron)


[STATEMENT]
lemma i_set0_mult_1_eq_i_set0: "i_set0_mult (Suc 0) = i_set0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i_set0_mult (Suc 0) = i_set0
[PROOF STEP]
by (simp add: i_set0_mult_def i_set0_def i_set_mult_1_eq_i_set)


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


[STATEMENT]
lemma rot_same_dir:
  assumes "x1 \<in> {a<--<b}"
  assumes "x2 \<in> {x1<--<b}"
  shows "(y \<bullet> rot (a-b) > 0) = (y \<bullet> rot(x1-x2) > 0)"  "(y \<bullet> rot (a-b) < 0) = (y \<bullet> rot(x1-x2) < 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < y \<bullet> rot (a - b)) = (0 < y \<bullet> rot (x1 - x2)) &&& (y \<bullet> rot (a - b) < 0) = (y \<bullet> rot (x1 - x2) < 0)
[PROOF STEP]
using oriented_subsegment_scale[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (0 < y \<bullet> rot (a - b)) = (0 < y \<bullet> rot (x1 - x2)) &&& (y \<bullet> rot (a - b) < 0) = (y \<bullet> rot (x1 - x2) < 0)
[PROOF STEP]
apply (smt inner_scaleR_right nrm_reverse rot_scaleR zero_less_mult_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<bullet> rot (a - b) < 0) = (y \<bullet> rot (x1 - x2) < 0)
[PROOF STEP]
by (smt \<open>\<And>thesis. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis\<close> inner_minus_right inner_scaleR_right rot_diff_commute rot_scaleR zero_less_mult_iff)


[STATEMENT]
lemma euclidean_closure_of [simp]: "euclidean closure_of S = closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euclidean closure_of S = closure S
[PROOF STEP]
by (auto simp: closure_of_def closure_def islimpt_def)


[STATEMENT]
lemma RRR_interior_closure[simplified]:
  shows "interior ({0::real..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
have "?lhs = interior ({0..2} \<union> {5..7})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior ({0..2} \<union> {3} \<union> {5..7}) = interior ({0..2} \<union> {5..7})
[PROOF STEP]
by (metis (no_types, lifting) Un_assoc Un_commute closed_Un closed_eucl_atLeastAtMost interior_closed_Un_empty_interior interior_singleton)
[PROOF STATE]
proof (state)
this:
interior ({0..2} \<union> {3} \<union> {5..7}) = interior ({0..2} \<union> {5..7})

goal (1 subgoal):
 1. interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
interior ({0..2} \<union> {3} \<union> {5..7}) = interior ({0..2} \<union> {5..7})

goal (1 subgoal):
 1. interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior ({0..2} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
by (simp add: interior_union_closed_intervals)
[PROOF STATE]
proof (state)
this:
interior ({0..2} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}

goal (1 subgoal):
 1. interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}

goal (1 subgoal):
 1. interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
interior ({0..2} \<union> {3} \<union> {5..7}) = {0<..<2} \<union> {5<..<7}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma INF_Union_eq: "(INF x\<in>\<Union>A. f x) = (INF a\<in>A. INF x\<in>a. f x)" for f :: "_ \<Rightarrow> 'a::complete_lattice"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> (f ` \<Union> A) = (\<Sqinter>a\<in>A. \<Sqinter> (f ` a))
[PROOF STEP]
by (auto intro!: antisym INF_greatest intro: INF_lower2)


[STATEMENT]
lemma pr_comp2_1': "\<lbrakk> pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1' \<rbrakk> \<Longrightarrow> (\<lambda> x. f (g x) (h x)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
assume A1: "pr_conv_2_to_1 f \<in> PrimRec1'"
[PROOF STATE]
proof (state)
this:
pr_conv_2_to_1 f \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
assume A2: "g \<in> PrimRec1'"
[PROOF STATE]
proof (state)
this:
g \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
assume A3: "h \<in> PrimRec1'"
[PROOF STATE]
proof (state)
this:
h \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
let ?f1 = "pr_conv_2_to_1 f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
have S1: "(%x. ?f1 ((c_f_pair g h) x)) = (\<lambda> x. f (g x) (h x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) = (\<lambda>x. f (g x) (h x))
[PROOF STEP]
by (simp add: c_f_pair_def pr_conv_2_to_1_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) = (\<lambda>x. f (g x) (h x))

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
from A2 A3
[PROOF STATE]
proof (chain)
picking this:
g \<in> PrimRec1'
h \<in> PrimRec1'
[PROOF STEP]
have S2: "c_f_pair g h \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
g \<in> PrimRec1'
h \<in> PrimRec1'

goal (1 subgoal):
 1. c_f_pair g h \<in> PrimRec1'
[PROOF STEP]
by (rule PrimRec1'.pair)
[PROOF STATE]
proof (state)
this:
c_f_pair g h \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
from A1 S2
[PROOF STATE]
proof (chain)
picking this:
pr_conv_2_to_1 f \<in> PrimRec1'
c_f_pair g h \<in> PrimRec1'
[PROOF STEP]
have S3: "(%x. ?f1 ((c_f_pair g h) x)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
pr_conv_2_to_1 f \<in> PrimRec1'
c_f_pair g h \<in> PrimRec1'

goal (1 subgoal):
 1. (\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) \<in> PrimRec1'
[PROOF STEP]
by (rule PrimRec1'.comp)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_2_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) = (\<lambda>x. f (g x) (h x))
(\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) \<in> PrimRec1'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) = (\<lambda>x. f (g x) (h x))
(\<lambda>x. pr_conv_2_to_1 f (c_f_pair g h x)) \<in> PrimRec1'

goal (1 subgoal):
 1. (\<lambda>x. f (g x) (h x)) \<in> PrimRec1'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x) (h x)) \<in> PrimRec1'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sint_greater_eq:
  \<open>- (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w\<close> for w :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
proof (cases \<open>bit w (LENGTH('a) - Suc 0)\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
 2. \<not> bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
bit w (LENGTH('a) - Suc 0)

goal (2 subgoals):
 1. bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
 2. \<not> bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bit w (LENGTH('a) - Suc 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bit w (LENGTH('a) - Suc 0)

goal (1 subgoal):
 1. - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
by transfer (simp add: signed_take_bit_eq_if_negative minus_exp_eq_not_mask or_greater_eq ac_simps)
[PROOF STATE]
proof (state)
this:
- (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w

goal (1 subgoal):
 1. \<not> bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
have *: \<open>- (2 ^ (LENGTH('a) - Suc 0)) \<le> (0::int)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (2 ^ (LENGTH('a) - Suc 0)) \<le> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (2 ^ (LENGTH('a) - Suc 0)) \<le> 0

goal (1 subgoal):
 1. \<not> bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> bit w (LENGTH('a) - Suc 0)

goal (1 subgoal):
 1. \<not> bit w (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> bit w (LENGTH('a) - Suc 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> bit w (LENGTH('a) - Suc 0)

goal (1 subgoal):
 1. - (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w
[PROOF STEP]
by transfer (auto simp add: signed_take_bit_eq intro: order_trans *)
[PROOF STATE]
proof (state)
this:
- (2 ^ (LENGTH('a) - Suc 0)) \<le> sint w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_id_mat_1: "matrix id = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix id = mat (1::'a)
[PROOF STEP]
by (simp add: mat_def matrix_def axis_def)


[STATEMENT]
lemma poly_map_compose_closed':
  assumes "is_poly_tuple n fs"
  assumes "length fs = m"
  assumes "is_poly_tuple k gs"
  assumes "length gs = n"
  shows "poly_map k (map (poly_compose n k gs) fs) \<in> poly_maps k m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map k (map (poly_compose n k gs) fs) \<in> poly_maps k m
[PROOF STEP]
apply(rule poly_maps_memI[of _ "map (poly_compose n k gs) fs"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. is_poly_tuple k (map (poly_compose n k gs) fs)
 2. length (map (poly_compose n k gs) fs) = m
 3. poly_map k (map (poly_compose n k gs) fs) = poly_map k (map (poly_compose n k gs) fs)
[PROOF STEP]
using poly_map_compose_closed[of n fs m k gs] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_poly_tuple n fs; length fs = m; is_poly_tuple k gs; length gs = n\<rbrakk> \<Longrightarrow> is_poly_tuple k (map (poly_compose n k gs) fs)
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n

goal (3 subgoals):
 1. is_poly_tuple k (map (poly_compose n k gs) fs)
 2. length (map (poly_compose n k gs) fs) = m
 3. poly_map k (map (poly_compose n k gs) fs) = poly_map k (map (poly_compose n k gs) fs)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (map (poly_compose n k gs) fs) = m
 2. poly_map k (map (poly_compose n k gs) fs) = poly_map k (map (poly_compose n k gs) fs)
[PROOF STEP]
apply (simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map k (map (poly_compose n k gs) fs) = poly_map k (map (poly_compose n k gs) fs)
[PROOF STEP]
by auto


[STATEMENT]
lemma sgn_div:
  fixes x y :: "'a::linordered_field"
  assumes "y \<noteq> 0" and "sgn x = sgn y"
  shows "x / y > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < x / y
[PROOF STEP]
using assms sgn_1_pos sgn_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
y \<noteq> (0::'a)
sgn x = sgn y
(sgn ?a = (1::?'a)) = ((0::?'a) < ?a)
(sgn ?a = (0::?'a)) = (?a = (0::?'a))

goal (1 subgoal):
 1. (0::'a) < x / y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma f_def: "f = (\<Sum>t = 0..q. 2^c * b^t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<Sum>t = 0..q. 2 ^ c * b ^ t)
[PROOF STEP]
using c_eq
[PROOF STATE]
proof (prove)
using this:
rm_constants q c b d e f a

goal (1 subgoal):
 1. f = (\<Sum>t = 0..q. 2 ^ c * b ^ t)
[PROOF STEP]
by (simp add: rm_constants_def F_def)


[STATEMENT]
lemma single_subset_iff [simp]:
  "{#a#} \<subseteq># M \<longleftrightarrow> a \<in># M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({#a#} \<subseteq># M) = (a \<in># M)
[PROOF STEP]
by (auto simp add: subseteq_mset_def Suc_le_eq)


[STATEMENT]
lemma inverse_rat [simp]: "inverse (Fract a b) = Fract b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (Fract a b) = Fract b a
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma integer_word64_bounded_eq:
   assumes "0 \<le> i"
    and "i \<le> 2 ^ LENGTH(64) - 1"
  shows "integer_of_word64 (word64_of_integer i) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_word64 (word64_of_integer i) = i
[PROOF STEP]
unfolding word64_of_integer_def integer_of_word64_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_word (word_of_integer i) = i
[PROOF STEP]
using integer_word_bounded_eq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?i; ?i \<le> 2 ^ LENGTH(?'a) - 1\<rbrakk> \<Longrightarrow> integer_of_word (word_of_integer ?i) = ?i
0 \<le> i
i \<le> 2 ^ LENGTH(64) - 1

goal (1 subgoal):
 1. integer_of_word (word_of_integer i) = i
[PROOF STEP]
by blast


[STATEMENT]
lemma set_sorted_list_of_set_remove [simp]:
"set (sorted_list_of_set (Set.remove x A)) = Set.remove x (set (sorted_list_of_set A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (sorted_list_of_set (Set.remove x A)) = Set.remove x (set (sorted_list_of_set A))
[PROOF STEP]
unfolding Set.remove_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (sorted_list_of_set (A - {x})) = set (sorted_list_of_set A) - {x}
[PROOF STEP]
by (cases "finite A"; simp)


[STATEMENT]
lemma nset_image_obtains:
  assumes "X \<in> [f`A]\<^bsup>k\<^esup>" "inj_on f A"
  obtains Y where "Y \<in> [A]\<^bsup>k\<^esup>" "X = f ` Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Y. \<lbrakk>Y \<in> [A]\<^bsup>k\<^esup>; X = f ` Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X \<in> [f ` A]\<^bsup>k\<^esup>
inj_on f A

goal (1 subgoal):
 1. (\<And>Y. \<lbrakk>Y \<in> [A]\<^bsup>k\<^esup>; X = f ` Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply (clarsimp simp add: nsets_def subset_image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>AA. \<lbrakk>\<And>Y. \<lbrakk>Y \<subseteq> A \<and> finite Y \<and> card Y = card (f ` Y); f ` AA = f ` Y\<rbrakk> \<Longrightarrow> thesis; inj_on f A; finite (f ` AA); k = card (f ` AA); AA \<subseteq> A; X = f ` AA\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (metis card_image finite_imageD inj_on_subset)


[STATEMENT]
lemma repeat_zmset_right[simp]: "repeat_zmset a (repeat_zmset b A) = repeat_zmset (a * b) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. repeat_zmset a (repeat_zmset b A) = repeat_zmset (a * b) A
[PROOF STEP]
by (auto simp: zmultiset_eq_iff left_diff_distrib')


[STATEMENT]
lemma cis_neq_zero [simp]: "cis a \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis a \<noteq> 0
[PROOF STEP]
by (metis norm_cis norm_zero zero_neq_one)


[STATEMENT]
lemma local_lipschitz_affine:
  fixes A :: "real \<Rightarrow> 'a::real_normed_algebra_1^'n^'m"
  assumes "open T" and "open S"
    and Ahyp: "\<And>\<tau> \<epsilon>. \<epsilon> > 0 \<Longrightarrow> \<tau> \<in> T \<Longrightarrow> cball \<tau> \<epsilon> \<subseteq> T \<Longrightarrow> bdd_above {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> cball \<tau> \<epsilon>}"
  shows "local_lipschitz T S (\<lambda>t s. A t *v s + B t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *v s + B t)
[PROOF STEP]
proof(unfold local_lipschitz_def lipschitz_on_def, clarsimp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
fix s t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
assume "s \<in> S" and "t \<in> T"
[PROOF STATE]
proof (state)
this:
s \<in> S
t \<in> T

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<in> S
t \<in> T
[PROOF STEP]
obtain e1 e2 where "cball t e1 \<subseteq> T" and "cball s e2 \<subseteq> S" and "min e1 e2 > 0"
[PROOF STATE]
proof (prove)
using this:
s \<in> S
t \<in> T

goal (1 subgoal):
 1. (\<And>e1 e2. \<lbrakk>cball t e1 \<subseteq> T; cball s e2 \<subseteq> S; 0 < min e1 e2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using open_cballE[OF _ \<open>open T\<close>] open_cballE[OF _ \<open>open S\<close>]
[PROOF STATE]
proof (prove)
using this:
s \<in> S
t \<in> T
?t\<^sub>0 \<in> T \<Longrightarrow> \<exists>e>0. cball ?t\<^sub>0 e \<subseteq> T
?t\<^sub>0 \<in> S \<Longrightarrow> \<exists>e>0. cball ?t\<^sub>0 e \<subseteq> S

goal (1 subgoal):
 1. (\<And>e1 e2. \<lbrakk>cball t e1 \<subseteq> T; cball s e2 \<subseteq> S; 0 < min e1 e2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
cball t e1 \<subseteq> T
cball s e2 \<subseteq> S
0 < min e1 e2

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
hence obs: "cball t (min e1 e2) \<subseteq> T"
[PROOF STATE]
proof (prove)
using this:
cball t e1 \<subseteq> T
cball s e2 \<subseteq> S
0 < min e1 e2

goal (1 subgoal):
 1. cball t (min e1 e2) \<subseteq> T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cball t (min e1 e2) \<subseteq> T

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
let ?L = "Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
have "\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
[PROOF STEP]
using \<open>min e1 e2 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < min e1 e2

goal (1 subgoal):
 1. \<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
have bdd: "bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
[PROOF STEP]
by (rule Ahyp, simp only: \<open>min e1 e2 > 0\<close>, simp_all add: \<open>t \<in> T\<close> obs)
[PROOF STATE]
proof (state)
this:
bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
have "Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)} \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
[PROOF STEP]
apply(rule order.trans[OF op_norm_ge_0[of "A t"]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A t\<parallel>\<^sub>o\<^sub>p \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
[PROOF STEP]
by (rule cSup_upper[OF calculation])
[PROOF STATE]
proof (state)
this:
0 \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
have "\<forall>x\<in>cball s (min e1 e2) \<inter> S. \<forall>y\<in>cball s (min e1 e2) \<inter> S.
    \<forall>\<tau>\<in>cball t (min e1 e2) \<inter> T. dist (A \<tau> *v x) (A \<tau> *v y) \<le> ?L * dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>cball s (min e1 e2) \<inter> S. \<forall>y\<in>cball s (min e1 e2) \<inter> S. \<forall>\<tau>\<in>cball t (min e1 e2) \<inter> T. dist (A \<tau> *v x) (A \<tau> *v y) \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)} * dist x y
[PROOF STEP]
apply(clarify, simp only: dist_norm, rule lipschitz_cond_affine)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y \<tau>. \<lbrakk>x \<in> cball s (min e1 e2); x \<in> S; y \<in> cball s (min e1 e2); y \<in> S; \<tau> \<in> cball t (min e1 e2); \<tau> \<in> T\<rbrakk> \<Longrightarrow> \<tau> \<in> cball t (min e1 e2)
 2. \<And>x y \<tau>. \<lbrakk>x \<in> cball s (min e1 e2); x \<in> S; y \<in> cball s (min e1 e2); y \<in> S; \<tau> \<in> cball t (min e1 e2); \<tau> \<in> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
[PROOF STEP]
using \<open>min e1 e2 > 0\<close> bdd
[PROOF STATE]
proof (prove)
using this:
0 < min e1 e2
bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}

goal (2 subgoals):
 1. \<And>x y \<tau>. \<lbrakk>x \<in> cball s (min e1 e2); x \<in> S; y \<in> cball s (min e1 e2); y \<in> S; \<tau> \<in> cball t (min e1 e2); \<tau> \<in> T\<rbrakk> \<Longrightarrow> \<tau> \<in> cball t (min e1 e2)
 2. \<And>x y \<tau>. \<lbrakk>x \<in> cball s (min e1 e2); x \<in> S; y \<in> cball s (min e1 e2); y \<in> S; \<tau> \<in> cball t (min e1 e2); \<tau> \<in> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>cball s (min e1 e2) \<inter> S. \<forall>y\<in>cball s (min e1 e2) \<inter> S. \<forall>\<tau>\<in>cball t (min e1 e2) \<inter> T. dist (A \<tau> *v x) (A \<tau> *v y) \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)} * dist x y

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> S; t \<in> T\<rbrakk> \<Longrightarrow> \<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. 0 \<le> L \<and> (\<forall>xa\<in>cball x u \<inter> S. \<forall>y\<in>cball x u \<inter> S. dist (A t *v xa) (A t *v y) \<le> L * dist xa y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
0 \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
\<forall>x\<in>cball s (min e1 e2) \<inter> S. \<forall>y\<in>cball s (min e1 e2) \<inter> S. \<forall>\<tau>\<in>cball t (min e1 e2) \<inter> T. dist (A \<tau> *v x) (A \<tau> *v y) \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)} * dist x y
[PROOF STEP]
show "\<exists>e>0. \<exists>L. \<forall>t\<in>cball t e \<inter> T. 0 \<le> L \<and>
    (\<forall>x\<in>cball s e \<inter> S. \<forall>y\<in>cball s e \<inter> S. dist (A t *v x) (A t *v y) \<le> L * dist x y)"
[PROOF STATE]
proof (prove)
using this:
\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
0 \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
\<forall>x\<in>cball s (min e1 e2) \<inter> S. \<forall>y\<in>cball s (min e1 e2) \<inter> S. \<forall>\<tau>\<in>cball t (min e1 e2) \<inter> T. dist (A \<tau> *v x) (A \<tau> *v y) \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)} * dist x y

goal (1 subgoal):
 1. \<exists>e>0. \<exists>L. \<forall>t\<in>cball t e \<inter> T. 0 \<le> L \<and> (\<forall>x\<in>cball s e \<inter> S. \<forall>y\<in>cball s e \<inter> S. dist (A t *v x) (A t *v y) \<le> L * dist x y)
[PROOF STEP]
using \<open>min e1 e2 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
bdd_above {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
0 \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)}
\<forall>x\<in>cball s (min e1 e2) \<inter> S. \<forall>y\<in>cball s (min e1 e2) \<inter> S. \<forall>\<tau>\<in>cball t (min e1 e2) \<inter> T. dist (A \<tau> *v x) (A \<tau> *v y) \<le> Sup {\<parallel>A \<tau>\<parallel>\<^sub>o\<^sub>p |\<tau>. \<tau> \<in> cball t (min e1 e2)} * dist x y
0 < min e1 e2

goal (1 subgoal):
 1. \<exists>e>0. \<exists>L. \<forall>t\<in>cball t e \<inter> T. 0 \<le> L \<and> (\<forall>x\<in>cball s e \<inter> S. \<forall>y\<in>cball s e \<inter> S. dist (A t *v x) (A t *v y) \<le> L * dist x y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>e>0. \<exists>L. \<forall>t\<in>cball t e \<inter> T. 0 \<le> L \<and> (\<forall>x\<in>cball s e \<inter> S. \<forall>y\<in>cball s e \<inter> S. dist (A t *v x) (A t *v y) \<le> L * dist x y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smult_smult_times:
  fixes a::"'a::semigroup_mult"
  shows "a\<cdot>\<^sub>m (k \<cdot>\<^sub>m A) = (a * k)\<cdot>\<^sub>m A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A) = a * k \<cdot>\<^sub>m A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
 2. dim_row (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_row (a * k \<cdot>\<^sub>m A)
 3. dim_col (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_col (a * k \<cdot>\<^sub>m A)
[PROOF STEP]
show r:"dim_row (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_row (a * k \<cdot>\<^sub>m A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_row (a * k \<cdot>\<^sub>m A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_row (a * k \<cdot>\<^sub>m A)

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
 2. dim_col (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_col (a * k \<cdot>\<^sub>m A)
[PROOF STEP]
show c:"dim_col (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_col (a * k \<cdot>\<^sub>m A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_col (a * k \<cdot>\<^sub>m A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_col (a * k \<cdot>\<^sub>m A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
show "\<And>i j. i < dim_row (a * k \<cdot>\<^sub>m A) \<Longrightarrow>
           j < dim_col (a * k \<cdot>\<^sub>m A) \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
assume "i < dim_row (a * k \<cdot>\<^sub>m A)" and "j < dim_col (a * k \<cdot>\<^sub>m A)"
[PROOF STATE]
proof (state)
this:
i < dim_row (a * k \<cdot>\<^sub>m A)
j < dim_col (a * k \<cdot>\<^sub>m A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
note ij = this
[PROOF STATE]
proof (state)
this:
i < dim_row (a * k \<cdot>\<^sub>m A)
j < dim_col (a * k \<cdot>\<^sub>m A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
hence "(a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = a * (k \<cdot>\<^sub>m A) $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row (a * k \<cdot>\<^sub>m A)
j < dim_col (a * k \<cdot>\<^sub>m A)

goal (1 subgoal):
 1. (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = a * (k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = a * (k \<cdot>\<^sub>m A) $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = a * (k \<cdot>\<^sub>m A) $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
have "... = a * (k * A $$ (i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (k \<cdot>\<^sub>m A) $$ (i, j) = a * (k * A $$ (i, j))
[PROOF STEP]
using ij
[PROOF STATE]
proof (prove)
using this:
i < dim_row (a * k \<cdot>\<^sub>m A)
j < dim_col (a * k \<cdot>\<^sub>m A)

goal (1 subgoal):
 1. a * (k \<cdot>\<^sub>m A) $$ (i, j) = a * (k * A $$ (i, j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a * (k \<cdot>\<^sub>m A) $$ (i, j) = a * (k * A $$ (i, j))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * (k \<cdot>\<^sub>m A) $$ (i, j) = a * (k * A $$ (i, j))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
have "... = (a * k) * A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (k * A $$ (i, j)) = a * k * A $$ (i, j)
[PROOF STEP]
by (simp add: semigroup_mult_class.mult.assoc)
[PROOF STATE]
proof (state)
this:
a * (k * A $$ (i, j)) = a * k * A $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * (k * A $$ (i, j)) = a * k * A $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
have "... = (a * k \<cdot>\<^sub>m A) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * k * A $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
using r c ij
[PROOF STATE]
proof (prove)
using this:
dim_row (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_row (a * k \<cdot>\<^sub>m A)
dim_col (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) = dim_col (a * k \<cdot>\<^sub>m A)
i < dim_row (a * k \<cdot>\<^sub>m A)
j < dim_col (a * k \<cdot>\<^sub>m A)

goal (1 subgoal):
 1. a * k * A $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a * k * A $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (a * k \<cdot>\<^sub>m A); j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
show "(a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
(a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)

goal (1 subgoal):
 1. (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (i, j) = (a * k \<cdot>\<^sub>m A) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < dim_row (a * k \<cdot>\<^sub>m A); ?j < dim_col (a * k \<cdot>\<^sub>m A)\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m (k \<cdot>\<^sub>m A)) $$ (?i, ?j) = (a * k \<cdot>\<^sub>m A) $$ (?i, ?j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scene_demorgan1: "-(X \<squnion>\<^sub>S Y) = -X \<sqinter>\<^sub>S -Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (X \<squnion>\<^sub>S Y) = - X \<sqinter>\<^sub>S - Y
[PROOF STEP]
by (simp add: inf_scene_def, transfer, auto)


[STATEMENT]
lemma disjComm: "disjSD_2 a b \<Longrightarrow> disjSD_2 b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjSD_2 a b \<Longrightarrow> disjSD_2 b a
[PROOF STEP]
apply (simp add: disjSD_2_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>aa ba c d. (aa, ba) \<in> sdnets a \<and> (c, d) \<in> sdnets b \<longrightarrow> twoNetsDistinct aa ba c d \<and> twoNetsDistinct aa ba d c \<Longrightarrow> \<forall>aa ba c d. (aa, ba) \<in> sdnets b \<and> (c, d) \<in> sdnets a \<longrightarrow> twoNetsDistinct aa ba c d \<and> twoNetsDistinct aa ba d c
[PROOF STEP]
apply (intro allI  impI  conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>aa ba c d. \<lbrakk>\<forall>aa ba c d. (aa, ba) \<in> sdnets a \<and> (c, d) \<in> sdnets b \<longrightarrow> twoNetsDistinct aa ba c d \<and> twoNetsDistinct aa ba d c; (aa, ba) \<in> sdnets b \<and> (c, d) \<in> sdnets a\<rbrakk> \<Longrightarrow> twoNetsDistinct aa ba c d
 2. \<And>aa ba c d. \<lbrakk>\<forall>aa ba c d. (aa, ba) \<in> sdnets a \<and> (c, d) \<in> sdnets b \<longrightarrow> twoNetsDistinct aa ba c d \<and> twoNetsDistinct aa ba d c; (aa, ba) \<in> sdnets b \<and> (c, d) \<in> sdnets a\<rbrakk> \<Longrightarrow> twoNetsDistinct aa ba d c
[PROOF STEP]
using tNDComm
[PROOF STATE]
proof (prove)
using this:
twoNetsDistinct ?a ?b ?c ?d \<Longrightarrow> twoNetsDistinct ?c ?d ?a ?b

goal (2 subgoals):
 1. \<And>aa ba c d. \<lbrakk>\<forall>aa ba c d. (aa, ba) \<in> sdnets a \<and> (c, d) \<in> sdnets b \<longrightarrow> twoNetsDistinct aa ba c d \<and> twoNetsDistinct aa ba d c; (aa, ba) \<in> sdnets b \<and> (c, d) \<in> sdnets a\<rbrakk> \<Longrightarrow> twoNetsDistinct aa ba c d
 2. \<And>aa ba c d. \<lbrakk>\<forall>aa ba c d. (aa, ba) \<in> sdnets a \<and> (c, d) \<in> sdnets b \<longrightarrow> twoNetsDistinct aa ba c d \<and> twoNetsDistinct aa ba d c; (aa, ba) \<in> sdnets b \<and> (c, d) \<in> sdnets a\<rbrakk> \<Longrightarrow> twoNetsDistinct aa ba d c
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa ba c d. \<lbrakk>\<forall>aa ba c d. (aa, ba) \<in> sdnets a \<and> (c, d) \<in> sdnets b \<longrightarrow> twoNetsDistinct aa ba c d \<and> twoNetsDistinct aa ba d c; (aa, ba) \<in> sdnets b \<and> (c, d) \<in> sdnets a\<rbrakk> \<Longrightarrow> twoNetsDistinct aa ba d c
[PROOF STEP]
by (meson tNDComm twoNetsDistinct_def)


[STATEMENT]
lemma minus_mtx2: "mtx
  ([a1, b1] #
   [c1, d1] # []) - mtx
  ([a2, b2] #
   [c2, d2] # []) = ((mtx
  ([a1-a2, b1-b2] #
   [c1-c2, d1-d2] # []))::2 sq_mtx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mtx [[a1, b1], [c1, d1]] - mtx [[a2, b2], [c2, d2]] = mtx [[a1 - a2, b1 - b2], [c1 - c2, d1 - d2]]
[PROOF STEP]
by (simp add: sq_mtx_eq_iff)


[STATEMENT]
lemma Nset2finite_inj_tr1:"\<lbrakk> i \<le> (n::nat); j \<le> n; f i = f j; i \<noteq> j \<rbrakk> \<Longrightarrow>
       f ` ({i. i \<le> n} - {j}) = f ` {i. i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> n; j \<le> n; f i = f j; i \<noteq> j\<rbrakk> \<Longrightarrow> f ` ({i. i \<le> n} - {j}) = f ` {i. i \<le> n}
[PROOF STEP]
apply (simp add:image_def, rule equalityI, rule subsetI, simp add:CollectI,
       erule bexE, case_tac "xa = j", frule sym, thin_tac "f i = f j",
       simp, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> n; j \<le> n; f i = f j; i \<noteq> j\<rbrakk> \<Longrightarrow> {y. \<exists>x\<le>n. y = f x} \<subseteq> {y. \<exists>x\<in>{i. i \<le> n} - {j}. y = f x}
[PROOF STEP]
apply (rule subsetI, simp, erule exE, case_tac "xa = j", frule sym,
       thin_tac "f i = f j", blast, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma push_bit_take_bit:
  "push_bit m (take_bit n a) = take_bit (m + n) (push_bit m a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit m (take_bit n a) = take_bit (m + n) (push_bit m a)
[PROOF STEP]
apply (simp add: push_bit_eq_mult take_bit_eq_mod power_add ac_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ m * (a mod (2::'a) ^ n) = a * (2::'a) ^ m mod ((2::'a) ^ m * (2::'a) ^ n)
[PROOF STEP]
using mult_exp_mod_exp_eq [of m \<open>m + n\<close> a]
[PROOF STATE]
proof (prove)
using this:
m \<le> m + n \<Longrightarrow> a * (2::'a) ^ m mod (2::'a) ^ (m + n) = a mod (2::'a) ^ (m + n - m) * (2::'a) ^ m

goal (1 subgoal):
 1. (2::'a) ^ m * (a mod (2::'a) ^ n) = a * (2::'a) ^ m mod ((2::'a) ^ m * (2::'a) ^ n)
[PROOF STEP]
apply (simp add: ac_simps power_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma event_ex_aux: "a 0 = (0::int) \<Longrightarrow> \<forall>n. xa (Suc n) = (\<not> xa n) \<Longrightarrow>
         \<forall>n. (xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0) \<Longrightarrow>
        (\<forall> n . (a n = -1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> -1 \<le> a n \<and> a n \<le> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> \<forall>n. (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
[PROOF STEP]
by (clarify, drule event_ex_aux_a, auto)


[STATEMENT]
lemma qbs_prob_integral_Markov_inequality_abs:
  assumes "qbs_prob_space_qbs s = X"
          "qbs_integrable s f"
      and "0 < c"
    shows "qbs_emeasure s {x \<in> qbs_space X. c \<le> \<bar>f x\<bar>} \<le> ennreal (1/c * qbs_prob_integral s (\<lambda>x. \<bar>f x\<bar>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_emeasure s {x \<in> qbs_space X. c \<le> \<bar>f x\<bar>} \<le> ennreal (1 / c * \<integral>\<^sub>Q x. \<bar>f x\<bar> \<partial>s)
[PROOF STEP]
using qbs_prob_integral_Markov_inequality[OF assms(1) qbs_integrable_abs[OF assms(2)] _ assms(3)]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> qbs_space X \<Longrightarrow> 0 \<le> \<bar>f x\<bar>) \<Longrightarrow> qbs_emeasure s {x \<in> qbs_space X. c \<le> \<bar>f x\<bar>} \<le> ennreal (1 / c * \<integral>\<^sub>Q x. \<bar>f x\<bar> \<partial>s)

goal (1 subgoal):
 1. qbs_emeasure s {x \<in> qbs_space X. c \<le> \<bar>f x\<bar>} \<le> ennreal (1 / c * \<integral>\<^sub>Q x. \<bar>f x\<bar> \<partial>s)
[PROOF STEP]
by(simp add: assms(1))


[STATEMENT]
lemma givenBy_eq_all: "(givenBy v) = {A. \<forall>x\<in>A. \<forall>y. v x = v y \<longrightarrow> y \<in> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. givenBy v = {A. \<forall>x\<in>A. \<forall>y. v x = v y \<longrightarrow> y \<in> A}
[PROOF STEP]
apply (unfold givenBy_def, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa xb xc y. \<lbrakk>xa \<in> UNIV; v xb \<in> xa; v xb = v y\<rbrakk> \<Longrightarrow> y \<in> v -` xa
 2. \<And>x. \<forall>xa\<in>x. \<forall>y. v xa = v y \<longrightarrow> y \<in> x \<Longrightarrow> x \<in> range ((-`) v)
[PROOF STEP]
apply (rule_tac [2] x = "v ` _" in image_eqI, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permute_list_compose_inv:
  assumes "\<sigma> permutes {..<n}"
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "permute_list \<sigma> (permute_list (fun_inv \<sigma>) a) = a"
        "permute_list (fun_inv \<sigma>) (permute_list \<sigma> a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list \<sigma> (permute_list (fun_inv \<sigma>) a) = a &&& permute_list (fun_inv \<sigma>) (permute_list \<sigma> a) = a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. permute_list \<sigma> (permute_list (fun_inv \<sigma>) a) = a &&& permute_list (fun_inv \<sigma>) (permute_list \<sigma> a) = a
[PROOF STEP]
apply (metis cartesian_power_car_memE fun_inv_permute(3) permute_list_compose permute_list_id)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list (fun_inv \<sigma>) (permute_list \<sigma> a) = a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. permute_list (fun_inv \<sigma>) (permute_list \<sigma> a) = a
[PROOF STEP]
by (metis cartesian_power_car_memE fun_inv_permute(2) fun_inv_permute(1) permute_list_compose permute_list_id)


[STATEMENT]
lemma "IArray.length (IArray [[],[]]) = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray [[], []]) = 2
[PROOF STEP]
by eval


[STATEMENT]
lemma sum_telescope_Ico: "a \<le> b \<Longrightarrow> (\<Sum>i=a ..< b. f i - f (Suc i) ::_::ab_group_add) = f a - f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> (\<Sum>i = a..<b. f i - f (Suc i)) = f a - f b
[PROOF STEP]
by (induction b rule: dec_induct) auto


[STATEMENT]
lemma (in euclidean_space) bchoice_Basis_iff:
  fixes P :: "'a \<Rightarrow> real \<Rightarrow> bool"
  shows "(\<forall>i\<in>Basis. \<exists>x\<in>A. P i x) \<longleftrightarrow> (\<exists>x. \<forall>i\<in>Basis. inner x i \<in> A \<and> P i (inner x i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>Basis. \<exists>x\<in>A. P i x) = (\<exists>x. \<forall>i\<in>Basis. inner x i \<in> A \<and> P i (inner x i))
[PROOF STEP]
by (simp add: choice_Basis_iff Bex_def)


[STATEMENT]
lemma is_nth_power_nat_code [code]:
  "is_nth_power_nat n m =
     (if n = 0 then m = 1
      else if m = 0 then n > 0
      else if n = 1 then True
      else (\<exists>k\<in>{1..m}. k ^ n = m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_nth_power_nat n m = (if n = 0 then m = 1 else if m = 0 then 0 < n else if n = 1 then True else \<exists>k\<in>{1..m}. k ^ n = m)
[PROOF STEP]
by (auto simp: is_nth_power_nat_def is_nth_power_def power_eq_iff_eq_base self_le_power)


[STATEMENT]
lemma bv_to_nat_lower_limit:
  assumes w0: "0 < bv_to_nat w"
  shows "2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat w
[PROOF STEP]
from w0 and norm_unsigned_result [of w]
[PROOF STATE]
proof (chain)
picking this:
0 < bv_to_nat w
norm_unsigned w = [] \<or> bv_msb (norm_unsigned w) = \<one>
[PROOF STEP]
have msbw: "bv_msb (norm_unsigned w) = \<one>"
[PROOF STATE]
proof (prove)
using this:
0 < bv_to_nat w
norm_unsigned w = [] \<or> bv_msb (norm_unsigned w) = \<one>

goal (1 subgoal):
 1. bv_msb (norm_unsigned w) = \<one>
[PROOF STEP]
by (auto simp add: norm_empty_bv_to_nat_zero)
[PROOF STATE]
proof (state)
this:
bv_msb (norm_unsigned w) = \<one>

goal (1 subgoal):
 1. 2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat w
[PROOF STEP]
have "2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat (norm_unsigned w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat (norm_unsigned w)
[PROOF STEP]
by (subst bv_to_nat_rew_msb [OF msbw],simp)
[PROOF STATE]
proof (state)
this:
2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat (norm_unsigned w)

goal (1 subgoal):
 1. 2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat w
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat (norm_unsigned w)

goal (1 subgoal):
 1. 2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (length (norm_unsigned w) - 1) \<le> bv_to_nat w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fv_foldr_Disj[simp]: "fv (foldr Disj Qs Q) = (fv Q \<union> (\<Union>Q \<in> set Qs. fv Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv (foldr Disj Qs Q) = fv Q \<union> \<Union> (fv ` set Qs)
[PROOF STEP]
by (induct Qs) auto


[STATEMENT]
lemma int_set_bit_numeral: fixes x :: int shows
  "set_bit x (numeral w) b = of_bool (odd x) + 2 * set_bit (x div 2) (pred_numeral w) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_bit_class.set_bit x (numeral w) b = of_bool (odd x) + 2 * set_bit_class.set_bit (x div 2) (pred_numeral w) b
[PROOF STEP]
by (fact bin_sc_numeral)


[STATEMENT]
lemma deriv_diff [simp]:
  "\<lbrakk>f field_differentiable at z; g field_differentiable at z\<rbrakk>
   \<Longrightarrow> deriv (\<lambda>w. f w - g w) z = deriv f z - deriv g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f field_differentiable at z; g field_differentiable at z\<rbrakk> \<Longrightarrow> deriv (\<lambda>w. f w - g w) z = deriv f z - deriv g z
[PROOF STEP]
unfolding DERIV_deriv_iff_field_differentiable[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_field_derivative deriv f z) (at z); (g has_field_derivative deriv g z) (at z)\<rbrakk> \<Longrightarrow> deriv (\<lambda>w. f w - g w) z = deriv f z - deriv g z
[PROOF STEP]
by (auto intro!: DERIV_imp_deriv derivative_intros)


[STATEMENT]
lemma consistent_def3: "consistent \<longleftrightarrow> (\<forall>\<phi> \<in> fmla. \<not> (prv \<phi> \<and> prv (neg \<phi>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent = (\<forall>\<phi>\<in>fmla. \<not> (prv \<phi> \<and> prv (neg \<phi>)))
[PROOF STEP]
unfolding consistent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> prv fls) = (\<forall>\<phi>\<in>fmla. \<not> (prv \<phi> \<and> prv (neg \<phi>)))
[PROOF STEP]
using prv_neg_fls neg_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?\<phi> \<in> fmla; prv ?\<phi>; prv (neg ?\<phi>)\<rbrakk> \<Longrightarrow> prv fls
neg ?\<phi> = imp ?\<phi> fls

goal (1 subgoal):
 1. (\<not> prv fls) = (\<forall>\<phi>\<in>fmla. \<not> (prv \<phi> \<and> prv (neg \<phi>)))
[PROOF STEP]
by auto


[STATEMENT]
theorem triangulize_divisor:
  assumes A: "A \<in> carrier_mat d d"
  shows "triangulize A = (r',A') \<Longrightarrow> r' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.triangulize A = (r', A') \<Longrightarrow> r' \<noteq> (0::'a)
[PROOF STEP]
unfolding triangulize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sub3 (dim_row A) (dim_row A) (1::'a, A) = (r', A') \<Longrightarrow> r' \<noteq> (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sub3 (dim_row A) (dim_row A) (1::'a, A) = (r', A') \<Longrightarrow> r' \<noteq> (0::'a)
[PROOF STEP]
assume rA': "sub3 (dim_row A) (dim_row A) (1, A) = (r', A')"
[PROOF STATE]
proof (state)
this:
sub3 (dim_row A) (dim_row A) (1::'a, A) = (r', A')

goal (1 subgoal):
 1. sub3 (dim_row A) (dim_row A) (1::'a, A) = (r', A') \<Longrightarrow> r' \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r' \<noteq> (0::'a)
[PROOF STEP]
using sub3_divisor[OF rA'] A
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dim_row A \<le> dim_row A; dim_row A \<le> dim_row A; dim_row A \<le> dim_col A; (1::'a) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> r' \<noteq> (0::'a)
A \<in> carrier_mat d d

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

goal:
No subgoals!
[PROOF STEP]
qed