[STATEMENT]
lemma sum_telescope':
  assumes "m \<le> n"
  shows   "(\<Sum>k = Suc m..n. f k - f (Suc k)) = f (Suc m) - (f (Suc n) :: 'a :: ab_group_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc m..n. f k - f (Suc k)) = f (Suc m) - f (Suc n)
[PROOF STEP]
by (rule dec_induct[OF assms]) (simp_all add: algebra_simps)


[STATEMENT]
lemma ALLC_LIST_eval_list_all: "eval ([\<forall> in L] DF) a = list_all (\<lambda>l. eval (DF l) a) L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval [\<forall> in L] DF a = list_all (\<lambda>l. eval (DF l) a) L
[PROOF STEP]
by (induction L, auto simp: TRUE_def UNARY_def)


[STATEMENT]
lemma isGlb_glb: "(\<exists>G. isGlb S cl G) = isGlb S cl (glb S cl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>G. isGlb S cl G) = isGlb S cl (glb S cl)
[PROOF STEP]
by (simp add: glb_def greatest_def isGlb_def some_eq_ex [symmetric])


[STATEMENT]
lemma Gromov_extension_isometry_boundary_to_boundary:
  fixes f::"'a::Gromov_hyperbolic_space \<Rightarrow> 'b::Gromov_hyperbolic_space"
  assumes "isometry_on UNIV f"
          "x \<in> Gromov_boundary"
  shows "(Gromov_extension f) x \<in> Gromov_boundary"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
have *: "Gromov_converging_at_boundary (\<lambda>n. f (rep_Gromov_completion x n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (rep_Gromov_completion x n))
[PROOF STEP]
by (simp add: Gromov_converging_at_infinity_isometry[OF assms(1)] Gromov_boundary_rep_converging assms(2))
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary (\<lambda>n. f (rep_Gromov_completion x n))

goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
unfolding Gromov_extension_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x \<in> Gromov_boundary then lim (to_Gromov_completion \<circ> f \<circ> rep_Gromov_completion x) else to_Gromov_completion (f (from_Gromov_completion x))) \<in> Gromov_boundary
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
x \<in> Gromov_boundary

goal (1 subgoal):
 1. (if x \<in> Gromov_boundary then lim (to_Gromov_completion \<circ> f \<circ> rep_Gromov_completion x) else to_Gromov_completion (f (from_Gromov_completion x))) \<in> Gromov_boundary
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
x \<in> Gromov_boundary

goal (1 subgoal):
 1. (if x \<in> Gromov_boundary then lim (\<lambda>xa. to_Gromov_completion (f (rep_Gromov_completion x xa))) else to_Gromov_completion (f (from_Gromov_completion x))) \<in> Gromov_boundary
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Gromov_boundary \<Longrightarrow> lim (\<lambda>xa. to_Gromov_completion (f (rep_Gromov_completion x xa))) \<in> Gromov_boundary
[PROOF STEP]
by (metis Gromov_converging_at_boundary_converges * limI)
[PROOF STATE]
proof (state)
this:
Gromov_extension f x \<in> Gromov_boundary

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scalar_right_mono: assumes
  "u \<in> carrier_vec n" "v \<in> carrier_vec n" "w \<in> carrier_vec n"
  and "\<And> i. i < n \<Longrightarrow> v $ i \<ge> w $ i"
  and "\<And> i. i < n \<Longrightarrow> u $ i \<ge> (0 :: 'a :: ordered_semiring_0)"
  shows "u \<bullet> v \<ge> u \<bullet> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<bullet> w \<le> u \<bullet> v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u \<bullet> w \<le> u \<bullet> v
[PROOF STEP]
have dim: "dim_vec v = dim_vec w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = dim_vec w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier_vec n
v \<in> carrier_vec n
w \<in> carrier_vec n
?i < n \<Longrightarrow> w $ ?i \<le> v $ ?i
?i < n \<Longrightarrow> (0::'a) \<le> u $ ?i

goal (1 subgoal):
 1. dim_vec v = dim_vec w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_vec v = dim_vec w

goal (1 subgoal):
 1. u \<bullet> w \<le> u \<bullet> v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<bullet> w \<le> u \<bullet> v
[PROOF STEP]
unfolding scalar_prod_def dim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec w. u $ i * w $ i) \<le> (\<Sum>i = 0..<dim_vec w. u $ i * v $ i)
[PROOF STEP]
by (intro sum_mono_ge times_right_mono, insert assms, auto)
[PROOF STATE]
proof (state)
this:
u \<bullet> w \<le> u \<bullet> v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ivl_integral_combine:
  fixes f::"real \<Rightarrow> 'a::banach"
  assumes "f integrable_on (closed_segment a b)"
  assumes "f integrable_on (closed_segment b c)"
  assumes "f integrable_on (closed_segment a c)"
  shows "ivl_integral a b f + ivl_integral b c f = ivl_integral a c f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ivl_integral a b f + ivl_integral b c f = ivl_integral a c f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ivl_integral a b f + ivl_integral b c f = ivl_integral a c f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ivl_integral a b f + ivl_integral b c f = ivl_integral a c f
[PROOF STEP]
using assms
      Henstock_Kurzweil_Integration.integral_combine[of a b c f]
      Henstock_Kurzweil_Integration.integral_combine[of a c b f]
      Henstock_Kurzweil_Integration.integral_combine[of b a c f]
      Henstock_Kurzweil_Integration.integral_combine[of b c a f]
      Henstock_Kurzweil_Integration.integral_combine[of c a b f]
      Henstock_Kurzweil_Integration.integral_combine[of c b a f]
[PROOF STATE]
proof (prove)
using this:
f integrable_on closed_segment a b
f integrable_on closed_segment b c
f integrable_on closed_segment a c
\<lbrakk>a \<le> b; b \<le> c; f integrable_on {a..c}\<rbrakk> \<Longrightarrow> integral {a..b} f + integral {b..c} f = integral {a..c} f
\<lbrakk>a \<le> c; c \<le> b; f integrable_on {a..b}\<rbrakk> \<Longrightarrow> integral {a..c} f + integral {c..b} f = integral {a..b} f
\<lbrakk>b \<le> a; a \<le> c; f integrable_on {b..c}\<rbrakk> \<Longrightarrow> integral {b..a} f + integral {a..c} f = integral {b..c} f
\<lbrakk>b \<le> c; c \<le> a; f integrable_on {b..a}\<rbrakk> \<Longrightarrow> integral {b..c} f + integral {c..a} f = integral {b..a} f
\<lbrakk>c \<le> a; a \<le> b; f integrable_on {c..b}\<rbrakk> \<Longrightarrow> integral {c..a} f + integral {a..b} f = integral {c..b} f
\<lbrakk>c \<le> b; b \<le> a; f integrable_on {c..a}\<rbrakk> \<Longrightarrow> integral {c..b} f + integral {b..a} f = integral {c..a} f

goal (1 subgoal):
 1. ivl_integral a b f + ivl_integral b c f = ivl_integral a c f
[PROOF STEP]
by (cases "a \<le> b"; cases "b \<le> c"; cases "a \<le> c")
       (auto simp: algebra_simps ivl_integral_def closed_segment_eq_real_ivl)
[PROOF STATE]
proof (state)
this:
ivl_integral a b f + ivl_integral b c f = ivl_integral a c f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in prob_space) constant_image_pos:
  assumes "\<forall>x\<in> space M. (0::real) < f x"
  and "\<exists>c::real. \<forall>x\<in> space M. f x = c"
shows "0 < (constant_image f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
assume "x\<in> space M"
[PROOF STATE]
proof (state)
this:
x \<in> space M

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
hence "0 < f x"
[PROOF STATE]
proof (prove)
using this:
x \<in> space M

goal (1 subgoal):
 1. 0 < f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> space M
\<forall>x\<in>space M. 0 < f x
\<exists>c. \<forall>x\<in>space M. f x = c

goal (1 subgoal):
 1. 0 < f x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < f x

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < f x

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
have "... = constant_image f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = constant_image f
[PROOF STEP]
using assms constant_imageI \<open>x\<in> space M\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>space M. 0 < f x
\<exists>c. \<forall>x\<in>space M. f x = c
\<exists>c. \<forall>x\<in>space M. ?f x = c \<Longrightarrow> \<forall>x\<in>space M. ?f x = constant_image ?f
x \<in> space M

goal (1 subgoal):
 1. f x = constant_image f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x = constant_image f

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < constant_image f
[PROOF STEP]
have ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < constant_image f

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < constant_image f

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x15 \<in> space M \<Longrightarrow> 0 < constant_image f

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?x15 \<in> space M \<Longrightarrow> 0 < constant_image f

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
using subprob_not_empty
[PROOF STATE]
proof (prove)
using this:
?x15 \<in> space M \<Longrightarrow> 0 < constant_image f
space M \<noteq> {}

goal (1 subgoal):
 1. 0 < constant_image f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < constant_image f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DERIV_cmult_right:
  "(f has_field_derivative D) (at x within s) \<Longrightarrow>
    ((\<lambda>x. f x * c) has_field_derivative D * c) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within s) \<Longrightarrow> ((\<lambda>x. f x * c) has_field_derivative D * c) (at x within s)
[PROOF STEP]
using DERIV_cmult
[PROOF STATE]
proof (prove)
using this:
(?f has_field_derivative ?D) (at ?x within ?s) \<Longrightarrow> ((\<lambda>x. ?c * ?f x) has_field_derivative ?c * ?D) (at ?x within ?s)

goal (1 subgoal):
 1. (f has_field_derivative D) (at x within s) \<Longrightarrow> ((\<lambda>x. f x * c) has_field_derivative D * c) (at x within s)
[PROOF STEP]
by (auto simp add: ac_simps)


[STATEMENT]
lemma t1_space_derived_set_of_singleton:
  "t1_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. X derived_set_of {x} = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X = (\<forall>x\<in>topspace X. X derived_set_of {x} = {})
[PROOF STEP]
apply (simp add: t1_space_def derived_set_of_def, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>\<forall>x\<in>topspace X. \<forall>y\<in>topspace X. x \<noteq> y \<longrightarrow> (\<exists>U. openin X U \<and> x \<in> U \<and> y \<notin> U); x \<in> topspace X; xa \<in> topspace X\<rbrakk> \<Longrightarrow> \<exists>T. xa \<in> T \<and> openin X T \<and> (x = xa \<or> x \<notin> T)
 2. \<And>x y. \<lbrakk>\<forall>x\<in>topspace X. \<forall>xa. xa \<in> topspace X \<longrightarrow> (\<exists>T. xa \<in> T \<and> openin X T \<and> (x = xa \<or> x \<notin> T)); x \<in> topspace X; y \<in> topspace X; x \<noteq> y\<rbrakk> \<Longrightarrow> \<exists>U. openin X U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
apply (metis openin_topspace)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>topspace X. \<forall>xa. xa \<in> topspace X \<longrightarrow> (\<exists>T. xa \<in> T \<and> openin X T \<and> (x = xa \<or> x \<notin> T)); x \<in> topspace X; y \<in> topspace X; x \<noteq> y\<rbrakk> \<Longrightarrow> \<exists>U. openin X U \<and> x \<in> U \<and> y \<notin> U
[PROOF STEP]
by force


[STATEMENT]
lemma path_rtrancl_edgesD: "path g u p v \<Longrightarrow> (u,v)\<in>(edges g)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path g u p v \<Longrightarrow> (u, v) \<in> (edges g)\<^sup>*
[PROOF STEP]
by (auto simp: rtrancl_edges_iff_path)


[STATEMENT]
lemma DERIV_mirror: "(DERIV f (- x) :> y) \<longleftrightarrow> (DERIV (\<lambda>x. f (- x)) x :> - y)"
  for f :: "real \<Rightarrow> real" and x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_real_derivative y) (at (- x)) = ((\<lambda>x. f (- x)) has_real_derivative - y) (at x)
[PROOF STEP]
by (simp add: DERIV_def filterlim_at_split filterlim_at_left_to_right
      tendsto_minus_cancel_left field_simps conj_commute)


[STATEMENT]
lemma summable_comparison_test_ev:
  "eventually (\<lambda>n. norm (f n) \<le> g n) sequentially \<Longrightarrow> summable g \<Longrightarrow> summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<^sub>F n in sequentially. norm (f n) \<le> g n; summable g\<rbrakk> \<Longrightarrow> summable f
[PROOF STEP]
by (rule summable_comparison_test) (auto simp: eventually_at_top_linorder)


[STATEMENT]
lemma comp_red_monic_basis_is_auto_reduced: "is_auto_reduced (set (comp_red_monic_basis xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_auto_reduced (set (comp_red_monic_basis xs))
[PROOF STEP]
unfolding set_comp_red_monic_basis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_auto_reduced (monic ` set (comp_red_basis xs))
[PROOF STEP]
by (rule image_monic_is_auto_reduced, rule comp_red_basis_is_auto_reduced)


[STATEMENT]
lemma nat_pow_0 [simp]: "x [^]\<^bsub>G\<^esub> (0::nat) = \<one>\<^bsub>G\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>G\<^esub> 0 = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
by (simp add: nat_pow_def)


[STATEMENT]
lemma block_to_sum:
  assumes "c>0"
  defines b: "b \<equiv> 2 ^ (Suc c)"
  assumes yltx_digits: "\<forall>t'. nth_digit y t' b \<le> nth_digit x t' b"
  shows "y mod b^t \<le> x mod b^t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
proof(cases "t=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t = 0 \<Longrightarrow> y mod b ^ t \<le> x mod b ^ t
 2. t \<noteq> 0 \<Longrightarrow> y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
t = 0

goal (2 subgoals):
 1. t = 0 \<Longrightarrow> y mod b ^ t \<le> x mod b ^ t
 2. t \<noteq> 0 \<Longrightarrow> y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t = 0

goal (1 subgoal):
 1. y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y mod b ^ t \<le> x mod b ^ t

goal (1 subgoal):
 1. t \<noteq> 0 \<Longrightarrow> y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<noteq> 0 \<Longrightarrow> y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
t \<noteq> 0

goal (1 subgoal):
 1. t \<noteq> 0 \<Longrightarrow> y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
using yltx_digits
[PROOF STATE]
proof (prove)
using this:
\<forall>t'. nth_digit y t' b \<le> nth_digit x t' b

goal (1 subgoal):
 1. y mod b ^ t \<le> x mod b ^ t
[PROOF STEP]
apply(induct t, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>y mod b ^ t \<le> x mod b ^ t; \<forall>t'. nth_digit y t' b \<le> nth_digit x t' b\<rbrakk> \<Longrightarrow> y mod (b * b ^ t) \<le> x mod (b * b ^ t)
[PROOF STEP]
using yltx_digits
[PROOF STATE]
proof (prove)
using this:
\<forall>t'. nth_digit y t' b \<le> nth_digit x t' b

goal (1 subgoal):
 1. \<And>t. \<lbrakk>y mod b ^ t \<le> x mod b ^ t; \<forall>t'. nth_digit y t' b \<le> nth_digit x t' b\<rbrakk> \<Longrightarrow> y mod (b * b ^ t) \<le> x mod (b * b ^ t)
[PROOF STEP]
by (smt add.commute add_left_cancel add_mono_thms_linordered_semiring(1) mod_mult2_eq
        mult_le_cancel2 nth_digit_def semiring_normalization_rules(7))
[PROOF STATE]
proof (state)
this:
y mod b ^ t \<le> x mod b ^ t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_prime_factorization_nat':
  "set (prime_factorization_nat' n) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (prime_factorization_nat' n) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
[PROOF STEP]
proof (intro equalityI subsetI; clarify)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> set (prime_factorization_nat' n) \<Longrightarrow> (a, b) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
 2. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
fix p k :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> set (prime_factorization_nat' n) \<Longrightarrow> (a, b) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
 2. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
assume pk: "(p, k) \<in> set (prime_factorization_nat' n)"
[PROOF STATE]
proof (state)
this:
(p, k) \<in> set (prime_factorization_nat' n)

goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> set (prime_factorization_nat' n) \<Longrightarrow> (a, b) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
 2. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
hence p: "p \<in> prime_factors n"
[PROOF STATE]
proof (prove)
using this:
(p, k) \<in> set (prime_factorization_nat' n)

goal (1 subgoal):
 1. p \<in># prime_factorization n
[PROOF STEP]
by (auto simp: prime_factorization_nat'_def Let_def multiset_prime_factorization_nat_correct)
[PROOF STATE]
proof (state)
this:
p \<in># prime_factorization n

goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> set (prime_factorization_nat' n) \<Longrightarrow> (a, b) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
 2. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
hence p': "prime p"
[PROOF STATE]
proof (prove)
using this:
p \<in># prime_factorization n

goal (1 subgoal):
 1. prime p
[PROOF STEP]
by (simp add: prime_factors_multiplicity)
[PROOF STATE]
proof (state)
this:
prime p

goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> set (prime_factorization_nat' n) \<Longrightarrow> (a, b) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
 2. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
from pk p'
[PROOF STATE]
proof (chain)
picking this:
(p, k) \<in> set (prime_factorization_nat' n)
prime p
[PROOF STEP]
have "k = multiplicity p n - 1"
[PROOF STATE]
proof (prove)
using this:
(p, k) \<in> set (prime_factorization_nat' n)
prime p

goal (1 subgoal):
 1. k = multiplicity p n - 1
[PROOF STEP]
by (auto simp: prime_factorization_nat'_def Let_def multiset_prime_factorization_nat_correct
          count_prime_factorization_prime [symmetric] count_mset )
[PROOF STATE]
proof (state)
this:
k = multiplicity p n - 1

goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> set (prime_factorization_nat' n) \<Longrightarrow> (a, b) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
 2. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
p \<in># prime_factorization n
k = multiplicity p n - 1
[PROOF STEP]
show "(p, k) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n"
[PROOF STATE]
proof (prove)
using this:
p \<in># prime_factorization n
k = multiplicity p n - 1

goal (1 subgoal):
 1. (p, k) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(p, k) \<in> (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n

goal (1 subgoal):
 1. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
fix p :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
assume "p \<in> prime_factors n"
[PROOF STATE]
proof (state)
this:
p \<in># prime_factorization n

goal (1 subgoal):
 1. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p \<in># prime_factorization n

goal (1 subgoal):
 1. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
p \<in># prime_factorization n
[PROOF STEP]
have "prime p"
[PROOF STATE]
proof (prove)
using this:
p \<in># prime_factorization n

goal (1 subgoal):
 1. prime p
[PROOF STEP]
by (simp add: prime_factors_multiplicity)
[PROOF STATE]
proof (state)
this:
prime p

goal (1 subgoal):
 1. \<And>a b p. p \<in># prime_factorization n \<Longrightarrow> (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p \<in># prime_factorization n
prime p
[PROOF STEP]
show "(p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)"
[PROOF STATE]
proof (prove)
using this:
p \<in># prime_factorization n
prime p

goal (1 subgoal):
 1. (p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)
[PROOF STEP]
by (auto simp: prime_factorization_nat'_def Let_def multiset_prime_factorization_nat_correct
          count_prime_factorization_prime [symmetric] count_mset)
[PROOF STATE]
proof (state)
this:
(p, multiplicity p n - 1) \<in> set (prime_factorization_nat' n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_eq_append_conv: "x#xs = ys@zs =
 (ys = [] \<and> x#xs = zs \<or> (\<exists>ys'. x#ys' = ys \<and> xs = ys'@zs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs = ys @ zs) = (ys = [] \<and> x # xs = zs \<or> (\<exists>ys'. x # ys' = ys \<and> xs = ys' @ zs))
[PROOF STEP]
by(cases ys) auto


[STATEMENT]
lemma swapVal_sym: "(val ^[x \<and> y]_zs) = (val ^[y \<and> x]_zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val ^[x \<and> y]_zs = val ^[y \<and> x]_zs
[PROOF STEP]
unfolding swapVal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xs xa. val xs (xa @xs[x \<and> y]_zs)) = (\<lambda>xs xa. val xs (xa @xs[y \<and> x]_zs))
[PROOF STEP]
by(auto simp add: sw_sym)


[STATEMENT]
lemma continuous_finite_range_constant:
  fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1"
  assumes "connected S"
      and "continuous_on S f"
      and "finite (f ` S)"
    shows "f constant_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f constant_on S
[PROOF STEP]
using assms continuous_finite_range_constant_eq
[PROOF STATE]
proof (prove)
using this:
connected S
continuous_on S f
finite (f ` S)
connected ?S = (\<forall>f. continuous_on ?S f \<and> finite (f ` ?S) \<longrightarrow> f constant_on ?S)

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


[STATEMENT]
lemma complex_cnj_power [simp]: "cnj (x ^ n) = cnj x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (x ^ n) = cnj x ^ n
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
theorem Tarski_semantic:
assumes 0: "T \<in> fmla" "Fvars T = {xx}"
and 1: "\<And>\<phi>. \<phi> \<in> fmla \<Longrightarrow> Fvars \<phi> = {} \<Longrightarrow> isTrue (eqv (subst T \<langle>\<phi>\<rangle> xx) \<phi>)"
shows "\<not> consistent"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> consistent
[PROOF STEP]
using assms prv_eq_isTrue[of "eqv (subst T \<langle>_\<rangle> xx) _"]
[PROOF STATE]
proof (prove)
using this:
T \<in> fmla
Fvars T = {xx}
\<lbrakk>?\<phi> \<in> fmla; Fvars ?\<phi> = {}\<rbrakk> \<Longrightarrow> isTrue (eqv (subst T \<langle>?\<phi>\<rangle> xx) ?\<phi>)
\<lbrakk>eqv (subst T \<langle>?uu3\<rangle> xx) ?uua3 \<in> fmla; Fvars (eqv (subst T \<langle>?uu3\<rangle> xx) ?uua3) = {}\<rbrakk> \<Longrightarrow> prv (eqv (subst T \<langle>?uu3\<rangle> xx) ?uua3) = isTrue (eqv (subst T \<langle>?uu3\<rangle> xx) ?uua3)

goal (1 subgoal):
 1. \<not> consistent
[PROOF STEP]
by (intro Tarski_proof_theoretic[OF 0]) auto


[STATEMENT]
theorem ref_map_soundness:
  fixes A::"('sA,'a)ioa" and B::"('sB,'a)ioa" and f::"'sB \<Rightarrow> 'sA"
  assumes "is_ref_map f B A" and "ext A = ext B"
  shows "traces B \<subseteq> traces A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.traces B \<subseteq> local.traces A
[PROOF STEP]
using assms ref_map_execs exec_inc_imp_trace_inc
[PROOF STATE]
proof (prove)
using this:
is_ref_map f B A
externals (ioa.asig A) = externals (ioa.asig B)
\<lbrakk>is_ref_map ?f ?B ?A; is_exec_of ?B ?e_B\<rbrakk> \<Longrightarrow> \<exists>e_A. is_exec_of ?A e_A \<and> trace (ioa.asig ?A) e_A = trace (ioa.asig ?A) ?e_B
\<lbrakk>externals (ioa.asig ?B) = externals (ioa.asig ?A); \<And>e_B. is_exec_of ?B e_B \<Longrightarrow> \<exists>e_A. is_exec_of ?A e_A \<and> trace (ioa.asig ?A) e_A = trace (ioa.asig ?A) e_B\<rbrakk> \<Longrightarrow> local.traces ?B \<subseteq> local.traces ?A

goal (1 subgoal):
 1. local.traces B \<subseteq> local.traces A
[PROOF STEP]
by metis


[STATEMENT]
lemma deriv_ln_Gamma_real:
  assumes "z > 0"
  shows   "deriv ln_Gamma z = Digamma (z :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv ln_Gamma z = Digamma z
[PROOF STEP]
by (intro DERIV_imp_deriv has_field_derivative_ln_Gamma_real assms)


[STATEMENT]
lemma "fps_nth (fps_of_poly 1 / fps_of_poly [:1, -3, 3, -1 :: complex:]) \<in>
         O(\<lambda>n. of_nat n ^ 2 * complex_of_real 1 ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (fps_of_poly 1 / fps_of_poly [:1, - 3, 3, - 1:]) \<in> O(\<lambda>n. (of_nat n)\<^sup>2 * complex_of_real 1 ^ n)
[PROOF STEP]
by ratfps_bigo


[STATEMENT]
lemma orthogonal_matrix': "orthogonal_matrix (Q:: real ^'n^'n) \<longleftrightarrow>  Q ** transpose Q= mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_matrix Q = (Q ** Finite_Cartesian_Product.transpose Q = mat 1)
[PROOF STEP]
by (metis matrix_left_right_inverse orthogonal_matrix_def)


[STATEMENT]
lemma Poly_append: "Poly (a @ b) = Poly a + monom 1 (length a) * Poly b"
  for a :: "'a::comm_semiring_1 list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (a @ b) = Poly a + monom (1::'a) (length a) * Poly b
[PROOF STEP]
by (induct a) (auto simp: monom_0 monom_Suc)


[STATEMENT]
lemma make_first_column_positive_invertible:
  shows  "\<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A)
  \<and> make_first_column_positive A = P * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
let ?P = "Matrix.mat (dim_row A) (dim_row A)
          (\<lambda>(i,j). if i = j then if A $$(i,0) < 0 then - 1 else 1 else 0::int)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
have "invertible_mat ?P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
have "(map abs (diag_mat ?P)) = replicate (length ((map abs (diag_mat ?P)))) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))) = replicate (length (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))))) 1
[PROOF STEP]
by (rule replicate_length_same[symmetric], auto simp add: diag_mat_def)
[PROOF STATE]
proof (state)
this:
map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))) = replicate (length (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))))) 1

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
hence m_rw: "(map abs (diag_mat ?P)) = replicate (dim_row A) 1"
[PROOF STATE]
proof (prove)
using this:
map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))) = replicate (length (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))))) 1

goal (1 subgoal):
 1. map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))) = replicate (dim_row A) 1
[PROOF STEP]
by (auto simp add: diag_mat_def)
[PROOF STATE]
proof (state)
this:
map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))) = replicate (dim_row A) 1

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
have "Determinant.det ?P = prod_list (diag_mat ?P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) = prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))
[PROOF STEP]
by (rule det_upper_triangular, auto)
[PROOF STATE]
proof (state)
this:
det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) = prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) = prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
have "abs ... = prod_list (map abs (diag_mat ?P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))\<bar> = prod_list (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))))
[PROOF STEP]
unfolding prod_list_abs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))\<bar> = \<bar>prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))\<bar>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<bar>prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))\<bar> = prod_list (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))))

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>prod_list (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))\<bar> = prod_list (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))))

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
have " ... = prod_list (replicate (dim_row A) 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))) = prod_list (replicate (dim_row A) 1)
[PROOF STEP]
using m_rw
[PROOF STATE]
proof (prove)
using this:
map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))) = replicate (dim_row A) 1

goal (1 subgoal):
 1. prod_list (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))) = prod_list (replicate (dim_row A) 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod_list (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))) = prod_list (replicate (dim_row A) 1)

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod_list (map abs (diag_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))) = prod_list (replicate (dim_row A) 1)

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (replicate (dim_row A) 1) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_list (replicate (dim_row A) 1) = 1

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))\<bar> = 1
[PROOF STEP]
have "\<bar>Determinant.det ?P\<bar> = 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))\<bar> = 1

goal (1 subgoal):
 1. \<bar>det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))\<bar> = 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<bar>det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))\<bar> = 1

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
hence "Determinant.det ?P dvd 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))\<bar> = 1

goal (1 subgoal):
 1. is_unit (det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
is_unit (det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_unit (det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
using invertible_iff_is_unit_JNF mat_carrier
[PROOF STATE]
proof (prove)
using this:
is_unit (det (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)))
?A \<in> carrier_mat ?n ?n \<Longrightarrow> invertible_mat ?A = (det ?A dvd (1::?'a))
Matrix.mat ?nr ?nc ?f \<in> carrier_mat ?nr ?nc

goal (1 subgoal):
 1. invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))

goal:
No subgoals!
[PROOF STEP]
(*Thanks to the new bridge*)
[PROOF STATE]
proof (state)
this:
invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
have "make_first_column_positive A = ?P * A" (is "?M = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. make_first_column_positive A = Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A
[PROOF STEP]
proof (rule eq_matI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
 2. dim_row (make_first_column_positive A) = dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)
 3. dim_col (make_first_column_positive A) = dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)
[PROOF STEP]
show "dim_row ?M = dim_row (?P * A)" and "dim_col ?M = dim_col (?P * A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (make_first_column_positive A) = dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) &&& dim_col (make_first_column_positive A) = dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row (make_first_column_positive A) = dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)
dim_col (make_first_column_positive A) = dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
assume i: "i < dim_row (?P * A)" and j: "j < dim_col (?P * A)"
[PROOF STATE]
proof (state)
this:
i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)
j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have set_rw: "{0..<dim_row A} = insert i ({0..<dim_row A} - {i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<dim_row A} = insert i ({0..<dim_row A} - {i})
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)

goal (1 subgoal):
 1. {0..<dim_row A} = insert i ({0..<dim_row A} - {i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<dim_row A} = insert i ({0..<dim_row A} - {i})

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have rw0: "(\<Sum>ia \<in> {0..<dim_row A } - {i}. Matrix.row ?P i $v ia * col A j $v ia) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia\<in>{0..<dim_row A} - {i}. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = 0
[PROOF STEP]
by (rule sum.neutral, insert i, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia\<in>{0..<dim_row A} - {i}. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = 0

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have "(?P * A) $$ (i, j) = Matrix.row ?P i \<bullet> col A j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i \<bullet> col A j
[PROOF STEP]
using i j
[PROOF STATE]
proof (prove)
using this:
i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)
j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)

goal (1 subgoal):
 1. (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i \<bullet> col A j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i \<bullet> col A j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i \<bullet> col A j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have "... = (\<Sum>ia = 0..<dim_row A. Matrix.row ?P i $v ia * col A j $v ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i \<bullet> col A j = (\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_vec (col A j). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = (\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i \<bullet> col A j = (\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i \<bullet> col A j = (\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have "... =  (\<Sum>ia \<in> insert i ({0..<dim_row A} - {i}). Matrix.row ?P i $v ia * col A j $v ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = (\<Sum>ia\<in>insert i ({0..<dim_row A} - {i}). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)
[PROOF STEP]
using set_rw
[PROOF STATE]
proof (prove)
using this:
{0..<dim_row A} = insert i ({0..<dim_row A} - {i})

goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = (\<Sum>ia\<in>insert i ({0..<dim_row A} - {i}). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = (\<Sum>ia\<in>insert i ({0..<dim_row A} - {i}). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<dim_row A. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = (\<Sum>ia\<in>insert i ({0..<dim_row A} - {i}). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have "... = Matrix.row ?P i $v i * col A j $v i
        + (\<Sum>ia \<in> {0..<dim_row A } - {i}. Matrix.row ?P i $v ia * col A j $v ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia\<in>insert i ({0..<dim_row A} - {i}). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i + (\<Sum>ia\<in>{0..<dim_row A} - {i}. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)
[PROOF STEP]
by (rule sum.insert, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia\<in>insert i ({0..<dim_row A} - {i}). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i + (\<Sum>ia\<in>{0..<dim_row A} - {i}. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>ia\<in>insert i ({0..<dim_row A} - {i}). row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i + (\<Sum>ia\<in>{0..<dim_row A} - {i}. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have "... = Matrix.row ?P i $v i * col A j $v i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i + (\<Sum>ia\<in>{0..<dim_row A} - {i}. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i
[PROOF STEP]
unfolding rw0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i + 0 = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i + (\<Sum>ia\<in>{0..<dim_row A} - {i}. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v ia * col A j $v ia) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i
[PROOF STEP]
have *: "(?P * A) $$ (i, j) = Matrix.row ?P i $v i * col A j $v i"
[PROOF STATE]
proof (prove)
using this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i

goal (1 subgoal):
 1. (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
have "... = ?M $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i = make_first_column_positive A $$ (i, j)
[PROOF STEP]
by (cases " A $$ (i, 0) < 0", insert i j, auto simp add: col_def)
[PROOF STATE]
proof (state)
this:
row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0)) i $v i * col A j $v i = make_first_column_positive A $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A); j < dim_col (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = make_first_column_positive A $$ (i, j)
[PROOF STEP]
show "?M $$ (i, j) = (?P * A) $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
(Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j) = make_first_column_positive A $$ (i, j)

goal (1 subgoal):
 1. make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
make_first_column_positive A $$ (i, j) = (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
make_first_column_positive A = Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
make_first_column_positive A = Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
have "?P \<in> carrier_mat (dim_row A) (dim_row A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) \<in> carrier_mat (dim_row A) (dim_row A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) \<in> carrier_mat (dim_row A) (dim_row A)

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
make_first_column_positive A = Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A
Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) \<in> carrier_mat (dim_row A) (dim_row A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
invertible_mat (Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0))
make_first_column_positive A = Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) * A
Matrix.mat (dim_row A) (dim_row A) (\<lambda>(i, j). if i = j then if A $$ (i, 0) < 0 then - 1 else 1 else 0) \<in> carrier_mat (dim_row A) (dim_row A)

goal (1 subgoal):
 1. \<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible_mat P \<and> P \<in> carrier_mat (dim_row A) (dim_row A) \<and> make_first_column_positive A = P * A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ivp_solsD:
  assumes "X \<in> Sols f U S t\<^sub>0 s"
  shows "D X = (\<lambda>t. f t (X t)) on U s" and "X t\<^sub>0 = s"
    and "X \<in> U s \<rightarrow> S" and "t\<^sub>0 \<in> U s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ( D X = (\<lambda>t. f t (X t)) on U s &&& X t\<^sub>0 = s) &&& X \<in> U s \<rightarrow> S &&& t\<^sub>0 \<in> U s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X \<in> Sols f U S t\<^sub>0 s

goal (1 subgoal):
 1. ( D X = (\<lambda>t. f t (X t)) on U s &&& X t\<^sub>0 = s) &&& X \<in> U s \<rightarrow> S &&& t\<^sub>0 \<in> U s
[PROOF STEP]
unfolding ivp_sols_def
[PROOF STATE]
proof (prove)
using this:
X \<in> {X \<in> U s \<rightarrow> S.  D X = (\<lambda>t. f t (X t)) on U s \<and> X t\<^sub>0 = s \<and> t\<^sub>0 \<in> U s}

goal (1 subgoal):
 1. ( D X = (\<lambda>t. f t (X t)) on U s &&& X t\<^sub>0 = s) &&& X \<in> U s \<rightarrow> S &&& t\<^sub>0 \<in> U s
[PROOF STEP]
by auto


[STATEMENT]
lemma return_time_some:
  assumes "returns_to P x"
  shows "return_time P x =
    (SOME t. t > 0 \<and> t \<in> existence_ivl0 x \<and> flow0 x t \<in> P \<and> (\<forall>s \<in> {0<..<t}. flow0 x s \<notin> P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. return_time P x = (SOME t. 0 < t \<and> t \<in> existence_ivl0 x \<and> flow0 x t \<in> P \<and> (\<forall>s\<in>{0<..<t}. flow0 x s \<notin> P))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
returns_to P x

goal (1 subgoal):
 1. return_time P x = (SOME t. 0 < t \<and> t \<in> existence_ivl0 x \<and> flow0 x t \<in> P \<and> (\<forall>s\<in>{0<..<t}. flow0 x s \<notin> P))
[PROOF STEP]
by (auto simp: return_time_def)


[STATEMENT]
lemma minus_right: "prod a (- b) = - prod a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ** - b = - (a ** b)
[PROOF STEP]
by (rule additive.minus [OF additive_right])


[STATEMENT]
theorem (in prime_number_theorem) totient_primorial_less:
  fixes \<epsilon> :: real
  defines "C \<equiv> third_mertens_const" and "h \<equiv> primorial"
  assumes "\<epsilon> > 0"
  shows   "eventually (\<lambda>x. totient (h x) < (1 + \<epsilon>) * C * h x / ln (ln (h x))) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "C > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < C
[PROOF STEP]
by (simp add: C_def third_mertens_const_pos)
[PROOF STATE]
proof (state)
this:
0 < C

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x))) \<sim>[at_top] (\<lambda>x. (1 + \<epsilon>) * C / ln (\<theta> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x)))) \<sim>[at_top] (\<lambda>x. (1 + \<epsilon>) * C / ln (\<theta> x))
[PROOF STEP]
by (simp add: ln_primorial h_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x)))) \<sim>[at_top] (\<lambda>x. (1 + \<epsilon>) * C / ln (\<theta> x))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x)))) \<sim>[at_top] (\<lambda>x. (1 + \<epsilon>) * C / ln (\<theta> x))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "\<dots> \<sim>[at_top] (\<lambda>x. (1 + \<epsilon>) * C / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (\<theta> x)) \<sim>[at_top] (\<lambda>x. (1 + \<epsilon>) * C / ln x)
[PROOF STEP]
by (intro asymp_equiv_intros ln_\<theta>_asymp_equiv)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (\<theta> x)) \<sim>[at_top] (\<lambda>x. (1 + \<epsilon>) * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>c d. c \<sim>[at_top] d \<Longrightarrow> c \<sim>[at_top] d) \<Longrightarrow> (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x)))) \<sim>[at_top] (\<lambda>a. (1 + \<epsilon>) * C / ln a)
[PROOF STEP]
have "(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) - (1 + \<epsilon>) * C / ln x) \<in> o(\<lambda>x. (1 + \<epsilon>) * C / ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<And>c d. c \<sim>[at_top] d \<Longrightarrow> c \<sim>[at_top] d) \<Longrightarrow> (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x)))) \<sim>[at_top] (\<lambda>a. (1 + \<epsilon>) * C / ln a)

goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (1 + \<epsilon>) * C / ln x) \<in> o(\<lambda>x. (1 + \<epsilon>) * C / ln x)
[PROOF STEP]
by (rule asymp_equiv_imp_diff_smallo)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (1 + \<epsilon>) * C / ln x) \<in> o(\<lambda>x. (1 + \<epsilon>) * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (1 + \<epsilon>) * C / ln x) \<in> o(\<lambda>x. (1 + \<epsilon>) * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "(\<lambda>x. (1 + \<epsilon>) * C / ln x) \<in> O(\<lambda>x. 1 / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln x) \<in> O(\<lambda>x. 1 / ln x)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln x) \<in> O(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln x) \<in> O(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) - (1 + \<epsilon>) * C / ln x) =
               (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) - C / ln x - \<epsilon> * C / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (1 + \<epsilon>) * C / ln x) = (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x)
[PROOF STEP]
by (simp add: algebra_simps fun_eq_iff add_divide_distrib)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (1 + \<epsilon>) * C / ln x) = (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)
[PROOF STEP]
have "(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) - C / ln x - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
hence "(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) - C / ln x - \<epsilon> * C / ln x -
           ((\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - C / ln x)) \<in> o(\<lambda>x. 1 / ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x - ((\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - C / ln x)) \<in> o(\<lambda>x. 1 / ln x)
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + \<epsilon>) * third_mertens_const / ln (ln (real (h x))) - third_mertens_const / ln x - \<epsilon> * third_mertens_const / ln x) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * third_mertens_const / ln (ln (real (h x))) - third_mertens_const / ln x - \<epsilon> * third_mertens_const / ln x - ((\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - third_mertens_const / ln x)) \<in> o(\<lambda>x. 1 / ln x)
[PROOF STEP]
by (rule sum_in_smallo[OF _ landau_o.big_small_trans[OF mertens_third_theorem]]) real_asymp+
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x - ((\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - C / ln x)) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
hence "(\<lambda>x. ((1 + \<epsilon>) * C / ln (ln (h x)) - (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p)) -
                 (\<epsilon> * C / ln x)) \<in> o(\<lambda>x. 1 / ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - C / ln x - \<epsilon> * C / ln x - ((\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - C / ln x)) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - \<epsilon> * C / ln x) \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "(\<lambda>x. 1 / ln x) \<in> O(\<lambda>x. \<epsilon> * C / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 1 / ln x) \<in> O(\<lambda>x. \<epsilon> * C / ln x)
[PROOF STEP]
using \<open>\<epsilon> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>

goal (1 subgoal):
 1. (\<lambda>x. 1 / ln x) \<in> O(\<lambda>x. \<epsilon> * C / ln x)
[PROOF STEP]
by (simp add: landau_divide_simps C_def third_mertens_const_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. 1 / ln x) \<in> O(\<lambda>x. \<epsilon> * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - \<epsilon> * C / ln x) \<in> o(\<lambda>x. \<epsilon> * C / ln x)
[PROOF STEP]
have "(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) - (\<Prod>p | prime p \<and> real p \<le> x. 1 - 1 / p))
                  \<sim>[at_top] (\<lambda>x. \<epsilon> * C / ln x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) - \<epsilon> * C / ln x) \<in> o(\<lambda>x. \<epsilon> * C / ln x)

goal (1 subgoal):
 1. (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) \<sim>[at_top] (\<lambda>x. \<epsilon> * C / ln x)
[PROOF STEP]
by (rule smallo_imp_asymp_equiv)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) \<sim>[at_top] (\<lambda>x. \<epsilon> * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
hence "eventually (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) - (\<Prod>p | prime p \<and> real p \<le> x. 1 - 1 / p) > 0
                          \<longleftrightarrow> \<epsilon> * C / ln x > 0) at_top"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) \<sim>[at_top] (\<lambda>x. \<epsilon> * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. (0 < (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) = (0 < \<epsilon> * C / ln x)
[PROOF STEP]
by (rule asymp_equiv_eventually_pos_iff)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. (0 < (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) = (0 < \<epsilon> * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. (0 < (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) = (0 < \<epsilon> * C / ln x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "eventually (\<lambda>x. \<epsilon> * C / ln x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < \<epsilon> * C / ln x
[PROOF STEP]
using \<open>\<epsilon> > 0\<close> \<open>C > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>
0 < C

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < \<epsilon> * C / ln x
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < \<epsilon> * C / ln x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. (0 < (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) = (0 < \<epsilon> * C / ln x)
\<forall>\<^sub>F x in at_top. 0 < \<epsilon> * C / ln x
[PROOF STEP]
have "eventually (\<lambda>x. (1 + \<epsilon>) * C / ln (ln (h x)) >
                      (\<Prod>p | prime p \<and> real p \<le> x. 1 - 1 / p)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. (0 < (1 + \<epsilon>) * C / ln (ln (real (h x))) - (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x)) = (0 < \<epsilon> * C / ln x)
\<forall>\<^sub>F x in at_top. 0 < \<epsilon> * C / ln x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x)))
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x)))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x)))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x))) \<Longrightarrow> real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x)))

goal (1 subgoal):
 1. \<And>x. (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x))) \<Longrightarrow> real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "h x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < h x
[PROOF STEP]
by (auto simp: h_def primorial_def intro!: prod_pos dest: prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
0 < h x

goal (1 subgoal):
 1. \<And>x. (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x))) \<Longrightarrow> real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
have "h x * ((1 + \<epsilon>) * C / ln (ln (h x))) > totient (h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (totient (h x)) < real (h x) * ((1 + \<epsilon>) * C / ln (ln (real (h x))))
[PROOF STEP]
using elim primorial_pos[of x]
[PROOF STATE]
proof (prove)
using this:
(\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x)))
0 < primorial x

goal (1 subgoal):
 1. real (totient (h x)) < real (h x) * ((1 + \<epsilon>) * C / ln (ln (real (h x))))
[PROOF STEP]
unfolding h_def totient_primorial
[PROOF STATE]
proof (prove)
using this:
(\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (primorial x)))
0 < primorial x

goal (1 subgoal):
 1. real (primorial x) * (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real p) < real (primorial x) * ((1 + \<epsilon>) * C / ln (ln (real (primorial x))))
[PROOF STEP]
by (intro mult_strict_left_mono) auto
[PROOF STATE]
proof (state)
this:
real (totient (h x)) < real (h x) * ((1 + \<epsilon>) * C / ln (ln (real (h x))))

goal (1 subgoal):
 1. \<And>x. (\<Prod>x\<in>{p. prime p \<and> real p \<le> x}. 1 - 1 / real x) < (1 + \<epsilon>) * C / ln (ln (real (h x))) \<Longrightarrow> real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
real (totient (h x)) < real (h x) * ((1 + \<epsilon>) * C / ln (ln (real (h x))))

goal (1 subgoal):
 1. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. real (totient (h x)) < (1 + \<epsilon>) * C * real (h x) / ln (ln (real (h x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UNIV_2: "UNIV = {1::2, 2::2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = {1, 2}
[PROOF STEP]
using exhaust_2
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2

goal (1 subgoal):
 1. UNIV = {1, 2}
[PROOF STEP]
by auto


[STATEMENT]
lemma has_vector_derivative_mult[derivative_intros]:
  "(f has_vector_derivative f') (at x within s) \<Longrightarrow> (g has_vector_derivative g') (at x within s) \<Longrightarrow>
    ((\<lambda>x. f x * g x) has_vector_derivative (f x * g' + f' * g x)) (at x within s)"
  for f g :: "real \<Rightarrow> 'a::real_normed_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_vector_derivative f') (at x within s); (g has_vector_derivative g') (at x within s)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x * g x) has_vector_derivative f x * g' + f' * g x) (at x within s)
[PROOF STEP]
by (rule bounded_bilinear.has_vector_derivative[OF bounded_bilinear_mult])


[STATEMENT]
lemma matrix_add_vect_distrib: "(A + B) *v v = A *v v + B *v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A + B) *v v = A *v v + B *v v
[PROOF STEP]
by (transfer_hma rule: add_mult_distrib_mat_vec)


[STATEMENT]
lemma euler_60_decimals:
  "\<bar>exp 1 - 2.718281828459045235360287471352662497757247093699959574966968\<bar>
      \<le> inverse (10^60::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp 1 - 2718281828459045235360287471352662497757247093699959574966968 / 10 ^ 60\<bar> \<le> inverse (10 ^ 60)
[PROOF STEP]
by (rule approx_coarsen, rule exp_1_approx[of 48])
     (simp_all add: eval_euler_approx eval_fact)


[STATEMENT]
lemma times_hyperdual_parts:
  fixes a b c d :: "'a :: ring_1"
  shows "(a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12) * (a' *\<^sub>H ba + b' *\<^sub>H e1 + c' *\<^sub>H e2 + d' *\<^sub>H e12) =
         (a * a') *\<^sub>H ba + (a * b' + b * a') *\<^sub>H e1 + (a * c' + c * a') *\<^sub>H e2 + (a * d' + b * c' + c * b' + d * a') *\<^sub>H e12"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12) * (a' *\<^sub>H ba + b' *\<^sub>H e1 + c' *\<^sub>H e2 + d' *\<^sub>H e12) = (a * a') *\<^sub>H ba + (a * b' + b * a') *\<^sub>H e1 + (a * c' + c * a') *\<^sub>H e2 + (a * d' + b * c' + c * b' + d * a') *\<^sub>H e12
[PROOF STEP]
by (simp add: hyperdual_bases)