[STATEMENT]
lemma sum_upto_inverse_bigo: "sum_upto (\<lambda>i. 1 / real i) \<in> O(\<lambda>x. ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
have "eventually (\<lambda>x. norm (sum_upto (\<lambda>i. 1 / real i) x) \<le> 1 * norm (ln x + 13/22)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. norm (sum_upto (\<lambda>i. 1 / real i) x) \<le> 1 * norm (ln x + 13 / 22)
[PROOF STEP]
using eventually_ge_at_top[of "1::real"] sum_upto_inverse_bound(2)
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) 1) at_top
\<forall>\<^sub>F x in at_top. sum_upto (\<lambda>i. 1 / real i) x \<le> ln x + 13 / 22

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. norm (sum_upto (\<lambda>i. 1 / real i) x) \<le> 1 * norm (ln x + 13 / 22)
[PROOF STEP]
by eventually_elim (insert sum_upto_inverse_bound(1), simp_all)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. norm (sum_upto (\<lambda>i. 1 / real i) x) \<le> 1 * norm (ln x + 13 / 22)

goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
hence "sum_upto (\<lambda>i. 1 / real i) \<in> O(\<lambda>x. ln x + 13/22)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm (sum_upto (\<lambda>i. 1 / real i) x) \<le> 1 * norm (ln x + 13 / 22)

goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(\<lambda>x. ln x + 13 / 22)
[PROOF STEP]
by (rule bigoI)
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>i. 1 / real i) \<in> O(\<lambda>x. ln x + 13 / 22)

goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>i. 1 / real i) \<in> O(\<lambda>x. ln x + 13 / 22)

goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
have "(\<lambda>x::real. ln x + 13/22) \<in> O(\<lambda>x. ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ln x + 13 / 22) \<in> O(ln)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln x + 13 / 22) \<in> O(ln)

goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)

goal (1 subgoal):
 1. sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>i. 1 / real i) \<in> O(ln)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma loop_apx_least_fixpoint_2:
  "apx.is_least_fixpoint (\<lambda>x . y * x \<squnion> z) (\<mu> (\<lambda>x . y * x \<squnion> z) \<squnion> (\<nu> (\<lambda>x . y * x \<squnion> z) \<sqinter> L))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. y * x \<squnion> z) (\<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. y * x \<squnion> z) (\<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L)
[PROOF STEP]
have "kappa_mu_nu (\<lambda>x . y * x \<squnion> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kappa_mu_nu (\<lambda>x. y * x \<squnion> z)
[PROOF STEP]
by (metis affine_apx_isotone affine_has_greatest_fixpoint affine_has_least_fixpoint affine_isotone loop_exists_2 nu_below_mu_nu_def nu_below_mu_nu_kappa_mu_nu)
[PROOF STATE]
proof (state)
this:
kappa_mu_nu (\<lambda>x. y * x \<squnion> z)

goal (1 subgoal):
 1. order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. y * x \<squnion> z) (\<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
kappa_mu_nu (\<lambda>x. y * x \<squnion> z)

goal (1 subgoal):
 1. order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. y * x \<squnion> z) (\<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L)
[PROOF STEP]
using apx.least_fixpoint_char kappa_mu_nu_def
[PROOF STATE]
proof (prove)
using this:
kappa_mu_nu (\<lambda>x. y * x \<squnion> z)
order.is_least_fixpoint (\<sqsubseteq>) ?f ?x = (order.has_least_fixpoint (\<sqsubseteq>) ?f \<and> ?x = \<kappa> ?f)
kappa_mu_nu ?f \<equiv> order.has_least_fixpoint (\<sqsubseteq>) ?f \<and> \<kappa> ?f = \<mu> ?f \<squnion> \<nu> ?f \<sqinter> L

goal (1 subgoal):
 1. order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. y * x \<squnion> z) (\<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. y * x \<squnion> z) (\<mu> (\<lambda>x. y * x \<squnion> z) \<squnion> \<nu> (\<lambda>x. y * x \<squnion> z) \<sqinter> L)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_free_nat:
  assumes "(m::nat) < n"
      and "n < c"
      and "c \<ge> 3"
  shows "\<exists>k::nat. k < m \<or> (m < k \<and> k < n) \<or> (n < k \<and> k < c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. k < m \<or> m < k \<and> k < n \<or> n < k \<and> k < c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m < n
n < c
3 \<le> c

goal (1 subgoal):
 1. \<exists>k. k < m \<or> m < k \<and> k < n \<or> n < k \<and> k < c
[PROOF STEP]
by presburger


[STATEMENT]
lemma SUP_add_le:
  assumes "X \<noteq> {}" "bounded (B ` X)" "bounded (A' ` X)"
  shows "(\<Squnion>c \<in> X. (B :: 'a \<Rightarrow> real) c + A' c) \<le> (\<Squnion>b \<in> X. B b) + (\<Squnion>a \<in> X. A' a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>c\<in>X. B c + A' c) \<le> \<Squnion> (B ` X) + \<Squnion> (A' ` X)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X \<noteq> {}
bounded (B ` X)
bounded (A' ` X)

goal (1 subgoal):
 1. (\<Squnion>c\<in>X. B c + A' c) \<le> \<Squnion> (B ` X) + \<Squnion> (A' ` X)
[PROOF STEP]
by (auto simp: add_mono bounded_has_Sup(1) intro!: cSUP_least)+


[STATEMENT]
lemma Lindelof_space_perfect_map_image_eq:
   "perfect_map X Y f \<Longrightarrow> Lindelof_space X \<longleftrightarrow> Lindelof_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perfect_map X Y f \<Longrightarrow> Lindelof_space X = Lindelof_space Y
[PROOF STEP]
using Lindelof_space_perfect_map_image Lindelof_space_proper_map_preimage perfect_map_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Lindelof_space ?X; perfect_map ?X ?Y ?f\<rbrakk> \<Longrightarrow> Lindelof_space ?Y
\<lbrakk>proper_map ?X ?Y ?f; Lindelof_space ?Y\<rbrakk> \<Longrightarrow> Lindelof_space ?X
perfect_map ?X ?Y ?f \<equiv> continuous_map ?X ?Y ?f \<and> proper_map ?X ?Y ?f \<and> ?f ` topspace ?X = topspace ?Y

goal (1 subgoal):
 1. perfect_map X Y f \<Longrightarrow> Lindelof_space X = Lindelof_space Y
[PROOF STEP]
by blast


[STATEMENT]
lemma (in ceuclidean_space) ceuclidean_representation_sum':
  "b = (\<Sum>i\<in>CBasis. f i *\<^sub>C i) \<longleftrightarrow> (\<forall>i\<in>CBasis. f i = cinner i b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b = (\<Sum>i\<in>CBasis. f i *\<^sub>C i)) = (\<forall>i\<in>CBasis. f i = i \<bullet>\<^sub>C b)
[PROOF STEP]
apply (auto simp add: ceuclidean_representation_sum[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>b = (\<Sum>i\<in>CBasis. f i *\<^sub>C i); i \<in> CBasis\<rbrakk> \<Longrightarrow> f i = i \<bullet>\<^sub>C (\<Sum>i\<in>CBasis. f i *\<^sub>C i)
 2. \<forall>i\<in>CBasis. f i = i \<bullet>\<^sub>C b \<Longrightarrow> b = (\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C b) *\<^sub>C i)
[PROOF STEP]
apply (metis ceuclidean_representation_sum cinner_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>CBasis. f i = i \<bullet>\<^sub>C b \<Longrightarrow> b = (\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C b) *\<^sub>C i)
[PROOF STEP]
by (metis local.ceuclidean_representation_sum local.cinner_commute)


[STATEMENT]
lemma left_associativity: "(x\<otimes>y)\<otimes>z = x\<otimes>y\<otimes>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes> y) \<otimes> z = x \<otimes> y \<otimes> z
[PROOF STEP]
by (induction x) (auto)


[STATEMENT]
lemma empty_interior_convex_hull:
  fixes S :: "'a::euclidean_space set"
  assumes "finite S" and dim: "card S \<le> DIM ('a)"
    shows "interior(convex hull S) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (convex hull S) = {}
[PROOF STEP]
by (metis Diff_empty Diff_eq_empty_iff convex_hull_subset_affine_hull
            interior_mono empty_interior_affine_hull [OF assms])


[STATEMENT]
lemma pprt_move_matrix: "pprt (move_matrix (A::('a::lattice_ring) matrix) j i) = move_matrix (pprt A) j i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pprt (move_matrix A j i) = move_matrix (pprt A) j i
[PROOF STEP]
apply (simp add: pprt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup (move_matrix A j i) 0 = move_matrix (sup A 0) j i
[PROOF STEP]
apply (simp add: sup_matrix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. combine_matrix sup (move_matrix A j i) 0 = move_matrix (combine_matrix sup A 0) j i
[PROOF STEP]
apply (simp add: Rep_matrix_inject[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (combine_matrix sup (move_matrix A j i) 0) = Rep_matrix (move_matrix (combine_matrix sup A 0) j i)
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. Rep_matrix (combine_matrix sup (move_matrix A j i) 0) x xa = Rep_matrix (move_matrix (combine_matrix sup A 0) j i) x xa
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma count_mset_set_if: "count (mset_set A) a = (if a \<in> A \<and> finite A then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (mset_set A) a = (if a \<in> A \<and> finite A then 1 else 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma r_s_mod_s:"\<lbrakk>0 < r; 0 < s\<rbrakk> \<Longrightarrow> (r * s - Suc 0) mod s = s - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s\<rbrakk> \<Longrightarrow> (r * s - Suc 0) mod s = s - Suc 0
[PROOF STEP]
apply (frule rfn_tool20 [of "s" "(r - Suc 0) * s + (s - Suc 0)" "r - Suc 0"
        "s - Suc 0"], simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; ((r - Suc 0) * s + (s - Suc 0)) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> (r * s - Suc 0) mod s = s - Suc 0
[PROOF STEP]
apply (simp add:diff_mult_distrib)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma match_list_concat: "match_list \<gamma> (concat lss) a p \<longleftrightarrow> (\<exists>ls \<in> set lss. match_list \<gamma> ls a p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. match_list \<gamma> (concat lss) a p = (\<exists>ls\<in>set lss. match_list \<gamma> ls a p)
[PROOF STEP]
apply(induction lss)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. match_list \<gamma> (concat []) a p = (\<exists>ls\<in>set []. match_list \<gamma> ls a p)
 2. \<And>aa lss. match_list \<gamma> (concat lss) a p = (\<exists>ls\<in>set lss. match_list \<gamma> ls a p) \<Longrightarrow> match_list \<gamma> (concat (aa # lss)) a p = (\<exists>ls\<in>set (aa # lss). match_list \<gamma> ls a p)
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa lss. match_list \<gamma> (concat lss) a p = (\<exists>ls\<in>set lss. match_list \<gamma> ls a p) \<Longrightarrow> match_list \<gamma> (concat (aa # lss)) a p = (\<exists>ls\<in>set (aa # lss). match_list \<gamma> ls a p)
[PROOF STEP]
by(auto simp add: match_list_append)


[STATEMENT]
lemma ac_of_fraction:
  assumes "N > 0"
  assumes "a \<in> nonzero Q\<^sub>p"
  assumes "b \<in> nonzero Q\<^sub>p"
  shows "ac N (a \<div> b) = ac N a \<otimes>\<^bsub>Zp_res_ring N\<^esub> inv \<^bsub>Zp_res_ring N\<^esub> ac N b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac N (a \<div> b) = ac N a \<otimes>\<^bsub>residue_ring (p ^ N)\<^esub> inv\<^bsub>residue_ring (p ^ N)\<^esub> ac N b
[PROOF STEP]
using ac_mult[of a "inv b" N] ac_inv assms Qp.nonzero_closed nonzero_inverse_Qp
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<in> carrier Q\<^sub>p; inv b \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ac N (a \<div> b) = ac N a \<otimes>\<^bsub>residue_ring (p ^ N)\<^esub> ac N (inv b)
\<lbrakk>?x \<in> nonzero Q\<^sub>p; 0 < ?n\<rbrakk> \<Longrightarrow> ac ?n (inv ?x) = inv\<^bsub>residue_ring (p ^ ?n)\<^esub> ac ?n ?x
0 < N
a \<in> nonzero Q\<^sub>p
b \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
?u \<in> nonzero Q\<^sub>p \<Longrightarrow> inv ?u \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. ac N (a \<div> b) = ac N a \<otimes>\<^bsub>residue_ring (p ^ N)\<^esub> inv\<^bsub>residue_ring (p ^ N)\<^esub> ac N b
[PROOF STEP]
by presburger


[STATEMENT]
lemma sigma_sets_UNION:
  "countable B \<Longrightarrow> (\<And>b. b \<in> B \<Longrightarrow> b \<in> sigma_sets X A) \<Longrightarrow> \<Union> B \<in> sigma_sets X A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable B; \<And>b. b \<in> B \<Longrightarrow> b \<in> sigma_sets X A\<rbrakk> \<Longrightarrow> \<Union> B \<in> sigma_sets X A
[PROOF STEP]
using from_nat_into [of B] range_from_nat_into [of B] sigma_sets.Union [of "from_nat_into B" X A]
[PROOF STATE]
proof (prove)
using this:
B \<noteq> {} \<Longrightarrow> from_nat_into B ?n \<in> B
\<lbrakk>B \<noteq> {}; countable B\<rbrakk> \<Longrightarrow> range (from_nat_into B) = B
(\<And>i. from_nat_into B i \<in> sigma_sets X A) \<Longrightarrow> \<Union> (range (from_nat_into B)) \<in> sigma_sets X A

goal (1 subgoal):
 1. \<lbrakk>countable B; \<And>b. b \<in> B \<Longrightarrow> b \<in> sigma_sets X A\<rbrakk> \<Longrightarrow> \<Union> B \<in> sigma_sets X A
[PROOF STEP]
by (cases "B = {}") (simp_all add: sigma_sets.Empty cong del: SUP_cong)


[STATEMENT]
lemma map_key_PP_sum: "Poly_Mapping.map_key PP (sum f A) = (\<Sum>a\<in>A. Poly_Mapping.map_key PP (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly_Mapping.map_key PP (sum f A) = (\<Sum>a\<in>A. Poly_Mapping.map_key PP (f a))
[PROOF STEP]
by (induct A rule: infinite_finite_induct) (simp_all add: map_key_PP_plus)


[STATEMENT]
lemma x_in_u_eq: "(x \<in> nat_to_set u) = (c_in x u = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> nat_to_set u) = (c_in x u = 1)
[PROOF STEP]
by (auto simp add: nat_to_set_def c_in_upper_bound)


[STATEMENT]
lemma mod_ident_iff: "m > 0 \<Longrightarrow> (x :: int) mod m = x \<longleftrightarrow> x \<in> {0 ..< m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> (x mod m = x) = (x \<in> {0..<m})
[PROOF STEP]
by (metis Divides.pos_mod_bound Divides.pos_mod_sign atLeastLessThan_iff mod_pos_pos_trivial)


[STATEMENT]
lemma poly_subst_uminus: "poly_subst f (-p) = - poly_subst f (p::('x \<Rightarrow>\<^sub>0 nat) \<Rightarrow>\<^sub>0 'b::comm_ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_subst f (- p) = - poly_subst f p
[PROOF STEP]
by (simp add: poly_subst_def keys_uminus punit.monom_mult_uminus_left sum_negf)


[STATEMENT]
lemma bin_rest_gt_0 [simp]: "(\<lambda>k::int. k div 2) x > 0 \<longleftrightarrow> x > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < x div 2) = (1 < x)
[PROOF STEP]
by auto


[STATEMENT]
lemma [smt_arith_multiplication]:
  fixes A B :: real and p n :: real
  assumes "A < B" "0 < n" "p > 0"
  shows "(A / n) * p < (B / n) * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A / n * p < B / n * p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A < B
0 < n
0 < p

goal (1 subgoal):
 1. A / n * p < B / n * p
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma vimage2p_map_list_all2:
  "vimage2p (map f) (map g) (list_all2 A) = list_all2 (vimage2p f g A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vimage2p (map f) (map g) (list_all2 A) = list_all2 (vimage2p f g A)
[PROOF STEP]
by(simp add: vimage2p_def list.rel_map)


[STATEMENT]
theorem contra_triv: "\<not>A \<Longrightarrow> A \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> A; A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by simp


[STATEMENT]
lemma sigma_algebra_Pow: "sigma_algebra sp (Pow sp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra sp (Pow sp)
[PROOF STEP]
by (auto simp: sigma_algebra_iff algebra_iff_Int)


[STATEMENT]
lemma UINF_cong_eq:
  "\<lbrakk> \<And> x. P\<^sub>1(x) = P\<^sub>2(x); \<And> x. `P\<^sub>1(x) \<Rightarrow> Q\<^sub>1(x) =\<^sub>u Q\<^sub>2(x)` \<rbrakk> \<Longrightarrow>
        (\<Sqinter> x | P\<^sub>1(x) \<bullet> Q\<^sub>1(x)) = (\<Sqinter> x | P\<^sub>2(x) \<bullet> Q\<^sub>2(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. P\<^sub>1 x = P\<^sub>2 x; \<And>x. `P\<^sub>1 x \<Rightarrow> Q\<^sub>1 x =\<^sub>u Q\<^sub>2 x`\<rbrakk> \<Longrightarrow> UINF P\<^sub>1 Q\<^sub>1 = UINF P\<^sub>2 Q\<^sub>2
[PROOF STEP]
by (unfold UINF_def, pred_simp, metis)


[STATEMENT]
theorem thmD13:
  assumes start: "items_le k (\<J> k 0) = Gen (paths_le k (\<P> k 0))"
  assumes valid_k: "k \<le> length Doc"
  shows "items_le k (\<J> k u) = Gen (paths_le k (\<P> k u)) \<and> \<T> k u = \<Z> k u
    \<and> items_le k (\<I> k) = Gen (paths_le k (\<Q> k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. items_le k (\<J> k u) = Gen (paths_le k (\<P> k u)) \<and> \<T> k u = \<Z> k u \<and> items_le k (\<I> k) = Gen (paths_le k (\<Q> k))
[PROOF STEP]
using thmD13_part1[OF start valid_k] thmD13_part2[OF start valid_k]
[PROOF STATE]
proof (prove)
using this:
items_le k (\<J> k ?u) = Gen (paths_le k (\<P> k ?u)) \<and> \<T> k ?u = \<Z> k ?u
items_le k (\<I> k) = Gen (paths_le k (\<Q> k))

goal (1 subgoal):
 1. items_le k (\<J> k u) = Gen (paths_le k (\<P> k u)) \<and> \<T> k u = \<Z> k u \<and> items_le k (\<I> k) = Gen (paths_le k (\<Q> k))
[PROOF STEP]
by blast


[STATEMENT]
theorem (in flowgraph) ntr_interleave: "valid fg (ca+cb) \<Longrightarrow>
  (ca+cb,w,c')\<in>trcl (ntr fg) \<longleftrightarrow>
  (\<exists>ca' cb' wa wb.
    c'=ca'+cb' \<and>
    w\<in>(wa\<otimes>\<^bsub>\<alpha>n fg\<^esub>wb) \<and>
    mon_c fg ca \<inter> (mon_c fg cb \<union> mon_ww fg wb) = {} \<and>
    mon_c fg cb \<inter> (mon_c fg ca \<union> mon_ww fg wa) = {} \<and>
    (ca,wa,ca')\<in>trcl (ntr fg) \<and> (cb,wb,cb')\<in>trcl (ntr fg))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid fg (ca + cb) \<Longrightarrow> ((ca + cb, w, c') \<in> trcl (ntr fg)) = (\<exists>ca' cb' wa wb. c' = ca' + cb' \<and> w \<in> wa \<otimes>\<^bsub>\<alpha>n fg\<^esub> wb \<and> mon_c fg ca \<inter> (mon_c fg cb \<union> mon_ww fg wb) = {} \<and> mon_c fg cb \<inter> (mon_c fg ca \<union> mon_ww fg wa) = {} \<and> (ca, wa, ca') \<in> trcl (ntr fg) \<and> (cb, wb, cb') \<in> trcl (ntr fg))
[PROOF STEP]
by (blast intro!: ntr_split ntr_unsplit)

\<comment> \<open>Here is the corresponding version for executions with an explicit local thread\<close>


[STATEMENT]
lemma prime_factorization_nat:
    "n > (0::nat) \<Longrightarrow> n = (\<Prod>p \<in> prime_factors n. p ^ multiplicity p n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n = (\<Prod>p\<in>prime_factors n. p ^ multiplicity p n)
[PROOF STEP]
by (simp add: prod_prime_factors)


[STATEMENT]
lemma Bernstein_Poly_rescale_01:
  assumes "c \<noteq> d"
  shows "Bernstein_Poly j p c d \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d-c:]
          = Bernstein_Poly_01 j p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_Poly j p c d \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d - c:] = Bernstein_Poly_01 j p
[PROOF STEP]
apply (subst Bernstein_Poly_rescale)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c \<noteq> d
 2. Bernstein_Poly j p ((c - c) / (d - c)) ((d - c) / (d - c)) = Bernstein_Poly_01 j p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> d

goal (2 subgoals):
 1. c \<noteq> d
 2. Bernstein_Poly j p ((c - c) / (d - c)) ((d - c) / (d - c)) = Bernstein_Poly_01 j p
[PROOF STEP]
by (auto simp: Bernstein_Poly_01)


[STATEMENT]
lemma harm_Suc: "harm (Suc n) = harm n + inverse (of_nat (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. harm (Suc n) = harm n + inverse (of_nat (Suc n))
[PROOF STEP]
by (simp add: harm_def)


[STATEMENT]
lemma is_lub_some_lub:
  "\<lbrakk> single_valued r; acyclic r; (x,u)\<in>r^*; (y,u)\<in>r^* \<rbrakk>
  \<Longrightarrow> is_lub (r^* ) x y (some_lub (r^* ) x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued r; acyclic r; (x, u) \<in> r\<^sup>*; (y, u) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> is_lub (r\<^sup>*) x y (some_lub (r\<^sup>*) x y)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued r; acyclic r; (x, u) \<in> r\<^sup>*; (y, u) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> is_lub (r\<^sup>*) x y (some_lub (r\<^sup>*) x y)
[PROOF STEP]
by (fastforce dest: single_valued_has_lubs simp add: some_lub_conv)


[STATEMENT]
lemma mat_delete_dim[simp]:
  "dim_row (mat_delete A i j) = dim_row A - 1"
  "dim_col (mat_delete A i j) = dim_col A - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_delete A i j) = dim_row A - 1 &&& dim_col (mat_delete A i j) = dim_col A - 1
[PROOF STEP]
unfolding mat_delete_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (dim_row A - 1) (dim_col A - 1) (\<lambda>(i', j'). A $$ (if i' < i then i' else Suc i', if j' < j then j' else Suc j'))) = dim_row A - 1 &&& dim_col (mat (dim_row A - 1) (dim_col A - 1) (\<lambda>(i', j'). A $$ (if i' < i then i' else Suc i', if j' < j then j' else Suc j'))) = dim_col A - 1
[PROOF STEP]
by auto


[STATEMENT]
lemma lebesgue_measurable_vimage_borel:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "f \<in> borel_measurable lebesgue" "T \<in> sets borel"
  shows "{x. f x \<in> T} \<in> sets lebesgue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. f x \<in> T} \<in> sets lebesgue
[PROOF STEP]
using assms borel_measurable_vimage_borel [of f UNIV]
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable lebesgue
T \<in> sets borel
(f \<in> borel_measurable (lebesgue_on UNIV)) = (\<forall>T. T \<in> sets borel \<longrightarrow> {x \<in> UNIV. f x \<in> T} \<in> sets (lebesgue_on UNIV))

goal (1 subgoal):
 1. {x. f x \<in> T} \<in> sets lebesgue
[PROOF STEP]
by auto


[STATEMENT]
lemma quasinorm_subset_space:
  assumes "N1 \<subseteq>\<^sub>N N2"
  shows "space\<^sub>N N1 \<subseteq> space\<^sub>N N2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space\<^sub>N N1 \<subseteq> space\<^sub>N N2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N1 \<subseteq>\<^sub>N N2

goal (1 subgoal):
 1. space\<^sub>N N1 \<subseteq> space\<^sub>N N2
[PROOF STEP]
unfolding space\<^sub>N_def less_eq_quasinorm_def
[PROOF STATE]
proof (prove)
using this:
\<exists>C\<ge>0. \<forall>f. eNorm N2 f \<le> ennreal C * eNorm N1 f

goal (1 subgoal):
 1. {f. eNorm N1 f < \<infinity>} \<subseteq> {f. eNorm N2 f < \<infinity>}
[PROOF STEP]
by (auto, metis ennreal_mult_eq_top_iff ennreal_neq_top less_le top.extremum_strict top.not_eq_extremum)


[STATEMENT]
lemma set_fold_union: "set (fold List.union xss ys) = (\<Union> (set ` set xss)) \<union> set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fold List.union xss ys) = \<Union> (set ` set xss) \<union> set ys
[PROOF STEP]
by (induct xss arbitrary: ys) auto


[STATEMENT]
lemma similar_mat_wit_dim_row:
  assumes "similar_mat_wit A B Q R"
  shows "dim_row B = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B = dim_row A
[PROOF STEP]
using assms Let_def
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B Q R
Let ?s ?f \<equiv> ?f ?s

goal (1 subgoal):
 1. dim_row B = dim_row A
[PROOF STEP]
unfolding  similar_mat_wit_def
[PROOF STATE]
proof (prove)
using this:
let n = dim_row A in {A, B, Q, R} \<subseteq> carrier_mat n n \<and> Q * R = 1\<^sub>m n \<and> R * Q = 1\<^sub>m n \<and> A = Q * B * R
Let ?s ?f \<equiv> ?f ?s

goal (1 subgoal):
 1. dim_row B = dim_row A
[PROOF STEP]
by (meson carrier_matD(1) insert_subset)


[STATEMENT]
lemma one_less_Fract_iff: "0 < b \<Longrightarrow> 1 < Fract a b \<longleftrightarrow> b < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (1 < Fract a b) = (b < a)
[PROOF STEP]
by (simp add: One_rat_def mult_less_cancel_right_disj)


[STATEMENT]
lemma computation_swingpos:
" rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B))
     (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B)
       (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) =
    rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have 1:"(A - rat_poly_times (rat_poly_times B B) B)
               = A - (B^3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - rat_poly_times (rat_poly_times B B) B = A - B ^ 3
[PROOF STEP]
by (metis power3_eq_cube)
[PROOF STATE]
proof (state)
this:
A - rat_poly_times (rat_poly_times B B) B = A - B ^ 3

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A - rat_poly_times (rat_poly_times B B) B = A - B ^ 3
[PROOF STEP]
have 2:"(rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)
                 = A*B - (B^3)*B"
[PROOF STATE]
proof (prove)
using this:
A - rat_poly_times (rat_poly_times B B) B = A - B ^ 3

goal (1 subgoal):
 1. rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B = rat_poly_times A B - rat_poly_times (B ^ 3) B
[PROOF STEP]
by (metis minus_right_distributivity)
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B = rat_poly_times A B - rat_poly_times (B ^ 3) B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B = rat_poly_times A B - rat_poly_times (B ^ 3) B
[PROOF STEP]
have "... = 1 - (B^4)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B = rat_poly_times A B - rat_poly_times (B ^ 3) B

goal (1 subgoal):
 1. rat_poly_times A B - rat_poly_times (B ^ 3) B = 1 - B ^ 4
[PROOF STEP]
by (simp add: inverse1 numeral_Bit0 power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times A B - rat_poly_times (B ^ 3) B = 1 - B ^ 4

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A B - rat_poly_times (B ^ 3) B = 1 - B ^ 4
[PROOF STEP]
have "(rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B))
                      = B - (B^4)*B"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A B - rat_poly_times (B ^ 3) B = 1 - B ^ 4

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - rat_poly_times (B ^ 4) B
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A B - rat_poly_times (B ^ 3) B = 1 - B ^ 4
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B = rat_poly_times A B - rat_poly_times (B ^ 3) B

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - rat_poly_times (B ^ 4) B
[PROOF STEP]
by (metis minus_right_distributivity mult.commute mult.right_neutral)
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - rat_poly_times (B ^ 4) B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - rat_poly_times (B ^ 4) B
[PROOF STEP]
have 3:"(rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B))
                  = B - (B^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - rat_poly_times (B ^ 4) B

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - B ^ 5
[PROOF STEP]
by (metis (no_types, lifting) inverse1 minus_right_distributivity
             mult.left_commute mult.right_neutral power2_eq_square power_numeral_odd)
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - B ^ 5

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "(rat_poly_times (A - rat_poly_times (rat_poly_times B B) B)
       (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)))
                 =  (A - (B^3))*(A*( A - (B^3)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
A - rat_poly_times (rat_poly_times B B) B = A - B ^ 3

goal (1 subgoal):
 1. rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))
[PROOF STEP]
have "... =  (A - (B^3))*(A*A - (A*(B^3)))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))
[PROOF STEP]
by (metis minus_left_distributivity)
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))
[PROOF STEP]
have "... = (A - (B^3))*(A*A - (B^2))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)
[PROOF STEP]
using inverse1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))
rat_poly_times A B = 1

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)
[PROOF STEP]
by (simp add: power2_eq_square power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)
[PROOF STEP]
have "... = A*(A*A - (B^2)) - (B^3)*(A*A - (B^2))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2)
[PROOF STEP]
by (metis minus_right_distributivity)
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2)
[PROOF STEP]
have "... = ((A^3) - B) - B + (B^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have "A*(A*A - (B^2)) = (A*A*A - A*(B^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (A * A - B\<^sup>2) = A * A * A - A * B\<^sup>2
[PROOF STEP]
by (simp add: right_diff_distrib)
[PROOF STATE]
proof (state)
this:
A * (A * A - B\<^sup>2) = A * A * A - A * B\<^sup>2

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A * (A * A - B\<^sup>2) = A * A * A - A * B\<^sup>2

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have "... = (A*A*A - A*(B*B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * A * A - A * B\<^sup>2 = A * A * A - A * (B * B)
[PROOF STEP]
by (metis power2_eq_square)
[PROOF STATE]
proof (state)
this:
A * A * A - A * B\<^sup>2 = A * A * A - A * (B * B)

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A * A * A - A * B\<^sup>2 = A * A * A - A * (B * B)

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have "...  = ((A^3) - ((A::rat_poly)*B)*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B
[PROOF STEP]
by (simp add: power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have "... = ((A^3) - ((1::rat_poly)*B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - rat_poly_times 1 B
[PROOF STEP]
by (metis inverse1)
[PROOF STATE]
proof (state)
this:
A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - rat_poly_times 1 B

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - rat_poly_times 1 B

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have "... = (A^3) - B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^ 3 - rat_poly_times 1 B = A ^ 3 - B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A ^ 3 - rat_poly_times 1 B = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A * (A * A - B\<^sup>2) = A * A * A - A * B\<^sup>2
A * A * A - A * B\<^sup>2 = A * A * A - A * (B * B)
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B
A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - rat_poly_times 1 B
A ^ 3 - rat_poly_times 1 B = A ^ 3 - B
[PROOF STEP]
have s1:"(A::rat_poly)*(A*A - (B^2)) = (A^3) - (B::rat_poly)"
[PROOF STATE]
proof (prove)
using this:
A * (A * A - B\<^sup>2) = A * A * A - A * B\<^sup>2
A * A * A - A * B\<^sup>2 = A * A * A - A * (B * B)
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B
A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - rat_poly_times 1 B
A ^ 3 - rat_poly_times 1 B = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have s2:"((B::rat_poly)^3)*(A*A - (B^2)) = (B^3)*(A*A) - (B^(3::nat))*(B^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)
[PROOF STEP]
by (metis minus_left_distributivity power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)
[PROOF STEP]
have "... = (((B::rat_poly)^3)*(A*A) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
using power_add
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)
?a ^ (?m + ?n) = ?a ^ ?m * ?a ^ ?n

goal (1 subgoal):
 1. rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2); \<And>a m n. a ^ (m + n) = a ^ m * a ^ n\<rbrakk> \<Longrightarrow> rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
have "(B^(3::nat))*(B^2) =  (B^5)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B ^ 3 * B\<^sup>2 = B ^ 5
[PROOF STEP]
by (metis One_nat_def Suc_1 numeral_3_eq_3 power_Suc power_numeral_odd)
[PROOF STATE]
proof (state)
this:
B ^ 3 * B\<^sup>2 = B ^ 5

goal (1 subgoal):
 1. \<lbrakk>rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2); \<And>a m n. a ^ (m + n) = a ^ m * a ^ n\<rbrakk> \<Longrightarrow> rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B ^ 3 * B\<^sup>2 = B ^ 5
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
B ^ 3 * B\<^sup>2 = B ^ 5

goal (1 subgoal):
 1. rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
using s2
[PROOF STATE]
proof (prove)
using this:
B ^ 3 * B\<^sup>2 = B ^ 5
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
have "... =  ((((B::rat_poly)*B*B)*(A*A)) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
by (metis power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5
[PROOF STEP]
have "... = ((((B::rat_poly)*(B*(B*A)*A))) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5
[PROOF STEP]
have "... = ((((B::rat_poly)*(B*(1)*A))) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5
[PROOF STEP]
using inverse2
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5
rat_poly_times B A = 1

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5
[PROOF STEP]
have "... =  ((((B::rat_poly)*(B*A))) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5
[PROOF STEP]
have "... = ((((B::rat_poly))) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B A) - B ^ 5 = B - B ^ 5
[PROOF STEP]
using inverse2
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5
rat_poly_times B A = 1

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B A) - B ^ 5 = B - B ^ 5
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B A) - B ^ 5 = B - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)
rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5
rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5
rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5
rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5
rat_poly_times B (rat_poly_times B A) - B ^ 5 = B - B ^ 5
[PROOF STEP]
have "((B::rat_poly)^3)*(A*A - (B^2)) = ((B::rat_poly) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2)
rat_poly_times (B ^ 3) (rat_poly_times A A) - rat_poly_times (B ^ 3) (B\<^sup>2) = rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5
rat_poly_times (B ^ 3) (rat_poly_times A A) - B ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5
rat_poly_times (rat_poly_times (rat_poly_times B B) B) (rat_poly_times A A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5
rat_poly_times B (rat_poly_times (rat_poly_times B (rat_poly_times B A)) A) - B ^ 5 = rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5
rat_poly_times B (rat_poly_times (rat_poly_times B 1) A) - B ^ 5 = rat_poly_times B (rat_poly_times B A) - B ^ 5
rat_poly_times B (rat_poly_times B A) - B ^ 5 = B - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = B - B ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = B - B ^ 5

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = B - B ^ 5
[PROOF STEP]
have "A*(A*A - (B^2)) - (B^3)*(A*A - (B^2))
                       = (A^3) - (B::rat_poly) - ((B::rat_poly) - (B^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = B - B ^ 5

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B - (B - B ^ 5)
[PROOF STEP]
using s1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = B - B ^ 5
rat_poly_times A (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B - (B - B ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B - (B - B ^ 5)

goal (1 subgoal):
 1. rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) \<Longrightarrow> rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B - (B - B ^ 5)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = A ^ 3 - B - (B - B ^ 5)

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))
rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))
rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)
rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2)
rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have "(rat_poly_times (A - rat_poly_times (rat_poly_times B B) B)
       (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)))
             = ((A^3) - B) - B + (B^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3))
rat_poly_times (A - B ^ 3) (rat_poly_times A (A - B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3))
rat_poly_times (A - B ^ 3) (rat_poly_times A A - rat_poly_times A (B ^ 3)) = rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2)
rat_poly_times (A - B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2)
rat_poly_times A (rat_poly_times A A - B\<^sup>2) - rat_poly_times (B ^ 3) (rat_poly_times A A - B\<^sup>2) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)

goal (1 subgoal):
 1. rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
[PROOF STEP]
have "?l =  B - (B^5) +  ((A^3) - B) - B + (B^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_plus (rat_poly_plus (B - B ^ 5) (A ^ 3 - B) - B) (B ^ 5)
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B)) = rat_poly_plus (A ^ 3 - B - B) (B ^ 5)
rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B) = B - B ^ 5

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_plus (rat_poly_plus (B - B ^ 5) (A ^ 3 - B) - B) (B ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_plus (rat_poly_plus (B - B ^ 5) (A ^ 3 - B) - B) (B ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_plus (rat_poly_plus (B - B ^ 5) (A ^ 3 - B) - B) (B ^ 5)
[PROOF STEP]
have 4:"?l = (A^3) - B"
[PROOF STATE]
proof (prove)
using this:
rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_plus (rat_poly_plus (B - B ^ 5) (A ^ 3 - B) - B) (B ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = A ^ 3 - B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "?r =  A*((A - rat_poly_times (rat_poly_times B B) B)*A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A*(A - (B^3))*A"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times (rat_poly_times A (A - B ^ 3)) A
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
A - rat_poly_times (rat_poly_times B B) B = A - B ^ 3

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times (rat_poly_times A (A - B ^ 3)) A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times (rat_poly_times A (A - B ^ 3)) A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times (rat_poly_times A (A - B ^ 3)) A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A*(A*A - (B^3)*A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times A (A - B ^ 3)) A = rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A)
[PROOF STEP]
by (simp add: minus_left_distributivity mult.commute)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A (A - B ^ 3)) A = rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A (A - B ^ 3)) A = rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A*(A*A - (B*B*B)*A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
by (metis power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A*(A*A - (B*B*(B*A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A*(A*A - B*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A)) = rat_poly_times A (rat_poly_times A A - rat_poly_times B B)
[PROOF STEP]
using inverse2 minus_left_distributivity
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B A = 1
rat_poly_times ?p (?q - ?r) = rat_poly_times ?p ?q - rat_poly_times ?p ?r

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

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A)) = rat_poly_times A (rat_poly_times A A - rat_poly_times B B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A*A*A - A*(B*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A A - rat_poly_times B B) = rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B)
[PROOF STEP]
by (metis minus_left_distributivity rat_poly.comm)
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - rat_poly_times B B) = rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A A - rat_poly_times B B) = rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A^3 - (A*B)*B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B
[PROOF STEP]
by (metis ab_semigroup_mult_class.mult_ac(1) power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
have "... = A^3 - B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - B
[PROOF STEP]
using inverse1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A B = 1

goal (1 subgoal):
 1. A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - B
[PROOF STEP]
by (metis monoid_mult_class.mult.left_neutral)
[PROOF STATE]
proof (state)
this:
A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times (rat_poly_times A (A - B ^ 3)) A
rat_poly_times (rat_poly_times A (A - B ^ 3)) A = rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A)
rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A)
rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A))
rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A)) = rat_poly_times A (rat_poly_times A A - rat_poly_times B B)
rat_poly_times A (rat_poly_times A A - rat_poly_times B B) = rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B)
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B
A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - B
[PROOF STEP]
have "?r =  A^3 - B"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times (rat_poly_times A (A - B ^ 3)) A
rat_poly_times (rat_poly_times A (A - B ^ 3)) A = rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A)
rat_poly_times A (rat_poly_times A A - rat_poly_times (B ^ 3) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A)
rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times (rat_poly_times B B) B) A) = rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A))
rat_poly_times A (rat_poly_times A A - rat_poly_times (rat_poly_times B B) (rat_poly_times B A)) = rat_poly_times A (rat_poly_times A A - rat_poly_times B B)
rat_poly_times A (rat_poly_times A A - rat_poly_times B B) = rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B)
rat_poly_times (rat_poly_times A A) A - rat_poly_times A (rat_poly_times B B) = A ^ 3 - rat_poly_times (rat_poly_times A B) B
A ^ 3 - rat_poly_times (rat_poly_times A B) B = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = A ^ 3 - B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = A ^ 3 - B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A) = A ^ 3 - B
rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = A ^ 3 - B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_plus (rat_poly_times B (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) B)) (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) (rat_poly_times A (A - rat_poly_times (rat_poly_times B B) B))) = rat_poly_times A (rat_poly_times (A - rat_poly_times (rat_poly_times B B) B) A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_dioph_div_mult:
  "eval_dioph ks (map (\<lambda>x. x div n) xs) * int n +
   eval_dioph ks (map (\<lambda>x. x mod n) xs) = eval_dioph ks xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_dioph ks (map (\<lambda>x. x div n) xs) * int n + eval_dioph ks (map (\<lambda>x. x mod n) xs) = eval_dioph ks xs
[PROOF STEP]
by (simp add: eval_dioph_mult o_def eval_dioph_add_map)


[STATEMENT]
lemma left_unique_vec_rel: "left_unique R \<Longrightarrow> left_unique (vec_rel R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_unique R \<Longrightarrow> left_unique (vec_rel R)
[PROOF STEP]
unfolding left_unique_def vec_rel_def vec_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. R x z \<longrightarrow> R y z \<longrightarrow> x = y \<Longrightarrow> \<forall>x y z. dim_vec x = dim_vec z \<and> (\<forall>i<dim_vec z. R (x $ i) (z $ i)) \<longrightarrow> dim_vec y = dim_vec z \<and> (\<forall>i<dim_vec z. R (y $ i) (z $ i)) \<longrightarrow> dim_vec x = dim_vec y \<and> (\<forall>i<dim_vec y. x $ i = y $ i)
[PROOF STEP]
by auto


[STATEMENT]
lemma sumhr_interval_const:
  "(\<forall>n. m \<le> Suc n \<longrightarrow> f n = r) \<and> m \<le> na \<Longrightarrow>
    sumhr (hypnat_of_nat m, hypnat_of_nat na, f) = hypreal_of_nat (na - m) * hypreal_of_real r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. m \<le> Suc n \<longrightarrow> f n = r) \<and> m \<le> na \<Longrightarrow> sumhr (hypnat_of_nat m, hypnat_of_nat na, f) = hypreal_of_nat (na - m) * hypreal_of_real r
[PROOF STEP]
unfolding sumhr_app
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. m \<le> Suc n \<longrightarrow> f n = r) \<and> m \<le> na \<Longrightarrow> (*f2* (\<lambda>m n. sum f {m..<n})) (hypnat_of_nat m) (hypnat_of_nat na) = hypreal_of_nat (na - m) * hypreal_of_real r
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma numer_cf7_pos: "-9.943 \<le> x \<Longrightarrow> numer_cf7 x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (9943 / 10 ^ 3) \<le> x \<Longrightarrow> 0 < numer_cf7 x
[PROOF STEP]
unfolding numer_cf7_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (9943 / 10 ^ 3) \<le> x \<Longrightarrow> 0 < x ^ 7 + 56 * x ^ 6 + 1512 * x ^ 5 + 25200 * x ^ 4 + 277200 * x ^ 3 + 1995840 * x\<^sup>2 + 8648640 * x + 17297280
[PROOF STEP]
by sturm


[STATEMENT]
lemma inter_union_distrib_left:
  "A \<inter># B + C = (A + C) \<inter># (B + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter># B + C = (A + C) \<inter># (B + C)
[PROOF STEP]
by (simp add: multiset_eq_iff min_add_distrib_left)


[STATEMENT]
lemma nonpos_Reals_mult_of_nat_iff:
  fixes a:: "'a :: real_div_algebra" shows "a * of_nat n \<in> \<real>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> a \<in> \<real>\<^sub>\<le>\<^sub>0 \<or> n=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * of_nat n \<in> \<real>\<^sub>\<le>\<^sub>0) = (a \<in> \<real>\<^sub>\<le>\<^sub>0 \<or> n = 0)
[PROOF STEP]
apply (auto intro: nonpos_Reals_mult_I2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a * of_nat n \<in> \<real>\<^sub>\<le>\<^sub>0; 0 < n\<rbrakk> \<Longrightarrow> a \<in> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
apply (auto simp: nonpos_Reals_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < n; a * of_nat n = of_real r; r \<le> 0\<rbrakk> \<Longrightarrow> \<exists>r. a = of_real r \<and> r \<le> 0
[PROOF STEP]
apply (rule_tac x="r/n" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < n; a * of_nat n = of_real r; r \<le> 0\<rbrakk> \<Longrightarrow> a = of_real (r / real n) \<and> r / real n \<le> 0
[PROOF STEP]
apply (auto simp: field_split_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cinner_Pair [simp]: "cinner (a, b) (c, d) = cinner a c + cinner b d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, b) \<bullet>\<^sub>C (c, d) = a \<bullet>\<^sub>C c + b \<bullet>\<^sub>C d
[PROOF STEP]
unfolding cinner_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (a, b) \<bullet>\<^sub>C fst (c, d) + snd (a, b) \<bullet>\<^sub>C snd (c, d) = a \<bullet>\<^sub>C c + b \<bullet>\<^sub>C d
[PROOF STEP]
by simp


[STATEMENT]
lemma prime_factors_gt_0_int:
  "p \<in> prime_factors x \<Longrightarrow> p > (0::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in># prime_factorization x \<Longrightarrow> 0 < p
[PROOF STEP]
by (simp add: in_prime_factors_imp_prime prime_gt_0_int)


[STATEMENT]
lemma Max_wrt_total_preorder:
  "Max_wrt le = {x\<in>carrier. \<forall>y\<in>carrier. le y x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max_wrt le = {x \<in> carrier. \<forall>y\<in>carrier. le y x}
[PROOF STEP]
unfolding Max_wrt_preorder
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier. \<forall>y\<in>carrier. le x y \<longrightarrow> le y x} = {x \<in> carrier. \<forall>y\<in>carrier. le y x}
[PROOF STEP]
using total
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier; ?y \<in> carrier\<rbrakk> \<Longrightarrow> le ?x ?y \<or> le ?y ?x

goal (1 subgoal):
 1. {x \<in> carrier. \<forall>y\<in>carrier. le x y \<longrightarrow> le y x} = {x \<in> carrier. \<forall>y\<in>carrier. le y x}
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_of_real_iff:
  "((\<lambda>x. of_real (f x) :: 'a::real_normed_div_algebra) \<longlongrightarrow> of_real c) F \<longleftrightarrow> (f \<longlongrightarrow> c) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. of_real (f x)) \<longlongrightarrow> of_real c) F = (f \<longlongrightarrow> c) F
[PROOF STEP]
unfolding tendsto_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>e>0. \<forall>\<^sub>F x in F. dist (of_real (f x)) (of_real c) < e) = (\<forall>e>0. \<forall>\<^sub>F x in F. dist (f x) c < e)
[PROOF STEP]
by simp


[STATEMENT]
lemma transpose_board2: "transpose_board (transpose_board b) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_board (transpose_board b) = b
[PROOF STEP]
unfolding transpose_board_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(j, i) |i j. (i, j) \<in> {(j, i) |i j. (i, j) \<in> b}} = b
[PROOF STEP]
by auto


[STATEMENT]
lemma (in prob_space) prob_Collect_eq_0:
  "{x \<in> space M. P x} \<in> sets M \<Longrightarrow> \<P>(x in M. P x) = 0 \<longleftrightarrow> (AE x in M. \<not> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> events \<Longrightarrow> (prob {x \<in> space M. P x} = 0) = (AE x in M. \<not> P x)
[PROOF STEP]
using AE_iff_measurable[OF _ refl, of M "\<lambda>x. \<not> P x"]
[PROOF STATE]
proof (prove)
using this:
{x \<in> space M. \<not> \<not> P x} \<in> events \<Longrightarrow> (AE x in M. \<not> P x) = (emeasure M {x \<in> space M. \<not> \<not> P x} = 0)

goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> events \<Longrightarrow> (prob {x \<in> space M. P x} = 0) = (AE x in M. \<not> P x)
[PROOF STEP]
by (simp add: emeasure_eq_measure measure_nonneg)


[STATEMENT]
lemma dg_Set_Hom_vsubset_dg_Par_Hom:
  assumes "a \<in>\<^sub>\<circ> dg_Set \<alpha>\<lparr>Obj\<rparr>" "b \<in>\<^sub>\<circ> dg_Set \<alpha>\<lparr>Obj\<rparr>"
  shows "Hom (dg_Set \<alpha>) a b \<subseteq>\<^sub>\<circ> Hom (dg_Par \<alpha>) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hom (dg_Set \<alpha>) a b \<subseteq>\<^sub>\<circ> Hom (dg_Par \<alpha>) a b
[PROOF STEP]
by (rule vsubsetI) (simp add: dg_Set_is_arr_dg_Par_is_arr)


[STATEMENT]
lemma DERIV_power_Suc:
  "(f has_field_derivative D) (at x within s) \<Longrightarrow>
    ((\<lambda>x. f x ^ Suc n) has_field_derivative (1 + of_nat n) * (D * f x ^ n)) (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 ^ Suc n) has_field_derivative ((1::'a) + of_nat n) * (D * f x ^ n)) (at x within s)
[PROOF STEP]
by (rule has_derivative_imp_has_field_derivative[OF has_derivative_power])
     (auto simp: has_field_derivative_def)


[STATEMENT]
lemma mult1E:
  assumes "(N, M) \<in> mult1 r"
  obtains a M0 K where "M = add_mset a M0" "N = M0 + K" "\<And>b. b \<in># K \<Longrightarrow> (b, a) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a M0 K. \<lbrakk>M = add_mset a M0; N = M0 + K; \<And>b. b \<in># K \<Longrightarrow> (b, a) \<in> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(N, M) \<in> mult1 r

goal (1 subgoal):
 1. (\<And>a M0 K. \<lbrakk>M = add_mset a M0; N = M0 + K; \<And>b. b \<in># K \<Longrightarrow> (b, a) \<in> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding mult1_def
[PROOF STATE]
proof (prove)
using this:
(N, M) \<in> {(N, M). \<exists>a M0 K. M = add_mset a M0 \<and> N = M0 + K \<and> (\<forall>b. b \<in># K \<longrightarrow> (b, a) \<in> r)}

goal (1 subgoal):
 1. (\<And>a M0 K. \<lbrakk>M = add_mset a M0; N = M0 + K; \<And>b. b \<in># K \<Longrightarrow> (b, a) \<in> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma finiteDomainImpliesFinite:
  assumes "runiq f"
  shows "finite (Domain f) = finite f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Domain f) = finite f
[PROOF STEP]
using assms Domain_empty_iff card_eq_0_iff finite.emptyI lm076
[PROOF STATE]
proof (prove)
using this:
runiq f
(Domain ?r = {}) = (?r = {})
(card ?A = 0) = (?A = {} \<or> infinite ?A)
finite {}
runiq ?P \<Longrightarrow> card (Domain ?P) = card ?P

goal (1 subgoal):
 1. finite (Domain f) = finite f
[PROOF STEP]
by metis


[STATEMENT]
lemma sum_list_sets_double : "(\<Sum>X\<leftarrow>[A,B]. X) = A + B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>X\<leftarrow>[A, B]. X) = A + B
[PROOF STEP]
using add_0_right[of B]
[PROOF STATE]
proof (prove)
using this:
B + (0::'a) = B

goal (1 subgoal):
 1. (\<Sum>X\<leftarrow>[A, B]. X) = A + B
[PROOF STEP]
by simp


[STATEMENT]
lemma sublist_trans:
  fixes l1 l2
  assumes "subseq l1 l2" "subseq l2 l3"
  shows "subseq l1 l3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subseq l1 l3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subseq l1 l2
subseq l2 l3

goal (1 subgoal):
 1. subseq l1 l3
[PROOF STEP]
by force

\<comment> \<open>NOTE can be solved directly with 'list\_emb\_length'.\<close>