[STATEMENT]
lemma stieltjes_gamma_real_limit_form:
  "(\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))
     \<longlonglongrightarrow> stieltjes_gamma n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
have "(\<lambda>m::nat. \<Sum>k<m.  ln (k+1) ^ n / (k+1) - (ln (k+2) ^ (n+1) - ln (k+1) ^ (n + 1)) / (n + 1))
          \<longlonglongrightarrow> stieltjes_gamma n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
using sums_stieltjes_gamma[of n]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / (real n + 1)) sums stieltjes_gamma n

goal (1 subgoal):
 1. (\<lambda>m. \<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
by (simp add: add_ac sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n

goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n

goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
have "(\<lambda>m::nat. \<Sum>k<m.  ln (k+1) ^ n / (k+1) - (ln (k+2) ^ (n+1) - ln (k+1) ^ (n + 1)) / (n + 1)) =
        (\<lambda>m::nat. (\<Sum>k=1..m. ln k ^ n / k) - ln (m + 1) ^ (n + 1) / (n + 1))"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1))
[PROOF STEP]
proof (rule ext, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
fix m :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
have "(\<Sum>k<m. ln (k+1) ^ n / (k+1) - (ln (k+2) ^ (n+1) - ln (k+1) ^ (n + 1)) / (n + 1)) =
            (\<Sum>k<m. ln (k+1) ^ n / (k+1)) -
            (\<Sum>k<m. ln (Suc k+1) ^ (n+1) - ln (k+1) ^ (n + 1)) / (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1)) - (\<Sum>k<m. ln (real (Suc k + 1)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)
[PROOF STEP]
by (simp add: sum_subtractf flip: sum_divide_distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1)) - (\<Sum>k<m. ln (real (Suc k + 1)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)

goal (1 subgoal):
 1. \<And>m. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1)) - (\<Sum>k<m. ln (real (Suc k + 1)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)

goal (1 subgoal):
 1. \<And>m. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
have "(\<Sum>k<m. ln (k+1) ^ n / (k+1)) = (\<Sum>k=1..m. ln k ^ n / k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k)
[PROOF STEP]
by (rule sum.reindex_bij_witness[of _ "\<lambda>k. k-1" Suc]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k)

goal (1 subgoal):
 1. \<And>m. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k)

goal (1 subgoal):
 1. \<And>m. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
have "(\<Sum>k<m. ln (Suc k+1) ^ (n+1) - ln (k+1) ^ (n + 1)) = ln (m + 1) ^ (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<m. ln (real (Suc k + 1)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) = ln (real (m + 1)) ^ (n + 1)
[PROOF STEP]
by (subst sum_lessThan_telescope) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k<m. ln (real (Suc k + 1)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) = ln (real (m + 1)) ^ (n + 1)

goal (1 subgoal):
 1. \<And>m. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
show "?lhs m = ?rhs m"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)

goal (1 subgoal):
 1. (\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k<m. ln (real (k + 1)) ^ n / real (k + 1) - (ln (real (k + 2)) ^ (n + 1) - ln (real (k + 1)) ^ (n + 1)) / real (n + 1)) = (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1))

goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
have *: "(\<lambda>m. (\<Sum>k = 1..m. ln k ^ n / k) - ln (m + 1) ^ (n + 1) / (n + 1))
                     \<longlonglongrightarrow> stieltjes_gamma n"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n

goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real (m + 1)) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n

goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
have **: "(\<lambda>m. ln (m + 1) ^ (n + 1) / (n + 1) - ln m ^ (n + 1) / (n + 1)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. ln (real (m + 1)) ^ (n + 1) / real (n + 1) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> 0
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>m. ln (real (m + 1)) ^ (n + 1) / real (n + 1) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
from tendsto_add[OF * **]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (\<Sum>k = 1..x. ln (real k) ^ n / real k) - ln (real (x + 1)) ^ (n + 1) / real (n + 1) + (ln (real (x + 1)) ^ (n + 1) / real (n + 1) - ln (real x) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> stieltjes_gamma n + 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (\<Sum>k = 1..x. ln (real k) ^ n / real k) - ln (real (x + 1)) ^ (n + 1) / real (n + 1) + (ln (real (x + 1)) ^ (n + 1) / real (n + 1) - ln (real x) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> stieltjes_gamma n + 0

goal (1 subgoal):
 1. (\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_div_mult: "\<lbrakk>0 < y; unat x * unat y < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> x * y div y = x"
  for x y :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < y; unat x * unat y < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> x * y div y = x
[PROOF STEP]
by (simp add: unat_eq_zero unat_mult_lem word_arith_nat_div)


[STATEMENT]
lemma lift_sub : "insertion (f::nat\<Rightarrow>real) (liftPoly 0 z (a - b)) = insertion f (liftPoly 0 z a - liftPoly 0 z b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (liftPoly 0 z (a - b)) = insertion f (liftPoly 0 z a - liftPoly 0 z b)
[PROOF STEP]
using liftPoly_sub[of "z" "a" "b"]
[PROOF STATE]
proof (prove)
using this:
liftPoly 0 z (a - b) = liftPoly 0 z a - liftPoly 0 z b

goal (1 subgoal):
 1. insertion f (liftPoly 0 z (a - b)) = insertion f (liftPoly 0 z a - liftPoly 0 z b)
[PROOF STEP]
by auto


[STATEMENT]
lemma union_insert_0:
  "(\<Union>n::nat. A n) = A 0 \<union> (\<Union>n\<in>{1..}. A n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range A) = A 0 \<union> \<Union> (A ` {1..})
[PROOF STEP]
by (metis UN_insert Un_insert_left sup_bot.left_neutral One_nat_def atLeast_0 atLeast_Suc_greaterThan ivl_disj_un_singleton(1))


[STATEMENT]
lemma poly_shift_monom':
  assumes "a \<in> carrier R"
  shows "poly_shift (a \<odot>\<^bsub>P\<^esub> (X[^]\<^bsub>P\<^esub>(Suc n))) = a\<odot>\<^bsub>P\<^esub>(X[^]\<^bsub>P\<^esub>n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_shift (a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> Suc n) = a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n
[PROOF STEP]
using assms monom_rep_X_pow poly_shift_monom
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
?a \<in> carrier R \<Longrightarrow> monom P ?a ?n = ?a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> ?n
?a \<in> carrier R \<Longrightarrow> poly_shift (monom P ?a (Suc ?k)) = monom P ?a ?k

goal (1 subgoal):
 1. poly_shift (a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> Suc n) = a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n
[PROOF STEP]
by auto


[STATEMENT]
lemma log_less_zero_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> log a x < 0 \<longleftrightarrow> x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (log a x < 0) = (x < 1)
[PROOF STEP]
using log_less_cancel_iff[of a x 1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < x; 0 < 1\<rbrakk> \<Longrightarrow> (log a x < log a 1) = (x < 1)

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


[STATEMENT]
lemma supremum_in_smaller_closure:
  assumes "finite S"
  shows "supremum (smaller_subset x S) \<in> {e} \<union> (closure S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supremum (smaller_subset x S) \<in> {e} \<union> closure S
[PROOF STEP]
using supremum_in_closure[OF assms, of "smaller_subset x S"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>smaller_subset x S \<subseteq> closure S; smaller_subset x S \<noteq> {}\<rbrakk> \<Longrightarrow> supremum (smaller_subset x S) \<in> closure S

goal (1 subgoal):
 1. supremum (smaller_subset x S) \<in> {e} \<union> closure S
[PROOF STEP]
by (metis UnI1 UnI2 cl.closure.base fold_empty singletonI smaller_subset_mono subset_iff)


[STATEMENT]
lemma formulaTrueIffAllClausesAreTrue:
  fixes formula :: Formula and valuation :: Valuation
  shows "formulaTrue formula valuation = (\<forall> clause. clause el formula \<longrightarrow> clauseTrue clause valuation)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. formulaTrue formula valuation = (\<forall>clause. clause el formula \<longrightarrow> clauseTrue clause valuation)
[PROOF STEP]
by (induct formula) auto


[STATEMENT]
lemma expands_to_ln_aux:
  assumes basis: "basis_wf (b # basis)"
  assumes L1: "((\<lambda>x. ln (g x)) expands_to L1) basis"
  assumes L2: "((\<lambda>x. ln (b x)) expands_to L2) basis"
  shows "((\<lambda>x. ln (g x) + e * ln (b x)) expands_to L1 + scale_ms e L2) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ln (g x) + e * ln (b x)) expands_to L1 + scale_ms e L2) basis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. ln (g x) + e * ln (b x)) expands_to L1 + scale_ms e L2) basis
[PROOF STEP]
from L1
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. ln (g x)) expands_to L1) basis
[PROOF STEP]
have "length basis = expansion_level TYPE('a)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. ln (g x)) expands_to L1) basis

goal (1 subgoal):
 1. length basis = expansion_level TYPE('a)
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_length)
[PROOF STATE]
proof (state)
this:
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. ((\<lambda>x. ln (g x) + e * ln (b x)) expands_to L1 + scale_ms e L2) basis
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
basis_wf (b # basis)
((\<lambda>x. ln (g x)) expands_to L1) basis
((\<lambda>x. ln (b x)) expands_to L2) basis
length basis = expansion_level TYPE('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
basis_wf (b # basis)
((\<lambda>x. ln (g x)) expands_to L1) basis
((\<lambda>x. ln (b x)) expands_to L2) basis
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. ((\<lambda>x. ln (g x) + e * ln (b x)) expands_to L1 + scale_ms e L2) basis
[PROOF STEP]
unfolding scale_ms_def
[PROOF STATE]
proof (prove)
using this:
basis_wf (b # basis)
((\<lambda>x. ln (g x)) expands_to L1) basis
((\<lambda>x. ln (b x)) expands_to L2) basis
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. ((\<lambda>x. ln (g x) + e * ln (b x)) expands_to L1 + const_expansion e * L2) basis
[PROOF STEP]
by (intro expands_to_add assms expands_to_mult expands_to_const)
       (simp_all add: basis_wf_Cons)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ln (g x) + e * ln (b x)) expands_to L1 + scale_ms e L2) basis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_7: "sum f (UNIV::7 set) = f 1 + f 2 + f 3 + f 4 + f 5 + f 6 + f 7"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f UNIV = f 1 + f 2 + f 3 + f 4 + f 5 + f 6 + f 7
[PROOF STEP]
unfolding UNIV_7
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {1, 2, 3, 4, 5, 6, 7} = f 1 + f 2 + f 3 + f 4 + f 5 + f 6 + f 7
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma existential_lookup_sem_R:
  assumes "\<And>i. i \<in> set_fml fml \<Longrightarrow> i < length qs"
  assumes "set signs = consistent_sign_vectors_R qs UNIV"
  shows "(\<exists>x::real. lookup_sem fml (map (\<lambda>p. poly p x) qs)) \<longleftrightarrow>
    find (lookup_sem fml) signs \<noteq> None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml (map (\<lambda>p. poly p x) qs)) = (find (lookup_sem fml) signs \<noteq> None)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
set signs = consistent_sign_vectors_R qs UNIV

goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml (map (\<lambda>p. poly p x) qs)) = (find (lookup_sem fml) signs \<noteq> None)
[PROOF STEP]
unfolding consistent_sign_vectors_R_def find_None_iff
[PROOF STATE]
proof (prove)
using this:
set signs = range (consistent_sign_vec qs)

goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml (map (\<lambda>p. poly p x) qs)) = (\<not> (\<nexists>x. x \<in> set signs \<and> lookup_sem fml x))
[PROOF STEP]
by (simp add: assms(1) consistent_sign_vec_semantics_R)


[STATEMENT]
lemma isosceles_triangle_orthogonal_on_midpoint:
  fixes A B C :: "'a :: euclidean_space"
  assumes "dist C A = dist C B"
  shows "orthogonal (C - midpoint A B) (A - midpoint A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
proof (cases "A = B")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
 2. A \<noteq> B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
assume "A \<noteq> B"
[PROOF STATE]
proof (state)
this:
A \<noteq> B

goal (2 subgoals):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
 2. A \<noteq> B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
let ?M = "midpoint A B"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
 2. A \<noteq> B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
from \<open>A \<noteq> B\<close>
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> B
[PROOF STEP]
have "angle A ?M C = pi - angle B ?M C"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B

goal (1 subgoal):
 1. angle A (midpoint A B) C = pi - angle B (midpoint A B) C
[PROOF STEP]
by (intro angle_inverse between_midpoint)
       (auto simp: between_midpoint eq_commute[of _ "midpoint A B" for A B])
[PROOF STATE]
proof (state)
this:
angle A (midpoint A B) C = pi - angle B (midpoint A B) C

goal (2 subgoals):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
 2. A \<noteq> B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
angle A (midpoint A B) C = pi - angle B (midpoint A B) C

goal (2 subgoals):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
 2. A \<noteq> B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
have "angle A ?M C = angle C ?M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. angle A (midpoint A B) C = angle C (midpoint A B) B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. angle A (midpoint A B) C = angle C (midpoint A B) B
[PROOF STEP]
have congruence: "congruent_triangle C A ?M C B ?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. congruent_triangle C A (midpoint A B) C B (midpoint A B)
[PROOF STEP]
proof (rule congruent_triangleI_sss)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. dist C A = dist C B
 2. dist A (midpoint A B) = dist B (midpoint A B)
 3. dist C (midpoint A B) = dist C (midpoint A B)
[PROOF STEP]
show "dist C A = dist C B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist C A = dist C B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dist C A = dist C B

goal (1 subgoal):
 1. dist C A = dist C B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dist C A = dist C B

goal (2 subgoals):
 1. dist A (midpoint A B) = dist B (midpoint A B)
 2. dist C (midpoint A B) = dist C (midpoint A B)
[PROOF STEP]
show "dist A ?M = dist B ?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist A (midpoint A B) = dist B (midpoint A B)
[PROOF STEP]
by (simp add: dist_midpoint)
[PROOF STATE]
proof (state)
this:
dist A (midpoint A B) = dist B (midpoint A B)

goal (1 subgoal):
 1. dist C (midpoint A B) = dist C (midpoint A B)
[PROOF STEP]
show "dist C (midpoint A B) = dist C (midpoint A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist C (midpoint A B) = dist C (midpoint A B)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
dist C (midpoint A B) = dist C (midpoint A B)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
congruent_triangle C A (midpoint A B) C B (midpoint A B)

goal (1 subgoal):
 1. angle A (midpoint A B) C = angle C (midpoint A B) B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
congruent_triangle C A (midpoint A B) C B (midpoint A B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
congruent_triangle C A (midpoint A B) C B (midpoint A B)

goal (1 subgoal):
 1. angle A (midpoint A B) C = angle C (midpoint A B) B
[PROOF STEP]
by (simp add: congruent_triangle.angles(6))
[PROOF STATE]
proof (state)
this:
angle A (midpoint A B) C = angle C (midpoint A B) B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
angle A (midpoint A B) C = angle C (midpoint A B) B

goal (2 subgoals):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
 2. A \<noteq> B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
angle A (midpoint A B) C = pi - angle B (midpoint A B) C
angle A (midpoint A B) C = angle C (midpoint A B) B
[PROOF STEP]
have "angle A ?M C = pi / 2"
[PROOF STATE]
proof (prove)
using this:
angle A (midpoint A B) C = pi - angle B (midpoint A B) C
angle A (midpoint A B) C = angle C (midpoint A B) B

goal (1 subgoal):
 1. angle A (midpoint A B) C = pi / 2
[PROOF STEP]
by (simp add: angle_commute)
[PROOF STATE]
proof (state)
this:
angle A (midpoint A B) C = pi / 2

goal (2 subgoals):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
 2. A \<noteq> B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
angle A (midpoint A B) C = pi / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
angle A (midpoint A B) C = pi / 2

goal (1 subgoal):
 1. orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
by (simp add: orthogonal_iff_angle orthogonal_commute)
[PROOF STATE]
proof (state)
this:
orthogonal (C - midpoint A B) (A - midpoint A B)

goal (1 subgoal):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
assume "A = B"
[PROOF STATE]
proof (state)
this:
A = B

goal (1 subgoal):
 1. A = B \<Longrightarrow> orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
A = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A = B

goal (1 subgoal):
 1. orthogonal (C - midpoint A B) (A - midpoint A B)
[PROOF STEP]
by (simp add: orthogonal_clauses(1))
[PROOF STATE]
proof (state)
this:
orthogonal (C - midpoint A B) (A - midpoint A B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma apply_cltn2_abs_abs_in_S:
  assumes "v \<noteq> 0" and "invertible J"
  shows "apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S
  \<longleftrightarrow> v \<bullet> (J ** M ** transpose J *v v) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)
[PROOF STEP]
from \<open>v \<noteq> 0\<close> and \<open>invertible J\<close>
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
invertible J
[PROOF STEP]
have "v v* J \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0
invertible J

goal (1 subgoal):
 1. v v* J \<noteq> 0
[PROOF STEP]
by (rule non_zero_mult_invertible_non_zero)
[PROOF STATE]
proof (state)
this:
v v* J \<noteq> 0

goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)
[PROOF STEP]
from \<open>v \<noteq> 0\<close> and \<open>invertible J\<close>
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
invertible J
[PROOF STEP]
have "apply_cltn2 (proj2_abs v) (cltn2_abs J) = proj2_abs (v v* J)"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0
invertible J

goal (1 subgoal):
 1. apply_cltn2 (proj2_abs v) (cltn2_abs J) = proj2_abs (v v* J)
[PROOF STEP]
by (rule apply_cltn2_abs)
[PROOF STATE]
proof (state)
this:
apply_cltn2 (proj2_abs v) (cltn2_abs J) = proj2_abs (v v* J)

goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
apply_cltn2 (proj2_abs v) (cltn2_abs J) = proj2_abs (v v* J)

goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)
[PROOF STEP]
from \<open>v v* J \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
v v* J \<noteq> 0
[PROOF STEP]
have "\<dots> \<in> S \<longleftrightarrow> (v v* J) \<bullet> (M *v (v v* J)) = 0"
[PROOF STATE]
proof (prove)
using this:
v v* J \<noteq> 0

goal (1 subgoal):
 1. (proj2_abs (v v* J) \<in> S) = ((v v* J) \<bullet> (M *v (v v* J)) = 0)
[PROOF STEP]
by (rule S_abs)
[PROOF STATE]
proof (state)
this:
(proj2_abs (v v* J) \<in> S) = ((v v* J) \<bullet> (M *v (v v* J)) = 0)

goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = ((v v* J) \<bullet> (M *v (v v* J)) = 0)
[PROOF STEP]
show "apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S
    \<longleftrightarrow> v \<bullet> (J ** M ** transpose J *v v) = 0"
[PROOF STATE]
proof (prove)
using this:
(apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = ((v v* J) \<bullet> (M *v (v v* J)) = 0)

goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)
[PROOF STEP]
by (simp add: dot_lmul_matrix matrix_vector_mul_assoc [symmetric])
[PROOF STATE]
proof (state)
this:
(apply_cltn2 (proj2_abs v) (cltn2_abs J) \<in> S) = (v \<bullet> (J ** M ** Finite_Cartesian_Product.transpose J *v v) = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_matrix_left_distrib [algebra_simps]:
  shows "(x + y) v* A = x v* A + y v* A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) v* A = x v* A + y v* A
[PROOF STEP]
unfolding vector_matrix_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>j. \<Sum>i\<in>UNIV. A $ i $ j * (x + y) $ i) = (\<chi>j. \<Sum>i\<in>UNIV. A $ i $ j * x $ i) + (\<chi>j. \<Sum>i\<in>UNIV. A $ i $ j * y $ i)
[PROOF STEP]
by (simp add: algebra_simps sum.distrib vec_eq_iff)


[STATEMENT]
theorem McMillan :
shows "\<K> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
have ineq: "\<And>k. 0 < k \<Longrightarrow> \<K> \<le> root k k * root k max_len"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. 0 < k \<Longrightarrow> \<K> \<le> root k (real k) * root k (real max_len)
[PROOF STEP]
using \<K>_pos \<K>_power_bound
[PROOF STATE]
proof (prove)
using this:
0 < \<K>
0 < ?k \<Longrightarrow> \<K> ^ ?k \<le> real (?k * max_len)

goal (1 subgoal):
 1. \<And>k. 0 < k \<Longrightarrow> \<K> \<le> root k (real k) * root k (real max_len)
[PROOF STEP]
by (metis (no_types, opaque_lifting) not_less of_nat_0_le_iff of_nat_mult power_strict_mono real_root_mult real_root_pos_pos_le real_root_pos_unique real_root_power)
[PROOF STATE]
proof (state)
this:
0 < ?k14 \<Longrightarrow> \<K> \<le> root ?k14 (real ?k14) * root ?k14 (real max_len)

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
hence "0 < max_len \<Longrightarrow> (\<lambda>k. root k k * root k max_len) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
using this:
0 < ?k14 \<Longrightarrow> \<K> \<le> root ?k14 (real ?k14) * root ?k14 (real max_len)

goal (1 subgoal):
 1. 0 < max_len \<Longrightarrow> (\<lambda>k. root k (real k) * root k (real max_len)) \<longlonglongrightarrow> 1
[PROOF STEP]
by (auto intro!: tendsto_eq_intros LIMSEQ_root LIMSEQ_root_const)
[PROOF STATE]
proof (state)
this:
0 < max_len \<Longrightarrow> (\<lambda>k. root k (real k) * root k (real max_len)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < max_len \<Longrightarrow> (\<lambda>k. root k (real k) * root k (real max_len)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
have "\<forall>n\<ge>1. \<K> \<le> root n n * root n max_len"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n\<ge>1. \<K> \<le> root n (real n) * root n (real max_len)
[PROOF STEP]
using ineq
[PROOF STATE]
proof (prove)
using this:
0 < ?k14 \<Longrightarrow> \<K> \<le> root ?k14 (real ?k14) * root ?k14 (real max_len)

goal (1 subgoal):
 1. \<forall>n\<ge>1. \<K> \<le> root n (real n) * root n (real max_len)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>1. \<K> \<le> root n (real n) * root n (real max_len)

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>1. \<K> \<le> root n (real n) * root n (real max_len)

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
have "max_len = 0 \<Longrightarrow> \<K> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_len = 0 \<Longrightarrow> \<K> \<le> 1
[PROOF STEP]
using ineq
[PROOF STATE]
proof (prove)
using this:
0 < ?k14 \<Longrightarrow> \<K> \<le> root ?k14 (real ?k14) * root ?k14 (real max_len)

goal (1 subgoal):
 1. max_len = 0 \<Longrightarrow> \<K> \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
max_len = 0 \<Longrightarrow> \<K> \<le> 1

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < max_len \<Longrightarrow> (\<lambda>k. root k (real k) * root k (real max_len)) \<longlonglongrightarrow> 1
\<forall>n\<ge>1. \<K> \<le> root n (real n) * root n (real max_len)
max_len = 0 \<Longrightarrow> \<K> \<le> 1
[PROOF STEP]
show " \<K> \<le> 1"
[PROOF STATE]
proof (prove)
using this:
0 < max_len \<Longrightarrow> (\<lambda>k. root k (real k) * root k (real max_len)) \<longlonglongrightarrow> 1
\<forall>n\<ge>1. \<K> \<le> root n (real n) * root n (real max_len)
max_len = 0 \<Longrightarrow> \<K> \<le> 1

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
using LIMSEQ_le_const
[PROOF STATE]
proof (prove)
using this:
0 < max_len \<Longrightarrow> (\<lambda>k. root k (real k) * root k (real max_len)) \<longlonglongrightarrow> 1
\<forall>n\<ge>1. \<K> \<le> root n (real n) * root n (real max_len)
max_len = 0 \<Longrightarrow> \<K> \<le> 1
\<lbrakk>?X \<longlonglongrightarrow> ?x; \<exists>N. \<forall>n\<ge>N. ?a \<le> ?X n\<rbrakk> \<Longrightarrow> ?a \<le> ?x

goal (1 subgoal):
 1. \<K> \<le> 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<K> \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma concat_eq_concat_iff: "\<forall>(x, y) \<in> set (zip xs ys). length x = length y \<Longrightarrow> length xs = length ys \<Longrightarrow> (concat xs = concat ys) = (xs = ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>(x, y)\<in>set (zip xs ys). length x = length y; length xs = length ys\<rbrakk> \<Longrightarrow> (concat xs = concat ys) = (xs = ys)
[PROOF STEP]
proof (induct xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. \<lbrakk>\<forall>(x, y)\<in>set (zip [] ys). length x = length y; length [] = length ys\<rbrakk> \<Longrightarrow> (concat [] = concat ys) = ([] = ys)
 2. \<And>a xs ys. \<lbrakk>\<And>ys. \<lbrakk>\<forall>(x, y)\<in>set (zip xs ys). length x = length y; length xs = length ys\<rbrakk> \<Longrightarrow> (concat xs = concat ys) = (xs = ys); \<forall>(x, y)\<in>set (zip (a # xs) ys). length x = length y; length (a # xs) = length ys\<rbrakk> \<Longrightarrow> (concat (a # xs) = concat ys) = (a # xs = ys)
[PROOF STEP]
case (Cons x xs ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>a\<in>set (zip xs ?ys). case a of (x, y) \<Rightarrow> length x = length y; length xs = length ?ys\<rbrakk> \<Longrightarrow> (concat xs = concat ?ys) = (xs = ?ys)
\<forall>a\<in>set (zip (x # xs) ys). case a of (x, y) \<Rightarrow> length x = length y
length (x # xs) = length ys

goal (2 subgoals):
 1. \<And>ys. \<lbrakk>\<forall>(x, y)\<in>set (zip [] ys). length x = length y; length [] = length ys\<rbrakk> \<Longrightarrow> (concat [] = concat ys) = ([] = ys)
 2. \<And>a xs ys. \<lbrakk>\<And>ys. \<lbrakk>\<forall>(x, y)\<in>set (zip xs ys). length x = length y; length xs = length ys\<rbrakk> \<Longrightarrow> (concat xs = concat ys) = (xs = ys); \<forall>(x, y)\<in>set (zip (a # xs) ys). length x = length y; length (a # xs) = length ys\<rbrakk> \<Longrightarrow> (concat (a # xs) = concat ys) = (a # xs = ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>a\<in>set (zip xs ?ys). case a of (x, y) \<Rightarrow> length x = length y; length xs = length ?ys\<rbrakk> \<Longrightarrow> (concat xs = concat ?ys) = (xs = ?ys)
\<forall>a\<in>set (zip (x # xs) ys). case a of (x, y) \<Rightarrow> length x = length y
length (x # xs) = length ys

goal (1 subgoal):
 1. (concat (x # xs) = concat ys) = (x # xs = ys)
[PROOF STEP]
by (cases ys) auto
[PROOF STATE]
proof (state)
this:
(concat (x # xs) = concat ys) = (x # xs = ys)

goal (1 subgoal):
 1. \<And>ys. \<lbrakk>\<forall>(x, y)\<in>set (zip [] ys). length x = length y; length [] = length ys\<rbrakk> \<Longrightarrow> (concat [] = concat ys) = ([] = ys)
[PROOF STEP]
qed (auto)


[STATEMENT]
theorem msgrel_imp_eqv_freeleft:
  assumes a: "U \<sim> V"
  shows "freeleft U \<sim> freeleft V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freeleft U \<sim> freeleft V
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
U \<sim> V

goal (1 subgoal):
 1. freeleft U \<sim> freeleft V
[PROOF STEP]
by (induct) (auto intro: msgrel_imp_eqv_freeleft_aux)


[STATEMENT]
lemma find_set :
  assumes "find P xs = Some x"
  shows "x \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
find P xs = Some x

goal (1 subgoal):
 1. x \<in> set xs
[PROOF STEP]
proof(induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. find P [] = Some x \<Longrightarrow> x \<in> set []
 2. \<And>a xs. \<lbrakk>find P xs = Some x \<Longrightarrow> x \<in> set xs; find P (a # xs) = Some x\<rbrakk> \<Longrightarrow> x \<in> set (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
find P [] = Some x

goal (2 subgoals):
 1. find P [] = Some x \<Longrightarrow> x \<in> set []
 2. \<And>a xs. \<lbrakk>find P xs = Some x \<Longrightarrow> x \<in> set xs; find P (a # xs) = Some x\<rbrakk> \<Longrightarrow> x \<in> set (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
find P [] = Some x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
find P [] = Some x

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

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>find P xs = Some x \<Longrightarrow> x \<in> set xs; find P (a # xs) = Some x\<rbrakk> \<Longrightarrow> x \<in> set (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>find P xs = Some x \<Longrightarrow> x \<in> set xs; find P (a # xs) = Some x\<rbrakk> \<Longrightarrow> x \<in> set (a # xs)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
find P xs = Some x \<Longrightarrow> x \<in> set xs
find P (a # xs) = Some x

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>find P xs = Some x \<Longrightarrow> x \<in> set xs; find P (a # xs) = Some x\<rbrakk> \<Longrightarrow> x \<in> set (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
find P xs = Some x \<Longrightarrow> x \<in> set xs
find P (a # xs) = Some x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
find P xs = Some x \<Longrightarrow> x \<in> set xs
find P (a # xs) = Some x

goal (1 subgoal):
 1. x \<in> set (a # xs)
[PROOF STEP]
by (metis find.simps(2) list.set_intros(1) list.set_intros(2) option.inject)
[PROOF STATE]
proof (state)
this:
x \<in> set (a # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convolution_eq_sum_over_supp_right :
  fixes   g f :: "'a::group_add \<Rightarrow> 'b::{comm_monoid_add,mult_zero}"
  assumes "g \<in> aezfun_set"
  shows   "convolution f g = (\<lambda>x. \<Sum>y\<in>supp g. (f (x - y)) * g y )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution f g = (\<lambda>x. \<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
fix x::'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
define SS where "SS = {y. x - y \<in> supp f \<and> y \<in> supp g}"
[PROOF STATE]
proof (state)
this:
SS = {y. x - y \<in> supp f \<and> y \<in> supp g}

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
have "finite (supp g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (supp g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g \<in> aezfun_set

goal (1 subgoal):
 1. finite (supp g)
[PROOF STEP]
unfolding aezfun_set_def
[PROOF STATE]
proof (prove)
using this:
g \<in> {f. finite (supp f)}

goal (1 subgoal):
 1. finite (supp g)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
finite (supp g)

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (supp g)

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
have "SS \<subseteq> supp g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SS \<subseteq> supp g
[PROOF STEP]
unfolding SS_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. x - y \<in> supp f \<and> y \<in> supp g} \<subseteq> supp g
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
SS \<subseteq> supp g

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
SS \<subseteq> supp g

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
have "\<And>y. y \<in> supp g - SS \<Longrightarrow> (f (x - y)) * g y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> supp g - SS \<Longrightarrow> f (x - y) * g y = (0::'b)
[PROOF STEP]
using SS_def
[PROOF STATE]
proof (prove)
using this:
SS = {y. x - y \<in> supp f \<and> y \<in> supp g}

goal (1 subgoal):
 1. \<And>y. y \<in> supp g - SS \<Longrightarrow> f (x - y) * g y = (0::'b)
[PROOF STEP]
unfolding supp_def
[PROOF STATE]
proof (prove)
using this:
SS = {y. x - y \<in> {x. f x \<noteq> (0::'b)} \<and> y \<in> {x. g x \<noteq> (0::'b)}}

goal (1 subgoal):
 1. \<And>y. y \<in> {x. g x \<noteq> (0::'b)} - SS \<Longrightarrow> f (x - y) * g y = (0::'b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y \<in> supp g - SS \<Longrightarrow> f (x - ?y) * g ?y = (0::'b)

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (supp g)
SS \<subseteq> supp g
?y \<in> supp g - SS \<Longrightarrow> f (x - ?y) * g ?y = (0::'b)
[PROOF STEP]
show "convolution f g x = (\<Sum>y\<in>supp g. (f (x - y)) * g y )"
[PROOF STATE]
proof (prove)
using this:
finite (supp g)
SS \<subseteq> supp g
?y \<in> supp g - SS \<Longrightarrow> f (x - ?y) * g ?y = (0::'b)

goal (1 subgoal):
 1. convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
unfolding convolution_def
[PROOF STATE]
proof (prove)
using this:
finite (supp g)
SS \<subseteq> supp g
?y \<in> supp g - SS \<Longrightarrow> f (x - ?y) * g ?y = (0::'b)

goal (1 subgoal):
 1. (\<Sum>y | x - y \<in> supp f \<and> y \<in> supp g. f (x - y) * g y) = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
using     SS_def sum.mono_neutral_left[of "supp g" SS "\<lambda>y. (f (x - y)) * g y"]
[PROOF STATE]
proof (prove)
using this:
finite (supp g)
SS \<subseteq> supp g
?y \<in> supp g - SS \<Longrightarrow> f (x - ?y) * g ?y = (0::'b)
SS = {y. x - y \<in> supp f \<and> y \<in> supp g}
\<lbrakk>finite (supp g); SS \<subseteq> supp g; \<forall>i\<in>supp g - SS. f (x - i) * g i = (0::'b)\<rbrakk> \<Longrightarrow> (\<Sum>y\<in>SS. f (x - y) * g y) = (\<Sum>y\<in>supp g. f (x - y) * g y)

goal (1 subgoal):
 1. (\<Sum>y | x - y \<in> supp f \<and> y \<in> supp g. f (x - y) * g y) = (\<Sum>y\<in>supp g. f (x - y) * g y)
[PROOF STEP]
by        fast
[PROOF STATE]
proof (state)
this:
convolution f g x = (\<Sum>y\<in>supp g. f (x - y) * g y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pre_zeta_aux_cnj [simp]:
  assumes "a > 0"
  shows   "pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
have "cnj (pre_zeta_aux n a z) =
          of_real a powr -cnj z / 2 + (\<Sum>x=1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R
            a powr (-cnj z - (2*x-1)) * pochhammer (cnj z) (2*x-1)) + EM_remainder (2*n+1)
          (\<lambda>x. -(pochhammer (cnj z) (Suc (2 * n)) *
                  cnj (of_real (x + a) powr (-1 - 2 * of_nat n - z)))) 0"
    (is "_ = _ + ?A + ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (pre_zeta_aux n a z) = complex_of_real a powr - cnj z / 2 + (\<Sum>x = 1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R complex_of_real a powr (- cnj z - of_nat (2 * x - 1)) * pochhammer (cnj z) (2 * x - 1)) + EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0
[PROOF STEP]
unfolding pre_zeta_aux_def complex_cnj_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (complex_of_real a powr - z / 2) + cnj (\<Sum>i = 1..n. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R (pochhammer z (2 * i - 1) * complex_of_real a powr (- z - of_nat (2 * i - 1)))) + cnj (EM_remainder (Suc (2 * n)) (\<lambda>x. - (pochhammer z (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z))) 0) = complex_of_real a powr - cnj z / 2 + (\<Sum>x = 1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R complex_of_real a powr (- cnj z - of_nat (2 * x - 1)) * pochhammer (cnj z) (2 * x - 1)) + EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. cnj (complex_of_real a powr - z / 2) + cnj (\<Sum>i = 1..n. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R (pochhammer z (2 * i - 1) * complex_of_real a powr (- z - of_nat (2 * i - 1)))) + cnj (EM_remainder (Suc (2 * n)) (\<lambda>x. - (pochhammer z (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z))) 0) = complex_of_real a powr - cnj z / 2 + (\<Sum>x = 1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R complex_of_real a powr (- cnj z - of_nat (2 * x - 1)) * pochhammer (cnj z) (2 * x - 1)) + EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0
[PROOF STEP]
by (subst EM_remainder_cnj [symmetric])
       (auto intro!: continuous_intros simp: cnj_powr add_eq_0_iff mult_ac)
[PROOF STATE]
proof (state)
this:
cnj (pre_zeta_aux n a z) = complex_of_real a powr - cnj z / 2 + (\<Sum>x = 1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R complex_of_real a powr (- cnj z - of_nat (2 * x - 1)) * pochhammer (cnj z) (2 * x - 1)) + EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0

goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cnj (pre_zeta_aux n a z) = complex_of_real a powr - cnj z / 2 + (\<Sum>x = 1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R complex_of_real a powr (- cnj z - of_nat (2 * x - 1)) * pochhammer (cnj z) (2 * x - 1)) + EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0

goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
have "?B = EM_remainder (2*n+1)
        (\<lambda>x. -(pochhammer (cnj z) (Suc (2 * n)) * of_real (x + a) powr (-1 - 2 * of_nat n - cnj z))) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0 = EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - cnj z))) 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0 = EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - cnj z))) 0
[PROOF STEP]
by (intro EM_remainder_cong) (auto simp: cnj_powr)
[PROOF STATE]
proof (state)
this:
EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0 = EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - cnj z))) 0

goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * cnj (complex_of_real (x + a) powr (- 1 - 2 * of_nat n - z)))) 0 = EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - cnj z))) 0

goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
have "of_real a powr -cnj z / 2 + ?A + \<dots> = pre_zeta_aux n a (cnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real a powr - cnj z / 2 + (\<Sum>x = 1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R complex_of_real a powr (- cnj z - of_nat (2 * x - 1)) * pochhammer (cnj z) (2 * x - 1)) + EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - cnj z))) 0 = pre_zeta_aux n a (cnj z)
[PROOF STEP]
by (simp add: pre_zeta_aux_def mult_ac)
[PROOF STATE]
proof (state)
this:
complex_of_real a powr - cnj z / 2 + (\<Sum>x = 1..n. (bernoulli (2 * x) / fact (2 * x)) *\<^sub>R complex_of_real a powr (- cnj z - of_nat (2 * x - 1)) * pochhammer (cnj z) (2 * x - 1)) + EM_remainder (2 * n + 1) (\<lambda>x. - (pochhammer (cnj z) (Suc (2 * n)) * complex_of_real (x + a) powr (- 1 - 2 * of_nat n - cnj z))) 0 = pre_zeta_aux n a (cnj z)

goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cnj (pre_zeta_aux n a z) = pre_zeta_aux n a (cnj z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cnj (pre_zeta_aux n a z) = pre_zeta_aux n a (cnj z)

goal (1 subgoal):
 1. pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
pre_zeta_aux n a (cnj z) = cnj (pre_zeta_aux n a z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_prefix_eq_strict_prefix_take_ex: "strict_prefix xs ys = ((\<exists>n. ys \<down> n = xs) \<and> xs \<noteq> ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_prefix xs ys = ((\<exists>n. ys \<down> n = xs) \<and> xs \<noteq> ys)
[PROOF STEP]
by (simp add: strict_prefix_def prefix_eq_prefix_take_ex)


[STATEMENT]
lemma Log_less_one_cancel_iff[simp]:
  "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> Log a x < 1 \<longleftrightarrow> x < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (Log a x < 1) = (x < a)
[PROOF STEP]
using Log_less_cancel_iff[of a x a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < x; 0 < a\<rbrakk> \<Longrightarrow> (Log a x < Log a a) = (x < a)

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


[STATEMENT]
lemma fact_split: "k \<le> n \<Longrightarrow> fact n = of_nat (prod Suc {n - k..<n}) * fact (n - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> fact n = of_nat (prod Suc {n - k..<n}) * fact (n - k)
[PROOF STEP]
by (simp add: fact_prod_Suc prod.union_disjoint [symmetric]
    ivl_disj_un ac_simps of_nat_mult [symmetric])


[STATEMENT]
lemma card_v_\<pi>[simp,intro]: assumes "x \<in> \<V>"
  shows "card (v {\<pi> x}) = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (v {\<pi> x}) = 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (v {\<pi> x}) = 2
[PROOF STEP]
from \<pi>m2[OF assms]
[PROOF STATE]
proof (chain)
picking this:
\<pi> x \<in> [m]^\<two>
[PROOF STEP]
have mem: "\<pi> x \<in> [m]^\<two>"
[PROOF STATE]
proof (prove)
using this:
\<pi> x \<in> [m]^\<two>

goal (1 subgoal):
 1. \<pi> x \<in> [m]^\<two>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<pi> x \<in> [m]^\<two>

goal (1 subgoal):
 1. card (v {\<pi> x}) = 2
[PROOF STEP]
from this[unfolded binprod_def]
[PROOF STATE]
proof (chain)
picking this:
\<pi> x \<in> {{x, y} |x y. x \<in> [m] \<and> y \<in> [m] \<and> x \<noteq> y}
[PROOF STEP]
obtain a b where \<pi>: "\<pi> x = {a,b}" and diff: "a \<noteq> b"
[PROOF STATE]
proof (prove)
using this:
\<pi> x \<in> {{x, y} |x y. x \<in> [m] \<and> y \<in> [m] \<and> x \<noteq> y}

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>\<pi> x = {a, b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<pi> x = {a, b}
a \<noteq> b

goal (1 subgoal):
 1. card (v {\<pi> x}) = 2
[PROOF STEP]
hence "v {\<pi> x} = {a,b}"
[PROOF STATE]
proof (prove)
using this:
\<pi> x = {a, b}
a \<noteq> b

goal (1 subgoal):
 1. v {\<pi> x} = {a, b}
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
using this:
\<pi> x = {a, b}
a \<noteq> b

goal (1 subgoal):
 1. {xa. \<exists>y. {xa, y} \<in> {\<pi> x}} = {a, b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v {\<pi> x} = {a, b}

goal (1 subgoal):
 1. card (v {\<pi> x}) = 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v {\<pi> x} = {a, b}

goal (1 subgoal):
 1. card (v {\<pi> x}) = 2
[PROOF STEP]
using diff
[PROOF STATE]
proof (prove)
using this:
v {\<pi> x} = {a, b}
a \<noteq> b

goal (1 subgoal):
 1. card (v {\<pi> x}) = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (v {\<pi> x}) = 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma keys_higherPowers: "keys (higherPowers b i m) = dec_above b i ` (keys m \<inter> {x. x \<notin> {b..<b+i}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (higherPowers b i m) = dec_above b i ` (keys m \<inter> {x. x \<notin> {b..<b + i}})
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> keys (higherPowers b i m) \<Longrightarrow> x \<in> dec_above b i ` (keys m \<inter> {x. x \<notin> {b..<b + i}})
 2. \<And>x xa. \<lbrakk>xa \<in> keys m; xa \<notin> {b..<b + i}\<rbrakk> \<Longrightarrow> dec_above b i xa \<in> keys (higherPowers b i m)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> keys (higherPowers b i m) \<Longrightarrow> x \<in> dec_above b i ` (keys m \<inter> {x. x \<notin> {b..<b + i}})
[PROOF STEP]
apply (rule image_eqI[where x="inc_above b i x"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> keys (higherPowers b i m) \<Longrightarrow> x = dec_above b i (inc_above b i x)
 2. x \<in> keys (higherPowers b i m) \<Longrightarrow> inc_above b i x \<in> keys m \<inter> {x. x \<notin> {b..<b + i}}
[PROOF STEP]
apply (auto simp: dec_above_inc_above in_keys_iff higherPowers.rep_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lookup m (inc_above b i x) \<noteq> (0::'a); b \<le> inc_above b i x; inc_above b i x < b + i\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis add_less_cancel_right inc_above_def leD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>xa \<in> keys m; xa \<notin> {b..<b + i}\<rbrakk> \<Longrightarrow> dec_above b i xa \<in> keys (higherPowers b i m)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xa_ \<in> keys m; xa_ \<notin> {b..<b + i}\<rbrakk> \<Longrightarrow> dec_above b i xa_ \<in> keys (higherPowers b i m)
[PROOF STEP]
by (auto simp: inc_above_dec_above in_keys_iff higherPowers.rep_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma frontier_halfspace_le:
  assumes "a \<noteq> 0 \<or> b \<noteq> 0"
    shows "frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
 2. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = (0::'a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
 2. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a) \<or> b \<noteq> 0
a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a) \<or> b \<noteq> 0
a = (0::'a)

goal (1 subgoal):
 1. frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}
[PROOF STEP]
by (force simp: frontier_def closed_halfspace_le)
[PROOF STATE]
proof (state)
this:
frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stern_brocot_iterate_aux_Det:
  assumes "Det m = 1" "0 < snd (mediant m)"
  shows "Det (root (traverse_tree path (stern_brocot_iterate_aux m))) = 1"
  and "0 < snd (mediant (root (traverse_tree path (stern_brocot_iterate_aux m))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Det (root (traverse_tree path (stern_brocot_iterate_aux m))) = 1 &&& 0 < snd (mediant (root (traverse_tree path (stern_brocot_iterate_aux m))))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Det m = 1
0 < snd (mediant m)

goal (1 subgoal):
 1. Det (root (traverse_tree path (stern_brocot_iterate_aux m))) = 1 &&& 0 < snd (mediant (root (traverse_tree path (stern_brocot_iterate_aux m))))
[PROOF STEP]
by (induct path arbitrary: m)
   (simp_all add: stern_brocot_iterate_aux_def LL_UR_Det LL_UR_pos split: dir.splits)


[STATEMENT]
lemma isCont_tendsto_compose: "isCont g l \<Longrightarrow> (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isCont g l; (f \<longlongrightarrow> l) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F
[PROOF STEP]
unfolding isCont_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<midarrow>l\<rightarrow> g l; (f \<longlongrightarrow> l) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F
[PROOF STEP]
by (rule tendsto_compose)


[STATEMENT]
lemma unique_ocircline_set:
  assumes "A \<noteq> B" and "A \<noteq> C" and "B \<noteq> C"
  shows "\<exists>! H. pos_oriented H \<and> (A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
obtain M where *: "moebius_pt M A = 0\<^sub>h"  "moebius_pt M B = 1\<^sub>h" "moebius_pt M C = \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. \<lbrakk>moebius_pt M A = 0\<^sub>h; moebius_pt M B = 1\<^sub>h; moebius_pt M C = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_moebius_01inf[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>M. moebius_pt M A = 0\<^sub>h \<and> moebius_pt M B = 1\<^sub>h \<and> moebius_pt M C = \<infinity>\<^sub>h

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>moebius_pt M A = 0\<^sub>h; moebius_pt M B = 1\<^sub>h; moebius_pt M C = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt M A = 0\<^sub>h
moebius_pt M B = 1\<^sub>h
moebius_pt M C = \<infinity>\<^sub>h

goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
let ?iM = "moebius_pt (moebius_inv M)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
have **: "?iM 0\<^sub>h = A"  "?iM 1\<^sub>h = B"  "?iM \<infinity>\<^sub>h = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M) 0\<^sub>h = A &&& moebius_pt (moebius_inv M) 1\<^sub>h = B &&& moebius_pt (moebius_inv M) \<infinity>\<^sub>h = C
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
moebius_pt M A = 0\<^sub>h
moebius_pt M B = 1\<^sub>h
moebius_pt M C = \<infinity>\<^sub>h

goal (1 subgoal):
 1. moebius_pt (moebius_inv M) 0\<^sub>h = A &&& moebius_pt (moebius_inv M) 1\<^sub>h = B &&& moebius_pt (moebius_inv M) \<infinity>\<^sub>h = C
[PROOF STEP]
by (auto simp add: moebius_pt_invert)
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M) 0\<^sub>h = A
moebius_pt (moebius_inv M) 1\<^sub>h = B
moebius_pt (moebius_inv M) \<infinity>\<^sub>h = C

goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
let ?H = "moebius_ocircline (moebius_inv M) o_x_axis"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
have 1: "A \<in> ocircline_set ?H" "B \<in> ocircline_set ?H" "C \<in> ocircline_set ?H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) &&& B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) &&& C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
moebius_pt (moebius_inv M) 0\<^sub>h = A
moebius_pt (moebius_inv M) 1\<^sub>h = B
moebius_pt (moebius_inv M) \<infinity>\<^sub>h = C

goal (1 subgoal):
 1. A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) &&& B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) &&& C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
have 2: "\<And> H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = ?H \<or> H' = opposite_ocircline ?H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
fix H'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
let ?H' = "ocircline_set H'" and ?H'' = "ocircline_set (moebius_ocircline M H')"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
assume "A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H'"
[PROOF STATE]
proof (state)
this:
A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H'

goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
hence "moebius_pt M A \<in> ?H''" "moebius_pt M B \<in> ?H''" "moebius_pt M C \<in> ?H''"
[PROOF STATE]
proof (prove)
using this:
A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H'

goal (1 subgoal):
 1. moebius_pt M A \<in> ocircline_set (moebius_ocircline M H') &&& moebius_pt M B \<in> ocircline_set (moebius_ocircline M H') &&& moebius_pt M C \<in> ocircline_set (moebius_ocircline M H')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt M A \<in> ocircline_set (moebius_ocircline M H')
moebius_pt M B \<in> ocircline_set (moebius_ocircline M H')
moebius_pt M C \<in> ocircline_set (moebius_ocircline M H')

goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
hence "0\<^sub>h \<in> ?H''" "1\<^sub>h \<in> ?H''"  "\<infinity>\<^sub>h \<in> ?H''"
[PROOF STATE]
proof (prove)
using this:
moebius_pt M A \<in> ocircline_set (moebius_ocircline M H')
moebius_pt M B \<in> ocircline_set (moebius_ocircline M H')
moebius_pt M C \<in> ocircline_set (moebius_ocircline M H')

goal (1 subgoal):
 1. 0\<^sub>h \<in> ocircline_set (moebius_ocircline M H') &&& 1\<^sub>h \<in> ocircline_set (moebius_ocircline M H') &&& \<infinity>\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
moebius_pt M A \<in> ocircline_set (moebius_ocircline M H')
moebius_pt M B \<in> ocircline_set (moebius_ocircline M H')
moebius_pt M C \<in> ocircline_set (moebius_ocircline M H')
moebius_pt M A = 0\<^sub>h
moebius_pt M B = 1\<^sub>h
moebius_pt M C = \<infinity>\<^sub>h

goal (1 subgoal):
 1. 0\<^sub>h \<in> ocircline_set (moebius_ocircline M H') &&& 1\<^sub>h \<in> ocircline_set (moebius_ocircline M H') &&& \<infinity>\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
1\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
\<infinity>\<^sub>h \<in> ocircline_set (moebius_ocircline M H')

goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
hence "moebius_ocircline M H' = o_x_axis \<or> moebius_ocircline M H' = opposite_ocircline o_x_axis"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
1\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
\<infinity>\<^sub>h \<in> ocircline_set (moebius_ocircline M H')

goal (1 subgoal):
 1. moebius_ocircline M H' = o_x_axis \<or> moebius_ocircline M H' = opposite_ocircline o_x_axis
[PROOF STEP]
using ocircline_01inf
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
1\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
\<infinity>\<^sub>h \<in> ocircline_set (moebius_ocircline M H')
0\<^sub>h \<in> ocircline_set ?H \<and> 1\<^sub>h \<in> ocircline_set ?H \<and> \<infinity>\<^sub>h \<in> ocircline_set ?H \<Longrightarrow> ?H = o_x_axis \<or> ?H = opposite_ocircline o_x_axis

goal (1 subgoal):
 1. moebius_ocircline M H' = o_x_axis \<or> moebius_ocircline M H' = opposite_ocircline o_x_axis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_ocircline M H' = o_x_axis \<or> moebius_ocircline M H' = opposite_ocircline o_x_axis

goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
hence "o_x_axis = moebius_ocircline M H' \<or>  o_x_axis = opposite_ocircline (moebius_ocircline M H')"
[PROOF STATE]
proof (prove)
using this:
moebius_ocircline M H' = o_x_axis \<or> moebius_ocircline M H' = opposite_ocircline o_x_axis

goal (1 subgoal):
 1. o_x_axis = moebius_ocircline M H' \<or> o_x_axis = opposite_ocircline (moebius_ocircline M H')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
o_x_axis = moebius_ocircline M H' \<or> o_x_axis = opposite_ocircline (moebius_ocircline M H')

goal (1 subgoal):
 1. \<And>H'. A \<in> ocircline_set H' \<and> B \<in> ocircline_set H' \<and> C \<in> ocircline_set H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
thus "H' = ?H \<or> H' = opposite_ocircline ?H"
[PROOF STATE]
proof (prove)
using this:
o_x_axis = moebius_ocircline M H' \<or> o_x_axis = opposite_ocircline (moebius_ocircline M H')

goal (1 subgoal):
 1. H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. o_x_axis = moebius_ocircline M H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
 2. o_x_axis = opposite_ocircline (moebius_ocircline M H') \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
assume *: "o_x_axis = moebius_ocircline M H'"
[PROOF STATE]
proof (state)
this:
o_x_axis = moebius_ocircline M H'

goal (2 subgoals):
 1. o_x_axis = moebius_ocircline M H' \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
 2. o_x_axis = opposite_ocircline (moebius_ocircline M H') \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
show "H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
by (rule disjI1) (subst *, simp)
[PROOF STATE]
proof (state)
this:
H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. o_x_axis = opposite_ocircline (moebius_ocircline M H') \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. o_x_axis = opposite_ocircline (moebius_ocircline M H') \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
assume *: "o_x_axis = opposite_ocircline (moebius_ocircline M H')"
[PROOF STATE]
proof (state)
this:
o_x_axis = opposite_ocircline (moebius_ocircline M H')

goal (1 subgoal):
 1. o_x_axis = opposite_ocircline (moebius_ocircline M H') \<Longrightarrow> H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
show "H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
by (rule disjI2) (subst *, simp)
[PROOF STATE]
proof (state)
this:
H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<in> ocircline_set ?H' \<and> B \<in> ocircline_set ?H' \<and> C \<in> ocircline_set ?H' \<Longrightarrow> ?H' = moebius_ocircline (moebius_inv M) o_x_axis \<or> ?H' = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
show ?thesis (is "\<exists>! x. ?P x")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
proof (cases "pos_oriented ?H")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
 2. \<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis)

goal (2 subgoals):
 1. pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
 2. \<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pos_oriented ?a \<and> A \<in> ocircline_set ?a \<and> B \<in> ocircline_set ?a \<and> C \<in> ocircline_set ?a
 2. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = ?a
[PROOF STEP]
show "?P ?H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<and> A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) \<and> B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) \<and> C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
using 1 True
[PROOF STATE]
proof (prove)
using this:
A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<and> A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) \<and> B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) \<and> C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<and> A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) \<and> B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis) \<and> C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = moebius_ocircline (moebius_inv M) o_x_axis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = moebius_ocircline (moebius_inv M) o_x_axis
[PROOF STEP]
fix H
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = moebius_ocircline (moebius_inv M) o_x_axis
[PROOF STEP]
assume "?P H"
[PROOF STATE]
proof (state)
this:
pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H

goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = moebius_ocircline (moebius_inv M) o_x_axis
[PROOF STEP]
thus "H = ?H"
[PROOF STATE]
proof (prove)
using this:
pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H

goal (1 subgoal):
 1. H = moebius_ocircline (moebius_inv M) o_x_axis
[PROOF STEP]
using 1 2[of H] True
[PROOF STATE]
proof (prove)
using this:
pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = moebius_ocircline (moebius_inv M) o_x_axis \<or> H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. H = moebius_ocircline (moebius_inv M) o_x_axis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H = moebius_ocircline (moebius_inv M) o_x_axis

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H

goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
let ?OH = "opposite_ocircline ?H"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis) \<Longrightarrow> \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pos_oriented ?a \<and> A \<in> ocircline_set ?a \<and> B \<in> ocircline_set ?a \<and> C \<in> ocircline_set ?a
 2. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = ?a
[PROOF STEP]
show "?P ?OH"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_oriented (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> A \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> B \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> C \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis))
[PROOF STEP]
using 1 False
[PROOF STATE]
proof (prove)
using this:
A \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
B \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
C \<in> ocircline_set (moebius_ocircline (moebius_inv M) o_x_axis)
\<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. pos_oriented (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> A \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> B \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> C \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pos_oriented (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> A \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> B \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)) \<and> C \<in> ocircline_set (opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis))

goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
fix H
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
assume "?P H"
[PROOF STATE]
proof (state)
this:
pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H

goal (1 subgoal):
 1. \<And>H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
thus "H = ?OH"
[PROOF STATE]
proof (prove)
using this:
pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H

goal (1 subgoal):
 1. H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
using False 2[of H]
[PROOF STATE]
proof (prove)
using this:
pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H
\<not> pos_oriented (moebius_ocircline (moebius_inv M) o_x_axis)
A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H \<Longrightarrow> H = moebius_ocircline (moebius_inv M) o_x_axis \<or> H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)

goal (1 subgoal):
 1. H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H = opposite_ocircline (moebius_ocircline (moebius_inv M) o_x_axis)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>!H. pos_oriented H \<and> A \<in> ocircline_set H \<and> B \<in> ocircline_set H \<and> C \<in> ocircline_set H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma similar_mat_jordan_matrix_smult:  fixes n_as :: "(nat \<times> 'a :: field) list"
  assumes k: "k \<noteq> 0"
  shows "similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda> (n,a). (n, k * a)) n_as))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>(n, a). (n, k * a)) n_as))
[PROOF STEP]
proof (induct n_as)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. similar_mat (k \<cdot>\<^sub>m jordan_matrix []) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) []))
 2. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. similar_mat (k \<cdot>\<^sub>m jordan_matrix []) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) []))
 2. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m jordan_matrix []) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) []))
[PROOF STEP]
by (auto simp: jordan_matrix_def intro!: similar_mat_refl)
[PROOF STATE]
proof (state)
this:
similar_mat (k \<cdot>\<^sub>m jordan_matrix []) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) []))

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
case (Cons na n_as)
[PROOF STATE]
proof (state)
this:
similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as))

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
obtain n a where na: "na = (n,a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n a. na = (n, a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
na = (n, a)

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
let ?l = "map (\<lambda> (n,a). (n, k * a))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
let ?n = "sum_list (map fst n_as)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
have "k \<cdot>\<^sub>m jordan_matrix (Cons na n_as) = k \<cdot>\<^sub>m four_block_mat
     (jordan_block n a) (0\<^sub>m n ?n)
     (0\<^sub>m ?n n) (jordan_matrix n_as)" (is "?M = _ \<cdot>\<^sub>m four_block_mat ?A ?B ?C ?D")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<cdot>\<^sub>m jordan_matrix (na # n_as) = k \<cdot>\<^sub>m four_block_mat (jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix n_as)
[PROOF STEP]
by (simp add: na jordan_matrix_Cons)
[PROOF STATE]
proof (state)
this:
k \<cdot>\<^sub>m jordan_matrix (na # n_as) = k \<cdot>\<^sub>m four_block_mat (jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix n_as)

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k \<cdot>\<^sub>m jordan_matrix (na # n_as) = k \<cdot>\<^sub>m four_block_mat (jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix n_as)

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
have "\<dots> = four_block_mat (k \<cdot>\<^sub>m ?A) ?B ?C (k \<cdot>\<^sub>m ?D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<cdot>\<^sub>m four_block_mat (jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix n_as) = four_block_mat (k \<cdot>\<^sub>m jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (k \<cdot>\<^sub>m jordan_matrix n_as)
[PROOF STEP]
by (subst smult_four_block_mat, auto)
[PROOF STATE]
proof (state)
this:
k \<cdot>\<^sub>m four_block_mat (jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix n_as) = four_block_mat (k \<cdot>\<^sub>m jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (k \<cdot>\<^sub>m jordan_matrix n_as)

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k \<cdot>\<^sub>m jordan_matrix (na # n_as) = four_block_mat (k \<cdot>\<^sub>m jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (k \<cdot>\<^sub>m jordan_matrix n_as)
[PROOF STEP]
have jm: "?M = four_block_mat (k \<cdot>\<^sub>m ?A) ?B ?C (k \<cdot>\<^sub>m ?D)"
[PROOF STATE]
proof (prove)
using this:
k \<cdot>\<^sub>m jordan_matrix (na # n_as) = four_block_mat (k \<cdot>\<^sub>m jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (k \<cdot>\<^sub>m jordan_matrix n_as)

goal (1 subgoal):
 1. k \<cdot>\<^sub>m jordan_matrix (na # n_as) = four_block_mat (k \<cdot>\<^sub>m jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (k \<cdot>\<^sub>m jordan_matrix n_as)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k \<cdot>\<^sub>m jordan_matrix (na # n_as) = four_block_mat (k \<cdot>\<^sub>m jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (k \<cdot>\<^sub>m jordan_matrix n_as)

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
have [simp]: "fst (case x of (n :: nat, a) \<Rightarrow> (n, k * a)) = fst x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (case x of (n, a) \<Rightarrow> (n, k * a)) = fst x
[PROOF STEP]
by (cases x, auto)
[PROOF STATE]
proof (state)
this:
fst (case ?x1 of (n, a) \<Rightarrow> (n, k * a)) = fst ?x1

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
have jmk: "jordan_matrix (?l (Cons na n_as)) = four_block_mat
     (jordan_block n (k * a)) ?B
     ?C (jordan_matrix (?l n_as))" (is "?kM = four_block_mat ?kA _ _ ?kD")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jordan_matrix (map (\<lambda>(n, a). (n, k * a)) (na # n_as)) = four_block_mat (jordan_block n (k * a)) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix (map (\<lambda>(n, a). (n, k * a)) n_as))
[PROOF STEP]
by (simp add: na jordan_matrix_Cons o_def)
[PROOF STATE]
proof (state)
this:
jordan_matrix (map (\<lambda>(n, a). (n, k * a)) (na # n_as)) = four_block_mat (jordan_block n (k * a)) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix (map (\<lambda>(n, a). (n, k * a)) n_as))

goal (1 subgoal):
 1. \<And>a n_as. similar_mat (k \<cdot>\<^sub>m jordan_matrix n_as) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) n_as)) \<Longrightarrow> similar_mat (k \<cdot>\<^sub>m jordan_matrix (a # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (a # n_as)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m jordan_matrix (na # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (na # n_as)))
[PROOF STEP]
unfolding jmk jm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (four_block_mat (k \<cdot>\<^sub>m jordan_block n a) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (k \<cdot>\<^sub>m jordan_matrix n_as)) (four_block_mat (jordan_block n (k * a)) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (jordan_matrix (map (\<lambda>(n, a). (n, k * a)) n_as)))
[PROOF STEP]
by (rule similar_mat_four_block_0_0[OF similar_mat_jordan_block_smult[OF _ k] Cons],
      auto intro!: similar_mat_refl)
[PROOF STATE]
proof (state)
this:
similar_mat (k \<cdot>\<^sub>m jordan_matrix (na # n_as)) (jordan_matrix (map (\<lambda>a. case a of (n, a) \<Rightarrow> (n, k * a)) (na # n_as)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_zero: assumes "abs x = 0" shows "x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = 0
[PROOF STEP]
using abs_def assms eq_iff_diff_eq_0
[PROOF STATE]
proof (prove)
using this:
Preliminaries.abs ?x \<equiv> if 0 \<le> ?x then ?x else 0 - ?x
Preliminaries.abs x = 0
(?a = ?b) = (?a - ?b = (0::?'a))

goal (1 subgoal):
 1. x = 0
[PROOF STEP]
by metis


[STATEMENT]
lemma sint_0 [simp]: "(sint x = 0) = (x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sint x = 0) = (x = 0)
[PROOF STEP]
by (fact signed_eq_0_iff)


[STATEMENT]
lemma tree1Eq [rule_format]:
    "\<forall>Y. (Suc n,Y) \<in> tree subs gamma = (\<exists>sigma \<in> subs gamma . (n,Y) \<in> tree subs sigma)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Y. ((Suc n, Y) \<in> tree subs gamma) = (\<exists>sigma\<in>subs gamma. (n, Y) \<in> tree subs sigma)
[PROOF STEP]
by (induct n) (blast, force)
    \<comment> \<open>moving down a tree\<close>


[STATEMENT]
lemma Cauchy_Schwarz_ineq_sum2:
  fixes f g:: "'a \<Rightarrow> real" and A:: "'a set"
  shows "(\<Sum> d \<in> A. f d * g d) \<le>
    (\<Sum> d \<in> A. (f d)^2) powr (1/2) * (\<Sum> d \<in> A. (g d)^2) powr (1/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d\<in>A. f d * g d) \<le> (\<Sum>d\<in>A. (f d)\<^sup>2) powr (1 / 2) * (\<Sum>d\<in>A. (g d)\<^sup>2) powr (1 / 2)
[PROOF STEP]
using Convex.Cauchy_Schwarz_ineq_sum[of "f" "g" "A"] le_powr_half_mult sum_nonneg zero_le_power2
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>A. f i * g i)\<^sup>2 \<le> (\<Sum>i\<in>A. (f i)\<^sup>2) * (\<Sum>i\<in>A. (g i)\<^sup>2)
\<lbrakk>?x\<^sup>2 \<le> ?y * ?z; 0 \<le> ?y; 0 \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?y powr (1 / 2) * ?z powr (1 / 2)
(\<And>x. x \<in> ?A \<Longrightarrow> (0::?'a) \<le> ?f x) \<Longrightarrow> (0::?'a) \<le> sum ?f ?A
(0::?'a) \<le> ?a\<^sup>2

goal (1 subgoal):
 1. (\<Sum>d\<in>A. f d * g d) \<le> (\<Sum>d\<in>A. (f d)\<^sup>2) powr (1 / 2) * (\<Sum>d\<in>A. (g d)\<^sup>2) powr (1 / 2)
[PROOF STEP]
by (metis (mono_tags, lifting))