[STATEMENT]
lemma continuous_within_topological:
  "continuous (at x within s) f \<longleftrightarrow>
    (\<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> (\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at x within s) f = (\<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> (\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)))
[PROOF STEP]
unfolding continuous_within tendsto_def eventually_at_topological
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>S. open S \<longrightarrow> f x \<in> S \<longrightarrow> (\<exists>Sa. open Sa \<and> x \<in> Sa \<and> (\<forall>xa\<in>Sa. xa \<noteq> x \<longrightarrow> xa \<in> s \<longrightarrow> f xa \<in> S))) = (\<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> (\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)))
[PROOF STEP]
by metis


[STATEMENT]
lemma gcd_coprime_poly:
  fixes p q::"'a::{factorial_ring_gcd,semiring_gcd_mult_normalize} poly"
  assumes nz: "p \<noteq> 0 \<or> q \<noteq> 0" and p': "p = p' * gcd p q" and
    q': "q = q' * gcd p q"
  shows "coprime p' q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime p' q'
[PROOF STEP]
using gcd_coprime nz p' q'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>gcd ?a ?b \<noteq> (0::?'a); ?a = ?a' * gcd ?a ?b; ?b = ?b' * gcd ?a ?b\<rbrakk> \<Longrightarrow> coprime ?a' ?b'
p \<noteq> 0 \<or> q \<noteq> 0
p = p' * gcd p q
q = q' * gcd p q

goal (1 subgoal):
 1. coprime p' q'
[PROOF STEP]
by auto


[STATEMENT]
theorem maximum_cardinality_matching:
  assumes "matching V E M" and "OSC L E"
  and "card M = weight {i \<in> L ` V. i > 1} (N V L)"
  and "matching V E M'"
  shows "card M' \<le> card M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card M' \<le> card M
[PROOF STEP]
using assms card_M_le_weight_NVLi
[PROOF STATE]
proof (prove)
using this:
matching V E M
OSC L E
card M = weight {i \<in> L ` V. 1 < i} (N V L)
matching V E M'
\<lbrakk>matching ?V ?E ?M; OSC ?L ?E\<rbrakk> \<Longrightarrow> card ?M \<le> weight {i \<in> ?L ` ?V. 1 < i} (N ?V ?L)

goal (1 subgoal):
 1. card M' \<le> card M
[PROOF STEP]
by simp


[STATEMENT]
lemma T_nn_integral_preserving:
  fixes f :: "'a \<Rightarrow> ennreal"
  assumes "f \<in> borel_measurable M"
  shows "(\<integral>\<^sup>+x. f(T x) \<partial>M) = (\<integral>\<^sup>+x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N M f
[PROOF STEP]
using measure_preserving_preserves_nn_integral[OF Tm assms]
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M f = \<integral>\<^sup>+ x. f (T x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N M f
[PROOF STEP]
by auto


[STATEMENT]
lemma mult_Suc_add_less: "\<lbrakk>\<alpha> < \<gamma>; \<beta> < \<gamma>; Ord \<alpha>; Ord \<beta>; Ord \<gamma>\<rbrakk>  \<Longrightarrow> \<gamma> * ord_of_nat m + \<alpha> < \<gamma> * ord_of_nat (Suc m) + \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<alpha> < \<gamma>; \<beta> < \<gamma>; Ord \<alpha>; Ord \<beta>; Ord \<gamma>\<rbrakk> \<Longrightarrow> \<gamma> * ord_of_nat m + \<alpha> < \<gamma> * ord_of_nat (Suc m) + \<beta>
[PROOF STEP]
apply (simp add: mult_succ add.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<alpha> < \<gamma>; \<beta> < \<gamma>; Ord \<alpha>; Ord \<beta>; Ord \<gamma>\<rbrakk> \<Longrightarrow> \<alpha> < \<gamma> + \<beta>
[PROOF STEP]
by (meson Ord_add Ord_linear2 le_less_trans not_add_less_right)


[STATEMENT]
lemma infs_disj[iff]: "infs (\<lambda> a. P a \<or> Q a) w \<longleftrightarrow> infs P w \<or> infs Q w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infs (\<lambda>a. P a \<or> Q a) w = (infs P w \<or> infs Q w)
[PROOF STEP]
unfolding infs_snth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. \<exists>k\<ge>n. P (w !! k) \<or> Q (w !! k)) = ((\<forall>n. \<exists>k\<ge>n. P (w !! k)) \<or> (\<forall>n. \<exists>k\<ge>n. Q (w !! k)))
[PROOF STEP]
using le_trans le_cases
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> ?j; ?j \<le> ?k\<rbrakk> \<Longrightarrow> ?i \<le> ?k
\<lbrakk>?x \<le> ?y \<Longrightarrow> ?P; ?y \<le> ?x \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<forall>n. \<exists>k\<ge>n. P (w !! k) \<or> Q (w !! k)) = ((\<forall>n. \<exists>k\<ge>n. P (w !! k)) \<or> (\<forall>n. \<exists>k\<ge>n. Q (w !! k)))
[PROOF STEP]
by metis


[STATEMENT]
lemma "(\<exists>y. \<forall>x. F x y = F x x)
        \<longrightarrow>  \<not> (\<forall>x. \<exists>y. \<forall>z. F z y = (\<not> F z x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x. F x y = F x x) \<longrightarrow> \<not> (\<forall>x. \<exists>y. \<forall>z. F z y = (\<not> F z x))
[PROOF STEP]
by blast


[STATEMENT]
lemma mset_ran_combine_eqs:
  assumes "mset_ran a r\<^sub>1 = mset_ran b r\<^sub>1"
  assumes "mset_ran a r\<^sub>2 = mset_ran b r\<^sub>2"
  assumes "r\<^sub>1\<inter>r\<^sub>2 = {}"
  shows "mset_ran a (r\<^sub>1\<union>r\<^sub>2) = mset_ran b (r\<^sub>1\<union>r\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_ran a (r\<^sub>1 \<union> r\<^sub>2) = mset_ran b (r\<^sub>1 \<union> r\<^sub>2)
[PROOF STEP]
apply (cases "finite r\<^sub>1"; cases "finite r\<^sub>2"; simp?)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite r\<^sub>1; finite r\<^sub>2\<rbrakk> \<Longrightarrow> mset_ran a (r\<^sub>1 \<union> r\<^sub>2) = mset_ran b (r\<^sub>1 \<union> r\<^sub>2)
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
mset_ran a r\<^sub>1 = mset_ran b r\<^sub>1
mset_ran a r\<^sub>2 = mset_ran b r\<^sub>2

goal (1 subgoal):
 1. \<lbrakk>finite r\<^sub>1; finite r\<^sub>2\<rbrakk> \<Longrightarrow> mset_ran a (r\<^sub>1 \<union> r\<^sub>2) = mset_ran b (r\<^sub>1 \<union> r\<^sub>2)
[PROOF STEP]
apply (simp add: mset_ran_combine1[OF _ _ assms(3), symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma final_Times [simp]: "final (Times fsm1 fsm2) = final fsm1 * final fsm2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. final (Times fsm1 fsm2) = final fsm1 * final fsm2
[PROOF STEP]
by (simp add: Times_def)


[STATEMENT]
lemma n_mult_right_upper_bound:
  "n(x * y) \<le> n(z) \<longleftrightarrow> n(x) \<le> n(z) \<and> x * n(y) * L \<le> x * bot \<squnion> n(z) * L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n (x * y) \<le> n z) = (n x \<le> n z \<and> x * n y * L \<le> x * bot \<squnion> n z * L)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n (x * y) \<le> n z \<Longrightarrow> n x \<le> n z \<and> x * n y * L \<le> x * bot \<squnion> n z * L
 2. n x \<le> n z \<and> x * n y * L \<le> x * bot \<squnion> n z * L \<Longrightarrow> n (x * y) \<le> n z
[PROOF STEP]
apply (metis sup_right_isotone order.eq_iff mult_isotone n_L_split n_mult_left_upper_bound order_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n x \<le> n z \<and> x * n y * L \<le> x * bot \<squnion> n z * L \<Longrightarrow> n (x * y) \<le> n z
[PROOF STEP]
by (smt (verit, ccfv_threshold) n_dist_sup n_export sup.absorb_iff2 n_mult n_mult_commutative n_mult_bot n_n_L)


[STATEMENT]
lemma sum_list_replicate_length [simp]:
  "sum_list (replicate (length xs) (Suc 0)) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (replicate (length xs) (Suc 0)) = length xs
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma swap_set_in_eq:
  assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b"
  shows "(a \<rightleftharpoons> b) \<bullet> S = (S - {a}) \<union> {b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<rightleftharpoons> b) \<bullet> S = S - {a} \<union> {b}
[PROOF STEP]
unfolding permute_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a \<rightleftharpoons> b) \<bullet> x |x. x \<in> S} = S - {a} \<union> {b}
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<in> S
b \<notin> S
sort_of a = sort_of b

goal (1 subgoal):
 1. {(a \<rightleftharpoons> b) \<bullet> x |x. x \<in> S} = S - {a} \<union> {b}
[PROOF STEP]
by (auto simp: swap_atom)


[STATEMENT]
lemma less_multiset\<^sub>H\<^sub>O_imp_less_multiset\<^sub>D\<^sub>M: "less_multiset\<^sub>H\<^sub>O M N \<Longrightarrow> less_multiset\<^sub>D\<^sub>M M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. less_multiset\<^sub>H\<^sub>O M N \<Longrightarrow> less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
unfolding less_multiset\<^sub>D\<^sub>M_def less_multiset\<^sub>H\<^sub>O_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<noteq> N \<and> (\<forall>y. count N y < count M y \<longrightarrow> (\<exists>x>y. count M x < count N x)) \<Longrightarrow> \<exists>X Y. X \<noteq> {#} \<and> X \<subseteq># N \<and> M = N - X + Y \<and> (\<forall>k. k \<in># Y \<longrightarrow> (\<exists>a. a \<in># X \<and> k < a))
[PROOF STEP]
unfolding multp\<^sub>D\<^sub>M_def[symmetric] multp\<^sub>H\<^sub>O_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multp\<^sub>H\<^sub>O (<) M N \<Longrightarrow> multp\<^sub>D\<^sub>M (<) M N
[PROOF STEP]
by (rule multp\<^sub>H\<^sub>O_imp_multp\<^sub>D\<^sub>M)


[STATEMENT]
lemma lm018:
  "possible_allocations_rel G N   =
   injectionsUniverse \<inter> {a. Domain a \<in> all_partitions G & Range a \<subseteq> N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. possible_allocations_rel G N = injectionsUniverse \<inter> {a. Domain a \<in> all_partitions G \<and> Range a \<subseteq> N}
[PROOF STEP]
using lm016 lm017
[PROOF STATE]
proof (prove)
using this:
possible_allocations_rel ?G ?N \<subseteq> injectionsUniverse \<inter> {a. Range a \<subseteq> ?N \<and> Domain a \<in> all_partitions ?G}
injectionsUniverse \<inter> {a. Domain a \<in> all_partitions ?G \<and> Range a \<subseteq> ?N} \<subseteq> possible_allocations_rel ?G ?N

goal (1 subgoal):
 1. possible_allocations_rel G N = injectionsUniverse \<inter> {a. Domain a \<in> all_partitions G \<and> Range a \<subseteq> N}
[PROOF STEP]
by blast


[STATEMENT]
lemma isCont_has_Ub:
  fixes f :: "real \<Rightarrow> 'a::linorder_topology"
  shows "a \<le> b \<Longrightarrow> \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x \<Longrightarrow>
    \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<forall>N. N < M \<longrightarrow> (\<exists>x. a \<le> x \<and> x \<le> b \<and> N < f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<forall>N<M. \<exists>x\<ge>a. x \<le> b \<and> N < f x)
[PROOF STEP]
using isCont_eq_Ub[of a b f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<exists>x\<ge>a. x \<le> b \<and> f x = M)

goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<forall>N<M. \<exists>x\<ge>a. x \<le> b \<and> N < f x)
[PROOF STEP]
by auto


[STATEMENT]
lemma tensor_mat_mult:
  assumes "m1 \<in> carrier_mat d1 d1"
    and "m2 \<in> carrier_mat d1 d1"
    and "m3 \<in> carrier_mat d2 d2"
    and "m4 \<in> carrier_mat d2 d2"
  shows "tensor_mat (m1 * m2) (m3 * m4) = tensor_mat m1 m3 * tensor_mat m2 m4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat (m1 * m2) (m3 * m4) = tensor_mat m1 m3 * tensor_mat m2 m4
[PROOF STEP]
proof (rule eq_matI, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
fix i j :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
assume i: "i < d" and j: "j < d"
[PROOF STATE]
proof (state)
this:
i < d
j < d

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
let ?i1 = "encode1 i" and ?i2 = "encode2 i" and ?j1 = "encode1 j" and ?j2 = "encode2 j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
have "tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = (m1 * m2) $$ (?i1, ?j1) * (m3 * m4) $$ (?i2, ?j2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = (m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j)
[PROOF STEP]
using i j
[PROOF STATE]
proof (prove)
using this:
i < d
j < d

goal (1 subgoal):
 1. tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = (m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j)
[PROOF STEP]
by (simp add: tensor_mat_eval)
[PROOF STATE]
proof (state)
this:
tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = (m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = (m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
have "\<dots> = (row m1 ?i1 \<bullet> col m2 ?j1) * (row m3 ?i2 \<bullet> col m4 ?j2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j) = row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j))
[PROOF STEP]
using assms i j
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat d1 d1
m2 \<in> carrier_mat d1 d1
m3 \<in> carrier_mat d2 d2
m4 \<in> carrier_mat d2 d2
i < d
j < d

goal (1 subgoal):
 1. (m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j) = row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j) = row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(m1 * m2) $$ (encode1 i, encode1 j) * (m3 * m4) $$ (encode2 i, encode2 j) = row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..<d1. m1 $$ (?i1, i) * m2 $$ (i, ?j1)) * (\<Sum>j = 0..<d2. m3 $$ (?i2, j) * m4 $$ (j, ?j2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j)) = (\<Sum>ia = 0..<d1. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j)) * (\<Sum>ja = 0..<d2. m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j))
[PROOF STEP]
using assms i j
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat d1 d1
m2 \<in> carrier_mat d1 d1
m3 \<in> carrier_mat d2 d2
m4 \<in> carrier_mat d2 d2
i < d
j < d

goal (1 subgoal):
 1. row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j)) = (\<Sum>ia = 0..<d1. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j)) * (\<Sum>ja = 0..<d2. m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j))
[PROOF STEP]
by (simp add: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j)) = (\<Sum>ia = 0..<d1. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j)) * (\<Sum>ja = 0..<d2. m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row m1 (encode1 i) \<bullet> col m2 (encode1 j) * (row m3 (encode2 i) \<bullet> col m4 (encode2 j)) = (\<Sum>ia = 0..<d1. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j)) * (\<Sum>ja = 0..<d2. m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..<d1. \<Sum>j = 0..<d2. (m1 $$ (?i1, i) * m2 $$ (i, ?j1)) * (m3 $$ (?i2, j) * m4 $$ (j, ?j2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<d1. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j)) * (\<Sum>ja = 0..<d2. m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j)) = (\<Sum>ia = 0..<d1. \<Sum>ja = 0..<d2. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j) * (m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j)))
[PROOF STEP]
by (rule Groups_Big.sum_product)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<d1. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j)) * (\<Sum>ja = 0..<d2. m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j)) = (\<Sum>ia = 0..<d1. \<Sum>ja = 0..<d2. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j) * (m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<d1. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j)) * (\<Sum>ja = 0..<d2. m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j)) = (\<Sum>ia = 0..<d1. \<Sum>ja = 0..<d2. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j) * (m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..<d. (m1 $$ (?i1, encode1 i) * m2 $$ (encode1 i, ?j1)) * (m3 $$ (?i2, encode2 i) * m4 $$ (encode2 i, ?j2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<d1. \<Sum>ja = 0..<d2. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j) * (m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j))) = (\<Sum>ia = 0..<d. m1 $$ (encode1 i, encode1 ia) * m2 $$ (encode1 ia, encode1 j) * (m3 $$ (encode2 i, encode2 ia) * m4 $$ (encode2 ia, encode2 j)))
[PROOF STEP]
by (rule sum_encode)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<d1. \<Sum>ja = 0..<d2. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j) * (m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j))) = (\<Sum>ia = 0..<d. m1 $$ (encode1 i, encode1 ia) * m2 $$ (encode1 ia, encode1 j) * (m3 $$ (encode2 i, encode2 ia) * m4 $$ (encode2 ia, encode2 j)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<d1. \<Sum>ja = 0..<d2. m1 $$ (encode1 i, ia) * m2 $$ (ia, encode1 j) * (m3 $$ (encode2 i, ja) * m4 $$ (ja, encode2 j))) = (\<Sum>ia = 0..<d. m1 $$ (encode1 i, encode1 ia) * m2 $$ (encode1 ia, encode1 j) * (m3 $$ (encode2 i, encode2 ia) * m4 $$ (encode2 ia, encode2 j)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
have "\<dots> = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<d. m1 $$ (encode1 i, encode1 ia) * m2 $$ (encode1 ia, encode1 j) * (m3 $$ (encode2 i, encode2 ia) * m4 $$ (encode2 ia, encode2 j))) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
apply (simp add: scalar_prod_def tensor_mat_eval i j)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<d. m1 $$ (encode1 i, encode1 ia) * m2 $$ (encode1 ia, encode1 j) * (m3 $$ (encode2 i, encode2 ia) * m4 $$ (encode2 ia, encode2 j))) = (\<Sum>ia = 0..<d. m1 $$ (encode1 i, encode1 ia) * m3 $$ (encode2 i, encode2 ia) * (m2 $$ (encode1 ia, encode1 j) * m4 $$ (encode2 ia, encode2 j)))
[PROOF STEP]
by (rule sum.cong, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<d. m1 $$ (encode1 i, encode1 ia) * m2 $$ (encode1 ia, encode1 j) * (m3 $$ (encode2 i, encode2 ia) * m4 $$ (encode2 ia, encode2 j))) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < d; j < d\<rbrakk> \<Longrightarrow> tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
show "tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j"
[PROOF STATE]
proof (prove)
using this:
tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j

goal (1 subgoal):
 1. tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
tensor_mat (m1 * m2) (m3 * m4) $$ (i, j) = row (tensor_mat m1 m3) i \<bullet> col (tensor_mat m2 m4) j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_componentwise:
  fixes a::"'a::euclidean_space \<Rightarrow>\<^sub>L 'b::euclidean_space"
    and b::"'c \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
  shows "(\<And>i j. i \<in> Basis \<Longrightarrow> j \<in> Basis \<Longrightarrow> ((\<lambda>n. b n j \<bullet> i) \<longlongrightarrow> a j \<bullet> i) F) \<Longrightarrow> (b \<longlongrightarrow> a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i \<in> Basis; j \<in> Basis\<rbrakk> \<Longrightarrow> ((\<lambda>n. blinfun_apply (b n) j \<bullet> i) \<longlongrightarrow> blinfun_apply a j \<bullet> i) F) \<Longrightarrow> (b \<longlongrightarrow> a) F
[PROOF STEP]
apply (subst blinfun_of_matrix_works[of a, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i \<in> Basis; j \<in> Basis\<rbrakk> \<Longrightarrow> ((\<lambda>n. blinfun_apply (b n) j \<bullet> i) \<longlongrightarrow> blinfun_apply a j \<bullet> i) F) \<Longrightarrow> (b \<longlongrightarrow> blinfun_of_matrix (\<lambda>i j. blinfun_apply a j \<bullet> i)) F
[PROOF STEP]
apply (subst blinfun_of_matrix_works[of "b x" for x, symmetric, abs_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i \<in> Basis; j \<in> Basis\<rbrakk> \<Longrightarrow> ((\<lambda>n. blinfun_apply (b n) j \<bullet> i) \<longlongrightarrow> blinfun_apply a j \<bullet> i) F) \<Longrightarrow> ((\<lambda>x. blinfun_of_matrix (\<lambda>i j. blinfun_apply (b x) j \<bullet> i)) \<longlongrightarrow> blinfun_of_matrix (\<lambda>i j. blinfun_apply a j \<bullet> i)) F
[PROOF STEP]
by (rule tendsto_blinfun_of_matrix)


[STATEMENT]
lemma dfa_reach_rquot:
  assumes "dfa_is_node A x"
  and "dfa_is_node A y"
  shows "rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
dfa_is_node A x
dfa_is_node A y
[PROOF STEP]
have "rquot_memb y (rquot_dfs A n x) = ((x,y) \<in> (succsr (rquot_succs A n))\<^sup>*)"
[PROOF STATE]
proof (prove)
using this:
dfa_is_node A x
dfa_is_node A y

goal (1 subgoal):
 1. rquot_memb y (rquot_dfs A n x) = ((x, y) \<in> (succsr (rquot_succs A n))\<^sup>*)
[PROOF STEP]
by (simp add: dfs_eq_rtrancl rquot_dfs_def)
[PROOF STATE]
proof (state)
this:
rquot_memb y (rquot_dfs A n x) = ((x, y) \<in> (succsr (rquot_succs A n))\<^sup>*)

goal (1 subgoal):
 1. rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rquot_memb y (rquot_dfs A n x) = ((x, y) \<in> (succsr (rquot_succs A n))\<^sup>*)

goal (1 subgoal):
 1. rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
have "\<dots> = (\<exists>m. dfa_reach A x (zeros m n) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> (succsr (rquot_succs A n))\<^sup>*) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
by (simp add: zeros_rtrancl)
[PROOF STATE]
proof (state)
this:
((x, y) \<in> (succsr (rquot_succs A n))\<^sup>*) = (\<exists>m. dfa_reach A x (zeros m n) y)

goal (1 subgoal):
 1. rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)

goal (1 subgoal):
 1. rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rquot_memb y (rquot_dfs A n x) = (\<exists>m. dfa_reach A x (zeros m n) y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma csucc_0 [simp]: "csucc 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csucc 0 = 1
[PROOF STEP]
by (simp add: finite_csucc one_V_def)


[STATEMENT]
lemma enat_min_eq_0_iff:
  fixes a b :: enat
  shows "min a b = 0 \<longleftrightarrow> a = 0 \<or> b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (min a b = 0) = (a = 0 \<or> b = 0)
[PROOF STEP]
by(auto simp add: min_def)


[STATEMENT]
lemma open_ballE: "t\<^sub>0 \<in> T \<Longrightarrow> open T \<Longrightarrow> \<exists>e>0. ball t\<^sub>0 e \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t\<^sub>0 \<in> T; open T\<rbrakk> \<Longrightarrow> \<exists>e>0. ball t\<^sub>0 e \<subseteq> T
[PROOF STEP]
using open_contains_ball
[PROOF STATE]
proof (prove)
using this:
open ?S = (\<forall>x\<in>?S. \<exists>e>0. ball x e \<subseteq> ?S)

goal (1 subgoal):
 1. \<lbrakk>t\<^sub>0 \<in> T; open T\<rbrakk> \<Longrightarrow> \<exists>e>0. ball t\<^sub>0 e \<subseteq> T
[PROOF STEP]
by blast


[STATEMENT]
lemma rotate_pow_mod:  "rotate n (u\<^sup>@k) = rotate (n mod \<^bold>|u\<^bold>|) (u\<^sup>@k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate n (u \<^sup>@ k) = rotate (n mod \<^bold>|u\<^bold>|) (u \<^sup>@ k)
[PROOF STEP]
using rotate_rotate[of "n mod \<^bold>|u\<^bold>|" "n div \<^bold>|u\<^bold>| * \<^bold>|u\<^bold>|" "u\<^sup>@k", symmetric]
[PROOF STATE]
proof (prove)
using this:
rotate (n mod \<^bold>|u\<^bold>| + n div \<^bold>|u\<^bold>| * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = rotate (n mod \<^bold>|u\<^bold>|) (rotate (n div \<^bold>|u\<^bold>| * \<^bold>|u\<^bold>|) (u \<^sup>@ k))

goal (1 subgoal):
 1. rotate n (u \<^sup>@ k) = rotate (n mod \<^bold>|u\<^bold>|) (u \<^sup>@ k)
[PROOF STEP]
unfolding rotate_pow_self[of "n div \<^bold>|u\<^bold>|" u k] div_mult_mod_eq[of n "\<^bold>|u\<^bold>|", unfolded add.commute[of "n div \<^bold>|u\<^bold>| * \<^bold>|u\<^bold>|" "n mod \<^bold>|u\<^bold>|"]]
[PROOF STATE]
proof (prove)
using this:
rotate n (u \<^sup>@ k) = rotate (n mod \<^bold>|u\<^bold>|) (u \<^sup>@ k)

goal (1 subgoal):
 1. rotate n (u \<^sup>@ k) = rotate (n mod \<^bold>|u\<^bold>|) (u \<^sup>@ k)
[PROOF STEP]
.


[STATEMENT]
lemma greatest_ge_nonzero_row':
  fixes A::"'a::{zero, one}^'n::{mod_type}^'m::{finite, linorder, one, plus}"
  assumes r: "reduced_row_echelon_form_upt_k A k"
  and i: "i \<le> (GREATEST m. \<not> is_zero_row_upt_k m k A)"
  and not_all_zero: "\<not> (\<forall>a. is_zero_row_upt_k a k A)"
  shows "\<not> is_zero_row_upt_k i k A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_zero_row_upt_k i k A
[PROOF STEP]
using greatest_less_zero_row[OF r] i not_all_zero
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_zero_row_upt_k ?i k A; \<not> (\<forall>a. is_zero_row_upt_k a k A)\<rbrakk> \<Longrightarrow> (GREATEST m. \<not> is_zero_row_upt_k m k A) < ?i
i \<le> (GREATEST m. \<not> is_zero_row_upt_k m k A)
\<not> (\<forall>a. is_zero_row_upt_k a k A)

goal (1 subgoal):
 1. \<not> is_zero_row_upt_k i k A
[PROOF STEP]
by fastforce


[STATEMENT]
lemma total_onD:
  "\<lbrakk> total_on A r; x \<in> A; y \<in> A \<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> x = y \<or> (y, x) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>total_on A r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> x = y \<or> (y, x) \<in> r
[PROOF STEP]
unfolding total_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A. \<forall>y\<in>A. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> x = y \<or> (y, x) \<in> r
[PROOF STEP]
by blast


[STATEMENT]
lemma space_eq_univ [simp]: "space M = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space M = UNIV
[PROOF STEP]
using M_is_borel[THEN sets_eq_imp_space_eq]
[PROOF STATE]
proof (prove)
using this:
space M = space borel

goal (1 subgoal):
 1. space M = UNIV
[PROOF STEP]
by simp


[STATEMENT]
lemma finite_iff_less_Aleph0: "finite (elts x) \<longleftrightarrow> vcard x < \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (elts x) = (vcard x < \<omega>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (elts x) \<Longrightarrow> vcard x < \<omega>
 2. vcard x < \<omega> \<Longrightarrow> finite (elts x)
[PROOF STEP]
show "finite (elts x) \<Longrightarrow> vcard x < \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (elts x) \<Longrightarrow> vcard x < \<omega>
[PROOF STEP]
by (metis Card_\<omega> Card_def finite_lesspoll_infinite infinite_\<omega> lesspoll_imp_Card_less)
[PROOF STATE]
proof (state)
this:
finite (elts x) \<Longrightarrow> vcard x < \<omega>

goal (1 subgoal):
 1. vcard x < \<omega> \<Longrightarrow> finite (elts x)
[PROOF STEP]
show "vcard x < \<omega> \<Longrightarrow> finite (elts x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard x < \<omega> \<Longrightarrow> finite (elts x)
[PROOF STEP]
by (meson Ord_cardinal cardinal_eqpoll eqpoll_finite_iff infinite_Ord_omega less_le_not_le)
[PROOF STATE]
proof (state)
this:
vcard x < \<omega> \<Longrightarrow> finite (elts x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_vector_derivative_complex_iff: "(f has_vector_derivative x) F \<longleftrightarrow>
    ((\<lambda>x. Re (f x)) has_field_derivative (Re x)) F \<and>
    ((\<lambda>x. Im (f x)) has_field_derivative (Im x)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_vector_derivative x) F = (((\<lambda>x. Re (f x)) has_real_derivative Re x) F \<and> ((\<lambda>x. Im (f x)) has_real_derivative Im x) F)
[PROOF STEP]
by (simp add: has_vector_derivative_def has_field_derivative_def has_derivative_def
      tendsto_complex_iff algebra_simps bounded_linear_scaleR_left bounded_linear_mult_right)


[STATEMENT]
lemma LIM_powa_exponent_at_zero: "1 < a \<Longrightarrow> (\<lambda>h. a powa h) \<midarrow>0\<rightarrow>  1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < a \<Longrightarrow> (powa) a \<midarrow>0\<rightarrow> 1
[PROOF STEP]
by (metis isCont_def isCont_powa_exponent_at_zero less_eq_real_def powa_zero_eq_one)


[STATEMENT]
lemma has_integral_Beta3:
  fixes a b :: real
  assumes "a < -1/2" and "b > 0"
  shows   "((\<lambda>x. (b + x ^ 2) powr a) has_integral
             Beta (-a - 1/2) (1/2) / 2 * b powr (a + 1/2)) {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
define C where "C = Beta (- a - 1 / 2) (1 / 2) / 2"
[PROOF STATE]
proof (state)
this:
C = Beta (- a - 1 / 2) (1 / 2) / 2

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have int: "nn_integral lborel (\<lambda>x. indicator {0<..} x * (1 + x ^ 2) powr a) = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C
[PROOF STEP]
using nn_integral_has_integral_lebesgue[OF _ has_integral_Beta2[OF assms(1)]]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. 0 \<le> (1 + x\<^sup>2) powr a) \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal (Beta (- a - 1 / 2) (1 / 2) / 2)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C
[PROOF STEP]
by (auto simp: C_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have "nn_integral lborel (\<lambda>x. indicator {0<..} x * (b + x ^ 2) powr a) =
        (\<integral>\<^sup>+x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < - 1 / 2
0 < b

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel
[PROOF STEP]
by (subst lborel_distr_mult'[of "sqrt b"])
       (auto simp: nn_integral_density nn_integral_distr mult_ac simp flip: ennreal_mult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+x. ennreal (indicat_real {0<..} x * (b * (1 + x ^ 2)) powr a * sqrt b) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < - 1 / 2
0 < b

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong) (auto simp: indicator_def field_simps zero_less_mult_iff)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} (x * sqrt b) * (b + (x * sqrt b)\<^sup>2) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+x. ennreal (indicat_real {0<..} x * b powr (a + 1/2) * (1 + x ^ 2) powr a) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < - 1 / 2
0 < b

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong) (auto simp: indicator_def powr_add powr_half_sqrt powr_mult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b * (1 + x\<^sup>2)) powr a * sqrt b) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have "\<dots> = b powr (a + 1/2) * (\<integral>\<^sup>+x. ennreal (indicat_real {0<..} x * (1 + x ^ 2) powr a) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal (b powr (a + 1 / 2)) * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < - 1 / 2
0 < b

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal (b powr (a + 1 / 2)) * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_cmult [symmetric]) (simp_all add: mult_ac flip: ennreal_mult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal (b powr (a + 1 / 2)) * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * b powr (a + 1 / 2) * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal (b powr (a + 1 / 2)) * \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have "(\<integral>\<^sup>+x. ennreal (indicat_real {0<..} x * (1 + x ^ 2) powr a) \<partial>lborel) = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C
[PROOF STEP]
using int
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (1 + x\<^sup>2) powr a) \<partial>lborel = ennreal C

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have "ennreal (b powr (a + 1/2)) * ennreal C = ennreal (C * b powr (a + 1/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (b powr (a + 1 / 2)) * ennreal C = ennreal (C * b powr (a + 1 / 2))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < - 1 / 2
0 < b

goal (1 subgoal):
 1. ennreal (b powr (a + 1 / 2)) * ennreal C = ennreal (C * b powr (a + 1 / 2))
[PROOF STEP]
by (subst ennreal_mult) (auto simp: C_def mult_ac Beta_def)
[PROOF STATE]
proof (state)
this:
ennreal (b powr (a + 1 / 2)) * ennreal C = ennreal (C * b powr (a + 1 / 2))

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = ennreal (C * b powr (a + 1 / 2))
[PROOF STEP]
have *: "(\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel) = \<dots>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = ennreal (C * b powr (a + 1 / 2))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = ennreal (C * b powr (a + 1 / 2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = ennreal (C * b powr (a + 1 / 2))

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
hence "((\<lambda>x. indicator {0<..} x * (b + x^2) powr a) has_integral C * b powr (a + 1/2)) UNIV"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = ennreal (C * b powr (a + 1 / 2))

goal (1 subgoal):
 1. ((\<lambda>x. indicat_real {0<..} x * (b + x\<^sup>2) powr a) has_integral C * b powr (a + 1 / 2)) UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0<..} x * (b + x\<^sup>2) powr a) \<partial>lborel = ennreal (C * b powr (a + 1 / 2))
a < - 1 / 2
0 < b

goal (1 subgoal):
 1. ((\<lambda>x. indicat_real {0<..} x * (b + x\<^sup>2) powr a) has_integral C * b powr (a + 1 / 2)) UNIV
[PROOF STEP]
by (subst has_integral_iff_nn_integral_lebesgue)
       (auto simp: C_def measurable_completion nn_integral_completion Beta_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. indicat_real {0<..} x * (b + x\<^sup>2) powr a) has_integral C * b powr (a + 1 / 2)) UNIV

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. indicat_real {0<..} x * (b + x\<^sup>2) powr a) has_integral C * b powr (a + 1 / 2)) UNIV

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
have "(\<lambda>x. indicator {0<..} x * (b + x^2) powr a) =
             (\<lambda>x. if x \<in> {0<..} then (b + x^2) powr a else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real {0<..} x * (b + x\<^sup>2) powr a) = (\<lambda>x. if x \<in> {0<..} then (b + x\<^sup>2) powr a else 0)
[PROOF STEP]
by (auto simp: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real {0<..} x * (b + x\<^sup>2) powr a) = (\<lambda>x. if x \<in> {0<..} then (b + x\<^sup>2) powr a else 0)

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. if x \<in> {0<..} then (b + x\<^sup>2) powr a else 0) has_integral C * b powr (a + 1 / 2)) UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. if x \<in> {0<..} then (b + x\<^sup>2) powr a else 0) has_integral C * b powr (a + 1 / 2)) UNIV

goal (1 subgoal):
 1. ((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}
[PROOF STEP]
by (subst (asm) has_integral_restrict_UNIV) (auto simp: C_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (b + x\<^sup>2) powr a) has_integral Beta (- a - 1 / 2) (1 / 2) / 2 * b powr (a + 1 / 2)) {0<..}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_component_of_eq_overlap:
   "path_component_of X x = path_component_of X y \<longleftrightarrow>
      (x \<notin> topspace X) \<and> (y \<notin> topspace X) \<or>
      Collect (path_component_of X x) \<inter> Collect (path_component_of X y) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (path_component_of X x = path_component_of X y) = (x \<notin> topspace X \<and> y \<notin> topspace X \<or> path_component_of_set X x \<inter> path_component_of_set X y \<noteq> {})
[PROOF STEP]
by (metis disjnt_def empty_iff inf_bot_right mem_Collect_eq path_component_of_disjoint path_component_of_eq path_component_of_eq_empty)


[STATEMENT]
lemma partition_on_mset_split:
  assumes "partition_on_mset A (P + Q)"
  shows "partition_on_mset (\<Sum>\<^sub>#P) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_on_mset (\<Sum>\<^sub># P) P
[PROOF STEP]
using  partition_on_mset_def partition_on_msetD2 assms
[PROOF STATE]
proof (prove)
using this:
partition_on_mset ?A ?P = (\<Sum>\<^sub># ?P = ?A \<and> {#} \<notin># ?P)
partition_on_mset ?A ?P \<Longrightarrow> {#} \<notin># ?P
partition_on_mset A (P + Q)

goal (1 subgoal):
 1. partition_on_mset (\<Sum>\<^sub># P) P
[PROOF STEP]
by fastforce


[STATEMENT]
lemma aadd_minus_r: "x + (- x) = (0::ant)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + - x = 0
[PROOF STEP]
apply (cut_tac  aadd_minus_inv[of "x"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x + x = 0 \<Longrightarrow> x + - x = 0
[PROOF STEP]
apply (simp add:aadd_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fact_fact_dvd_fact:
  "fact k * fact n dvd (fact (k + n) :: 'a::linordered_semidom)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact k * fact n dvd fact (k + n)
[PROOF STEP]
by (metis add.commute add_diff_cancel_left' choose_dvd le_add2)


[STATEMENT]
lemma regular_system:
  fixes a11 a12 a21 a22 b1 b2 :: "'a::field"
  assumes "det2 a11 a12 a21 a22 \<noteq> 0"
  shows "\<exists>! x. a11*(fst x) + a12*(snd x) = b1 \<and>
               a21*(fst x) + a22*(snd x) = b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a11 * fst ?a + a12 * snd ?a = b1 \<and> a21 * fst ?a + a22 * snd ?a = b2
 2. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ?a
[PROOF STEP]
let ?d = "a11*a22 - a12*a21" and ?d1 = "b1*a22 - b2*a12" and ?d2 = "b2*a11 - b1*a21"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a11 * fst ?a + a12 * snd ?a = b1 \<and> a21 * fst ?a + a22 * snd ?a = b2
 2. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ?a
[PROOF STEP]
let ?x = "(?d1 / ?d, ?d2 / ?d)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a11 * fst ?a + a12 * snd ?a = b1 \<and> a21 * fst ?a + a22 * snd ?a = b2
 2. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ?a
[PROOF STEP]
have "a11 * ?d1 + a12 * ?d2 = b1*?d" "a21 * ?d1 + a22 * ?d2 = b2*?d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a11 * (b1 * a22 - b2 * a12) + a12 * (b2 * a11 - b1 * a21) = b1 * (a11 * a22 - a12 * a21) &&& a21 * (b1 * a22 - b2 * a12) + a22 * (b2 * a11 - b1 * a21) = b2 * (a11 * a22 - a12 * a21)
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
a11 * (b1 * a22 - b2 * a12) + a12 * (b2 * a11 - b1 * a21) = b1 * (a11 * a22 - a12 * a21)
a21 * (b1 * a22 - b2 * a12) + a22 * (b2 * a11 - b1 * a21) = b2 * (a11 * a22 - a12 * a21)

goal (2 subgoals):
 1. a11 * fst ?a + a12 * snd ?a = b1 \<and> a21 * fst ?a + a22 * snd ?a = b2
 2. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ?a
[PROOF STEP]
thus "a11 * fst ?x + a12 * snd ?x = b1 \<and> a21 * fst ?x + a22 * snd ?x = b2"
[PROOF STATE]
proof (prove)
using this:
a11 * (b1 * a22 - b2 * a12) + a12 * (b2 * a11 - b1 * a21) = b1 * (a11 * a22 - a12 * a21)
a21 * (b1 * a22 - b2 * a12) + a22 * (b2 * a11 - b1 * a21) = b2 * (a11 * a22 - a12 * a21)

goal (1 subgoal):
 1. a11 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a12 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b1 \<and> a21 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a22 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a11 * (b1 * a22 - b2 * a12) + a12 * (b2 * a11 - b1 * a21) = b1 * (a11 * a22 - a12 * a21)
a21 * (b1 * a22 - b2 * a12) + a22 * (b2 * a11 - b1 * a21) = b2 * (a11 * a22 - a12 * a21)
det2 a11 a12 a21 a22 \<noteq> (0::'a)

goal (1 subgoal):
 1. a11 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a12 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b1 \<and> a21 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a22 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b2
[PROOF STEP]
by (metis (opaque_lifting, no_types) det2_def add_divide_distrib eq_divide_imp fst_eqD snd_eqD times_divide_eq_right)
[PROOF STATE]
proof (state)
this:
a11 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a12 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b1 \<and> a21 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a22 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b2

goal (1 subgoal):
 1. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))
[PROOF STEP]
fix x'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))
[PROOF STEP]
assume "a11 * fst x' + a12 * snd x' = b1 \<and> a21 * fst x' + a22 * snd x' = b2"
[PROOF STATE]
proof (state)
this:
a11 * fst x' + a12 * snd x' = b1 \<and> a21 * fst x' + a22 * snd x' = b2

goal (1 subgoal):
 1. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))
[PROOF STEP]
with \<open>a11 * fst ?x + a12 * snd ?x = b1 \<and> a21 * fst ?x + a22 * snd ?x = b2\<close>
[PROOF STATE]
proof (chain)
picking this:
a11 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a12 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b1 \<and> a21 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a22 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b2
a11 * fst x' + a12 * snd x' = b1 \<and> a21 * fst x' + a22 * snd x' = b2
[PROOF STEP]
have "a11 * (fst x' - fst ?x) + a12 * (snd x' - snd ?x) = 0 \<and> a21 * (fst x' - fst ?x) + a22 * (snd x' - snd ?x) = 0"
[PROOF STATE]
proof (prove)
using this:
a11 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a12 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b1 \<and> a21 * fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) + a22 * snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = b2
a11 * fst x' + a12 * snd x' = b1 \<and> a21 * fst x' + a22 * snd x' = b2

goal (1 subgoal):
 1. a11 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a12 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a) \<and> a21 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a22 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a)
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
a11 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a12 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a) \<and> a21 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a22 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a)

goal (1 subgoal):
 1. \<And>x. a11 * fst x + a12 * snd x = b1 \<and> a21 * fst x + a22 * snd x = b2 \<Longrightarrow> x = ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))
[PROOF STEP]
thus "x' = ?x"
[PROOF STATE]
proof (prove)
using this:
a11 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a12 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a) \<and> a21 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a22 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a)

goal (1 subgoal):
 1. x' = ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))
[PROOF STEP]
using regular_homogenous_system[OF assms, of "fst x' - fst ?x" "snd x' - snd ?x"]
[PROOF STATE]
proof (prove)
using this:
a11 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a12 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a) \<and> a21 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a22 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a)
\<lbrakk>a11 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a12 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a); a21 * (fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) + a22 * (snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))) = (0::'a)\<rbrakk> \<Longrightarrow> fst x' - fst ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = (0::'a) \<and> snd x' - snd ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21)) = (0::'a)

goal (1 subgoal):
 1. x' = ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))
[PROOF STEP]
by (cases x') auto
[PROOF STATE]
proof (state)
this:
x' = ((b1 * a22 - b2 * a12) / (a11 * a22 - a12 * a21), (b2 * a11 - b1 * a21) / (a11 * a22 - a12 * a21))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma contour_integrable_continuous_part_circlepath:
     "continuous_on (path_image (part_circlepath z r s t)) f
      \<Longrightarrow> f contour_integrable_on (part_circlepath z r s t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image (part_circlepath z r s t)) f \<Longrightarrow> f contour_integrable_on part_circlepath z r s t
[PROOF STEP]
unfolding contour_integrable_on has_contour_integral_def vector_derivative_part_circlepath path_image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (part_circlepath z r s t ` {0..1}) f \<Longrightarrow> (\<lambda>ta. f (part_circlepath z r s t ta) * (\<i> * complex_of_real r * (complex_of_real t - complex_of_real s) * exp (\<i> * complex_of_real (linepath s t ta)))) integrable_on {0..1}
[PROOF STEP]
apply (rule integrable_continuous_real)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (part_circlepath z r s t ` {0..1}) f \<Longrightarrow> continuous_on {0..1} (\<lambda>ta. f (part_circlepath z r s t ta) * (\<i> * complex_of_real r * (complex_of_real t - complex_of_real s) * exp (\<i> * complex_of_real (linepath s t ta))))
[PROOF STEP]
apply (fast intro: path_part_circlepath [unfolded path_def] continuous_intros continuous_on_compose2 [where g=f, OF _ _ order_refl])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma [simp]:
  assumes n: "dim_vec f = n"
  shows "bool_vec_from_simplice (ceros_of_boolean_input f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bool_vec_from_simplice (ceros_of_boolean_input f) = f
[PROOF STEP]
unfolding bool_vec_from_simplice_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>i. i \<notin> ceros_of_boolean_input f) = f
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>i. i \<notin> {x. x < dim_vec f \<and> f $ x = False}) = f
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
dim_vec f = n

goal (1 subgoal):
 1. vec n (\<lambda>i. i \<notin> {x. x < dim_vec f \<and> f $ x = False}) = f
[PROOF STEP]
by auto


[STATEMENT]
lemma pmf_K0 [simp]: "pmf (K0 d S0) (s,a) = pmf S0 s * pmf (d s) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (K\<^sub>0 d S0) (s, a) = pmf S0 s * pmf (d s) a
[PROOF STEP]
unfolding K0_iff pmf_bind
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation S0 (\<lambda>x. pmf (map_pmf (Pair x) (d x)) (s, a)) = pmf S0 s * pmf (d s) a
[PROOF STEP]
by (subst integral_measure_pmf[where A = "{s}"]) (auto simp: pmf_map pmf.rep_eq split: if_splits)


[STATEMENT]
lemma pochhammer_binomial_sum:
  fixes a b :: "'a::comm_ring_1"
  shows "pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))
[PROOF STEP]
proof (induction n arbitrary: a b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))
 2. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a b. pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))
 2. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
case (Suc n a b)
[PROOF STATE]
proof (state)
this:
pochhammer (?a + ?b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer ?a k * pochhammer ?b (n - k))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) =
      (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) +
      ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) +
      pochhammer b (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) + ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n))
[PROOF STEP]
by (subst sum.atMost_Suc_shift) (simp add: ring_distribs sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) + ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) + ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) =
      a * pochhammer ((a + 1) + b) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) = a * pochhammer (a + (1::'a) + b) n
[PROOF STEP]
by (subst Suc) (simp add: sum_distrib_left pochhammer_rec mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) = a * pochhammer (a + (1::'a) + b) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) = a * pochhammer (a + (1::'a) + b) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "(\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) +
        pochhammer b (Suc n) =
      (\<Sum>i=0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
apply (subst sum.atLeast_Suc_atMost, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = of_nat (n choose 0) * pochhammer a 0 * pochhammer b (Suc n - 0) + (\<Sum>i = Suc 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
apply (simp add: sum.shift_bounds_cl_Suc_ivl atLeast0AtMost del: sum.cl_ivl_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
pochhammer (?a + ?b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer ?a k * pochhammer ?b (n - k))

goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto simp: not_le binomial_eq_0)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))
[PROOF STEP]
by (intro sum.cong) (simp_all add: Suc_diff_le)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "\<dots> = b * pochhammer (a + (b + 1)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i))) = b * pochhammer (a + (b + (1::'a))) n
[PROOF STEP]
by (subst Suc) (simp add: sum_distrib_left mult_ac pochhammer_rec)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i))) = b * pochhammer (a + (b + (1::'a))) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i))) = b * pochhammer (a + (b + (1::'a))) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "a * pochhammer ((a + 1) + b) n + b * pochhammer (a + (b + 1)) n =
      pochhammer (a + b) (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * pochhammer (a + (1::'a) + b) n + b * pochhammer (a + (b + (1::'a))) n = pochhammer (a + b) (Suc n)
[PROOF STEP]
by (simp add: pochhammer_rec algebra_simps)
[PROOF STATE]
proof (state)
this:
a * pochhammer (a + (1::'a) + b) n + b * pochhammer (a + (b + (1::'a))) n = pochhammer (a + b) (Suc n)

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = pochhammer (a + b) (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = pochhammer (a + b) (Suc n)

goal (1 subgoal):
 1. pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_not_le_zero_ereal[simp]: "\<not> (1 \<le> (0::ereal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 1 \<le> 0
[PROOF STEP]
by (simp add: one_ereal_def zero_ereal_def)


[STATEMENT]
lemma bezout_coefficients_fst_snd:
  "fst (bezout_coefficients a b) * a + snd (bezout_coefficients a b) * b = gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (bezout_coefficients a b) * a + snd (bezout_coefficients a b) * b = gcd a b
[PROOF STEP]
by (rule bezout_coefficients) simp


[STATEMENT]
lemma pathfinish_linepath[simp]: "pathfinish (linepath a b) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathfinish (linepath a b) = b
[PROOF STEP]
unfolding pathfinish_def linepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - 1) *\<^sub>R a + 1 *\<^sub>R b = b
[PROOF STEP]
by auto


[STATEMENT]
lemma of_int_gbinomial: "of_int (a gchoose k) = (of_int a :: 'a::field_char_0) gchoose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (a gchoose k) = of_int a gchoose k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int (a gchoose k) = of_int a gchoose k
[PROOF STEP]
have of_int_div: "y dvd x \<Longrightarrow> of_int (x div y) = of_int x / (of_int y :: 'a)" for x y :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y dvd x \<Longrightarrow> of_int (x div y) = of_int x / of_int y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y dvd ?x \<Longrightarrow> of_int (?x div ?y) = of_int ?x / of_int ?y

goal (1 subgoal):
 1. of_int (a gchoose k) = of_int a gchoose k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (a gchoose k) = of_int a gchoose k
[PROOF STEP]
by (simp add: gbinomial_int_pochhammer' gbinomial_pochhammer' of_int_div fact_dvd_pochhammer
        pochhammer_of_int[symmetric])
[PROOF STATE]
proof (state)
this:
of_int (a gchoose k) = of_int a gchoose k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gbinomial_int_pochhammer': "a gchoose k = pochhammer (a - int k + 1) k div fact k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a gchoose k = pochhammer (a - int k + 1) k div fact k
[PROOF STEP]
by (simp only: gbinomial_prod_rev falling_fact_pochhammer')


[STATEMENT]
lemma ENR_translation:
  fixes S :: "'a::euclidean_space set"
  shows "ENR(image (\<lambda>x. a + x) S) \<longleftrightarrow> ENR S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ENR ((+) a ` S) = ENR S
[PROOF STEP]
by (meson homeomorphic_sym homeomorphic_translation homeomorphic_ENR_iff_ENR)


[STATEMENT]
lemma closure_inside_subset:
    fixes S :: "'a::real_normed_vector set"
    assumes "closed S"
      shows "closure(inside S) \<subseteq> S \<union> inside S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (inside S) \<subseteq> S \<union> inside S
[PROOF STEP]
by (metis assms closure_minimal open_closed open_outside sup.cobounded2 union_with_inside)


[STATEMENT]
lemma eqv_class_eq [simp]: "\<lfloor>a\<rfloor> = \<lfloor>b\<rfloor> \<longleftrightarrow> a \<sim> (b::'a::equiv)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>a\<rfloor> = \<lfloor>b\<rfloor>) = (a \<sim> b)
[PROOF STEP]
using eqv_class_eqI eqv_class_eqD
[PROOF STATE]
proof (prove)
using this:
?a \<sim> ?b \<Longrightarrow> \<lfloor>?a\<rfloor> = \<lfloor>?b\<rfloor>
\<lfloor>?a\<rfloor> = \<lfloor>?b\<rfloor> \<Longrightarrow> ?a \<sim> ?b

goal (1 subgoal):
 1. (\<lfloor>a\<rfloor> = \<lfloor>b\<rfloor>) = (a \<sim> b)
[PROOF STEP]
by blast


[STATEMENT]
lemma trans_S_point: "\<And> x y z. (x, y) \<in> S \<Longrightarrow> (y, z) \<in> S \<Longrightarrow> (x, z) \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> S; (y, z) \<in> S\<rbrakk> \<Longrightarrow> (x, z) \<in> S
[PROOF STEP]
using trans_S
[PROOF STATE]
proof (prove)
using this:
trans S

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> S; (y, z) \<in> S\<rbrakk> \<Longrightarrow> (x, z) \<in> S
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y z. (x, y) \<in> S \<longrightarrow> (y, z) \<in> S \<longrightarrow> (x, z) \<in> S

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> S; (y, z) \<in> S\<rbrakk> \<Longrightarrow> (x, z) \<in> S
[PROOF STEP]
by blast


[STATEMENT]
lemma null_space_orthogonal_complement_row_space:
  fixes A::"'a^'cols::{finite, wellorder}^'rows::{finite, wellorder}"
  shows "null_space A = COLS.v.orthogonal_complement (row_space (\<chi> i j. cnj (A $ i $ j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. null_space A = COLS.v.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. null_space A = COLS.v.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))
[PROOF STEP]
interpret m: matrix inner_rows inner_cols
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Generalizations2.matrix inner_rows inner_cols
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. null_space A = COLS.v.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))
[PROOF STEP]
let ?A="(\<chi> i j. cnj (A $ i $ j))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. null_space A = COLS.v.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. null_space A = COLS.v.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))
[PROOF STEP]
proof (unfold null_space_def COLS.v.orthogonal_complement_def, auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>A *v x = 0; y \<in> row_space (\<chi>i j. cnj_class.cnj (A $ i $ j))\<rbrakk> \<Longrightarrow> COLS.v.orthogonal y x
 2. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
fix x xa
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>A *v x = 0; y \<in> row_space (\<chi>i j. cnj_class.cnj (A $ i $ j))\<rbrakk> \<Longrightarrow> COLS.v.orthogonal y x
 2. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
assume Ax: "A *v x = 0" and xa: "xa \<in> row_space (\<chi> i j. cnj (A $ i $ j))"
[PROOF STATE]
proof (state)
this:
A *v x = 0
xa \<in> row_space (\<chi>i j. cnj_class.cnj (A $ i $ j))

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>A *v x = 0; y \<in> row_space (\<chi>i j. cnj_class.cnj (A $ i $ j))\<rbrakk> \<Longrightarrow> COLS.v.orthogonal y x
 2. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
obtain y where y: "xa = transpose (\<chi> i j. cnj (A $ i $ j)) *v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. xa = Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using xa
[PROOF STATE]
proof (prove)
using this:
xa \<in> row_space (\<chi>i j. cnj_class.cnj (A $ i $ j))

goal (1 subgoal):
 1. (\<And>y. xa = Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding row_space_eq
[PROOF STATE]
proof (prove)
using this:
xa \<in> {w. \<exists>y. Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y = w}

goal (1 subgoal):
 1. (\<And>y. xa = Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
xa = Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>A *v x = 0; y \<in> row_space (\<chi>i j. cnj_class.cnj (A $ i $ j))\<rbrakk> \<Longrightarrow> COLS.v.orthogonal y x
 2. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
have y2: "y v* (\<chi> i j. cnj (A $ i $ j)) = xa"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y v* (\<chi>i j. cnj_class.cnj (A $ i $ j)) = xa
[PROOF STEP]
using transpose_vector y
[PROOF STATE]
proof (prove)
using this:
?x v* ?A = Finite_Cartesian_Product.transpose ?A *v ?x
xa = Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y

goal (1 subgoal):
 1. y v* (\<chi>i j. cnj_class.cnj (A $ i $ j)) = xa
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
y v* (\<chi>i j. cnj_class.cnj (A $ i $ j)) = xa

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>A *v x = 0; y \<in> row_space (\<chi>i j. cnj_class.cnj (A $ i $ j))\<rbrakk> \<Longrightarrow> COLS.v.orthogonal y x
 2. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
show "COLS.v.orthogonal xa x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. COLS.v.orthogonal xa x
[PROOF STEP]
using m.dot_lmul_matrix[of y ?A x]
[PROOF STATE]
proof (prove)
using this:
inner_cols (y v* (\<chi>i j. cnj_class.cnj (A $ i $ j))) x = inner_rows y ((\<chi>i j. cnj_class.cnj ((\<chi>i j. cnj_class.cnj (A $ i $ j)) $ i $ j)) *v x)

goal (1 subgoal):
 1. COLS.v.orthogonal xa x
[PROOF STEP]
unfolding cnj_cnj_matrix Ax ROWS.v.inner_zero_right
[PROOF STATE]
proof (prove)
using this:
inner_cols (y v* (\<chi>i j. cnj_class.cnj (A $ i $ j))) x = (0::'a)

goal (1 subgoal):
 1. COLS.v.orthogonal xa x
[PROOF STEP]
unfolding y2
[PROOF STATE]
proof (prove)
using this:
inner_cols xa x = (0::'a)

goal (1 subgoal):
 1. COLS.v.orthogonal xa x
[PROOF STEP]
unfolding COLS.v.orthogonal_def
[PROOF STATE]
proof (prove)
using this:
inner_cols xa x = (0::'a)

goal (1 subgoal):
 1. inner_cols xa x = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
COLS.v.orthogonal xa x

goal (1 subgoal):
 1. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
assume xa: "\<forall>xa\<in>row_space (\<chi> i j. cnj (A $ i $ j)). COLS.v.orthogonal xa x"
[PROOF STATE]
proof (state)
this:
\<forall>xa\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal xa x

goal (1 subgoal):
 1. \<And>x. \<forall>y\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal y x \<Longrightarrow> A *v x = 0
[PROOF STEP]
show "A *v x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
using xa
[PROOF STATE]
proof (prove)
using this:
\<forall>xa\<in>row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)). COLS.v.orthogonal xa x

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
unfolding row_space_eq COLS.v.orthogonal_def
[PROOF STATE]
proof (prove)
using this:
\<forall>xa\<in>{w. \<exists>y. Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y = w}. inner_cols xa x = (0::'a)

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
using COLS.v.inner_eq_zero_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>xa\<in>{w. \<exists>y. Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y = w}. inner_cols xa x = (0::'a)
(inner_cols ?x ?x = (0::'a)) = (?x = 0)

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
using m.dot_lmul_matrix[of _ ?A]
[PROOF STATE]
proof (prove)
using this:
\<forall>xa\<in>{w. \<exists>y. Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y = w}. inner_cols xa x = (0::'a)
(inner_cols ?x ?x = (0::'a)) = (?x = 0)
inner_cols (?x v* (\<chi>i j. cnj_class.cnj (A $ i $ j))) ?y = inner_rows ?x ((\<chi>i j. cnj_class.cnj ((\<chi>i j. cnj_class.cnj (A $ i $ j)) $ i $ j)) *v ?y)

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
unfolding transpose_vector
[PROOF STATE]
proof (prove)
using this:
\<forall>xa\<in>{w. \<exists>y. Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v y = w}. inner_cols xa x = (0::'a)
(inner_cols ?x ?x = (0::'a)) = (?x = 0)
inner_cols (Finite_Cartesian_Product.transpose (\<chi>i j. cnj_class.cnj (A $ i $ j)) *v ?x) ?y = inner_rows ?x ((\<chi>i j. cnj_class.cnj ((\<chi>i j. cnj_class.cnj (A $ i $ j)) $ i $ j)) *v ?y)

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
by auto
       (metis ROWS.i4 m.cnj_cnj_matrix m.dot_lmul_matrix transpose_vector)
[PROOF STATE]
proof (state)
this:
A *v x = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
null_space A = COLS.v.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_sum_of_squares_unique:
  fixes p :: nat
  assumes "prime p" "p = 2 \<or> [p = 1] (mod 4)"
  shows   "\<exists>!(x,y). x \<le> y \<and> x ^ 2 + y ^ 2 = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
p = 2 \<or> [p = 1] (mod 4)

goal (1 subgoal):
 1. \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 2 \<Longrightarrow> \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
 2. [p = 1] (mod 4) \<Longrightarrow> \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
assume [simp]: "p = 2"
[PROOF STATE]
proof (state)
this:
p = 2

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
 2. [p = 1] (mod 4) \<Longrightarrow> \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
have **: "(\<lambda>(x,y). x \<le> y \<and> x ^ 2 + y ^ 2 = p) = (\<lambda>z. z = (1,1 :: nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p) = (\<lambda>z. z = (1, 1))
[PROOF STEP]
using two_sum_of_squares_nat_iff
[PROOF STATE]
proof (prove)
using this:
(?x\<^sup>2 + ?y\<^sup>2 = 2) = (?x = 1 \<and> ?y = 1)

goal (1 subgoal):
 1. (\<lambda>(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p) = (\<lambda>z. z = (1, 1))
[PROOF STEP]
by (auto simp: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p) = (\<lambda>z. z = (1, 1))

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
 2. [p = 1] (mod 4) \<Longrightarrow> \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p) = (\<lambda>z. z = (1, 1))

goal (1 subgoal):
 1. \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
by (subst **) auto
[PROOF STATE]
proof (state)
this:
\<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p

goal (1 subgoal):
 1. [p = 1] (mod 4) \<Longrightarrow> \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
qed (use prime_1_mod_4_sum_of_squares_unique[of p] assms in auto)


[STATEMENT]
lemma STAR_exp_Infinitesimal:
  assumes "x \<in> Infinitesimal" shows "( *f* exp) (x::hypreal) \<approx> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*f* exp) x \<approx> 1
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (*f* exp) x \<approx> 1
 2. x \<noteq> 0 \<Longrightarrow> (*f* exp) x \<approx> 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (*f* exp) x \<approx> 1
 2. x \<noteq> 0 \<Longrightarrow> (*f* exp) x \<approx> 1
[PROOF STEP]
have "NSDERIV exp 0 :> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSDERIV exp (0::'a) :> (1::'a)
[PROOF STEP]
by (metis DERIV_exp NSDERIV_DERIV_iff exp_zero)
[PROOF STATE]
proof (state)
this:
NSDERIV exp (0::?'a1) :> (1::?'a1)

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (*f* exp) x \<approx> 1
 2. x \<noteq> 0 \<Longrightarrow> (*f* exp) x \<approx> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
NSDERIV exp (0::?'a1) :> (1::?'a1)
[PROOF STEP]
have "((*f* exp) x - 1) / x \<approx> 1"
[PROOF STATE]
proof (prove)
using this:
NSDERIV exp (0::?'a1) :> (1::?'a1)

goal (1 subgoal):
 1. ((*f* exp) x - 1) / x \<approx> 1
[PROOF STEP]
using nsderiv_def False NSDERIVD2 assms
[PROOF STATE]
proof (prove)
using this:
NSDERIV exp (0::?'a1) :> (1::?'a1)
NSDERIV ?f ?x :> ?D = (\<forall>h\<in>Infinitesimal - {0}. ((*f* ?f) (star_of ?x + h) - star_of (?f ?x)) / h \<approx> star_of ?D)
x \<noteq> 0
\<lbrakk>NSDERIV ?g ?x :> ?Db; ?y \<in> Infinitesimal; ?y \<noteq> 0\<rbrakk> \<Longrightarrow> ((*f* ?g) (star_of ?x + ?y) - star_of (?g ?x)) / ?y \<approx> star_of ?Db
x \<in> Infinitesimal

goal (1 subgoal):
 1. ((*f* exp) x - 1) / x \<approx> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
((*f* exp) x - 1) / x \<approx> 1

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (*f* exp) x \<approx> 1
 2. x \<noteq> 0 \<Longrightarrow> (*f* exp) x \<approx> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((*f* exp) x - 1) / x \<approx> 1
[PROOF STEP]
have "(*f* exp) x - 1 \<approx> x"
[PROOF STATE]
proof (prove)
using this:
((*f* exp) x - 1) / x \<approx> 1

goal (1 subgoal):
 1. (*f* exp) x - 1 \<approx> x
[PROOF STEP]
using NSDERIVD4 \<open>NSDERIV exp 0 :> 1\<close> assms
[PROOF STATE]
proof (prove)
using this:
((*f* exp) x - 1) / x \<approx> 1
\<lbrakk>NSDERIV ?f ?x :> ?D; ?h \<in> Infinitesimal\<rbrakk> \<Longrightarrow> (*f* ?f) (hypreal_of_real ?x + ?h) - hypreal_of_real (?f ?x) \<approx> hypreal_of_real ?D * ?h
NSDERIV exp (0::?'a) :> (1::?'a)
x \<in> Infinitesimal

goal (1 subgoal):
 1. (*f* exp) x - 1 \<approx> x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(*f* exp) x - 1 \<approx> x

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (*f* exp) x \<approx> 1
 2. x \<noteq> 0 \<Longrightarrow> (*f* exp) x \<approx> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(*f* exp) x - 1 \<approx> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(*f* exp) x - 1 \<approx> x

goal (1 subgoal):
 1. (*f* exp) x \<approx> 1
[PROOF STEP]
by (meson Infinitesimal_approx approx_minus_iff approx_trans2 assms not_Infinitesimal_not_zero)
[PROOF STATE]
proof (state)
this:
(*f* exp) x \<approx> 1

goal (1 subgoal):
 1. x = 0 \<Longrightarrow> (*f* exp) x \<approx> 1
[PROOF STEP]
qed auto


[STATEMENT]
lemma norm_zero [simp]: "norm (0::'a) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (0::'a) = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma pos_oriented_cmat_mult_positive:
  assumes
    "hermitean H1 \<and> H1 \<noteq> mat_zero" and
    "hermitean H2 \<and> H2 \<noteq> mat_zero" and
    "\<exists>k. k > 0 \<and> H2 = cor k *\<^sub>s\<^sub>m H1"
  shows
    "pos_oriented_cmat H1 \<longleftrightarrow> pos_oriented_cmat H2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_oriented_cmat H1 = pos_oriented_cmat H2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pos_oriented_cmat H1 = pos_oriented_cmat H2
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
\<exists>k>0. H2 = cor k *\<^sub>s\<^sub>m H1
[PROOF STEP]
obtain k where "k > 0 \<and> H2 = cor k *\<^sub>s\<^sub>m H1"
[PROOF STATE]
proof (prove)
using this:
\<exists>k>0. H2 = cor k *\<^sub>s\<^sub>m H1

goal (1 subgoal):
 1. (\<And>k. 0 < k \<and> H2 = cor k *\<^sub>s\<^sub>m H1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < k \<and> H2 = cor k *\<^sub>s\<^sub>m H1

goal (1 subgoal):
 1. pos_oriented_cmat H1 = pos_oriented_cmat H2
[PROOF STEP]
hence "\<exists>k. k > 0 \<and> H1 = cor k *\<^sub>s\<^sub>m H2"
[PROOF STATE]
proof (prove)
using this:
0 < k \<and> H2 = cor k *\<^sub>s\<^sub>m H1

goal (1 subgoal):
 1. \<exists>k>0. H1 = cor k *\<^sub>s\<^sub>m H2
[PROOF STEP]
by (rule_tac x="1/k" in exI, auto)
[PROOF STATE]
proof (state)
this:
\<exists>k>0. H1 = cor k *\<^sub>s\<^sub>m H2

goal (1 subgoal):
 1. pos_oriented_cmat H1 = pos_oriented_cmat H2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>k>0. H1 = cor k *\<^sub>s\<^sub>m H2

goal (1 subgoal):
 1. pos_oriented_cmat H1 = pos_oriented_cmat H2
[PROOF STEP]
using assms pos_oriented_cmat_mult_positive'
[PROOF STATE]
proof (prove)
using this:
\<exists>k>0. H1 = cor k *\<^sub>s\<^sub>m H2
hermitean H1 \<and> H1 \<noteq> mat_zero
hermitean H2 \<and> H2 \<noteq> mat_zero
\<exists>k>0. H2 = cor k *\<^sub>s\<^sub>m H1
\<lbrakk>hermitean ?H1.0 \<and> ?H1.0 \<noteq> mat_zero; hermitean ?H2.0 \<and> ?H2.0 \<noteq> mat_zero; \<exists>k>0. ?H2.0 = cor k *\<^sub>s\<^sub>m ?H1.0; pos_oriented_cmat ?H1.0\<rbrakk> \<Longrightarrow> pos_oriented_cmat ?H2.0

goal (1 subgoal):
 1. pos_oriented_cmat H1 = pos_oriented_cmat H2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pos_oriented_cmat H1 = pos_oriented_cmat H2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_replicate_conv: "(\<forall>i<length xs. xs ! i = m) = (xs = m\<^bsup>length xs\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i<length xs. xs ! i = m) = (xs = m\<^bsup>length xs\<^esup>)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>i<length xs. xs ! i = m \<Longrightarrow> xs = m\<^bsup>length xs\<^esup>
 2. xs = m\<^bsup>length xs\<^esup> \<Longrightarrow> \<forall>i<length xs. xs ! i = m
[PROOF STEP]
apply (simp add: expand_list_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = m\<^bsup>length xs\<^esup> \<Longrightarrow> \<forall>i<length xs. xs ! i = m
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>xs = m\<^bsup>length xs\<^esup>; i < length xs\<rbrakk> \<Longrightarrow> xs ! i = m
[PROOF STEP]
apply (rule ssubst[of xs "replicate (length xs) m"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>xs = m\<^bsup>length xs\<^esup>; i < length xs\<rbrakk> \<Longrightarrow> m\<^bsup>length xs\<^esup> ! i = m
[PROOF STEP]
apply (rule nth_replicate, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done