[STATEMENT]
lemma fSup_subdistl:
  assumes "mono (f::'a::complete_lattice \<Rightarrow> 'b::complete_lattice)"
  shows "Sup \<circ> (`) ((\<circ>) f) \<le> (\<circ>) f \<circ> Sup"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup \<circ> (`) ((\<circ>) f) \<le> (\<circ>) f \<circ> Sup
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mono f

goal (1 subgoal):
 1. Sup \<circ> (`) ((\<circ>) f) \<le> (\<circ>) f \<circ> Sup
[PROOF STEP]
by (simp add: SUP_least Sup_upper le_fun_def monoD image_comp)


[STATEMENT]
lemma prime_elem_dvd_power_iff:
  assumes "prime_elem p"
  shows "p dvd a ^ n \<longleftrightarrow> p dvd a \<and> n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p dvd a ^ n) = (p dvd a \<and> 0 < n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime_elem p

goal (1 subgoal):
 1. (p dvd a ^ n) = (p dvd a \<and> 0 < n)
[PROOF STEP]
by (induct n) (auto dest: prime_elem_not_unit prime_elem_dvd_multD)


[STATEMENT]
lemma divisor_sigma_1_left: "divisor_sigma 1 n = of_nat (divisor_sum n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma (1::'a) n = of_nat (divisor_sum n)
[PROOF STEP]
by (simp add: divisor_sum_def divisor_sigma_def)


[STATEMENT]
lemma frac_diff_eq1: "a \<noteq> b \<Longrightarrow> a / (a - b) - b / (a - b) = 1" for a::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> a / (a - b) - b / (a - b) = 1
[PROOF STEP]
by (metis (no_types) ab_left_minus add.commute add_left_cancel
      diff_divide_distrib diff_minus_eq_add div_self)


[STATEMENT]
lemma four_block_mat_dim0:
  assumes A: "A \<in> carrier_mat n n"
  and B: "B \<in> carrier_mat n 0"
  and C: "C \<in> carrier_mat 0 n"
  and D: "D \<in> carrier_mat 0 0"
shows "four_block_mat A B C D = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D = A
[PROOF STEP]
unfolding four_block_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let nra = dim_row A; nrd = dim_row D; nca = dim_col A; ncd = dim_col D in Matrix.mat (nra + nrd) (nca + ncd) (\<lambda>(i, j). if i < nra then if j < nca then A $$ (i, j) else B $$ (i, j - nca) else if j < nca then C $$ (i - nra, j) else D $$ (i - nra, j - nca))) = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n 0
C \<in> carrier_mat 0 n
D \<in> carrier_mat 0 0

goal (1 subgoal):
 1. (let nra = dim_row A; nrd = dim_row D; nca = dim_col A; ncd = dim_col D in Matrix.mat (nra + nrd) (nca + ncd) (\<lambda>(i, j). if i < nra then if j < nca then A $$ (i, j) else B $$ (i, j - nca) else if j < nca then C $$ (i - nra, j) else D $$ (i - nra, j - nca))) = A
[PROOF STEP]
by auto


[STATEMENT]
lemma (in comm_monoid) submonoid_is_comm_monoid :
  assumes "submonoid H G"
  shows "comm_monoid (G\<lparr>carrier := H\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
proof (intro monoid.monoid_comm_monoidI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Group.monoid (G\<lparr>carrier := H\<rparr>)
 2. \<And>x y. \<lbrakk>x \<in> carrier (G\<lparr>carrier := H\<rparr>); y \<in> carrier (G\<lparr>carrier := H\<rparr>)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> y = y \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x
[PROOF STEP]
show "monoid (G\<lparr>carrier := H\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.monoid (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
using submonoid.submonoid_is_monoid assms comm_monoid_axioms comm_monoid_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>submonoid ?H ?G; Group.monoid ?G\<rbrakk> \<Longrightarrow> Group.monoid (?G\<lparr>carrier := ?H\<rparr>)
submonoid H G
Group.comm_monoid G
Group.comm_monoid ?G \<equiv> Group.monoid ?G \<and> Group.comm_monoid_axioms ?G

goal (1 subgoal):
 1. Group.monoid (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Group.monoid (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (G\<lparr>carrier := H\<rparr>); y \<in> carrier (G\<lparr>carrier := H\<rparr>)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> y = y \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x
[PROOF STEP]
show "\<And>x y. x \<in> carrier (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> y \<in> carrier (G\<lparr>carrier := H\<rparr>)
        \<Longrightarrow> x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> y = y \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (G\<lparr>carrier := H\<rparr>); y \<in> carrier (G\<lparr>carrier := H\<rparr>)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> y = y \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x
[PROOF STEP]
by simp (meson assms m_comm submonoid.mem_carrier)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier (G\<lparr>carrier := H\<rparr>); ?y \<in> carrier (G\<lparr>carrier := H\<rparr>)\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?y = ?y \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem strong_Nullstellensatz:
  assumes "finite X" and "F \<subseteq> P[X]"
  shows "\<I> (\<V> F) = \<surd>ideal (F::(_ \<Rightarrow>\<^sub>0 _::alg_closed_field) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<I> (\<V> F) = \<surd>ideal F
[PROOF STEP]
proof (intro subset_antisym subsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> \<I> (\<V> F) \<Longrightarrow> x \<in> \<surd>ideal F
 2. \<And>x. x \<in> \<surd>ideal F \<Longrightarrow> x \<in> \<I> (\<V> F)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> \<I> (\<V> F) \<Longrightarrow> x \<in> \<surd>ideal F
 2. \<And>x. x \<in> \<surd>ideal F \<Longrightarrow> x \<in> \<I> (\<V> F)
[PROOF STEP]
assume "f \<in> \<I> (\<V> F)"
[PROOF STATE]
proof (state)
this:
f \<in> \<I> (\<V> F)

goal (2 subgoals):
 1. \<And>x. x \<in> \<I> (\<V> F) \<Longrightarrow> x \<in> \<surd>ideal F
 2. \<And>x. x \<in> \<surd>ideal F \<Longrightarrow> x \<in> \<I> (\<V> F)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite X
F \<subseteq> P[X]
f \<in> \<I> (\<V> F)
[PROOF STEP]
show "f \<in> \<surd>ideal F"
[PROOF STATE]
proof (prove)
using this:
finite X
F \<subseteq> P[X]
f \<in> \<I> (\<V> F)

goal (1 subgoal):
 1. f \<in> \<surd>ideal F
[PROOF STEP]
by (rule Nullstellensatz)
[PROOF STATE]
proof (state)
this:
f \<in> \<surd>ideal F

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<Longrightarrow> x \<in> \<I> (\<V> F)
[PROOF STEP]
qed (metis ideal_ofI variety_ofD variety_of_radical_ideal)


[STATEMENT]
lemma path_component_of_mono:
   "\<lbrakk>path_component_of (subtopology X S) x y; S \<subseteq> T\<rbrakk> \<Longrightarrow> path_component_of (subtopology X T) x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path_component_of (subtopology X S) x y; S \<subseteq> T\<rbrakk> \<Longrightarrow> path_component_of (subtopology X T) x y
[PROOF STEP]
unfolding path_component_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>g. pathin (subtopology X S) g \<and> g 0 = x \<and> g 1 = y; S \<subseteq> T\<rbrakk> \<Longrightarrow> \<exists>g. pathin (subtopology X T) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
by (metis subsetD pathin_subtopology)


[STATEMENT]
lemma max_reg_Gt: "max_reg (Gt a b) = max (AExp.max_reg a) (AExp.max_reg b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GExp.max_reg (Gt a b) = max (AExp.max_reg a) (AExp.max_reg b)
[PROOF STEP]
apply (simp add: max_reg_def AExp.max_reg_def Let_def max_absorb2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AExp.enumerate_regs a \<noteq> {} \<longrightarrow> AExp.enumerate_regs b \<noteq> {} \<longrightarrow> Some (Max (AExp.enumerate_regs a \<union> AExp.enumerate_regs b)) = max (Some (Max (AExp.enumerate_regs a))) (Some (Max (AExp.enumerate_regs b)))
[PROOF STEP]
by (metis AExp.finite_enumerate_regs Max.union bot_option_def max_bot2 sup_Some sup_max)


[STATEMENT]
lemma combine_r_distr:
  "\<lbrakk> set Ks \<subseteq> carrier R; set Us \<subseteq> carrier R \<rbrakk> \<Longrightarrow>
     k \<in> carrier R \<Longrightarrow> k \<otimes> (combine Ks Us) = combine (map ((\<otimes>) k) Ks) Us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set Ks \<subseteq> carrier R; set Us \<subseteq> carrier R; k \<in> carrier R\<rbrakk> \<Longrightarrow> k \<otimes> combine Ks Us = combine (map ((\<otimes>) k) Ks) Us
[PROOF STEP]
by (induct Ks Us rule: combine.induct) (auto simp add: m_assoc r_distr)


[STATEMENT]
lemma sqrtu_numeral:
  "sqrtu x (numeral n) = (sqrtu x (pred_numeral n) + x/sqrtu x (pred_numeral n)) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrtu x (numeral n) = (sqrtu x (pred_numeral n) + x / sqrtu x (pred_numeral n)) / 2
[PROOF STEP]
by (simp add: numeral_eq_Suc)


[STATEMENT]
lemma ladder_n_last_is_length:
  assumes "is_ladder D L"
  shows "ladder_n L (length L - 1) = length D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_n L (length L - 1) = length D
[PROOF STEP]
using assms is_ladder_def ladder_last_n_intro
[PROOF STATE]
proof (prove)
using this:
is_ladder D L
is_ladder ?D ?L = (?L \<noteq> [] \<and> (\<forall>u<length ?L. ladder_n ?L u \<le> length ?D) \<and> (\<forall>u v. u < v \<and> v < length ?L \<longrightarrow> ladder_n ?L u < ladder_n ?L v) \<and> ladder_last_n ?L = length ?D)
?L \<noteq> [] \<Longrightarrow> ladder_n ?L (length ?L - Suc 0) = ladder_last_n ?L

goal (1 subgoal):
 1. ladder_n L (length L - 1) = length D
[PROOF STEP]
by auto


[STATEMENT]
lemma multi_to_arith_prog:
  "multi_arith_prog 1 start steps c =
    arith_prog start (steps 0) (c 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multi_arith_prog 1 start steps c = arith_prog start (steps 0) (c 0)
[PROOF STEP]
unfolding multi_arith_prog_def arith_prog_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. start + int (\<Sum>i<1. c i * steps i) = start + int (c 0 * steps 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma fls_pow_conv_regpart:
  "fls_subdegree f \<ge> 0 \<Longrightarrow> fls_regpart (f ^ n) = (fls_regpart f) ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fls_subdegree f \<Longrightarrow> fls_regpart (f ^ n) = fls_regpart f ^ n
[PROOF STEP]
using fls_pow_subdegree_ge0[of f n] fls_pow_conv_fps_pow[of f n]
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree f \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
0 \<le> fls_subdegree f \<Longrightarrow> f ^ n = fps_to_fls (fls_regpart f ^ n)

goal (1 subgoal):
 1. 0 \<le> fls_subdegree f \<Longrightarrow> fls_regpart (f ^ n) = fls_regpart f ^ n
[PROOF STEP]
by    (intro fps_to_fls_eq_imp_fps_eq) simp


[STATEMENT]
lemma max_reg_Plus: "max_reg (Plus a1 a2) = max (max_reg a1) (max_reg a2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_reg (Plus a1 a2) = max (max_reg a1) (max_reg a2)
[PROOF STEP]
apply (simp add: max_reg_def Let_def max_absorb2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enumerate_regs a1 \<noteq> {} \<longrightarrow> enumerate_regs a2 \<noteq> {} \<longrightarrow> Some (Max (enumerate_regs a1 \<union> enumerate_regs a2)) = max (Some (Max (enumerate_regs a1))) (Some (Max (enumerate_regs a2)))
[PROOF STEP]
by (metis Max.union bot_option_def finite_enumerate_regs max_bot2 sup_Some sup_max)


[STATEMENT]
lemma poly_as_sum_of_monoms: "(\<Sum>i\<le>degree p. monom (coeff p i) i) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree p. monom (coeff p i) i) = p
[PROOF STEP]
by (intro poly_as_sum_of_monoms' order_refl)


[STATEMENT]
theorem meet_binary: "x \<sqinter> y = \<Sqinter>{x, y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y = \<Sqinter>{x, y}
[PROOF STEP]
by (rule meet_equality) (rule is_inf_binary)


[STATEMENT]
lemma mod_ring_divide64: "(mod_ring_rel64 ===> mod_ring_rel64 ===> mod_ring_rel64) (divide_p64 pp) (/)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64 ===> mod_ring_rel64) (divide_p64 pp) (/)
[PROOF STEP]
using mod_ring_inverse64 mod_ring_mult64[OF *]
[PROOF STATE]
proof (prove)
using this:
(mod_ring_rel64 ===> mod_ring_rel64) (inverse_p64 pp) inverse
(mod_ring_rel64 ===> mod_ring_rel64 ===> mod_ring_rel64) (mult_p64 pp) (*)

goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64 ===> mod_ring_rel64) (divide_p64 pp) (/)
[PROOF STEP]
unfolding divide_p64_def divide_mod_ring_def inverse_mod_ring_def[symmetric]
    rel_fun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. mod_ring_rel64 x y \<longrightarrow> mod_ring_rel64 (inverse_p64 pp x) (inverse y)
\<forall>x y. mod_ring_rel64 x y \<longrightarrow> (\<forall>xa ya. mod_ring_rel64 xa ya \<longrightarrow> mod_ring_rel64 (mult_p64 pp x xa) (y * ya))

goal (1 subgoal):
 1. \<forall>x y. mod_ring_rel64 x y \<longrightarrow> (\<forall>xa ya. mod_ring_rel64 xa ya \<longrightarrow> mod_ring_rel64 (mult_p64 pp x (inverse_p64 pp xa)) (y * inverse ya))
[PROOF STEP]
by blast


[STATEMENT]
lemma "filterlim (\<lambda>x::real. sqrt (x^2 + 1) - sqrt (x + 1)) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. sqrt (x\<^sup>2 + 1) - sqrt (x + 1) :> at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma mat_det_12_congruence [simp]:
  shows "mat_det_12 (congruence M A) (congruence M B) = (cor ((cmod (mat_det M))\<^sup>2)) * mat_det_12 A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_det_12 (congruence M A) (congruence M B) = cor ((cmod (mat_det M))\<^sup>2) * mat_det_12 A B
[PROOF STEP]
unfolding congruence_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_det_12 (mat_adj M *\<^sub>m\<^sub>m A *\<^sub>m\<^sub>m M) (mat_adj M *\<^sub>m\<^sub>m B *\<^sub>m\<^sub>m M) = cor ((cmod (mat_det M))\<^sup>2) * mat_det_12 A B
[PROOF STEP]
by ((subst mult_mm_assoc[symmetric])+, subst mat_det_12_mm_l, subst mat_det_12_mm_r, subst mat_det_adj) (auto simp add: field_simps complex_mult_cnj_cmod)


[STATEMENT]
lemma congruence_congruence:
  shows "congruence M1 (congruence M2 H) = congruence (M2 *\<^sub>m\<^sub>m M1) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. congruence M1 (congruence M2 H) = congruence (M2 *\<^sub>m\<^sub>m M1) H
[PROOF STEP]
unfolding congruence_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_adj M1 *\<^sub>m\<^sub>m (mat_adj M2 *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m M2) *\<^sub>m\<^sub>m M1 = mat_adj (M2 *\<^sub>m\<^sub>m M1) *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m (M2 *\<^sub>m\<^sub>m M1)
[PROOF STEP]
apply (subst mult_mm_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_adj M1 *\<^sub>m\<^sub>m (mat_adj M2 *\<^sub>m\<^sub>m H) *\<^sub>m\<^sub>m M2 *\<^sub>m\<^sub>m M1 = mat_adj (M2 *\<^sub>m\<^sub>m M1) *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m (M2 *\<^sub>m\<^sub>m M1)
[PROOF STEP]
apply (subst mult_mm_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_adj M1 *\<^sub>m\<^sub>m mat_adj M2 *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m M2 *\<^sub>m\<^sub>m M1 = mat_adj (M2 *\<^sub>m\<^sub>m M1) *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m (M2 *\<^sub>m\<^sub>m M1)
[PROOF STEP]
apply (subst mat_adj_mult_mm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_adj M1 *\<^sub>m\<^sub>m mat_adj M2 *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m M2 *\<^sub>m\<^sub>m M1 = mat_adj M1 *\<^sub>m\<^sub>m mat_adj M2 *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m (M2 *\<^sub>m\<^sub>m M1)
[PROOF STEP]
apply (subst mult_mm_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_adj M1 *\<^sub>m\<^sub>m mat_adj M2 *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m M2 *\<^sub>m\<^sub>m M1 = mat_adj M1 *\<^sub>m\<^sub>m mat_adj M2 *\<^sub>m\<^sub>m H *\<^sub>m\<^sub>m M2 *\<^sub>m\<^sub>m M1
[PROOF STEP]
by simp


[STATEMENT]
lemma infsum_cmult_right:
  fixes f :: "'a \<Rightarrow> 'b :: {t2_space, topological_semigroup_mult, semiring_0}"
  assumes \<open>c \<noteq> 0 \<Longrightarrow> f summable_on A\<close>
  shows \<open>infsum (\<lambda>x. c * f x) A = c * infsum f A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
proof (cases \<open>c=0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
 2. c \<noteq> (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = (0::'b)

goal (2 subgoals):
 1. c = (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
 2. c \<noteq> (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = (0::'b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = (0::'b)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A

goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'b)

goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'b)
[PROOF STEP]
have \<open>has_sum f A (infsum f A)\<close>
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'b)

goal (1 subgoal):
 1. has_sum f A (infsum f A)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
has_sum f A (infsum f A)

goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
has_sum f A (infsum f A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
has_sum f A (infsum f A)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A
[PROOF STEP]
by (auto intro!: infsumI has_sum_cmult_right)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. c * f x) = c * infsum f A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma if_eq_is_pr2: "\<lbrakk> p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda> x y. if (p1 x y = p2 x y) then (q1 x y) else (q2 x y)) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
have S1: "(\<lambda> x y. if (p1 x y = p2 x y) then (q1 x y) else (q2 x y)) = (\<lambda> x y. if (abs_of_diff (p1 x y) (p2 x y) = 0) then (q1 x y) else (q2 x y))" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) = (\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y)
[PROOF STEP]
by (simp add: abs_of_diff_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) = (\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y)

goal (1 subgoal):
 1. \<lbrakk>p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
assume A1: "p1 \<in> PrimRec2" and A2: "p2 \<in> PrimRec2"
[PROOF STATE]
proof (state)
this:
p1 \<in> PrimRec2
p2 \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
with abs_of_diff_is_pr
[PROOF STATE]
proof (chain)
picking this:
abs_of_diff \<in> PrimRec2
p1 \<in> PrimRec2
p2 \<in> PrimRec2
[PROOF STEP]
have S2: "(\<lambda> x y. abs_of_diff (p1 x y) (p2 x y)) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
abs_of_diff \<in> PrimRec2
p1 \<in> PrimRec2
p2 \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. abs_of_diff (p1 x y) (p2 x y)) \<in> PrimRec2
[PROOF STEP]
by prec0
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. abs_of_diff (p1 x y) (p2 x y)) \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
assume "q1 \<in> PrimRec2" and "q2 \<in> PrimRec2"
[PROOF STATE]
proof (state)
this:
q1 \<in> PrimRec2
q2 \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
with S2
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x y. abs_of_diff (p1 x y) (p2 x y)) \<in> PrimRec2
q1 \<in> PrimRec2
q2 \<in> PrimRec2
[PROOF STEP]
have "?R \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. abs_of_diff (p1 x y) (p2 x y)) \<in> PrimRec2
q1 \<in> PrimRec2
q2 \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
by (rule if_is_pr2)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y) \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>p1 \<in> PrimRec2; p2 \<in> PrimRec2; q1 \<in> PrimRec2; q2 \<in> PrimRec2\<rbrakk> \<Longrightarrow> (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) = (\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y)
(\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) = (\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y)
(\<lambda>x y. if abs_of_diff (p1 x y) (p2 x y) = 0 then q1 x y else q2 x y) \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. if p1 x y = p2 x y then q1 x y else q2 x y) \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_ln1_over_ln: "(\<lambda>n. ln(Suc n) / ln n) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ln (real (Suc n)) / ln (real n)) \<longlonglongrightarrow> 1
[PROOF STEP]
proof (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> 1
 2. \<forall>\<^sub>F x in sequentially. ?f x = ln (real (Suc x)) / ln (real x)
[PROOF STEP]
have "(\<lambda>n. ln(1 + 1/n) / ln n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ln (1 + 1 / real n) / ln (real n)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (rule Lim_transform_bound)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. norm (ln (1 + 1 / real n) / ln (real n)) \<le> norm (?g n)
 2. ?g \<longlonglongrightarrow> (0::?'c)
[PROOF STEP]
show "(inverse o real) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inverse \<circ> real) \<longlonglongrightarrow> 0
[PROOF STEP]
by (metis comp_def lim_inverse_n lim_explicit)
[PROOF STATE]
proof (state)
this:
(inverse \<circ> real) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. norm (ln (1 + 1 / real n) / ln (real n)) \<le> norm ((inverse \<circ> real) n)
[PROOF STEP]
show "\<forall>\<^sub>F n in sequentially. norm (ln (1 + 1 / n) / ln n) \<le> norm ((inverse \<circ> real) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. norm (ln (1 + 1 / real n) / ln (real n)) \<le> norm ((inverse \<circ> real) n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
fix n::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
assume n: "3 \<le> n"
[PROOF STATE]
proof (state)
this:
3 \<le> n

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 \<le> n
[PROOF STEP]
have "ln 3 \<le> ln n" and ln0: "0 \<le> ln n"
[PROOF STATE]
proof (prove)
using this:
3 \<le> n

goal (1 subgoal):
 1. ln 3 \<le> ln (real n) &&& 0 \<le> ln (real n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ln 3 \<le> ln (real n)
0 \<le> ln (real n)

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
with ln3_gt_1
[PROOF STATE]
proof (chain)
picking this:
1 < ln 3
ln 3 \<le> ln (real n)
0 \<le> ln (real n)
[PROOF STEP]
have "1/ ln n \<le> 1"
[PROOF STATE]
proof (prove)
using this:
1 < ln 3
ln 3 \<le> ln (real n)
0 \<le> ln (real n)

goal (1 subgoal):
 1. 1 / ln (real n) \<le> 1
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
1 / ln (real n) \<le> 1

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 / ln (real n) \<le> 1

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
have "ln (1 + 1 / real n) \<le> 1/n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (1 + 1 / real n) \<le> 1 / real n
[PROOF STEP]
by (simp add: ln_add_one_self_le_self)
[PROOF STATE]
proof (state)
this:
ln (1 + 1 / real n) \<le> 1 / real n

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 / ln (real n) \<le> 1
ln (1 + 1 / real n) \<le> 1 / real n
[PROOF STEP]
have "ln (1 + 1 / real n) * (1 / ln n) \<le> (1/n) * 1"
[PROOF STATE]
proof (prove)
using this:
1 / ln (real n) \<le> 1
ln (1 + 1 / real n) \<le> 1 / real n

goal (1 subgoal):
 1. ln (1 + 1 / real n) * (1 / ln (real n)) \<le> 1 / real n * 1
[PROOF STEP]
by (intro mult_mono) (use n in auto)
[PROOF STATE]
proof (state)
this:
ln (1 + 1 / real n) * (1 / ln (real n)) \<le> 1 / real n * 1

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> norm (ln (1 + 1 / real x) / ln (real x)) \<le> norm ((inverse \<circ> real) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ln (1 + 1 / real n) * (1 / ln (real n)) \<le> 1 / real n * 1
[PROOF STEP]
show "norm (ln (1 + 1 / n) / ln n) \<le> norm ((inverse \<circ> real) n)"
[PROOF STATE]
proof (prove)
using this:
ln (1 + 1 / real n) * (1 / ln (real n)) \<le> 1 / real n * 1

goal (1 subgoal):
 1. norm (ln (1 + 1 / real n) / ln (real n)) \<le> norm ((inverse \<circ> real) n)
[PROOF STEP]
by (simp add: field_simps ln0)
[PROOF STATE]
proof (state)
this:
norm (ln (1 + 1 / real n) / ln (real n)) \<le> norm ((inverse \<circ> real) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. norm (ln (1 + 1 / real n) / ln (real n)) \<le> norm ((inverse \<circ> real) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (1 + 1 / real n) / ln (real n)) \<longlonglongrightarrow> 0

goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> 1
 2. \<forall>\<^sub>F x in sequentially. ?f x = ln (real (Suc x)) / ln (real x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ln (1 + 1 / real n) / ln (real n)) \<longlonglongrightarrow> 0
[PROOF STEP]
show "(\<lambda>n. 1 + ln(1 + 1/n) / ln n) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ln (1 + 1 / real n) / ln (real n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. 1 + ln (1 + 1 / real n) / ln (real n)) \<longlonglongrightarrow> 1
[PROOF STEP]
by (metis (full_types) add.right_neutral tendsto_add_const_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 + ln (1 + 1 / real n) / ln (real n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 1 + ln (1 + 1 / real x) / ln (real x) = ln (real (Suc x)) / ln (real x)
[PROOF STEP]
show "\<forall>\<^sub>F k in sequentially. 1 + ln (1 + 1 / k) / ln k = ln(Suc k) / ln k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F k in sequentially. 1 + ln (1 + 1 / real k) / ln (real k) = ln (real (Suc k)) / ln (real k)
[PROOF STEP]
by (simp add: field_split_simps ln_div eventually_sequentiallyI [of 2])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F k in sequentially. 1 + ln (1 + 1 / real k) / ln (real k) = ln (real (Suc k)) / ln (real k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Gromov_product_isometry:
  assumes "isometry_on UNIV f"
  shows "Gromov_product_at (f x) (f y) (f z) = Gromov_product_at x y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_product_at (f x) (f y) (f z) = Gromov_product_at x y z
[PROOF STEP]
unfolding Gromov_product_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dist (f x) (f y) + dist (f x) (f z) - dist (f y) (f z)) / 2 = (dist x y + dist x z - dist y z) / 2
[PROOF STEP]
by (simp add: isometry_onD[OF assms])


[STATEMENT]
lemma complement_bibd_index:
  assumes "ps \<subseteq> \<V>"
  assumes "card ps = 2"
  shows "\<B>\<^sup>C index ps = \<b> + \<Lambda> - 2*\<r>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B>\<^sup>C index ps = \<b> + \<Lambda> - 2 * \<r>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<B>\<^sup>C index ps = \<b> + \<Lambda> - 2 * \<r>
[PROOF STEP]
obtain x y where set: "ps = {x, y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. ps = {x, y} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using b_non_zero bibd_block_number diff_is_0_eq incomplete
    mult_0_right nat_less_le design_points_nempty assms
[PROOF STATE]
proof (prove)
using this:
\<b> \<noteq> 0
\<b> = \<Lambda> * \<v> * (\<v> - 1) div (\<k> * (\<k> - 1))
(?m - ?n = 0) = (?m \<le> ?n)
\<k> < \<v>
?m * 0 = 0
(?m < ?n) = (?m \<le> ?n \<and> ?m \<noteq> ?n)
\<V> \<noteq> {}
ps \<subseteq> \<V>
card ps = 2

goal (1 subgoal):
 1. (\<And>x y. ps = {x, y} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis card_2_iff)
[PROOF STATE]
proof (state)
this:
ps = {x, y}

goal (1 subgoal):
 1. \<B>\<^sup>C index ps = \<b> + \<Lambda> - 2 * \<r>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ps = {x, y}
[PROOF STEP]
have "x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
ps = {x, y}

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ps = {x, y}
ps \<subseteq> \<V>
card ps = 2

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

goal (1 subgoal):
 1. \<B>\<^sup>C index ps = \<b> + \<Lambda> - 2 * \<r>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. \<B>\<^sup>C index ps = \<b> + \<Lambda> - 2 * \<r>
[PROOF STEP]
using comp_params_index_pair assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
\<lbrakk>{?x, ?y} \<subseteq> \<V>; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> \<B>\<^sup>C index {?x, ?y} = \<b> + \<Lambda> - 2 * \<r>
ps \<subseteq> \<V>
card ps = 2

goal (1 subgoal):
 1. \<B>\<^sup>C index ps = \<b> + \<Lambda> - 2 * \<r>
[PROOF STEP]
by (simp add: set)
[PROOF STATE]
proof (state)
this:
\<B>\<^sup>C index ps = \<b> + \<Lambda> - 2 * \<r>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PredicatePairFunction:
fixes
  P::"'a \<Rightarrow> 'b \<Rightarrow> 'c \<Rightarrow> 'd \<Rightarrow> bool"
assumes
  A1: "\<forall>x1 x2 . \<exists>y1 y2 . (P x1 x2 y1 y2)"
shows
  "\<exists>f . \<forall>x1 x2 . \<exists>y1 y2 .
    (f x1 x2) = (y1, y2)
    \<and> (P x1 x2 (fst (f x1 x2)) (snd (f x1 x2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
define P' where "P' x y = P (fst x) (snd x) (fst y) (snd y)" for x y
[PROOF STATE]
proof (state)
this:
P' ?x ?y = P (fst ?x) (snd ?x) (fst ?y) (snd ?y)

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
hence "\<forall>x. \<exists>y. P' x  y"
[PROOF STATE]
proof (prove)
using this:
P' ?x ?y = P (fst ?x) (snd ?x) (fst ?y) (snd ?y)

goal (1 subgoal):
 1. \<forall>x. \<exists>y. P' x y
[PROOF STEP]
using A1
[PROOF STATE]
proof (prove)
using this:
P' ?x ?y = P (fst ?x) (snd ?x) (fst ?y) (snd ?y)
\<forall>x1 x2. \<exists>y1 y2. P x1 x2 y1 y2

goal (1 subgoal):
 1. \<forall>x. \<exists>y. P' x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. \<exists>y. P' x y

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
hence "\<exists>f. \<forall>x. P' x (f x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. \<exists>y. P' x y

goal (1 subgoal):
 1. \<exists>f. \<forall>x. P' x (f x)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>f. \<forall>x. P' x (f x)

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. \<forall>x. P' x (f x)
[PROOF STEP]
obtain f where "\<forall>x. P' x (f x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<forall>x. P' x (f x)

goal (1 subgoal):
 1. (\<And>f. \<forall>x. P' x (f x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x. P' x (f x)

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x. P' x (f x)

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
define f' where "f' x1 x2 = f (x1, x2)" for x1 x2
[PROOF STATE]
proof (state)
this:
f' ?x1.0 ?x2.0 = f (?x1.0, ?x2.0)

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. P' x (f x)
f' ?x1.0 ?x2.0 = f (?x1.0, ?x2.0)
[PROOF STEP]
have "\<forall>x. P' x (f' (fst x) (snd x))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. P' x (f x)
f' ?x1.0 ?x2.0 = f (?x1.0, ?x2.0)

goal (1 subgoal):
 1. \<forall>x. P' x (f' (fst x) (snd x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. P' x (f' (fst x) (snd x))

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
hence "\<exists>f'. \<forall>x. P' x (f' (fst x) (snd x))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. P' x (f' (fst x) (snd x))

goal (1 subgoal):
 1. \<exists>f'. \<forall>x. P' x (f' (fst x) (snd x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f'. \<forall>x. P' x (f' (fst x) (snd x))

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>f'. \<forall>x. P' x (f' (fst x) (snd x))

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
using P'_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f'. \<forall>x. P' x (f' (fst x) (snd x))
P' ?x ?y = P (fst ?x) (snd ?x) (fst ?y) (snd ?y)

goal (1 subgoal):
 1. \<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f. \<forall>x1 x2. \<exists>y1 y2. f x1 x2 = (y1, y2) \<and> P x1 x2 (fst (f x1 x2)) (snd (f x1 x2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_mask:
  \<open>n < mask n\<close> if \<open>Suc 0 < n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
define m where \<open>m = n - 2\<close>
[PROOF STATE]
proof (state)
this:
m = n - 2

goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
Suc 0 < n
m = n - 2
[PROOF STEP]
have *: \<open>n = m + 2\<close>
[PROOF STATE]
proof (prove)
using this:
Suc 0 < n
m = n - 2

goal (1 subgoal):
 1. n = m + 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n = m + 2

goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
have \<open>Suc (Suc (Suc m)) < 4 * 2 ^ m\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (Suc (Suc m)) < 4 * 2 ^ m
[PROOF STEP]
by (induction m) simp_all
[PROOF STATE]
proof (state)
this:
Suc (Suc (Suc m)) < 4 * 2 ^ m

goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (Suc (Suc m)) < 4 * 2 ^ m
[PROOF STEP]
have \<open>Suc (m + 2) < Suc (mask (m + 2))\<close>
[PROOF STATE]
proof (prove)
using this:
Suc (Suc (Suc m)) < 4 * 2 ^ m

goal (1 subgoal):
 1. Suc (m + 2) < Suc (mask (m + 2))
[PROOF STEP]
by (simp add: Suc_mask_eq_exp)
[PROOF STATE]
proof (state)
this:
Suc (m + 2) < Suc (mask (m + 2))

goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (m + 2) < Suc (mask (m + 2))
[PROOF STEP]
have \<open>m + 2 < mask (m + 2)\<close>
[PROOF STATE]
proof (prove)
using this:
Suc (m + 2) < Suc (mask (m + 2))

goal (1 subgoal):
 1. m + 2 < mask (m + 2)
[PROOF STEP]
by (simp add: less_le)
[PROOF STATE]
proof (state)
this:
m + 2 < mask (m + 2)

goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
n = m + 2
m + 2 < mask (m + 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = m + 2
m + 2 < mask (m + 2)

goal (1 subgoal):
 1. n < mask n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < mask n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hd_rotate_conv_nth:
  assumes "xs \<noteq> []" shows "hd(rotate n xs) = xs!(n mod length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (rotate n xs) = xs ! (n mod length xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hd (rotate n xs) = xs ! (n mod length xs)
[PROOF STEP]
have "n mod length xs < length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n mod length xs < length xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. n mod length xs < length xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n mod length xs < length xs

goal (1 subgoal):
 1. hd (rotate n xs) = xs ! (n mod length xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n mod length xs < length xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n mod length xs < length xs

goal (1 subgoal):
 1. hd (rotate n xs) = xs ! (n mod length xs)
[PROOF STEP]
by (metis drop_eq_Nil hd_append2 hd_drop_conv_nth leD rotate_drop_take)
[PROOF STATE]
proof (state)
this:
hd (rotate n xs) = xs ! (n mod length xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enum_works_finite:
  fixes N :: "nat set"
  assumes "finite N"
  shows "N = enum N ` {..<card N} \<and> strict_mono_on {..<card N} (enum N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N = enum N ` {..<card N} \<and> strict_mono_on {..<card N} (enum N)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite N

goal (1 subgoal):
 1. N = enum N ` {..<card N} \<and> strict_mono_on {..<card N} (enum N)
[PROOF STEP]
by (metis bij_betw_imp_surj_on finite_bij_enumerate finite_enumerate_mono lessThan_iff strict_mono_onI)


[STATEMENT]
lemma open_Collect_neq:
  fixes f g :: "'a::topological_space \<Rightarrow> 'b::t2_space"
  assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
  shows "open {x. f x \<noteq> g x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x. f x \<noteq> g x}
[PROOF STEP]
proof (rule openI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. f x \<noteq> g x} \<Longrightarrow> \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. f x \<noteq> g x} \<Longrightarrow> \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}
[PROOF STEP]
assume "t \<in> {x. f x \<noteq> g x}"
[PROOF STATE]
proof (state)
this:
t \<in> {x. f x \<noteq> g x}

goal (1 subgoal):
 1. \<And>x. x \<in> {x. f x \<noteq> g x} \<Longrightarrow> \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> {x. f x \<noteq> g x}
[PROOF STEP]
obtain U V where *: "open U" "open V" "f t \<in> U" "g t \<in> V" "U \<inter> V = {}"
[PROOF STATE]
proof (prove)
using this:
t \<in> {x. f x \<noteq> g x}

goal (1 subgoal):
 1. (\<And>U V. \<lbrakk>open U; open V; f t \<in> U; g t \<in> V; U \<inter> V = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: separation_t2)
[PROOF STATE]
proof (state)
this:
open U
open V
f t \<in> U
g t \<in> V
U \<inter> V = {}

goal (1 subgoal):
 1. \<And>x. x \<in> {x. f x \<noteq> g x} \<Longrightarrow> \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}
[PROOF STEP]
with open_vimage[OF \<open>open U\<close> f] open_vimage[OF \<open>open V\<close> g]
[PROOF STATE]
proof (chain)
picking this:
open (f -` U)
open (g -` V)
open U
open V
f t \<in> U
g t \<in> V
U \<inter> V = {}
[PROOF STEP]
show "\<exists>T. open T \<and> t \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}"
[PROOF STATE]
proof (prove)
using this:
open (f -` U)
open (g -` V)
open U
open V
f t \<in> U
g t \<in> V
U \<inter> V = {}

goal (1 subgoal):
 1. \<exists>T. open T \<and> t \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}
[PROOF STEP]
by (intro exI[of _ "f -` U \<inter> g -` V"]) auto
[PROOF STATE]
proof (state)
this:
\<exists>T. open T \<and> t \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_at_point_scalar_mult:
  assumes "a \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "A \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "k \<in> carrier R"
  shows "eval_at_point R a (poly_scalar_mult R k A) = k \<otimes>\<^bsub>R\<^esub> (eval_at_point R a A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_at_point R a (poly_scalar_mult R k A) = k \<otimes> eval_at_point R a A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (R\<^bsup>n\<^esup>)
A \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
k \<in> carrier R

goal (1 subgoal):
 1. eval_at_point R a (poly_scalar_mult R k A) = k \<otimes> eval_at_point R a A
[PROOF STEP]
unfolding eval_at_point_def total_eval_def eval_in_ring_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (R\<^bsup>n\<^esup>)
A \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
k \<in> carrier R

goal (1 subgoal):
 1. poly_eval R UNIV (\<lambda>i. if i < length a then a ! i else \<zero>) (poly_scalar_mult R k A) {#} = k \<otimes> poly_eval R UNIV (\<lambda>i. if i < length a then a ! i else \<zero>) A {#}
[PROOF STEP]
using  R.poly_eval_scalar_mult[of k "(\<lambda>i. if i < length a then a ! i else \<zero>)" A "{..<n}" UNIV]
        poly_scalar_mult_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (R\<^bsup>n\<^esup>)
A \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
k \<in> carrier R
\<lbrakk>k \<in> carrier R; (\<lambda>i. if i < length a then a ! i else \<zero>) \<in> UNIV \<rightarrow> carrier R; A \<in> carrier R [\<X>\<^bsub>{..<n}\<^esub>]\<rbrakk> \<Longrightarrow> poly_eval R UNIV (\<lambda>i. if i < length a then a ! i else \<zero>) (poly_scalar_mult R k A) = poly_scalar_mult R k (poly_eval R UNIV (\<lambda>i. if i < length a then a ! i else \<zero>) A)
poly_scalar_mult ?R ?c ?P = (\<lambda>m. ?c \<otimes>\<^bsub>?R\<^esub> ?P m)

goal (1 subgoal):
 1. poly_eval R UNIV (\<lambda>i. if i < length a then a ! i else \<zero>) (poly_scalar_mult R k A) {#} = k \<otimes> poly_eval R UNIV (\<lambda>i. if i < length a then a ! i else \<zero>) A {#}
[PROOF STEP]
by (smt R.Pring_car cartesian_power_car_memE cartesian_power_car_memE' R.closed_funI coord_ring_def R.zero_closed)


[STATEMENT]
lemma multiplicative_function_divide:
  fixes f :: "nat \<Rightarrow> 'a :: field"
  assumes "multiplicative_function f"  "multiplicative_function g"
  shows   "multiplicative_function (\<lambda>n. f n / g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. f n / g n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. f n / g n)
[PROOF STEP]
have "multiplicative_function (\<lambda>n. f n * inverse (g n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. f n * inverse (g n))
[PROOF STEP]
by (intro multiplicative_function_mult multiplicative_function_inverse assms)
[PROOF STATE]
proof (state)
this:
multiplicative_function (\<lambda>n. f n * inverse (g n))

goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. f n / g n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicative_function (\<lambda>n. f n * inverse (g n))

goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. f n / g n)
[PROOF STEP]
have "(\<lambda>n. f n * inverse (g n)) = (\<lambda>n. f n / g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f n * inverse (g n)) = (\<lambda>n. f n / g n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f n * inverse (g n)) = (\<lambda>n. f n / g n)

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

goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. f n / g n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
multiplicative_function (\<lambda>n. f n / g n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_mult_of_nat [simp]: "lookup (of_nat n * m) k = n * lookup m k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
have "of_nat n * m = (\<Sum>i<n. m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n * m = (\<Sum>i<n. m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat n * m = (\<Sum>i<n. m)

goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat n * m = (\<Sum>i<n. m)

goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
have "lookup \<dots> k = (\<Sum>i<n. lookup m k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (\<Sum>i<n. m) k = (\<Sum>i<n. lookup m k)
[PROOF STEP]
by (simp only: lookup_sum)
[PROOF STATE]
proof (state)
this:
lookup (\<Sum>i<n. m) k = (\<Sum>i<n. lookup m k)

goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup (\<Sum>i<n. m) k = (\<Sum>i<n. lookup m k)

goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
have "\<dots> = n * lookup m k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. lookup m k) = n * lookup m k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. lookup m k) = n * lookup m k

goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lookup (of_nat n * m) k = n * lookup m k

goal (1 subgoal):
 1. lookup (of_nat n * m) k = n * lookup m k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lookup (of_nat n * m) k = n * lookup m k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma graph_partition_edges_card :
  assumes "finite (uverts G)" and "uwellformed G" and "A \<subseteq> (uverts G)"
  shows "card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G.  e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (uverts G)
uwellformed G
A \<subseteq> uverts G

goal (1 subgoal):
 1. card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
have "uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G.  e \<subseteq> (uverts G) - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> ((uverts G) - A) \<noteq> {}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
using assms uwellformed_def
[PROOF STATE]
proof (prove)
using this:
finite (uverts G)
uwellformed G
A \<subseteq> uverts G
uwellformed ?G \<equiv> \<forall>e\<in>uedges ?G. card e = 2 \<and> (\<forall>u\<in>e. u \<in> uverts ?G)

goal (1 subgoal):
 1. uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
have "{e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G.  e \<subseteq> uverts G - A} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G. e \<subseteq> uverts G - A} = {}
[PROOF STEP]
using assms uwellformed_def
[PROOF STATE]
proof (prove)
using this:
finite (uverts G)
uwellformed G
A \<subseteq> uverts G
uwellformed ?G \<equiv> \<forall>e\<in>uedges ?G. card e = 2 \<and> (\<forall>u\<in>e. u \<in> uverts ?G)

goal (1 subgoal):
 1. {e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G. e \<subseteq> uverts G - A} = {}
[PROOF STEP]
by (smt (verit, ccfv_SIG) Diff_disjoint Int_subset_iff card.empty disjoint_iff mem_Collect_eq nat.simps(3) nat_1_add_1 plus_1_eq_Suc prod.sel(2) subset_empty)
[PROOF STATE]
proof (state)
this:
{e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G. e \<subseteq> uverts G - A} = {}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G. e \<subseteq> uverts G - A} = {}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
have "({e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G.  e \<subseteq> uverts G - A}) \<inter> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A}) \<inter> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}} = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
({e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A}) \<inter> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}} = {}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
({e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A}) \<inter> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}} = {}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
have "finite {e \<in> uedges G. e \<subseteq> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {e \<in> uedges G. e \<subseteq> A}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (uverts G)
uwellformed G
A \<subseteq> uverts G

goal (1 subgoal):
 1. finite {e \<in> uedges G. e \<subseteq> A}
[PROOF STEP]
by (simp add: finite_subset)
[PROOF STATE]
proof (state)
this:
finite {e \<in> uedges G. e \<subseteq> A}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {e \<in> uedges G. e \<subseteq> A}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
have "finite {e \<in> uedges G.  e \<subseteq> uverts G - A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {e \<in> uedges G. e \<subseteq> uverts G - A}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (uverts G)
uwellformed G
A \<subseteq> uverts G

goal (1 subgoal):
 1. finite {e \<in> uedges G. e \<subseteq> uverts G - A}
[PROOF STEP]
by (simp add: finite_subset)
[PROOF STATE]
proof (state)
this:
finite {e \<in> uedges G. e \<subseteq> uverts G - A}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {e \<in> uedges G. e \<subseteq> uverts G - A}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
have "finite {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
using assms finite_verts_edges
[PROOF STATE]
proof (prove)
using this:
finite (uverts G)
uwellformed G
A \<subseteq> uverts G
\<lbrakk>uwellformed ?G; finite (uverts ?G)\<rbrakk> \<Longrightarrow> finite (uedges ?G)

goal (1 subgoal):
 1. finite {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}

goal (1 subgoal):
 1. \<lbrakk>finite (uverts G); uwellformed G; A \<subseteq> uverts G\<rbrakk> \<Longrightarrow> card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
{e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G. e \<subseteq> uverts G - A} = {}
({e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A}) \<inter> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}} = {}
finite {e \<in> uedges G. e \<subseteq> A}
finite {e \<in> uedges G. e \<subseteq> uverts G - A}
finite {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
{e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G. e \<subseteq> uverts G - A} = {}
({e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A}) \<inter> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}} = {}
finite {e \<in> uedges G. e \<subseteq> A}
finite {e \<in> uedges G. e \<subseteq> uverts G - A}
finite {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}

goal (1 subgoal):
 1. card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
using assms Finite_Set.card_Un_disjoint
[PROOF STATE]
proof (prove)
using this:
uedges G = {e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A} \<union> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
{e \<in> uedges G. e \<subseteq> A} \<inter> {e \<in> uedges G. e \<subseteq> uverts G - A} = {}
({e \<in> uedges G. e \<subseteq> A} \<union> {e \<in> uedges G. e \<subseteq> uverts G - A}) \<inter> {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}} = {}
finite {e \<in> uedges G. e \<subseteq> A}
finite {e \<in> uedges G. e \<subseteq> uverts G - A}
finite {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
finite (uverts G)
uwellformed G
A \<subseteq> uverts G
\<lbrakk>finite ?A; finite ?B; ?A \<inter> ?B = {}\<rbrakk> \<Longrightarrow> card (?A \<union> ?B) = card ?A + card ?B

goal (1 subgoal):
 1. card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}
[PROOF STEP]
by (smt (verit, best) finite_UnI)
[PROOF STATE]
proof (state)
this:
card (uedges G) = card {e \<in> uedges G. e \<subseteq> A} + card {e \<in> uedges G. e \<subseteq> uverts G - A} + card {e \<in> uedges G. e \<inter> A \<noteq> {} \<and> e \<inter> (uverts G - A) \<noteq> {}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parabolic_isometryD:
  assumes "parabolic_isometry f"
  shows "isometry f"
        "\<not>bounded {(f^^n) x|n. True}"
        "stable_translation_length f = 0"
        "\<not>elliptic_isometry f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (isometry f &&& \<not> bounded {(f ^^ n) x |n. True}) &&& stable_translation_length f = 0 &&& \<not> elliptic_isometry f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
parabolic_isometry f

goal (1 subgoal):
 1. (isometry f &&& \<not> bounded {(f ^^ n) x |n. True}) &&& stable_translation_length f = 0 &&& \<not> elliptic_isometry f
[PROOF STEP]
unfolding parabolic_isometry_def
[PROOF STATE]
proof (prove)
using this:
isometry f \<and> \<not> elliptic_isometry f \<and> stable_translation_length f = 0

goal (1 subgoal):
 1. (isometry f &&& \<not> bounded {(f ^^ n) x |n. True}) &&& stable_translation_length f = 0 &&& \<not> elliptic_isometry f
[PROOF STEP]
by auto


[STATEMENT]
lemma conjugate_preserve_poincare_line [simp]:
  assumes "u \<in> unit_disc" "v \<in> unit_disc" "u \<noteq> v"
  shows "poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
have "conjugate u \<noteq> conjugate v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate u \<noteq> conjugate v
[PROOF STEP]
using \<open>u \<noteq> v\<close>
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v

goal (1 subgoal):
 1. conjugate u \<noteq> conjugate v
[PROOF STEP]
by (auto simp add: conjugate_inj)
[PROOF STATE]
proof (state)
this:
conjugate u \<noteq> conjugate v

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
conjugate u \<noteq> conjugate v

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
have "conjugate u \<in> unit_disc" "conjugate v \<in> unit_disc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate u \<in> unit_disc &&& conjugate v \<in> unit_disc
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> v

goal (1 subgoal):
 1. conjugate u \<in> unit_disc &&& conjugate v \<in> unit_disc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate u \<in> unit_disc
conjugate v \<in> unit_disc

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
conjugate u \<in> unit_disc
conjugate v \<in> unit_disc

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
have "conjugate u \<in> circline_set (conjugate_circline (poincare_line u v))"
       "conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate u \<in> circline_set (conjugate_circline (poincare_line u v)) &&& conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))
[PROOF STEP]
using \<open>u \<noteq> v\<close>
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v

goal (1 subgoal):
 1. conjugate u \<in> circline_set (conjugate_circline (poincare_line u v)) &&& conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
conjugate u \<in> circline_set (conjugate_circline (poincare_line u v))
conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
conjugate u \<in> circline_set (conjugate_circline (poincare_line u v))
conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
have "is_poincare_line (conjugate_circline (poincare_line u v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poincare_line (conjugate_circline (poincare_line u v))
[PROOF STEP]
using is_poincare_line_poincare_line[OF \<open>u \<noteq> v\<close>]
[PROOF STATE]
proof (prove)
using this:
is_poincare_line (poincare_line u v)

goal (1 subgoal):
 1. is_poincare_line (conjugate_circline (poincare_line u v))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_poincare_line (conjugate_circline (poincare_line u v))

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
conjugate u \<noteq> conjugate v
conjugate u \<in> unit_disc
conjugate v \<in> unit_disc
conjugate u \<in> circline_set (conjugate_circline (poincare_line u v))
conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))
is_poincare_line (conjugate_circline (poincare_line u v))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
conjugate u \<noteq> conjugate v
conjugate u \<in> unit_disc
conjugate v \<in> unit_disc
conjugate u \<in> circline_set (conjugate_circline (poincare_line u v))
conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))
is_poincare_line (conjugate_circline (poincare_line u v))

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
using unique_poincare_line[of "conjugate u" "conjugate v" "conjugate_circline (poincare_line u v)"]
[PROOF STATE]
proof (prove)
using this:
conjugate u \<noteq> conjugate v
conjugate u \<in> unit_disc
conjugate v \<in> unit_disc
conjugate u \<in> circline_set (conjugate_circline (poincare_line u v))
conjugate v \<in> circline_set (conjugate_circline (poincare_line u v))
is_poincare_line (conjugate_circline (poincare_line u v))
\<lbrakk>conjugate u \<noteq> conjugate v; conjugate u \<in> unit_disc; conjugate v \<in> unit_disc; conjugate u \<in> circline_set (conjugate_circline (poincare_line u v)); conjugate v \<in> circline_set (conjugate_circline (poincare_line u v)); is_poincare_line (conjugate_circline (poincare_line u v))\<rbrakk> \<Longrightarrow> conjugate_circline (poincare_line u v) = poincare_line (conjugate u) (conjugate v)

goal (1 subgoal):
 1. poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poincare_line (conjugate u) (conjugate v) = conjugate_circline (poincare_line u v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Arccos_minus1: "Arccos(-1) = pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arccos (- 1) = complex_of_real pi
[PROOF STEP]
by (rule Arccos_unique) auto


[STATEMENT]
lemma choose_int_suc[simp]:
  "choose_int (Suc n) i = choose_int n (i-1) + choose_int n i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
proof(cases "nat i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. nat i = 0 \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
 2. \<And>nata. nat i = Suc nata \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
nat i = 0

goal (2 subgoals):
 1. nat i = 0 \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
 2. \<And>nata. nat i = Suc nata \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nat i = 0

goal (1 subgoal):
 1. choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
by (simp add:choose_int_def)
[PROOF STATE]
proof (state)
this:
choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i

goal (1 subgoal):
 1. \<And>nata. nat i = Suc nata \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nata. nat i = Suc nata \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
case (Suc v)
[PROOF STATE]
proof (state)
this:
nat i = Suc v

goal (1 subgoal):
 1. \<And>nata. nat i = Suc nata \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
hence "nat (i - 1) = v" "i\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
nat i = Suc v

goal (1 subgoal):
 1. nat (i - 1) = v &&& i \<noteq> 0
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
nat (i - 1) = v
i \<noteq> 0

goal (1 subgoal):
 1. \<And>nata. nat i = Suc nata \<Longrightarrow> choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nat (i - 1) = v
i \<noteq> 0

goal (1 subgoal):
 1. choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i
[PROOF STEP]
unfolding choose_int_def Suc
[PROOF STATE]
proof (prove)
using this:
nat (i - 1) = v
i \<noteq> 0

goal (1 subgoal):
 1. (if i < 0 then 0 else Suc n choose Suc v) = (if i - 1 < 0 then 0 else n choose nat (i - 1)) + (if i < 0 then 0 else n choose Suc v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
choose_int (Suc n) i = choose_int n (i - 1) + choose_int n i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_not_dvd_fact:
assumes kn: "k < n" and prime_n: "prime n"
shows "\<not> n dvd fact k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> n dvd fact k
[PROOF STEP]
using kn
[PROOF STATE]
proof (prove)
using this:
k < n

goal (1 subgoal):
 1. \<not> n dvd fact k
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < n \<Longrightarrow> \<not> n dvd fact 0
 2. \<And>k. \<lbrakk>k < n \<Longrightarrow> \<not> n dvd fact k; Suc k < n\<rbrakk> \<Longrightarrow> \<not> n dvd fact (Suc k)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < n

goal (2 subgoals):
 1. 0 < n \<Longrightarrow> \<not> n dvd fact 0
 2. \<And>k. \<lbrakk>k < n \<Longrightarrow> \<not> n dvd fact k; Suc k < n\<rbrakk> \<Longrightarrow> \<not> n dvd fact (Suc k)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. \<not> n dvd fact 0
[PROOF STEP]
using prime_n
[PROOF STATE]
proof (prove)
using this:
0 < n
prime n

goal (1 subgoal):
 1. \<not> n dvd fact 0
[PROOF STEP]
unfolding prime_nat_iff
[PROOF STATE]
proof (prove)
using this:
0 < n
1 < n \<and> (\<forall>m. m dvd n \<longrightarrow> m = 1 \<or> m = n)

goal (1 subgoal):
 1. \<not> n dvd fact 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> n dvd fact 0

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < n \<Longrightarrow> \<not> n dvd fact k; Suc k < n\<rbrakk> \<Longrightarrow> \<not> n dvd fact (Suc k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < n \<Longrightarrow> \<not> n dvd fact k; Suc k < n\<rbrakk> \<Longrightarrow> \<not> n dvd fact (Suc k)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
k < n \<Longrightarrow> \<not> n dvd fact k
Suc k < n

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < n \<Longrightarrow> \<not> n dvd fact k; Suc k < n\<rbrakk> \<Longrightarrow> \<not> n dvd fact (Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> n dvd fact (Suc k)
[PROOF STEP]
proof (rule ccontr, unfold not_not)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
assume "n dvd fact (Suc k)"
[PROOF STATE]
proof (state)
this:
n dvd fact (Suc k)

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n dvd fact (Suc k)

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
have "... = Suc k * \<Prod>{1..k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (Suc k) = Suc k * \<Prod>{1..k}
[PROOF STEP]
unfolding fact_Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (Suc k) * fact k = Suc k * \<Prod>{1..k}
[PROOF STEP]
unfolding fact_prod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (Suc k) * of_nat (\<Prod>{1..k}) = Suc k * \<Prod>{1..k}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact (Suc k) = Suc k * \<Prod>{1..k}

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n dvd Suc k * \<Prod>{1..k}
[PROOF STEP]
have "n dvd Suc k * \<Prod>{1..k}"
[PROOF STATE]
proof (prove)
using this:
n dvd Suc k * \<Prod>{1..k}

goal (1 subgoal):
 1. n dvd Suc k * \<Prod>{1..k}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n dvd Suc k * \<Prod>{1..k}

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
hence "n dvd Suc k \<or> n dvd \<Prod>{1..k}"
[PROOF STATE]
proof (prove)
using this:
n dvd Suc k * \<Prod>{1..k}

goal (1 subgoal):
 1. n dvd Suc k \<or> n dvd \<Prod>{1..k}
[PROOF STEP]
using prime_dvd_mult_eq_nat[OF prime_n]
[PROOF STATE]
proof (prove)
using this:
n dvd Suc k * \<Prod>{1..k}
(n dvd ?a * ?b) = (n dvd ?a \<or> n dvd ?b)

goal (1 subgoal):
 1. n dvd Suc k \<or> n dvd \<Prod>{1..k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n dvd Suc k \<or> n dvd \<Prod>{1..k}

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n dvd Suc k \<or> n dvd \<Prod>{1..k}

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
have  "\<not> n dvd Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> n dvd Suc k
[PROOF STEP]
by (simp add: Suc.prems(1) nat_dvd_not_less)
[PROOF STATE]
proof (state)
this:
\<not> n dvd Suc k

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> n dvd Suc k

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
hence "\<not> n dvd \<Prod>{1..k}"
[PROOF STATE]
proof (prove)
using this:
\<not> n dvd Suc k

goal (1 subgoal):
 1. \<not> n dvd \<Prod>{1..k}
[PROOF STEP]
using Suc.hyps Suc.prems
[PROOF STATE]
proof (prove)
using this:
\<not> n dvd Suc k
k < n \<Longrightarrow> \<not> n dvd fact k
Suc k < n

goal (1 subgoal):
 1. \<not> n dvd \<Prod>{1..k}
[PROOF STEP]
using Suc_lessD fact_prod[of k]
[PROOF STATE]
proof (prove)
using this:
\<not> n dvd Suc k
k < n \<Longrightarrow> \<not> n dvd fact k
Suc k < n
Suc ?m < ?n \<Longrightarrow> ?m < ?n
fact k = of_nat (\<Prod>{1..k})

goal (1 subgoal):
 1. \<not> n dvd \<Prod>{1..k}
[PROOF STEP]
by (metis of_nat_id)
[PROOF STATE]
proof (state)
this:
\<not> n dvd \<Prod>{1..k}

goal (1 subgoal):
 1. n dvd fact (Suc k) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n dvd Suc k \<or> n dvd \<Prod>{1..k}
\<not> n dvd Suc k
\<not> n dvd \<Prod>{1..k}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
n dvd Suc k \<or> n dvd \<Prod>{1..k}
\<not> n dvd Suc k
\<not> n dvd \<Prod>{1..k}

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> n dvd fact (Suc k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zeta_partial_sum_01_asymp_equiv:
  assumes "s \<in> {0<..<1}"
  shows "sum_upto (\<lambda>n. n powr -s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
from zeta_partial_sum_le_pos'[of s] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < s; s \<noteq> 1\<rbrakk> \<Longrightarrow> \<exists>c>0. \<forall>x\<ge>1. \<bar>sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)\<bar> \<le> c
s \<in> {0<..<1}
[PROOF STEP]
obtain c where
    c: "c > 0" "\<forall>x\<ge>1. \<bar>sum_upto (\<lambda>x. real x powr -s) x - x powr (1 - s) / (1 - s)\<bar> \<le> c"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < s; s \<noteq> 1\<rbrakk> \<Longrightarrow> \<exists>c>0. \<forall>x\<ge>1. \<bar>sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)\<bar> \<le> c
s \<in> {0<..<1}

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>x\<ge>1. \<bar>sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)\<bar> \<le> c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < c
\<forall>x\<ge>1. \<bar>sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)\<bar> \<le> c

goal (1 subgoal):
 1. sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
hence "(\<lambda>x. sum_upto (\<lambda>x. real x powr -s) x - x powr (1 - s) / (1 - s)) \<in> O(\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
using this:
0 < c
\<forall>x\<ge>1. \<bar>sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)\<bar> \<le> c

goal (1 subgoal):
 1. (\<lambda>x. sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)) \<in> O(\<lambda>_. 1)
[PROOF STEP]
by (intro bigoI[of _ c] eventually_mono[OF eventually_ge_at_top[of 1]]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)) \<in> O(\<lambda>_. 1)

goal (1 subgoal):
 1. sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)) \<in> O(\<lambda>_. 1)

goal (1 subgoal):
 1. sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
have "(\<lambda>_. 1) \<in> o(\<lambda>x. x powr (1 - s) / (1 - s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>_. 1) \<in> o(\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s \<in> {0<..<1}

goal (1 subgoal):
 1. (\<lambda>_. 1) \<in> o(\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> o(\<lambda>x. x powr (1 - s) / (1 - s))

goal (1 subgoal):
 1. sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)) \<in> o(\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. sum_upto (\<lambda>x. real x powr - s) x - x powr (1 - s) / (1 - s)) \<in> o(\<lambda>x. x powr (1 - s) / (1 - s))

goal (1 subgoal):
 1. sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))
[PROOF STEP]
by (rule smallo_imp_asymp_equiv)
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>n. real n powr - s) \<sim>[at_top] (\<lambda>x. x powr (1 - s) / (1 - s))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma differentiable_cmult_left_iff [simp]:
  fixes c::"'a::real_normed_field"
  shows "(\<lambda>t. c * q t) differentiable at t \<longleftrightarrow> c = 0 \<or> (\<lambda>t. q t) differentiable at t" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. c * q t) differentiable at t) = (c = (0::'a) \<or> q differentiable at t)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>t. c * q t) differentiable at t \<Longrightarrow> c = (0::'a) \<or> q differentiable at t
 2. c = (0::'a) \<or> q differentiable at t \<Longrightarrow> (\<lambda>t. c * q t) differentiable at t
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
(\<lambda>t. c * q t) differentiable at t

goal (2 subgoals):
 1. (\<lambda>t. c * q t) differentiable at t \<Longrightarrow> c = (0::'a) \<or> q differentiable at t
 2. c = (0::'a) \<or> q differentiable at t \<Longrightarrow> (\<lambda>t. c * q t) differentiable at t
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(\<lambda>t. c * q t) differentiable at t

goal (2 subgoals):
 1. (\<lambda>t. c * q t) differentiable at t \<Longrightarrow> c = (0::'a) \<or> q differentiable at t
 2. c = (0::'a) \<or> q differentiable at t \<Longrightarrow> (\<lambda>t. c * q t) differentiable at t
[PROOF STEP]
assume "c \<noteq> 0"
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'a)

goal (2 subgoals):
 1. (\<lambda>t. c * q t) differentiable at t \<Longrightarrow> c = (0::'a) \<or> q differentiable at t
 2. c = (0::'a) \<or> q differentiable at t \<Longrightarrow> (\<lambda>t. c * q t) differentiable at t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a)
[PROOF STEP]
have "q differentiable at t"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. q differentiable at t
[PROOF STEP]
using differentiable_mult [OF differentiable_const L, of concl: "1/c"]
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
(\<lambda>x. (1::'a) / c * (c * q x)) differentiable at t

goal (1 subgoal):
 1. q differentiable at t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q differentiable at t

goal (2 subgoals):
 1. (\<lambda>t. c * q t) differentiable at t \<Longrightarrow> c = (0::'a) \<or> q differentiable at t
 2. c = (0::'a) \<or> q differentiable at t \<Longrightarrow> (\<lambda>t. c * q t) differentiable at t
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'a) \<Longrightarrow> q differentiable at t

goal (2 subgoals):
 1. (\<lambda>t. c * q t) differentiable at t \<Longrightarrow> c = (0::'a) \<or> q differentiable at t
 2. c = (0::'a) \<or> q differentiable at t \<Longrightarrow> (\<lambda>t. c * q t) differentiable at t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a) \<Longrightarrow> q differentiable at t
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a) \<Longrightarrow> q differentiable at t

goal (1 subgoal):
 1. c = (0::'a) \<or> q differentiable at t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = (0::'a) \<or> q differentiable at t

goal (1 subgoal):
 1. c = (0::'a) \<or> q differentiable at t \<Longrightarrow> (\<lambda>t. c * q t) differentiable at t
[PROOF STEP]
qed auto


[STATEMENT]
lemma image_orthogonal_transformation_ball:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'a"
  assumes "orthogonal_transformation f"
  shows "f ` ball x r = ball (f x) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` ball x r = ball (f x) r
[PROOF STEP]
proof (intro equalityI subsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> f ` ball x r \<Longrightarrow> xa \<in> ball (f x) r
 2. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> f ` ball x r \<Longrightarrow> xa \<in> ball (f x) r
 2. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
assume "y \<in> f ` ball x r"
[PROOF STATE]
proof (state)
this:
y \<in> f ` ball x r

goal (2 subgoals):
 1. \<And>xa. xa \<in> f ` ball x r \<Longrightarrow> xa \<in> ball (f x) r
 2. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
orthogonal_transformation f
y \<in> f ` ball x r
[PROOF STEP]
show "y \<in> ball (f x) r"
[PROOF STATE]
proof (prove)
using this:
orthogonal_transformation f
y \<in> f ` ball x r

goal (1 subgoal):
 1. y \<in> ball (f x) r
[PROOF STEP]
by (auto simp: orthogonal_transformation_isometry)
[PROOF STATE]
proof (state)
this:
y \<in> ball (f x) r

goal (1 subgoal):
 1. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
assume y: "y \<in> ball (f x) r"
[PROOF STATE]
proof (state)
this:
y \<in> ball (f x) r

goal (1 subgoal):
 1. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> ball (f x) r
[PROOF STEP]
obtain z where z: "y = f z"
[PROOF STATE]
proof (prove)
using this:
y \<in> ball (f x) r

goal (1 subgoal):
 1. (\<And>z. y = f z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms orthogonal_transformation_surj
[PROOF STATE]
proof (prove)
using this:
y \<in> ball (f x) r
orthogonal_transformation f
orthogonal_transformation ?f \<Longrightarrow> surj ?f

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

goal (1 subgoal):
 1. \<And>xa. xa \<in> ball (f x) r \<Longrightarrow> xa \<in> f ` ball x r
[PROOF STEP]
with y assms
[PROOF STATE]
proof (chain)
picking this:
y \<in> ball (f x) r
orthogonal_transformation f
y = f z
[PROOF STEP]
show "y \<in> f ` ball x r"
[PROOF STATE]
proof (prove)
using this:
y \<in> ball (f x) r
orthogonal_transformation f
y = f z

goal (1 subgoal):
 1. y \<in> f ` ball x r
[PROOF STEP]
by (auto simp: orthogonal_transformation_isometry)
[PROOF STATE]
proof (state)
this:
y \<in> f ` ball x r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_of_Sigma_mono2:
assumes "inj_on f (I::'i set)" and "f ` I \<le> (J::'j set)"
shows "|SIGMA i : I. (A::'j \<Rightarrow> 'a set) (f i)| \<le>o |SIGMA j : J. A j|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
let ?LEFT = "SIGMA i : I. A (f i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
let ?RIGHT = "SIGMA j : J. A j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
obtain u where u_def: "u = (\<lambda>(i::'i,a::'a). (f i,a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. u = (\<lambda>(i, a). (f i, a)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u = (\<lambda>(i, a). (f i, a))

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
have "inj_on u ?LEFT \<and> u `?LEFT \<le> ?RIGHT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on u (SIGMA i:I. A (f i)) \<and> u ` (SIGMA i:I. A (f i)) \<subseteq> Sigma J A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on f I
f ` I \<subseteq> J

goal (1 subgoal):
 1. inj_on u (SIGMA i:I. A (f i)) \<and> u ` (SIGMA i:I. A (f i)) \<subseteq> Sigma J A
[PROOF STEP]
unfolding u_def inj_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>I. \<forall>y\<in>I. f x = f y \<longrightarrow> x = y
f ` I \<subseteq> J

goal (1 subgoal):
 1. (\<forall>x\<in>SIGMA i:I. A (f i). \<forall>y\<in>SIGMA i:I. A (f i). (case x of (i, x) \<Rightarrow> (f i, x)) = (case y of (i, x) \<Rightarrow> (f i, x)) \<longrightarrow> x = y) \<and> (\<lambda>(i, y). (f i, y)) ` (SIGMA i:I. A (f i)) \<subseteq> Sigma J A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on u (SIGMA i:I. A (f i)) \<and> u ` (SIGMA i:I. A (f i)) \<subseteq> Sigma J A

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on u (SIGMA i:I. A (f i)) \<and> u ` (SIGMA i:I. A (f i)) \<subseteq> Sigma J A

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
using card_of_ordLeq
[PROOF STATE]
proof (prove)
using this:
inj_on u (SIGMA i:I. A (f i)) \<and> u ` (SIGMA i:I. A (f i)) \<subseteq> Sigma J A
(\<exists>f. inj_on f ?A \<and> f ` ?A \<subseteq> ?B) = (|?A| \<le>o |?B|)

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J A|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|SIGMA i:I. A (f i)| \<le>o |Sigma J A|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pr_comp1_3': "\<lbrakk> f \<in> PrimRec1'; pr_conv_3_to_1 g \<in> PrimRec1' \<rbrakk> \<Longrightarrow> pr_conv_3_to_1 (\<lambda> x y z. f (g x y z)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> PrimRec1'; pr_conv_3_to_1 g \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_3_to_1 (\<lambda>x y z. f (g x y z)) \<in> PrimRec1'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>f \<in> PrimRec1'; pr_conv_3_to_1 g \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_3_to_1 (\<lambda>x y z. f (g x y z)) \<in> PrimRec1'
[PROOF STEP]
assume "f \<in> PrimRec1'"
  and "pr_conv_3_to_1 g \<in> PrimRec1'" (is "?g1 \<in> PrimRec1'")
[PROOF STATE]
proof (state)
this:
f \<in> PrimRec1'
pr_conv_3_to_1 g \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>f \<in> PrimRec1'; pr_conv_3_to_1 g \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_3_to_1 (\<lambda>x y z. f (g x y z)) \<in> PrimRec1'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> PrimRec1'
pr_conv_3_to_1 g \<in> PrimRec1'
[PROOF STEP]
have "(\<lambda> x. f (?g1 x)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
f \<in> PrimRec1'
pr_conv_3_to_1 g \<in> PrimRec1'

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

goal (1 subgoal):
 1. \<lbrakk>f \<in> PrimRec1'; pr_conv_3_to_1 g \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_3_to_1 (\<lambda>x y z. f (g x y z)) \<in> PrimRec1'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (pr_conv_3_to_1 g x)) \<in> PrimRec1'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (pr_conv_3_to_1 g x)) \<in> PrimRec1'

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Bernstein_Poly_span:
  assumes "c \<noteq> d"
  shows "poly_vs.span {Bernstein_Poly x p c d | x. x \<le> p} = {x. degree x \<le> p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p} = {x. degree x \<le> p}
[PROOF STEP]
proof (subst Bernstein_Poly_01_span[symmetric], subst poly_vs.span_eq, rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {Bernstein_Poly x p c d |x. x \<le> p} \<subseteq> poly_vs.span {Bernstein_Poly_01 x p |x. x \<le> p}
 2. {Bernstein_Poly_01 x p |x. x \<le> p} \<subseteq> poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p}
[PROOF STEP]
show "{Bernstein_Poly x p c d |x. x \<le> p}
      \<subseteq> poly_vs.span {Bernstein_Poly_01 x p |x. x \<le> p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Bernstein_Poly x p c d |x. x \<le> p} \<subseteq> poly_vs.span {Bernstein_Poly_01 x p |x. x \<le> p}
[PROOF STEP]
apply (subst Setcompr_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<le>p. Bernstein_Poly x p c d \<in> poly_vs.span {Bernstein_Poly_01 x p |x. x \<le> p}
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<le> p \<Longrightarrow> Bernstein_Poly x p c d \<in> poly_vs.span {Bernstein_Poly_01 x p |x. x \<le> p}
[PROOF STEP]
apply (rule Bernstein_Poly_01_span1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<le> p \<Longrightarrow> degree (Bernstein_Poly x p c d) \<le> p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> d

goal (1 subgoal):
 1. \<And>x. x \<le> p \<Longrightarrow> degree (Bernstein_Poly x p c d) \<le> p
[PROOF STEP]
by (auto simp: degree_Bernstein_le Bernstein_Poly_eq_rescale_01
                    degree_pcompose)
[PROOF STATE]
proof (state)
this:
{Bernstein_Poly x p c d |x. x \<le> p} \<subseteq> poly_vs.span {Bernstein_Poly_01 x p |x. x \<le> p}

goal (1 subgoal):
 1. {Bernstein_Poly_01 x p |x. x \<le> p} \<subseteq> poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p}
[PROOF STEP]
show "{Bernstein_Poly_01 x p |x. x \<le> p}
      \<subseteq> poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Bernstein_Poly_01 x p |x. x \<le> p} \<subseteq> poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p}
[PROOF STEP]
apply (subst Setcompr_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<le>p. Bernstein_Poly_01 x p \<in> poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p}
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<le> p \<Longrightarrow> Bernstein_Poly_01 x p \<in> poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p}
[PROOF STEP]
apply (rule Bernstein_Poly_span1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<le> p \<Longrightarrow> c \<noteq> d
 2. \<And>x. x \<le> p \<Longrightarrow> degree (Bernstein_Poly_01 x p) \<le> p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> d

goal (2 subgoals):
 1. \<And>x. x \<le> p \<Longrightarrow> c \<noteq> d
 2. \<And>x. x \<le> p \<Longrightarrow> degree (Bernstein_Poly_01 x p) \<le> p
[PROOF STEP]
by (auto simp: degree_Bernstein_le)
[PROOF STATE]
proof (state)
this:
{Bernstein_Poly_01 x p |x. x \<le> p} \<subseteq> poly_vs.span {Bernstein_Poly x p c d |x. x \<le> p}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma imp_graph_rtrancl_skew_sym:
  "(l\<^sub>1, l\<^sub>2) \<in> (imp_graph cnf)\<^sup>* \<Longrightarrow> (negate l\<^sub>2, negate l\<^sub>1) \<in> (imp_graph cnf)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l\<^sub>1, l\<^sub>2) \<in> (imp_graph cnf)\<^sup>* \<Longrightarrow> (negate l\<^sub>2, negate l\<^sub>1) \<in> (imp_graph cnf)\<^sup>*
[PROOF STEP]
by (induction rule: rtrancl.induct)(auto dest: imp_graph_skew_sym)


[STATEMENT]
lemma card_of_Pow_cong[simp]:
assumes "|A| =o |B|"
shows "|Pow A| =o |Pow B|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Pow A| =o |Pow B|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |Pow A| =o |Pow B|
[PROOF STEP]
obtain f where "bij_betw f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms card_of_ordIso[of A B]
[PROOF STATE]
proof (prove)
using this:
|A| =o |B|
(\<exists>f. bij_betw f A B) = (|A| =o |B|)

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

goal (1 subgoal):
 1. |Pow A| =o |Pow B|
[PROOF STEP]
hence "bij_betw (image f) (Pow A) (Pow B)"
[PROOF STATE]
proof (prove)
using this:
bij_betw f A B

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

goal (1 subgoal):
 1. |Pow A| =o |Pow B|
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw ((`) f) (Pow A) (Pow B)

goal (1 subgoal):
 1. |Pow A| =o |Pow B|
[PROOF STEP]
using card_of_ordIso[of "Pow A"]
[PROOF STATE]
proof (prove)
using this:
bij_betw ((`) f) (Pow A) (Pow B)
(\<exists>f. bij_betw f (Pow A) ?B) = (|Pow A| =o |?B|)

goal (1 subgoal):
 1. |Pow A| =o |Pow B|
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
|Pow A| =o |Pow B|

goal:
No subgoals!
[PROOF STEP]
qed