[STATEMENT]
lemma interior_surjective_linear_image:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'a::euclidean_space"
  assumes "linear f" "surj f"
   shows "interior(f ` S) = f ` (interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (f ` S) = f ` interior S
[PROOF STEP]
by (simp add: assms interior_injective_linear_image linear_surjective_imp_injective)


[STATEMENT]
lemma DeMoivre2: "(rcis r a) ^ n = rcis (r ^ n) (real n * a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis r a ^ n = rcis (r ^ n) (real n * a)
[PROOF STEP]
by (simp add: rcis_def power_mult_distrib DeMoivre)


[STATEMENT]
lemma (in prob_space) exponential_distributed_iff:
  assumes "0 < l"
  shows "distributed M lborel X (exponential_density l) \<longleftrightarrow>
    (X \<in> borel_measurable M \<and> (\<forall>a\<ge>0. \<P>(x in M. X x \<le> a) = 1 - exp (- a * l)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distributed M lborel X (\<lambda>x. ennreal (exponential_density l x)) = (random_variable borel X \<and> (\<forall>a\<ge>0. prob {x \<in> space M. X x \<le> a} = 1 - exp (- a * l)))
[PROOF STEP]
using assms erlang_distributed_iff[of l X 0]
[PROOF STATE]
proof (prove)
using this:
0 < l
0 < l \<Longrightarrow> distributed M lborel X (\<lambda>x. ennreal (exponential_density l x)) = (random_variable borel X \<and> 0 < l \<and> (\<forall>a\<ge>0. prob {x \<in> space M. X x \<le> a} = erlang_CDF 0 l a))

goal (1 subgoal):
 1. distributed M lborel X (\<lambda>x. ennreal (exponential_density l x)) = (random_variable borel X \<and> (\<forall>a\<ge>0. prob {x \<in> space M. X x \<le> a} = 1 - exp (- a * l)))
[PROOF STEP]
by (auto simp: erlang_CDF_0)


[STATEMENT]
lemma ord0_leI:
"\<lbrakk>\<forall>a::ord0. a < x \<longrightarrow> a < y\<rbrakk> \<Longrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a<x. a < y \<Longrightarrow> x \<le> y
[PROOF STEP]
apply (unfold ord0_less_def ord0_le_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. (a, x) \<in> ord0_leq O ord0_prec\<^sup>+ \<longrightarrow> (a, y) \<in> ord0_leq O ord0_prec\<^sup>+ \<Longrightarrow> (x, y) \<in> ord0_leq
[PROOF STEP]
apply (rule ord0_leqI[rule_format])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>\<forall>a. (a, x) \<in> ord0_leq O ord0_prec\<^sup>+ \<longrightarrow> (a, y) \<in> ord0_leq O ord0_prec\<^sup>+; (a, x) \<in> ord0_prec\<^sup>+\<rbrakk> \<Longrightarrow> (a, y) \<in> ord0_leq O ord0_prec\<^sup>+
[PROOF STEP]
apply (drule spec, erule mp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. (a, x) \<in> ord0_prec\<^sup>+ \<Longrightarrow> (a, x) \<in> ord0_leq O ord0_prec\<^sup>+
[PROOF STEP]
apply (erule relcompI[OF ord0_leq_refl])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma totient_prime:
  assumes "prime p"
  shows   "totient p = p - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient p = p - 1
[PROOF STEP]
using totient_prime_power_Suc[of p 0] assms
[PROOF STATE]
proof (prove)
using this:
prime p \<Longrightarrow> totient (p ^ Suc 0) = p ^ 0 * (p - 1)
prime p

goal (1 subgoal):
 1. totient p = p - 1
[PROOF STEP]
by simp


[STATEMENT]
lemma integral_cnj: "cnj (integral A f) = integral A (\<lambda>x. cnj (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (integral A f) = integral A (\<lambda>x. cnj (f x))
[PROOF STEP]
by (cases "f integrable_on A")
     (simp_all add: integral_linear[OF _ bounded_linear_cnj, symmetric]
                    o_def integrable_on_cnj_iff not_integrable_integral)


[STATEMENT]
lemma Qp_nat_pow_pow:
  fixes n::nat
  fixes m::nat
  assumes "a \<in> carrier Q\<^sub>p"
  shows "(a[^](n*m)) = ((a[^]n)[^]m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] (n * m) = (a [^] n) [^] m
[PROOF STEP]
by (simp add: Qp.nat_pow_pow assms)


[STATEMENT]
lemma cofinite_card:
  shows "card {f. CK_nf_pos (f::nat cofinite set \<Rightarrow> nat cofinite set)} = 5"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {f. CK_nf_pos f} = 5
[PROOF STEP]
by (rule extremally_disconnected_not_part_not_ed_ou_card[OF cofinite_extremally_disconnected cofinite_not_part cofinite_not_ed_ou])


[STATEMENT]
lemma complex_is_Real_iff: "z \<in> \<real> \<longleftrightarrow> Im z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> \<real>) = (Im z = 0)
[PROOF STEP]
by (auto simp: Reals_def complex_eq_iff)


[STATEMENT]
lemma cos_pi_eq_zero [simp]: "cos (pi * real (Suc (2 * m)) / 2) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (pi * real (Suc (2 * m)) / 2) = 0
[PROOF STEP]
by (simp only: cos_add sin_add of_nat_Suc distrib_right distrib_left add_divide_distrib, auto)


[STATEMENT]
lemma homeomorphism_on_bij:
  assumes "homeomorphism_on S f"
  shows "bij_betw f S (f`S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f S (f ` S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
homeomorphism_on S f

goal (1 subgoal):
 1. bij_betw f S (f ` S)
[PROOF STEP]
unfolding homeomorphism_on_def homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
\<exists>g. (\<forall>x\<in>S. g (f x) = x) \<and> f ` S = f ` S \<and> continuous_on S f \<and> (\<forall>y\<in>f ` S. f (g y) = y) \<and> g ` f ` S = S \<and> continuous_on (f ` S) g

goal (1 subgoal):
 1. bij_betw f S (f ` S)
[PROOF STEP]
by auto (metis inj_on_def inj_on_imp_bij_betw)


[STATEMENT]
theorem catalan_closed_form:
  "catalan n = ((2*n) choose n) div Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. catalan n = (2 * n choose n) div Suc n
[PROOF STEP]
by (subst catalan_closed_form_aux [symmetric]) (simp del: mult_Suc_right)


[STATEMENT]
lemma word_mod_div_equality: "(n div b) * b + (n mod b) = n"
  for n b :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n div b * b + n mod b = n
[PROOF STEP]
by (fact div_mult_mod_eq)


[STATEMENT]
lemma ell2_norm_finite_L2_set: "ell2_norm (x::'a::finite\<Rightarrow>complex) = L2_set (norm o x) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ell2_norm x = L2_set (cmod \<circ> x) UNIV
[PROOF STEP]
by (simp add: ell2_norm_finite L2_set_def)


[STATEMENT]
lemma fin_dim_span_cols:
assumes "A \<in> carrier_mat n nc"
shows "vectorspace.fin_dim class_ring (vs (span (set (cols A))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.fin_dim class_ring (vs (local.span (set (cols A))))
[PROOF STEP]
using fin_dim_span cols_dim List.finite_set assms carrier_matD(1) module_vec_simps(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<subseteq> carrier V\<rbrakk> \<Longrightarrow> vectorspace.fin_dim class_ring (vs (local.span ?A))
set (cols ?A) \<subseteq> carrier_vec (dim_row ?A)
finite (set ?xs)
A \<in> carrier_mat n nc
?A \<in> carrier_mat ?nr ?nc \<Longrightarrow> dim_row ?A = ?nr
carrier (module_vec ?ty ?n) = carrier_vec ?n

goal (1 subgoal):
 1. vectorspace.fin_dim class_ring (vs (local.span (set (cols A))))
[PROOF STEP]
by force


[STATEMENT]
theorem time_vebt_delete:   fixes t defines "u \<equiv> 2^n"
  shows "invar_vebt t n \<Longrightarrow> T\<^sub>d\<^sub>e\<^sub>l\<^sub>e\<^sub>t\<^sub>e  t x \<le> 140 + 70 * lb (lb u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n \<Longrightarrow> real (T\<^sub>d\<^sub>e\<^sub>l\<^sub>e\<^sub>t\<^sub>e t x) \<le> 140 + 70 * log 2 (log 2 u)
[PROOF STEP]
unfolding u_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n \<Longrightarrow> real (T\<^sub>d\<^sub>e\<^sub>l\<^sub>e\<^sub>t\<^sub>e t x) \<le> 140 + 70 * log 2 (log 2 (2 ^ n))
[PROOF STEP]
by (meson delete_bound_size_univ)


[STATEMENT]
lemma suminf_zero[simp]: "suminf (\<lambda>n. 0::'a::{t2_space, comm_monoid_add}) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (0::'a)) = (0::'a)
[PROOF STEP]
by (rule sums_zero [THEN sums_unique, symmetric])


[STATEMENT]
lemma division_points_finite:
  fixes i :: "'a::euclidean_space set"
  assumes "d division_of i"
  shows "finite (division_points i d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (division_points i d)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (division_points i d)
[PROOF STEP]
note assm = division_ofD[OF assms]
[PROOF STATE]
proof (state)
this:
finite d
?K \<in> d \<Longrightarrow> ?K \<subseteq> i
?K \<in> d \<Longrightarrow> ?K \<noteq> {}
?K \<in> d \<Longrightarrow> \<exists>a b. ?K = cbox a b
\<lbrakk>?K1.0 \<in> d; ?K2.0 \<in> d; ?K1.0 \<noteq> ?K2.0\<rbrakk> \<Longrightarrow> interior ?K1.0 \<inter> interior ?K2.0 = {}
\<Union> d = i

goal (1 subgoal):
 1. finite (division_points i d)
[PROOF STEP]
let ?M = "\<lambda>j. {(j,x)|x. (interval_lowerbound i)\<bullet>j < x \<and> x < (interval_upperbound i)\<bullet>j \<and>
    (\<exists>i\<in>d. (interval_lowerbound i)\<bullet>j = x \<or> (interval_upperbound i)\<bullet>j = x)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (division_points i d)
[PROOF STEP]
have *: "division_points i d = \<Union>(?M ` Basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. division_points i d = (\<Union>j\<in>Basis. {(j, x) |x. interval_lowerbound i \<bullet> j < x \<and> x < interval_upperbound i \<bullet> j \<and> (\<exists>i\<in>d. interval_lowerbound i \<bullet> j = x \<or> interval_upperbound i \<bullet> j = x)})
[PROOF STEP]
unfolding division_points_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(j, x). j \<in> Basis \<and> interval_lowerbound i \<bullet> j < x \<and> x < interval_upperbound i \<bullet> j \<and> (\<exists>i\<in>d. interval_lowerbound i \<bullet> j = x \<or> interval_upperbound i \<bullet> j = x)} = (\<Union>j\<in>Basis. {(j, x) |x. interval_lowerbound i \<bullet> j < x \<and> x < interval_upperbound i \<bullet> j \<and> (\<exists>i\<in>d. interval_lowerbound i \<bullet> j = x \<or> interval_upperbound i \<bullet> j = x)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
division_points i d = (\<Union>j\<in>Basis. {(j, x) |x. interval_lowerbound i \<bullet> j < x \<and> x < interval_upperbound i \<bullet> j \<and> (\<exists>i\<in>d. interval_lowerbound i \<bullet> j = x \<or> interval_upperbound i \<bullet> j = x)})

goal (1 subgoal):
 1. finite (division_points i d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (division_points i d)
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union>j\<in>Basis. {(j, x) |x. interval_lowerbound i \<bullet> j < x \<and> x < interval_upperbound i \<bullet> j \<and> (\<exists>i\<in>d. interval_lowerbound i \<bullet> j = x \<or> interval_upperbound i \<bullet> j = x)})
[PROOF STEP]
using assm
[PROOF STATE]
proof (prove)
using this:
finite d
?K \<in> d \<Longrightarrow> ?K \<subseteq> i
?K \<in> d \<Longrightarrow> ?K \<noteq> {}
?K \<in> d \<Longrightarrow> \<exists>a b. ?K = cbox a b
\<lbrakk>?K1.0 \<in> d; ?K2.0 \<in> d; ?K1.0 \<noteq> ?K2.0\<rbrakk> \<Longrightarrow> interior ?K1.0 \<inter> interior ?K2.0 = {}
\<Union> d = i

goal (1 subgoal):
 1. finite (\<Union>j\<in>Basis. {(j, x) |x. interval_lowerbound i \<bullet> j < x \<and> x < interval_upperbound i \<bullet> j \<and> (\<exists>i\<in>d. interval_lowerbound i \<bullet> j = x \<or> interval_upperbound i \<bullet> j = x)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (division_points i d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma omega_sum_less_eqlen_iff_cases [simp]:
  assumes "length ms = length ns"
   shows "omega_sum (m#ms) < omega_sum (n#ns)
          \<longleftrightarrow> m<n \<or> m=n \<and> omega_sum ms < omega_sum ns"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (omega_sum (m # ms) < omega_sum (n # ns)) = (m < n \<or> m = n \<and> omega_sum ms < omega_sum ns)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. omega_sum (m # ms) < omega_sum (n # ns) \<Longrightarrow> m < n \<or> m = n \<and> omega_sum ms < omega_sum ns
 2. m < n \<or> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
omega_sum (m # ms) < omega_sum (n # ns)

goal (2 subgoals):
 1. omega_sum (m # ms) < omega_sum (n # ns) \<Longrightarrow> m < n \<or> m = n \<and> omega_sum ms < omega_sum ns
 2. m < n \<or> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
have "\<not> Suc n < Suc m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Suc n < Suc m
[PROOF STEP]
using omega_sum_less [of ms] omega_sum_less [of ns] L assms mult_nat_less_add_less
[PROOF STATE]
proof (prove)
using this:
omega_sum ms < \<omega> \<up> ord_of_nat (length ms)
omega_sum ns < \<omega> \<up> ord_of_nat (length ns)
omega_sum (m # ms) < omega_sum (n # ns)
length ms = length ns
\<lbrakk>?m < ?n; ?\<alpha> < ?\<gamma>; ?\<beta> < ?\<gamma>; Ord ?\<alpha>; Ord ?\<beta>; Ord ?\<gamma>\<rbrakk> \<Longrightarrow> ?\<gamma> * ord_of_nat ?m + ?\<alpha> < ?\<gamma> * ord_of_nat ?n + ?\<beta>

goal (1 subgoal):
 1. \<not> Suc n < Suc m
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<not> Suc n < Suc m

goal (2 subgoals):
 1. omega_sum (m # ms) < omega_sum (n # ns) \<Longrightarrow> m < n \<or> m = n \<and> omega_sum ms < omega_sum ns
 2. m < n \<or> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
with L assms
[PROOF STATE]
proof (chain)
picking this:
omega_sum (m # ms) < omega_sum (n # ns)
length ms = length ns
\<not> Suc n < Suc m
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
omega_sum (m # ms) < omega_sum (n # ns)
length ms = length ns
\<not> Suc n < Suc m

goal (1 subgoal):
 1. m < n \<or> m = n \<and> omega_sum ms < omega_sum ns
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m < n \<or> m = n \<and> omega_sum ms < omega_sum ns

goal (1 subgoal):
 1. m < n \<or> m = n \<and> omega_sum ms < omega_sum ns \<Longrightarrow> omega_sum (m # ms) < omega_sum (n # ns)
[PROOF STEP]
qed (auto simp: mult_nat_less_add_less omega_sum_aux_less assms)


[STATEMENT]
lemma length_comb [simp]:  "length (mt_of ((f1 \<box> f2) sttp)) =
  length (mt_of (f1 sttp)) + length (mt_of (f2 (sttp_of (f1 sttp))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (fst ((f1 \<box> f2) sttp)) = length (fst (f1 sttp)) + length (fst (f2 (snd (f1 sttp))))
[PROOF STEP]
by (simp add: comb_def split_beta)


[STATEMENT]
lemma (in vectorspace) mult_inverse:
  assumes h1: "a\<in>carrier K" and h2: "v\<in>carrier V" and h3: "a \<odot>\<^bsub>V\<^esub> v = w" and h4: "a\<noteq>\<zero>\<^bsub>K\<^esub>"
  shows "v = (inv\<^bsub>K\<^esub> a )\<odot>\<^bsub>V\<^esub> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
from h1 h2 h3
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier K
v \<in> carrier V
a \<odot>\<^bsub>V\<^esub> v = w
[PROOF STEP]
have 1: "w\<in>carrier V"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier K
v \<in> carrier V
a \<odot>\<^bsub>V\<^esub> v = w

goal (1 subgoal):
 1. w \<in> carrier V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> carrier V

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
from h3 1
[PROOF STATE]
proof (chain)
picking this:
a \<odot>\<^bsub>V\<^esub> v = w
w \<in> carrier V
[PROOF STEP]
have 2: "(inv\<^bsub>K\<^esub> a )\<odot>\<^bsub>V\<^esub>(a \<odot>\<^bsub>V\<^esub> v) =(inv\<^bsub>K\<^esub> a )\<odot>\<^bsub>V\<^esub>w"
[PROOF STATE]
proof (prove)
using this:
a \<odot>\<^bsub>V\<^esub> v = w
w \<in> carrier V

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
from h1 h4
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier K
a \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
have 3: "inv\<^bsub>K\<^esub> a\<in>carrier K"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier K
a \<noteq> \<zero>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<in> carrier K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>K\<^esub> a \<in> carrier K

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
interpret g: group "(units_group K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (units_group K)
[PROOF STEP]
by (rule units_form_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
have f: "field K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field K
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
field K

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
from f h1 h4
[PROOF STATE]
proof (chain)
picking this:
field K
a \<in> carrier K
a \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
have 4: "a\<in>Units K"
[PROOF STATE]
proof (prove)
using this:
field K
a \<in> carrier K
a \<noteq> \<zero>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. a \<in> Units K
[PROOF STEP]
by (unfold field_def field_axioms_def, simp)
[PROOF STATE]
proof (state)
this:
a \<in> Units K

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
from 4 h1 h4
[PROOF STATE]
proof (chain)
picking this:
a \<in> Units K
a \<in> carrier K
a \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
have 5: "((inv\<^bsub>K\<^esub> a) \<otimes>\<^bsub>K\<^esub>a) = \<one>\<^bsub>K\<^esub>"
[PROOF STATE]
proof (prove)
using this:
a \<in> Units K
a \<in> carrier K
a \<noteq> \<zero>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub>
[PROOF STEP]
by (intro Units_l_inv, auto)
[PROOF STATE]
proof (state)
this:
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
from 5
[PROOF STATE]
proof (chain)
picking this:
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub>
[PROOF STEP]
have 6: "(inv\<^bsub>K\<^esub> a )\<odot>\<^bsub>V\<^esub>(a \<odot>\<^bsub>V\<^esub> v) = v"
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub> \<Longrightarrow> inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v
[PROOF STEP]
from h1 h2 h4
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier K
v \<in> carrier V
a \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
have 7: "(inv\<^bsub>K\<^esub> a )\<odot>\<^bsub>V\<^esub>(a \<odot>\<^bsub>V\<^esub> v) =(inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub>a) \<odot>\<^bsub>V\<^esub> v"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier K
v \<in> carrier V
a \<noteq> \<zero>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v
[PROOF STEP]
by (auto simp add: smult_assoc1)
[PROOF STATE]
proof (state)
this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub> \<Longrightarrow> inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v
[PROOF STEP]
from 5 h2
[PROOF STATE]
proof (chain)
picking this:
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub>
v \<in> carrier V
[PROOF STEP]
have 8: "(inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub>a) \<odot>\<^bsub>V\<^esub> v = v"
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub>
v \<in> carrier V

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v = v

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a = \<one>\<^bsub>K\<^esub> \<Longrightarrow> inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v
[PROOF STEP]
from 7 8
[PROOF STATE]
proof (chain)
picking this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v = v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v
inv\<^bsub>K\<^esub> a \<otimes>\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> v = v

goal (1 subgoal):
 1. inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
from 2 6
[PROOF STATE]
proof (chain)
picking this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> (a \<odot>\<^bsub>V\<^esub> v) = v

goal (1 subgoal):
 1. v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = inv\<^bsub>K\<^esub> a \<odot>\<^bsub>V\<^esub> w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_at_right_linorder:\<comment> \<open>TODO: generalize @{thm eventually_at_right_real}\<close>
  "a > (b :: 'a :: linorder_topology) \<Longrightarrow> eventually (\<lambda>x. x \<in> {b<..<a}) (at_right b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < a \<Longrightarrow> \<forall>\<^sub>F x in at_right b. x \<in> {b<..<a}
[PROOF STEP]
unfolding eventually_at_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < a \<Longrightarrow> \<exists>ba>b. \<forall>y>b. y < ba \<longrightarrow> y \<in> {b<..<a}
[PROOF STEP]
by auto


[STATEMENT]
lemma is_rbt_fold_rbt_insertwk:
  assumes "is_rbt t1"
  shows "is_rbt (fold (rbt_insert_with_key f) t2 t1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_rbt (RBT_Impl.fold (rbt_insert_with_key f) t2 t1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_rbt (RBT_Impl.fold (rbt_insert_with_key f) t2 t1)
[PROOF STEP]
define xs where "xs = entries t2"
[PROOF STATE]
proof (state)
this:
xs = entries t2

goal (1 subgoal):
 1. is_rbt (RBT_Impl.fold (rbt_insert_with_key f) t2 t1)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_rbt t1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_rbt t1

goal (1 subgoal):
 1. is_rbt (RBT_Impl.fold (rbt_insert_with_key f) t2 t1)
[PROOF STEP]
unfolding fold_def xs_def[symmetric]
[PROOF STATE]
proof (prove)
using this:
is_rbt t1

goal (1 subgoal):
 1. is_rbt (List.fold (\<lambda>(x, y). rbt_insert_with_key f x y) xs t1)
[PROOF STEP]
by(induct xs rule: rev_induct)(auto simp add: rbt_insertwk_is_rbt)
[PROOF STATE]
proof (state)
this:
is_rbt (RBT_Impl.fold (rbt_insert_with_key f) t2 t1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_ord_trans_refl_le: "
  \<lbrakk> transP ord; reflP ord \<rbrakk> \<Longrightarrow>
  (list_ord ord xs) =
  (\<forall>j < length xs. \<forall>i \<le> j. ord (xs ! i) (xs ! j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}\<rbrakk> \<Longrightarrow> list_ord ord xs = (\<forall>j<length xs. \<forall>i\<le>j. ord (xs ! i) (xs ! j))
[PROOF STEP]
apply (subst list_ord_trans, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}\<rbrakk> \<Longrightarrow> (\<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)) = (\<forall>j<length xs. \<forall>i\<le>j. ord (xs ! i) (xs ! j))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> \<forall>j<length xs. \<forall>i\<le>j. ord (xs ! i) (xs ! j)
 2. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i\<le>j. ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j); j < length xs; i \<le> j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
 2. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i\<le>j. ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)
[PROOF STEP]
apply (case_tac "i = j")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j); j < length xs; i \<le> j; i = j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
 2. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j); j < length xs; i \<le> j; i \<noteq> j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
 3. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i\<le>j. ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)
[PROOF STEP]
apply (simp add: refl_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j); j < length xs; i \<le> j; i \<noteq> j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
 2. \<lbrakk>trans {(x, y). ord x y}; refl {(x, y). ord x y}; \<forall>j<length xs. \<forall>i\<le>j. ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_on_open_Un:
  "open s \<Longrightarrow> open t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t f \<Longrightarrow> continuous_on (s \<union> t) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open s; open t; continuous_on s f; continuous_on t f\<rbrakk> \<Longrightarrow> continuous_on (s \<union> t) f
[PROOF STEP]
using continuous_on_open_Union [of "{s,t}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>sa. sa \<in> {s, t} \<Longrightarrow> open sa; \<And>sa. sa \<in> {s, t} \<Longrightarrow> continuous_on sa ?f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> {s, t}) ?f

goal (1 subgoal):
 1. \<lbrakk>open s; open t; continuous_on s f; continuous_on t f\<rbrakk> \<Longrightarrow> continuous_on (s \<union> t) f
[PROOF STEP]
by auto


[STATEMENT]
lemma strict_mono_primorial': "strict_mono primorial'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono primorial'
[PROOF STEP]
unfolding strict_mono_Suc_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. primorial' n < primorial' (Suc n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. primorial' n < primorial' (Suc n)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. primorial' n < primorial' (Suc n)
[PROOF STEP]
have "primorial' n * 1 < primorial' n * nth_prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primorial' n * 1 < primorial' n * nth_prime n
[PROOF STEP]
using prime_gt_1_nat[OF prime_nth_prime[of n]]
[PROOF STATE]
proof (prove)
using this:
1 < nth_prime n

goal (1 subgoal):
 1. primorial' n * 1 < primorial' n * nth_prime n
[PROOF STEP]
by (intro mult_strict_left_mono) auto
[PROOF STATE]
proof (state)
this:
primorial' n * 1 < primorial' n * nth_prime n

goal (1 subgoal):
 1. \<And>n. primorial' n < primorial' (Suc n)
[PROOF STEP]
thus "primorial' n < primorial' (Suc n)"
[PROOF STATE]
proof (prove)
using this:
primorial' n * 1 < primorial' n * nth_prime n

goal (1 subgoal):
 1. primorial' n < primorial' (Suc n)
[PROOF STEP]
by (simp add: primorial'_Suc)
[PROOF STATE]
proof (state)
this:
primorial' n < primorial' (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary_surj:
  assumes "unitary U"
  shows "surj (cblinfun_apply U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj ((*\<^sub>V) U)
[PROOF STEP]
apply (rule surjI[where f=\<open>cblinfun_apply (U*)\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. U *\<^sub>V U* *\<^sub>V x = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitary U

goal (1 subgoal):
 1. \<And>x. U *\<^sub>V U* *\<^sub>V x = x
[PROOF STEP]
unfolding unitary_def
[PROOF STATE]
proof (prove)
using this:
U* o\<^sub>C\<^sub>L U = id_cblinfun \<and> U o\<^sub>C\<^sub>L U* = id_cblinfun

goal (1 subgoal):
 1. \<And>x. U *\<^sub>V U* *\<^sub>V x = x
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x U. \<lbrakk>bounded_clinear U; U\<^sup>\<dagger> \<circ> U = (\<lambda>x. x) \<and> U \<circ> U\<^sup>\<dagger> = (\<lambda>x. x)\<rbrakk> \<Longrightarrow> U ((U\<^sup>\<dagger>) x) = x
[PROOF STEP]
using comp_eq_dest_lhs
[PROOF STATE]
proof (prove)
using this:
?a \<circ> ?b = ?c \<Longrightarrow> ?a (?b ?v) = ?c ?v

goal (1 subgoal):
 1. \<And>x U. \<lbrakk>bounded_clinear U; U\<^sup>\<dagger> \<circ> U = (\<lambda>x. x) \<and> U \<circ> U\<^sup>\<dagger> = (\<lambda>x. x)\<rbrakk> \<Longrightarrow> U ((U\<^sup>\<dagger>) x) = x
[PROOF STEP]
by force


[STATEMENT]
lemma [simp]: assumes "xs \<noteq> LNil" "ys \<noteq> LNil" "lhd xs = lhd ys"
  shows lhd_llist_inf: "lhd (inf xs ys) = lhd ys"
  and  ltl_llist_inf: "ltl (inf xs ys) = inf (ltl xs) (ltl ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lhd (xs \<sqinter> ys) = lhd ys &&& ltl (xs \<sqinter> ys) = ltl xs \<sqinter> ltl ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> LNil
ys \<noteq> LNil
lhd xs = lhd ys

goal (1 subgoal):
 1. lhd (xs \<sqinter> ys) = lhd ys &&& ltl (xs \<sqinter> ys) = ltl xs \<sqinter> ltl ys
[PROOF STEP]
by(simp_all add: inf_llist_def)


[STATEMENT]
lemma (in group) pow_order_eq_1:
  assumes "a \<in> carrier G" shows "a [^] order G = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] order G = \<one>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G

goal (1 subgoal):
 1. a [^] order G = \<one>
[PROOF STEP]
by (metis nat_pow_pow ord_dvd_group_order pow_ord_eq_1 dvdE nat_pow_one)


[STATEMENT]
lemma union_is_single:
  "M + N = {#a#} \<longleftrightarrow> M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#}"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M + N = {#a#}) = (M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. M + N = {#a#} \<Longrightarrow> M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#}
 2. M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#} \<Longrightarrow> M + N = {#a#}
[PROOF STEP]
show ?lhs if ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M + N = {#a#}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#}

goal (1 subgoal):
 1. M + N = {#a#}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#} \<Longrightarrow> M + N = {#a#}

goal (1 subgoal):
 1. M + N = {#a#} \<Longrightarrow> M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#}
[PROOF STEP]
show ?rhs if ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#}
[PROOF STEP]
by (metis Multiset.diff_cancel add.commute add_diff_cancel_left' diff_add_zero diff_single_trivial insert_DiffM that)
[PROOF STATE]
proof (state)
this:
M + N = {#a#} \<Longrightarrow> M = {#a#} \<and> N = {#} \<or> M = {#} \<and> N = {#a#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power_by_mult: "VARS a b c
 {a=A \<and> b=B}
 c := (1::nat);
 WHILE b \<noteq> 0
 INV {A^B = c * a^b}
 DO  WHILE b mod 2 = 0
     INV {A^B = c * a^b}
     DO  a := a*a; b := b div 2 OD;
     c := c*a; b := b - 1
 OD
 {c = A^B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a = A \<and> b = B}
c := 1; WHILE b \<noteq> 0 INV {A ^ B = c * a ^ b}  VAR {0}
DO WHILE b mod 2 = 0 INV {A ^ B = c * a ^ b}  VAR {0}
DO a := a * a; b := b div 2 OD; c := c * a; b := b - 1 OD
{c = A ^ B}
[PROOF STEP]
proof casified_vcg_simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c. A ^ B = c * a ^ b \<and> b mod 2 = Suc 0 \<Longrightarrow> c = 0 \<or> a ^ b = a * a ^ (b - Suc 0)
[PROOF STEP]
case while
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>a b c. A ^ B = c * a ^ b \<and> b mod 2 = Suc 0 \<Longrightarrow> c = 0 \<or> a ^ b = a * a ^ (b - Suc 0)
[PROOF STEP]
case invariant
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>a b c. A ^ B = c * a ^ b \<and> b mod 2 = Suc 0 \<Longrightarrow> c = 0 \<or> a ^ b = a * a ^ (b - Suc 0)
[PROOF STEP]
case while
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>a b c. A ^ B = c * a ^ b \<and> b mod 2 = Suc 0 \<Longrightarrow> c = 0 \<or> a ^ b = a * a ^ (b - Suc 0)
[PROOF STEP]
case postcondition
[PROOF STATE]
proof (state)
this:
A ^ B = c * a ^ b \<and> b mod 2 = Suc 0

goal (1 subgoal):
 1. \<And>a b c. A ^ B = c * a ^ b \<and> b mod 2 = Suc 0 \<Longrightarrow> c = 0 \<or> a ^ b = a * a ^ (b - Suc 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A ^ B = c * a ^ b \<and> b mod 2 = Suc 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A ^ B = c * a ^ b \<and> b mod 2 = Suc 0

goal (1 subgoal):
 1. c = 0 \<or> a ^ b = a * a ^ (b - Suc 0)
[PROOF STEP]
by (cases b) simp_all
[PROOF STATE]
proof (state)
this:
c = 0 \<or> a ^ b = a * a ^ (b - Suc 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) id_in_auto: "(\<lambda>x \<in> carrier G. x) \<in> auto G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x\<in>carrier G. x) \<in> auto G
[PROOF STEP]
by (simp add: auto_def hom_def restrictI group.axioms id_Bij)


[STATEMENT]
lemma mssnth_sin_series_stream:
  "mssnth sin_series_stream n = (-1) ^ n / fact (2 * n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mssnth sin_series_stream n = (- 1) ^ n / fact (2 * n + 1)
[PROOF STEP]
using mssnth_sin_series_stream_aux[of False 1 n]
[PROOF STATE]
proof (prove)
using this:
mssnth (sin_series_stream_aux False (fact 1) (real 1)) n = (if False then - 1 else 1) * (- 1) ^ n / fact (2 * n + 1)

goal (1 subgoal):
 1. mssnth sin_series_stream n = (- 1) ^ n / fact (2 * n + 1)
[PROOF STEP]
unfolding sin_series_stream_def
[PROOF STATE]
proof (prove)
using this:
mssnth (sin_series_stream_aux False (fact 1) (real 1)) n = (if False then - 1 else 1) * (- 1) ^ n / fact (2 * n + 1)

goal (1 subgoal):
 1. mssnth (sin_series_stream_aux False 1 1) n = (- 1) ^ n / fact (2 * n + 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma tendsto_add_smallo_iff:
  assumes "f2 \<in> o[F](f1)"
  shows   "(f1 \<longlongrightarrow> a) F \<longleftrightarrow> ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f1 \<longlongrightarrow> a) F = ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (f1 \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F
 2. ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F \<Longrightarrow> (f1 \<longlongrightarrow> a) F
[PROOF STEP]
assume "((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F"
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F

goal (2 subgoals):
 1. (f1 \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F
 2. ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F \<Longrightarrow> (f1 \<longlongrightarrow> a) F
[PROOF STEP]
hence "((\<lambda>x. f1 x + f2 x - f2 x) \<longlongrightarrow> a) F"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F

goal (1 subgoal):
 1. ((\<lambda>x. f1 x + f2 x - f2 x) \<longlongrightarrow> a) F
[PROOF STEP]
by (rule tendsto_diff_smallo) (simp add: landau_o.small.plus_absorb2 assms)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f1 x + f2 x - f2 x) \<longlongrightarrow> a) F

goal (2 subgoals):
 1. (f1 \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F
 2. ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F \<Longrightarrow> (f1 \<longlongrightarrow> a) F
[PROOF STEP]
thus "(f1 \<longlongrightarrow> a) F"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f1 x + f2 x - f2 x) \<longlongrightarrow> a) F

goal (1 subgoal):
 1. (f1 \<longlongrightarrow> a) F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f1 \<longlongrightarrow> a) F

goal (1 subgoal):
 1. (f1 \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. f1 x + f2 x) \<longlongrightarrow> a) F
[PROOF STEP]
qed (rule tendsto_add_smallo[OF _ assms])


[STATEMENT]
lemma enat_of_option_le_conv: "enat_of_option m \<le> enat_of_option n \<longleftrightarrow> (case (m,n) of
    (_,None) \<Rightarrow> True
  | (Some a, Some b) \<Rightarrow> a\<le>b
  | (_, _) \<Rightarrow> False
)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (enat_of_option m \<le> enat_of_option n) = (case (m, n) of (None, None) \<Rightarrow> True | (None, Some aa) \<Rightarrow> False | (Some aa, None) \<Rightarrow> True | (Some aa, Some b) \<Rightarrow> aa \<le> b)
[PROOF STEP]
by (auto split: option.split)


[STATEMENT]
lemma summable_cot_pfd_real:
  fixes x :: real
  shows "summable (\<lambda>n. 2 * x / (x ^ 2 - of_nat (Suc n) ^ 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
have "summable (\<lambda>n. complex_of_real (2 * x / (x ^ 2 - of_nat (Suc n) ^ 2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. complex_of_real (2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2)))
[PROOF STEP]
using summable_cot_pfd_complex[of "of_real x"]
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. 2 * complex_of_real x / ((complex_of_real x)\<^sup>2 - (of_nat (Suc n))\<^sup>2))

goal (1 subgoal):
 1. summable (\<lambda>n. complex_of_real (2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. complex_of_real (2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2)))

goal (1 subgoal):
 1. summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. complex_of_real (2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2)))

goal (1 subgoal):
 1. summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
have "?this \<longleftrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. complex_of_real (2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))) = summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
by (rule summable_of_real_iff)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. complex_of_real (2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))) = summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))

goal (1 subgoal):
 1. summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))

goal (1 subgoal):
 1. summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. 2 * x / (x\<^sup>2 - (real (Suc n))\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_nonpos_flip: "eventually (\<lambda>x. f x \<le> (0::real)) F \<Longrightarrow> eventually (\<lambda>x. -f x \<ge> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<le> 0 \<Longrightarrow> \<forall>\<^sub>F x in F. 0 \<le> - f x
[PROOF STEP]
by simp


[STATEMENT]
lemma lspace_iff:
  assumes "\<infinity> > p" "p > 0"
  shows "lspace (lebesgue_on S) p = {f \<in> borel_measurable (lebesgue_on S). integrable (lebesgue_on S) (\<lambda>x. (norm(f x) powr (enn2real p)))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lspace (lebesgue_on S) p = {f \<in> borel_measurable (lebesgue_on S). integrable (lebesgue_on S) (\<lambda>x. norm (f x) powr enn2real p)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lspace (lebesgue_on S) p = {f \<in> borel_measurable (lebesgue_on S). integrable (lebesgue_on S) (\<lambda>x. norm (f x) powr enn2real p)}
[PROOF STEP]
obtain q::real where "p = enn2real q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. p = ennreal (enn2real (ennreal q)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Lp_cases assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>p2. \<lbrakk>?p = ennreal p2; 0 < p2; 0 < ?p\<rbrakk> \<Longrightarrow> ?thesis; ?p = 0 \<Longrightarrow> ?thesis; ?p = \<infinity> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
p < \<infinity>
0 < p

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

goal (1 subgoal):
 1. lspace (lebesgue_on S) p = {f \<in> borel_measurable (lebesgue_on S). integrable (lebesgue_on S) (\<lambda>x. norm (f x) powr enn2real p)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = ennreal (enn2real (ennreal q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = ennreal (enn2real (ennreal q))

goal (1 subgoal):
 1. lspace (lebesgue_on S) p = {f \<in> borel_measurable (lebesgue_on S). integrable (lebesgue_on S) (\<lambda>x. norm (f x) powr enn2real p)}
[PROOF STEP]
using assms lspace_ennreal_iff
[PROOF STATE]
proof (prove)
using this:
p = ennreal (enn2real (ennreal q))
p < \<infinity>
0 < p
0 < ?p \<Longrightarrow> lspace (lebesgue_on ?S) (ennreal ?p) = {f \<in> borel_measurable (lebesgue_on ?S). integrable (lebesgue_on ?S) (\<lambda>x. norm (f x) powr ?p)}

goal (1 subgoal):
 1. lspace (lebesgue_on S) p = {f \<in> borel_measurable (lebesgue_on S). integrable (lebesgue_on S) (\<lambda>x. norm (f x) powr enn2real p)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lspace (lebesgue_on S) p = {f \<in> borel_measurable (lebesgue_on S). integrable (lebesgue_on S) (\<lambda>x. norm (f x) powr enn2real p)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dropWhile_dropWhile1: "(\<And>x. Q x \<Longrightarrow> P x) \<Longrightarrow> dropWhile Q (dropWhile P xs) = dropWhile P xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. Q x \<Longrightarrow> P x) \<Longrightarrow> dropWhile Q (dropWhile P xs) = dropWhile P xs
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma content_eq_0: "content (cbox a b) = 0 \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i \<le> a\<bullet>i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (content (cbox a b) = 0) = (\<exists>i\<in>Basis. b \<bullet> i \<le> a \<bullet> i)
[PROOF STEP]
by (auto simp: content_cbox_cases not_le intro: less_imp_le antisym eq_refl)


[STATEMENT]
lemma finsum_eq_parition:
  assumes "finite S"
  assumes "f \<in> S \<rightarrow> carrier R"
  assumes "T \<subseteq> S"
  assumes "\<And>x. x \<in> S - T \<Longrightarrow> f x = \<zero>"
  shows "finsum  R f S  = finsum R f T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f S = finsum R f T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S
f \<in> S \<rightarrow> carrier R
T \<subseteq> S
?x23 \<in> S - T \<Longrightarrow> f ?x23 = \<zero>

goal (1 subgoal):
 1. finsum R f S = finsum R f T
[PROOF STEP]
by (metis add.finprod_mono_neutral_cong_right)


[STATEMENT]
lemma injective_closed_imp_embedding_map:
  "\<lbrakk>continuous_map X Y f; closed_map X Y f; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> embedding_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; closed_map X Y f; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> embedding_map X Y f
[PROOF STEP]
unfolding embedding_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; closed_map X Y f; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> homeomorphic_map X (subtopology Y (f ` topspace X)) f
[PROOF STEP]
by (simp add: closed_map_imp_subset closed_map_into_subtopology continuous_closed_quotient_map
                continuous_map_in_subtopology dual_order.eq_iff homeomorphic_map_def)


[STATEMENT]
lemma infinite_num0: "\<not> finite (UNIV :: num0 set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
using card_num0[unfolded card_eq_0_iff]
[PROOF STATE]
proof (prove)
using this:
UNIV = {} \<or> infinite UNIV

goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
by simp


[STATEMENT]
lemma ChiPlus_ChiPlus_NoCycles_2:
  "\<lbrakk> (S,U) \<in> ChiPlus A; (U,T) \<in> ChiPlus A \<rbrakk> \<Longrightarrow> (T,S) \<notin>  ChiPlus A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(S, U) \<in> ChiPlus A; (U, T) \<in> ChiPlus A\<rbrakk> \<Longrightarrow> (T, S) \<notin> ChiPlus A
[PROOF STEP]
apply (rule ChiPlus_ChiPlus_NoCycles)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(S, U) \<in> ChiPlus A; (U, T) \<in> ChiPlus A\<rbrakk> \<Longrightarrow> (S, T) \<in> ChiPlus A
[PROOF STEP]
apply (auto intro: trancl_trans simp add: ChiPlus_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma msog_append: "ms_of_greek (xs @ ys) = image_mset (adj_msog [] ys) (ms_of_greek xs) +
  image_mset (adj_msog xs []) (ms_of_greek ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ms_of_greek (xs @ ys) = image_mset (adj_msog [] ys) (ms_of_greek xs) + image_mset (adj_msog xs []) (ms_of_greek ys)
[PROOF STEP]
by (auto simp: ms_of_greek_def list_splits_append multiset.map_comp comp_def prod.case_distrib)


[STATEMENT]
lemma nn_integral_count_space_eq:
  "(\<And>x. x \<in> A - B \<Longrightarrow> f x = 0) \<Longrightarrow> (\<And>x. x \<in> B - A \<Longrightarrow> f x = 0) \<Longrightarrow>
    (\<integral>\<^sup>+x. f x \<partial>count_space A) = (\<integral>\<^sup>+x. f x \<partial>count_space B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> A - B \<Longrightarrow> f x = 0; \<And>x. x \<in> B - A \<Longrightarrow> f x = 0\<rbrakk> \<Longrightarrow> integral\<^sup>N (count_space A) f = integral\<^sup>N (count_space B) f
[PROOF STEP]
by (auto simp: nn_integral_count_space_indicator intro!: nn_integral_cong split: split_indicator)


[STATEMENT]
lemma mset_ran_insert: "\<lbrakk>finite r; i\<notin>r\<rbrakk> \<Longrightarrow> mset_ran a (insert i r) = add_mset (a i) (mset_ran a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite r; i \<notin> r\<rbrakk> \<Longrightarrow> mset_ran a (insert i r) = add_mset (a i) (mset_ran a r)
[PROOF STEP]
by (auto simp: mset_ran_def)


[STATEMENT]
lemma prodinf_mult: "convergent_prod f \<Longrightarrow> convergent_prod g \<Longrightarrow> prodinf f * prodinf g = (\<Prod>n. f n * g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>convergent_prod f; convergent_prod g\<rbrakk> \<Longrightarrow> prodinf f * prodinf g = (\<Prod>n. f n * g n)
[PROOF STEP]
by (intro has_prod_unique has_prod_mult convergent_prod_has_prod)


[STATEMENT]
lemma is_swap_sum_mod_2:
  assumes "is_swap"
  shows "(f 0 + f 1) mod 2 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f 0 + f 1) mod 2 = 1
[PROOF STEP]
using assms is_swap_def
[PROOF STATE]
proof (prove)
using this:
is_swap
is_swap = (\<forall>x\<in>{0, 1}. f x = 1 - x)

goal (1 subgoal):
 1. (f 0 + f 1) mod 2 = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma lfp_induct':
  assumes M: "mono f"
  assumes IS: "\<And>m. \<lbrakk> m \<le> lfp f; m \<le> P \<rbrakk> \<Longrightarrow> f m \<le> P"
  shows "lfp f \<le> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f \<le> P
[PROOF STEP]
apply (rule lfp_induct[OF M])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (inf (lfp f) P) \<le> P
[PROOF STEP]
apply (rule IS)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inf (lfp f) P \<le> lfp f
 2. inf (lfp f) P \<le> P
[PROOF STEP]
by simp_all


[STATEMENT]
lemma inf_Pair_Pair [simp]: "inf (a, b) (c, d) = (inf a c, inf b d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf (a, b) (c, d) = (inf a c, inf b d)
[PROOF STEP]
unfolding inf_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inf (fst (a, b)) (fst (c, d)), inf (snd (a, b)) (snd (c, d))) = (inf a c, inf b d)
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_deriv_maclauren_0:
  "(fps_nth_deriv k (f :: 'a::comm_semiring_1 fps)) $ 0 = of_nat (fact k) * f $ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_nth_deriv k f $ 0 = of_nat (fact k) * f $ k
[PROOF STEP]
by (induct k arbitrary: f) (simp_all add: field_simps)


[STATEMENT]
lemma lm104:
  assumes "card N > 0" "distinct G"
  shows   "Union {injections P N| P. P \<in> all_partitions (set G)} =
           Union (set [set (injections_alg l N) . l \<leftarrow> all_partitions_list G])"
  (is "Union ?L = Union ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {injections P N |P. P \<in> all_partitions (set G)} = \<Union> (set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> {injections P N |P. P \<in> all_partitions (set G)} = \<Union> (set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)))
[PROOF STEP]
have "?L = ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < card N
distinct G

goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
by (rule lm103)
[PROOF STATE]
proof (state)
this:
{injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))

goal (1 subgoal):
 1. \<Union> {injections P N |P. P \<in> all_partitions (set G)} = \<Union> (set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))

goal (1 subgoal):
 1. \<Union> {injections P N |P. P \<in> all_partitions (set G)} = \<Union> (set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<Union> {injections P N |P. P \<in> all_partitions (set G)} = \<Union> (set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_of_Func_Plus:
  fixes A :: "'a set" and B :: "'b set" and C :: "'c set"
  shows "|Func (A <+> B) C| =o |Func A C \<times> Func B C|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Func (A <+> B) C| =o |Func A C \<times> Func B C|
[PROOF STEP]
proof (rule ordIso_symmetric)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
define f where "f = (\<lambda>(g :: 'a => 'c, h::'b \<Rightarrow> 'c) ab. case ab of Inl a \<Rightarrow> g a | Inr b \<Rightarrow> h b)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>(g, h) ab. case ab of Inl a \<Rightarrow> g a | Inr b \<Rightarrow> h b)

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
define f' where "f' = (\<lambda>(f :: ('a + 'b) \<Rightarrow> 'c). (\<lambda>a. f (Inl a), \<lambda>b. f (Inr b)))"
[PROOF STATE]
proof (state)
this:
f' = (\<lambda>f. (\<lambda>a. f (Inl a), \<lambda>b. f (Inr b)))

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
have "f ` (Func A C \<times> Func B C) \<subseteq> Func (A <+> B) C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (Func A C \<times> Func B C) \<subseteq> Func (A <+> B) C
[PROOF STEP]
unfolding Func_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). case_sum x y) ` ({f. (\<forall>a\<in>A. f a \<in> C) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)} \<times> {f. (\<forall>a\<in>B. f a \<in> C) \<and> (\<forall>a. a \<notin> B \<longrightarrow> f a = undefined)}) \<subseteq> {f. (\<forall>a\<in>A <+> B. f a \<in> C) \<and> (\<forall>a. a \<notin> A <+> B \<longrightarrow> f a = undefined)}
[PROOF STEP]
by (force split: sum.splits)
[PROOF STATE]
proof (state)
this:
f ` (Func A C \<times> Func B C) \<subseteq> Func (A <+> B) C

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f ` (Func A C \<times> Func B C) \<subseteq> Func (A <+> B) C

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
have "f' ` Func (A <+> B) C \<subseteq> Func A C \<times> Func B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f' ` Func (A <+> B) C \<subseteq> Func A C \<times> Func B C
[PROOF STEP]
unfolding Func_def f'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f. (\<lambda>a. f (Inl a), \<lambda>b. f (Inr b))) ` {f. (\<forall>a\<in>A <+> B. f a \<in> C) \<and> (\<forall>a. a \<notin> A <+> B \<longrightarrow> f a = undefined)} \<subseteq> {f. (\<forall>a\<in>A. f a \<in> C) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)} \<times> {f. (\<forall>a\<in>B. f a \<in> C) \<and> (\<forall>a. a \<notin> B \<longrightarrow> f a = undefined)}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
f' ` Func (A <+> B) C \<subseteq> Func A C \<times> Func B C

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f' ` Func (A <+> B) C \<subseteq> Func A C \<times> Func B C

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
have "\<forall>a \<in> Func A C \<times> Func B C. f' (f a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>Func A C \<times> Func B C. f' (f a) = a
[PROOF STEP]
unfolding f'_def f_def Func_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>{f. (\<forall>a\<in>A. f a \<in> C) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)} \<times> {f. (\<forall>a\<in>B. f a \<in> C) \<and> (\<forall>a. a \<notin> B \<longrightarrow> f a = undefined)}. (\<lambda>aa. (case a of (x, xa) \<Rightarrow> case_sum x xa) (Inl aa), \<lambda>b. (case a of (x, xa) \<Rightarrow> case_sum x xa) (Inr b)) = a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>Func A C \<times> Func B C. f' (f a) = a

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>Func A C \<times> Func B C. f' (f a) = a

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
have "\<forall>a' \<in> Func (A <+> B) C. f (f' a') = a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a'\<in>Func (A <+> B) C. f (f' a') = a'
[PROOF STEP]
unfolding f'_def f_def Func_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a'\<in>{f. (\<forall>a\<in>A <+> B. f a \<in> C) \<and> (\<forall>a. a \<notin> A <+> B \<longrightarrow> f a = undefined)}. (case (\<lambda>a. a' (Inl a), \<lambda>b. a' (Inr b)) of (x, xa) \<Rightarrow> case_sum x xa) = a'
[PROOF STEP]
by (auto split: sum.splits)
[PROOF STATE]
proof (state)
this:
\<forall>a'\<in>Func (A <+> B) C. f (f' a') = a'

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f ` (Func A C \<times> Func B C) \<subseteq> Func (A <+> B) C
f' ` Func (A <+> B) C \<subseteq> Func A C \<times> Func B C
\<forall>a\<in>Func A C \<times> Func B C. f' (f a) = a
\<forall>a'\<in>Func (A <+> B) C. f (f' a') = a'
[PROOF STEP]
have "bij_betw f (Func A C \<times> Func B C) (Func (A <+> B) C)"
[PROOF STATE]
proof (prove)
using this:
f ` (Func A C \<times> Func B C) \<subseteq> Func (A <+> B) C
f' ` Func (A <+> B) C \<subseteq> Func A C \<times> Func B C
\<forall>a\<in>Func A C \<times> Func B C. f' (f a) = a
\<forall>a'\<in>Func (A <+> B) C. f (f' a') = a'

goal (1 subgoal):
 1. bij_betw f (Func A C \<times> Func B C) (Func (A <+> B) C)
[PROOF STEP]
by (intro bij_betw_byWitness[of _ f' f])
[PROOF STATE]
proof (state)
this:
bij_betw f (Func A C \<times> Func B C) (Func (A <+> B) C)

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
thus "|Func A C \<times> Func B C| =o |Func (A <+> B) C|"
[PROOF STATE]
proof (prove)
using this:
bij_betw f (Func A C \<times> Func B C) (Func (A <+> B) C)

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
using card_of_ordIso
[PROOF STATE]
proof (prove)
using this:
bij_betw f (Func A C \<times> Func B C) (Func (A <+> B) C)
(\<exists>f. bij_betw f ?A ?B) = (|?A| =o |?B|)

goal (1 subgoal):
 1. |Func A C \<times> Func B C| =o |Func (A <+> B) C|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|Func A C \<times> Func B C| =o |Func (A <+> B) C|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cos_sin_eq: "cos x = sin (of_real pi/2 - x)"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x = sin (of_real pi / (2::'a) - x)
[PROOF STEP]
using sin_cos_eq [of "of_real pi/2 - x"]
[PROOF STATE]
proof (prove)
using this:
sin (of_real pi / (2::'a) - x) = cos (of_real pi / (2::'a) - (of_real pi / (2::'a) - x))

goal (1 subgoal):
 1. cos x = sin (of_real pi / (2::'a) - x)
[PROOF STEP]
by simp


[STATEMENT]
lemma iso_set_trans:
  "\<lbrakk>h \<in> Group.iso G H; i \<in> Group.iso H I\<rbrakk> \<Longrightarrow> i \<circ> h \<in> Group.iso G I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> Group.iso G H; i \<in> Group.iso H I\<rbrakk> \<Longrightarrow> i \<circ> h \<in> Group.iso G I
[PROOF STEP]
by (force simp: iso_def hom_compose intro: bij_betw_trans)


[STATEMENT]
lemma boolfunc_from_sc_un:
  "boolfunc_from_sc n (a\<union>b) = bf_or (boolfunc_from_sc n a) (boolfunc_from_sc n b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boolfunc_from_sc n (a \<union> b) = bf_or (boolfunc_from_sc n a) (boolfunc_from_sc n b)
[PROOF STEP]
unfolding boolfunc_from_sc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. {i. i < n \<and> \<not> p i} \<in> a \<union> b) = bf_or (\<lambda>p. {i. i < n \<and> \<not> p i} \<in> a) (\<lambda>p. {i. i < n \<and> \<not> p i} \<in> b)
[PROOF STEP]
unfolding bf_or_def bf_ite_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. {i. i < n \<and> \<not> p i} \<in> a \<union> b) = (\<lambda>l. if {i. i < n \<and> \<not> l i} \<in> a then True else {i. i < n \<and> \<not> l i} \<in> b)
[PROOF STEP]
by force


[STATEMENT]
lemma poly_map_pullback_char:
  assumes "is_poly_tuple n fs"
  assumes "length fs = m"
  assumes "is_poly_tuple k gs"
  assumes "length gs = n"
  shows "(pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs)) =
          poly_map k (map (poly_compose n k gs) fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) = poly_map k (map (poly_compose n k gs) fs)
[PROOF STEP]
proof(rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
show "pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x =
         poly_map k (map (poly_compose n k gs) fs) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
proof(cases "x \<in> carrier (R\<^bsup>k\<^esup>)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
 2. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> carrier (R\<^bsup>k\<^esup>)

goal (2 subgoals):
 1. x \<in> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
 2. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
have 0: "length (pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x) =  m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x) = m
[PROOF STEP]
using True assms poly_map_closed cartesian_power_car_memE
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (R\<^bsup>k\<^esup>)
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n
\<lbrakk>is_poly_tuple ?n ?fs; length ?fs = ?m; ?as \<in> carrier (R\<^bsup>?n\<^esup>)\<rbrakk> \<Longrightarrow> poly_map ?n ?fs ?as \<in> carrier (R\<^bsup>?m\<^esup>)
?as \<in> carrier (?R\<^bsup>?n\<^esup>) \<Longrightarrow> length ?as = ?n

goal (1 subgoal):
 1. length (pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x) = m
[PROOF STEP]
unfolding pullback_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (R\<^bsup>k\<^esup>)
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n
\<lbrakk>is_poly_tuple ?n ?fs; length ?fs = ?m; ?as \<in> carrier (R\<^bsup>?n\<^esup>)\<rbrakk> \<Longrightarrow> poly_map ?n ?fs ?as \<in> carrier (R\<^bsup>?m\<^esup>)
?as \<in> carrier (?R\<^bsup>?n\<^esup>) \<Longrightarrow> length ?as = ?n

goal (1 subgoal):
 1. length (FuncSet.compose (carrier (R\<^bsup>k\<^esup>)) (poly_map n fs) (poly_map k gs) x) = m
[PROOF STEP]
by (metis (mono_tags, lifting) compose_eq)
[PROOF STATE]
proof (state)
this:
length (pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x) = m

goal (2 subgoals):
 1. x \<in> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
 2. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
have 1: "is_poly_tuple k (map (poly_compose n k gs) fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poly_tuple k (map (poly_compose n k gs) fs)
[PROOF STEP]
by (simp add: assms poly_map_compose_closed)
[PROOF STATE]
proof (state)
this:
is_poly_tuple k (map (poly_compose n k gs) fs)

goal (2 subgoals):
 1. x \<in> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
 2. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
have 2: "length (map (poly_compose n k gs) fs) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (poly_compose n k gs) fs) = m
[PROOF STEP]
using assms length_map
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n
length (map ?f ?xs) = length ?xs

goal (1 subgoal):
 1. length (map (poly_compose n k gs) fs) = m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (map (poly_compose n k gs) fs) = m

goal (2 subgoals):
 1. x \<in> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
 2. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
have 3: "\<And>i. i < m \<Longrightarrow>
            (pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x)! i =
                  eval_at_point R (poly_map k gs x) (fs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < m \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x ! i = eval_at_point R (poly_map k gs x) (fs ! i)
[PROOF STEP]
unfolding pullback_def poly_map_def poly_tuple_eval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < m \<Longrightarrow> FuncSet.compose (carrier (R\<^bsup>k\<^esup>)) (\<lambda>as\<in>carrier (R\<^bsup>n\<^esup>). map (eval_at_point R as) fs) (\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) gs) x ! i = eval_at_point R ((\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) gs) x) (fs ! i)
[PROOF STEP]
using assms True
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n
x \<in> carrier (R\<^bsup>k\<^esup>)

goal (1 subgoal):
 1. \<And>i. i < m \<Longrightarrow> FuncSet.compose (carrier (R\<^bsup>k\<^esup>)) (\<lambda>as\<in>carrier (R\<^bsup>n\<^esup>). map (eval_at_point R as) fs) (\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) gs) x ! i = eval_at_point R ((\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) gs) x) (fs ! i)
[PROOF STEP]
by (smt compose_eq nth_map poly_tuple_eval_closed poly_tuple_eval_def restrict_apply')
[PROOF STATE]
proof (state)
this:
?i30 < m \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x ! ?i30 = eval_at_point R (poly_map k gs x) (fs ! ?i30)

goal (2 subgoals):
 1. x \<in> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
 2. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
have 4: "\<And>i. i < m \<Longrightarrow>
            poly_map k (map (poly_compose n k gs) fs) x ! i =
                  eval_at_point R (poly_map k gs x) (fs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < m \<Longrightarrow> poly_map k (map (poly_compose n k gs) fs) x ! i = eval_at_point R (poly_map k gs x) (fs ! i)
[PROOF STEP]
unfolding poly_map_def poly_tuple_eval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < m \<Longrightarrow> (\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) (map (poly_compose n k gs) fs)) x ! i = eval_at_point R ((\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) gs) x) (fs ! i)
[PROOF STEP]
using True assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (R\<^bsup>k\<^esup>)
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n

goal (1 subgoal):
 1. \<And>i. i < m \<Longrightarrow> (\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) (map (poly_compose n k gs) fs)) x ! i = eval_at_point R ((\<lambda>as\<in>carrier (R\<^bsup>k\<^esup>). map (eval_at_point R as) gs) x) (fs ! i)
[PROOF STEP]
by (smt "2" cring_coord_rings.is_poly_tuple_def cring_coord_rings_axioms neq0_conv
            nth_map nth_mem poly_compose_eval poly_tuple_eval_def restrict_apply' subset_code(1))
[PROOF STATE]
proof (state)
this:
?i30 < m \<Longrightarrow> poly_map k (map (poly_compose n k gs) fs) x ! ?i30 = eval_at_point R (poly_map k gs x) (fs ! ?i30)

goal (2 subgoals):
 1. x \<in> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
 2. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
using 0 1 2 3 4 assms True
[PROOF STATE]
proof (prove)
using this:
length (pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x) = m
is_poly_tuple k (map (poly_compose n k gs) fs)
length (map (poly_compose n k gs) fs) = m
?i30 < m \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x ! ?i30 = eval_at_point R (poly_map k gs x) (fs ! ?i30)
?i30 < m \<Longrightarrow> poly_map k (map (poly_compose n k gs) fs) x ! ?i30 = eval_at_point R (poly_map k gs x) (fs ! ?i30)
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n
x \<in> carrier (R\<^bsup>k\<^esup>)

goal (1 subgoal):
 1. pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
by (metis cartesian_power_car_memE nth_equalityI poly_map_closed)
[PROOF STATE]
proof (state)
this:
pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x

goal (1 subgoal):
 1. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> carrier (R\<^bsup>k\<^esup>)

goal (1 subgoal):
 1. x \<notin> carrier (R\<^bsup>k\<^esup>) \<Longrightarrow> pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> carrier (R\<^bsup>k\<^esup>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<notin> carrier (R\<^bsup>k\<^esup>)

goal (1 subgoal):
 1. pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x
[PROOF STEP]
unfolding poly_map_def pullback_def
[PROOF STATE]
proof (prove)
using this:
x \<notin> carrier (R\<^bsup>k\<^esup>)

goal (1 subgoal):
 1. FuncSet.compose (carrier (R\<^bsup>k\<^esup>)) (restrict (poly_tuple_eval fs) (carrier (R\<^bsup>n\<^esup>))) (restrict (poly_tuple_eval gs) (carrier (R\<^bsup>k\<^esup>))) x = restrict (poly_tuple_eval (map (poly_compose n k gs) fs)) (carrier (R\<^bsup>k\<^esup>)) x
[PROOF STEP]
by (metis affine_alg_set_empty compose_extensional extensional_restrict poly_map_def restrict_def)
[PROOF STATE]
proof (state)
this:
pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pullback (R\<^bsup>k\<^esup>) (poly_map k gs) (poly_map n fs) x = poly_map k (map (poly_compose n k gs) fs) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_rotation_mapping_u_to_positive_y_axis:
  assumes "u \<noteq> 0\<^sub>h" and "u \<noteq> \<infinity>\<^sub>h"
  shows "\<exists> \<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
obtain c where *: "u = of_complex c"
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. (\<And>c. u = of_complex c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h
?z = \<infinity>\<^sub>h \<or> (\<exists>x. ?z = of_complex x)

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

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis
[PROOF STEP]
have "is_imag (cis (pi/2 - Arg c) * c)" "Im (cis (pi/2 - Arg c) * c) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_imag (cis (pi / 2 - Arg c) * c) &&& 0 < Im (cis (pi / 2 - Arg c) * c)
[PROOF STEP]
using "*" assms is_real_rot_to_x_axis positive_rot_to_x_axis of_complex_zero_iff
[PROOF STATE]
proof (prove)
using this:
u = of_complex c
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h
?z \<noteq> 0 \<Longrightarrow> is_real (cis (- Arg ?z) * ?z)
?z \<noteq> 0 \<Longrightarrow> 0 < Re (cis (- Arg ?z) * ?z)
(of_complex ?x = 0\<^sub>h) = (?x = 0)

goal (1 subgoal):
 1. is_imag (cis (pi / 2 - Arg c) * c) &&& 0 < Im (cis (pi / 2 - Arg c) * c)
[PROOF STEP]
by - (simp, simp, simp add: field_simps)
[PROOF STATE]
proof (state)
this:
is_imag (cis (pi / 2 - Arg c) * c)
0 < Im (cis (pi / 2 - Arg c) * c)

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_imag (cis (pi / 2 - Arg c) * c)
0 < Im (cis (pi / 2 - Arg c) * c)

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
is_imag (cis (pi / 2 - Arg c) * c)
0 < Im (cis (pi / 2 - Arg c) * c)
u = of_complex c

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis
[PROOF STEP]
by (rule_tac x="pi/2-Arg c" in exI) (simp add: positive_y_axis_def circline_set_y_axis)
[PROOF STATE]
proof (state)
this:
\<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_y_axis

goal:
No subgoals!
[PROOF STEP]
qed